@squidcloud/client 1.0.79 → 1.0.81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  /*! For license information please see index.js.LICENSE.txt */
2
- import*as e from"rxjs";import*as t from"cross-fetch";import*as r from"socket.io-client";var n={8278:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},3910:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0});const o=r(8599);t.default=o.PromisePool,i(r(8278),t),i(r(8599),t),i(r(5607),t),i(r(6784),t),i(r(9446),t),i(r(4204),t)},5607:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PromisePoolError=void 0;class r extends Error{constructor(e,t){super(),this.raw=e,this.item=t,this.name=this.constructor.name,this.message=this.messageFrom(e),Error.captureStackTrace(this,this.constructor)}static createFrom(e,t){return new this(e,t)}messageFrom(e){return e instanceof Error||"object"==typeof e?e.message:"string"==typeof e||"number"==typeof e?e.toString():""}}t.PromisePoolError=r},4027:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PromisePoolExecutor=void 0;const n=r(8599),i=r(5607),o=r(9446),s=r(4204);t.PromisePoolExecutor=class{constructor(){this.meta={tasks:[],items:[],errors:[],results:[],stopped:!1,concurrency:10,shouldResultsCorrespond:!1,processedItems:[],taskTimeout:0},this.handler=()=>{},this.errorHandler=void 0,this.onTaskStartedHandlers=[],this.onTaskFinishedHandlers=[]}useConcurrency(e){if(!this.isValidConcurrency(e))throw s.ValidationError.createFrom(`"concurrency" must be a number, 1 or up. Received "${e}" (${typeof e})`);return this.meta.concurrency=e,this}isValidConcurrency(e){return"number"==typeof e&&e>=1}withTaskTimeout(e){return this.meta.taskTimeout=e,this}concurrency(){return this.meta.concurrency}useCorrespondingResults(e){return this.meta.shouldResultsCorrespond=e,this}shouldUseCorrespondingResults(){return this.meta.shouldResultsCorrespond}taskTimeout(){return this.meta.taskTimeout}for(e){return this.meta.items=e,this}items(){return this.meta.items}itemsCount(){return this.items().length}tasks(){return this.meta.tasks}activeTaskCount(){return this.activeTasksCount()}activeTasksCount(){return this.tasks().length}processedItems(){return this.meta.processedItems}processedCount(){return this.processedItems().length}processedPercentage(){return this.processedCount()/this.itemsCount()*100}results(){return this.meta.results}errors(){return this.meta.errors}withHandler(e){return this.handler=e,this}hasErrorHandler(){return!!this.errorHandler}handleError(e){return this.errorHandler=e,this}onTaskStarted(e){return this.onTaskStartedHandlers=e,this}onTaskFinished(e){return this.onTaskFinishedHandlers=e,this}hasReachedConcurrencyLimit(){return this.activeTasksCount()>=this.concurrency()}stop(){throw this.markAsStopped(),new o.StopThePromisePoolError}markAsStopped(){return this.meta.stopped=!0,this}isStopped(){return this.meta.stopped}async start(){return await this.validateInputs().prepareResultsArray().process()}validateInputs(){if("function"!=typeof this.handler)throw s.ValidationError.createFrom("The first parameter for the .process(fn) method must be a function");const e=this.taskTimeout();if(!(null==e||"number"==typeof e&&e>=0))throw s.ValidationError.createFrom(`"timeout" must be undefined or a number. A number must be 0 or up. Received "${String(e)}" (${typeof e})`);if(!Array.isArray(this.items()))throw s.ValidationError.createFrom(`"items" must be an array. Received "${typeof this.items()}"`);if(this.errorHandler&&"function"!=typeof this.errorHandler)throw s.ValidationError.createFrom(`The error handler must be a function. Received "${typeof this.errorHandler}"`);return this.onTaskStartedHandlers.forEach((e=>{if(e&&"function"!=typeof e)throw s.ValidationError.createFrom(`The onTaskStarted handler must be a function. Received "${typeof e}"`)})),this.onTaskFinishedHandlers.forEach((e=>{if(e&&"function"!=typeof e)throw s.ValidationError.createFrom(`The error handler must be a function. Received "${typeof e}"`)})),this}prepareResultsArray(){return this.shouldUseCorrespondingResults()&&(this.meta.results=Array(this.items().length).fill(n.PromisePool.notRun)),this}async process(){for(const[e,t]of this.items().entries()){if(this.isStopped())break;await this.waitForProcessingSlot(),this.startProcessing(t,e)}return await this.drained()}async waitForProcessingSlot(){for(;this.hasReachedConcurrencyLimit();)await this.waitForActiveTaskToFinish()}async waitForActiveTaskToFinish(){await Promise.race(this.tasks())}startProcessing(e,t){const r=this.createTaskFor(e,t).then((e=>{this.save(e,t).removeActive(r)})).catch((async n=>{await this.handleErrorFor(n,e,t),this.removeActive(r)})).finally((()=>{this.processedItems().push(e),this.runOnTaskFinishedHandlers(e)}));this.tasks().push(r),this.runOnTaskStartedHandlers(e)}async createTaskFor(e,t){return void 0===this.taskTimeout()?this.handler(e,t,this):Promise.race([this.handler(e,t,this),this.createTaskTimeout(e)])}async createTaskTimeout(e){return new Promise(((t,r)=>{setTimeout((()=>{r(new i.PromisePoolError(`Promise in pool timed out after ${this.taskTimeout()}ms`,e))}),this.taskTimeout())}))}save(e,t){return this.shouldUseCorrespondingResults()?this.results()[t]=e:this.results().push(e),this}removeActive(e){return this.tasks().splice(this.tasks().indexOf(e),1),this}async handleErrorFor(e,t,r){if(this.shouldUseCorrespondingResults()&&(this.results()[r]=n.PromisePool.failed),!this.isStoppingThePoolError(e)){if(this.isValidationError(e))throw this.markAsStopped(),e;this.hasErrorHandler()?await this.runErrorHandlerFor(e,t):this.saveErrorFor(e,t)}}isStoppingThePoolError(e){return e instanceof o.StopThePromisePoolError}isValidationError(e){return e instanceof s.ValidationError}async runErrorHandlerFor(e,t){var r;try{await(null===(r=this.errorHandler)||void 0===r?void 0:r.call(this,e,t,this))}catch(e){this.rethrowIfNotStoppingThePool(e)}}runOnTaskStartedHandlers(e){this.onTaskStartedHandlers.forEach((t=>{t(e,this)}))}runOnTaskFinishedHandlers(e){this.onTaskFinishedHandlers.forEach((t=>{t(e,this)}))}rethrowIfNotStoppingThePool(e){if(!this.isStoppingThePoolError(e))throw e}saveErrorFor(e,t){this.errors().push(i.PromisePoolError.createFrom(e,t))}async drained(){return await this.drainActiveTasks(),{errors:this.errors(),results:this.results()}}async drainActiveTasks(){await Promise.all(this.tasks())}}},8599:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PromisePool=void 0;const n=r(4027);class i{constructor(e){this.timeout=void 0,this.concurrency=10,this.shouldResultsCorrespond=!1,this.items=null!=e?e:[],this.errorHandler=void 0,this.onTaskStartedHandlers=[],this.onTaskFinishedHandlers=[]}withConcurrency(e){return this.concurrency=e,this}static withConcurrency(e){return(new this).withConcurrency(e)}withTaskTimeout(e){return this.timeout=e,this}static withTaskTimeout(e){return(new this).withTaskTimeout(e)}for(e){return"number"==typeof this.timeout?new i(e).withConcurrency(this.concurrency).withTaskTimeout(this.timeout):new i(e).withConcurrency(this.concurrency)}static for(e){return(new this).for(e)}handleError(e){return this.errorHandler=e,this}onTaskStarted(e){return this.onTaskStartedHandlers.push(e),this}onTaskFinished(e){return this.onTaskFinishedHandlers.push(e),this}useCorrespondingResults(){return this.shouldResultsCorrespond=!0,this}async process(e){return(new n.PromisePoolExecutor).useConcurrency(this.concurrency).useCorrespondingResults(this.shouldResultsCorrespond).withTaskTimeout(this.timeout).withHandler(e).handleError(this.errorHandler).onTaskStarted(this.onTaskStartedHandlers).onTaskFinished(this.onTaskFinishedHandlers).for(this.items).start()}}t.PromisePool=i,i.notRun=Symbol("notRun"),i.failed=Symbol("failed")},6784:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},9446:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StopThePromisePoolError=void 0;class r extends Error{}t.StopThePromisePoolError=r},4204:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ValidationError=void 0;class r extends Error{constructor(e){super(e),Error.captureStackTrace(this,this.constructor)}static createFrom(e){return new this(e)}}t.ValidationError=r},3747:(e,t)=>{function r(e,t){return{validate:e,compare:t}}Object.defineProperty(t,"__esModule",{value:!0}),t.formatNames=t.fastFormats=t.fullFormats=void 0,t.fullFormats={date:r(o,s),time:r(c,u),"date-time":r((function(e){const t=e.split(l);return 2===t.length&&o(t[0])&&c(t[1],!0)}),f),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(e){return h.test(e)&&d.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:function(e){if(g.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}},uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:function(e){return p.lastIndex=0,p.test(e)},int32:{type:"number",validate:function(e){return Number.isInteger(e)&&e<=y&&e>=m}},int64:{type:"number",validate:function(e){return Number.isInteger(e)}},float:{type:"number",validate:v},double:{type:"number",validate:v},password:!0,binary:!0},t.fastFormats={...t.fullFormats,date:r(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,s),time:r(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u),"date-time":r(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,f),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},t.formatNames=Object.keys(t.fullFormats);const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function o(e){const t=n.exec(e);if(!t)return!1;const r=+t[1],o=+t[2],s=+t[3];return o>=1&&o<=12&&s>=1&&s<=(2===o&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(r)?29:i[o])}function s(e,t){if(e&&t)return e>t?1:e<t?-1:0}const a=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function c(e,t){const r=a.exec(e);if(!r)return!1;const n=+r[1],i=+r[2],o=+r[3],s=r[5];return(n<=23&&i<=59&&o<=59||23===n&&59===i&&60===o)&&(!t||""!==s)}function u(e,t){if(!e||!t)return;const r=a.exec(e),n=a.exec(t);return r&&n?(e=r[1]+r[2]+r[3]+(r[4]||""))>(t=n[1]+n[2]+n[3]+(n[4]||""))?1:e<t?-1:0:void 0}const l=/t|\s/i;function f(e,t){if(!e||!t)return;const[r,n]=e.split(l),[i,o]=t.split(l),a=s(r,i);return void 0!==a?a||u(n,o):void 0}const h=/\/|:/,d=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,p=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm,m=-(2**31),y=2**31-1;function v(){return!0}const g=/[^\\]\\Z/},8414:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(3747),i=r(9262),o=r(5669),s=new o.Name("fullFormats"),a=new o.Name("fastFormats"),c=(e,t={keywords:!0})=>{if(Array.isArray(t))return u(e,t,n.fullFormats,s),e;const[r,o]="fast"===t.mode?[n.fastFormats,a]:[n.fullFormats,s];return u(e,t.formats||n.formatNames,r,o),t.keywords&&i.default(e),e};function u(e,t,r,n){var i,s;null!==(i=(s=e.opts.code).formats)&&void 0!==i||(s.formats=o._`require("ajv-formats/dist/formats").${n}`);for(const n of t)e.addFormat(n,r[n])}c.get=(e,t="full")=>{const r=("fast"===t?n.fastFormats:n.fullFormats)[e];if(!r)throw new Error(`Unknown format "${e}"`);return r},e.exports=t=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c},9262:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;const n=r(6236),i=r(5669),o=i.operators,s={formatMaximum:{okStr:"<=",ok:o.LTE,fail:o.GT},formatMinimum:{okStr:">=",ok:o.GTE,fail:o.LT},formatExclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},formatExclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},a={message:({keyword:e,schemaCode:t})=>i.str`should be ${s[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>i._`{comparison: ${s[e].okStr}, limit: ${t}}`};t.formatLimitDefinition={keyword:Object.keys(s),type:"string",schemaType:"string",$data:!0,error:a,code(e){const{gen:t,data:r,schemaCode:o,keyword:a,it:c}=e,{opts:u,self:l}=c;if(!u.validateFormats)return;const f=new n.KeywordCxt(c,l.RULES.all.format.definition,"format");function h(e){return i._`${e}.compare(${r}, ${o}) ${s[a].fail} 0`}f.$data?function(){const r=t.scopeValue("formats",{ref:l.formats,code:u.code.formats}),n=t.const("fmt",i._`${r}[${f.schemaCode}]`);e.fail$data(i.or(i._`typeof ${n} != "object"`,i._`${n} instanceof RegExp`,i._`typeof ${n}.compare != "function"`,h(n)))}():function(){const r=f.schema,n=l.formats[r];if(!n||!0===n)return;if("object"!=typeof n||n instanceof RegExp||"function"!=typeof n.compare)throw new Error(`"${a}": format "${r}" does not define "compare" function`);const o=t.scopeValue("formats",{key:r,ref:n,code:u.code.formats?i._`${u.code.formats}${i.getProperty(r)}`:void 0});e.fail$data(h(o))}()},dependencies:["format"]},t.default=e=>(e.addKeyword(t.formatLimitDefinition),e)},6236:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const n=r(8355),i=r(5671),o=r(2),s=r(1512),a=["/properties"],c="http://json-schema.org/draft-07/schema";class u extends n.default{_addVocabularies(){super._addVocabularies(),i.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(s,a):s;this.addMetaSchema(e,c,!1),this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}}e.exports=t=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var l=r(1686);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var f=r(5669);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}});var h=r(6448);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return h.default}});var d=r(1578);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return d.default}})},6545:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class r{}t._CodeOrName=r,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends r{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=n;class i extends r{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof n&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function o(e,...t){const r=[e[0]];let n=0;for(;n<t.length;)c(r,t[n]),r.push(e[++n]);return new i(r)}t._Code=i,t.nil=new i(""),t._=o;const s=new i("+");function a(e,...t){const r=[l(e[0])];let n=0;for(;n<t.length;)r.push(s),c(r,t[n]),r.push(s,l(e[++n]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===s){const r=u(e[t-1],e[t+1]);if(void 0!==r){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}(r),new i(r)}function c(e,t){var r;t instanceof i?e.push(...t._items):t instanceof n?e.push(t):e.push("number"==typeof(r=t)||"boolean"==typeof r||null===r?r:l(Array.isArray(r)?r.join(","):r))}function u(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof n||'"'!==e[e.length-1])return;return"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof n?void 0:`"${e}${t.slice(1)}`}function l(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.str=a,t.addCodeArg=c,t.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:a`${e}${t}`},t.stringify=function(e){return new i(l(e))},t.safeStringify=l,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new i(`.${e}`):o`[${e}]`},t.getEsmExportName=function(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new i(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},t.regexpCode=function(e){return new i(e.toString())}},5669:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const n=r(6545),i=r(9187);var o=r(6545);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return o.Name}});var s=r(9187);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),t.operators={GT:new n._Code(">"),GTE:new n._Code(">="),LT:new n._Code("<"),LTE:new n._Code("<="),EQ:new n._Code("==="),NEQ:new n._Code("!=="),NOT:new n._Code("!"),OR:new n._Code("||"),AND:new n._Code("&&"),ADD:new n._Code("+")};class a{optimizeNodes(){return this}optimizeNames(e,t){return this}}class c extends a{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){const r=e?i.varKinds.var:this.varKind,n=void 0===this.rhs?"":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=R(this.rhs,e,t)),this}get names(){return this.rhs instanceof n._CodeOrName?this.rhs.names:{}}}class u extends a{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof n.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=R(this.rhs,e,t),this}get names(){return A(this.lhs instanceof n.Name?{}:{...this.lhs.names},this.rhs)}}class l extends u{constructor(e,t,r,n){super(e,r,n),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class f extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class h extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class d extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class p extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=R(this.code,e,t),this}get names(){return this.code instanceof n._CodeOrName?this.code.names:{}}}class m extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,r)=>t+r.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:r}=this;let n=r.length;for(;n--;){const i=r[n];i.optimizeNames(e,t)||(x(e,i.names),r.splice(n,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>D(e,t.names)),{})}}class y extends m{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class v extends m{}class g extends y{}g.kind="else";class _ extends y{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new g(e):e}return t?!1===e?t instanceof _?t:t.nodes:this.nodes.length?this:new _(P(e),t instanceof _?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null===(r=this.else)||void 0===r?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=R(this.condition,e,t),this}get names(){const e=super.names;return A(e,this.condition),this.else&&D(e,this.else.names),e}}_.kind="if";class b extends y{}b.kind="for";class w extends b{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=R(this.iteration,e,t),this}get names(){return D(super.names,this.iteration.names)}}class E extends b{constructor(e,t,r,n){super(),this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){const t=e.es5?i.varKinds.var:this.varKind,{name:r,from:n,to:o}=this;return`for(${t} ${r}=${n}; ${r}<${o}; ${r}++)`+super.render(e)}get names(){const e=A(super.names,this.from);return A(e,this.to)}}class S extends b{constructor(e,t,r,n){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=R(this.iterable,e,t),this}get names(){return D(super.names,this.iterable.names)}}class O extends y{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}O.kind="func";class I extends m{render(e){return"return "+super.render(e)}}I.kind="return";class T extends y{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),null===(r=this.catch)||void 0===r||r.optimizeNames(e,t),null===(n=this.finally)||void 0===n||n.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&D(e,this.catch.names),this.finally&&D(e,this.finally.names),e}}class k extends y{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}k.kind="catch";class N extends y{render(e){return"finally"+super.render(e)}}function D(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function A(e,t){return t instanceof n._CodeOrName?D(e,t.names):e}function R(e,t,r){return e instanceof n.Name?o(e):(i=e)instanceof n._Code&&i._items.some((e=>e instanceof n.Name&&1===t[e.str]&&void 0!==r[e.str]))?new n._Code(e._items.reduce(((e,t)=>(t instanceof n.Name&&(t=o(t)),t instanceof n._Code?e.push(...t._items):e.push(t),e)),[])):e;var i;function o(e){const n=r[e.str];return void 0===n||1!==t[e.str]?e:(delete t[e.str],n)}}function x(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function P(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:n._`!${M(e)}`}N.kind="finally",t.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new i.Scope({parent:e}),this._nodes=[new v]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){const i=this._scope.toName(t);return void 0!==r&&n&&(this._constants[i.str]=r),this._leafNode(new c(e,i,r)),i}const(e,t,r){return this._def(i.varKinds.const,e,t,r)}let(e,t,r){return this._def(i.varKinds.let,e,t,r)}var(e,t,r){return this._def(i.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new u(e,t,r))}add(e,r){return this._leafNode(new l(e,t.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==n.nil&&this._leafNode(new p(e)),this}object(...e){const t=["{"];for(const[r,i]of e)t.length>1&&t.push(","),t.push(r),(r!==i||this.opts.es5)&&(t.push(":"),(0,n.addCodeArg)(t,i));return t.push("}"),new n._Code(t)}if(e,t,r){if(this._blockNode(new _(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new _(e))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(_,g)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new w(e),t)}forRange(e,t,r,n,o=(this.opts.es5?i.varKinds.var:i.varKinds.let)){const s=this._scope.toName(e);return this._for(new E(o,s,t,r),(()=>n(s)))}forOf(e,t,r,o=i.varKinds.const){const s=this._scope.toName(e);if(this.opts.es5){const e=t instanceof n.Name?t:this.var("_arr",t);return this.forRange("_i",0,n._`${e}.length`,(t=>{this.var(s,n._`${e}[${t}]`),r(s)}))}return this._for(new S("of",o,s,t),(()=>r(s)))}forIn(e,t,r,o=(this.opts.es5?i.varKinds.var:i.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,n._`Object.keys(${t})`,r);const s=this._scope.toName(e);return this._for(new S("in",o,s,t),(()=>r(s)))}endFor(){return this._endBlockNode(b)}label(e){return this._leafNode(new f(e))}break(e){return this._leafNode(new h(e))}return(e){const t=new I;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(I)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const n=new T;if(this._blockNode(n),this.code(e),t){const e=this.name("e");this._currNode=n.catch=new k(e),t(e)}return r&&(this._currNode=n.finally=new N,this.code(r)),this._endBlockNode(k,N)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=n.nil,r,i){return this._blockNode(new O(e,t,r)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(O)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof _))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},t.not=P;const $=j(t.operators.AND);t.and=function(...e){return e.reduce($)};const C=j(t.operators.OR);function j(e){return(t,r)=>t===n.nil?r:r===n.nil?t:n._`${M(t)} ${e} ${M(r)}`}function M(e){return e instanceof n.Name?e:n._`(${e})`}t.or=function(...e){return e.reduce(C)}},9187:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const n=r(6545);class i extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var o;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(o=t.UsedValueState||(t.UsedValueState={})),t.varKinds={const:new n.Name("const"),let:new n.Name("let"),var:new n.Name("var")};class s{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof n.Name?e:this.name(e)}name(e){return new n.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,r;if((null===(r=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===r?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=s;class a extends n.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=n._`.${new n.Name(t)}[${r}]`}}t.ValueScopeName=a;const c=n._`\n`;t.ValueScope=class extends s{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?c:n.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const n=this.toName(e),{prefix:i}=n,o=null!==(r=t.key)&&void 0!==r?r:t.ref;let s=this._values[i];if(s){const e=s.get(o);if(e)return e}else s=this._values[i]=new Map;s.set(o,n);const a=this._scope[i]||(this._scope[i]=[]),c=a.length;return a[c]=t.ref,n.setValue(t,{property:i,itemIndex:c}),n}getValue(e,t){const r=this._values[e];if(r)return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(t=>{if(void 0===t.scopePath)throw new Error(`CodeGen: name "${t}" has no value`);return n._`${e}${t.scopePath}`}))}scopeCode(e=this._values,t,r){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,r)}_reduceValues(e,r,s={},a){let c=n.nil;for(const u in e){const l=e[u];if(!l)continue;const f=s[u]=s[u]||new Map;l.forEach((e=>{if(f.has(e))return;f.set(e,o.Started);let s=r(e);if(s){const r=this.opts.es5?t.varKinds.var:t.varKinds.const;c=n._`${c}${r} ${e} = ${s};${this.opts._n}`}else{if(!(s=null==a?void 0:a(e)))throw new i(e);c=n._`${c}${s}${this.opts._n}`}f.set(e,o.Completed)}))}return c}}},6930:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const n=r(5669),i=r(8936),o=r(7250);function s(e,t){const r=e.const("err",t);e.if(n._`${o.default.vErrors} === null`,(()=>e.assign(o.default.vErrors,n._`[${r}]`)),n._`${o.default.vErrors}.push(${r})`),e.code(n._`${o.default.errors}++`)}function a(e,t){const{gen:r,validateName:i,schemaEnv:o}=e;o.$async?r.throw(n._`new ${e.ValidationError}(${t})`):(r.assign(n._`${i}.errors`,t),r.return(!1))}t.keywordError={message:({keyword:e})=>n.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?n.str`"${e}" keyword must be ${t} ($data)`:n.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,r=t.keywordError,i,o){const{it:c}=e,{gen:l,compositeRule:f,allErrors:h}=c,d=u(e,r,i);(null!=o?o:f||h)?s(l,d):a(c,n._`[${d}]`)},t.reportExtraError=function(e,r=t.keywordError,n){const{it:i}=e,{gen:c,compositeRule:l,allErrors:f}=i;s(c,u(e,r,n)),l||f||a(i,o.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(o.default.errors,t),e.if(n._`${o.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign(n._`${o.default.vErrors}.length`,t)),(()=>e.assign(o.default.vErrors,null)))))},t.extendErrors=function({gen:e,keyword:t,schemaValue:r,data:i,errsCount:s,it:a}){if(void 0===s)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",s,o.default.errors,(s=>{e.const(c,n._`${o.default.vErrors}[${s}]`),e.if(n._`${c}.instancePath === undefined`,(()=>e.assign(n._`${c}.instancePath`,(0,n.strConcat)(o.default.instancePath,a.errorPath)))),e.assign(n._`${c}.schemaPath`,n.str`${a.errSchemaPath}/${t}`),a.opts.verbose&&(e.assign(n._`${c}.schema`,r),e.assign(n._`${c}.data`,i))}))};const c={keyword:new n.Name("keyword"),schemaPath:new n.Name("schemaPath"),params:new n.Name("params"),propertyName:new n.Name("propertyName"),message:new n.Name("message"),schema:new n.Name("schema"),parentSchema:new n.Name("parentSchema")};function u(e,t,r){const{createErrors:i}=e.it;return!1===i?n._`{}`:function(e,t,r={}){const{gen:i,it:s}=e,a=[l(s,r),f(e,r)];return function(e,{params:t,message:r},i){const{keyword:s,data:a,schemaValue:u,it:l}=e,{opts:f,propertyName:h,topSchemaRef:d,schemaPath:p}=l;i.push([c.keyword,s],[c.params,"function"==typeof t?t(e):t||n._`{}`]),f.messages&&i.push([c.message,"function"==typeof r?r(e):r]),f.verbose&&i.push([c.schema,u],[c.parentSchema,n._`${d}${p}`],[o.default.data,a]),h&&i.push([c.propertyName,h])}(e,t,a),i.object(...a)}(e,t,r)}function l({errorPath:e},{instancePath:t}){const r=t?n.str`${e}${(0,i.getErrorPath)(t,i.Type.Str)}`:e;return[o.default.instancePath,(0,n.strConcat)(o.default.instancePath,r)]}function f({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:o}){let s=o?t:n.str`${t}/${e}`;return r&&(s=n.str`${s}${(0,i.getErrorPath)(r,i.Type.Str)}`),[c.schemaPath,s]}},7382:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const n=r(5669),i=r(6448),o=r(7250),s=r(6696),a=r(8936),c=r(1686);class u{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,s.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function l(e){const t=h.call(this,e);if(t)return t;const r=(0,s.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:a,lines:u}=this.opts.code,{ownProperties:l}=this.opts,f=new n.CodeGen(this.scope,{es5:a,lines:u,ownProperties:l});let d;e.$async&&(d=f.scopeValue("Error",{ref:i.default,code:n._`require("ajv/dist/runtime/validation_error").default`}));const p=f.scopeName("validate");e.validateName=p;const m={gen:f,allErrors:this.opts.allErrors,data:o.default.data,parentData:o.default.parentData,parentDataProperty:o.default.parentDataProperty,dataNames:[o.default.data],dataPathArr:[n.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,n.stringify)(e.schema)}:{ref:e.schema}),validateName:p,ValidationError:d,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:n.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:n._`""`,opts:this.opts,self:this};let y;try{this._compilations.add(e),(0,c.validateFunctionCode)(m),f.optimize(this.opts.code.optimize);const t=f.toString();y=`${f.scopeRefs(o.default.scope)}return ${t}`,this.opts.code.process&&(y=this.opts.code.process(y,e));const r=new Function(`${o.default.self}`,`${o.default.scope}`,y)(this,this.scope.get());if(this.scope.value(p,{ref:r}),r.errors=null,r.schema=e.schema,r.schemaEnv=e,e.$async&&(r.$async=!0),!0===this.opts.code.source&&(r.source={validateName:p,validateCode:t,scopeValues:f._values}),this.opts.unevaluated){const{props:e,items:t}=m;r.evaluated={props:e instanceof n.Name?void 0:e,items:t instanceof n.Name?void 0:t,dynamicProps:e instanceof n.Name,dynamicItems:t instanceof n.Name},r.source&&(r.source.evaluated=(0,n.stringify)(r.evaluated))}return e.validate=r,e}catch(t){throw delete e.validate,delete e.validateName,y&&this.logger.error("Error compiling schema, function code:",y),t}finally{this._compilations.delete(e)}}function f(e){return(0,s.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:l.call(this,e)}function h(e){for(const n of this._compilations)if(r=e,(t=n).schema===r.schema&&t.root===r.root&&t.baseId===r.baseId)return n;var t,r}function d(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||p.call(this,e,t)}function p(e,t){const r=this.opts.uriResolver.parse(t),n=(0,s._getFullPath)(this.opts.uriResolver,r);let i=(0,s.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===i)return y.call(this,r,e);const o=(0,s.normalizeId)(n),a=this.refs[o]||this.schemas[o];if("string"==typeof a){const t=p.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return y.call(this,r,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||l.call(this,a),o===(0,s.normalizeId)(t)){const{schema:t}=a,{schemaId:r}=this.opts,n=t[r];return n&&(i=(0,s.resolveUrl)(this.opts.uriResolver,i,n)),new u({schema:t,schemaId:r,root:e,baseId:i})}return y.call(this,r,a)}}t.SchemaEnv=u,t.compileSchema=l,t.resolveRef=function(e,t,r){var n;r=(0,s.resolveUrl)(this.opts.uriResolver,t,r);const i=e.refs[r];if(i)return i;let o=d.call(this,e,r);if(void 0===o){const i=null===(n=e.localRefs)||void 0===n?void 0:n[r],{schemaId:s}=this.opts;i&&(o=new u({schema:i,schemaId:s,root:e,baseId:t}))}return void 0!==o?e.refs[r]=f.call(this,o):void 0},t.getCompilingSchema=h,t.resolveSchema=p;const m=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function y(e,{baseId:t,schema:r,root:n}){var i;if("/"!==(null===(i=e.fragment)||void 0===i?void 0:i[0]))return;for(const n of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;const e=r[(0,a.unescapeFragment)(n)];if(void 0===e)return;const i="object"==typeof(r=e)&&r[this.opts.schemaId];!m.has(n)&&i&&(t=(0,s.resolveUrl)(this.opts.uriResolver,t,i))}let o;if("boolean"!=typeof r&&r.$ref&&!(0,a.schemaHasRulesButRef)(r,this.RULES)){const e=(0,s.resolveUrl)(this.opts.uriResolver,t,r.$ref);o=p.call(this,n,e)}const{schemaId:c}=this.opts;return o=o||new u({schema:r,schemaId:c,root:n,baseId:t}),o.schema!==o.root.schema?o:void 0}},7250:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(5669),i={data:new n.Name("data"),valCxt:new n.Name("valCxt"),instancePath:new n.Name("instancePath"),parentData:new n.Name("parentData"),parentDataProperty:new n.Name("parentDataProperty"),rootData:new n.Name("rootData"),dynamicAnchors:new n.Name("dynamicAnchors"),vErrors:new n.Name("vErrors"),errors:new n.Name("errors"),this:new n.Name("this"),self:new n.Name("self"),scope:new n.Name("scope"),json:new n.Name("json"),jsonPos:new n.Name("jsonPos"),jsonLen:new n.Name("jsonLen"),jsonPart:new n.Name("jsonPart")};t.default=i},1578:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(6696);class i extends Error{constructor(e,t,r,i){super(i||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,n.resolveUrl)(e,t,r),this.missingSchema=(0,n.normalizeId)((0,n.getFullPath)(e,this.missingRef))}}t.default=i},6696:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const n=r(8936),i=r(6471),o=r(2943),s=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!c(e):!!t&&u(e)<=t)};const a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function c(e){for(const t in e){if(a.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(c))return!0;if("object"==typeof r&&c(r))return!0}return!1}function u(e){let t=0;for(const r in e){if("$ref"===r)return 1/0;if(t++,!s.has(r)&&("object"==typeof e[r]&&(0,n.eachItem)(e[r],(e=>t+=u(e))),t===1/0))return 1/0}return t}function l(e,t="",r){!1!==r&&(t=d(t));const n=e.parse(t);return f(e,n)}function f(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=l,t._getFullPath=f;const h=/#\/?$/;function d(e){return e?e.replace(h,""):""}t.normalizeId=d,t.resolveUrl=function(e,t,r){return r=d(r),e.resolve(t,r)};const p=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:r,uriResolver:n}=this.opts,s=d(e[r]||t),a={"":s},c=l(n,s,!1),u={},f=new Set;return o(e,{allKeys:!0},((e,t,n,i)=>{if(void 0===i)return;const o=c+t;let s=a[i];function l(t){const r=this.opts.uriResolver.resolve;if(t=d(s?r(s,t):t),f.has(t))throw m(t);f.add(t);let n=this.refs[t];return"string"==typeof n&&(n=this.refs[n]),"object"==typeof n?h(e,n.schema,t):t!==d(o)&&("#"===t[0]?(h(e,u[t],t),u[t]=e):this.refs[t]=o),t}function y(e){if("string"==typeof e){if(!p.test(e))throw new Error(`invalid anchor "${e}"`);l.call(this,`#${e}`)}}"string"==typeof e[r]&&(s=l.call(this,e[r])),y.call(this,e.$anchor),y.call(this,e.$dynamicAnchor),a[t]=s})),u;function h(e,t,r){if(void 0!==t&&!i(e,t))throw m(r)}function m(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},2881:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;const r=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&r.has(e)},t.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},8936:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const n=r(5669),i=r(6545);function o(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema)return;if("boolean"==typeof t)return;const i=n.RULES.keywords;for(const r in t)i[r]||p(e,`unknown keyword: "${r}"`)}function s(e,t){if("boolean"==typeof e)return!e;for(const r in e)if(t[r])return!0;return!1}function a(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function c(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function u({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:i}){return(o,s,a,c)=>{const u=void 0===a?s:a instanceof n.Name?(s instanceof n.Name?e(o,s,a):t(o,s,a),a):s instanceof n.Name?(t(o,a,s),s):r(s,a);return c!==n.Name||u instanceof n.Name?u:i(o,u)}}function l(e,t){if(!0===t)return e.var("props",!0);const r=e.var("props",n._`{}`);return void 0!==t&&f(e,r,t),r}function f(e,t,r){Object.keys(r).forEach((r=>e.assign(n._`${t}${(0,n.getProperty)(r)}`,!0)))}t.toHash=function(e){const t={};for(const r of e)t[r]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(o(e,t),!s(t,e.self.RULES.all))},t.checkUnknownRules=o,t.schemaHasRules=s,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const r in e)if("$ref"!==r&&t.all[r])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},r,i,o){if(!o){if("number"==typeof r||"boolean"==typeof r)return r;if("string"==typeof r)return n._`${r}`}return n._`${e}${t}${(0,n.getProperty)(i)}`},t.unescapeFragment=function(e){return c(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(a(e))},t.escapeJsonPointer=a,t.unescapeJsonPointer=c,t.eachItem=function(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)},t.mergeEvaluated={props:u({mergeNames:(e,t,r)=>e.if(n._`${r} !== true && ${t} !== undefined`,(()=>{e.if(n._`${t} === true`,(()=>e.assign(r,!0)),(()=>e.assign(r,n._`${r} || {}`).code(n._`Object.assign(${r}, ${t})`)))})),mergeToName:(e,t,r)=>e.if(n._`${r} !== true`,(()=>{!0===t?e.assign(r,!0):(e.assign(r,n._`${r} || {}`),f(e,r,t))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:l}),items:u({mergeNames:(e,t,r)=>e.if(n._`${r} !== true && ${t} !== undefined`,(()=>e.assign(r,n._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`))),mergeToName:(e,t,r)=>e.if(n._`${r} !== true`,(()=>e.assign(r,!0===t||n._`${r} > ${t} ? ${r} : ${t}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=l,t.setEvaluated=f;const h={};var d;function p(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw new Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:h[t.code]||(h[t.code]=new i._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(d=t.Type||(t.Type={})),t.getErrorPath=function(e,t,r){if(e instanceof n.Name){const i=t===d.Num;return r?i?n._`"[" + ${e} + "]"`:n._`"['" + ${e} + "']"`:i?n._`"/" + ${e}`:n._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,n.getProperty)(e).toString():"/"+a(e)},t.checkStrictMode=p},9073:(e,t)=>{function r(e,t){return t.rules.some((t=>n(e,t)))}function n(e,t){var r;return void 0!==e[t.keyword]||(null===(r=t.definition.implements)||void 0===r?void 0:r.some((t=>void 0!==e[t])))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},n){const i=t.RULES.types[n];return i&&!0!==i&&r(e,i)},t.shouldUseGroup=r,t.shouldUseRule=n},2171:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const n=r(6930),i=r(5669),o=r(7250),s={message:"boolean schema is false"};function a(e,t){const{gen:r,data:i}=e,o={gen:r,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,n.reportError)(o,s,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:r,validateName:n}=e;!1===r?a(e,!1):"object"==typeof r&&!0===r.$async?t.return(o.default.data):(t.assign(i._`${n}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:r,schema:n}=e;!1===n?(r.var(t,!1),a(e)):r.var(t,!0)}},7332:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const n=r(2881),i=r(9073),o=r(6930),s=r(5669),a=r(8936);var c;function u(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(n.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(c=t.DataType||(t.DataType={})),t.getSchemaTypes=function(e){const t=u(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},t.getJSONTypes=u,t.coerceAndCheckDataType=function(e,t){const{gen:r,data:n,opts:o}=e,a=function(e,t){return t?e.filter((e=>l.has(e)||"array"===t&&"array"===e)):[]}(t,o.coerceTypes),u=t.length>0&&!(0===a.length&&1===t.length&&(0,i.schemaHasRulesForType)(e,t[0]));if(u){const i=h(t,n,o.strictNumbers,c.Wrong);r.if(i,(()=>{a.length?function(e,t,r){const{gen:n,data:i,opts:o}=e,a=n.let("dataType",s._`typeof ${i}`),c=n.let("coerced",s._`undefined`);"array"===o.coerceTypes&&n.if(s._`${a} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,(()=>n.assign(i,s._`${i}[0]`).assign(a,s._`typeof ${i}`).if(h(t,i,o.strictNumbers),(()=>n.assign(c,i))))),n.if(s._`${c} !== undefined`);for(const e of r)(l.has(e)||"array"===e&&"array"===o.coerceTypes)&&u(e);function u(e){switch(e){case"string":return void n.elseIf(s._`${a} == "number" || ${a} == "boolean"`).assign(c,s._`"" + ${i}`).elseIf(s._`${i} === null`).assign(c,s._`""`);case"number":return void n.elseIf(s._`${a} == "boolean" || ${i} === null
2
+ import*as e from"rxjs";import*as t from"cross-fetch";import*as r from"socket.io-client";var n={8278:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},3910:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0});const o=r(8599);t.default=o.PromisePool,i(r(8278),t),i(r(8599),t),i(r(5607),t),i(r(6784),t),i(r(9446),t),i(r(4204),t)},5607:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PromisePoolError=void 0;class r extends Error{constructor(e,t){super(),this.raw=e,this.item=t,this.name=this.constructor.name,this.message=this.messageFrom(e),Error.captureStackTrace(this,this.constructor)}static createFrom(e,t){return new this(e,t)}messageFrom(e){return e instanceof Error||"object"==typeof e?e.message:"string"==typeof e||"number"==typeof e?e.toString():""}}t.PromisePoolError=r},4027:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PromisePoolExecutor=void 0;const n=r(8599),i=r(5607),o=r(9446),s=r(4204);t.PromisePoolExecutor=class{constructor(){this.meta={tasks:[],items:[],errors:[],results:[],stopped:!1,concurrency:10,shouldResultsCorrespond:!1,processedItems:[],taskTimeout:0},this.handler=()=>{},this.errorHandler=void 0,this.onTaskStartedHandlers=[],this.onTaskFinishedHandlers=[]}useConcurrency(e){if(!this.isValidConcurrency(e))throw s.ValidationError.createFrom(`"concurrency" must be a number, 1 or up. Received "${e}" (${typeof e})`);return this.meta.concurrency=e,this}isValidConcurrency(e){return"number"==typeof e&&e>=1}withTaskTimeout(e){return this.meta.taskTimeout=e,this}concurrency(){return this.meta.concurrency}useCorrespondingResults(e){return this.meta.shouldResultsCorrespond=e,this}shouldUseCorrespondingResults(){return this.meta.shouldResultsCorrespond}taskTimeout(){return this.meta.taskTimeout}for(e){return this.meta.items=e,this}items(){return this.meta.items}itemsCount(){return this.items().length}tasks(){return this.meta.tasks}activeTaskCount(){return this.activeTasksCount()}activeTasksCount(){return this.tasks().length}processedItems(){return this.meta.processedItems}processedCount(){return this.processedItems().length}processedPercentage(){return this.processedCount()/this.itemsCount()*100}results(){return this.meta.results}errors(){return this.meta.errors}withHandler(e){return this.handler=e,this}hasErrorHandler(){return!!this.errorHandler}handleError(e){return this.errorHandler=e,this}onTaskStarted(e){return this.onTaskStartedHandlers=e,this}onTaskFinished(e){return this.onTaskFinishedHandlers=e,this}hasReachedConcurrencyLimit(){return this.activeTasksCount()>=this.concurrency()}stop(){throw this.markAsStopped(),new o.StopThePromisePoolError}markAsStopped(){return this.meta.stopped=!0,this}isStopped(){return this.meta.stopped}async start(){return await this.validateInputs().prepareResultsArray().process()}validateInputs(){if("function"!=typeof this.handler)throw s.ValidationError.createFrom("The first parameter for the .process(fn) method must be a function");const e=this.taskTimeout();if(!(null==e||"number"==typeof e&&e>=0))throw s.ValidationError.createFrom(`"timeout" must be undefined or a number. A number must be 0 or up. Received "${String(e)}" (${typeof e})`);if(!Array.isArray(this.items()))throw s.ValidationError.createFrom(`"items" must be an array. Received "${typeof this.items()}"`);if(this.errorHandler&&"function"!=typeof this.errorHandler)throw s.ValidationError.createFrom(`The error handler must be a function. Received "${typeof this.errorHandler}"`);return this.onTaskStartedHandlers.forEach((e=>{if(e&&"function"!=typeof e)throw s.ValidationError.createFrom(`The onTaskStarted handler must be a function. Received "${typeof e}"`)})),this.onTaskFinishedHandlers.forEach((e=>{if(e&&"function"!=typeof e)throw s.ValidationError.createFrom(`The error handler must be a function. Received "${typeof e}"`)})),this}prepareResultsArray(){return this.shouldUseCorrespondingResults()&&(this.meta.results=Array(this.items().length).fill(n.PromisePool.notRun)),this}async process(){for(const[e,t]of this.items().entries()){if(this.isStopped())break;await this.waitForProcessingSlot(),this.startProcessing(t,e)}return await this.drained()}async waitForProcessingSlot(){for(;this.hasReachedConcurrencyLimit();)await this.waitForActiveTaskToFinish()}async waitForActiveTaskToFinish(){await Promise.race(this.tasks())}startProcessing(e,t){const r=this.createTaskFor(e,t).then((e=>{this.save(e,t).removeActive(r)})).catch((async n=>{await this.handleErrorFor(n,e,t),this.removeActive(r)})).finally((()=>{this.processedItems().push(e),this.runOnTaskFinishedHandlers(e)}));this.tasks().push(r),this.runOnTaskStartedHandlers(e)}async createTaskFor(e,t){return void 0===this.taskTimeout()?this.handler(e,t,this):Promise.race([this.handler(e,t,this),this.createTaskTimeout(e)])}async createTaskTimeout(e){return new Promise(((t,r)=>{setTimeout((()=>{r(new i.PromisePoolError(`Promise in pool timed out after ${this.taskTimeout()}ms`,e))}),this.taskTimeout())}))}save(e,t){return this.shouldUseCorrespondingResults()?this.results()[t]=e:this.results().push(e),this}removeActive(e){return this.tasks().splice(this.tasks().indexOf(e),1),this}async handleErrorFor(e,t,r){if(this.shouldUseCorrespondingResults()&&(this.results()[r]=n.PromisePool.failed),!this.isStoppingThePoolError(e)){if(this.isValidationError(e))throw this.markAsStopped(),e;this.hasErrorHandler()?await this.runErrorHandlerFor(e,t):this.saveErrorFor(e,t)}}isStoppingThePoolError(e){return e instanceof o.StopThePromisePoolError}isValidationError(e){return e instanceof s.ValidationError}async runErrorHandlerFor(e,t){var r;try{await(null===(r=this.errorHandler)||void 0===r?void 0:r.call(this,e,t,this))}catch(e){this.rethrowIfNotStoppingThePool(e)}}runOnTaskStartedHandlers(e){this.onTaskStartedHandlers.forEach((t=>{t(e,this)}))}runOnTaskFinishedHandlers(e){this.onTaskFinishedHandlers.forEach((t=>{t(e,this)}))}rethrowIfNotStoppingThePool(e){if(!this.isStoppingThePoolError(e))throw e}saveErrorFor(e,t){this.errors().push(i.PromisePoolError.createFrom(e,t))}async drained(){return await this.drainActiveTasks(),{errors:this.errors(),results:this.results()}}async drainActiveTasks(){await Promise.all(this.tasks())}}},8599:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PromisePool=void 0;const n=r(4027);class i{constructor(e){this.timeout=void 0,this.concurrency=10,this.shouldResultsCorrespond=!1,this.items=null!=e?e:[],this.errorHandler=void 0,this.onTaskStartedHandlers=[],this.onTaskFinishedHandlers=[]}withConcurrency(e){return this.concurrency=e,this}static withConcurrency(e){return(new this).withConcurrency(e)}withTaskTimeout(e){return this.timeout=e,this}static withTaskTimeout(e){return(new this).withTaskTimeout(e)}for(e){return"number"==typeof this.timeout?new i(e).withConcurrency(this.concurrency).withTaskTimeout(this.timeout):new i(e).withConcurrency(this.concurrency)}static for(e){return(new this).for(e)}handleError(e){return this.errorHandler=e,this}onTaskStarted(e){return this.onTaskStartedHandlers.push(e),this}onTaskFinished(e){return this.onTaskFinishedHandlers.push(e),this}useCorrespondingResults(){return this.shouldResultsCorrespond=!0,this}async process(e){return(new n.PromisePoolExecutor).useConcurrency(this.concurrency).useCorrespondingResults(this.shouldResultsCorrespond).withTaskTimeout(this.timeout).withHandler(e).handleError(this.errorHandler).onTaskStarted(this.onTaskStartedHandlers).onTaskFinished(this.onTaskFinishedHandlers).for(this.items).start()}}t.PromisePool=i,i.notRun=Symbol("notRun"),i.failed=Symbol("failed")},6784:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},9446:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StopThePromisePoolError=void 0;class r extends Error{}t.StopThePromisePoolError=r},4204:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ValidationError=void 0;class r extends Error{constructor(e){super(e),Error.captureStackTrace(this,this.constructor)}static createFrom(e){return new this(e)}}t.ValidationError=r},3747:(e,t)=>{function r(e,t){return{validate:e,compare:t}}Object.defineProperty(t,"__esModule",{value:!0}),t.formatNames=t.fastFormats=t.fullFormats=void 0,t.fullFormats={date:r(o,s),time:r(c,u),"date-time":r((function(e){const t=e.split(l);return 2===t.length&&o(t[0])&&c(t[1],!0)}),f),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(e){return h.test(e)&&d.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:function(e){if(g.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}},uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:function(e){return p.lastIndex=0,p.test(e)},int32:{type:"number",validate:function(e){return Number.isInteger(e)&&e<=y&&e>=m}},int64:{type:"number",validate:function(e){return Number.isInteger(e)}},float:{type:"number",validate:v},double:{type:"number",validate:v},password:!0,binary:!0},t.fastFormats={...t.fullFormats,date:r(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,s),time:r(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u),"date-time":r(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,f),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},t.formatNames=Object.keys(t.fullFormats);const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function o(e){const t=n.exec(e);if(!t)return!1;const r=+t[1],o=+t[2],s=+t[3];return o>=1&&o<=12&&s>=1&&s<=(2===o&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(r)?29:i[o])}function s(e,t){if(e&&t)return e>t?1:e<t?-1:0}const a=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function c(e,t){const r=a.exec(e);if(!r)return!1;const n=+r[1],i=+r[2],o=+r[3],s=r[5];return(n<=23&&i<=59&&o<=59||23===n&&59===i&&60===o)&&(!t||""!==s)}function u(e,t){if(!e||!t)return;const r=a.exec(e),n=a.exec(t);return r&&n?(e=r[1]+r[2]+r[3]+(r[4]||""))>(t=n[1]+n[2]+n[3]+(n[4]||""))?1:e<t?-1:0:void 0}const l=/t|\s/i;function f(e,t){if(!e||!t)return;const[r,n]=e.split(l),[i,o]=t.split(l),a=s(r,i);return void 0!==a?a||u(n,o):void 0}const h=/\/|:/,d=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,p=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm,m=-(2**31),y=2**31-1;function v(){return!0}const g=/[^\\]\\Z/},8414:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(3747),i=r(9262),o=r(5669),s=new o.Name("fullFormats"),a=new o.Name("fastFormats"),c=(e,t={keywords:!0})=>{if(Array.isArray(t))return u(e,t,n.fullFormats,s),e;const[r,o]="fast"===t.mode?[n.fastFormats,a]:[n.fullFormats,s];return u(e,t.formats||n.formatNames,r,o),t.keywords&&i.default(e),e};function u(e,t,r,n){var i,s;null!==(i=(s=e.opts.code).formats)&&void 0!==i||(s.formats=o._`require("ajv-formats/dist/formats").${n}`);for(const n of t)e.addFormat(n,r[n])}c.get=(e,t="full")=>{const r=("fast"===t?n.fastFormats:n.fullFormats)[e];if(!r)throw new Error(`Unknown format "${e}"`);return r},e.exports=t=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c},9262:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;const n=r(6236),i=r(5669),o=i.operators,s={formatMaximum:{okStr:"<=",ok:o.LTE,fail:o.GT},formatMinimum:{okStr:">=",ok:o.GTE,fail:o.LT},formatExclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},formatExclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},a={message:({keyword:e,schemaCode:t})=>i.str`should be ${s[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>i._`{comparison: ${s[e].okStr}, limit: ${t}}`};t.formatLimitDefinition={keyword:Object.keys(s),type:"string",schemaType:"string",$data:!0,error:a,code(e){const{gen:t,data:r,schemaCode:o,keyword:a,it:c}=e,{opts:u,self:l}=c;if(!u.validateFormats)return;const f=new n.KeywordCxt(c,l.RULES.all.format.definition,"format");function h(e){return i._`${e}.compare(${r}, ${o}) ${s[a].fail} 0`}f.$data?function(){const r=t.scopeValue("formats",{ref:l.formats,code:u.code.formats}),n=t.const("fmt",i._`${r}[${f.schemaCode}]`);e.fail$data(i.or(i._`typeof ${n} != "object"`,i._`${n} instanceof RegExp`,i._`typeof ${n}.compare != "function"`,h(n)))}():function(){const r=f.schema,n=l.formats[r];if(!n||!0===n)return;if("object"!=typeof n||n instanceof RegExp||"function"!=typeof n.compare)throw new Error(`"${a}": format "${r}" does not define "compare" function`);const o=t.scopeValue("formats",{key:r,ref:n,code:u.code.formats?i._`${u.code.formats}${i.getProperty(r)}`:void 0});e.fail$data(h(o))}()},dependencies:["format"]},t.default=e=>(e.addKeyword(t.formatLimitDefinition),e)},6236:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const n=r(8355),i=r(5671),o=r(2),s=r(1512),a=["/properties"],c="http://json-schema.org/draft-07/schema";class u extends n.default{_addVocabularies(){super._addVocabularies(),i.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(s,a):s;this.addMetaSchema(e,c,!1),this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}}e.exports=t=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var l=r(1686);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var f=r(5669);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}});var h=r(6448);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return h.default}});var d=r(1578);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return d.default}})},6545:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class r{}t._CodeOrName=r,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends r{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=n;class i extends r{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof n&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function o(e,...t){const r=[e[0]];let n=0;for(;n<t.length;)c(r,t[n]),r.push(e[++n]);return new i(r)}t._Code=i,t.nil=new i(""),t._=o;const s=new i("+");function a(e,...t){const r=[l(e[0])];let n=0;for(;n<t.length;)r.push(s),c(r,t[n]),r.push(s,l(e[++n]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===s){const r=u(e[t-1],e[t+1]);if(void 0!==r){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}(r),new i(r)}function c(e,t){var r;t instanceof i?e.push(...t._items):t instanceof n?e.push(t):e.push("number"==typeof(r=t)||"boolean"==typeof r||null===r?r:l(Array.isArray(r)?r.join(","):r))}function u(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof n||'"'!==e[e.length-1])return;return"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof n?void 0:`"${e}${t.slice(1)}`}function l(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.str=a,t.addCodeArg=c,t.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:a`${e}${t}`},t.stringify=function(e){return new i(l(e))},t.safeStringify=l,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new i(`.${e}`):o`[${e}]`},t.getEsmExportName=function(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new i(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},t.regexpCode=function(e){return new i(e.toString())}},5669:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const n=r(6545),i=r(9187);var o=r(6545);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return o.Name}});var s=r(9187);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),t.operators={GT:new n._Code(">"),GTE:new n._Code(">="),LT:new n._Code("<"),LTE:new n._Code("<="),EQ:new n._Code("==="),NEQ:new n._Code("!=="),NOT:new n._Code("!"),OR:new n._Code("||"),AND:new n._Code("&&"),ADD:new n._Code("+")};class a{optimizeNodes(){return this}optimizeNames(e,t){return this}}class c extends a{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){const r=e?i.varKinds.var:this.varKind,n=void 0===this.rhs?"":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=R(this.rhs,e,t)),this}get names(){return this.rhs instanceof n._CodeOrName?this.rhs.names:{}}}class u extends a{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof n.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=R(this.rhs,e,t),this}get names(){return A(this.lhs instanceof n.Name?{}:{...this.lhs.names},this.rhs)}}class l extends u{constructor(e,t,r,n){super(e,r,n),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class f extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class h extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class d extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class p extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=R(this.code,e,t),this}get names(){return this.code instanceof n._CodeOrName?this.code.names:{}}}class m extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,r)=>t+r.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:r}=this;let n=r.length;for(;n--;){const i=r[n];i.optimizeNames(e,t)||(x(e,i.names),r.splice(n,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>D(e,t.names)),{})}}class y extends m{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class v extends m{}class g extends y{}g.kind="else";class _ extends y{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new g(e):e}return t?!1===e?t instanceof _?t:t.nodes:this.nodes.length?this:new _(P(e),t instanceof _?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null===(r=this.else)||void 0===r?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=R(this.condition,e,t),this}get names(){const e=super.names;return A(e,this.condition),this.else&&D(e,this.else.names),e}}_.kind="if";class b extends y{}b.kind="for";class w extends b{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=R(this.iteration,e,t),this}get names(){return D(super.names,this.iteration.names)}}class E extends b{constructor(e,t,r,n){super(),this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){const t=e.es5?i.varKinds.var:this.varKind,{name:r,from:n,to:o}=this;return`for(${t} ${r}=${n}; ${r}<${o}; ${r}++)`+super.render(e)}get names(){const e=A(super.names,this.from);return A(e,this.to)}}class S extends b{constructor(e,t,r,n){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=R(this.iterable,e,t),this}get names(){return D(super.names,this.iterable.names)}}class O extends y{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}O.kind="func";class T extends m{render(e){return"return "+super.render(e)}}T.kind="return";class I extends y{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),null===(r=this.catch)||void 0===r||r.optimizeNames(e,t),null===(n=this.finally)||void 0===n||n.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&D(e,this.catch.names),this.finally&&D(e,this.finally.names),e}}class k extends y{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}k.kind="catch";class N extends y{render(e){return"finally"+super.render(e)}}function D(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function A(e,t){return t instanceof n._CodeOrName?D(e,t.names):e}function R(e,t,r){return e instanceof n.Name?o(e):(i=e)instanceof n._Code&&i._items.some((e=>e instanceof n.Name&&1===t[e.str]&&void 0!==r[e.str]))?new n._Code(e._items.reduce(((e,t)=>(t instanceof n.Name&&(t=o(t)),t instanceof n._Code?e.push(...t._items):e.push(t),e)),[])):e;var i;function o(e){const n=r[e.str];return void 0===n||1!==t[e.str]?e:(delete t[e.str],n)}}function x(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function P(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:n._`!${M(e)}`}N.kind="finally",t.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new i.Scope({parent:e}),this._nodes=[new v]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){const i=this._scope.toName(t);return void 0!==r&&n&&(this._constants[i.str]=r),this._leafNode(new c(e,i,r)),i}const(e,t,r){return this._def(i.varKinds.const,e,t,r)}let(e,t,r){return this._def(i.varKinds.let,e,t,r)}var(e,t,r){return this._def(i.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new u(e,t,r))}add(e,r){return this._leafNode(new l(e,t.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==n.nil&&this._leafNode(new p(e)),this}object(...e){const t=["{"];for(const[r,i]of e)t.length>1&&t.push(","),t.push(r),(r!==i||this.opts.es5)&&(t.push(":"),(0,n.addCodeArg)(t,i));return t.push("}"),new n._Code(t)}if(e,t,r){if(this._blockNode(new _(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new _(e))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(_,g)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new w(e),t)}forRange(e,t,r,n,o=(this.opts.es5?i.varKinds.var:i.varKinds.let)){const s=this._scope.toName(e);return this._for(new E(o,s,t,r),(()=>n(s)))}forOf(e,t,r,o=i.varKinds.const){const s=this._scope.toName(e);if(this.opts.es5){const e=t instanceof n.Name?t:this.var("_arr",t);return this.forRange("_i",0,n._`${e}.length`,(t=>{this.var(s,n._`${e}[${t}]`),r(s)}))}return this._for(new S("of",o,s,t),(()=>r(s)))}forIn(e,t,r,o=(this.opts.es5?i.varKinds.var:i.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,n._`Object.keys(${t})`,r);const s=this._scope.toName(e);return this._for(new S("in",o,s,t),(()=>r(s)))}endFor(){return this._endBlockNode(b)}label(e){return this._leafNode(new f(e))}break(e){return this._leafNode(new h(e))}return(e){const t=new T;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(T)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const n=new I;if(this._blockNode(n),this.code(e),t){const e=this.name("e");this._currNode=n.catch=new k(e),t(e)}return r&&(this._currNode=n.finally=new N,this.code(r)),this._endBlockNode(k,N)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=n.nil,r,i){return this._blockNode(new O(e,t,r)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(O)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof _))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},t.not=P;const $=j(t.operators.AND);t.and=function(...e){return e.reduce($)};const C=j(t.operators.OR);function j(e){return(t,r)=>t===n.nil?r:r===n.nil?t:n._`${M(t)} ${e} ${M(r)}`}function M(e){return e instanceof n.Name?e:n._`(${e})`}t.or=function(...e){return e.reduce(C)}},9187:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const n=r(6545);class i extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var o;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(o=t.UsedValueState||(t.UsedValueState={})),t.varKinds={const:new n.Name("const"),let:new n.Name("let"),var:new n.Name("var")};class s{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof n.Name?e:this.name(e)}name(e){return new n.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,r;if((null===(r=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===r?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=s;class a extends n.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=n._`.${new n.Name(t)}[${r}]`}}t.ValueScopeName=a;const c=n._`\n`;t.ValueScope=class extends s{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?c:n.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const n=this.toName(e),{prefix:i}=n,o=null!==(r=t.key)&&void 0!==r?r:t.ref;let s=this._values[i];if(s){const e=s.get(o);if(e)return e}else s=this._values[i]=new Map;s.set(o,n);const a=this._scope[i]||(this._scope[i]=[]),c=a.length;return a[c]=t.ref,n.setValue(t,{property:i,itemIndex:c}),n}getValue(e,t){const r=this._values[e];if(r)return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(t=>{if(void 0===t.scopePath)throw new Error(`CodeGen: name "${t}" has no value`);return n._`${e}${t.scopePath}`}))}scopeCode(e=this._values,t,r){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,r)}_reduceValues(e,r,s={},a){let c=n.nil;for(const u in e){const l=e[u];if(!l)continue;const f=s[u]=s[u]||new Map;l.forEach((e=>{if(f.has(e))return;f.set(e,o.Started);let s=r(e);if(s){const r=this.opts.es5?t.varKinds.var:t.varKinds.const;c=n._`${c}${r} ${e} = ${s};${this.opts._n}`}else{if(!(s=null==a?void 0:a(e)))throw new i(e);c=n._`${c}${s}${this.opts._n}`}f.set(e,o.Completed)}))}return c}}},6930:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const n=r(5669),i=r(8936),o=r(7250);function s(e,t){const r=e.const("err",t);e.if(n._`${o.default.vErrors} === null`,(()=>e.assign(o.default.vErrors,n._`[${r}]`)),n._`${o.default.vErrors}.push(${r})`),e.code(n._`${o.default.errors}++`)}function a(e,t){const{gen:r,validateName:i,schemaEnv:o}=e;o.$async?r.throw(n._`new ${e.ValidationError}(${t})`):(r.assign(n._`${i}.errors`,t),r.return(!1))}t.keywordError={message:({keyword:e})=>n.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?n.str`"${e}" keyword must be ${t} ($data)`:n.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,r=t.keywordError,i,o){const{it:c}=e,{gen:l,compositeRule:f,allErrors:h}=c,d=u(e,r,i);(null!=o?o:f||h)?s(l,d):a(c,n._`[${d}]`)},t.reportExtraError=function(e,r=t.keywordError,n){const{it:i}=e,{gen:c,compositeRule:l,allErrors:f}=i;s(c,u(e,r,n)),l||f||a(i,o.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(o.default.errors,t),e.if(n._`${o.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign(n._`${o.default.vErrors}.length`,t)),(()=>e.assign(o.default.vErrors,null)))))},t.extendErrors=function({gen:e,keyword:t,schemaValue:r,data:i,errsCount:s,it:a}){if(void 0===s)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",s,o.default.errors,(s=>{e.const(c,n._`${o.default.vErrors}[${s}]`),e.if(n._`${c}.instancePath === undefined`,(()=>e.assign(n._`${c}.instancePath`,(0,n.strConcat)(o.default.instancePath,a.errorPath)))),e.assign(n._`${c}.schemaPath`,n.str`${a.errSchemaPath}/${t}`),a.opts.verbose&&(e.assign(n._`${c}.schema`,r),e.assign(n._`${c}.data`,i))}))};const c={keyword:new n.Name("keyword"),schemaPath:new n.Name("schemaPath"),params:new n.Name("params"),propertyName:new n.Name("propertyName"),message:new n.Name("message"),schema:new n.Name("schema"),parentSchema:new n.Name("parentSchema")};function u(e,t,r){const{createErrors:i}=e.it;return!1===i?n._`{}`:function(e,t,r={}){const{gen:i,it:s}=e,a=[l(s,r),f(e,r)];return function(e,{params:t,message:r},i){const{keyword:s,data:a,schemaValue:u,it:l}=e,{opts:f,propertyName:h,topSchemaRef:d,schemaPath:p}=l;i.push([c.keyword,s],[c.params,"function"==typeof t?t(e):t||n._`{}`]),f.messages&&i.push([c.message,"function"==typeof r?r(e):r]),f.verbose&&i.push([c.schema,u],[c.parentSchema,n._`${d}${p}`],[o.default.data,a]),h&&i.push([c.propertyName,h])}(e,t,a),i.object(...a)}(e,t,r)}function l({errorPath:e},{instancePath:t}){const r=t?n.str`${e}${(0,i.getErrorPath)(t,i.Type.Str)}`:e;return[o.default.instancePath,(0,n.strConcat)(o.default.instancePath,r)]}function f({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:o}){let s=o?t:n.str`${t}/${e}`;return r&&(s=n.str`${s}${(0,i.getErrorPath)(r,i.Type.Str)}`),[c.schemaPath,s]}},7382:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const n=r(5669),i=r(6448),o=r(7250),s=r(6696),a=r(8936),c=r(1686);class u{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,s.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function l(e){const t=h.call(this,e);if(t)return t;const r=(0,s.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:a,lines:u}=this.opts.code,{ownProperties:l}=this.opts,f=new n.CodeGen(this.scope,{es5:a,lines:u,ownProperties:l});let d;e.$async&&(d=f.scopeValue("Error",{ref:i.default,code:n._`require("ajv/dist/runtime/validation_error").default`}));const p=f.scopeName("validate");e.validateName=p;const m={gen:f,allErrors:this.opts.allErrors,data:o.default.data,parentData:o.default.parentData,parentDataProperty:o.default.parentDataProperty,dataNames:[o.default.data],dataPathArr:[n.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,n.stringify)(e.schema)}:{ref:e.schema}),validateName:p,ValidationError:d,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:n.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:n._`""`,opts:this.opts,self:this};let y;try{this._compilations.add(e),(0,c.validateFunctionCode)(m),f.optimize(this.opts.code.optimize);const t=f.toString();y=`${f.scopeRefs(o.default.scope)}return ${t}`,this.opts.code.process&&(y=this.opts.code.process(y,e));const r=new Function(`${o.default.self}`,`${o.default.scope}`,y)(this,this.scope.get());if(this.scope.value(p,{ref:r}),r.errors=null,r.schema=e.schema,r.schemaEnv=e,e.$async&&(r.$async=!0),!0===this.opts.code.source&&(r.source={validateName:p,validateCode:t,scopeValues:f._values}),this.opts.unevaluated){const{props:e,items:t}=m;r.evaluated={props:e instanceof n.Name?void 0:e,items:t instanceof n.Name?void 0:t,dynamicProps:e instanceof n.Name,dynamicItems:t instanceof n.Name},r.source&&(r.source.evaluated=(0,n.stringify)(r.evaluated))}return e.validate=r,e}catch(t){throw delete e.validate,delete e.validateName,y&&this.logger.error("Error compiling schema, function code:",y),t}finally{this._compilations.delete(e)}}function f(e){return(0,s.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:l.call(this,e)}function h(e){for(const n of this._compilations)if(r=e,(t=n).schema===r.schema&&t.root===r.root&&t.baseId===r.baseId)return n;var t,r}function d(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||p.call(this,e,t)}function p(e,t){const r=this.opts.uriResolver.parse(t),n=(0,s._getFullPath)(this.opts.uriResolver,r);let i=(0,s.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===i)return y.call(this,r,e);const o=(0,s.normalizeId)(n),a=this.refs[o]||this.schemas[o];if("string"==typeof a){const t=p.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return y.call(this,r,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||l.call(this,a),o===(0,s.normalizeId)(t)){const{schema:t}=a,{schemaId:r}=this.opts,n=t[r];return n&&(i=(0,s.resolveUrl)(this.opts.uriResolver,i,n)),new u({schema:t,schemaId:r,root:e,baseId:i})}return y.call(this,r,a)}}t.SchemaEnv=u,t.compileSchema=l,t.resolveRef=function(e,t,r){var n;r=(0,s.resolveUrl)(this.opts.uriResolver,t,r);const i=e.refs[r];if(i)return i;let o=d.call(this,e,r);if(void 0===o){const i=null===(n=e.localRefs)||void 0===n?void 0:n[r],{schemaId:s}=this.opts;i&&(o=new u({schema:i,schemaId:s,root:e,baseId:t}))}return void 0!==o?e.refs[r]=f.call(this,o):void 0},t.getCompilingSchema=h,t.resolveSchema=p;const m=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function y(e,{baseId:t,schema:r,root:n}){var i;if("/"!==(null===(i=e.fragment)||void 0===i?void 0:i[0]))return;for(const n of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;const e=r[(0,a.unescapeFragment)(n)];if(void 0===e)return;const i="object"==typeof(r=e)&&r[this.opts.schemaId];!m.has(n)&&i&&(t=(0,s.resolveUrl)(this.opts.uriResolver,t,i))}let o;if("boolean"!=typeof r&&r.$ref&&!(0,a.schemaHasRulesButRef)(r,this.RULES)){const e=(0,s.resolveUrl)(this.opts.uriResolver,t,r.$ref);o=p.call(this,n,e)}const{schemaId:c}=this.opts;return o=o||new u({schema:r,schemaId:c,root:n,baseId:t}),o.schema!==o.root.schema?o:void 0}},7250:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(5669),i={data:new n.Name("data"),valCxt:new n.Name("valCxt"),instancePath:new n.Name("instancePath"),parentData:new n.Name("parentData"),parentDataProperty:new n.Name("parentDataProperty"),rootData:new n.Name("rootData"),dynamicAnchors:new n.Name("dynamicAnchors"),vErrors:new n.Name("vErrors"),errors:new n.Name("errors"),this:new n.Name("this"),self:new n.Name("self"),scope:new n.Name("scope"),json:new n.Name("json"),jsonPos:new n.Name("jsonPos"),jsonLen:new n.Name("jsonLen"),jsonPart:new n.Name("jsonPart")};t.default=i},1578:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(6696);class i extends Error{constructor(e,t,r,i){super(i||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,n.resolveUrl)(e,t,r),this.missingSchema=(0,n.normalizeId)((0,n.getFullPath)(e,this.missingRef))}}t.default=i},6696:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const n=r(8936),i=r(6471),o=r(2943),s=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!c(e):!!t&&u(e)<=t)};const a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function c(e){for(const t in e){if(a.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(c))return!0;if("object"==typeof r&&c(r))return!0}return!1}function u(e){let t=0;for(const r in e){if("$ref"===r)return 1/0;if(t++,!s.has(r)&&("object"==typeof e[r]&&(0,n.eachItem)(e[r],(e=>t+=u(e))),t===1/0))return 1/0}return t}function l(e,t="",r){!1!==r&&(t=d(t));const n=e.parse(t);return f(e,n)}function f(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=l,t._getFullPath=f;const h=/#\/?$/;function d(e){return e?e.replace(h,""):""}t.normalizeId=d,t.resolveUrl=function(e,t,r){return r=d(r),e.resolve(t,r)};const p=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:r,uriResolver:n}=this.opts,s=d(e[r]||t),a={"":s},c=l(n,s,!1),u={},f=new Set;return o(e,{allKeys:!0},((e,t,n,i)=>{if(void 0===i)return;const o=c+t;let s=a[i];function l(t){const r=this.opts.uriResolver.resolve;if(t=d(s?r(s,t):t),f.has(t))throw m(t);f.add(t);let n=this.refs[t];return"string"==typeof n&&(n=this.refs[n]),"object"==typeof n?h(e,n.schema,t):t!==d(o)&&("#"===t[0]?(h(e,u[t],t),u[t]=e):this.refs[t]=o),t}function y(e){if("string"==typeof e){if(!p.test(e))throw new Error(`invalid anchor "${e}"`);l.call(this,`#${e}`)}}"string"==typeof e[r]&&(s=l.call(this,e[r])),y.call(this,e.$anchor),y.call(this,e.$dynamicAnchor),a[t]=s})),u;function h(e,t,r){if(void 0!==t&&!i(e,t))throw m(r)}function m(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},2881:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;const r=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&r.has(e)},t.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},8936:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const n=r(5669),i=r(6545);function o(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema)return;if("boolean"==typeof t)return;const i=n.RULES.keywords;for(const r in t)i[r]||p(e,`unknown keyword: "${r}"`)}function s(e,t){if("boolean"==typeof e)return!e;for(const r in e)if(t[r])return!0;return!1}function a(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function c(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function u({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:i}){return(o,s,a,c)=>{const u=void 0===a?s:a instanceof n.Name?(s instanceof n.Name?e(o,s,a):t(o,s,a),a):s instanceof n.Name?(t(o,a,s),s):r(s,a);return c!==n.Name||u instanceof n.Name?u:i(o,u)}}function l(e,t){if(!0===t)return e.var("props",!0);const r=e.var("props",n._`{}`);return void 0!==t&&f(e,r,t),r}function f(e,t,r){Object.keys(r).forEach((r=>e.assign(n._`${t}${(0,n.getProperty)(r)}`,!0)))}t.toHash=function(e){const t={};for(const r of e)t[r]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(o(e,t),!s(t,e.self.RULES.all))},t.checkUnknownRules=o,t.schemaHasRules=s,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const r in e)if("$ref"!==r&&t.all[r])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},r,i,o){if(!o){if("number"==typeof r||"boolean"==typeof r)return r;if("string"==typeof r)return n._`${r}`}return n._`${e}${t}${(0,n.getProperty)(i)}`},t.unescapeFragment=function(e){return c(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(a(e))},t.escapeJsonPointer=a,t.unescapeJsonPointer=c,t.eachItem=function(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)},t.mergeEvaluated={props:u({mergeNames:(e,t,r)=>e.if(n._`${r} !== true && ${t} !== undefined`,(()=>{e.if(n._`${t} === true`,(()=>e.assign(r,!0)),(()=>e.assign(r,n._`${r} || {}`).code(n._`Object.assign(${r}, ${t})`)))})),mergeToName:(e,t,r)=>e.if(n._`${r} !== true`,(()=>{!0===t?e.assign(r,!0):(e.assign(r,n._`${r} || {}`),f(e,r,t))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:l}),items:u({mergeNames:(e,t,r)=>e.if(n._`${r} !== true && ${t} !== undefined`,(()=>e.assign(r,n._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`))),mergeToName:(e,t,r)=>e.if(n._`${r} !== true`,(()=>e.assign(r,!0===t||n._`${r} > ${t} ? ${r} : ${t}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=l,t.setEvaluated=f;const h={};var d;function p(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw new Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:h[t.code]||(h[t.code]=new i._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(d=t.Type||(t.Type={})),t.getErrorPath=function(e,t,r){if(e instanceof n.Name){const i=t===d.Num;return r?i?n._`"[" + ${e} + "]"`:n._`"['" + ${e} + "']"`:i?n._`"/" + ${e}`:n._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,n.getProperty)(e).toString():"/"+a(e)},t.checkStrictMode=p},9073:(e,t)=>{function r(e,t){return t.rules.some((t=>n(e,t)))}function n(e,t){var r;return void 0!==e[t.keyword]||(null===(r=t.definition.implements)||void 0===r?void 0:r.some((t=>void 0!==e[t])))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},n){const i=t.RULES.types[n];return i&&!0!==i&&r(e,i)},t.shouldUseGroup=r,t.shouldUseRule=n},2171:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const n=r(6930),i=r(5669),o=r(7250),s={message:"boolean schema is false"};function a(e,t){const{gen:r,data:i}=e,o={gen:r,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,n.reportError)(o,s,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:r,validateName:n}=e;!1===r?a(e,!1):"object"==typeof r&&!0===r.$async?t.return(o.default.data):(t.assign(i._`${n}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:r,schema:n}=e;!1===n?(r.var(t,!1),a(e)):r.var(t,!0)}},7332:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const n=r(2881),i=r(9073),o=r(6930),s=r(5669),a=r(8936);var c;function u(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(n.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(c=t.DataType||(t.DataType={})),t.getSchemaTypes=function(e){const t=u(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},t.getJSONTypes=u,t.coerceAndCheckDataType=function(e,t){const{gen:r,data:n,opts:o}=e,a=function(e,t){return t?e.filter((e=>l.has(e)||"array"===t&&"array"===e)):[]}(t,o.coerceTypes),u=t.length>0&&!(0===a.length&&1===t.length&&(0,i.schemaHasRulesForType)(e,t[0]));if(u){const i=h(t,n,o.strictNumbers,c.Wrong);r.if(i,(()=>{a.length?function(e,t,r){const{gen:n,data:i,opts:o}=e,a=n.let("dataType",s._`typeof ${i}`),c=n.let("coerced",s._`undefined`);"array"===o.coerceTypes&&n.if(s._`${a} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,(()=>n.assign(i,s._`${i}[0]`).assign(a,s._`typeof ${i}`).if(h(t,i,o.strictNumbers),(()=>n.assign(c,i))))),n.if(s._`${c} !== undefined`);for(const e of r)(l.has(e)||"array"===e&&"array"===o.coerceTypes)&&u(e);function u(e){switch(e){case"string":return void n.elseIf(s._`${a} == "number" || ${a} == "boolean"`).assign(c,s._`"" + ${i}`).elseIf(s._`${i} === null`).assign(c,s._`""`);case"number":return void n.elseIf(s._`${a} == "boolean" || ${i} === null
3
3
  || (${a} == "string" && ${i} && ${i} == +${i})`).assign(c,s._`+${i}`);case"integer":return void n.elseIf(s._`${a} === "boolean" || ${i} === null
4
4
  || (${a} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(c,s._`+${i}`);case"boolean":return void n.elseIf(s._`${i} === "false" || ${i} === 0 || ${i} === null`).assign(c,!1).elseIf(s._`${i} === "true" || ${i} === 1`).assign(c,!0);case"null":return n.elseIf(s._`${i} === "" || ${i} === 0 || ${i} === false`),void n.assign(c,null);case"array":n.elseIf(s._`${a} === "string" || ${a} === "number"
5
- || ${a} === "boolean" || ${i} === null`).assign(c,s._`[${i}]`)}}n.else(),p(e),n.endIf(),n.if(s._`${c} !== undefined`,(()=>{n.assign(i,c),function({gen:e,parentData:t,parentDataProperty:r},n){e.if(s._`${t} !== undefined`,(()=>e.assign(s._`${t}[${r}]`,n)))}(e,c)}))}(e,t,a):p(e)}))}return u};const l=new Set(["string","number","integer","boolean","null"]);function f(e,t,r,n=c.Correct){const i=n===c.Correct?s.operators.EQ:s.operators.NEQ;let o;switch(e){case"null":return s._`${t} ${i} null`;case"array":o=s._`Array.isArray(${t})`;break;case"object":o=s._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=a(s._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=a();break;default:return s._`typeof ${t} ${i} ${e}`}return n===c.Correct?o:(0,s.not)(o);function a(e=s.nil){return(0,s.and)(s._`typeof ${t} == "number"`,e,r?s._`isFinite(${t})`:s.nil)}}function h(e,t,r,n){if(1===e.length)return f(e[0],t,r,n);let i;const o=(0,a.toHash)(e);if(o.array&&o.object){const e=s._`typeof ${t} != "object"`;i=o.null?e:s._`!${t} || ${e}`,delete o.null,delete o.array,delete o.object}else i=s.nil;o.number&&delete o.integer;for(const e in o)i=(0,s.and)(i,f(e,t,r,n));return i}t.checkDataType=f,t.checkDataTypes=h;const d={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?s._`{type: ${e}}`:s._`{type: ${t}}`};function p(e){const t=function(e){const{gen:t,data:r,schema:n}=e,i=(0,a.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}(e);(0,o.reportError)(t,d)}t.reportTypeError=p},1481:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const n=r(5669),i=r(8936);function o(e,t,r){const{gen:o,compositeRule:s,data:a,opts:c}=e;if(void 0===r)return;const u=n._`${a}${(0,n.getProperty)(t)}`;if(s)return void(0,i.checkStrictMode)(e,`default is ignored for: ${u}`);let l=n._`${u} === undefined`;"empty"===c.useDefaults&&(l=n._`${l} || ${u} === null || ${u} === ""`),o.if(l,n._`${u} = ${(0,n.stringify)(r)}`)}t.assignDefaults=function(e,t){const{properties:r,items:n}=e.schema;if("object"===t&&r)for(const t in r)o(e,t,r[t].default);else"array"===t&&Array.isArray(n)&&n.forEach(((t,r)=>o(e,r,t.default)))}},1686:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;const n=r(2171),i=r(7332),o=r(9073),s=r(7332),a=r(1481),c=r(5782),u=r(8878),l=r(5669),f=r(7250),h=r(6696),d=r(8936),p=r(6930);function m({gen:e,validateName:t,schema:r,schemaEnv:n,opts:i},o){i.code.es5?e.func(t,l._`${f.default.data}, ${f.default.valCxt}`,n.$async,(()=>{e.code(l._`"use strict"; ${y(r,i)}`),function(e,t){e.if(f.default.valCxt,(()=>{e.var(f.default.instancePath,l._`${f.default.valCxt}.${f.default.instancePath}`),e.var(f.default.parentData,l._`${f.default.valCxt}.${f.default.parentData}`),e.var(f.default.parentDataProperty,l._`${f.default.valCxt}.${f.default.parentDataProperty}`),e.var(f.default.rootData,l._`${f.default.valCxt}.${f.default.rootData}`),t.dynamicRef&&e.var(f.default.dynamicAnchors,l._`${f.default.valCxt}.${f.default.dynamicAnchors}`)}),(()=>{e.var(f.default.instancePath,l._`""`),e.var(f.default.parentData,l._`undefined`),e.var(f.default.parentDataProperty,l._`undefined`),e.var(f.default.rootData,f.default.data),t.dynamicRef&&e.var(f.default.dynamicAnchors,l._`{}`)}))}(e,i),e.code(o)})):e.func(t,l._`${f.default.data}, ${function(e){return l._`{${f.default.instancePath}="", ${f.default.parentData}, ${f.default.parentDataProperty}, ${f.default.rootData}=${f.default.data}${e.dynamicRef?l._`, ${f.default.dynamicAnchors}={}`:l.nil}}={}`}(i)}`,n.$async,(()=>e.code(y(r,i)).code(o)))}function y(e,t){const r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?l._`/*# sourceURL=${r} */`:l.nil}function v({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function g(e){return"boolean"!=typeof e.schema}function _(e){(0,d.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:r,opts:n,self:i}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function b(e,t){if(e.opts.jtd)return E(e,[],!1,t);const r=(0,i.getSchemaTypes)(e.schema);E(e,r,!(0,i.coerceAndCheckDataType)(e,r),t)}function w({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:i}){const o=r.$comment;if(!0===i.$comment)e.code(l._`${f.default.self}.logger.log(${o})`);else if("function"==typeof i.$comment){const r=l.str`${n}/$comment`,i=e.scopeValue("root",{ref:t.root});e.code(l._`${f.default.self}.opts.$comment(${o}, ${r}, ${i}.schema)`)}}function E(e,t,r,n){const{gen:i,schema:a,data:c,allErrors:u,opts:h,self:p}=e,{RULES:m}=p;function y(d){(0,o.shouldUseGroup)(a,d)&&(d.type?(i.if((0,s.checkDataType)(d.type,c,h.strictNumbers)),S(e,d),1===t.length&&t[0]===d.type&&r&&(i.else(),(0,s.reportTypeError)(e)),i.endIf()):S(e,d),u||i.if(l._`${f.default.errors} === ${n||0}`))}!a.$ref||!h.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(a,m)?(h.jtd||function(e,t){!e.schemaEnv.meta&&e.opts.strictTypes&&(function(e,t){t.length&&(e.dataTypes.length?(t.forEach((t=>{O(e.dataTypes,t)||I(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),function(e,t){const r=[];for(const n of e.dataTypes)O(t,n)?r.push(n):t.includes("integer")&&"number"===n&&r.push("integer");e.dataTypes=r}(e,t)):e.dataTypes=t)}(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&I(e,"use allowUnionTypes to allow union type keyword")}(e,t),function(e,t){const r=e.self.RULES.all;for(const n in r){const i=r[n];if("object"==typeof i&&(0,o.shouldUseRule)(e.schema,i)){const{type:r}=i.definition;r.length&&!r.some((e=>{return n=e,(r=t).includes(n)||"number"===n&&r.includes("integer");var r,n}))&&I(e,`missing type "${r.join(",")}" for keyword "${n}"`)}}}(e,e.dataTypes))}(e,t),i.block((()=>{for(const e of m.rules)y(e);y(m.post)}))):i.block((()=>k(e,"$ref",m.all.$ref.definition)))}function S(e,t){const{gen:r,schema:n,opts:{useDefaults:i}}=e;i&&(0,a.assignDefaults)(e,t.type),r.block((()=>{for(const r of t.rules)(0,o.shouldUseRule)(n,r)&&k(e,r.keyword,r.definition,t.type)}))}function O(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function I(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,d.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=function(e){g(e)&&(_(e),v(e))?function(e){const{schema:t,opts:r,gen:n}=e;m(e,(()=>{r.$comment&&t.$comment&&w(e),function(e){const{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,d.checkStrictMode)(e,"default is ignored in the schema root")}(e),n.let(f.default.vErrors,null),n.let(f.default.errors,0),r.unevaluated&&function(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",l._`${r}.evaluated`),t.if(l._`${e.evaluated}.dynamicProps`,(()=>t.assign(l._`${e.evaluated}.props`,l._`undefined`))),t.if(l._`${e.evaluated}.dynamicItems`,(()=>t.assign(l._`${e.evaluated}.items`,l._`undefined`)))}(e),b(e),function(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:i,opts:o}=e;r.$async?t.if(l._`${f.default.errors} === 0`,(()=>t.return(f.default.data)),(()=>t.throw(l._`new ${i}(${f.default.vErrors})`))):(t.assign(l._`${n}.errors`,f.default.vErrors),o.unevaluated&&function({gen:e,evaluated:t,props:r,items:n}){r instanceof l.Name&&e.assign(l._`${t}.props`,r),n instanceof l.Name&&e.assign(l._`${t}.items`,n)}(e),t.return(l._`${f.default.errors} === 0`))}(e)}))}(e):m(e,(()=>(0,n.topBoolOrEmptySchema)(e)))};class T{constructor(e,t,r){if((0,c.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",A(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,c.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",f.default.errors))}result(e,t,r){this.failResult((0,l.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,l.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(l._`${t} !== undefined && (${(0,l.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t)return this.setParams(t),this._error(e,r),void this.setParams({});this._error(e,r)}_error(e,t){(e?p.reportExtraError:p.reportError)(this,this.def.error,t)}$dataError(){(0,p.reportError)(this,this.def.$dataError||p.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,p.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=l.nil){this.gen.block((()=>{this.check$data(e,r),t()}))}check$data(e=l.nil,t=l.nil){if(!this.$data)return;const{gen:r,schemaCode:n,schemaType:i,def:o}=this;r.if((0,l.or)(l._`${n} === undefined`,t)),e!==l.nil&&r.assign(e,!0),(i.length||o.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==l.nil&&r.assign(e,!1)),r.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:r,def:n,it:i}=this;return(0,l.or)(function(){if(r.length){if(!(t instanceof l.Name))throw new Error("ajv implementation error");const e=Array.isArray(r)?r:[r];return l._`${(0,s.checkDataTypes)(e,t,i.opts.strictNumbers,s.DataType.Wrong)}`}return l.nil}(),function(){if(n.validateSchema){const r=e.scopeValue("validate$data",{ref:n.validateSchema});return l._`!${r}(${t})`}return l.nil}())}subschema(e,t){const r=(0,u.getSubschema)(this.it,e);(0,u.extendSubschemaData)(r,this.it,e),(0,u.extendSubschemaMode)(r,e);const i={...this.it,...r,items:void 0,props:void 0};return function(e,t){g(e)&&(_(e),v(e))?function(e,t){const{schema:r,gen:n,opts:i}=e;i.$comment&&r.$comment&&w(e),function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,h.resolveUrl)(e.opts.uriResolver,e.baseId,t))}(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const o=n.const("_errs",f.default.errors);b(e,o),n.var(t,l._`${o} === ${f.default.errors}`)}(e,t):(0,n.boolOrEmptySchema)(e,t)}(i,t),i}mergeEvaluated(e,t){const{it:r,gen:n}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=d.mergeEvaluated.props(n,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=d.mergeEvaluated.items(n,e.items,r.items,t)))}mergeValidEvaluated(e,t){const{it:r,gen:n}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return n.if(t,(()=>this.mergeEvaluated(e,l.Name))),!0}}function k(e,t,r,n){const i=new T(e,r,t);"code"in r?r.code(i,n):i.$data&&r.validate?(0,c.funcKeywordCode)(i,r):"macro"in r?(0,c.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,c.funcKeywordCode)(i,r)}t.KeywordCxt=T;const N=/^\/(?:[^~]|~0|~1)*$/,D=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function A(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let i,o;if(""===e)return f.default.rootData;if("/"===e[0]){if(!N.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);i=e,o=f.default.rootData}else{const s=D.exec(e);if(!s)throw new Error(`Invalid JSON-pointer: ${e}`);const a=+s[1];if(i=s[2],"#"===i){if(a>=t)throw new Error(c("property/index",a));return n[t-a]}if(a>t)throw new Error(c("data",a));if(o=r[t-a],!i)return o}let s=o;const a=i.split("/");for(const e of a)e&&(o=l._`${o}${(0,l.getProperty)((0,d.unescapeJsonPointer)(e))}`,s=l._`${s} && ${o}`);return s;function c(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}t.getData=A},5782:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const n=r(5669),i=r(7250),o=r(3499),s=r(6930);function a(e){const{gen:t,data:r,it:i}=e;t.if(i.parentData,(()=>t.assign(r,n._`${i.parentData}[${i.parentDataProperty}]`)))}function c(e,t,r){if(void 0===r)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,n.stringify)(r)})}t.macroKeywordCode=function(e,t){const{gen:r,keyword:i,schema:o,parentSchema:s,it:a}=e,u=t.macro.call(a.self,o,s,a),l=c(r,i,u);!1!==a.opts.validateSchema&&a.self.validateSchema(u,!0);const f=r.name("valid");e.subschema({schema:u,schemaPath:n.nil,errSchemaPath:`${a.errSchemaPath}/${i}`,topSchemaRef:l,compositeRule:!0},f),e.pass(f,(()=>e.error(!0)))},t.funcKeywordCode=function(e,t){var r;const{gen:u,keyword:l,schema:f,parentSchema:h,$data:d,it:p}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(p,t);const m=!d&&t.compile?t.compile.call(p.self,f,h,p):t.validate,y=c(u,l,m),v=u.let("valid");function g(r=(t.async?n._`await `:n.nil)){const s=p.opts.passContext?i.default.this:i.default.self,a=!("compile"in t&&!d||!1===t.schema);u.assign(v,n._`${r}${(0,o.callValidateCode)(e,y,s,a)}`,t.modifying)}function _(e){var r;u.if((0,n.not)(null!==(r=t.valid)&&void 0!==r?r:v),e)}e.block$data(v,(function(){if(!1===t.errors)g(),t.modifying&&a(e),_((()=>e.error()));else{const r=t.async?function(){const e=u.let("ruleErrs",null);return u.try((()=>g(n._`await `)),(t=>u.assign(v,!1).if(n._`${t} instanceof ${p.ValidationError}`,(()=>u.assign(e,n._`${t}.errors`)),(()=>u.throw(t))))),e}():function(){const e=n._`${y}.errors`;return u.assign(e,null),g(n.nil),e}();t.modifying&&a(e),_((()=>function(e,t){const{gen:r}=e;r.if(n._`Array.isArray(${t})`,(()=>{r.assign(i.default.vErrors,n._`${i.default.vErrors} === null ? ${t} : ${i.default.vErrors}.concat(${t})`).assign(i.default.errors,n._`${i.default.vErrors}.length`),(0,s.extendErrors)(e)}),(()=>e.error()))}(e,r)))}})),e.ok(null!==(r=t.valid)&&void 0!==r?r:v)},t.validSchemaType=function(e,t,r=!1){return!t.length||t.some((t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e))},t.validateKeywordUsage=function({schema:e,opts:t,self:r,errSchemaPath:n},i,o){if(Array.isArray(i.keyword)?!i.keyword.includes(o):i.keyword!==o)throw new Error("ajv implementation error");const s=i.dependencies;if(null==s?void 0:s.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${o}: ${s.join(",")}`);if(i.validateSchema&&!i.validateSchema(e[o])){const e=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);r.logger.error(e)}}},8878:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;const n=r(5669),i=r(8936);t.getSubschema=function(e,{keyword:t,schemaProp:r,schema:o,schemaPath:s,errSchemaPath:a,topSchemaRef:c}){if(void 0!==t&&void 0!==o)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const o=e.schema[t];return void 0===r?{schema:o,schemaPath:n._`${e.schemaPath}${(0,n.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:o[r],schemaPath:n._`${e.schemaPath}${(0,n.getProperty)(t)}${(0,n.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,i.escapeFragment)(r)}`}}if(void 0!==o){if(void 0===s||void 0===a||void 0===c)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:o,schemaPath:s,topSchemaRef:c,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:r,dataPropType:o,data:s,dataTypes:a,propertyName:c}){if(void 0!==s&&void 0!==r)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:u}=t;if(void 0!==r){const{errorPath:s,dataPathArr:a,opts:c}=t;l(u.let("data",n._`${t.data}${(0,n.getProperty)(r)}`,!0)),e.errorPath=n.str`${s}${(0,i.getErrorPath)(r,o,c.jsPropertySyntax)}`,e.parentDataProperty=n._`${r}`,e.dataPathArr=[...a,e.parentDataProperty]}function l(r){e.data=r,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,r]}void 0!==s&&(l(s instanceof n.Name?s:u.let("data",s,!0)),void 0!==c&&(e.propertyName=c)),a&&(e.dataTypes=a)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:o}){void 0!==n&&(e.compositeRule=n),void 0!==i&&(e.createErrors=i),void 0!==o&&(e.allErrors=o),e.jtdDiscriminator=t,e.jtdMetadata=r}},8355:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var n=r(1686);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return n.KeywordCxt}});var i=r(5669);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return i._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return i.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return i.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return i.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return i.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return i.CodeGen}});const o=r(6448),s=r(1578),a=r(2881),c=r(7382),u=r(5669),l=r(6696),f=r(7332),h=r(8936),d=r(1143),p=r(407),m=(e,t)=>new RegExp(e,t);m.code="new RegExp";const y=["removeAdditional","useDefaults","coerceTypes"],v=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),g={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function b(e){var t,r,n,i,o,s,a,c,u,l,f,h,d,y,v,g,_,b,w,E,S,O,I,T,k;const N=e.strict,D=null===(t=e.code)||void 0===t?void 0:t.optimize,A=!0===D||void 0===D?1:D||0,R=null!==(n=null===(r=e.code)||void 0===r?void 0:r.regExp)&&void 0!==n?n:m,x=null!==(i=e.uriResolver)&&void 0!==i?i:p.default;return{strictSchema:null===(s=null!==(o=e.strictSchema)&&void 0!==o?o:N)||void 0===s||s,strictNumbers:null===(c=null!==(a=e.strictNumbers)&&void 0!==a?a:N)||void 0===c||c,strictTypes:null!==(l=null!==(u=e.strictTypes)&&void 0!==u?u:N)&&void 0!==l?l:"log",strictTuples:null!==(h=null!==(f=e.strictTuples)&&void 0!==f?f:N)&&void 0!==h?h:"log",strictRequired:null!==(y=null!==(d=e.strictRequired)&&void 0!==d?d:N)&&void 0!==y&&y,code:e.code?{...e.code,optimize:A,regExp:R}:{optimize:A,regExp:R},loopRequired:null!==(v=e.loopRequired)&&void 0!==v?v:200,loopEnum:null!==(g=e.loopEnum)&&void 0!==g?g:200,meta:null===(_=e.meta)||void 0===_||_,messages:null===(b=e.messages)||void 0===b||b,inlineRefs:null===(w=e.inlineRefs)||void 0===w||w,schemaId:null!==(E=e.schemaId)&&void 0!==E?E:"$id",addUsedSchema:null===(S=e.addUsedSchema)||void 0===S||S,validateSchema:null===(O=e.validateSchema)||void 0===O||O,validateFormats:null===(I=e.validateFormats)||void 0===I||I,unicodeRegExp:null===(T=e.unicodeRegExp)||void 0===T||T,int32range:null===(k=e.int32range)||void 0===k||k,uriResolver:x}}class w{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...b(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new u.ValueScope({scope:{},prefixes:v,es5:t,lines:r}),this.logger=function(e){if(!1===e)return N;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),E.call(this,g,e,"NOT SUPPORTED"),E.call(this,_,e,"DEPRECATED","warn"),this._metaOpts=k.call(this),e.formats&&I.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&T.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),O.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:r}=this.opts;let n=d;"id"===r&&(n={...d},n.id=n.$id,delete n.$id),t&&e&&this.addMetaSchema(n,n[r],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);const n=r(t);return"$async"in r||(this.errors=r.errors),n}compile(e,t){const r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(e,t){await i.call(this,e.$schema);const r=this._addSchema(e,t);return r.validate||o.call(this,r)}async function i(e){e&&!this.getSchema(e)&&await n.call(this,{$ref:e},!0)}async function o(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof s.default))throw t;return a.call(this,t),await c.call(this,t.missingSchema),o.call(this,e)}}function a({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){const r=await u.call(this,e);this.refs[e]||await i.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function u(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,n=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,r,n);return this}let i;if("object"==typeof e){const{schemaId:t}=this.opts;if(i=e[t],void 0!==i&&"string"!=typeof i)throw new Error(`schema ${t} must be string`)}return t=(0,l.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let r;if(r=e.$schema,void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const n=this.validate(r,e);if(!n&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return n}getSchema(e){let t;for(;"string"==typeof(t=S.call(this,e));)e=t;if(void 0===t){const{schemaId:r}=this.opts,n=new c.SchemaEnv({schema:{},schemaId:r});if(t=c.resolveSchema.call(this,n,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=S.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let r=e[this.opts.schemaId];return r&&(r=(0,l.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(r=(t=e).keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(A.call(this,r,t),!t)return(0,h.eachItem)(r,(e=>R.call(this,e))),this;P.call(this,t);const n={...t,type:(0,f.getJSONTypes)(t.type),schemaType:(0,f.getJSONTypes)(t.schemaType)};return(0,h.eachItem)(r,0===n.type.length?e=>R.call(this,e,n):e=>n.type.forEach((t=>R.call(this,e,n,t)))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const r of t.rules){const t=r.rules.findIndex((t=>t.keyword===e));t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map((e=>`${r}${e.instancePath} ${e.message}`)).reduce(((e,r)=>e+t+r)):"No errors"}$dataMetaSchema(e,t){const r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const n of t){const t=n.split("/").slice(1);let i=e;for(const e of t)i=i[e];for(const e in r){const t=r[e];if("object"!=typeof t)continue;const{$data:n}=t.definition,o=i[e];n&&o&&(i[e]=C(o))}}return e}_removeAllSchemas(e,t){for(const r in e){const n=e[r];t&&!t.test(r)||("string"==typeof n?delete e[r]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[r]))}}_addSchema(e,t,r,n=this.opts.validateSchema,i=this.opts.addUsedSchema){let o;const{schemaId:s}=this.opts;if("object"==typeof e)o=e[s];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let a=this._cache.get(e);if(void 0!==a)return a;r=(0,l.normalizeId)(o||r);const u=l.getSchemaRefs.call(this,e,r);return a=new c.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:r,localRefs:u}),this._cache.set(a.schema,a),i&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=a),n&&this.validateSchema(e,!0),a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):c.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,e)}finally{this.opts=t}}}function E(e,t,r,n="error"){for(const i in e){const o=i;o in t&&this.logger[n](`${r}: option ${i}. ${e[o]}`)}}function S(e){return e=(0,l.normalizeId)(e),this.schemas[e]||this.refs[e]}function O(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function I(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function T(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}}function k(){const e={...this.opts};for(const t of y)delete e[t];return e}t.default=w,w.ValidationError=o.default,w.MissingRefError=s.default;const N={log(){},warn(){},error(){}},D=/^[a-z_$][a-z0-9_$:-]*$/i;function A(e,t){const{RULES:r}=this;if((0,h.eachItem)(e,(e=>{if(r.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!D.test(e))throw new Error(`Keyword ${e} has invalid name`)})),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function R(e,t,r){var n;const i=null==t?void 0:t.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:o}=this;let s=i?o.post:o.rules.find((({type:e})=>e===r));if(s||(s={type:r,rules:[]},o.rules.push(s)),o.keywords[e]=!0,!t)return;const a={keyword:e,definition:{...t,type:(0,f.getJSONTypes)(t.type),schemaType:(0,f.getJSONTypes)(t.schemaType)}};t.before?x.call(this,s,a,t.before):s.rules.push(a),o.all[e]=a,null===(n=t.implements)||void 0===n||n.forEach((e=>this.addKeyword(e)))}function x(e,t,r){const n=e.rules.findIndex((e=>e.keyword===r));n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function P(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=C(t)),e.validateSchema=this.compile(t,!0))}const $={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function C(e){return{anyOf:[e,$]}}},4285:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(6471);n.code='require("ajv/dist/runtime/equal").default',t.default=n},9161:(e,t)=>{function r(e){const t=e.length;let r,n=0,i=0;for(;i<t;)n++,r=e.charCodeAt(i++),r>=55296&&r<=56319&&i<t&&(r=e.charCodeAt(i),56320==(64512&r)&&i++);return n}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,r.code='require("ajv/dist/runtime/ucs2length").default'},407:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(2371);n.code='require("ajv/dist/runtime/uri").default',t.default=n},6448:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});class r extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}t.default=r},8891:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;const n=r(5669),i=r(8936),o={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>n.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>n._`{limit: ${e}}`},code(e){const{parentSchema:t,it:r}=e,{items:n}=t;Array.isArray(n)?s(e,n):(0,i.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas')}};function s(e,t){const{gen:r,schema:o,data:s,keyword:a,it:c}=e;c.items=!0;const u=r.const("len",n._`${s}.length`);if(!1===o)e.setParams({len:t.length}),e.pass(n._`${u} <= ${t.length}`);else if("object"==typeof o&&!(0,i.alwaysValidSchema)(c,o)){const o=r.var("valid",n._`${u} <= ${t.length}`);r.if((0,n.not)(o),(()=>function(o){r.forRange("i",t.length,u,(t=>{e.subschema({keyword:a,dataProp:t,dataPropType:i.Type.Num},o),c.allErrors||r.if((0,n.not)(o),(()=>r.break()))}))}(o))),e.ok(o)}}t.validateAdditionalItems=s,t.default=o},4943:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(3499),i=r(5669),o=r(7250),s=r(8936),a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>i._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:r,parentSchema:a,data:c,errsCount:u,it:l}=e;if(!u)throw new Error("ajv implementation error");const{allErrors:f,opts:h}=l;if(l.props=!0,"all"!==h.removeAdditional&&(0,s.alwaysValidSchema)(l,r))return;const d=(0,n.allSchemaProperties)(a.properties),p=(0,n.allSchemaProperties)(a.patternProperties);function m(e){t.code(i._`delete ${c}[${e}]`)}function y(n){if("all"===h.removeAdditional||h.removeAdditional&&!1===r)m(n);else{if(!1===r)return e.setParams({additionalProperty:n}),e.error(),void(f||t.break());if("object"==typeof r&&!(0,s.alwaysValidSchema)(l,r)){const r=t.name("valid");"failing"===h.removeAdditional?(v(n,r,!1),t.if((0,i.not)(r),(()=>{e.reset(),m(n)}))):(v(n,r),f||t.if((0,i.not)(r),(()=>t.break())))}}}function v(t,r,n){const i={keyword:"additionalProperties",dataProp:t,dataPropType:s.Type.Str};!1===n&&Object.assign(i,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(i,r)}t.forIn("key",c,(r=>{d.length||p.length?t.if(function(r){let o;if(d.length>8){const e=(0,s.schemaRefOrVal)(l,a.properties,"properties");o=(0,n.isOwnProperty)(t,e,r)}else o=d.length?(0,i.or)(...d.map((e=>i._`${r} === ${e}`))):i.nil;return p.length&&(o=(0,i.or)(o,...p.map((t=>i._`${(0,n.usePattern)(e,t)}.test(${r})`)))),(0,i.not)(o)}(r),(()=>y(r))):y(r)})),e.ok(i._`${u} === ${o.default.errors}`)}};t.default=a},2609:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(8936),i={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const o=t.name("valid");r.forEach(((t,r)=>{if((0,n.alwaysValidSchema)(i,t))return;const s=e.subschema({keyword:"allOf",schemaProp:r},o);e.ok(o),e.mergeEvaluated(s)}))}};t.default=i},4279:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:r(3499).validateUnion,error:{message:"must match a schema in anyOf"}};t.default=n},5609:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(5669),i=r(8936),o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?n.str`must contain at least ${e} valid item(s)`:n.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?n._`{minContains: ${e}}`:n._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:r,parentSchema:o,data:s,it:a}=e;let c,u;const{minContains:l,maxContains:f}=o;a.opts.next?(c=void 0===l?1:l,u=f):c=1;const h=t.const("len",n._`${s}.length`);if(e.setParams({min:c,max:u}),void 0===u&&0===c)return void(0,i.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==u&&c>u)return(0,i.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,i.alwaysValidSchema)(a,r)){let t=n._`${h} >= ${c}`;return void 0!==u&&(t=n._`${t} && ${h} <= ${u}`),void e.pass(t)}a.items=!0;const d=t.name("valid");function p(){const e=t.name("_valid"),r=t.let("count",0);m(e,(()=>t.if(e,(()=>function(e){t.code(n._`${e}++`),void 0===u?t.if(n._`${e} >= ${c}`,(()=>t.assign(d,!0).break())):(t.if(n._`${e} > ${u}`,(()=>t.assign(d,!1).break())),1===c?t.assign(d,!0):t.if(n._`${e} >= ${c}`,(()=>t.assign(d,!0))))}(r)))))}function m(r,n){t.forRange("i",0,h,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:i.Type.Num,compositeRule:!0},r),n()}))}void 0===u&&1===c?m(d,(()=>t.if(d,(()=>t.break())))):0===c?(t.let(d,!0),void 0!==u&&t.if(n._`${s}.length > 0`,p)):(t.let(d,!1),p()),e.result(d,(()=>e.reset()))}};t.default=o},5463:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const n=r(5669),i=r(8936),o=r(3499);t.error={message:({params:{property:e,depsCount:t,deps:r}})=>{const i=1===t?"property":"properties";return n.str`must have ${i} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:i}})=>n._`{property: ${e},
5
+ || ${a} === "boolean" || ${i} === null`).assign(c,s._`[${i}]`)}}n.else(),p(e),n.endIf(),n.if(s._`${c} !== undefined`,(()=>{n.assign(i,c),function({gen:e,parentData:t,parentDataProperty:r},n){e.if(s._`${t} !== undefined`,(()=>e.assign(s._`${t}[${r}]`,n)))}(e,c)}))}(e,t,a):p(e)}))}return u};const l=new Set(["string","number","integer","boolean","null"]);function f(e,t,r,n=c.Correct){const i=n===c.Correct?s.operators.EQ:s.operators.NEQ;let o;switch(e){case"null":return s._`${t} ${i} null`;case"array":o=s._`Array.isArray(${t})`;break;case"object":o=s._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=a(s._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=a();break;default:return s._`typeof ${t} ${i} ${e}`}return n===c.Correct?o:(0,s.not)(o);function a(e=s.nil){return(0,s.and)(s._`typeof ${t} == "number"`,e,r?s._`isFinite(${t})`:s.nil)}}function h(e,t,r,n){if(1===e.length)return f(e[0],t,r,n);let i;const o=(0,a.toHash)(e);if(o.array&&o.object){const e=s._`typeof ${t} != "object"`;i=o.null?e:s._`!${t} || ${e}`,delete o.null,delete o.array,delete o.object}else i=s.nil;o.number&&delete o.integer;for(const e in o)i=(0,s.and)(i,f(e,t,r,n));return i}t.checkDataType=f,t.checkDataTypes=h;const d={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?s._`{type: ${e}}`:s._`{type: ${t}}`};function p(e){const t=function(e){const{gen:t,data:r,schema:n}=e,i=(0,a.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}(e);(0,o.reportError)(t,d)}t.reportTypeError=p},1481:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const n=r(5669),i=r(8936);function o(e,t,r){const{gen:o,compositeRule:s,data:a,opts:c}=e;if(void 0===r)return;const u=n._`${a}${(0,n.getProperty)(t)}`;if(s)return void(0,i.checkStrictMode)(e,`default is ignored for: ${u}`);let l=n._`${u} === undefined`;"empty"===c.useDefaults&&(l=n._`${l} || ${u} === null || ${u} === ""`),o.if(l,n._`${u} = ${(0,n.stringify)(r)}`)}t.assignDefaults=function(e,t){const{properties:r,items:n}=e.schema;if("object"===t&&r)for(const t in r)o(e,t,r[t].default);else"array"===t&&Array.isArray(n)&&n.forEach(((t,r)=>o(e,r,t.default)))}},1686:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;const n=r(2171),i=r(7332),o=r(9073),s=r(7332),a=r(1481),c=r(5782),u=r(8878),l=r(5669),f=r(7250),h=r(6696),d=r(8936),p=r(6930);function m({gen:e,validateName:t,schema:r,schemaEnv:n,opts:i},o){i.code.es5?e.func(t,l._`${f.default.data}, ${f.default.valCxt}`,n.$async,(()=>{e.code(l._`"use strict"; ${y(r,i)}`),function(e,t){e.if(f.default.valCxt,(()=>{e.var(f.default.instancePath,l._`${f.default.valCxt}.${f.default.instancePath}`),e.var(f.default.parentData,l._`${f.default.valCxt}.${f.default.parentData}`),e.var(f.default.parentDataProperty,l._`${f.default.valCxt}.${f.default.parentDataProperty}`),e.var(f.default.rootData,l._`${f.default.valCxt}.${f.default.rootData}`),t.dynamicRef&&e.var(f.default.dynamicAnchors,l._`${f.default.valCxt}.${f.default.dynamicAnchors}`)}),(()=>{e.var(f.default.instancePath,l._`""`),e.var(f.default.parentData,l._`undefined`),e.var(f.default.parentDataProperty,l._`undefined`),e.var(f.default.rootData,f.default.data),t.dynamicRef&&e.var(f.default.dynamicAnchors,l._`{}`)}))}(e,i),e.code(o)})):e.func(t,l._`${f.default.data}, ${function(e){return l._`{${f.default.instancePath}="", ${f.default.parentData}, ${f.default.parentDataProperty}, ${f.default.rootData}=${f.default.data}${e.dynamicRef?l._`, ${f.default.dynamicAnchors}={}`:l.nil}}={}`}(i)}`,n.$async,(()=>e.code(y(r,i)).code(o)))}function y(e,t){const r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?l._`/*# sourceURL=${r} */`:l.nil}function v({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function g(e){return"boolean"!=typeof e.schema}function _(e){(0,d.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:r,opts:n,self:i}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function b(e,t){if(e.opts.jtd)return E(e,[],!1,t);const r=(0,i.getSchemaTypes)(e.schema);E(e,r,!(0,i.coerceAndCheckDataType)(e,r),t)}function w({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:i}){const o=r.$comment;if(!0===i.$comment)e.code(l._`${f.default.self}.logger.log(${o})`);else if("function"==typeof i.$comment){const r=l.str`${n}/$comment`,i=e.scopeValue("root",{ref:t.root});e.code(l._`${f.default.self}.opts.$comment(${o}, ${r}, ${i}.schema)`)}}function E(e,t,r,n){const{gen:i,schema:a,data:c,allErrors:u,opts:h,self:p}=e,{RULES:m}=p;function y(d){(0,o.shouldUseGroup)(a,d)&&(d.type?(i.if((0,s.checkDataType)(d.type,c,h.strictNumbers)),S(e,d),1===t.length&&t[0]===d.type&&r&&(i.else(),(0,s.reportTypeError)(e)),i.endIf()):S(e,d),u||i.if(l._`${f.default.errors} === ${n||0}`))}!a.$ref||!h.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(a,m)?(h.jtd||function(e,t){!e.schemaEnv.meta&&e.opts.strictTypes&&(function(e,t){t.length&&(e.dataTypes.length?(t.forEach((t=>{O(e.dataTypes,t)||T(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),function(e,t){const r=[];for(const n of e.dataTypes)O(t,n)?r.push(n):t.includes("integer")&&"number"===n&&r.push("integer");e.dataTypes=r}(e,t)):e.dataTypes=t)}(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&T(e,"use allowUnionTypes to allow union type keyword")}(e,t),function(e,t){const r=e.self.RULES.all;for(const n in r){const i=r[n];if("object"==typeof i&&(0,o.shouldUseRule)(e.schema,i)){const{type:r}=i.definition;r.length&&!r.some((e=>{return n=e,(r=t).includes(n)||"number"===n&&r.includes("integer");var r,n}))&&T(e,`missing type "${r.join(",")}" for keyword "${n}"`)}}}(e,e.dataTypes))}(e,t),i.block((()=>{for(const e of m.rules)y(e);y(m.post)}))):i.block((()=>k(e,"$ref",m.all.$ref.definition)))}function S(e,t){const{gen:r,schema:n,opts:{useDefaults:i}}=e;i&&(0,a.assignDefaults)(e,t.type),r.block((()=>{for(const r of t.rules)(0,o.shouldUseRule)(n,r)&&k(e,r.keyword,r.definition,t.type)}))}function O(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function T(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,d.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=function(e){g(e)&&(_(e),v(e))?function(e){const{schema:t,opts:r,gen:n}=e;m(e,(()=>{r.$comment&&t.$comment&&w(e),function(e){const{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,d.checkStrictMode)(e,"default is ignored in the schema root")}(e),n.let(f.default.vErrors,null),n.let(f.default.errors,0),r.unevaluated&&function(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",l._`${r}.evaluated`),t.if(l._`${e.evaluated}.dynamicProps`,(()=>t.assign(l._`${e.evaluated}.props`,l._`undefined`))),t.if(l._`${e.evaluated}.dynamicItems`,(()=>t.assign(l._`${e.evaluated}.items`,l._`undefined`)))}(e),b(e),function(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:i,opts:o}=e;r.$async?t.if(l._`${f.default.errors} === 0`,(()=>t.return(f.default.data)),(()=>t.throw(l._`new ${i}(${f.default.vErrors})`))):(t.assign(l._`${n}.errors`,f.default.vErrors),o.unevaluated&&function({gen:e,evaluated:t,props:r,items:n}){r instanceof l.Name&&e.assign(l._`${t}.props`,r),n instanceof l.Name&&e.assign(l._`${t}.items`,n)}(e),t.return(l._`${f.default.errors} === 0`))}(e)}))}(e):m(e,(()=>(0,n.topBoolOrEmptySchema)(e)))};class I{constructor(e,t,r){if((0,c.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",A(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,c.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",f.default.errors))}result(e,t,r){this.failResult((0,l.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,l.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(l._`${t} !== undefined && (${(0,l.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t)return this.setParams(t),this._error(e,r),void this.setParams({});this._error(e,r)}_error(e,t){(e?p.reportExtraError:p.reportError)(this,this.def.error,t)}$dataError(){(0,p.reportError)(this,this.def.$dataError||p.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,p.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=l.nil){this.gen.block((()=>{this.check$data(e,r),t()}))}check$data(e=l.nil,t=l.nil){if(!this.$data)return;const{gen:r,schemaCode:n,schemaType:i,def:o}=this;r.if((0,l.or)(l._`${n} === undefined`,t)),e!==l.nil&&r.assign(e,!0),(i.length||o.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==l.nil&&r.assign(e,!1)),r.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:r,def:n,it:i}=this;return(0,l.or)(function(){if(r.length){if(!(t instanceof l.Name))throw new Error("ajv implementation error");const e=Array.isArray(r)?r:[r];return l._`${(0,s.checkDataTypes)(e,t,i.opts.strictNumbers,s.DataType.Wrong)}`}return l.nil}(),function(){if(n.validateSchema){const r=e.scopeValue("validate$data",{ref:n.validateSchema});return l._`!${r}(${t})`}return l.nil}())}subschema(e,t){const r=(0,u.getSubschema)(this.it,e);(0,u.extendSubschemaData)(r,this.it,e),(0,u.extendSubschemaMode)(r,e);const i={...this.it,...r,items:void 0,props:void 0};return function(e,t){g(e)&&(_(e),v(e))?function(e,t){const{schema:r,gen:n,opts:i}=e;i.$comment&&r.$comment&&w(e),function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,h.resolveUrl)(e.opts.uriResolver,e.baseId,t))}(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const o=n.const("_errs",f.default.errors);b(e,o),n.var(t,l._`${o} === ${f.default.errors}`)}(e,t):(0,n.boolOrEmptySchema)(e,t)}(i,t),i}mergeEvaluated(e,t){const{it:r,gen:n}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=d.mergeEvaluated.props(n,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=d.mergeEvaluated.items(n,e.items,r.items,t)))}mergeValidEvaluated(e,t){const{it:r,gen:n}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return n.if(t,(()=>this.mergeEvaluated(e,l.Name))),!0}}function k(e,t,r,n){const i=new I(e,r,t);"code"in r?r.code(i,n):i.$data&&r.validate?(0,c.funcKeywordCode)(i,r):"macro"in r?(0,c.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,c.funcKeywordCode)(i,r)}t.KeywordCxt=I;const N=/^\/(?:[^~]|~0|~1)*$/,D=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function A(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let i,o;if(""===e)return f.default.rootData;if("/"===e[0]){if(!N.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);i=e,o=f.default.rootData}else{const s=D.exec(e);if(!s)throw new Error(`Invalid JSON-pointer: ${e}`);const a=+s[1];if(i=s[2],"#"===i){if(a>=t)throw new Error(c("property/index",a));return n[t-a]}if(a>t)throw new Error(c("data",a));if(o=r[t-a],!i)return o}let s=o;const a=i.split("/");for(const e of a)e&&(o=l._`${o}${(0,l.getProperty)((0,d.unescapeJsonPointer)(e))}`,s=l._`${s} && ${o}`);return s;function c(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}t.getData=A},5782:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const n=r(5669),i=r(7250),o=r(3499),s=r(6930);function a(e){const{gen:t,data:r,it:i}=e;t.if(i.parentData,(()=>t.assign(r,n._`${i.parentData}[${i.parentDataProperty}]`)))}function c(e,t,r){if(void 0===r)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,n.stringify)(r)})}t.macroKeywordCode=function(e,t){const{gen:r,keyword:i,schema:o,parentSchema:s,it:a}=e,u=t.macro.call(a.self,o,s,a),l=c(r,i,u);!1!==a.opts.validateSchema&&a.self.validateSchema(u,!0);const f=r.name("valid");e.subschema({schema:u,schemaPath:n.nil,errSchemaPath:`${a.errSchemaPath}/${i}`,topSchemaRef:l,compositeRule:!0},f),e.pass(f,(()=>e.error(!0)))},t.funcKeywordCode=function(e,t){var r;const{gen:u,keyword:l,schema:f,parentSchema:h,$data:d,it:p}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(p,t);const m=!d&&t.compile?t.compile.call(p.self,f,h,p):t.validate,y=c(u,l,m),v=u.let("valid");function g(r=(t.async?n._`await `:n.nil)){const s=p.opts.passContext?i.default.this:i.default.self,a=!("compile"in t&&!d||!1===t.schema);u.assign(v,n._`${r}${(0,o.callValidateCode)(e,y,s,a)}`,t.modifying)}function _(e){var r;u.if((0,n.not)(null!==(r=t.valid)&&void 0!==r?r:v),e)}e.block$data(v,(function(){if(!1===t.errors)g(),t.modifying&&a(e),_((()=>e.error()));else{const r=t.async?function(){const e=u.let("ruleErrs",null);return u.try((()=>g(n._`await `)),(t=>u.assign(v,!1).if(n._`${t} instanceof ${p.ValidationError}`,(()=>u.assign(e,n._`${t}.errors`)),(()=>u.throw(t))))),e}():function(){const e=n._`${y}.errors`;return u.assign(e,null),g(n.nil),e}();t.modifying&&a(e),_((()=>function(e,t){const{gen:r}=e;r.if(n._`Array.isArray(${t})`,(()=>{r.assign(i.default.vErrors,n._`${i.default.vErrors} === null ? ${t} : ${i.default.vErrors}.concat(${t})`).assign(i.default.errors,n._`${i.default.vErrors}.length`),(0,s.extendErrors)(e)}),(()=>e.error()))}(e,r)))}})),e.ok(null!==(r=t.valid)&&void 0!==r?r:v)},t.validSchemaType=function(e,t,r=!1){return!t.length||t.some((t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e))},t.validateKeywordUsage=function({schema:e,opts:t,self:r,errSchemaPath:n},i,o){if(Array.isArray(i.keyword)?!i.keyword.includes(o):i.keyword!==o)throw new Error("ajv implementation error");const s=i.dependencies;if(null==s?void 0:s.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${o}: ${s.join(",")}`);if(i.validateSchema&&!i.validateSchema(e[o])){const e=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);r.logger.error(e)}}},8878:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;const n=r(5669),i=r(8936);t.getSubschema=function(e,{keyword:t,schemaProp:r,schema:o,schemaPath:s,errSchemaPath:a,topSchemaRef:c}){if(void 0!==t&&void 0!==o)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const o=e.schema[t];return void 0===r?{schema:o,schemaPath:n._`${e.schemaPath}${(0,n.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:o[r],schemaPath:n._`${e.schemaPath}${(0,n.getProperty)(t)}${(0,n.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,i.escapeFragment)(r)}`}}if(void 0!==o){if(void 0===s||void 0===a||void 0===c)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:o,schemaPath:s,topSchemaRef:c,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:r,dataPropType:o,data:s,dataTypes:a,propertyName:c}){if(void 0!==s&&void 0!==r)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:u}=t;if(void 0!==r){const{errorPath:s,dataPathArr:a,opts:c}=t;l(u.let("data",n._`${t.data}${(0,n.getProperty)(r)}`,!0)),e.errorPath=n.str`${s}${(0,i.getErrorPath)(r,o,c.jsPropertySyntax)}`,e.parentDataProperty=n._`${r}`,e.dataPathArr=[...a,e.parentDataProperty]}function l(r){e.data=r,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,r]}void 0!==s&&(l(s instanceof n.Name?s:u.let("data",s,!0)),void 0!==c&&(e.propertyName=c)),a&&(e.dataTypes=a)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:o}){void 0!==n&&(e.compositeRule=n),void 0!==i&&(e.createErrors=i),void 0!==o&&(e.allErrors=o),e.jtdDiscriminator=t,e.jtdMetadata=r}},8355:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var n=r(1686);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return n.KeywordCxt}});var i=r(5669);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return i._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return i.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return i.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return i.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return i.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return i.CodeGen}});const o=r(6448),s=r(1578),a=r(2881),c=r(7382),u=r(5669),l=r(6696),f=r(7332),h=r(8936),d=r(1143),p=r(407),m=(e,t)=>new RegExp(e,t);m.code="new RegExp";const y=["removeAdditional","useDefaults","coerceTypes"],v=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),g={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function b(e){var t,r,n,i,o,s,a,c,u,l,f,h,d,y,v,g,_,b,w,E,S,O,T,I,k;const N=e.strict,D=null===(t=e.code)||void 0===t?void 0:t.optimize,A=!0===D||void 0===D?1:D||0,R=null!==(n=null===(r=e.code)||void 0===r?void 0:r.regExp)&&void 0!==n?n:m,x=null!==(i=e.uriResolver)&&void 0!==i?i:p.default;return{strictSchema:null===(s=null!==(o=e.strictSchema)&&void 0!==o?o:N)||void 0===s||s,strictNumbers:null===(c=null!==(a=e.strictNumbers)&&void 0!==a?a:N)||void 0===c||c,strictTypes:null!==(l=null!==(u=e.strictTypes)&&void 0!==u?u:N)&&void 0!==l?l:"log",strictTuples:null!==(h=null!==(f=e.strictTuples)&&void 0!==f?f:N)&&void 0!==h?h:"log",strictRequired:null!==(y=null!==(d=e.strictRequired)&&void 0!==d?d:N)&&void 0!==y&&y,code:e.code?{...e.code,optimize:A,regExp:R}:{optimize:A,regExp:R},loopRequired:null!==(v=e.loopRequired)&&void 0!==v?v:200,loopEnum:null!==(g=e.loopEnum)&&void 0!==g?g:200,meta:null===(_=e.meta)||void 0===_||_,messages:null===(b=e.messages)||void 0===b||b,inlineRefs:null===(w=e.inlineRefs)||void 0===w||w,schemaId:null!==(E=e.schemaId)&&void 0!==E?E:"$id",addUsedSchema:null===(S=e.addUsedSchema)||void 0===S||S,validateSchema:null===(O=e.validateSchema)||void 0===O||O,validateFormats:null===(T=e.validateFormats)||void 0===T||T,unicodeRegExp:null===(I=e.unicodeRegExp)||void 0===I||I,int32range:null===(k=e.int32range)||void 0===k||k,uriResolver:x}}class w{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...b(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new u.ValueScope({scope:{},prefixes:v,es5:t,lines:r}),this.logger=function(e){if(!1===e)return N;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),E.call(this,g,e,"NOT SUPPORTED"),E.call(this,_,e,"DEPRECATED","warn"),this._metaOpts=k.call(this),e.formats&&T.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&I.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),O.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:r}=this.opts;let n=d;"id"===r&&(n={...d},n.id=n.$id,delete n.$id),t&&e&&this.addMetaSchema(n,n[r],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);const n=r(t);return"$async"in r||(this.errors=r.errors),n}compile(e,t){const r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(e,t){await i.call(this,e.$schema);const r=this._addSchema(e,t);return r.validate||o.call(this,r)}async function i(e){e&&!this.getSchema(e)&&await n.call(this,{$ref:e},!0)}async function o(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof s.default))throw t;return a.call(this,t),await c.call(this,t.missingSchema),o.call(this,e)}}function a({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){const r=await u.call(this,e);this.refs[e]||await i.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function u(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,n=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,r,n);return this}let i;if("object"==typeof e){const{schemaId:t}=this.opts;if(i=e[t],void 0!==i&&"string"!=typeof i)throw new Error(`schema ${t} must be string`)}return t=(0,l.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let r;if(r=e.$schema,void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const n=this.validate(r,e);if(!n&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return n}getSchema(e){let t;for(;"string"==typeof(t=S.call(this,e));)e=t;if(void 0===t){const{schemaId:r}=this.opts,n=new c.SchemaEnv({schema:{},schemaId:r});if(t=c.resolveSchema.call(this,n,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=S.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let r=e[this.opts.schemaId];return r&&(r=(0,l.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(r=(t=e).keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(A.call(this,r,t),!t)return(0,h.eachItem)(r,(e=>R.call(this,e))),this;P.call(this,t);const n={...t,type:(0,f.getJSONTypes)(t.type),schemaType:(0,f.getJSONTypes)(t.schemaType)};return(0,h.eachItem)(r,0===n.type.length?e=>R.call(this,e,n):e=>n.type.forEach((t=>R.call(this,e,n,t)))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const r of t.rules){const t=r.rules.findIndex((t=>t.keyword===e));t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map((e=>`${r}${e.instancePath} ${e.message}`)).reduce(((e,r)=>e+t+r)):"No errors"}$dataMetaSchema(e,t){const r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const n of t){const t=n.split("/").slice(1);let i=e;for(const e of t)i=i[e];for(const e in r){const t=r[e];if("object"!=typeof t)continue;const{$data:n}=t.definition,o=i[e];n&&o&&(i[e]=C(o))}}return e}_removeAllSchemas(e,t){for(const r in e){const n=e[r];t&&!t.test(r)||("string"==typeof n?delete e[r]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[r]))}}_addSchema(e,t,r,n=this.opts.validateSchema,i=this.opts.addUsedSchema){let o;const{schemaId:s}=this.opts;if("object"==typeof e)o=e[s];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let a=this._cache.get(e);if(void 0!==a)return a;r=(0,l.normalizeId)(o||r);const u=l.getSchemaRefs.call(this,e,r);return a=new c.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:r,localRefs:u}),this._cache.set(a.schema,a),i&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=a),n&&this.validateSchema(e,!0),a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):c.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,e)}finally{this.opts=t}}}function E(e,t,r,n="error"){for(const i in e){const o=i;o in t&&this.logger[n](`${r}: option ${i}. ${e[o]}`)}}function S(e){return e=(0,l.normalizeId)(e),this.schemas[e]||this.refs[e]}function O(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function T(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function I(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}}function k(){const e={...this.opts};for(const t of y)delete e[t];return e}t.default=w,w.ValidationError=o.default,w.MissingRefError=s.default;const N={log(){},warn(){},error(){}},D=/^[a-z_$][a-z0-9_$:-]*$/i;function A(e,t){const{RULES:r}=this;if((0,h.eachItem)(e,(e=>{if(r.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!D.test(e))throw new Error(`Keyword ${e} has invalid name`)})),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function R(e,t,r){var n;const i=null==t?void 0:t.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:o}=this;let s=i?o.post:o.rules.find((({type:e})=>e===r));if(s||(s={type:r,rules:[]},o.rules.push(s)),o.keywords[e]=!0,!t)return;const a={keyword:e,definition:{...t,type:(0,f.getJSONTypes)(t.type),schemaType:(0,f.getJSONTypes)(t.schemaType)}};t.before?x.call(this,s,a,t.before):s.rules.push(a),o.all[e]=a,null===(n=t.implements)||void 0===n||n.forEach((e=>this.addKeyword(e)))}function x(e,t,r){const n=e.rules.findIndex((e=>e.keyword===r));n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function P(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=C(t)),e.validateSchema=this.compile(t,!0))}const $={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function C(e){return{anyOf:[e,$]}}},4285:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(6471);n.code='require("ajv/dist/runtime/equal").default',t.default=n},9161:(e,t)=>{function r(e){const t=e.length;let r,n=0,i=0;for(;i<t;)n++,r=e.charCodeAt(i++),r>=55296&&r<=56319&&i<t&&(r=e.charCodeAt(i),56320==(64512&r)&&i++);return n}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,r.code='require("ajv/dist/runtime/ucs2length").default'},407:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(2371);n.code='require("ajv/dist/runtime/uri").default',t.default=n},6448:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});class r extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}t.default=r},8891:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;const n=r(5669),i=r(8936),o={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>n.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>n._`{limit: ${e}}`},code(e){const{parentSchema:t,it:r}=e,{items:n}=t;Array.isArray(n)?s(e,n):(0,i.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas')}};function s(e,t){const{gen:r,schema:o,data:s,keyword:a,it:c}=e;c.items=!0;const u=r.const("len",n._`${s}.length`);if(!1===o)e.setParams({len:t.length}),e.pass(n._`${u} <= ${t.length}`);else if("object"==typeof o&&!(0,i.alwaysValidSchema)(c,o)){const o=r.var("valid",n._`${u} <= ${t.length}`);r.if((0,n.not)(o),(()=>function(o){r.forRange("i",t.length,u,(t=>{e.subschema({keyword:a,dataProp:t,dataPropType:i.Type.Num},o),c.allErrors||r.if((0,n.not)(o),(()=>r.break()))}))}(o))),e.ok(o)}}t.validateAdditionalItems=s,t.default=o},4943:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(3499),i=r(5669),o=r(7250),s=r(8936),a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>i._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:r,parentSchema:a,data:c,errsCount:u,it:l}=e;if(!u)throw new Error("ajv implementation error");const{allErrors:f,opts:h}=l;if(l.props=!0,"all"!==h.removeAdditional&&(0,s.alwaysValidSchema)(l,r))return;const d=(0,n.allSchemaProperties)(a.properties),p=(0,n.allSchemaProperties)(a.patternProperties);function m(e){t.code(i._`delete ${c}[${e}]`)}function y(n){if("all"===h.removeAdditional||h.removeAdditional&&!1===r)m(n);else{if(!1===r)return e.setParams({additionalProperty:n}),e.error(),void(f||t.break());if("object"==typeof r&&!(0,s.alwaysValidSchema)(l,r)){const r=t.name("valid");"failing"===h.removeAdditional?(v(n,r,!1),t.if((0,i.not)(r),(()=>{e.reset(),m(n)}))):(v(n,r),f||t.if((0,i.not)(r),(()=>t.break())))}}}function v(t,r,n){const i={keyword:"additionalProperties",dataProp:t,dataPropType:s.Type.Str};!1===n&&Object.assign(i,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(i,r)}t.forIn("key",c,(r=>{d.length||p.length?t.if(function(r){let o;if(d.length>8){const e=(0,s.schemaRefOrVal)(l,a.properties,"properties");o=(0,n.isOwnProperty)(t,e,r)}else o=d.length?(0,i.or)(...d.map((e=>i._`${r} === ${e}`))):i.nil;return p.length&&(o=(0,i.or)(o,...p.map((t=>i._`${(0,n.usePattern)(e,t)}.test(${r})`)))),(0,i.not)(o)}(r),(()=>y(r))):y(r)})),e.ok(i._`${u} === ${o.default.errors}`)}};t.default=a},2609:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(8936),i={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const o=t.name("valid");r.forEach(((t,r)=>{if((0,n.alwaysValidSchema)(i,t))return;const s=e.subschema({keyword:"allOf",schemaProp:r},o);e.ok(o),e.mergeEvaluated(s)}))}};t.default=i},4279:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:r(3499).validateUnion,error:{message:"must match a schema in anyOf"}};t.default=n},5609:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(5669),i=r(8936),o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?n.str`must contain at least ${e} valid item(s)`:n.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?n._`{minContains: ${e}}`:n._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:r,parentSchema:o,data:s,it:a}=e;let c,u;const{minContains:l,maxContains:f}=o;a.opts.next?(c=void 0===l?1:l,u=f):c=1;const h=t.const("len",n._`${s}.length`);if(e.setParams({min:c,max:u}),void 0===u&&0===c)return void(0,i.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==u&&c>u)return(0,i.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,i.alwaysValidSchema)(a,r)){let t=n._`${h} >= ${c}`;return void 0!==u&&(t=n._`${t} && ${h} <= ${u}`),void e.pass(t)}a.items=!0;const d=t.name("valid");function p(){const e=t.name("_valid"),r=t.let("count",0);m(e,(()=>t.if(e,(()=>function(e){t.code(n._`${e}++`),void 0===u?t.if(n._`${e} >= ${c}`,(()=>t.assign(d,!0).break())):(t.if(n._`${e} > ${u}`,(()=>t.assign(d,!1).break())),1===c?t.assign(d,!0):t.if(n._`${e} >= ${c}`,(()=>t.assign(d,!0))))}(r)))))}function m(r,n){t.forRange("i",0,h,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:i.Type.Num,compositeRule:!0},r),n()}))}void 0===u&&1===c?m(d,(()=>t.if(d,(()=>t.break())))):0===c?(t.let(d,!0),void 0!==u&&t.if(n._`${s}.length > 0`,p)):(t.let(d,!1),p()),e.result(d,(()=>e.reset()))}};t.default=o},5463:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const n=r(5669),i=r(8936),o=r(3499);t.error={message:({params:{property:e,depsCount:t,deps:r}})=>{const i=1===t?"property":"properties";return n.str`must have ${i} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:i}})=>n._`{property: ${e},
6
6
  missingProperty: ${i},
7
7
  depsCount: ${t},
8
- deps: ${r}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,r]=function({schema:e}){const t={},r={};for(const n in e)"__proto__"!==n&&((Array.isArray(e[n])?t:r)[n]=e[n]);return[t,r]}(e);a(e,t),c(e,r)}};function a(e,t=e.schema){const{gen:r,data:i,it:s}=e;if(0===Object.keys(t).length)return;const a=r.let("missing");for(const c in t){const u=t[c];if(0===u.length)continue;const l=(0,o.propertyInData)(r,i,c,s.opts.ownProperties);e.setParams({property:c,depsCount:u.length,deps:u.join(", ")}),s.allErrors?r.if(l,(()=>{for(const t of u)(0,o.checkReportMissingProp)(e,t)})):(r.if(n._`${l} && (${(0,o.checkMissingProp)(e,u,a)})`),(0,o.reportMissingProp)(e,a),r.else())}}function c(e,t=e.schema){const{gen:r,data:n,keyword:s,it:a}=e,c=r.name("valid");for(const u in t)(0,i.alwaysValidSchema)(a,t[u])||(r.if((0,o.propertyInData)(r,n,u,a.opts.ownProperties),(()=>{const t=e.subschema({keyword:s,schemaProp:u},c);e.mergeValidEvaluated(t,c)}),(()=>r.var(c,!0))),e.ok(c))}t.validatePropertyDeps=a,t.validateSchemaDeps=c,t.default=s},76:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(5669),i=r(8936),o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>n.str`must match "${e.ifClause}" schema`,params:({params:e})=>n._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:r,it:o}=e;void 0===r.then&&void 0===r.else&&(0,i.checkStrictMode)(o,'"if" without "then" and "else" is ignored');const a=s(o,"then"),c=s(o,"else");if(!a&&!c)return;const u=t.let("valid",!0),l=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);e.mergeEvaluated(t)}(),e.reset(),a&&c){const r=t.let("ifClause");e.setParams({ifClause:r}),t.if(l,f("then",r),f("else",r))}else a?t.if(l,f("then")):t.if((0,n.not)(l),f("else"));function f(r,i){return()=>{const o=e.subschema({keyword:r},l);t.assign(u,l),e.mergeValidEvaluated(o,u),i?t.assign(i,n._`${r}`):e.setParams({ifClause:r})}}e.pass(u,(()=>e.error(!0)))}};function s(e,t){const r=e.schema[t];return void 0!==r&&!(0,i.alwaysValidSchema)(e,r)}t.default=o},6951:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(8891),i=r(1162),o=r(8634),s=r(5151),a=r(5609),c=r(5463),u=r(3021),l=r(4943),f=r(4243),h=r(8103),d=r(2869),p=r(4279),m=r(4880),y=r(2609),v=r(76),g=r(5316);t.default=function(e=!1){const t=[d.default,p.default,m.default,y.default,v.default,g.default,u.default,l.default,c.default,f.default,h.default];return e?t.push(i.default,s.default):t.push(n.default,o.default),t.push(a.default),t}},8634:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;const n=r(5669),i=r(8936),o=r(3499),s={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return a(e,"additionalItems",t);r.items=!0,(0,i.alwaysValidSchema)(r,t)||e.ok((0,o.validateArray)(e))}};function a(e,t,r=e.schema){const{gen:o,parentSchema:s,data:a,keyword:c,it:u}=e;!function(e){const{opts:n,errSchemaPath:o}=u,s=r.length,a=s===e.minItems&&(s===e.maxItems||!1===e[t]);if(n.strictTuples&&!a){const e=`"${c}" is ${s}-tuple, but minItems or maxItems/${t} are not specified or different at path "${o}"`;(0,i.checkStrictMode)(u,e,n.strictTuples)}}(s),u.opts.unevaluated&&r.length&&!0!==u.items&&(u.items=i.mergeEvaluated.items(o,r.length,u.items));const l=o.name("valid"),f=o.const("len",n._`${a}.length`);r.forEach(((t,r)=>{(0,i.alwaysValidSchema)(u,t)||(o.if(n._`${f} > ${r}`,(()=>e.subschema({keyword:c,schemaProp:r,dataProp:r},l))),e.ok(l))}))}t.validateTuple=a,t.default=s},5151:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(5669),i=r(8936),o=r(3499),s=r(8891),a={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>n.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>n._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:r,it:n}=e,{prefixItems:a}=r;n.items=!0,(0,i.alwaysValidSchema)(n,t)||(a?(0,s.validateAdditionalItems)(e,a):e.ok((0,o.validateArray)(e)))}};t.default=a},2869:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(8936),i={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:i}=e;if((0,n.alwaysValidSchema)(i,r))return void e.fail();const o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,(()=>e.reset()),(()=>e.error()))},error:{message:"must NOT be valid"}};t.default=i},4880:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(5669),i=r(8936),o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>n._`{passingSchemas: ${e.passing}}`},code(e){const{gen:t,schema:r,parentSchema:o,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&o.discriminator)return;const a=r,c=t.let("valid",!1),u=t.let("passing",null),l=t.name("_valid");e.setParams({passing:u}),t.block((function(){a.forEach(((r,o)=>{let a;(0,i.alwaysValidSchema)(s,r)?t.var(l,!0):a=e.subschema({keyword:"oneOf",schemaProp:o,compositeRule:!0},l),o>0&&t.if(n._`${l} && ${c}`).assign(c,!1).assign(u,n._`[${u}, ${o}]`).else(),t.if(l,(()=>{t.assign(c,!0),t.assign(u,o),a&&e.mergeEvaluated(a,n.Name)}))}))})),e.result(c,(()=>e.reset()),(()=>e.error(!0)))}};t.default=o},8103:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(3499),i=r(5669),o=r(8936),s=r(8936),a={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:a,parentSchema:c,it:u}=e,{opts:l}=u,f=(0,n.allSchemaProperties)(r),h=f.filter((e=>(0,o.alwaysValidSchema)(u,r[e])));if(0===f.length||h.length===f.length&&(!u.opts.unevaluated||!0===u.props))return;const d=l.strictSchema&&!l.allowMatchingProperties&&c.properties,p=t.name("valid");!0===u.props||u.props instanceof i.Name||(u.props=(0,s.evaluatedPropsToName)(t,u.props));const{props:m}=u;function y(e){for(const t in d)new RegExp(e).test(t)&&(0,o.checkStrictMode)(u,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function v(r){t.forIn("key",a,(o=>{t.if(i._`${(0,n.usePattern)(e,r)}.test(${o})`,(()=>{const n=h.includes(r);n||e.subschema({keyword:"patternProperties",schemaProp:r,dataProp:o,dataPropType:s.Type.Str},p),u.opts.unevaluated&&!0!==m?t.assign(i._`${m}[${o}]`,!0):n||u.allErrors||t.if((0,i.not)(p),(()=>t.break()))}))}))}!function(){for(const e of f)d&&y(e),u.allErrors?v(e):(t.var(p,!0),v(e),t.if(p))}()}};t.default=a},1162:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(8634),i={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,n.validateTuple)(e,"items")};t.default=i},4243:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(1686),i=r(3499),o=r(8936),s=r(4943),a={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,parentSchema:a,data:c,it:u}=e;"all"===u.opts.removeAdditional&&void 0===a.additionalProperties&&s.default.code(new n.KeywordCxt(u,s.default,"additionalProperties"));const l=(0,i.allSchemaProperties)(r);for(const e of l)u.definedProperties.add(e);u.opts.unevaluated&&l.length&&!0!==u.props&&(u.props=o.mergeEvaluated.props(t,(0,o.toHash)(l),u.props));const f=l.filter((e=>!(0,o.alwaysValidSchema)(u,r[e])));if(0===f.length)return;const h=t.name("valid");for(const r of f)d(r)?p(r):(t.if((0,i.propertyInData)(t,c,r,u.opts.ownProperties)),p(r),u.allErrors||t.else().var(h,!0),t.endIf()),e.it.definedProperties.add(r),e.ok(h);function d(e){return u.opts.useDefaults&&!u.compositeRule&&void 0!==r[e].default}function p(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},h)}}};t.default=a},3021:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(5669),i=r(8936),o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>n._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:r,data:o,it:s}=e;if((0,i.alwaysValidSchema)(s,r))return;const a=t.name("valid");t.forIn("key",o,(r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},a),t.if((0,n.not)(a),(()=>{e.error(!0),s.allErrors||t.break()}))})),e.ok(a)}};t.default=o},5316:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(8936),i={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){void 0===t.if&&(0,n.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};t.default=i},3499:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;const n=r(5669),i=r(8936),o=r(7250),s=r(8936);function a(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:n._`Object.prototype.hasOwnProperty`})}function c(e,t,r){return n._`${a(e)}.call(${t}, ${r})`}function u(e,t,r,i){const o=n._`${t}${(0,n.getProperty)(r)} === undefined`;return i?(0,n.or)(o,(0,n.not)(c(e,t,r))):o}function l(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}t.checkReportMissingProp=function(e,t){const{gen:r,data:i,it:o}=e;r.if(u(r,i,t,o.opts.ownProperties),(()=>{e.setParams({missingProperty:n._`${t}`},!0),e.error()}))},t.checkMissingProp=function({gen:e,data:t,it:{opts:r}},i,o){return(0,n.or)(...i.map((i=>(0,n.and)(u(e,t,i,r.ownProperties),n._`${o} = ${i}`))))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.hasPropFunc=a,t.isOwnProperty=c,t.propertyInData=function(e,t,r,i){const o=n._`${t}${(0,n.getProperty)(r)} !== undefined`;return i?n._`${o} && ${c(e,t,r)}`:o},t.noPropertyInData=u,t.allSchemaProperties=l,t.schemaProperties=function(e,t){return l(t).filter((r=>!(0,i.alwaysValidSchema)(e,t[r])))},t.callValidateCode=function({schemaCode:e,data:t,it:{gen:r,topSchemaRef:i,schemaPath:s,errorPath:a},it:c},u,l,f){const h=f?n._`${e}, ${t}, ${i}${s}`:t,d=[[o.default.instancePath,(0,n.strConcat)(o.default.instancePath,a)],[o.default.parentData,c.parentData],[o.default.parentDataProperty,c.parentDataProperty],[o.default.rootData,o.default.rootData]];c.opts.dynamicRef&&d.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);const p=n._`${h}, ${r.object(...d)}`;return l!==n.nil?n._`${u}.call(${l}, ${p})`:n._`${u}(${p})`};const f=n._`new RegExp`;t.usePattern=function({gen:e,it:{opts:t}},r){const i=t.unicodeRegExp?"u":"",{regExp:o}=t.code,a=o(r,i);return e.scopeValue("pattern",{key:a.toString(),ref:a,code:n._`${"new RegExp"===o.code?f:(0,s.useFunc)(e,o)}(${r}, ${i})`})},t.validateArray=function(e){const{gen:t,data:r,keyword:o,it:s}=e,a=t.name("valid");if(s.allErrors){const e=t.let("valid",!0);return c((()=>t.assign(e,!1))),e}return t.var(a,!0),c((()=>t.break())),a;function c(s){const c=t.const("len",n._`${r}.length`);t.forRange("i",0,c,(r=>{e.subschema({keyword:o,dataProp:r,dataPropType:i.Type.Num},a),t.if((0,n.not)(a),s)}))}},t.validateUnion=function(e){const{gen:t,schema:r,keyword:o,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some((e=>(0,i.alwaysValidSchema)(s,e)))&&!s.opts.unevaluated)return;const a=t.let("valid",!1),c=t.name("_valid");t.block((()=>r.forEach(((r,i)=>{const s=e.subschema({keyword:o,schemaProp:i,compositeRule:!0},c);t.assign(a,n._`${a} || ${c}`),e.mergeValidEvaluated(s,c)||t.if((0,n.not)(a))})))),e.result(a,(()=>e.reset()),(()=>e.error(!0)))}},1018:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});const r={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=r},2101:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(1018),i=r(1939),o=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",n.default,i.default];t.default=o},1939:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;const n=r(1578),i=r(3499),o=r(5669),s=r(7250),a=r(7382),c=r(8936),u={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:i}=e,{baseId:s,schemaEnv:c,validateName:u,opts:h,self:d}=i,{root:p}=c;if(("#"===r||"#/"===r)&&s===p.baseId)return function(){if(c===p)return f(e,u,c,c.$async);const r=t.scopeValue("root",{ref:p});return f(e,o._`${r}.validate`,p,p.$async)}();const m=a.resolveRef.call(d,p,s,r);if(void 0===m)throw new n.default(i.opts.uriResolver,s,r);return m instanceof a.SchemaEnv?function(t){const r=l(e,t);f(e,r,t,t.$async)}(m):function(n){const i=t.scopeValue("schema",!0===h.code.source?{ref:n,code:(0,o.stringify)(n)}:{ref:n}),s=t.name("valid"),a=e.subschema({schema:n,dataTypes:[],schemaPath:o.nil,topSchemaRef:i,errSchemaPath:r},s);e.mergeEvaluated(a),e.ok(s)}(m)}};function l(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):o._`${r.scopeValue("wrapper",{ref:t})}.validate`}function f(e,t,r,n){const{gen:a,it:u}=e,{allErrors:l,schemaEnv:f,opts:h}=u,d=h.passContext?s.default.this:o.nil;function p(e){const t=o._`${e}.errors`;a.assign(s.default.vErrors,o._`${s.default.vErrors} === null ? ${t} : ${s.default.vErrors}.concat(${t})`),a.assign(s.default.errors,o._`${s.default.vErrors}.length`)}function m(e){var t;if(!u.opts.unevaluated)return;const n=null===(t=null==r?void 0:r.validate)||void 0===t?void 0:t.evaluated;if(!0!==u.props)if(n&&!n.dynamicProps)void 0!==n.props&&(u.props=c.mergeEvaluated.props(a,n.props,u.props));else{const t=a.var("props",o._`${e}.evaluated.props`);u.props=c.mergeEvaluated.props(a,t,u.props,o.Name)}if(!0!==u.items)if(n&&!n.dynamicItems)void 0!==n.items&&(u.items=c.mergeEvaluated.items(a,n.items,u.items));else{const t=a.var("items",o._`${e}.evaluated.items`);u.items=c.mergeEvaluated.items(a,t,u.items,o.Name)}}n?function(){if(!f.$async)throw new Error("async schema referenced by sync schema");const r=a.let("valid");a.try((()=>{a.code(o._`await ${(0,i.callValidateCode)(e,t,d)}`),m(t),l||a.assign(r,!0)}),(e=>{a.if(o._`!(${e} instanceof ${u.ValidationError})`,(()=>a.throw(e))),p(e),l||a.assign(r,!1)})),e.ok(r)}():e.result((0,i.callValidateCode)(e,t,d),(()=>m(t)),(()=>p(t)))}t.getValidate=l,t.callRef=f,t.default=u},2:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(5669),i=r(7421),o=r(7382),s=r(8936),a={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===i.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>n._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},code(e){const{gen:t,data:r,schema:a,parentSchema:c,it:u}=e,{oneOf:l}=c;if(!u.opts.discriminator)throw new Error("discriminator: requires discriminator option");const f=a.propertyName;if("string"!=typeof f)throw new Error("discriminator: requires propertyName");if(a.mapping)throw new Error("discriminator: mapping is not supported");if(!l)throw new Error("discriminator: requires oneOf keyword");const h=t.let("valid",!1),d=t.const("tag",n._`${r}${(0,n.getProperty)(f)}`);function p(r){const i=t.name("valid"),o=e.subschema({keyword:"oneOf",schemaProp:r},i);return e.mergeEvaluated(o,n.Name),i}t.if(n._`typeof ${d} == "string"`,(()=>function(){const r=function(){var e;const t={},r=i(c);let n=!0;for(let t=0;t<l.length;t++){let c=l[t];(null==c?void 0:c.$ref)&&!(0,s.schemaHasRulesButRef)(c,u.self.RULES)&&(c=o.resolveRef.call(u.self,u.schemaEnv.root,u.baseId,null==c?void 0:c.$ref),c instanceof o.SchemaEnv&&(c=c.schema));const h=null===(e=null==c?void 0:c.properties)||void 0===e?void 0:e[f];if("object"!=typeof h)throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${f}"`);n=n&&(r||i(c)),a(h,t)}if(!n)throw new Error(`discriminator: "${f}" must be required`);return t;function i({required:e}){return Array.isArray(e)&&e.includes(f)}function a(e,t){if(e.const)h(e.const,t);else{if(!e.enum)throw new Error(`discriminator: "properties/${f}" must have "const" or "enum"`);for(const r of e.enum)h(r,t)}}function h(e,r){if("string"!=typeof e||e in t)throw new Error(`discriminator: "${f}" values must be unique strings`);t[e]=r}}();t.if(!1);for(const e in r)t.elseIf(n._`${d} === ${e}`),t.assign(h,p(r[e]));t.else(),e.error(!1,{discrError:i.DiscrError.Mapping,tag:d,tagName:f}),t.endIf()}()),(()=>e.error(!1,{discrError:i.DiscrError.Tag,tag:d,tagName:f}))),e.ok(h)}};t.default=a},7421:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,(r=t.DiscrError||(t.DiscrError={})).Tag="tag",r.Mapping="mapping"},5671:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(2101),i=r(7499),o=r(6951),s=r(4480),a=r(2480),c=[n.default,i.default,(0,o.default)(),s.default,a.metadataVocabulary,a.contentVocabulary];t.default=c},3599:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(5669),i={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>n.str`must match format "${e}"`,params:({schemaCode:e})=>n._`{format: ${e}}`},code(e,t){const{gen:r,data:i,$data:o,schema:s,schemaCode:a,it:c}=e,{opts:u,errSchemaPath:l,schemaEnv:f,self:h}=c;u.validateFormats&&(o?function(){const o=r.scopeValue("formats",{ref:h.formats,code:u.code.formats}),s=r.const("fDef",n._`${o}[${a}]`),c=r.let("fType"),l=r.let("format");r.if(n._`typeof ${s} == "object" && !(${s} instanceof RegExp)`,(()=>r.assign(c,n._`${s}.type || "string"`).assign(l,n._`${s}.validate`)),(()=>r.assign(c,n._`"string"`).assign(l,s))),e.fail$data((0,n.or)(!1===u.strictSchema?n.nil:n._`${a} && !${l}`,function(){const e=f.$async?n._`(${s}.async ? await ${l}(${i}) : ${l}(${i}))`:n._`${l}(${i})`,r=n._`(typeof ${l} == "function" ? ${e} : ${l}.test(${i}))`;return n._`${l} && ${l} !== true && ${c} === ${t} && !${r}`}()))}():function(){const o=h.formats[s];if(!o)return void function(){if(!1!==u.strictSchema)throw new Error(e());function e(){return`unknown format "${s}" ignored in schema at path "${l}"`}h.logger.warn(e())}();if(!0===o)return;const[a,c,d]=function(e){const t=e instanceof RegExp?(0,n.regexpCode)(e):u.code.formats?n._`${u.code.formats}${(0,n.getProperty)(s)}`:void 0,i=r.scopeValue("formats",{key:s,ref:e,code:t});return"object"!=typeof e||e instanceof RegExp?["string",e,i]:[e.type||"string",e.validate,n._`${i}.validate`]}(o);a===t&&e.pass(function(){if("object"==typeof o&&!(o instanceof RegExp)&&o.async){if(!f.$async)throw new Error("async format in sync schema");return n._`await ${d}(${i})`}return"function"==typeof c?n._`${d}(${i})`:n._`${d}.test(${i})`}())}())}};t.default=i},4480:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=[r(3599).default];t.default=n},2480:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},6577:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(5669),i=r(8936),o=r(4285),s={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>n._`{allowedValue: ${e}}`},code(e){const{gen:t,data:r,$data:s,schemaCode:a,schema:c}=e;s||c&&"object"==typeof c?e.fail$data(n._`!${(0,i.useFunc)(t,o.default)}(${r}, ${a})`):e.fail(n._`${c} !== ${r}`)}};t.default=s},9450:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(5669),i=r(8936),o=r(4285),s={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>n._`{allowedValues: ${e}}`},code(e){const{gen:t,data:r,$data:s,schema:a,schemaCode:c,it:u}=e;if(!s&&0===a.length)throw new Error("enum must have non-empty array");const l=a.length>=u.opts.loopEnum;let f;const h=()=>null!=f?f:f=(0,i.useFunc)(t,o.default);let d;if(l||s)d=t.let("valid"),e.block$data(d,(function(){t.assign(d,!1),t.forOf("v",c,(e=>t.if(n._`${h()}(${r}, ${e})`,(()=>t.assign(d,!0).break()))))}));else{if(!Array.isArray(a))throw new Error("ajv implementation error");const e=t.const("vSchema",c);d=(0,n.or)(...a.map(((t,i)=>function(e,t){const i=a[t];return"object"==typeof i&&null!==i?n._`${h()}(${r}, ${e}[${t}])`:n._`${r} === ${i}`}(e,i))))}e.pass(d)}};t.default=s},7499:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(1337),i=r(9706),o=r(9507),s=r(1216),a=r(34),c=r(6962),u=r(1135),l=r(194),f=r(6577),h=r(9450),d=[n.default,i.default,o.default,s.default,a.default,c.default,u.default,l.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},f.default,h.default];t.default=d},1135:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(5669),i={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const r="maxItems"===e?"more":"fewer";return n.str`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:i}=e,o="maxItems"===t?n.operators.GT:n.operators.LT;e.fail$data(n._`${r}.length ${o} ${i}`)}};t.default=i},9507:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(5669),i=r(8936),o=r(9161),s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const r="maxLength"===e?"more":"fewer";return n.str`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:s,it:a}=e,c="maxLength"===t?n.operators.GT:n.operators.LT,u=!1===a.opts.unicode?n._`${r}.length`:n._`${(0,i.useFunc)(e.gen,o.default)}(${r})`;e.fail$data(n._`${u} ${c} ${s}`)}};t.default=s},1337:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(5669),i=n.operators,o={maximum:{okStr:"<=",ok:i.LTE,fail:i.GT},minimum:{okStr:">=",ok:i.GTE,fail:i.LT},exclusiveMaximum:{okStr:"<",ok:i.LT,fail:i.GTE},exclusiveMinimum:{okStr:">",ok:i.GT,fail:i.LTE}},s={message:({keyword:e,schemaCode:t})=>n.str`must be ${o[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>n._`{comparison: ${o[e].okStr}, limit: ${t}}`},a={keyword:Object.keys(o),type:"number",schemaType:"number",$data:!0,error:s,code(e){const{keyword:t,data:r,schemaCode:i}=e;e.fail$data(n._`${r} ${o[t].fail} ${i} || isNaN(${r})`)}};t.default=a},34:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(5669),i={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const r="maxProperties"===e?"more":"fewer";return n.str`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:i}=e,o="maxProperties"===t?n.operators.GT:n.operators.LT;e.fail$data(n._`Object.keys(${r}).length ${o} ${i}`)}};t.default=i},9706:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(5669),i={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>n.str`must be multiple of ${e}`,params:({schemaCode:e})=>n._`{multipleOf: ${e}}`},code(e){const{gen:t,data:r,schemaCode:i,it:o}=e,s=o.opts.multipleOfPrecision,a=t.let("res"),c=s?n._`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:n._`${a} !== parseInt(${a})`;e.fail$data(n._`(${i} === 0 || (${a} = ${r}/${i}, ${c}))`)}};t.default=i},1216:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(3499),i=r(5669),o={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>i.str`must match pattern "${e}"`,params:({schemaCode:e})=>i._`{pattern: ${e}}`},code(e){const{data:t,$data:r,schema:o,schemaCode:s,it:a}=e,c=a.opts.unicodeRegExp?"u":"",u=r?i._`(new RegExp(${s}, ${c}))`:(0,n.usePattern)(e,o);e.fail$data(i._`!${u}.test(${t})`)}};t.default=o},6962:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(3499),i=r(5669),o=r(8936),s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>i.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>i._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:r,schemaCode:s,data:a,$data:c,it:u}=e,{opts:l}=u;if(!c&&0===r.length)return;const f=r.length>=l.loopRequired;if(u.allErrors?function(){if(f||c)e.block$data(i.nil,h);else for(const t of r)(0,n.checkReportMissingProp)(e,t)}():function(){const o=t.let("missing");if(f||c){const r=t.let("valid",!0);e.block$data(r,(()=>function(r,o){e.setParams({missingProperty:r}),t.forOf(r,s,(()=>{t.assign(o,(0,n.propertyInData)(t,a,r,l.ownProperties)),t.if((0,i.not)(o),(()=>{e.error(),t.break()}))}),i.nil)}(o,r))),e.ok(r)}else t.if((0,n.checkMissingProp)(e,r,o)),(0,n.reportMissingProp)(e,o),t.else()}(),l.strictRequired){const t=e.parentSchema.properties,{definedProperties:n}=e.it;for(const e of r)if(void 0===(null==t?void 0:t[e])&&!n.has(e)){const t=`required property "${e}" is not defined at "${u.schemaEnv.baseId+u.errSchemaPath}" (strictRequired)`;(0,o.checkStrictMode)(u,t,u.opts.strictRequired)}}function h(){t.forOf("prop",s,(r=>{e.setParams({missingProperty:r}),t.if((0,n.noPropertyInData)(t,a,r,l.ownProperties),(()=>e.error()))}))}}};t.default=s},194:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(7332),i=r(5669),o=r(8936),s=r(4285),a={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>i.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>i._`{i: ${e}, j: ${t}}`},code(e){const{gen:t,data:r,$data:a,schema:c,parentSchema:u,schemaCode:l,it:f}=e;if(!a&&!c)return;const h=t.let("valid"),d=u.items?(0,n.getSchemaTypes)(u.items):[];function p(o,s){const a=t.name("item"),c=(0,n.checkDataTypes)(d,a,f.opts.strictNumbers,n.DataType.Wrong),u=t.const("indices",i._`{}`);t.for(i._`;${o}--;`,(()=>{t.let(a,i._`${r}[${o}]`),t.if(c,i._`continue`),d.length>1&&t.if(i._`typeof ${a} == "string"`,i._`${a} += "_"`),t.if(i._`typeof ${u}[${a}] == "number"`,(()=>{t.assign(s,i._`${u}[${a}]`),e.error(),t.assign(h,!1).break()})).code(i._`${u}[${a}] = ${o}`)}))}function m(n,a){const c=(0,o.useFunc)(t,s.default),u=t.name("outer");t.label(u).for(i._`;${n}--;`,(()=>t.for(i._`${a} = ${n}; ${a}--;`,(()=>t.if(i._`${c}(${r}[${n}], ${r}[${a}])`,(()=>{e.error(),t.assign(h,!1).break(u)}))))))}e.block$data(h,(function(){const n=t.let("i",i._`${r}.length`),o=t.let("j");e.setParams({i:n,j:o}),t.assign(h,!0),t.if(i._`${n} > 1`,(()=>(d.length>0&&!d.some((e=>"object"===e||"array"===e))?p:m)(n,o)))}),i._`${l} === false`),e.ok(h)}};t.default=a},2943:e=>{var t=e.exports=function(e,t,n){"function"==typeof t&&(n=t,t={}),r(t,"function"==typeof(n=t.cb||n)?n:n.pre||function(){},n.post||function(){},e,"",e)};function r(e,n,i,o,s,a,c,u,l,f){if(o&&"object"==typeof o&&!Array.isArray(o)){for(var h in n(o,s,a,c,u,l,f),o){var d=o[h];if(Array.isArray(d)){if(h in t.arrayKeywords)for(var p=0;p<d.length;p++)r(e,n,i,d[p],s+"/"+h+"/"+p,a,s,h,o,p)}else if(h in t.propsKeywords){if(d&&"object"==typeof d)for(var m in d)r(e,n,i,d[m],s+"/"+h+"/"+m.replace(/~/g,"~0").replace(/\//g,"~1"),a,s,h,o,m)}else(h in t.keywords||e.allKeys&&!(h in t.skipKeywords))&&r(e,n,i,d,s+"/"+h,a,s,h,o)}i(o,s,a,c,u,l,f)}}t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}},2091:function(e,t,r){var n,i;i=function(e){var t=["N","E","A","D"];function r(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function n(e,t){Object.defineProperty(this,"kind",{value:e,enumerable:!0}),t&&t.length&&Object.defineProperty(this,"path",{value:t,enumerable:!0})}function i(e,t,r){i.super_.call(this,"E",e),Object.defineProperty(this,"lhs",{value:t,enumerable:!0}),Object.defineProperty(this,"rhs",{value:r,enumerable:!0})}function o(e,t){o.super_.call(this,"N",e),Object.defineProperty(this,"rhs",{value:t,enumerable:!0})}function s(e,t){s.super_.call(this,"D",e),Object.defineProperty(this,"lhs",{value:t,enumerable:!0})}function a(e,t,r){a.super_.call(this,"A",e),Object.defineProperty(this,"index",{value:t,enumerable:!0}),Object.defineProperty(this,"item",{value:r,enumerable:!0})}function c(e,t,r){var n=e.slice((r||t)+1||e.length);return e.length=t<0?e.length+t:t,e.push.apply(e,n),e}function u(e){var t=typeof e;return"object"!==t?t:e===Math?"math":null===e?"null":Array.isArray(e)?"array":"[object Date]"===Object.prototype.toString.call(e)?"date":"function"==typeof e.toString&&/^\/.*\//.test(e.toString())?"regexp":"object"}function l(e){var t=0;if(0===e.length)return t;for(var r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t&=t;return t}function f(e){var t=0,r=u(e);if("array"===r)return e.forEach((function(e){t+=f(e)})),t+l("[type: array, hash: "+t+"]");if("object"===r){for(var n in e)if(e.hasOwnProperty(n)){var i="[ type: object, key: "+n+", value hash: "+f(e[n])+"]";t+=l(i)}return t}return t+l("[ type: "+r+" ; value: "+e+"]")}function h(e,t,r,n,c,l,d,p){r=r||[],d=d||[];var m=(c=c||[]).slice(0);if(null!=l){if(n){if("function"==typeof n&&n(m,l))return;if("object"==typeof n){if(n.prefilter&&n.prefilter(m,l))return;if(n.normalize){var y=n.normalize(m,l,e,t);y&&(e=y[0],t=y[1])}}}m.push(l)}"regexp"===u(e)&&"regexp"===u(t)&&(e=e.toString(),t=t.toString());var v,g,_,b,w=typeof e,E=typeof t,S="undefined"!==w||d&&d.length>0&&d[d.length-1].lhs&&Object.getOwnPropertyDescriptor(d[d.length-1].lhs,l),O="undefined"!==E||d&&d.length>0&&d[d.length-1].rhs&&Object.getOwnPropertyDescriptor(d[d.length-1].rhs,l);if(!S&&O)r.push(new o(m,t));else if(!O&&S)r.push(new s(m,e));else if(u(e)!==u(t))r.push(new i(m,e,t));else if("date"===u(e)&&e-t!=0)r.push(new i(m,e,t));else if("object"===w&&null!==e&&null!==t){for(v=d.length-1;v>-1;--v)if(d[v].lhs===e){b=!0;break}if(b)e!==t&&r.push(new i(m,e,t));else{if(d.push({lhs:e,rhs:t}),Array.isArray(e)){for(p&&(e.sort((function(e,t){return f(e)-f(t)})),t.sort((function(e,t){return f(e)-f(t)}))),v=t.length-1,g=e.length-1;v>g;)r.push(new a(m,v,new o(void 0,t[v--])));for(;g>v;)r.push(new a(m,g,new s(void 0,e[g--])));for(;v>=0;--v)h(e[v],t[v],r,n,m,v,d,p)}else{var I=Object.keys(e),T=Object.keys(t);for(v=0;v<I.length;++v)_=I[v],(b=T.indexOf(_))>=0?(h(e[_],t[_],r,n,m,_,d,p),T[b]=null):h(e[_],void 0,r,n,m,_,d,p);for(v=0;v<T.length;++v)(_=T[v])&&h(void 0,t[_],r,n,m,_,d,p)}d.length=d.length-1}}else e!==t&&("number"===w&&isNaN(e)&&isNaN(t)||r.push(new i(m,e,t)))}function d(e,t,r,n,i){var o=[];if(h(e,t,o,n,null,null,null,i),r)for(var s=0;s<o.length;++s)r(o[s]);return o}function p(e,t,r,n){var i=d(e,t,n?function(e){e&&n.push(e)}:void 0,r);return n||(i.length?i:void 0)}function m(e,t,r){if(r.path&&r.path.length){var n,i=e[t],o=r.path.length-1;for(n=0;n<o;n++)i=i[r.path[n]];switch(r.kind){case"A":m(i[r.path[n]],r.index,r.item);break;case"D":delete i[r.path[n]];break;case"E":case"N":i[r.path[n]]=r.rhs}}else switch(r.kind){case"A":m(e[t],r.index,r.item);break;case"D":e=c(e,t);break;case"E":case"N":e[t]=r.rhs}return e}function y(e,r,n){if(void 0===n&&r&&~t.indexOf(r.kind)&&(n=r),e&&n&&n.kind){for(var i=e,o=-1,s=n.path?n.path.length-1:0;++o<s;)void 0===i[n.path[o]]&&(i[n.path[o]]=void 0!==n.path[o+1]&&"number"==typeof n.path[o+1]?[]:{}),i=i[n.path[o]];switch(n.kind){case"A":n.path&&void 0===i[n.path[o]]&&(i[n.path[o]]=[]),m(n.path?i[n.path[o]]:i,n.index,n.item);break;case"D":delete i[n.path[o]];break;case"E":case"N":i[n.path[o]]=n.rhs}}}function v(e,t,r){if(r.path&&r.path.length){var n,i=e[t],o=r.path.length-1;for(n=0;n<o;n++)i=i[r.path[n]];switch(r.kind){case"A":v(i[r.path[n]],r.index,r.item);break;case"D":case"E":i[r.path[n]]=r.lhs;break;case"N":delete i[r.path[n]]}}else switch(r.kind){case"A":v(e[t],r.index,r.item);break;case"D":case"E":e[t]=r.lhs;break;case"N":e=c(e,t)}return e}return r(i,n),r(o,n),r(s,n),r(a,n),Object.defineProperties(p,{diff:{value:p,enumerable:!0},orderIndependentDiff:{value:function(e,t,r,n){var i=d(e,t,n?function(e){e&&n.push(e)}:void 0,r,!0);return n||(i.length?i:void 0)},enumerable:!0},observableDiff:{value:d,enumerable:!0},orderIndependentObservableDiff:{value:function(e,t,r,n,i,o,s){return h(e,t,r,n,i,o,s,!0)},enumerable:!0},orderIndepHash:{value:f,enumerable:!0},applyDiff:{value:function(e,t,r){e&&t&&d(e,t,(function(n){r&&!r(e,t,n)||y(e,t,n)}))},enumerable:!0},applyChange:{value:y,enumerable:!0},revertChange:{value:function(e,t,r){if(e&&t&&r&&r.kind){var n,i,o=e;for(i=r.path.length-1,n=0;n<i;n++)void 0===o[r.path[n]]&&(o[r.path[n]]={}),o=o[r.path[n]];switch(r.kind){case"A":v(o[r.path[n]],r.index,r.item);break;case"D":case"E":o[r.path[n]]=r.lhs;break;case"N":delete o[r.path[n]]}}},enumerable:!0},isConflict:{value:function(){return"undefined"!=typeof $conflict},enumerable:!0}}),p.DeepDiff=p,e&&(e.DeepDiff=p),p}(this),void 0===(n=function(){return i}.call(t,r,t,e))||(e.exports=n)},6471:e=>{e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(i=n;0!=i--;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(o=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;0!=i--;){var s=o[i];if(!e(t[s],r[s]))return!1}return!0}return t!=t&&r!=r}},8784:function(e,t,r){var n;e=r.nmd(e),function(){var i,o="Expected a function",s="__lodash_hash_undefined__",a="__lodash_placeholder__",c=32,u=128,l=1/0,f=9007199254740991,h=NaN,d=4294967295,p=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",c],["partialRight",64],["rearg",256]],m="[object Arguments]",y="[object Array]",v="[object Boolean]",g="[object Date]",_="[object Error]",b="[object Function]",w="[object GeneratorFunction]",E="[object Map]",S="[object Number]",O="[object Object]",I="[object Promise]",T="[object RegExp]",k="[object Set]",N="[object String]",D="[object Symbol]",A="[object WeakMap]",R="[object ArrayBuffer]",x="[object DataView]",P="[object Float32Array]",$="[object Float64Array]",C="[object Int8Array]",j="[object Int16Array]",M="[object Int32Array]",F="[object Uint8Array]",q="[object Uint8ClampedArray]",V="[object Uint16Array]",L="[object Uint32Array]",U=/\b__p \+= '';/g,Q=/\b(__p \+=) '' \+/g,B=/(__e\(.*?\)|\b__t\)) \+\n'';/g,z=/&(?:amp|lt|gt|quot|#39);/g,Y=/[&<>"']/g,K=RegExp(z.source),H=RegExp(Y.source),G=/<%-([\s\S]+?)%>/g,W=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,X=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,re=RegExp(te.source),ne=/^\s+/,ie=/\s/,oe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,se=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,ce=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ue=/[()=,{}\[\]\/\s]/,le=/\\(\\)?/g,fe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,he=/\w*$/,de=/^[-+]0x[0-9a-f]+$/i,pe=/^0b[01]+$/i,me=/^\[object .+?Constructor\]$/,ye=/^0o[0-7]+$/i,ve=/^(?:0|[1-9]\d*)$/,ge=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_e=/($^)/,be=/['\n\r\u2028\u2029\\]/g,we="\\ud800-\\udfff",Ee="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Se="\\u2700-\\u27bf",Oe="a-z\\xdf-\\xf6\\xf8-\\xff",Ie="A-Z\\xc0-\\xd6\\xd8-\\xde",Te="\\ufe0e\\ufe0f",ke="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ne="["+we+"]",De="["+ke+"]",Ae="["+Ee+"]",Re="\\d+",xe="["+Se+"]",Pe="["+Oe+"]",$e="[^"+we+ke+Re+Se+Oe+Ie+"]",Ce="\\ud83c[\\udffb-\\udfff]",je="[^"+we+"]",Me="(?:\\ud83c[\\udde6-\\uddff]){2}",Fe="[\\ud800-\\udbff][\\udc00-\\udfff]",qe="["+Ie+"]",Ve="\\u200d",Le="(?:"+Pe+"|"+$e+")",Ue="(?:"+qe+"|"+$e+")",Qe="(?:['’](?:d|ll|m|re|s|t|ve))?",Be="(?:['’](?:D|LL|M|RE|S|T|VE))?",ze="(?:"+Ae+"|"+Ce+")?",Ye="["+Te+"]?",Ke=Ye+ze+"(?:"+Ve+"(?:"+[je,Me,Fe].join("|")+")"+Ye+ze+")*",He="(?:"+[xe,Me,Fe].join("|")+")"+Ke,Ge="(?:"+[je+Ae+"?",Ae,Me,Fe,Ne].join("|")+")",We=RegExp("['’]","g"),Je=RegExp(Ae,"g"),Ze=RegExp(Ce+"(?="+Ce+")|"+Ge+Ke,"g"),Xe=RegExp([qe+"?"+Pe+"+"+Qe+"(?="+[De,qe,"$"].join("|")+")",Ue+"+"+Be+"(?="+[De,qe+Le,"$"].join("|")+")",qe+"?"+Le+"+"+Qe,qe+"+"+Be,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Re,He].join("|"),"g"),et=RegExp("["+Ve+we+Ee+Te+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],nt=-1,it={};it[P]=it[$]=it[C]=it[j]=it[M]=it[F]=it[q]=it[V]=it[L]=!0,it[m]=it[y]=it[R]=it[v]=it[x]=it[g]=it[_]=it[b]=it[E]=it[S]=it[O]=it[T]=it[k]=it[N]=it[A]=!1;var ot={};ot[m]=ot[y]=ot[R]=ot[x]=ot[v]=ot[g]=ot[P]=ot[$]=ot[C]=ot[j]=ot[M]=ot[E]=ot[S]=ot[O]=ot[T]=ot[k]=ot[N]=ot[D]=ot[F]=ot[q]=ot[V]=ot[L]=!0,ot[_]=ot[b]=ot[A]=!1;var st={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},at=parseFloat,ct=parseInt,ut="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,lt="object"==typeof self&&self&&self.Object===Object&&self,ft=ut||lt||Function("return this")(),ht=t&&!t.nodeType&&t,dt=ht&&e&&!e.nodeType&&e,pt=dt&&dt.exports===ht,mt=pt&&ut.process,yt=function(){try{return dt&&dt.require&&dt.require("util").types||mt&&mt.binding&&mt.binding("util")}catch(e){}}(),vt=yt&&yt.isArrayBuffer,gt=yt&&yt.isDate,_t=yt&&yt.isMap,bt=yt&&yt.isRegExp,wt=yt&&yt.isSet,Et=yt&&yt.isTypedArray;function St(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function Ot(e,t,r,n){for(var i=-1,o=null==e?0:e.length;++i<o;){var s=e[i];t(n,s,r(s),e)}return n}function It(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function Tt(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function kt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}function Nt(e,t){for(var r=-1,n=null==e?0:e.length,i=0,o=[];++r<n;){var s=e[r];t(s,r,e)&&(o[i++]=s)}return o}function Dt(e,t){return!(null==e||!e.length)&&qt(e,t,0)>-1}function At(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}function Rt(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function xt(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function Pt(e,t,r,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(r=e[++i]);++i<o;)r=t(r,e[i],i,e);return r}function $t(e,t,r,n){var i=null==e?0:e.length;for(n&&i&&(r=e[--i]);i--;)r=t(r,e[i],i,e);return r}function Ct(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var jt=Qt("length");function Mt(e,t,r){var n;return r(e,(function(e,r,i){if(t(e,r,i))return n=r,!1})),n}function Ft(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function qt(e,t,r){return t==t?function(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}(e,t,r):Ft(e,Lt,r)}function Vt(e,t,r,n){for(var i=r-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function Lt(e){return e!=e}function Ut(e,t){var r=null==e?0:e.length;return r?Yt(e,t)/r:h}function Qt(e){return function(t){return null==t?i:t[e]}}function Bt(e){return function(t){return null==e?i:e[t]}}function zt(e,t,r,n,i){return i(e,(function(e,i,o){r=n?(n=!1,e):t(r,e,i,o)})),r}function Yt(e,t){for(var r,n=-1,o=e.length;++n<o;){var s=t(e[n]);s!==i&&(r=r===i?s:r+s)}return r}function Kt(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Ht(e){return e?e.slice(0,fr(e)+1).replace(ne,""):e}function Gt(e){return function(t){return e(t)}}function Wt(e,t){return Rt(t,(function(t){return e[t]}))}function Jt(e,t){return e.has(t)}function Zt(e,t){for(var r=-1,n=e.length;++r<n&&qt(t,e[r],0)>-1;);return r}function Xt(e,t){for(var r=e.length;r--&&qt(t,e[r],0)>-1;);return r}var er=Bt({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),tr=Bt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function rr(e){return"\\"+st[e]}function nr(e){return et.test(e)}function ir(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function or(e,t){return function(r){return e(t(r))}}function sr(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var s=e[r];s!==t&&s!==a||(e[r]=a,o[i++]=r)}return o}function ar(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}function cr(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=[e,e]})),r}function ur(e){return nr(e)?function(e){for(var t=Ze.lastIndex=0;Ze.test(e);)++t;return t}(e):jt(e)}function lr(e){return nr(e)?function(e){return e.match(Ze)||[]}(e):function(e){return e.split("")}(e)}function fr(e){for(var t=e.length;t--&&ie.test(e.charAt(t)););return t}var hr=Bt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),dr=function e(t){var r,n=(t=null==t?ft:dr.defaults(ft.Object(),t,dr.pick(ft,rt))).Array,ie=t.Date,we=t.Error,Ee=t.Function,Se=t.Math,Oe=t.Object,Ie=t.RegExp,Te=t.String,ke=t.TypeError,Ne=n.prototype,De=Ee.prototype,Ae=Oe.prototype,Re=t["__core-js_shared__"],xe=De.toString,Pe=Ae.hasOwnProperty,$e=0,Ce=(r=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",je=Ae.toString,Me=xe.call(Oe),Fe=ft._,qe=Ie("^"+xe.call(Pe).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ve=pt?t.Buffer:i,Le=t.Symbol,Ue=t.Uint8Array,Qe=Ve?Ve.allocUnsafe:i,Be=or(Oe.getPrototypeOf,Oe),ze=Oe.create,Ye=Ae.propertyIsEnumerable,Ke=Ne.splice,He=Le?Le.isConcatSpreadable:i,Ge=Le?Le.iterator:i,Ze=Le?Le.toStringTag:i,et=function(){try{var e=co(Oe,"defineProperty");return e({},"",{}),e}catch(e){}}(),st=t.clearTimeout!==ft.clearTimeout&&t.clearTimeout,ut=ie&&ie.now!==ft.Date.now&&ie.now,lt=t.setTimeout!==ft.setTimeout&&t.setTimeout,ht=Se.ceil,dt=Se.floor,mt=Oe.getOwnPropertySymbols,yt=Ve?Ve.isBuffer:i,jt=t.isFinite,Bt=Ne.join,pr=or(Oe.keys,Oe),mr=Se.max,yr=Se.min,vr=ie.now,gr=t.parseInt,_r=Se.random,br=Ne.reverse,wr=co(t,"DataView"),Er=co(t,"Map"),Sr=co(t,"Promise"),Or=co(t,"Set"),Ir=co(t,"WeakMap"),Tr=co(Oe,"create"),kr=Ir&&new Ir,Nr={},Dr=Mo(wr),Ar=Mo(Er),Rr=Mo(Sr),xr=Mo(Or),Pr=Mo(Ir),$r=Le?Le.prototype:i,Cr=$r?$r.valueOf:i,jr=$r?$r.toString:i;function Mr(e){if(ea(e)&&!Qs(e)&&!(e instanceof Lr)){if(e instanceof Vr)return e;if(Pe.call(e,"__wrapped__"))return Fo(e)}return new Vr(e)}var Fr=function(){function e(){}return function(t){if(!Xs(t))return{};if(ze)return ze(t);e.prototype=t;var r=new e;return e.prototype=i,r}}();function qr(){}function Vr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function Lr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Ur(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Qr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Br(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function zr(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new Br;++t<r;)this.add(e[t])}function Yr(e){var t=this.__data__=new Qr(e);this.size=t.size}function Kr(e,t){var r=Qs(e),n=!r&&Us(e),i=!r&&!n&&Ks(e),o=!r&&!n&&!i&&ca(e),s=r||n||i||o,a=s?Kt(e.length,Te):[],c=a.length;for(var u in e)!t&&!Pe.call(e,u)||s&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||yo(u,c))||a.push(u);return a}function Hr(e){var t=e.length;return t?e[zn(0,t-1)]:i}function Gr(e,t){return xo(Ti(e),on(t,0,e.length))}function Wr(e){return xo(Ti(e))}function Jr(e,t,r){(r!==i&&!qs(e[t],r)||r===i&&!(t in e))&&rn(e,t,r)}function Zr(e,t,r){var n=e[t];Pe.call(e,t)&&qs(n,r)&&(r!==i||t in e)||rn(e,t,r)}function Xr(e,t){for(var r=e.length;r--;)if(qs(e[r][0],t))return r;return-1}function en(e,t,r,n){return ln(e,(function(e,i,o){t(n,e,r(e),o)})),n}function tn(e,t){return e&&ki(t,Aa(t),e)}function rn(e,t,r){"__proto__"==t&&et?et(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function nn(e,t){for(var r=-1,o=t.length,s=n(o),a=null==e;++r<o;)s[r]=a?i:Ia(e,t[r]);return s}function on(e,t,r){return e==e&&(r!==i&&(e=e<=r?e:r),t!==i&&(e=e>=t?e:t)),e}function sn(e,t,r,n,o,s){var a,c=1&t,u=2&t,l=4&t;if(r&&(a=o?r(e,n,o,s):r(e)),a!==i)return a;if(!Xs(e))return e;var f=Qs(e);if(f){if(a=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&Pe.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!c)return Ti(e,a)}else{var h=fo(e),d=h==b||h==w;if(Ks(e))return bi(e,c);if(h==O||h==m||d&&!o){if(a=u||d?{}:po(e),!c)return u?function(e,t){return ki(e,lo(e),t)}(e,function(e,t){return e&&ki(t,Ra(t),e)}(a,e)):function(e,t){return ki(e,uo(e),t)}(e,tn(a,e))}else{if(!ot[h])return o?e:{};a=function(e,t,r){var n,i=e.constructor;switch(t){case R:return wi(e);case v:case g:return new i(+e);case x:return function(e,t){var r=t?wi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case P:case $:case C:case j:case M:case F:case q:case V:case L:return Ei(e,r);case E:return new i;case S:case N:return new i(e);case T:return function(e){var t=new e.constructor(e.source,he.exec(e));return t.lastIndex=e.lastIndex,t}(e);case k:return new i;case D:return n=e,Cr?Oe(Cr.call(n)):{}}}(e,h,c)}}s||(s=new Yr);var p=s.get(e);if(p)return p;s.set(e,a),oa(e)?e.forEach((function(n){a.add(sn(n,t,r,n,e,s))})):ta(e)&&e.forEach((function(n,i){a.set(i,sn(n,t,r,i,e,s))}));var y=f?i:(l?u?to:eo:u?Ra:Aa)(e);return It(y||e,(function(n,i){y&&(n=e[i=n]),Zr(a,i,sn(n,t,r,i,e,s))})),a}function an(e,t,r){var n=r.length;if(null==e)return!n;for(e=Oe(e);n--;){var o=r[n],s=t[o],a=e[o];if(a===i&&!(o in e)||!s(a))return!1}return!0}function cn(e,t,r){if("function"!=typeof e)throw new ke(o);return No((function(){e.apply(i,r)}),t)}function un(e,t,r,n){var i=-1,o=Dt,s=!0,a=e.length,c=[],u=t.length;if(!a)return c;r&&(t=Rt(t,Gt(r))),n?(o=At,s=!1):t.length>=200&&(o=Jt,s=!1,t=new zr(t));e:for(;++i<a;){var l=e[i],f=null==r?l:r(l);if(l=n||0!==l?l:0,s&&f==f){for(var h=u;h--;)if(t[h]===f)continue e;c.push(l)}else o(t,f,n)||c.push(l)}return c}Mr.templateSettings={escape:G,evaluate:W,interpolate:J,variable:"",imports:{_:Mr}},Mr.prototype=qr.prototype,Mr.prototype.constructor=Mr,Vr.prototype=Fr(qr.prototype),Vr.prototype.constructor=Vr,Lr.prototype=Fr(qr.prototype),Lr.prototype.constructor=Lr,Ur.prototype.clear=function(){this.__data__=Tr?Tr(null):{},this.size=0},Ur.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ur.prototype.get=function(e){var t=this.__data__;if(Tr){var r=t[e];return r===s?i:r}return Pe.call(t,e)?t[e]:i},Ur.prototype.has=function(e){var t=this.__data__;return Tr?t[e]!==i:Pe.call(t,e)},Ur.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Tr&&t===i?s:t,this},Qr.prototype.clear=function(){this.__data__=[],this.size=0},Qr.prototype.delete=function(e){var t=this.__data__,r=Xr(t,e);return!(r<0||(r==t.length-1?t.pop():Ke.call(t,r,1),--this.size,0))},Qr.prototype.get=function(e){var t=this.__data__,r=Xr(t,e);return r<0?i:t[r][1]},Qr.prototype.has=function(e){return Xr(this.__data__,e)>-1},Qr.prototype.set=function(e,t){var r=this.__data__,n=Xr(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Br.prototype.clear=function(){this.size=0,this.__data__={hash:new Ur,map:new(Er||Qr),string:new Ur}},Br.prototype.delete=function(e){var t=so(this,e).delete(e);return this.size-=t?1:0,t},Br.prototype.get=function(e){return so(this,e).get(e)},Br.prototype.has=function(e){return so(this,e).has(e)},Br.prototype.set=function(e,t){var r=so(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},zr.prototype.add=zr.prototype.push=function(e){return this.__data__.set(e,s),this},zr.prototype.has=function(e){return this.__data__.has(e)},Yr.prototype.clear=function(){this.__data__=new Qr,this.size=0},Yr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Yr.prototype.get=function(e){return this.__data__.get(e)},Yr.prototype.has=function(e){return this.__data__.has(e)},Yr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Qr){var n=r.__data__;if(!Er||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Br(n)}return r.set(e,t),this.size=r.size,this};var ln=Ai(gn),fn=Ai(_n,!0);function hn(e,t){var r=!0;return ln(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function dn(e,t,r){for(var n=-1,o=e.length;++n<o;){var s=e[n],a=t(s);if(null!=a&&(c===i?a==a&&!aa(a):r(a,c)))var c=a,u=s}return u}function pn(e,t){var r=[];return ln(e,(function(e,n,i){t(e,n,i)&&r.push(e)})),r}function mn(e,t,r,n,i){var o=-1,s=e.length;for(r||(r=mo),i||(i=[]);++o<s;){var a=e[o];t>0&&r(a)?t>1?mn(a,t-1,r,n,i):xt(i,a):n||(i[i.length]=a)}return i}var yn=Ri(),vn=Ri(!0);function gn(e,t){return e&&yn(e,t,Aa)}function _n(e,t){return e&&vn(e,t,Aa)}function bn(e,t){return Nt(t,(function(t){return Ws(e[t])}))}function wn(e,t){for(var r=0,n=(t=yi(t,e)).length;null!=e&&r<n;)e=e[jo(t[r++])];return r&&r==n?e:i}function En(e,t,r){var n=t(e);return Qs(e)?n:xt(n,r(e))}function Sn(e){return null==e?e===i?"[object Undefined]":"[object Null]":Ze&&Ze in Oe(e)?function(e){var t=Pe.call(e,Ze),r=e[Ze];try{e[Ze]=i;var n=!0}catch(e){}var o=je.call(e);return n&&(t?e[Ze]=r:delete e[Ze]),o}(e):function(e){return je.call(e)}(e)}function On(e,t){return e>t}function In(e,t){return null!=e&&Pe.call(e,t)}function Tn(e,t){return null!=e&&t in Oe(e)}function kn(e,t,r){for(var o=r?At:Dt,s=e[0].length,a=e.length,c=a,u=n(a),l=1/0,f=[];c--;){var h=e[c];c&&t&&(h=Rt(h,Gt(t))),l=yr(h.length,l),u[c]=!r&&(t||s>=120&&h.length>=120)?new zr(c&&h):i}h=e[0];var d=-1,p=u[0];e:for(;++d<s&&f.length<l;){var m=h[d],y=t?t(m):m;if(m=r||0!==m?m:0,!(p?Jt(p,y):o(f,y,r))){for(c=a;--c;){var v=u[c];if(!(v?Jt(v,y):o(e[c],y,r)))continue e}p&&p.push(y),f.push(m)}}return f}function Nn(e,t,r){var n=null==(e=Io(e,t=yi(t,e)))?e:e[jo(Go(t))];return null==n?i:St(n,e,r)}function Dn(e){return ea(e)&&Sn(e)==m}function An(e,t,r,n,o){return e===t||(null==e||null==t||!ea(e)&&!ea(t)?e!=e&&t!=t:function(e,t,r,n,o,s){var a=Qs(e),c=Qs(t),u=a?y:fo(e),l=c?y:fo(t),f=(u=u==m?O:u)==O,h=(l=l==m?O:l)==O,d=u==l;if(d&&Ks(e)){if(!Ks(t))return!1;a=!0,f=!1}if(d&&!f)return s||(s=new Yr),a||ca(e)?Zi(e,t,r,n,o,s):function(e,t,r,n,i,o,s){switch(r){case x:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case R:return!(e.byteLength!=t.byteLength||!o(new Ue(e),new Ue(t)));case v:case g:case S:return qs(+e,+t);case _:return e.name==t.name&&e.message==t.message;case T:case N:return e==t+"";case E:var a=ir;case k:var c=1&n;if(a||(a=ar),e.size!=t.size&&!c)return!1;var u=s.get(e);if(u)return u==t;n|=2,s.set(e,t);var l=Zi(a(e),a(t),n,i,o,s);return s.delete(e),l;case D:if(Cr)return Cr.call(e)==Cr.call(t)}return!1}(e,t,u,r,n,o,s);if(!(1&r)){var p=f&&Pe.call(e,"__wrapped__"),b=h&&Pe.call(t,"__wrapped__");if(p||b){var w=p?e.value():e,I=b?t.value():t;return s||(s=new Yr),o(w,I,r,n,s)}}return!!d&&(s||(s=new Yr),function(e,t,r,n,o,s){var a=1&r,c=eo(e),u=c.length;if(u!=eo(t).length&&!a)return!1;for(var l=u;l--;){var f=c[l];if(!(a?f in t:Pe.call(t,f)))return!1}var h=s.get(e),d=s.get(t);if(h&&d)return h==t&&d==e;var p=!0;s.set(e,t),s.set(t,e);for(var m=a;++l<u;){var y=e[f=c[l]],v=t[f];if(n)var g=a?n(v,y,f,t,e,s):n(y,v,f,e,t,s);if(!(g===i?y===v||o(y,v,r,n,s):g)){p=!1;break}m||(m="constructor"==f)}if(p&&!m){var _=e.constructor,b=t.constructor;_==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof _&&_ instanceof _&&"function"==typeof b&&b instanceof b||(p=!1)}return s.delete(e),s.delete(t),p}(e,t,r,n,o,s))}(e,t,r,n,An,o))}function Rn(e,t,r,n){var o=r.length,s=o,a=!n;if(null==e)return!s;for(e=Oe(e);o--;){var c=r[o];if(a&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++o<s;){var u=(c=r[o])[0],l=e[u],f=c[1];if(a&&c[2]){if(l===i&&!(u in e))return!1}else{var h=new Yr;if(n)var d=n(l,f,u,e,t,h);if(!(d===i?An(f,l,3,n,h):d))return!1}}return!0}function xn(e){return!(!Xs(e)||(t=e,Ce&&Ce in t))&&(Ws(e)?qe:me).test(Mo(e));var t}function Pn(e){return"function"==typeof e?e:null==e?rc:"object"==typeof e?Qs(e)?Fn(e[0],e[1]):Mn(e):fc(e)}function $n(e){if(!wo(e))return pr(e);var t=[];for(var r in Oe(e))Pe.call(e,r)&&"constructor"!=r&&t.push(r);return t}function Cn(e,t){return e<t}function jn(e,t){var r=-1,i=zs(e)?n(e.length):[];return ln(e,(function(e,n,o){i[++r]=t(e,n,o)})),i}function Mn(e){var t=ao(e);return 1==t.length&&t[0][2]?So(t[0][0],t[0][1]):function(r){return r===e||Rn(r,e,t)}}function Fn(e,t){return go(e)&&Eo(t)?So(jo(e),t):function(r){var n=Ia(r,e);return n===i&&n===t?Ta(r,e):An(t,n,3)}}function qn(e,t,r,n,o){e!==t&&yn(t,(function(s,a){if(o||(o=new Yr),Xs(s))!function(e,t,r,n,o,s,a){var c=To(e,r),u=To(t,r),l=a.get(u);if(l)Jr(e,r,l);else{var f=s?s(c,u,r+"",e,t,a):i,h=f===i;if(h){var d=Qs(u),p=!d&&Ks(u),m=!d&&!p&&ca(u);f=u,d||p||m?Qs(c)?f=c:Ys(c)?f=Ti(c):p?(h=!1,f=bi(u,!0)):m?(h=!1,f=Ei(u,!0)):f=[]:na(u)||Us(u)?(f=c,Us(c)?f=ya(c):Xs(c)&&!Ws(c)||(f=po(u))):h=!1}h&&(a.set(u,f),o(f,u,n,s,a),a.delete(u)),Jr(e,r,f)}}(e,t,a,r,qn,n,o);else{var c=n?n(To(e,a),s,a+"",e,t,o):i;c===i&&(c=s),Jr(e,a,c)}}),Ra)}function Vn(e,t){var r=e.length;if(r)return yo(t+=t<0?r:0,r)?e[t]:i}function Ln(e,t,r){t=t.length?Rt(t,(function(e){return Qs(e)?function(t){return wn(t,1===e.length?e[0]:e)}:e})):[rc];var n=-1;t=Rt(t,Gt(oo()));var i=jn(e,(function(e,r,i){var o=Rt(t,(function(t){return t(e)}));return{criteria:o,index:++n,value:e}}));return function(e,t){var n=e.length;for(e.sort((function(e,t){return function(e,t,r){for(var n=-1,i=e.criteria,o=t.criteria,s=i.length,a=r.length;++n<s;){var c=Si(i[n],o[n]);if(c)return n>=a?c:c*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}));n--;)e[n]=e[n].value;return e}(i)}function Un(e,t,r){for(var n=-1,i=t.length,o={};++n<i;){var s=t[n],a=wn(e,s);r(a,s)&&Wn(o,yi(s,e),a)}return o}function Qn(e,t,r,n){var i=n?Vt:qt,o=-1,s=t.length,a=e;for(e===t&&(t=Ti(t)),r&&(a=Rt(e,Gt(r)));++o<s;)for(var c=0,u=t[o],l=r?r(u):u;(c=i(a,l,c,n))>-1;)a!==e&&Ke.call(a,c,1),Ke.call(e,c,1);return e}function Bn(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==o){var o=i;yo(i)?Ke.call(e,i,1):ci(e,i)}}return e}function zn(e,t){return e+dt(_r()*(t-e+1))}function Yn(e,t){var r="";if(!e||t<1||t>f)return r;do{t%2&&(r+=e),(t=dt(t/2))&&(e+=e)}while(t);return r}function Kn(e,t){return Do(Oo(e,t,rc),e+"")}function Hn(e){return Hr(qa(e))}function Gn(e,t){var r=qa(e);return xo(r,on(t,0,r.length))}function Wn(e,t,r,n){if(!Xs(e))return e;for(var o=-1,s=(t=yi(t,e)).length,a=s-1,c=e;null!=c&&++o<s;){var u=jo(t[o]),l=r;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(o!=a){var f=c[u];(l=n?n(f,u,c):i)===i&&(l=Xs(f)?f:yo(t[o+1])?[]:{})}Zr(c,u,l),c=c[u]}return e}var Jn=kr?function(e,t){return kr.set(e,t),e}:rc,Zn=et?function(e,t){return et(e,"toString",{configurable:!0,enumerable:!1,value:Xa(t),writable:!0})}:rc;function Xn(e){return xo(qa(e))}function ei(e,t,r){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var s=n(o);++i<o;)s[i]=e[i+t];return s}function ti(e,t){var r;return ln(e,(function(e,n,i){return!(r=t(e,n,i))})),!!r}function ri(e,t,r){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var o=n+i>>>1,s=e[o];null!==s&&!aa(s)&&(r?s<=t:s<t)?n=o+1:i=o}return i}return ni(e,t,rc,r)}function ni(e,t,r,n){var o=0,s=null==e?0:e.length;if(0===s)return 0;for(var a=(t=r(t))!=t,c=null===t,u=aa(t),l=t===i;o<s;){var f=dt((o+s)/2),h=r(e[f]),d=h!==i,p=null===h,m=h==h,y=aa(h);if(a)var v=n||m;else v=l?m&&(n||d):c?m&&d&&(n||!p):u?m&&d&&!p&&(n||!y):!p&&!y&&(n?h<=t:h<t);v?o=f+1:s=f}return yr(s,4294967294)}function ii(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var s=e[r],a=t?t(s):s;if(!r||!qs(a,c)){var c=a;o[i++]=0===s?0:s}}return o}function oi(e){return"number"==typeof e?e:aa(e)?h:+e}function si(e){if("string"==typeof e)return e;if(Qs(e))return Rt(e,si)+"";if(aa(e))return jr?jr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ai(e,t,r){var n=-1,i=Dt,o=e.length,s=!0,a=[],c=a;if(r)s=!1,i=At;else if(o>=200){var u=t?null:Yi(e);if(u)return ar(u);s=!1,i=Jt,c=new zr}else c=t?[]:a;e:for(;++n<o;){var l=e[n],f=t?t(l):l;if(l=r||0!==l?l:0,s&&f==f){for(var h=c.length;h--;)if(c[h]===f)continue e;t&&c.push(f),a.push(l)}else i(c,f,r)||(c!==a&&c.push(f),a.push(l))}return a}function ci(e,t){return null==(e=Io(e,t=yi(t,e)))||delete e[jo(Go(t))]}function ui(e,t,r,n){return Wn(e,t,r(wn(e,t)),n)}function li(e,t,r,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return r?ei(e,n?0:o,n?o+1:i):ei(e,n?o+1:0,n?i:o)}function fi(e,t){var r=e;return r instanceof Lr&&(r=r.value()),Pt(t,(function(e,t){return t.func.apply(t.thisArg,xt([e],t.args))}),r)}function hi(e,t,r){var i=e.length;if(i<2)return i?ai(e[0]):[];for(var o=-1,s=n(i);++o<i;)for(var a=e[o],c=-1;++c<i;)c!=o&&(s[o]=un(s[o]||a,e[c],t,r));return ai(mn(s,1),t,r)}function di(e,t,r){for(var n=-1,o=e.length,s=t.length,a={};++n<o;){var c=n<s?t[n]:i;r(a,e[n],c)}return a}function pi(e){return Ys(e)?e:[]}function mi(e){return"function"==typeof e?e:rc}function yi(e,t){return Qs(e)?e:go(e,t)?[e]:Co(va(e))}var vi=Kn;function gi(e,t,r){var n=e.length;return r=r===i?n:r,!t&&r>=n?e:ei(e,t,r)}var _i=st||function(e){return ft.clearTimeout(e)};function bi(e,t){if(t)return e.slice();var r=e.length,n=Qe?Qe(r):new e.constructor(r);return e.copy(n),n}function wi(e){var t=new e.constructor(e.byteLength);return new Ue(t).set(new Ue(e)),t}function Ei(e,t){var r=t?wi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Si(e,t){if(e!==t){var r=e!==i,n=null===e,o=e==e,s=aa(e),a=t!==i,c=null===t,u=t==t,l=aa(t);if(!c&&!l&&!s&&e>t||s&&a&&u&&!c&&!l||n&&a&&u||!r&&u||!o)return 1;if(!n&&!s&&!l&&e<t||l&&r&&o&&!n&&!s||c&&r&&o||!a&&o||!u)return-1}return 0}function Oi(e,t,r,i){for(var o=-1,s=e.length,a=r.length,c=-1,u=t.length,l=mr(s-a,0),f=n(u+l),h=!i;++c<u;)f[c]=t[c];for(;++o<a;)(h||o<s)&&(f[r[o]]=e[o]);for(;l--;)f[c++]=e[o++];return f}function Ii(e,t,r,i){for(var o=-1,s=e.length,a=-1,c=r.length,u=-1,l=t.length,f=mr(s-c,0),h=n(f+l),d=!i;++o<f;)h[o]=e[o];for(var p=o;++u<l;)h[p+u]=t[u];for(;++a<c;)(d||o<s)&&(h[p+r[a]]=e[o++]);return h}function Ti(e,t){var r=-1,i=e.length;for(t||(t=n(i));++r<i;)t[r]=e[r];return t}function ki(e,t,r,n){var o=!r;r||(r={});for(var s=-1,a=t.length;++s<a;){var c=t[s],u=n?n(r[c],e[c],c,r,e):i;u===i&&(u=e[c]),o?rn(r,c,u):Zr(r,c,u)}return r}function Ni(e,t){return function(r,n){var i=Qs(r)?Ot:en,o=t?t():{};return i(r,e,oo(n,2),o)}}function Di(e){return Kn((function(t,r){var n=-1,o=r.length,s=o>1?r[o-1]:i,a=o>2?r[2]:i;for(s=e.length>3&&"function"==typeof s?(o--,s):i,a&&vo(r[0],r[1],a)&&(s=o<3?i:s,o=1),t=Oe(t);++n<o;){var c=r[n];c&&e(t,c,n,s)}return t}))}function Ai(e,t){return function(r,n){if(null==r)return r;if(!zs(r))return e(r,n);for(var i=r.length,o=t?i:-1,s=Oe(r);(t?o--:++o<i)&&!1!==n(s[o],o,s););return r}}function Ri(e){return function(t,r,n){for(var i=-1,o=Oe(t),s=n(t),a=s.length;a--;){var c=s[e?a:++i];if(!1===r(o[c],c,o))break}return t}}function xi(e){return function(t){var r=nr(t=va(t))?lr(t):i,n=r?r[0]:t.charAt(0),o=r?gi(r,1).join(""):t.slice(1);return n[e]()+o}}function Pi(e){return function(t){return Pt(Wa(Ua(t).replace(We,"")),e,"")}}function $i(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Fr(e.prototype),n=e.apply(r,t);return Xs(n)?n:r}}function Ci(e){return function(t,r,n){var o=Oe(t);if(!zs(t)){var s=oo(r,3);t=Aa(t),r=function(e){return s(o[e],e,o)}}var a=e(t,r,n);return a>-1?o[s?t[a]:a]:i}}function ji(e){return Xi((function(t){var r=t.length,n=r,s=Vr.prototype.thru;for(e&&t.reverse();n--;){var a=t[n];if("function"!=typeof a)throw new ke(o);if(s&&!c&&"wrapper"==no(a))var c=new Vr([],!0)}for(n=c?n:r;++n<r;){var u=no(a=t[n]),l="wrapper"==u?ro(a):i;c=l&&_o(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?c[no(l[0])].apply(c,l[3]):1==a.length&&_o(a)?c[u]():c.thru(a)}return function(){var e=arguments,n=e[0];if(c&&1==e.length&&Qs(n))return c.plant(n).value();for(var i=0,o=r?t[i].apply(this,e):n;++i<r;)o=t[i].call(this,o);return o}}))}function Mi(e,t,r,o,s,a,c,l,f,h){var d=t&u,p=1&t,m=2&t,y=24&t,v=512&t,g=m?i:$i(e);return function u(){for(var _=arguments.length,b=n(_),w=_;w--;)b[w]=arguments[w];if(y)var E=io(u),S=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}(b,E);if(o&&(b=Oi(b,o,s,y)),a&&(b=Ii(b,a,c,y)),_-=S,y&&_<h){var O=sr(b,E);return Bi(e,t,Mi,u.placeholder,r,b,O,l,f,h-_)}var I=p?r:this,T=m?I[e]:e;return _=b.length,l?b=function(e,t){for(var r=e.length,n=yr(t.length,r),o=Ti(e);n--;){var s=t[n];e[n]=yo(s,r)?o[s]:i}return e}(b,l):v&&_>1&&b.reverse(),d&&f<_&&(b.length=f),this&&this!==ft&&this instanceof u&&(T=g||$i(T)),T.apply(I,b)}}function Fi(e,t){return function(r,n){return function(e,t,r,n){return gn(e,(function(e,i,o){t(n,r(e),i,o)})),n}(r,e,t(n),{})}}function qi(e,t){return function(r,n){var o;if(r===i&&n===i)return t;if(r!==i&&(o=r),n!==i){if(o===i)return n;"string"==typeof r||"string"==typeof n?(r=si(r),n=si(n)):(r=oi(r),n=oi(n)),o=e(r,n)}return o}}function Vi(e){return Xi((function(t){return t=Rt(t,Gt(oo())),Kn((function(r){var n=this;return e(t,(function(e){return St(e,n,r)}))}))}))}function Li(e,t){var r=(t=t===i?" ":si(t)).length;if(r<2)return r?Yn(t,e):t;var n=Yn(t,ht(e/ur(t)));return nr(t)?gi(lr(n),0,e).join(""):n.slice(0,e)}function Ui(e){return function(t,r,o){return o&&"number"!=typeof o&&vo(t,r,o)&&(r=o=i),t=ha(t),r===i?(r=t,t=0):r=ha(r),function(e,t,r,i){for(var o=-1,s=mr(ht((t-e)/(r||1)),0),a=n(s);s--;)a[i?s:++o]=e,e+=r;return a}(t,r,o=o===i?t<r?1:-1:ha(o),e)}}function Qi(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=ma(t),r=ma(r)),e(t,r)}}function Bi(e,t,r,n,o,s,a,u,l,f){var h=8&t;t|=h?c:64,4&(t&=~(h?64:c))||(t&=-4);var d=[e,t,o,h?s:i,h?a:i,h?i:s,h?i:a,u,l,f],p=r.apply(i,d);return _o(e)&&ko(p,d),p.placeholder=n,Ao(p,e,t)}function zi(e){var t=Se[e];return function(e,r){if(e=ma(e),(r=null==r?0:yr(da(r),292))&&jt(e)){var n=(va(e)+"e").split("e");return+((n=(va(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var Yi=Or&&1/ar(new Or([,-0]))[1]==l?function(e){return new Or(e)}:ac;function Ki(e){return function(t){var r=fo(t);return r==E?ir(t):r==k?cr(t):function(e,t){return Rt(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Hi(e,t,r,s,l,f,h,d){var p=2&t;if(!p&&"function"!=typeof e)throw new ke(o);var m=s?s.length:0;if(m||(t&=-97,s=l=i),h=h===i?h:mr(da(h),0),d=d===i?d:da(d),m-=l?l.length:0,64&t){var y=s,v=l;s=l=i}var g=p?i:ro(e),_=[e,t,r,s,l,y,v,f,h,d];if(g&&function(e,t){var r=e[1],n=t[1],i=r|n,o=i<131,s=n==u&&8==r||n==u&&256==r&&e[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==r;if(!o&&!s)return e;1&n&&(e[2]=t[2],i|=1&r?0:4);var c=t[3];if(c){var l=e[3];e[3]=l?Oi(l,c,t[4]):c,e[4]=l?sr(e[3],a):t[4]}(c=t[5])&&(l=e[5],e[5]=l?Ii(l,c,t[6]):c,e[6]=l?sr(e[5],a):t[6]),(c=t[7])&&(e[7]=c),n&u&&(e[8]=null==e[8]?t[8]:yr(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(_,g),e=_[0],t=_[1],r=_[2],s=_[3],l=_[4],!(d=_[9]=_[9]===i?p?0:e.length:mr(_[9]-m,0))&&24&t&&(t&=-25),t&&1!=t)b=8==t||16==t?function(e,t,r){var o=$i(e);return function s(){for(var a=arguments.length,c=n(a),u=a,l=io(s);u--;)c[u]=arguments[u];var f=a<3&&c[0]!==l&&c[a-1]!==l?[]:sr(c,l);return(a-=f.length)<r?Bi(e,t,Mi,s.placeholder,i,c,f,i,i,r-a):St(this&&this!==ft&&this instanceof s?o:e,this,c)}}(e,t,d):t!=c&&33!=t||l.length?Mi.apply(i,_):function(e,t,r,i){var o=1&t,s=$i(e);return function t(){for(var a=-1,c=arguments.length,u=-1,l=i.length,f=n(l+c),h=this&&this!==ft&&this instanceof t?s:e;++u<l;)f[u]=i[u];for(;c--;)f[u++]=arguments[++a];return St(h,o?r:this,f)}}(e,t,r,s);else var b=function(e,t,r){var n=1&t,i=$i(e);return function t(){return(this&&this!==ft&&this instanceof t?i:e).apply(n?r:this,arguments)}}(e,t,r);return Ao((g?Jn:ko)(b,_),e,t)}function Gi(e,t,r,n){return e===i||qs(e,Ae[r])&&!Pe.call(n,r)?t:e}function Wi(e,t,r,n,o,s){return Xs(e)&&Xs(t)&&(s.set(t,e),qn(e,t,i,Wi,s),s.delete(t)),e}function Ji(e){return na(e)?i:e}function Zi(e,t,r,n,o,s){var a=1&r,c=e.length,u=t.length;if(c!=u&&!(a&&u>c))return!1;var l=s.get(e),f=s.get(t);if(l&&f)return l==t&&f==e;var h=-1,d=!0,p=2&r?new zr:i;for(s.set(e,t),s.set(t,e);++h<c;){var m=e[h],y=t[h];if(n)var v=a?n(y,m,h,t,e,s):n(m,y,h,e,t,s);if(v!==i){if(v)continue;d=!1;break}if(p){if(!Ct(t,(function(e,t){if(!Jt(p,t)&&(m===e||o(m,e,r,n,s)))return p.push(t)}))){d=!1;break}}else if(m!==y&&!o(m,y,r,n,s)){d=!1;break}}return s.delete(e),s.delete(t),d}function Xi(e){return Do(Oo(e,i,Bo),e+"")}function eo(e){return En(e,Aa,uo)}function to(e){return En(e,Ra,lo)}var ro=kr?function(e){return kr.get(e)}:ac;function no(e){for(var t=e.name+"",r=Nr[t],n=Pe.call(Nr,t)?r.length:0;n--;){var i=r[n],o=i.func;if(null==o||o==e)return i.name}return t}function io(e){return(Pe.call(Mr,"placeholder")?Mr:e).placeholder}function oo(){var e=Mr.iteratee||nc;return e=e===nc?Pn:e,arguments.length?e(arguments[0],arguments[1]):e}function so(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function ao(e){for(var t=Aa(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,Eo(i)]}return t}function co(e,t){var r=function(e,t){return null==e?i:e[t]}(e,t);return xn(r)?r:i}var uo=mt?function(e){return null==e?[]:(e=Oe(e),Nt(mt(e),(function(t){return Ye.call(e,t)})))}:pc,lo=mt?function(e){for(var t=[];e;)xt(t,uo(e)),e=Be(e);return t}:pc,fo=Sn;function ho(e,t,r){for(var n=-1,i=(t=yi(t,e)).length,o=!1;++n<i;){var s=jo(t[n]);if(!(o=null!=e&&r(e,s)))break;e=e[s]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&Zs(i)&&yo(s,i)&&(Qs(e)||Us(e))}function po(e){return"function"!=typeof e.constructor||wo(e)?{}:Fr(Be(e))}function mo(e){return Qs(e)||Us(e)||!!(He&&e&&e[He])}function yo(e,t){var r=typeof e;return!!(t=null==t?f:t)&&("number"==r||"symbol"!=r&&ve.test(e))&&e>-1&&e%1==0&&e<t}function vo(e,t,r){if(!Xs(r))return!1;var n=typeof t;return!!("number"==n?zs(r)&&yo(t,r.length):"string"==n&&t in r)&&qs(r[t],e)}function go(e,t){if(Qs(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!aa(e))||X.test(e)||!Z.test(e)||null!=t&&e in Oe(t)}function _o(e){var t=no(e),r=Mr[t];if("function"!=typeof r||!(t in Lr.prototype))return!1;if(e===r)return!0;var n=ro(r);return!!n&&e===n[0]}(wr&&fo(new wr(new ArrayBuffer(1)))!=x||Er&&fo(new Er)!=E||Sr&&fo(Sr.resolve())!=I||Or&&fo(new Or)!=k||Ir&&fo(new Ir)!=A)&&(fo=function(e){var t=Sn(e),r=t==O?e.constructor:i,n=r?Mo(r):"";if(n)switch(n){case Dr:return x;case Ar:return E;case Rr:return I;case xr:return k;case Pr:return A}return t});var bo=Re?Ws:mc;function wo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ae)}function Eo(e){return e==e&&!Xs(e)}function So(e,t){return function(r){return null!=r&&r[e]===t&&(t!==i||e in Oe(r))}}function Oo(e,t,r){return t=mr(t===i?e.length-1:t,0),function(){for(var i=arguments,o=-1,s=mr(i.length-t,0),a=n(s);++o<s;)a[o]=i[t+o];o=-1;for(var c=n(t+1);++o<t;)c[o]=i[o];return c[t]=r(a),St(e,this,c)}}function Io(e,t){return t.length<2?e:wn(e,ei(t,0,-1))}function To(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var ko=Ro(Jn),No=lt||function(e,t){return ft.setTimeout(e,t)},Do=Ro(Zn);function Ao(e,t,r){var n=t+"";return Do(e,function(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(oe,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return It(p,(function(r){var n="_."+r[0];t&r[1]&&!Dt(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(se);return t?t[1].split(ae):[]}(n),r)))}function Ro(e){var t=0,r=0;return function(){var n=vr(),o=16-(n-r);if(r=n,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function xo(e,t){var r=-1,n=e.length,o=n-1;for(t=t===i?n:t;++r<t;){var s=zn(r,o),a=e[s];e[s]=e[r],e[r]=a}return e.length=t,e}var Po,$o,Co=(Po=Ps((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ee,(function(e,r,n,i){t.push(n?i.replace(le,"$1"):r||e)})),t}),(function(e){return 500===$o.size&&$o.clear(),e})),$o=Po.cache,Po);function jo(e){if("string"==typeof e||aa(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Mo(e){if(null!=e){try{return xe.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Fo(e){if(e instanceof Lr)return e.clone();var t=new Vr(e.__wrapped__,e.__chain__);return t.__actions__=Ti(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var qo=Kn((function(e,t){return Ys(e)?un(e,mn(t,1,Ys,!0)):[]})),Vo=Kn((function(e,t){var r=Go(t);return Ys(r)&&(r=i),Ys(e)?un(e,mn(t,1,Ys,!0),oo(r,2)):[]})),Lo=Kn((function(e,t){var r=Go(t);return Ys(r)&&(r=i),Ys(e)?un(e,mn(t,1,Ys,!0),i,r):[]}));function Uo(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:da(r);return i<0&&(i=mr(n+i,0)),Ft(e,oo(t,3),i)}function Qo(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=n-1;return r!==i&&(o=da(r),o=r<0?mr(n+o,0):yr(o,n-1)),Ft(e,oo(t,3),o,!0)}function Bo(e){return null!=e&&e.length?mn(e,1):[]}function zo(e){return e&&e.length?e[0]:i}var Yo=Kn((function(e){var t=Rt(e,pi);return t.length&&t[0]===e[0]?kn(t):[]})),Ko=Kn((function(e){var t=Go(e),r=Rt(e,pi);return t===Go(r)?t=i:r.pop(),r.length&&r[0]===e[0]?kn(r,oo(t,2)):[]})),Ho=Kn((function(e){var t=Go(e),r=Rt(e,pi);return(t="function"==typeof t?t:i)&&r.pop(),r.length&&r[0]===e[0]?kn(r,i,t):[]}));function Go(e){var t=null==e?0:e.length;return t?e[t-1]:i}var Wo=Kn(Jo);function Jo(e,t){return e&&e.length&&t&&t.length?Qn(e,t):e}var Zo=Xi((function(e,t){var r=null==e?0:e.length,n=nn(e,t);return Bn(e,Rt(t,(function(e){return yo(e,r)?+e:e})).sort(Si)),n}));function Xo(e){return null==e?e:br.call(e)}var es=Kn((function(e){return ai(mn(e,1,Ys,!0))})),ts=Kn((function(e){var t=Go(e);return Ys(t)&&(t=i),ai(mn(e,1,Ys,!0),oo(t,2))})),rs=Kn((function(e){var t=Go(e);return t="function"==typeof t?t:i,ai(mn(e,1,Ys,!0),i,t)}));function ns(e){if(!e||!e.length)return[];var t=0;return e=Nt(e,(function(e){if(Ys(e))return t=mr(e.length,t),!0})),Kt(t,(function(t){return Rt(e,Qt(t))}))}function is(e,t){if(!e||!e.length)return[];var r=ns(e);return null==t?r:Rt(r,(function(e){return St(t,i,e)}))}var os=Kn((function(e,t){return Ys(e)?un(e,t):[]})),ss=Kn((function(e){return hi(Nt(e,Ys))})),as=Kn((function(e){var t=Go(e);return Ys(t)&&(t=i),hi(Nt(e,Ys),oo(t,2))})),cs=Kn((function(e){var t=Go(e);return t="function"==typeof t?t:i,hi(Nt(e,Ys),i,t)})),us=Kn(ns),ls=Kn((function(e){var t=e.length,r=t>1?e[t-1]:i;return r="function"==typeof r?(e.pop(),r):i,is(e,r)}));function fs(e){var t=Mr(e);return t.__chain__=!0,t}function hs(e,t){return t(e)}var ds=Xi((function(e){var t=e.length,r=t?e[0]:0,n=this.__wrapped__,o=function(t){return nn(t,e)};return!(t>1||this.__actions__.length)&&n instanceof Lr&&yo(r)?((n=n.slice(r,+r+(t?1:0))).__actions__.push({func:hs,args:[o],thisArg:i}),new Vr(n,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)})),ps=Ni((function(e,t,r){Pe.call(e,r)?++e[r]:rn(e,r,1)})),ms=Ci(Uo),ys=Ci(Qo);function vs(e,t){return(Qs(e)?It:ln)(e,oo(t,3))}function gs(e,t){return(Qs(e)?Tt:fn)(e,oo(t,3))}var _s=Ni((function(e,t,r){Pe.call(e,r)?e[r].push(t):rn(e,r,[t])})),bs=Kn((function(e,t,r){var i=-1,o="function"==typeof t,s=zs(e)?n(e.length):[];return ln(e,(function(e){s[++i]=o?St(t,e,r):Nn(e,t,r)})),s})),ws=Ni((function(e,t,r){rn(e,r,t)}));function Es(e,t){return(Qs(e)?Rt:jn)(e,oo(t,3))}var Ss=Ni((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]})),Os=Kn((function(e,t){if(null==e)return[];var r=t.length;return r>1&&vo(e,t[0],t[1])?t=[]:r>2&&vo(t[0],t[1],t[2])&&(t=[t[0]]),Ln(e,mn(t,1),[])})),Is=ut||function(){return ft.Date.now()};function Ts(e,t,r){return t=r?i:t,t=e&&null==t?e.length:t,Hi(e,u,i,i,i,i,t)}function ks(e,t){var r;if("function"!=typeof t)throw new ke(o);return e=da(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=i),r}}var Ns=Kn((function(e,t,r){var n=1;if(r.length){var i=sr(r,io(Ns));n|=c}return Hi(e,n,t,r,i)})),Ds=Kn((function(e,t,r){var n=3;if(r.length){var i=sr(r,io(Ds));n|=c}return Hi(t,n,e,r,i)}));function As(e,t,r){var n,s,a,c,u,l,f=0,h=!1,d=!1,p=!0;if("function"!=typeof e)throw new ke(o);function m(t){var r=n,o=s;return n=s=i,f=t,c=e.apply(o,r)}function y(e){var r=e-l;return l===i||r>=t||r<0||d&&e-f>=a}function v(){var e=Is();if(y(e))return g(e);u=No(v,function(e){var r=t-(e-l);return d?yr(r,a-(e-f)):r}(e))}function g(e){return u=i,p&&n?m(e):(n=s=i,c)}function _(){var e=Is(),r=y(e);if(n=arguments,s=this,l=e,r){if(u===i)return function(e){return f=e,u=No(v,t),h?m(e):c}(l);if(d)return _i(u),u=No(v,t),m(l)}return u===i&&(u=No(v,t)),c}return t=ma(t)||0,Xs(r)&&(h=!!r.leading,a=(d="maxWait"in r)?mr(ma(r.maxWait)||0,t):a,p="trailing"in r?!!r.trailing:p),_.cancel=function(){u!==i&&_i(u),f=0,n=l=s=u=i},_.flush=function(){return u===i?c:g(Is())},_}var Rs=Kn((function(e,t){return cn(e,1,t)})),xs=Kn((function(e,t,r){return cn(e,ma(t)||0,r)}));function Ps(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new ke(o);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=e.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(Ps.Cache||Br),r}function $s(e){if("function"!=typeof e)throw new ke(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ps.Cache=Br;var Cs=vi((function(e,t){var r=(t=1==t.length&&Qs(t[0])?Rt(t[0],Gt(oo())):Rt(mn(t,1),Gt(oo()))).length;return Kn((function(n){for(var i=-1,o=yr(n.length,r);++i<o;)n[i]=t[i].call(this,n[i]);return St(e,this,n)}))})),js=Kn((function(e,t){var r=sr(t,io(js));return Hi(e,c,i,t,r)})),Ms=Kn((function(e,t){var r=sr(t,io(Ms));return Hi(e,64,i,t,r)})),Fs=Xi((function(e,t){return Hi(e,256,i,i,i,t)}));function qs(e,t){return e===t||e!=e&&t!=t}var Vs=Qi(On),Ls=Qi((function(e,t){return e>=t})),Us=Dn(function(){return arguments}())?Dn:function(e){return ea(e)&&Pe.call(e,"callee")&&!Ye.call(e,"callee")},Qs=n.isArray,Bs=vt?Gt(vt):function(e){return ea(e)&&Sn(e)==R};function zs(e){return null!=e&&Zs(e.length)&&!Ws(e)}function Ys(e){return ea(e)&&zs(e)}var Ks=yt||mc,Hs=gt?Gt(gt):function(e){return ea(e)&&Sn(e)==g};function Gs(e){if(!ea(e))return!1;var t=Sn(e);return t==_||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!na(e)}function Ws(e){if(!Xs(e))return!1;var t=Sn(e);return t==b||t==w||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Js(e){return"number"==typeof e&&e==da(e)}function Zs(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=f}function Xs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ea(e){return null!=e&&"object"==typeof e}var ta=_t?Gt(_t):function(e){return ea(e)&&fo(e)==E};function ra(e){return"number"==typeof e||ea(e)&&Sn(e)==S}function na(e){if(!ea(e)||Sn(e)!=O)return!1;var t=Be(e);if(null===t)return!0;var r=Pe.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&xe.call(r)==Me}var ia=bt?Gt(bt):function(e){return ea(e)&&Sn(e)==T},oa=wt?Gt(wt):function(e){return ea(e)&&fo(e)==k};function sa(e){return"string"==typeof e||!Qs(e)&&ea(e)&&Sn(e)==N}function aa(e){return"symbol"==typeof e||ea(e)&&Sn(e)==D}var ca=Et?Gt(Et):function(e){return ea(e)&&Zs(e.length)&&!!it[Sn(e)]},ua=Qi(Cn),la=Qi((function(e,t){return e<=t}));function fa(e){if(!e)return[];if(zs(e))return sa(e)?lr(e):Ti(e);if(Ge&&e[Ge])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Ge]());var t=fo(e);return(t==E?ir:t==k?ar:qa)(e)}function ha(e){return e?(e=ma(e))===l||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function da(e){var t=ha(e),r=t%1;return t==t?r?t-r:t:0}function pa(e){return e?on(da(e),0,d):0}function ma(e){if("number"==typeof e)return e;if(aa(e))return h;if(Xs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Xs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Ht(e);var r=pe.test(e);return r||ye.test(e)?ct(e.slice(2),r?2:8):de.test(e)?h:+e}function ya(e){return ki(e,Ra(e))}function va(e){return null==e?"":si(e)}var ga=Di((function(e,t){if(wo(t)||zs(t))ki(t,Aa(t),e);else for(var r in t)Pe.call(t,r)&&Zr(e,r,t[r])})),_a=Di((function(e,t){ki(t,Ra(t),e)})),ba=Di((function(e,t,r,n){ki(t,Ra(t),e,n)})),wa=Di((function(e,t,r,n){ki(t,Aa(t),e,n)})),Ea=Xi(nn),Sa=Kn((function(e,t){e=Oe(e);var r=-1,n=t.length,o=n>2?t[2]:i;for(o&&vo(t[0],t[1],o)&&(n=1);++r<n;)for(var s=t[r],a=Ra(s),c=-1,u=a.length;++c<u;){var l=a[c],f=e[l];(f===i||qs(f,Ae[l])&&!Pe.call(e,l))&&(e[l]=s[l])}return e})),Oa=Kn((function(e){return e.push(i,Wi),St(Pa,i,e)}));function Ia(e,t,r){var n=null==e?i:wn(e,t);return n===i?r:n}function Ta(e,t){return null!=e&&ho(e,t,Tn)}var ka=Fi((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=je.call(t)),e[t]=r}),Xa(rc)),Na=Fi((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=je.call(t)),Pe.call(e,t)?e[t].push(r):e[t]=[r]}),oo),Da=Kn(Nn);function Aa(e){return zs(e)?Kr(e):$n(e)}function Ra(e){return zs(e)?Kr(e,!0):function(e){if(!Xs(e))return function(e){var t=[];if(null!=e)for(var r in Oe(e))t.push(r);return t}(e);var t=wo(e),r=[];for(var n in e)("constructor"!=n||!t&&Pe.call(e,n))&&r.push(n);return r}(e)}var xa=Di((function(e,t,r){qn(e,t,r)})),Pa=Di((function(e,t,r,n){qn(e,t,r,n)})),$a=Xi((function(e,t){var r={};if(null==e)return r;var n=!1;t=Rt(t,(function(t){return t=yi(t,e),n||(n=t.length>1),t})),ki(e,to(e),r),n&&(r=sn(r,7,Ji));for(var i=t.length;i--;)ci(r,t[i]);return r})),Ca=Xi((function(e,t){return null==e?{}:function(e,t){return Un(e,t,(function(t,r){return Ta(e,r)}))}(e,t)}));function ja(e,t){if(null==e)return{};var r=Rt(to(e),(function(e){return[e]}));return t=oo(t),Un(e,r,(function(e,r){return t(e,r[0])}))}var Ma=Ki(Aa),Fa=Ki(Ra);function qa(e){return null==e?[]:Wt(e,Aa(e))}var Va=Pi((function(e,t,r){return t=t.toLowerCase(),e+(r?La(t):t)}));function La(e){return Ga(va(e).toLowerCase())}function Ua(e){return(e=va(e))&&e.replace(ge,er).replace(Je,"")}var Qa=Pi((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),Ba=Pi((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),za=xi("toLowerCase"),Ya=Pi((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()})),Ka=Pi((function(e,t,r){return e+(r?" ":"")+Ga(t)})),Ha=Pi((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Ga=xi("toUpperCase");function Wa(e,t,r){return e=va(e),(t=r?i:t)===i?function(e){return tt.test(e)}(e)?function(e){return e.match(Xe)||[]}(e):function(e){return e.match(ce)||[]}(e):e.match(t)||[]}var Ja=Kn((function(e,t){try{return St(e,i,t)}catch(e){return Gs(e)?e:new we(e)}})),Za=Xi((function(e,t){return It(t,(function(t){t=jo(t),rn(e,t,Ns(e[t],e))})),e}));function Xa(e){return function(){return e}}var ec=ji(),tc=ji(!0);function rc(e){return e}function nc(e){return Pn("function"==typeof e?e:sn(e,1))}var ic=Kn((function(e,t){return function(r){return Nn(r,e,t)}})),oc=Kn((function(e,t){return function(r){return Nn(e,r,t)}}));function sc(e,t,r){var n=Aa(t),i=bn(t,n);null!=r||Xs(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=bn(t,Aa(t)));var o=!(Xs(r)&&"chain"in r&&!r.chain),s=Ws(e);return It(i,(function(r){var n=t[r];e[r]=n,s&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__);return(r.__actions__=Ti(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,xt([this.value()],arguments))})})),e}function ac(){}var cc=Vi(Rt),uc=Vi(kt),lc=Vi(Ct);function fc(e){return go(e)?Qt(jo(e)):function(e){return function(t){return wn(t,e)}}(e)}var hc=Ui(),dc=Ui(!0);function pc(){return[]}function mc(){return!1}var yc,vc=qi((function(e,t){return e+t}),0),gc=zi("ceil"),_c=qi((function(e,t){return e/t}),1),bc=zi("floor"),wc=qi((function(e,t){return e*t}),1),Ec=zi("round"),Sc=qi((function(e,t){return e-t}),0);return Mr.after=function(e,t){if("function"!=typeof t)throw new ke(o);return e=da(e),function(){if(--e<1)return t.apply(this,arguments)}},Mr.ary=Ts,Mr.assign=ga,Mr.assignIn=_a,Mr.assignInWith=ba,Mr.assignWith=wa,Mr.at=Ea,Mr.before=ks,Mr.bind=Ns,Mr.bindAll=Za,Mr.bindKey=Ds,Mr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Qs(e)?e:[e]},Mr.chain=fs,Mr.chunk=function(e,t,r){t=(r?vo(e,t,r):t===i)?1:mr(da(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var s=0,a=0,c=n(ht(o/t));s<o;)c[a++]=ei(e,s,s+=t);return c},Mr.compact=function(e){for(var t=-1,r=null==e?0:e.length,n=0,i=[];++t<r;){var o=e[t];o&&(i[n++]=o)}return i},Mr.concat=function(){var e=arguments.length;if(!e)return[];for(var t=n(e-1),r=arguments[0],i=e;i--;)t[i-1]=arguments[i];return xt(Qs(r)?Ti(r):[r],mn(t,1))},Mr.cond=function(e){var t=null==e?0:e.length,r=oo();return e=t?Rt(e,(function(e){if("function"!=typeof e[1])throw new ke(o);return[r(e[0]),e[1]]})):[],Kn((function(r){for(var n=-1;++n<t;){var i=e[n];if(St(i[0],this,r))return St(i[1],this,r)}}))},Mr.conforms=function(e){return function(e){var t=Aa(e);return function(r){return an(r,e,t)}}(sn(e,1))},Mr.constant=Xa,Mr.countBy=ps,Mr.create=function(e,t){var r=Fr(e);return null==t?r:tn(r,t)},Mr.curry=function e(t,r,n){var o=Hi(t,8,i,i,i,i,i,r=n?i:r);return o.placeholder=e.placeholder,o},Mr.curryRight=function e(t,r,n){var o=Hi(t,16,i,i,i,i,i,r=n?i:r);return o.placeholder=e.placeholder,o},Mr.debounce=As,Mr.defaults=Sa,Mr.defaultsDeep=Oa,Mr.defer=Rs,Mr.delay=xs,Mr.difference=qo,Mr.differenceBy=Vo,Mr.differenceWith=Lo,Mr.drop=function(e,t,r){var n=null==e?0:e.length;return n?ei(e,(t=r||t===i?1:da(t))<0?0:t,n):[]},Mr.dropRight=function(e,t,r){var n=null==e?0:e.length;return n?ei(e,0,(t=n-(t=r||t===i?1:da(t)))<0?0:t):[]},Mr.dropRightWhile=function(e,t){return e&&e.length?li(e,oo(t,3),!0,!0):[]},Mr.dropWhile=function(e,t){return e&&e.length?li(e,oo(t,3),!0):[]},Mr.fill=function(e,t,r,n){var o=null==e?0:e.length;return o?(r&&"number"!=typeof r&&vo(e,t,r)&&(r=0,n=o),function(e,t,r,n){var o=e.length;for((r=da(r))<0&&(r=-r>o?0:o+r),(n=n===i||n>o?o:da(n))<0&&(n+=o),n=r>n?0:pa(n);r<n;)e[r++]=t;return e}(e,t,r,n)):[]},Mr.filter=function(e,t){return(Qs(e)?Nt:pn)(e,oo(t,3))},Mr.flatMap=function(e,t){return mn(Es(e,t),1)},Mr.flatMapDeep=function(e,t){return mn(Es(e,t),l)},Mr.flatMapDepth=function(e,t,r){return r=r===i?1:da(r),mn(Es(e,t),r)},Mr.flatten=Bo,Mr.flattenDeep=function(e){return null!=e&&e.length?mn(e,l):[]},Mr.flattenDepth=function(e,t){return null!=e&&e.length?mn(e,t=t===i?1:da(t)):[]},Mr.flip=function(e){return Hi(e,512)},Mr.flow=ec,Mr.flowRight=tc,Mr.fromPairs=function(e){for(var t=-1,r=null==e?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n},Mr.functions=function(e){return null==e?[]:bn(e,Aa(e))},Mr.functionsIn=function(e){return null==e?[]:bn(e,Ra(e))},Mr.groupBy=_s,Mr.initial=function(e){return null!=e&&e.length?ei(e,0,-1):[]},Mr.intersection=Yo,Mr.intersectionBy=Ko,Mr.intersectionWith=Ho,Mr.invert=ka,Mr.invertBy=Na,Mr.invokeMap=bs,Mr.iteratee=nc,Mr.keyBy=ws,Mr.keys=Aa,Mr.keysIn=Ra,Mr.map=Es,Mr.mapKeys=function(e,t){var r={};return t=oo(t,3),gn(e,(function(e,n,i){rn(r,t(e,n,i),e)})),r},Mr.mapValues=function(e,t){var r={};return t=oo(t,3),gn(e,(function(e,n,i){rn(r,n,t(e,n,i))})),r},Mr.matches=function(e){return Mn(sn(e,1))},Mr.matchesProperty=function(e,t){return Fn(e,sn(t,1))},Mr.memoize=Ps,Mr.merge=xa,Mr.mergeWith=Pa,Mr.method=ic,Mr.methodOf=oc,Mr.mixin=sc,Mr.negate=$s,Mr.nthArg=function(e){return e=da(e),Kn((function(t){return Vn(t,e)}))},Mr.omit=$a,Mr.omitBy=function(e,t){return ja(e,$s(oo(t)))},Mr.once=function(e){return ks(2,e)},Mr.orderBy=function(e,t,r,n){return null==e?[]:(Qs(t)||(t=null==t?[]:[t]),Qs(r=n?i:r)||(r=null==r?[]:[r]),Ln(e,t,r))},Mr.over=cc,Mr.overArgs=Cs,Mr.overEvery=uc,Mr.overSome=lc,Mr.partial=js,Mr.partialRight=Ms,Mr.partition=Ss,Mr.pick=Ca,Mr.pickBy=ja,Mr.property=fc,Mr.propertyOf=function(e){return function(t){return null==e?i:wn(e,t)}},Mr.pull=Wo,Mr.pullAll=Jo,Mr.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?Qn(e,t,oo(r,2)):e},Mr.pullAllWith=function(e,t,r){return e&&e.length&&t&&t.length?Qn(e,t,i,r):e},Mr.pullAt=Zo,Mr.range=hc,Mr.rangeRight=dc,Mr.rearg=Fs,Mr.reject=function(e,t){return(Qs(e)?Nt:pn)(e,$s(oo(t,3)))},Mr.remove=function(e,t){var r=[];if(!e||!e.length)return r;var n=-1,i=[],o=e.length;for(t=oo(t,3);++n<o;){var s=e[n];t(s,n,e)&&(r.push(s),i.push(n))}return Bn(e,i),r},Mr.rest=function(e,t){if("function"!=typeof e)throw new ke(o);return Kn(e,t=t===i?t:da(t))},Mr.reverse=Xo,Mr.sampleSize=function(e,t,r){return t=(r?vo(e,t,r):t===i)?1:da(t),(Qs(e)?Gr:Gn)(e,t)},Mr.set=function(e,t,r){return null==e?e:Wn(e,t,r)},Mr.setWith=function(e,t,r,n){return n="function"==typeof n?n:i,null==e?e:Wn(e,t,r,n)},Mr.shuffle=function(e){return(Qs(e)?Wr:Xn)(e)},Mr.slice=function(e,t,r){var n=null==e?0:e.length;return n?(r&&"number"!=typeof r&&vo(e,t,r)?(t=0,r=n):(t=null==t?0:da(t),r=r===i?n:da(r)),ei(e,t,r)):[]},Mr.sortBy=Os,Mr.sortedUniq=function(e){return e&&e.length?ii(e):[]},Mr.sortedUniqBy=function(e,t){return e&&e.length?ii(e,oo(t,2)):[]},Mr.split=function(e,t,r){return r&&"number"!=typeof r&&vo(e,t,r)&&(t=r=i),(r=r===i?d:r>>>0)?(e=va(e))&&("string"==typeof t||null!=t&&!ia(t))&&!(t=si(t))&&nr(e)?gi(lr(e),0,r):e.split(t,r):[]},Mr.spread=function(e,t){if("function"!=typeof e)throw new ke(o);return t=null==t?0:mr(da(t),0),Kn((function(r){var n=r[t],i=gi(r,0,t);return n&&xt(i,n),St(e,this,i)}))},Mr.tail=function(e){var t=null==e?0:e.length;return t?ei(e,1,t):[]},Mr.take=function(e,t,r){return e&&e.length?ei(e,0,(t=r||t===i?1:da(t))<0?0:t):[]},Mr.takeRight=function(e,t,r){var n=null==e?0:e.length;return n?ei(e,(t=n-(t=r||t===i?1:da(t)))<0?0:t,n):[]},Mr.takeRightWhile=function(e,t){return e&&e.length?li(e,oo(t,3),!1,!0):[]},Mr.takeWhile=function(e,t){return e&&e.length?li(e,oo(t,3)):[]},Mr.tap=function(e,t){return t(e),e},Mr.throttle=function(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new ke(o);return Xs(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),As(e,t,{leading:n,maxWait:t,trailing:i})},Mr.thru=hs,Mr.toArray=fa,Mr.toPairs=Ma,Mr.toPairsIn=Fa,Mr.toPath=function(e){return Qs(e)?Rt(e,jo):aa(e)?[e]:Ti(Co(va(e)))},Mr.toPlainObject=ya,Mr.transform=function(e,t,r){var n=Qs(e),i=n||Ks(e)||ca(e);if(t=oo(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:Xs(e)&&Ws(o)?Fr(Be(e)):{}}return(i?It:gn)(e,(function(e,n,i){return t(r,e,n,i)})),r},Mr.unary=function(e){return Ts(e,1)},Mr.union=es,Mr.unionBy=ts,Mr.unionWith=rs,Mr.uniq=function(e){return e&&e.length?ai(e):[]},Mr.uniqBy=function(e,t){return e&&e.length?ai(e,oo(t,2)):[]},Mr.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?ai(e,i,t):[]},Mr.unset=function(e,t){return null==e||ci(e,t)},Mr.unzip=ns,Mr.unzipWith=is,Mr.update=function(e,t,r){return null==e?e:ui(e,t,mi(r))},Mr.updateWith=function(e,t,r,n){return n="function"==typeof n?n:i,null==e?e:ui(e,t,mi(r),n)},Mr.values=qa,Mr.valuesIn=function(e){return null==e?[]:Wt(e,Ra(e))},Mr.without=os,Mr.words=Wa,Mr.wrap=function(e,t){return js(mi(t),e)},Mr.xor=ss,Mr.xorBy=as,Mr.xorWith=cs,Mr.zip=us,Mr.zipObject=function(e,t){return di(e||[],t||[],Zr)},Mr.zipObjectDeep=function(e,t){return di(e||[],t||[],Wn)},Mr.zipWith=ls,Mr.entries=Ma,Mr.entriesIn=Fa,Mr.extend=_a,Mr.extendWith=ba,sc(Mr,Mr),Mr.add=vc,Mr.attempt=Ja,Mr.camelCase=Va,Mr.capitalize=La,Mr.ceil=gc,Mr.clamp=function(e,t,r){return r===i&&(r=t,t=i),r!==i&&(r=(r=ma(r))==r?r:0),t!==i&&(t=(t=ma(t))==t?t:0),on(ma(e),t,r)},Mr.clone=function(e){return sn(e,4)},Mr.cloneDeep=function(e){return sn(e,5)},Mr.cloneDeepWith=function(e,t){return sn(e,5,t="function"==typeof t?t:i)},Mr.cloneWith=function(e,t){return sn(e,4,t="function"==typeof t?t:i)},Mr.conformsTo=function(e,t){return null==t||an(e,t,Aa(t))},Mr.deburr=Ua,Mr.defaultTo=function(e,t){return null==e||e!=e?t:e},Mr.divide=_c,Mr.endsWith=function(e,t,r){e=va(e),t=si(t);var n=e.length,o=r=r===i?n:on(da(r),0,n);return(r-=t.length)>=0&&e.slice(r,o)==t},Mr.eq=qs,Mr.escape=function(e){return(e=va(e))&&H.test(e)?e.replace(Y,tr):e},Mr.escapeRegExp=function(e){return(e=va(e))&&re.test(e)?e.replace(te,"\\$&"):e},Mr.every=function(e,t,r){var n=Qs(e)?kt:hn;return r&&vo(e,t,r)&&(t=i),n(e,oo(t,3))},Mr.find=ms,Mr.findIndex=Uo,Mr.findKey=function(e,t){return Mt(e,oo(t,3),gn)},Mr.findLast=ys,Mr.findLastIndex=Qo,Mr.findLastKey=function(e,t){return Mt(e,oo(t,3),_n)},Mr.floor=bc,Mr.forEach=vs,Mr.forEachRight=gs,Mr.forIn=function(e,t){return null==e?e:yn(e,oo(t,3),Ra)},Mr.forInRight=function(e,t){return null==e?e:vn(e,oo(t,3),Ra)},Mr.forOwn=function(e,t){return e&&gn(e,oo(t,3))},Mr.forOwnRight=function(e,t){return e&&_n(e,oo(t,3))},Mr.get=Ia,Mr.gt=Vs,Mr.gte=Ls,Mr.has=function(e,t){return null!=e&&ho(e,t,In)},Mr.hasIn=Ta,Mr.head=zo,Mr.identity=rc,Mr.includes=function(e,t,r,n){e=zs(e)?e:qa(e),r=r&&!n?da(r):0;var i=e.length;return r<0&&(r=mr(i+r,0)),sa(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&qt(e,t,r)>-1},Mr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:da(r);return i<0&&(i=mr(n+i,0)),qt(e,t,i)},Mr.inRange=function(e,t,r){return t=ha(t),r===i?(r=t,t=0):r=ha(r),function(e,t,r){return e>=yr(t,r)&&e<mr(t,r)}(e=ma(e),t,r)},Mr.invoke=Da,Mr.isArguments=Us,Mr.isArray=Qs,Mr.isArrayBuffer=Bs,Mr.isArrayLike=zs,Mr.isArrayLikeObject=Ys,Mr.isBoolean=function(e){return!0===e||!1===e||ea(e)&&Sn(e)==v},Mr.isBuffer=Ks,Mr.isDate=Hs,Mr.isElement=function(e){return ea(e)&&1===e.nodeType&&!na(e)},Mr.isEmpty=function(e){if(null==e)return!0;if(zs(e)&&(Qs(e)||"string"==typeof e||"function"==typeof e.splice||Ks(e)||ca(e)||Us(e)))return!e.length;var t=fo(e);if(t==E||t==k)return!e.size;if(wo(e))return!$n(e).length;for(var r in e)if(Pe.call(e,r))return!1;return!0},Mr.isEqual=function(e,t){return An(e,t)},Mr.isEqualWith=function(e,t,r){var n=(r="function"==typeof r?r:i)?r(e,t):i;return n===i?An(e,t,i,r):!!n},Mr.isError=Gs,Mr.isFinite=function(e){return"number"==typeof e&&jt(e)},Mr.isFunction=Ws,Mr.isInteger=Js,Mr.isLength=Zs,Mr.isMap=ta,Mr.isMatch=function(e,t){return e===t||Rn(e,t,ao(t))},Mr.isMatchWith=function(e,t,r){return r="function"==typeof r?r:i,Rn(e,t,ao(t),r)},Mr.isNaN=function(e){return ra(e)&&e!=+e},Mr.isNative=function(e){if(bo(e))throw new we("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return xn(e)},Mr.isNil=function(e){return null==e},Mr.isNull=function(e){return null===e},Mr.isNumber=ra,Mr.isObject=Xs,Mr.isObjectLike=ea,Mr.isPlainObject=na,Mr.isRegExp=ia,Mr.isSafeInteger=function(e){return Js(e)&&e>=-9007199254740991&&e<=f},Mr.isSet=oa,Mr.isString=sa,Mr.isSymbol=aa,Mr.isTypedArray=ca,Mr.isUndefined=function(e){return e===i},Mr.isWeakMap=function(e){return ea(e)&&fo(e)==A},Mr.isWeakSet=function(e){return ea(e)&&"[object WeakSet]"==Sn(e)},Mr.join=function(e,t){return null==e?"":Bt.call(e,t)},Mr.kebabCase=Qa,Mr.last=Go,Mr.lastIndexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=n;return r!==i&&(o=(o=da(r))<0?mr(n+o,0):yr(o,n-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,o):Ft(e,Lt,o,!0)},Mr.lowerCase=Ba,Mr.lowerFirst=za,Mr.lt=ua,Mr.lte=la,Mr.max=function(e){return e&&e.length?dn(e,rc,On):i},Mr.maxBy=function(e,t){return e&&e.length?dn(e,oo(t,2),On):i},Mr.mean=function(e){return Ut(e,rc)},Mr.meanBy=function(e,t){return Ut(e,oo(t,2))},Mr.min=function(e){return e&&e.length?dn(e,rc,Cn):i},Mr.minBy=function(e,t){return e&&e.length?dn(e,oo(t,2),Cn):i},Mr.stubArray=pc,Mr.stubFalse=mc,Mr.stubObject=function(){return{}},Mr.stubString=function(){return""},Mr.stubTrue=function(){return!0},Mr.multiply=wc,Mr.nth=function(e,t){return e&&e.length?Vn(e,da(t)):i},Mr.noConflict=function(){return ft._===this&&(ft._=Fe),this},Mr.noop=ac,Mr.now=Is,Mr.pad=function(e,t,r){e=va(e);var n=(t=da(t))?ur(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Li(dt(i),r)+e+Li(ht(i),r)},Mr.padEnd=function(e,t,r){e=va(e);var n=(t=da(t))?ur(e):0;return t&&n<t?e+Li(t-n,r):e},Mr.padStart=function(e,t,r){e=va(e);var n=(t=da(t))?ur(e):0;return t&&n<t?Li(t-n,r)+e:e},Mr.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),gr(va(e).replace(ne,""),t||0)},Mr.random=function(e,t,r){if(r&&"boolean"!=typeof r&&vo(e,t,r)&&(t=r=i),r===i&&("boolean"==typeof t?(r=t,t=i):"boolean"==typeof e&&(r=e,e=i)),e===i&&t===i?(e=0,t=1):(e=ha(e),t===i?(t=e,e=0):t=ha(t)),e>t){var n=e;e=t,t=n}if(r||e%1||t%1){var o=_r();return yr(e+o*(t-e+at("1e-"+((o+"").length-1))),t)}return zn(e,t)},Mr.reduce=function(e,t,r){var n=Qs(e)?Pt:zt,i=arguments.length<3;return n(e,oo(t,4),r,i,ln)},Mr.reduceRight=function(e,t,r){var n=Qs(e)?$t:zt,i=arguments.length<3;return n(e,oo(t,4),r,i,fn)},Mr.repeat=function(e,t,r){return t=(r?vo(e,t,r):t===i)?1:da(t),Yn(va(e),t)},Mr.replace=function(){var e=arguments,t=va(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Mr.result=function(e,t,r){var n=-1,o=(t=yi(t,e)).length;for(o||(o=1,e=i);++n<o;){var s=null==e?i:e[jo(t[n])];s===i&&(n=o,s=r),e=Ws(s)?s.call(e):s}return e},Mr.round=Ec,Mr.runInContext=e,Mr.sample=function(e){return(Qs(e)?Hr:Hn)(e)},Mr.size=function(e){if(null==e)return 0;if(zs(e))return sa(e)?ur(e):e.length;var t=fo(e);return t==E||t==k?e.size:$n(e).length},Mr.snakeCase=Ya,Mr.some=function(e,t,r){var n=Qs(e)?Ct:ti;return r&&vo(e,t,r)&&(t=i),n(e,oo(t,3))},Mr.sortedIndex=function(e,t){return ri(e,t)},Mr.sortedIndexBy=function(e,t,r){return ni(e,t,oo(r,2))},Mr.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var n=ri(e,t);if(n<r&&qs(e[n],t))return n}return-1},Mr.sortedLastIndex=function(e,t){return ri(e,t,!0)},Mr.sortedLastIndexBy=function(e,t,r){return ni(e,t,oo(r,2),!0)},Mr.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var r=ri(e,t,!0)-1;if(qs(e[r],t))return r}return-1},Mr.startCase=Ka,Mr.startsWith=function(e,t,r){return e=va(e),r=null==r?0:on(da(r),0,e.length),t=si(t),e.slice(r,r+t.length)==t},Mr.subtract=Sc,Mr.sum=function(e){return e&&e.length?Yt(e,rc):0},Mr.sumBy=function(e,t){return e&&e.length?Yt(e,oo(t,2)):0},Mr.template=function(e,t,r){var n=Mr.templateSettings;r&&vo(e,t,r)&&(t=i),e=va(e),t=ba({},t,n,Gi);var o,s,a=ba({},t.imports,n.imports,Gi),c=Aa(a),u=Wt(a,c),l=0,f=t.interpolate||_e,h="__p += '",d=Ie((t.escape||_e).source+"|"+f.source+"|"+(f===J?fe:_e).source+"|"+(t.evaluate||_e).source+"|$","g"),p="//# sourceURL="+(Pe.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++nt+"]")+"\n";e.replace(d,(function(t,r,n,i,a,c){return n||(n=i),h+=e.slice(l,c).replace(be,rr),r&&(o=!0,h+="' +\n__e("+r+") +\n'"),a&&(s=!0,h+="';\n"+a+";\n__p += '"),n&&(h+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),l=c+t.length,t})),h+="';\n";var m=Pe.call(t,"variable")&&t.variable;if(m){if(ue.test(m))throw new we("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(s?h.replace(U,""):h).replace(Q,"$1").replace(B,"$1;"),h="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var y=Ja((function(){return Ee(c,p+"return "+h).apply(i,u)}));if(y.source=h,Gs(y))throw y;return y},Mr.times=function(e,t){if((e=da(e))<1||e>f)return[];var r=d,n=yr(e,d);t=oo(t),e-=d;for(var i=Kt(n,t);++r<e;)t(r);return i},Mr.toFinite=ha,Mr.toInteger=da,Mr.toLength=pa,Mr.toLower=function(e){return va(e).toLowerCase()},Mr.toNumber=ma,Mr.toSafeInteger=function(e){return e?on(da(e),-9007199254740991,f):0===e?e:0},Mr.toString=va,Mr.toUpper=function(e){return va(e).toUpperCase()},Mr.trim=function(e,t,r){if((e=va(e))&&(r||t===i))return Ht(e);if(!e||!(t=si(t)))return e;var n=lr(e),o=lr(t);return gi(n,Zt(n,o),Xt(n,o)+1).join("")},Mr.trimEnd=function(e,t,r){if((e=va(e))&&(r||t===i))return e.slice(0,fr(e)+1);if(!e||!(t=si(t)))return e;var n=lr(e);return gi(n,0,Xt(n,lr(t))+1).join("")},Mr.trimStart=function(e,t,r){if((e=va(e))&&(r||t===i))return e.replace(ne,"");if(!e||!(t=si(t)))return e;var n=lr(e);return gi(n,Zt(n,lr(t))).join("")},Mr.truncate=function(e,t){var r=30,n="...";if(Xs(t)){var o="separator"in t?t.separator:o;r="length"in t?da(t.length):r,n="omission"in t?si(t.omission):n}var s=(e=va(e)).length;if(nr(e)){var a=lr(e);s=a.length}if(r>=s)return e;var c=r-ur(n);if(c<1)return n;var u=a?gi(a,0,c).join(""):e.slice(0,c);if(o===i)return u+n;if(a&&(c+=u.length-c),ia(o)){if(e.slice(c).search(o)){var l,f=u;for(o.global||(o=Ie(o.source,va(he.exec(o))+"g")),o.lastIndex=0;l=o.exec(f);)var h=l.index;u=u.slice(0,h===i?c:h)}}else if(e.indexOf(si(o),c)!=c){var d=u.lastIndexOf(o);d>-1&&(u=u.slice(0,d))}return u+n},Mr.unescape=function(e){return(e=va(e))&&K.test(e)?e.replace(z,hr):e},Mr.uniqueId=function(e){var t=++$e;return va(e)+t},Mr.upperCase=Ha,Mr.upperFirst=Ga,Mr.each=vs,Mr.eachRight=gs,Mr.first=zo,sc(Mr,(yc={},gn(Mr,(function(e,t){Pe.call(Mr.prototype,t)||(yc[t]=e)})),yc),{chain:!1}),Mr.VERSION="4.17.21",It(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Mr[e].placeholder=Mr})),It(["drop","take"],(function(e,t){Lr.prototype[e]=function(r){r=r===i?1:mr(da(r),0);var n=this.__filtered__&&!t?new Lr(this):this.clone();return n.__filtered__?n.__takeCount__=yr(r,n.__takeCount__):n.__views__.push({size:yr(r,d),type:e+(n.__dir__<0?"Right":"")}),n},Lr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),It(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;Lr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:oo(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),It(["head","last"],(function(e,t){var r="take"+(t?"Right":"");Lr.prototype[e]=function(){return this[r](1).value()[0]}})),It(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");Lr.prototype[e]=function(){return this.__filtered__?new Lr(this):this[r](1)}})),Lr.prototype.compact=function(){return this.filter(rc)},Lr.prototype.find=function(e){return this.filter(e).head()},Lr.prototype.findLast=function(e){return this.reverse().find(e)},Lr.prototype.invokeMap=Kn((function(e,t){return"function"==typeof e?new Lr(this):this.map((function(r){return Nn(r,e,t)}))})),Lr.prototype.reject=function(e){return this.filter($s(oo(e)))},Lr.prototype.slice=function(e,t){e=da(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Lr(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==i&&(r=(t=da(t))<0?r.dropRight(-t):r.take(t-e)),r)},Lr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Lr.prototype.toArray=function(){return this.take(d)},gn(Lr.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),o=Mr[n?"take"+("last"==t?"Right":""):t],s=n||/^find/.test(t);o&&(Mr.prototype[t]=function(){var t=this.__wrapped__,a=n?[1]:arguments,c=t instanceof Lr,u=a[0],l=c||Qs(t),f=function(e){var t=o.apply(Mr,xt([e],a));return n&&h?t[0]:t};l&&r&&"function"==typeof u&&1!=u.length&&(c=l=!1);var h=this.__chain__,d=!!this.__actions__.length,p=s&&!h,m=c&&!d;if(!s&&l){t=m?t:new Lr(this);var y=e.apply(t,a);return y.__actions__.push({func:hs,args:[f],thisArg:i}),new Vr(y,h)}return p&&m?e.apply(this,a):(y=this.thru(f),p?n?y.value()[0]:y.value():y)})})),It(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Ne[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Mr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(Qs(i)?i:[],e)}return this[r]((function(r){return t.apply(Qs(r)?r:[],e)}))}})),gn(Lr.prototype,(function(e,t){var r=Mr[t];if(r){var n=r.name+"";Pe.call(Nr,n)||(Nr[n]=[]),Nr[n].push({name:t,func:r})}})),Nr[Mi(i,2).name]=[{name:"wrapper",func:i}],Lr.prototype.clone=function(){var e=new Lr(this.__wrapped__);return e.__actions__=Ti(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ti(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ti(this.__views__),e},Lr.prototype.reverse=function(){if(this.__filtered__){var e=new Lr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Lr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=Qs(e),n=t<0,i=r?e.length:0,o=function(e,t,r){for(var n=-1,i=r.length;++n<i;){var o=r[n],s=o.size;switch(o.type){case"drop":e+=s;break;case"dropRight":t-=s;break;case"take":t=yr(t,e+s);break;case"takeRight":e=mr(e,t-s)}}return{start:e,end:t}}(0,i,this.__views__),s=o.start,a=o.end,c=a-s,u=n?a:s-1,l=this.__iteratees__,f=l.length,h=0,d=yr(c,this.__takeCount__);if(!r||!n&&i==c&&d==c)return fi(e,this.__actions__);var p=[];e:for(;c--&&h<d;){for(var m=-1,y=e[u+=t];++m<f;){var v=l[m],g=v.iteratee,_=v.type,b=g(y);if(2==_)y=b;else if(!b){if(1==_)continue e;break e}}p[h++]=y}return p},Mr.prototype.at=ds,Mr.prototype.chain=function(){return fs(this)},Mr.prototype.commit=function(){return new Vr(this.value(),this.__chain__)},Mr.prototype.next=function(){this.__values__===i&&(this.__values__=fa(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Mr.prototype.plant=function(e){for(var t,r=this;r instanceof qr;){var n=Fo(r);n.__index__=0,n.__values__=i,t?o.__wrapped__=n:t=n;var o=n;r=r.__wrapped__}return o.__wrapped__=e,t},Mr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Lr){var t=e;return this.__actions__.length&&(t=new Lr(this)),(t=t.reverse()).__actions__.push({func:hs,args:[Xo],thisArg:i}),new Vr(t,this.__chain__)}return this.thru(Xo)},Mr.prototype.toJSON=Mr.prototype.valueOf=Mr.prototype.value=function(){return fi(this.__wrapped__,this.__actions__)},Mr.prototype.first=Mr.prototype.head,Ge&&(Mr.prototype[Ge]=function(){return this}),Mr}();ft._=dr,(n=function(){return dr}.call(t,r,t,e))===i||(e.exports=n)}.call(this)},2371:function(e,t){!function(e){function t(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(t.length>1){t[0]=t[0].slice(0,-1);for(var n=t.length-1,i=1;i<n;++i)t[i]=t[i].slice(1,-1);return t[n]=t[n].slice(1),t.join("")}return t[0]}function r(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function i(e){return e.toUpperCase()}function o(e){var n="[A-Za-z]",i="[0-9]",o=t(i,"[A-Fa-f]"),s=r(r("%[EFef]"+o+"%"+o+o+"%"+o+o)+"|"+r("%[89A-Fa-f]"+o+"%"+o+o)+"|"+r("%"+o+o)),a="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=t("[\\:\\/\\?\\#\\[\\]\\@]",a),u=e?"[\\uE000-\\uF8FF]":"[]",l=t(n,i,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]"),f=r(n+t(n,i,"[\\+\\-\\.]")+"*"),h=r(r(s+"|"+t(l,a,"[\\:]"))+"*"),d=(r(r("25[0-5]")+"|"+r("2[0-4]"+i)+"|"+r("1"+i+i)+"|"+r("[1-9]"+i)+"|"+i),r(r("25[0-5]")+"|"+r("2[0-4]"+i)+"|"+r("1"+i+i)+"|"+r("0?[1-9]"+i)+"|0?0?"+i)),p=r(d+"\\."+d+"\\."+d+"\\."+d),m=r(o+"{1,4}"),y=r(r(m+"\\:"+m)+"|"+p),v=r(r(m+"\\:")+"{6}"+y),g=r("\\:\\:"+r(m+"\\:")+"{5}"+y),_=r(r(m)+"?\\:\\:"+r(m+"\\:")+"{4}"+y),b=r(r(r(m+"\\:")+"{0,1}"+m)+"?\\:\\:"+r(m+"\\:")+"{3}"+y),w=r(r(r(m+"\\:")+"{0,2}"+m)+"?\\:\\:"+r(m+"\\:")+"{2}"+y),E=r(r(r(m+"\\:")+"{0,3}"+m)+"?\\:\\:"+m+"\\:"+y),S=r(r(r(m+"\\:")+"{0,4}"+m)+"?\\:\\:"+y),O=r(r(r(m+"\\:")+"{0,5}"+m)+"?\\:\\:"+m),I=r(r(r(m+"\\:")+"{0,6}"+m)+"?\\:\\:"),T=r([v,g,_,b,w,E,S,O,I].join("|")),k=r(r(l+"|"+s)+"+"),N=(r(T+"\\%25"+k),r(T+r("\\%25|\\%(?!"+o+"{2})")+k)),D=r("[vV]"+o+"+\\."+t(l,a,"[\\:]")+"+"),A=r("\\["+r(N+"|"+T+"|"+D)+"\\]"),R=r(r(s+"|"+t(l,a))+"*"),x=r(A+"|"+p+"(?!"+R+")|"+R),P=r(i+"*"),$=r(r(h+"@")+"?"+x+r("\\:"+P)+"?"),C=r(s+"|"+t(l,a,"[\\:\\@]")),j=r(C+"*"),M=r(C+"+"),F=r(r(s+"|"+t(l,a,"[\\@]"))+"+"),q=r(r("\\/"+j)+"*"),V=r("\\/"+r(M+q)+"?"),L=r(F+q),U=r(M+q),Q="(?!"+C+")",B=(r(q+"|"+V+"|"+L+"|"+U+"|"+Q),r(r(C+"|"+t("[\\/\\?]",u))+"*")),z=r(r(C+"|[\\/\\?]")+"*"),Y=r(r("\\/\\/"+$+q)+"|"+V+"|"+U+"|"+Q),K=r(f+"\\:"+Y+r("\\?"+B)+"?"+r("\\#"+z)+"?"),H=r(r("\\/\\/"+$+q)+"|"+V+"|"+L+"|"+Q),G=r(H+r("\\?"+B)+"?"+r("\\#"+z)+"?");return r(K+"|"+G),r(f+"\\:"+Y+r("\\?"+B)+"?"),r(r("\\/\\/("+r("("+h+")@")+"?("+x+")"+r("\\:("+P+")")+"?)")+"?("+q+"|"+V+"|"+U+"|"+Q+")"),r("\\?("+B+")"),r("\\#("+z+")"),r(r("\\/\\/("+r("("+h+")@")+"?("+x+")"+r("\\:("+P+")")+"?)")+"?("+q+"|"+V+"|"+L+"|"+Q+")"),r("\\?("+B+")"),r("\\#("+z+")"),r(r("\\/\\/("+r("("+h+")@")+"?("+x+")"+r("\\:("+P+")")+"?)")+"?("+q+"|"+V+"|"+U+"|"+Q+")"),r("\\?("+B+")"),r("\\#("+z+")"),r("("+h+")@"),r("\\:("+P+")"),{NOT_SCHEME:new RegExp(t("[^]",n,i,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(t("[^\\%\\:]",l,a),"g"),NOT_HOST:new RegExp(t("[^\\%\\[\\]\\:]",l,a),"g"),NOT_PATH:new RegExp(t("[^\\%\\/\\:\\@]",l,a),"g"),NOT_PATH_NOSCHEME:new RegExp(t("[^\\%\\/\\@]",l,a),"g"),NOT_QUERY:new RegExp(t("[^\\%]",l,a,"[\\:\\@\\/\\?]",u),"g"),NOT_FRAGMENT:new RegExp(t("[^\\%]",l,a,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(t("[^]",l,a),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(t("[^\\%]",l,c),"g"),PCT_ENCODED:new RegExp(s,"g"),IPV4ADDRESS:new RegExp("^("+p+")$"),IPV6ADDRESS:new RegExp("^\\[?("+T+")"+r(r("\\%25|\\%(?!"+o+"{2})")+"("+k+")")+"?\\]?$")}}var s=o(!1),a=o(!0),c=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{!n&&a.return&&a.return()}finally{if(i)throw o}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},u=2147483647,l=36,f=/^xn--/,h=/[^\0-\x7E]/,d=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,y=String.fromCharCode;function v(e){throw new RangeError(p[e])}function g(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+function(e,t){for(var r=[],n=e.length;n--;)r[n]=t(e[n]);return r}((e=e.replace(d,".")).split("."),t).join(".")}function _(e){for(var t=[],r=0,n=e.length;r<n;){var i=e.charCodeAt(r++);if(i>=55296&&i<=56319&&r<n){var o=e.charCodeAt(r++);56320==(64512&o)?t.push(((1023&i)<<10)+(1023&o)+65536):(t.push(i),r--)}else t.push(i)}return t}var b=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},w=function(e,t,r){var n=0;for(e=r?m(e/700):e>>1,e+=m(e/t);e>455;n+=l)e=m(e/35);return m(n+36*e/(e+38))},E=function(e){var t,r=[],n=e.length,i=0,o=128,s=72,a=e.lastIndexOf("-");a<0&&(a=0);for(var c=0;c<a;++c)e.charCodeAt(c)>=128&&v("not-basic"),r.push(e.charCodeAt(c));for(var f=a>0?a+1:0;f<n;){for(var h=i,d=1,p=l;;p+=l){f>=n&&v("invalid-input");var y=(t=e.charCodeAt(f++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:l;(y>=l||y>m((u-i)/d))&&v("overflow"),i+=y*d;var g=p<=s?1:p>=s+26?26:p-s;if(y<g)break;var _=l-g;d>m(u/_)&&v("overflow"),d*=_}var b=r.length+1;s=w(i-h,b,0==h),m(i/b)>u-o&&v("overflow"),o+=m(i/b),i%=b,r.splice(i++,0,o)}return String.fromCodePoint.apply(String,r)},S=function(e){var t=[],r=(e=_(e)).length,n=128,i=0,o=72,s=!0,a=!1,c=void 0;try{for(var f,h=e[Symbol.iterator]();!(s=(f=h.next()).done);s=!0){var d=f.value;d<128&&t.push(y(d))}}catch(e){a=!0,c=e}finally{try{!s&&h.return&&h.return()}finally{if(a)throw c}}var p=t.length,g=p;for(p&&t.push("-");g<r;){var E=u,S=!0,O=!1,I=void 0;try{for(var T,k=e[Symbol.iterator]();!(S=(T=k.next()).done);S=!0){var N=T.value;N>=n&&N<E&&(E=N)}}catch(e){O=!0,I=e}finally{try{!S&&k.return&&k.return()}finally{if(O)throw I}}var D=g+1;E-n>m((u-i)/D)&&v("overflow"),i+=(E-n)*D,n=E;var A=!0,R=!1,x=void 0;try{for(var P,$=e[Symbol.iterator]();!(A=(P=$.next()).done);A=!0){var C=P.value;if(C<n&&++i>u&&v("overflow"),C==n){for(var j=i,M=l;;M+=l){var F=M<=o?1:M>=o+26?26:M-o;if(j<F)break;var q=j-F,V=l-F;t.push(y(b(F+q%V,0))),j=m(q/V)}t.push(y(b(j,0))),o=w(i,D,g==p),i=0,++g}}}catch(e){R=!0,x=e}finally{try{!A&&$.return&&$.return()}finally{if(R)throw x}}++i,++n}return t.join("")},O={version:"2.1.0",ucs2:{decode:_,encode:function(e){return String.fromCodePoint.apply(String,function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}(e))}},decode:E,encode:S,toASCII:function(e){return g(e,(function(e){return h.test(e)?"xn--"+S(e):e}))},toUnicode:function(e){return g(e,(function(e){return f.test(e)?E(e.slice(4).toLowerCase()):e}))}},I={};function T(e){var t=e.charCodeAt(0);return t<16?"%0"+t.toString(16).toUpperCase():t<128?"%"+t.toString(16).toUpperCase():t<2048?"%"+(t>>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function k(e){for(var t="",r=0,n=e.length;r<n;){var i=parseInt(e.substr(r+1,2),16);if(i<128)t+=String.fromCharCode(i),r+=3;else if(i>=194&&i<224){if(n-r>=6){var o=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&i)<<6|63&o)}else t+=e.substr(r,6);r+=6}else if(i>=224){if(n-r>=9){var s=parseInt(e.substr(r+4,2),16),a=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&i)<<12|(63&s)<<6|63&a)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function N(e,t){function r(e){var r=k(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,T).replace(t.PCT_ENCODED,i)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,T).replace(t.PCT_ENCODED,i)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,T).replace(t.PCT_ENCODED,i)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,T).replace(t.PCT_ENCODED,i)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,T).replace(t.PCT_ENCODED,i)),e}function D(e){return e.replace(/^0*(.*)/,"$1")||"0"}function A(e,t){var r=e.match(t.IPV4ADDRESS)||[],n=c(r,2)[1];return n?n.split(".").map(D).join("."):e}function R(e,t){var r=e.match(t.IPV6ADDRESS)||[],n=c(r,3),i=n[1],o=n[2];if(i){for(var s=i.toLowerCase().split("::").reverse(),a=c(s,2),u=a[0],l=a[1],f=l?l.split(":").map(D):[],h=u.split(":").map(D),d=t.IPV4ADDRESS.test(h[h.length-1]),p=d?7:8,m=h.length-p,y=Array(p),v=0;v<p;++v)y[v]=f[v]||h[m+v]||"";d&&(y[p-1]=A(y[p-1],t));var g=y.reduce((function(e,t,r){if(!t||"0"===t){var n=e[e.length-1];n&&n.index+n.length===r?n.length++:e.push({index:r,length:1})}return e}),[]).sort((function(e,t){return t.length-e.length}))[0],_=void 0;if(g&&g.length>1){var b=y.slice(0,g.index),w=y.slice(g.index+g.length);_=b.join(":")+"::"+w.join(":")}else _=y.join(":");return o&&(_+="%"+o),_}return e}var x=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,P=void 0==="".match(/(){0}/)[1];function $(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},n=!1!==t.iri?a:s;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var i=e.match(x);if(i){P?(r.scheme=i[1],r.userinfo=i[3],r.host=i[4],r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=i[7],r.fragment=i[8],isNaN(r.port)&&(r.port=i[5])):(r.scheme=i[1]||void 0,r.userinfo=-1!==e.indexOf("@")?i[3]:void 0,r.host=-1!==e.indexOf("//")?i[4]:void 0,r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=-1!==e.indexOf("?")?i[7]:void 0,r.fragment=-1!==e.indexOf("#")?i[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?i[4]:void 0)),r.host&&(r.host=R(A(r.host,n),n)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var o=I[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||o&&o.unicodeSupport)N(r,n);else{if(r.host&&(t.domainHost||o&&o.domainHost))try{r.host=O.toASCII(r.host.replace(n.PCT_ENCODED,k).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}N(r,s)}o&&o.parse&&o.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}var C=/^\.\.?\//,j=/^\/\.(\/|$)/,M=/^\/\.\.(\/|$)/,F=/^\/?(?:.|\n)*?(?=\/|$)/;function q(e){for(var t=[];e.length;)if(e.match(C))e=e.replace(C,"");else if(e.match(j))e=e.replace(j,"/");else if(e.match(M))e=e.replace(M,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(F);if(!r)throw new Error("Unexpected dot segment condition");var n=r[0];e=e.slice(n.length),t.push(n)}return t.join("")}function V(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?a:s,n=[],i=I[(t.scheme||e.scheme||"").toLowerCase()];if(i&&i.serialize&&i.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||i&&i.domainHost)try{e.host=t.iri?O.toUnicode(e.host):O.toASCII(e.host.replace(r.PCT_ENCODED,k).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}N(e,r),"suffix"!==t.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var o=function(e,t){var r=!1!==t.iri?a:s,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(R(A(String(e.host),r),r).replace(r.IPV6ADDRESS,(function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}(e,t);if(void 0!==o&&("suffix"!==t.reference&&n.push("//"),n.push(o),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var c=e.path;t.absolutePath||i&&i.absolutePath||(c=q(c)),void 0===o&&(c=c.replace(/^\/\//,"/%2F")),n.push(c)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function L(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=$(V(e,r),r),t=$(V(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(n.scheme=t.scheme,n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=q(t.path||""),n.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=q(t.path||""),n.query=t.query):(t.path?("/"===t.path.charAt(0)?n.path=q(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:n.path=t.path:n.path="/"+t.path,n.path=q(n.path)),n.query=t.query):(n.path=e.path,void 0!==t.query?n.query=t.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=t.fragment,n}function U(e,t){return e&&e.toString().replace(t&&t.iri?a.PCT_ENCODED:s.PCT_ENCODED,k)}var Q={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var r="https"===String(e.scheme).toLowerCase();return e.port!==(r?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},B={scheme:"https",domainHost:Q.domainHost,parse:Q.parse,serialize:Q.serialize};function z(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var Y={scheme:"ws",domainHost:!0,parse:function(e,t){var r=e;return r.secure=z(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r},serialize:function(e,t){if(e.port!==(z(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var r=e.resourceName.split("?"),n=c(r,2),i=n[0],o=n[1];e.path=i&&"/"!==i?i:void 0,e.query=o,e.resourceName=void 0}return e.fragment=void 0,e}},K={scheme:"wss",domainHost:Y.domainHost,parse:Y.parse,serialize:Y.serialize},H={},G="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",W="[0-9A-Fa-f]",J=r(r("%[EFef]"+W+"%"+W+W+"%"+W+W)+"|"+r("%[89A-Fa-f]"+W+"%"+W+W)+"|"+r("%"+W+W)),Z=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),X=new RegExp(G,"g"),ee=new RegExp(J,"g"),te=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',Z),"g"),re=new RegExp(t("[^]",G,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),ne=re;function ie(e){var t=k(e);return t.match(X)?t:e}var oe={scheme:"mailto",parse:function(e,t){var r=e,n=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var i=!1,o={},s=r.query.split("&"),a=0,c=s.length;a<c;++a){var u=s[a].split("=");switch(u[0]){case"to":for(var l=u[1].split(","),f=0,h=l.length;f<h;++f)n.push(l[f]);break;case"subject":r.subject=U(u[1],t);break;case"body":r.body=U(u[1],t);break;default:i=!0,o[U(u[0],t)]=U(u[1],t)}}i&&(r.headers=o)}r.query=void 0;for(var d=0,p=n.length;d<p;++d){var m=n[d].split("@");if(m[0]=U(m[0]),t.unicodeSupport)m[1]=U(m[1],t).toLowerCase();else try{m[1]=O.toASCII(U(m[1],t).toLowerCase())}catch(e){r.error=r.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[d]=m.join("@")}return r},serialize:function(e,t){var r,n=e,o=null!=(r=e.to)?r instanceof Array?r:"number"!=typeof r.length||r.split||r.setInterval||r.call?[r]:Array.prototype.slice.call(r):[];if(o){for(var s=0,a=o.length;s<a;++s){var c=String(o[s]),u=c.lastIndexOf("@"),l=c.slice(0,u).replace(ee,ie).replace(ee,i).replace(te,T),f=c.slice(u+1);try{f=t.iri?O.toUnicode(f):O.toASCII(U(f,t).toLowerCase())}catch(e){n.error=n.error||"Email address's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+e}o[s]=l+"@"+f}n.path=o.join(",")}var h=e.headers=e.headers||{};e.subject&&(h.subject=e.subject),e.body&&(h.body=e.body);var d=[];for(var p in h)h[p]!==H[p]&&d.push(p.replace(ee,ie).replace(ee,i).replace(re,T)+"="+h[p].replace(ee,ie).replace(ee,i).replace(ne,T));return d.length&&(n.query=d.join("&")),n}},se=/^([^\:]+)\:(.*)/,ae={scheme:"urn",parse:function(e,t){var r=e.path&&e.path.match(se),n=e;if(r){var i=t.scheme||n.scheme||"urn",o=r[1].toLowerCase(),s=r[2],a=i+":"+(t.nid||o),c=I[a];n.nid=o,n.nss=s,n.path=void 0,c&&(n=c.parse(n,t))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,t){var r=t.scheme||e.scheme||"urn",n=e.nid,i=r+":"+(t.nid||n),o=I[i];o&&(e=o.serialize(e,t));var s=e,a=e.nss;return s.path=(n||t.nid)+":"+a,s}},ce=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,ue={scheme:"urn:uuid",parse:function(e,t){var r=e;return r.uuid=r.nss,r.nss=void 0,t.tolerant||r.uuid&&r.uuid.match(ce)||(r.error=r.error||"UUID is not valid."),r},serialize:function(e,t){var r=e;return r.nss=(e.uuid||"").toLowerCase(),r}};I[Q.scheme]=Q,I[B.scheme]=B,I[Y.scheme]=Y,I[K.scheme]=K,I[oe.scheme]=oe,I[ae.scheme]=ae,I[ue.scheme]=ue,e.SCHEMES=I,e.pctEncChar=T,e.pctDecChars=k,e.parse=$,e.removeDotSegments=q,e.serialize=V,e.resolveComponents=L,e.resolve=function(e,t,r){var n=function(e,t){var r=e;if(t)for(var n in t)r[n]=t[n];return r}({scheme:"null"},r);return V(L($(e,n),$(t,n),n,!0),n)},e.normalize=function(e,t){return"string"==typeof e?e=V($(e,t),t):"object"===n(e)&&(e=$(V(e,t),t)),e},e.equal=function(e,t,r){return"string"==typeof e?e=V($(e,r),r):"object"===n(e)&&(e=V(e,r)),"string"==typeof t?t=V($(t,r),r):"object"===n(t)&&(t=V(t,r)),e===t},e.escapeComponent=function(e,t){return e&&e.toString().replace(t&&t.iri?a.ESCAPE:s.ESCAPE,T)},e.unescapeComponent=U,Object.defineProperty(e,"__esModule",{value:!0})}(t)},1143:e=>{e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},1512:e=>{e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')}},i={};function o(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={id:e,loaded:!1,exports:{}};return n[e].call(r.exports,r,r.exports,o),r.loaded=!0,r.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var s={};(()=>{var n,i;o.d(s,{Jk:()=>He,hx:()=>se,my:()=>ce,g6:()=>wa,jP:()=>ze,zk:()=>Ke,VE:()=>Ja}),function(e){e.database="database",e.api="api",e.observability="observability",e.crm="crm",e.auth="auth",e.ai="ai"}(n||(n={})),function(e){e.built_in_db="built_in_db",e.mongo="mongo",e.mysql="mysql",e.mssql="mssql",e.postgres="postgres",e.cockroach="cockroach",e.api="api",e.graphql="graphql",e.snowflake="snowflake",e.datadog="datadog",e.newrelic="newrelic",e.auth0="auth0",e.jwt_rsa="jwt_rsa",e.jwt_hmac="jwt_hmac",e.ai_assistant="ai_assistant",e.cognito="cognito",e.okta="okta",e.algolia="algolia",e.elastic_observability="elastic_observability",e.elastic_search="elastic_search",e.elastic_enterprise_search="elastic_enterprise_search",e.sentry="sentry",e.sap_hana="sap_hana",e.salesforce_crm="salesforce_crm",e.documentdb="documentdb",e.dynamodb="dynamodb",e.cassandra="cassandra",e.clickhouse="clickhouse",e.alloydb="alloydb",e.spanner="spanner",e.db2="db2",e.mariadb="mariadb",e.oracledb="oracledb",e.redis="redis",e.xata="xata",e.azure_sql="azure_sql"}(i||(i={})),i.built_in_db,i.mongo,i.mysql,i.mssql,i.postgres,i.cockroach,i.snowflake,i.oracledb,i.api,i.graphql,i.datadog,i.newrelic,i.auth0,i.jwt_rsa,i.jwt_hmac,i.cognito,i.okta;var a;i.built_in_db,i.mysql,i.oracledb,i.mssql,i.postgres,i.cockroach,i.mongo,i.api,i.graphql,i.snowflake,i.datadog,Object.keys({us1:"US1 - East",us3:"US3 - West",us5:"US5 - Central",eu1:"EU1 - Europe",ap1:"AP1 - Asia","us1-fed":"US1-FED (FedRamp)"}),i.newrelic,Object.keys({worldwide:"Worldwide",eu:"Europe"}),i.auth0,i.jwt_rsa,i.jwt_hmac,i.ai_assistant,i.cognito,i.okta,i.mysql,i.oracledb,i.mssql,i.postgres,i.cockroach,i.mongo,i.snowflake,i.graphql,i.mysql,i.oracledb,i.mssql,i.snowflake,i.postgres,i.cockroach,i.mongo,i.built_in_db,i.graphql,function(e){e.EVERY_SECOND="* * * * * *",e.EVERY_5_SECONDS="*/5 * * * * *",e.EVERY_10_SECONDS="*/10 * * * * *",e.EVERY_30_SECONDS="*/30 * * * * *",e.EVERY_MINUTE="*/1 * * * *",e.EVERY_5_MINUTES="0 */5 * * * *",e.EVERY_10_MINUTES="0 */10 * * * *",e.EVERY_30_MINUTES="0 */30 * * * *",e.EVERY_HOUR="0 0-23/1 * * *",e.EVERY_2_HOURS="0 0-23/2 * * *",e.EVERY_3_HOURS="0 0-23/3 * * *",e.EVERY_4_HOURS="0 0-23/4 * * *",e.EVERY_5_HOURS="0 0-23/5 * * *",e.EVERY_6_HOURS="0 0-23/6 * * *",e.EVERY_7_HOURS="0 0-23/7 * * *",e.EVERY_8_HOURS="0 0-23/8 * * *",e.EVERY_9_HOURS="0 0-23/9 * * *",e.EVERY_10_HOURS="0 0-23/10 * * *",e.EVERY_11_HOURS="0 0-23/11 * * *",e.EVERY_12_HOURS="0 0-23/12 * * *",e.EVERY_DAY_AT_1AM="0 01 * * *",e.EVERY_DAY_AT_2AM="0 02 * * *",e.EVERY_DAY_AT_3AM="0 03 * * *",e.EVERY_DAY_AT_4AM="0 04 * * *",e.EVERY_DAY_AT_5AM="0 05 * * *",e.EVERY_DAY_AT_6AM="0 06 * * *",e.EVERY_DAY_AT_7AM="0 07 * * *",e.EVERY_DAY_AT_8AM="0 08 * * *",e.EVERY_DAY_AT_9AM="0 09 * * *",e.EVERY_DAY_AT_10AM="0 10 * * *",e.EVERY_DAY_AT_11AM="0 11 * * *",e.EVERY_DAY_AT_NOON="0 12 * * *",e.EVERY_DAY_AT_1PM="0 13 * * *",e.EVERY_DAY_AT_2PM="0 14 * * *",e.EVERY_DAY_AT_3PM="0 15 * * *",e.EVERY_DAY_AT_4PM="0 16 * * *",e.EVERY_DAY_AT_5PM="0 17 * * *",e.EVERY_DAY_AT_6PM="0 18 * * *",e.EVERY_DAY_AT_7PM="0 19 * * *",e.EVERY_DAY_AT_8PM="0 20 * * *",e.EVERY_DAY_AT_9PM="0 21 * * *",e.EVERY_DAY_AT_10PM="0 22 * * *",e.EVERY_DAY_AT_11PM="0 23 * * *",e.EVERY_DAY_AT_MIDNIGHT="0 0 * * *",e.EVERY_WEEK="0 0 * * 0",e.EVERY_WEEKDAY="0 0 * * 1-5",e.EVERY_WEEKEND="0 0 * * 6,0",e.EVERY_1ST_DAY_OF_MONTH_AT_MIDNIGHT="0 0 1 * *",e.EVERY_1ST_DAY_OF_MONTH_AT_NOON="0 12 1 * *",e.EVERY_2ND_HOUR="0 */2 * * *",e.EVERY_2ND_HOUR_FROM_1AM_THROUGH_11PM="0 1-23/2 * * *",e.EVERY_2ND_MONTH="0 0 1 */2 *",e.EVERY_QUARTER="0 0 1 */3 *",e.EVERY_6_MONTHS="0 0 1 */6 *",e.EVERY_YEAR="0 0 1 0 *",e.EVERY_30_MINUTES_BETWEEN_9AM_AND_5PM="0 */30 9-17 * * *",e.EVERY_30_MINUTES_BETWEEN_9AM_AND_6PM="0 */30 9-18 * * *",e.EVERY_30_MINUTES_BETWEEN_10AM_AND_7PM="0 */30 10-19 * * *",e.MONDAY_TO_FRIDAY_AT_1AM="0 0 01 * * 1-5",e.MONDAY_TO_FRIDAY_AT_2AM="0 0 02 * * 1-5",e.MONDAY_TO_FRIDAY_AT_3AM="0 0 03 * * 1-5",e.MONDAY_TO_FRIDAY_AT_4AM="0 0 04 * * 1-5",e.MONDAY_TO_FRIDAY_AT_5AM="0 0 05 * * 1-5",e.MONDAY_TO_FRIDAY_AT_6AM="0 0 06 * * 1-5",e.MONDAY_TO_FRIDAY_AT_7AM="0 0 07 * * 1-5",e.MONDAY_TO_FRIDAY_AT_8AM="0 0 08 * * 1-5",e.MONDAY_TO_FRIDAY_AT_9AM="0 0 09 * * 1-5",e.MONDAY_TO_FRIDAY_AT_09_30AM="0 30 09 * * 1-5",e.MONDAY_TO_FRIDAY_AT_10AM="0 0 10 * * 1-5",e.MONDAY_TO_FRIDAY_AT_11AM="0 0 11 * * 1-5",e.MONDAY_TO_FRIDAY_AT_11_30AM="0 30 11 * * 1-5",e.MONDAY_TO_FRIDAY_AT_12PM="0 0 12 * * 1-5",e.MONDAY_TO_FRIDAY_AT_1PM="0 0 13 * * 1-5",e.MONDAY_TO_FRIDAY_AT_2PM="0 0 14 * * 1-5",e.MONDAY_TO_FRIDAY_AT_3PM="0 0 15 * * 1-5",e.MONDAY_TO_FRIDAY_AT_4PM="0 0 16 * * 1-5",e.MONDAY_TO_FRIDAY_AT_5PM="0 0 17 * * 1-5",e.MONDAY_TO_FRIDAY_AT_6PM="0 0 18 * * 1-5",e.MONDAY_TO_FRIDAY_AT_7PM="0 0 19 * * 1-5",e.MONDAY_TO_FRIDAY_AT_8PM="0 0 20 * * 1-5",e.MONDAY_TO_FRIDAY_AT_9PM="0 0 21 * * 1-5",e.MONDAY_TO_FRIDAY_AT_10PM="0 0 22 * * 1-5",e.MONDAY_TO_FRIDAY_AT_11PM="0 0 23 * * 1-5"}(a||(a={}));var c,u,l=o(8784);function f(e){return null!=e}(u=c||(c={}))[u.CONTINUE=100]="CONTINUE",u[u.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",u[u.PROCESSING=102]="PROCESSING",u[u.EARLYHINTS=103]="EARLYHINTS",u[u.OK=200]="OK",u[u.CREATED=201]="CREATED",u[u.ACCEPTED=202]="ACCEPTED",u[u.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",u[u.NO_CONTENT=204]="NO_CONTENT",u[u.RESET_CONTENT=205]="RESET_CONTENT",u[u.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",u[u.AMBIGUOUS=300]="AMBIGUOUS",u[u.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",u[u.FOUND=302]="FOUND",u[u.SEE_OTHER=303]="SEE_OTHER",u[u.NOT_MODIFIED=304]="NOT_MODIFIED",u[u.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",u[u.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",u[u.BAD_REQUEST=400]="BAD_REQUEST",u[u.UNAUTHORIZED=401]="UNAUTHORIZED",u[u.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",u[u.FORBIDDEN=403]="FORBIDDEN",u[u.NOT_FOUND=404]="NOT_FOUND",u[u.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",u[u.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",u[u.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",u[u.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",u[u.CONFLICT=409]="CONFLICT",u[u.GONE=410]="GONE",u[u.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",u[u.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",u[u.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",u[u.URI_TOO_LONG=414]="URI_TOO_LONG",u[u.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",u[u.REQUESTED_RANGE_NOT_SATISFIABLE=416]="REQUESTED_RANGE_NOT_SATISFIABLE",u[u.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",u[u.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",u[u.MISDIRECTED=421]="MISDIRECTED",u[u.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",u[u.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",u[u.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",u[u.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",u[u.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",u[u.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",u[u.BAD_GATEWAY=502]="BAD_GATEWAY",u[u.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",u[u.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",u[u.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED";class h extends Error{constructor(e,t,r){super(e),this.statusCode=t,this.details=r}}function d(e){if(!(e instanceof Object))throw new Error("Field sort has to be an object");var t,r;m((t=e,r=["fieldName","asc"],!Array.isArray(t)&&[...Object.keys(t)].every((e=>r.includes(e)))),"Field sort should only contain a fieldName and asc"),m(p(e.asc,"boolean"),"Asc needs to be boolean"),function(e){if(!e||"string"!=typeof e)throw new Error("Field name has to be a non-empty string");if("__docId__"!==e&&!e.match(/^[a-zA-Z][a-zA-Z0-9!@#$%^&*~_]{0,49}$/))throw new Error("A Field name can contain only a-z, A-Z, 0-9,!@#$%^&*~_, starting with a letter, at least one character, and up to 50. Field name: "+e)}(e.fieldName)}function p(e,t){return Array.isArray(e)?e.every((e=>typeof e===t)):typeof e===t}function m(e,t){if(e)return;const r="function"==typeof t?t():t;throw r instanceof Error?r:new Error(null!=r?r:"Assertion error")}function y(e,t){return m(e,t),e}function v(e,t,r="."){const n=t.split(r);let i,o=e;for(;o&&n.length;){const e=y(n.shift());if(!(o instanceof Object&&e in o))return;i=o[e],o=i}return i}function g(e){return"object"==typeof e&&Reflect.getPrototypeOf(e)===Object.prototype}function _(e,t,r,n="."){var i;const o=t.split(n);let s=e;for(;o.length;){const e=y(o.shift());if(o.length){const t=g(s[e])&&null!==(i=l.clone(s[e]))&&void 0!==i?i:{};s[e]=t,s=t}else s[e]=r}}function b(e,t,r="."){var n;const i=t.split(r);let o=e;for(;i.length;){const e=y(i.shift());if(i.length){const t=g(o[e])&&null!==(n=l.clone(o[e]))&&void 0!==n?n:{};o[e]=t,o=t}else delete o[e]}}function w(e,t,r){if(e.has(t)){const n=e.get(t);e.delete(t),e.set(r,n)}}function E(e){if(Array.isArray(e))return e.map((e=>E(e)));if("object"!=typeof e||null===e||e instanceof Date)return e;const t=Object.keys(e),r={};return t.sort().forEach((t=>{r[t]=E(e[t])})),r}function S(e){return O(E(e))}function O(e){if(void 0===e)return null;const t=l.cloneDeepWith(e,(e=>l.isDate(e)?{$date:e.toISOString()}:void 0));return JSON.stringify(t)}function I(e){const t=JSON.parse(e);return l.cloneDeepWith(t,(e=>l.isObject(e)&&l.has(e,"$date")&&1===Object.keys(e).length?new Date(e.$date):void 0))}function T(e){if(void 0===e)throw new Error("INVALID_ENCODE_VALUE");const t=O(e);if("undefined"!=typeof Buffer)return Buffer.from(t,"utf8").toString("base64");{const e=(new TextEncoder).encode(t);let r="";for(let t=0;t<e.length;t++)r+=String.fromCharCode(e[t]);return window.btoa(r)}}function k(e){let t;if("undefined"!=typeof Buffer)t=Buffer.from(e,"base64").toString("utf8");else{const r=window.atob(e),n=new Uint8Array(r.length);for(let e=0;e<n.length;e++)n[e]=r.charCodeAt(e);t=(new TextDecoder).decode(n)}return I(t)}class N{}class D extends N{async findQueriesForDocument(e,t,r,n){const i=await this.getMapping(e,r,n);return i?A(i,t):[]}}function A(e,t){var r;const n=[...e.unconditional||[]],i=new Set,o=new Map;for(const[n,s]of Object.entries(e.conditional||{})){const e=k(n);for(const[n,a]of Object.entries(s)){const s=[],c=null!==(r=v(t,e))&&void 0!==r?r:null,u=T(c);switch(n){case"==":s.push(...a[u]||[]);break;case"!=":{(a[u]||[]).forEach((e=>i.add(e)));const e=Object.entries(a).filter((([e])=>e!==u));for(const[t,r]of e)s.push(...r);break}case"<":case"<=":case">":case">=":case"like":case"not like":case"like_cs":case"not like_cs":f(c)&&s.push(...Object.entries(a).filter((([e])=>R(k(e),c,n))).reduce(((e,[t,r])=>(e.push(...r),e)),[]));break;default:throw new Error("Unsupported operator: "+n)}for(const e of s)o.set(e,(o.get(e)||0)+1)}}for(const[t,r]of o.entries())i.has(t)||r>=e.queriesMetadata[t].condCount&&n.push(t);return n}function R(e,t,r){if(null===e||null===t)return!1;switch(r){case"<":return t<e;case"<=":return t<=e;case">":return t>e;case">=":return t>=e;case"like":return"string"==typeof t&&"string"==typeof e&&x(t,e,!1);case"not like":return!("string"==typeof t&&"string"==typeof e&&x(t,e,!1));case"like_cs":return"string"==typeof t&&"string"==typeof e&&x(t,e,!0);case"not like_cs":return!("string"==typeof t&&"string"==typeof e&&x(t,e,!0));default:throw new Error(`Unsupported operator comparison: ${r}`)}}function x(e,t,r){r||(e=e.toLowerCase(),t=t.toLowerCase());const n=t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&").replace(/%/g,".*");return new RegExp(`^${n}$`).test(e)}function P(e,t){return`${e}_${t}`}const $={"in:in":(e,t)=>e.every((e=>t.includes(e))),"in:not in":(e,t)=>e.every((e=>!t.includes(e))),"not in:not in":(e,t)=>t.every((t=>e.includes(t))),">:not in":(e,t)=>t.every((t=>e>=t)),">=:not in":(e,t)=>t.every((t=>e>t)),"<:not in":(e,t)=>t.every((t=>e<=t)),"<=:not in":(e,t)=>t.every((t=>e<t)),">:>":(e,t)=>e>=t,">=:>":(e,t)=>e>t,"in:>":(e,t)=>e.every((e=>e>t)),">:>=":(e,t)=>e>=t,">=:>=":(e,t)=>e>=t,"in:>=":(e,t)=>e.every((e=>e>=t)),"<:<":(e,t)=>e<=t,"<=:<":(e,t)=>e<t,"in:<":(e,t)=>e.every((e=>e<t)),"<:<=":(e,t)=>e<=t,"<=:<=":(e,t)=>e<=t,"in:<=":(e,t)=>e.every((e=>e<=t))};class C{constructor(e){this.query=e,this.query=e,this.parsedConditions=this.parseConditions(this.query.conditions)}get integrationId(){return this.query.integrationId}get collectionName(){return this.query.collectionName}get limit(){return this.query.limit}sortedBy(e){const t=e.find(((e,t)=>{var r;return!(0,l.isEqual)(this.query.sortOrder[t],Object.assign(Object.assign({},e),{asc:null===(r=e.asc)||void 0===r||r}))}));return!t}sortedByExact(e){return e.length===this.query.sortOrder.length&&this.sortedBy(e)}includes(e,t,r){return this.includesCondition({fieldName:e,operator:t,value:r})}includesCondition(e){const t=this.parsedConditions.filter((t=>t.fieldName===e.fieldName));return!!t.length&&!!t.find((t=>this.evaluateIncludes(t,e)))}includesConditions(e){return this.parseConditions(e).every((e=>this.includesCondition(e)))}matchesConditions(e){const t=this.parseConditions(e);return this.parsedConditions.length===t.length&&t.every((e=>this.includesCondition(e)))}matchesQuery(e){if(e.collectionName!==this.collectionName||e.integrationId!==this.integrationId)return!1;const t=this.matchesConditions(e.conditions),r=this.sortedByExact(e.sortOrder),n=this.limit===e.limit;return t&&r&&n}isSubsetOf(e,t,r){return this.isSubsetOfCondition({fieldName:e,operator:t,value:r})}isSubsetOfCondition(e){return!!this.parsedConditions.filter((t=>t.fieldName===e.fieldName)).find((t=>this.evaluateSubset(t,e)))}isSubsetOfConditions(e){return this.parseConditions(e).every((e=>this.isSubsetOfCondition(e)))}isSubsetOfQuery(e){if(e.collectionName!==this.collectionName||e.integrationId!==this.integrationId)return!1;const t=this.isSubsetOfConditions(e.conditions),r=this.sortedBy(e.sortOrder),n=-1===e.limit||this.limit>-1&&this.limit<e.limit;return t&&r&&n}getConditionsFor(...e){return this.parsedConditions.filter((t=>e.includes(t.fieldName)))}getConditionsForField(e){return this.parsedConditions.filter((t=>t.fieldName===e))}documentMatchesQuery(e){for(const t of this.parsedConditions){const r=t.fieldName,n=t.operator,i=l.get(e,r);if("in"===n){if(t.value.includes(i))continue;return!1}if("not in"!==n){if(!R(t.value,i,n))return!1}else if(t.value.includes(i))return!1}return!0}evaluateSubset(e,t){const{operator:r,value:n}=e,{operator:i,value:o}=this.parseConditions([t])[0],s=$[`${r}:${i}`];return!!s&&s(n,o)}evaluateIncludes(e,t){const{operator:r,value:n}=e,{operator:i,value:o}=this.parseConditions([t])[0],s=Array.isArray(n)?n.sort():n,a=Array.isArray(o)?o.sort():o;return i===r&&(0,l.isEqual)(a,s)}parseConditions(e){const t=[],r=new Map,n=new Map;return e.forEach((e=>{switch(e.operator){case"==":case"in":r.set(e.fieldName,(r.get(e.fieldName)||[]).concat(e.value));break;case"!=":case"not in":n.set(e.fieldName,(n.get(e.fieldName)||[]).concat(e.value));break;default:t.push(e)}})),r.forEach(((e,r)=>{t.push({fieldName:r,operator:"in",value:e})})),n.forEach(((e,r)=>{t.push({fieldName:r,operator:"not in",value:e})})),t}}class j{eq(e,t){return this.where(e,"==",t)}neq(e,t){return this.where(e,"!=",t)}in(e,t){return this.where(e,"in",t)}nin(e,t){return this.where(e,"not in",t)}gt(e,t){return this.where(e,">",t)}gte(e,t){return this.where(e,">=",t)}lt(e,t){return this.where(e,"<",t)}lte(e,t){return this.where(e,"<=",t)}like(e,t,r){return this.where(e,r?"like_cs":"like",t)}notLike(e,t,r){return this.where(e,r?"not like_cs":"not like",t)}}class M extends j{constructor(e,t){super(),this.collectionName=e,this.integrationId=t,this.query={integrationId:t,collectionName:e,conditions:[],limit:-1,sortOrder:[]}}where(e,t,r){if("in"===t||"not in"===t){const n=r instanceof Array?[...r]:[r];for(const r of n)this.query.conditions.push({fieldName:e,operator:"in"===t?"==":"!=",value:r});return this}return this.query.conditions.push({fieldName:e,operator:t,value:r}),this}limit(e){return function(e){m(p(e,"number"),"Limit needs to be a number"),-1!==e&&(m(e>0,"query limit has to be greater than 0"),m(Math.floor(e)===e,"query limit has to be an integer"),m(e<=2e4,"Limit can be maximum 20000"))}(e),m(-1===this.query.limit,"The limit was already set."),this.query.limit=e,this}sortBy(e,t=!0){const r={asc:t,fieldName:e};return d(r),m(!this.query.sortOrder.some((t=>t.fieldName===e)),`${e} already in the sort list.`),this.query.sortOrder.push(r),this}build(){const e=this.mergeConditions();return Object.assign(Object.assign({},this.query),{conditions:e})}mergeConditions(){const e=[],t=l.groupBy(this.query.conditions||[],(e=>e.fieldName));for(const r of Object.values(t)){const t=l.groupBy(r,(e=>e.operator));for(const[r,n]of Object.entries(t)){if("=="===r||"!="===r){e.push(...n);continue}const t=l.sortBy(n,(e=>e.value));">"===r||">="===r?e.push(t[t.length-1]):e.push(t[0])}}return e}}function F(e,t){return`${function(e){const[t,r,n,i]=e.split(/[_-]/);return m(!i,"Invalid appId: "+e),{appId:t,environmentId:null!=r?r:"prod",squidDeveloperId:n}}(e).appId}${t&&"prod"!==t?`-${t}`:""}`}function q(e){return I(e)}function V(...e){const[t,r,n]=e,i="object"==typeof t?t:{docId:t,collectionName:r,integrationId:n};return i.integrationId||(i.integrationId=void 0),S(i)}var L;o(2091),function(e){e.TRACE="trace",e.DEBUG="debug",e.INFO="info",e.WARN="warn",e.ERROR="error"}(L||(L={}));const U=(Q={BehaviorSubject:()=>e.BehaviorSubject,NEVER:()=>e.NEVER,Observable:()=>e.Observable,ReplaySubject:()=>e.ReplaySubject,Subject:()=>e.Subject,combineLatest:()=>e.combineLatest,combineLatestWith:()=>e.combineLatestWith,debounceTime:()=>e.debounceTime,defer:()=>e.defer,delay:()=>e.delay,distinctUntilChanged:()=>e.distinctUntilChanged,filter:()=>e.filter,finalize:()=>e.finalize,firstValueFrom:()=>e.firstValueFrom,from:()=>e.from,groupBy:()=>e.groupBy,lastValueFrom:()=>e.lastValueFrom,map:()=>e.map,mergeMap:()=>e.mergeMap,of:()=>e.of,pairwise:()=>e.pairwise,race:()=>e.race,reduce:()=>e.reduce,share:()=>e.share,skip:()=>e.skip,startWith:()=>e.startWith,switchMap:()=>e.switchMap,take:()=>e.take,takeUntil:()=>e.takeUntil,takeWhile:()=>e.takeWhile,tap:()=>e.tap,timer:()=>e.timer,toArray:()=>e.toArray},B={},o.d(B,Q),B);var Q,B;function z(e,t){switch(t.type){case"applyNumericFn":return function(e,t){if("increment"===t.fn)return null==e?t.value:e+t.value;throw new Error("Unknown numeric function: "+JSON.stringify(t))}(e,t);case"applyStringFn":return function(e,t){switch(t.fn){case"trim":return"string"!=typeof e?e:e.trim();case"extendString":return null==e?t.value:e+t.value;default:throw new Error("Unknown string function: "+JSON.stringify(t))}}(e,t);case"update":return"object"==typeof t.value?l.cloneDeep(t.value):t.value;case"removeProperty":return;default:throw new Error("Unknown property mutation type: "+JSON.stringify(t))}}function Y(e){return Object.entries(e.properties).sort((([e],[t])=>e.split(".").length-t.split(".").length))}function K(e){let t=[];return(0,U.from)(e).pipe((0,U.groupBy)((e=>`${e.squidDocIdObj.integrationId}${e.squidDocIdObj.collectionName}/${e.squidDocIdObj.docId}`)),(0,U.mergeMap)((e=>e.pipe((0,U.reduce)(((e,t)=>function(e,t){if("insert"===t.type)return t;if("delete"===t.type)return t;if("delete"===e.type)throw new Error("Cannot delete and then update");if(m("update"===t.type,"Invalid mutation type"),"update"===e.type)return function(e,t){const r=l.cloneDeep(e);t=l.cloneDeep(t);for(const[e]of Y(r)){const n=e.split(".").length;Object.entries(t.properties).some((([t])=>e.startsWith(t+".")&&n>t.split(".").length))&&delete r.properties[e]}for(const[e,n]of Y(t))r.properties[e]=[...r.properties[e]||[],...n];return r}(e,t);const r=l.cloneDeep(e);for(const[e,n]of Y(t)){const t=n;for(const n of t){const t=z(v(r.properties,e),n);void 0===t?b(r.properties,e):_(r.properties,e,t)}}return r}(e,t)))))),(0,U.toArray)()).subscribe((e=>{t=e})),t}var H=o(6236),G=o.n(H),W=o(8414),J=o.n(W);const Z=new(G())({allErrors:!0,allowUnionTypes:!1,useDefaults:!1});function X(e,t,r=((e,t)=>e>t?1:e<t?-1:0),n=0,i=e.length-1){if(i<n)return-1;const o=Math.trunc((n+i)/2);return 0===r(t,e[o])?o:r(t,e[o])>0?X(e,t,r,o+1,i):X(e,t,r,n,o-1)}function ee(e,t,r=((e,t)=>e>t?1:e<t?-1:0)){let n;for(n=e.length-1;n>=0&&r(e[n],t)>0;n--)e[n+1]=e[n];e[n+1]=t}function te(e,t,r=((e,t)=>e>t?1:e<t?-1:0)){const n=X(e,t,r);n>-1&&e.splice(n,1)}J()(Z),Z.addKeyword({keyword:"isDate",type:"object",validate:(e,t)=>e===t instanceof Date}),Z.addKeyword({keyword:"isJSON",type:"object",validate:(e,t)=>{try{const e=JSON.stringify(t);return JSON.parse(e),!0}catch(e){return!1}}}),Z.addKeyword({keyword:"isComputed",validate:(e,t)=>!e||null!==t}),Z.addKeyword({keyword:"isDefaultComputed",validate:(e,t)=>!e||null!==t}),Z.addKeyword({keyword:"primaryKey",validate:(e,t)=>!e||null!==t}),Z.addKeyword({keyword:"insertable",validate:(e,t)=>!e||null!==t}),Z.addKeyword({keyword:"deletable",validate:(e,t)=>!e||null!==t}),Z.addKeyword({keyword:"applyDefaultValueOn",validate:(e,t)=>!e||["always","empty","updateOrEmpty"].includes(e)}),Z.addKeyword({keyword:"dataType",validate:(e,t)=>!0});class re extends Error{constructor(e,t){super(e),this.details=t}}function ne(e){return/^local/.test(e)}function ie(){let e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){const r=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?r:3&r|8).toString(16)}))}class oe{constructor(){this.locks={}}async lock(...e){if(this.canGetLock(...e))return void this.lockSync(...e);const t=Object.entries(this.locks).filter((([t])=>e.includes(t))).map((([e,t])=>t));await(0,U.lastValueFrom)((0,U.combineLatest)(t).pipe((0,U.filter)((e=>!e.includes(!0))),(0,U.take)(1))),await this.lock(...e)}release(...e){for(const t of e){const e=y(this.locks[t]);e.next(!1),e.complete(),delete this.locks[t]}}canGetLock(...e){return!e.some((e=>{var t;return null===(t=this.locks[e])||void 0===t?void 0:t.value}))}lockSync(...e){m(this.canGetLock(...e),"Cannot acquire lock sync");for(const t of e)this.locks[t]=new U.BehaviorSubject(!0)}}class se{constructor(e,t,r,n,i){this.collectionName=e,this.integrationId=t,this.documentReferenceFactory=r,this.queryBuilderFactory=n,this.joinQueryBuilderFactory=i,this.documents=new Map,this.refId=ie()}doc(e){if(e&&"string"!=typeof e&&"object"!=typeof e&&!Array.isArray(e))throw new Error("Invalid doc id. Can be only object or string.");if(this.integrationId!==i.built_in_db)if(e){if("object"!=typeof e)throw new Error("Invalid doc id. String doc ids are only supported for the built_in_db integration. For all other integrations, the doc id must be an object.")}else e={__squidId:ie()};else e=e&&"string"!=typeof e?{__id:S(e)}:{__id:e||ie()};const t=S(e),r=V(t,this.collectionName,this.integrationId);let n=this.documents.get(t);return n||(n=this.documentReferenceFactory.create(r,this.queryBuilderFactory),this.documents.set(t,n),n)}query(){return this.queryBuilderFactory.get(this.collectionName,this.integrationId)}joinQuery(e){return this.joinQueryBuilderFactory.getForJoin(this.collectionName,this.integrationId,null!=e?e:this.collectionName)}or(...e){return new ae(...e)}migrateDocIds(e){for(const[t,r]of this.documents)r.migrateDocIds(e);Object.entries(e).forEach((([e,t])=>{const r=q(e),n=q(t);w(this.documents,r.docId,n.docId)}))}}class ae{constructor(...e){if(0===e.length)throw new Error("At least one query builder must be provided");this.builders=e}changes(){throw new Error("Changes are not supported for merged queries")}snapshot(){return(0,U.firstValueFrom)(this.snapshots(!1))}snapshots(e){const t=this.builders.map((t=>t.snapshots(e)));return this.or(this.builders[0].getSortOrder(),...t)}or(e,...t){return(0,U.combineLatest)([...t]).pipe((0,U.map)((t=>{const r=new Set,n=t.flat(),i=[];for(const e of n)r.has(e.data)||(r.add(e.data),i.push(e));return i.sort(((t,r)=>{for(const{fieldName:n,asc:i}of e){const e=t.data[n],o=r.data[n];if(e<o)return i?-1:1;if(e>o)return i?1:-1}return 0}))})))}getSortOrder(){throw new Error("getSortOrder is not supported for merged queries")}}class ce{constructor(e,t,r){this._squidDocId=e,this.dataManager=t,this.queryBuilderFactory=r,this.refId=ie()}get squidDocId(){return this._squidDocId}get data(){return y(this.dataManager.getProperties(this.squidDocId),(()=>{const{collectionName:e,integrationId:t,docId:r}=q(this.squidDocId);return`No data found for document reference: ${JSON.stringify({docId:r,collectionName:e,integrationId:t},null,2)}`})())}get hasData(){return!!this.dataManager.getProperties(this.squidDocId)}async snapshot(){if(this.isTracked()&&this.dataManager.getProperties(this.squidDocId))return this;const e=await this.queryBuilderFactory.getForDocument(this.squidDocId).snapshot();return y(e.length<=1,"Got more than one doc for the same id:"+this.squidDocId),e.length?this:void 0}snapshots(){return this.queryBuilderFactory.getForDocument(this.squidDocId).snapshots().pipe((0,U.map)((e=>(y(e.length<=1,"Got more than one doc for the same id:"+this.squidDocId),e.length?this:void 0))))}isDirty(){return this.dataManager.isDirty(this.squidDocId)}isTracked(){return this.dataManager.isTracked(this.squidDocId)}async update(e,t){const r={};Object.entries(e).forEach((([e,t])=>{const n=void 0!==t?{type:"update",value:t}:{type:"removeProperty"};r[e]=[n]}));const n={type:"update",squidDocIdObj:q(this.squidDocId),properties:r};return this.dataManager.applyOutgoingMutation(n,t)}async setInPath(e,t,r){return this.update({[e]:l.cloneDeep(t)},r)}async deleteInPath(e,t){return this.update({[e]:void 0},t)}incrementInPath(e,t,r){const n={type:"applyNumericFn",fn:"increment",value:t},i={type:"update",squidDocIdObj:q(this.squidDocId),properties:{[e]:[n]}};return this.dataManager.applyOutgoingMutation(i,r)}decrementInPath(e,t,r){return this.incrementInPath(e,-t,r)}async insert(e,t){const r=q(this.squidDocId);let n=I(r.docId);n.__squidId&&(n={});const i={type:"insert",squidDocIdObj:r,properties:Object.assign(Object.assign(Object.assign({},e),{__docId__:r.docId}),n)};return this.dataManager.applyOutgoingMutation(i,t)}async delete(e){const t={type:"delete",squidDocIdObj:q(this.squidDocId)};return this.dataManager.applyOutgoingMutation(t,e)}migrateDocIds(e){const t=e[this.squidDocId];t&&(this._squidDocId=t)}}function ue(e){return"function"==typeof e}function le(e){return function(t){if(function(e){return ue(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}var fe=function(e,t){return fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},fe(e,t)};function he(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}fe(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var de=function(){return de=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},de.apply(this,arguments)};function pe(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function me(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))}function ye(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function ve(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ge(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function _e(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}Object.create,Object.create;var be,we=((be=function(e){var t;t=this,Error.call(t),t.stack=(new Error).stack,this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}).prototype=Object.create(Error.prototype),be.prototype.constructor=be,be);function Ee(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Se=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,r,n,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=ve(o),a=s.next();!a.done;a=s.next())a.value.remove(this)}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}else o.remove(this);var c=this.initialTeardown;if(ue(c))try{c()}catch(e){i=e instanceof we?e.errors:[e]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var l=ve(u),f=l.next();!f.done;f=l.next()){var h=f.value;try{Oe(h)}catch(e){i=null!=i?i:[],e instanceof we?i=_e(_e([],ge(i)),ge(e.errors)):i.push(e)}}}catch(e){r={error:e}}finally{try{f&&!f.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}}if(i)throw new we(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)Oe(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Ee(t,e)},e.prototype.remove=function(t){var r=this._finalizers;r&&Ee(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}();function Oe(e){ue(e)?e():e.unsubscribe()}Se.EMPTY;var Ie=null,Te=null,ke=!1,Ne=!1,De={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=De.delegate;return(null==i?void 0:i.setTimeout)?i.setTimeout.apply(i,_e([e,t],ge(r))):setTimeout.apply(void 0,_e([e,t],ge(r)))},clearTimeout:function(e){var t=De.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function Ae(){}var Re=xe("C",void 0,void 0);function xe(e,t,r){return{kind:e,value:t,error:r}}var Pe=function(e){function t(t){var r,n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,((r=t)instanceof Se||r&&"closed"in r&&ue(r.remove)&&ue(r.add)&&ue(r.unsubscribe))&&t.add(n)):n.destination=Ve,n}return he(t,e),t.create=function(e,t,r){return new Me(e,t,r)},t.prototype.next=function(e){this.isStopped?qe(function(e){return xe("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?qe(xe("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?qe(Re,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Se),$e=Function.prototype.bind;function Ce(e,t){return $e.call(e,t)}var je=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){Fe(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){Fe(e)}else Fe(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){Fe(e)}},e}(),Me=function(e){function t(t,r,n){var i,o,s=e.call(this)||this;return ue(t)||!t?i={next:null!=t?t:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}:s&&Ne?((o=Object.create(t)).unsubscribe=function(){return s.unsubscribe()},i={next:t.next&&Ce(t.next,o),error:t.error&&Ce(t.error,o),complete:t.complete&&Ce(t.complete,o)}):i=t,s.destination=new je(i),s}return he(t,e),t}(Pe);function Fe(e){ke||function(e){De.setTimeout((function(){if(!Ie)throw e;Ie(e)}))}(e)}function qe(e,t){var r=Te;r&&De.setTimeout((function(){return r(e,t)}))}var Ve={closed:!0,next:Ae,error:function(e){throw e},complete:Ae};function Le(e,t,r,n,i){return new Ue(e,t,r,n,i)}var Ue=function(e){function t(t,r,n,i,o,s){var a=e.call(this,t)||this;return a.onFinalize=o,a.shouldUnsubscribe=s,a._next=r?function(e){try{r(e)}catch(e){t.error(e)}}:e.prototype._next,a._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=n?function(){try{n()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,a}return he(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(Pe);function Qe(e,t){return le((function(r,n){var i=0;r.subscribe(Le(n,(function(r){n.next(e.call(t,r,i++))})))}))}class Be{constructor(e,t,r){this.querySubscriptionManager=e,this.documentReferenceFactory=t,this.queryBuilderFactory=r}getForJoin(e,t,r){return new ze(e,t,this.querySubscriptionManager,this.documentReferenceFactory,r,this,this.queryBuilderFactory)}}class ze extends j{constructor(e,t,r,n,i,o,s){super(),this.collectionName=e,this.integrationId=t,this.querySubscriptionManager=r,this.documentReferenceFactory=n,this.alias=i,this.joinQueryBuilderFactory=o,this.queryBuilderFactory=s,this.joins={},this.joinConditions={},this.simpleQueryBuilder=new M(e,t)}where(e,t,r){return this.simpleQueryBuilder.where(e,t,r),this}limit(e){return this.simpleQueryBuilder.limit(e),this}sortBy(e,t=!0){return this.simpleQueryBuilder.sortBy(e,t),this}join(e,t,r){const n={leftFieldName:t,rightFieldName:r,leftAlias:this.alias};this.joins[e.alias]=e.build(),Object.entries(e.joins).forEach((([e,t])=>{this.joins[e]=t}));for(const[t,r]of Object.entries(e.joinConditions))this.joinConditions[t]=r;return this.joinConditions[e.alias]=n,this}snapshot(){return(0,U.firstValueFrom)(this.snapshots(!1))}snapshots(e=!0){return this.querySubscriptionManager.processQuery(this.build(),this.alias,l.cloneDeep(this.joins),l.cloneDeep(this.joinConditions),e,!1).pipe(Qe((e=>e.map((e=>{const t={};for(const[r,n]of Object.entries(e)){const e=r===this.alias?this.collectionName:this.joins[r].collectionName,i=r===this.alias?this.integrationId:this.joins[r].integrationId,o=n?V(n.__docId__,e,i):void 0;t[r]=o?this.documentReferenceFactory.create(o,this.queryBuilderFactory):void 0}return t})))))}build(){return this.simpleQueryBuilder.build()}}class Ye{constructor(e,t,r){this.querySubscriptionManager=e,this.documentReferenceFactory=t,this.documentIdentityService=r}getForDocument(e){const{collectionName:t,integrationId:r,docId:n}=q(e),i=I(n),o=this.get(t,r);return Object.entries(i).forEach((([e,t])=>{o.where(e,"==",t)})),o}get(e,t){return new Ke(e,t,this.querySubscriptionManager,this.documentReferenceFactory,this,this.documentIdentityService)}}class Ke extends M{constructor(e,t,r,n,i,o){super(e,t),this.querySubscriptionManager=r,this.documentReferenceFactory=n,this.queryBuilderFactory=i,this.documentIdentityService=o,this.forceFetchFromServer=!1}getSortOrder(){return this.query.sortOrder}snapshot(){return(0,U.firstValueFrom)(this.snapshots(!1))}setForceFetchFromServer(){return this.forceFetchFromServer=!0,this}snapshots(e=!0){return this.querySubscriptionManager.processQuery(this.build(),this.collectionName,{},{},e,this.forceFetchFromServer).pipe(Qe((e=>e.map((e=>{m(1===Object.keys(e).length);const t=V(y(e[this.collectionName]).__docId__,this.collectionName,this.integrationId);return this.documentReferenceFactory.create(t,this.queryBuilderFactory)})))))}changes(){let e,t=new Set;return this.snapshots().pipe((0,U.combineLatestWith)(this.documentIdentityService.observeChanges().pipe((0,U.switchMap)((t=>(Object.entries(t).forEach((([t,r])=>{!function(e,t,r){const n=e[t];void 0!==n&&(e[r]=n,delete e[t])}(e||{},t,r)})),U.NEVER))),(0,U.startWith)({}))),Qe((([r])=>{let n=[];const i=[],o=[];if(e){for(const o of r){const r=o.squidDocId,s=o.data;if(t.has(s))delete e[r],t.delete(s);else if(e[r]){i.push(o);const n=e[r];delete e[r],t.delete(n)}else n.push(o)}for(const e of t)o.push(e)}else n=r;e={},t=new Set;for(const n of r){const r=n.data;e[n.squidDocId]=r,t.add(r)}return new He(n,i,o)})))}get hash(){return T(this.build())}}class He{constructor(e,t,r){this.inserts=e,this.updates=t,this.deletes=r}}class Ge{constructor(e,t,r){this.rpcManager=e,this.socketManager=t,this.integrationId=r,this.ongoingChatRequests={},this.socketManager.observeNotifications().pipe((0,U.filter)((e=>"aiAssistant"===e.type)),Qe((e=>e))).subscribe((e=>{this.handleChatResponse(e)}))}profile(e){return new We(this,this.integrationId,e)}async mutate(e){await this.rpcManager.post("ai/assistant/mutate",e)}chat(e,t){const r=ie(),n=new U.BehaviorSubject("");this.ongoingChatRequests[r]=n;const i={profileId:e,prompt:t,integrationId:this.integrationId,clientRequestId:r};return this.rpcManager.post("ai/assistant/chat",i).catch((e=>{n.error(e),n.complete()})),n.pipe((0,U.finalize)((()=>{delete this.ongoingChatRequests[r]})),(0,U.share)())}handleChatResponse(e){const t=this.ongoingChatRequests[e.clientRequestId];t&&(e.payload.complete?t.complete():t.next(t.value+e.payload.token))}}class We{constructor(e,t,r){this.client=e,this.integrationId=t,this.profileId=r}chat(e){return this.client.chat(this.profileId,e)}context(e){return new Je(this.client,this.integrationId,this.profileId,e)}instruction(e){return new Ze(this.client,this.integrationId,this.profileId,e)}insert(e){const{modelName:t}=e,r={type:"insert",resource:"profile",profileId:this.profileId,payload:{modelName:t,strictContext:!1},integrationId:this.integrationId};return this.client.mutate(r)}update(e){const{modelName:t}=e,r={type:"update",resource:"profile",profileId:this.profileId,payload:{modelName:t,strictContext:!1},integrationId:this.integrationId};return this.client.mutate(r)}delete(){const e={type:"delete",resource:"profile",profileId:this.profileId,integrationId:this.integrationId,payload:{}};return this.client.mutate(e)}}class Je{constructor(e,t,r,n){this.client=e,this.integrationId=t,this.profileId=r,this.id=n||ie()}insert(e){const{title:t,context:r}=e,n={type:"insert",resource:"context",profileId:this.profileId,integrationId:this.integrationId,payload:{id:this.id,title:t,context:r}};return this.client.mutate(n)}update(e){const{title:t,context:r}=e,n={type:"update",resource:"context",profileId:this.profileId,integrationId:this.integrationId,payload:{id:this.id,title:t,context:r}};return this.client.mutate(n)}delete(){const e={type:"delete",resource:"context",profileId:this.profileId,integrationId:this.integrationId,payload:{id:this.id}};return this.client.mutate(e)}}class Ze{constructor(e,t,r,n){this.client=e,this.integrationId=t,this.profileId=r,this.id=n||ie()}insert(e){const{instruction:t}=e,r={type:"insert",resource:"instruction",profileId:this.profileId,integrationId:this.integrationId,payload:{id:this.id,instruction:t}};return this.client.mutate(r)}update(e){const{instruction:t}=e,r={type:"update",resource:"instruction",profileId:this.profileId,integrationId:this.integrationId,payload:{id:this.id,instruction:t}};return this.client.mutate(r)}delete(){const e={type:"delete",resource:"instruction",profileId:this.profileId,integrationId:this.integrationId,payload:{id:this.id}};return this.client.mutate(e)}}class Xe{constructor(e,t){this.rpcManager=e,this.socketManager=t,this.assistantsMap=new Map}getAssistant(e){let t=this.assistantsMap.get(e);return t||(t=new Ge(this.rpcManager,this.socketManager,e),this.assistantsMap.set(e,t),t)}}class et{constructor(e,t,r,n={}){this.clientIdService=e,this.rpcManager=t,this.socketManager=r,this.apiServerUrlOverrideMapping=n,this.ongoingApiExecutions={},r.observeNotifications().pipe((0,U.filter)((e=>"api"===e.type)),Qe((e=>e))).subscribe((e=>{this.handleApiResponse(e.clientRequestId,e).then()}))}callApiAndSubscribe(e,t,r){const n=ie(),i=new U.Subject;this.ongoingApiExecutions[n]=i;const o={integrationId:e,endpointId:t,request:r,clientRequestId:n,serverUrlOverride:this.apiServerUrlOverrideMapping[e]};return this.rpcManager.post("api/call",o).catch((n=>{console.error("Got error while calling API",e,t,r,n),i.error(n),i.complete()})),(0,U.race)(i.pipe((0,U.finalize)((()=>{delete this.ongoingApiExecutions[n]})),(0,U.share)()),this.clientIdService.observeClientTooOld().pipe(Qe((()=>{throw new Error("CLIENT_NOT_CONNECTED")}))))}async handleApiResponse(e,t){const r=this.ongoingApiExecutions[e];r&&(t.success?r.next(I(t.payload)):r.error((0,l.pick)(t,"httpStatus","payload")),r.complete())}}class tt{constructor(e,t){this.destructManager=e,this.apiKey=t,this.authIdTokenSet=new U.BehaviorSubject(!1),this.authIdTokenObservableSubject=new U.Subject,this.shouldWaitForAuth=!1,this.observeAuthIdToken().subscribe((e=>{this.idToken=e.token,this.integrationId=e.integrationId,this.authIdTokenSet.next(!0)}))}setAuthIdToken(e,t){this.shouldWaitForAuth=!0,this.authIdTokenSet.next(!1);const r=e&&"string"!=typeof e?(0,U.from)(e).pipe((0,U.map)((e=>({token:e,integrationId:t})))):(0,U.of)({token:e,integrationId:t});this.authIdTokenObservableSubject.next(r)}observeAuthIdToken(){return this.authIdTokenObservableSubject.pipe((0,U.switchMap)((e=>e)),(0,U.takeUntil)(this.destructManager.observeIsDestructing()))}async waitForReadyState(){this.shouldWaitForAuth&&!this.destructManager.isDestructing&&await(0,U.firstValueFrom)((0,U.race)(this.authIdTokenSet.asObservable().pipe((0,U.filter)(Boolean)),this.destructManager.observeIsDestructing()))}getApiKey(){return this.apiKey}getAuthToken(){return this.apiKey?{type:"ApiKey",token:this.apiKey}:this.idToken?{type:"Bearer",token:this.idToken,integrationId:this.integrationId}:void 0}}class rt{constructor(e,t,r){this.clientIdService=e,this.rpcManager=t,this.socketManager=r,this.ongoingFunctionExecutions={},r.observeNotifications().pipe((0,U.filter)((e=>"backendFunction"===e.type)),Qe((e=>e))).subscribe((e=>{this.handleFunctionResponse(e.clientRequestId,e.payload)}))}executeFunctionAndSubscribe(e,...t){const r=ie(),n=new U.Subject;this.ongoingFunctionExecutions[r]=n;const i={functionName:e,paramsArrayStr:O(t),clientRequestId:r};return this.rpcManager.post("backend-function/execute",i).catch((t=>{console.error("Got error while executing function",e,t),n.error(t),n.complete()})),(0,U.race)(n.pipe((0,U.finalize)((()=>{delete this.ongoingFunctionExecutions[r]})),(0,U.share)()),this.clientIdService.observeClientTooOld().pipe(Qe((()=>{throw new Error("CLIENT_NOT_CONNECTED")}))))}handleFunctionResponse(e,t){const r=this.ongoingFunctionExecutions[e];if(!r)return;const n=I(t);n.success?r.next(n.response):(r.error(new Error(n.response)),r.complete())}}class nt{constructor(e){this.destructManager=e,this.clientTooOldSubject=new U.BehaviorSubject(!1),this.clientIdSubject=new U.BehaviorSubject(ie()),this.destructManager.onDestruct((()=>{this.clientTooOldSubject.complete(),this.clientIdSubject.complete()}))}observeClientId(){return this.clientIdSubject}observeClientTooOld(){return this.clientTooOldSubject.pipe((0,U.filter)((e=>e)),(0,U.map)((e=>{})))}notifyClientTooOld(){this.clientTooOldSubject.next(!0),this.clientIdSubject.next(ie())}notifyClientReadyToBeRegenerated(){this.clientTooOldSubject.next(!1)}observeClientReadyToBeRegenerated(){return this.clientTooOldSubject.pipe((0,U.skip)(1),(0,U.filter)((e=>!e)),(0,U.map)((e=>{})))}getClientId(){return this.clientIdSubject.value}isClientTooOld(){return this.clientTooOldSubject.value}}class it{constructor(e,t,r,n){this.documentReferenceFactory=e,this.queryBuilderFactory=t,this.joinQueryBuilderFactory=r,this.documentIdentityService=n,this.collections=new Map,this.documentIdentityService.observeChanges().subscribe(this.migrateDocIds.bind(this))}get(e,t){let r=this.collections.get(t);r||(r=new Map,this.collections.set(t,r));let n=r.get(e);return n||(n=new se(e,t,this.documentReferenceFactory,this.queryBuilderFactory,this.joinQueryBuilderFactory),r.set(e,n),n)}migrateDocIds(e){this.collections.forEach((t=>{for(const[r,n]of t)n.migrateDocIds(e)}))}}var ot=o(3910);const st="dataManager_runInTransaction";class at{constructor(e,t,r,n,i,o,s,a){this.documentStore=e,this.mutationSender=t,this.socketManager=r,this.querySubscriptionManager=n,this.queryBuilderFactory=i,this.lockManager=o,this.destructManager=s,this.documentIdentityService=a,this.docIdToLocalTimestamp=new Map,this.batchClientRequestIds=new Set,this.docIdToServerTimestamp=new Map,this.pendingIncomingUpdates=new Map,this.pendingOutgoingMutations=new Map,this.pendingOutgoingMutationsChanged=new U.Subject,this.outgoingMutationsEmpty=new U.BehaviorSubject(!0),this.knownDirtyDocs=new Set,this.failedDocsToResync=[],this.refreshDocIdToTimestamp=new Map,this.handleIncomingMessagesForTests=!0,this.destructManager.onDestruct((()=>{this.destruct()})),this.documentIdentityService.observeChanges().subscribe(this.migrateDocIds.bind(this)),this.handleNotifications(),this.startDeleteExpiredTimestampsJob(),this.handleOrphanDocs(),this.outgoingMutationsEmpty.subscribe((e=>{this.querySubscriptionManager.safeToSendQueriesToServer.next(e)}))}getProperties(e){return this.documentStore.getDocumentOrUndefined(e)}isDirty(e){var t;if(this.knownDirtyDocs.has(e))return!0;if(null===(t=this.pendingOutgoingMutations.get(e))||void 0===t?void 0:t.length)return!0;const r=this.docIdToServerTimestamp.get(e),n=r&&!r.expireTimestamp?r.timestamp:void 0,i=this.docIdToLocalTimestamp.get(e);return!((!i||n)&&!this.isForgotten(e)&&!this.isLocalOnly(e)&&i===n)}async runInTransaction(e,t){return t?(m(t===this.currentTransactionId,"Transaction already ended."),e(t).then((e=>Promise.resolve()))):(this.lockManager.canGetLock(st)?this.lockManager.lockSync(st):await this.lockManager.lock(st),new Promise((async(t,r)=>{try{this.currentTransactionId=ie();try{return await e(this.currentTransactionId)}catch(e){console.error("error while executing callback function in transaction",e)}finally{this.finishTransaction({resolve:t,reject:r})}}catch(e){console.error("error while executing transaction",e)}finally{this.lockManager.release(st)}})))}async applyOutgoingMutation(e,t){var r;const n=V(e.squidDocIdObj);this.knownDirtyDocs.add(n),t||this.lockManager.canGetLock(st)||(await this.lockManager.lock(st),this.lockManager.release(st)),this.knownDirtyDocs.delete(n);const i=null===(r=this.pendingOutgoingMutations.get(n))||void 0===r?void 0:r.slice(-1)[0];if(i&&!i.sentToServer)i.mutation=K([i.mutation,e])[0],this.outgoingMutationsEmpty.next(!1);else{const t={mutation:this.removeInternalProperties(e),sentToServer:!1},r=this.pendingOutgoingMutations.get(n)||[];r.push(t),this.pendingOutgoingMutations.set(n,r),this.outgoingMutationsEmpty.next(!1),this.pendingOutgoingMutationsChanged.next()}return this.runInTransaction((async()=>{const t=this.documentStore.getDocumentOrUndefined(n),r="delete"===e.type?void 0:"update"===e.type?function(e,t){if(!e)return;const r=Object.assign({},e),n=Y(t);for(const[e,t]of n){const n=t;for(const t of n){const n=z(v(r,e),t);void 0===n?b(r,e):_(r,e,n)}}return r}(t,e):Object.assign({},e.properties);this.updateDocumentFromSnapshot(n,r)&&("insert"===e.type&&this.docIdToLocalTimestamp.set(n,(new Date).getTime()),this.querySubscriptionManager.setClientRequestIdsForLocalDoc(n,r).forEach((e=>this.batchClientRequestIds.add(e))))}),t)}async runInTransactionSync(e,t){if(t)return m(t===this.currentTransactionId,"Transaction already ended."),void e(t);await this.lockManager.lock(st);try{this.currentTransactionId=ie();try{return e(this.currentTransactionId)}catch(e){console.error("error while executing callback function in transaction",e)}finally{this.finishTransaction()}}catch(e){console.error("error while executing transaction",e)}finally{this.lockManager.release(st)}}removeInternalProperties(e){if("delete"===e.type)return e;const t=Object.assign(Object.assign({},e),{properties:Object.assign({},e.properties)});return delete t.properties.__docId__,delete t.properties.__ts__,t}handleNotifications(){this.socketManager.observeNotifications().pipe((0,U.filter)((e=>"mutations"===e.type)),Qe((e=>e))).subscribe((e=>{this.outgoingMutationsEmpty.pipe((0,U.filter)(Boolean),(0,U.take)(1)).subscribe((()=>{this.handleIncomingMutations(e.payload)}))})),this.socketManager.observeNotifications().pipe((0,U.filter)((e=>"query"===e.type)),Qe((e=>e))).subscribe((e=>{this.outgoingMutationsEmpty.pipe((0,U.filter)(Boolean),(0,U.take)(1)).subscribe((()=>{this.handleIncomingQuerySnapshots(e.payload)}))}))}handleIncomingMutations(e){if(!this.handleIncomingMessagesForTests)return;const t=e.reduce(((e,t)=>this.querySubscriptionManager.hasOngoingQuery(t.clientRequestId)?(e[t.squidDocId]={properties:t.doc,timestamp:t.mutationTimestamp},e):e),{});this.applyIncomingUpdates(t)}handleIncomingQuerySnapshots(e){if(!this.handleIncomingMessagesForTests)return;if(!this.querySubscriptionManager.hasOngoingQuery(e.clientRequestId))return;const t=this.querySubscriptionManager.getQuery(e.clientRequestId),r={};for(const n of e.docs){const e=V(n.__docId__,t.collectionName,t.integrationId);r[e]={properties:n,timestamp:n.__ts__}}this.querySubscriptionManager.setGotInitialResult(e.clientRequestId),this.runInTransactionSync((t=>{this.batchClientRequestIds.add(e.clientRequestId),this.applyIncomingUpdates(r,t)&&this.querySubscriptionManager.hasSubscription(e.clientRequestId)&&this.batchClientRequestIds.delete(e.clientRequestId)})).then()}applyIncomingUpdates(e,t){let r=!1;const n=new Set;for(const[t,i]of Object.entries(e))this.addPendingIncomingUpdate(t,i),this.pendingIncomingUpdates.get(t)||(r=!0),n.add(t);return this.runInTransactionSync((()=>{for(const e of n)this.maybeApplyIncomingUpdate(e)}),t).then(),r}addPendingIncomingUpdate(e,t){const r=this.pendingIncomingUpdates.get(e),n=this.docIdToServerTimestamp.get(e);r&&r.timestamp>t.timestamp||n&&n.timestamp>t.timestamp||this.pendingIncomingUpdates.set(e,t)}maybeApplyIncomingUpdate(e){const t=this.pendingIncomingUpdates.get(e);if(!t)return;const r=this.pendingOutgoingMutations.get(e);r&&r.length||(this.updateDocumentFromSnapshot(e,t.properties),this.acknowledgeDocument(e,t.timestamp,!t.properties),this.docIdToLocalTimestamp.set(e,t.timestamp),this.pendingIncomingUpdates.delete(e),this.querySubscriptionManager.setClientRequestIdsForLocalDoc(e,t.properties).forEach((e=>{this.batchClientRequestIds.add(e)})),t.properties&&(this.querySubscriptionManager.findQueriesForDocument(t.properties,e).length||this.forgetDocument(e)))}destruct(){this.stopDeleteExpiredTimestampsJob()}stopDeleteExpiredTimestampsJob(){void 0!==this.deleteExpiredTimestampsInterval&&(clearInterval(this.deleteExpiredTimestampsInterval),this.deleteExpiredTimestampsInterval=void 0)}startDeleteExpiredTimestampsJob(){this.deleteExpiredTimestampsInterval=setInterval((()=>{const e=[...this.docIdToServerTimestamp.entries()].filter((([e,t])=>!(!t.expireTimestamp||t.expireTimestamp>Date.now()||this.isTracked(e))));for(const[t]of e)this.docIdToServerTimestamp.delete(t),this.forgetDocument(t)}),1e4)}isTracked(e){if(this.pendingIncomingUpdates.get(e))return!0;const t=this.pendingOutgoingMutations.get(e);return!(!t||!t.length)||this.querySubscriptionManager.hasOngoingQueryForDocId(e)}isForgotten(e){return this.documentStore.hasData(e)&&!this.isTracked(e)}isLocalOnly(e){return!this.hasBeenAcknowledged(e)&&this.documentStore.hasData(e)}hasBeenAcknowledged(e){return this.docIdToServerTimestamp.has(e)}updateDocumentFromSnapshot(e,t){const r=this.documentStore.getDocumentOrUndefined(e);return!(!r&&!t||r===t)&&((!r||!t||S(Object.assign(Object.assign({},t),{__ts__:void 0}))!==S(r))&&(this.documentStore.saveDocument(e,t),!0))}finishTransaction(e){this.currentTransactionId=void 0;const t=[...this.batchClientRequestIds.values()];this.batchClientRequestIds.clear(),this.querySubscriptionManager.notifyAllSubscriptions(t),this.sendAllUnsentOutgoingMutations(e).then()}async sendAllUnsentOutgoingMutations(e){const t=this.groupOutgoingMutationsByIntegrationId();try{await ot.PromisePool.for(t).withConcurrency(t.length||1).handleError((e=>{throw e})).process((async([e,t])=>{await this.sendMutationsForIntegration([...t],e)})),this.pendingOutgoingMutations.size||this.outgoingMutationsEmpty.next(!0),await this.refreshUpdatedDocuments(),this.hasPendingSentMutations()?(await(0,U.firstValueFrom)(this.pendingOutgoingMutationsChanged.pipe((0,U.filter)((()=>!this.hasPendingSentMutations())))),null==e||e.resolve()):null==e||e.resolve()}catch(t){this.pendingOutgoingMutations.size||(this.outgoingMutationsEmpty.next(!0),await this.resyncFailedUpdates()),null==e||e.reject(t)}}async sendMutationsForIntegration(e,t){try{const{timestamp:r,idResolutionMap:n={},refreshList:i=[]}=await this.mutationSender.sendMutations(e.map((e=>e.mutation)),t);await this.documentIdentityService.migrate(n),i.forEach((e=>{this.refreshDocIdToTimestamp.set(n[e]||e,r)}));for(const t of e){let e=this.removeOutgoingMutation(t);n[e]&&(e=n[e]),this.acknowledgeDocument(e,r),this.isTracked(e)||(this.setExpiration(e,!0),this.forgetDocument(e))}}catch(t){for(const t of e){const e=this.removeOutgoingMutation(t);this.forgetDocument(e),(this.hasBeenAcknowledged(e)||"insert"===t.mutation.type)&&this.failedDocsToResync.push(e)}throw t}}removeOutgoingMutation(e){const t=V(e.mutation.squidDocIdObj),r=y(this.pendingOutgoingMutations.get(t));return r.splice(r.indexOf(e),1),r.length||this.pendingOutgoingMutations.delete(t),this.pendingOutgoingMutationsChanged.next(),t}async resyncFailedUpdates(){const e=[...this.failedDocsToResync];this.failedDocsToResync.splice(0);for(const t of e){this.setExpiration(t,!0);try{const e=await this.queryBuilderFactory.getForDocument(t).setForceFetchFromServer().snapshot();if(y(e.length<=1,"Got more than one doc for the same id:"+t),!e.length){this.forgetDocument(t);const e=this.querySubscriptionManager.setClientRequestIdsForLocalDoc(t,void 0);this.querySubscriptionManager.notifyAllSubscriptions(e)}}catch(e){this.querySubscriptionManager.errorOutAllQueries(t,e)}}}async refreshUpdatedDocuments(){var e;const t=[];for(const[r,n]of this.refreshDocIdToTimestamp.entries()){const i=null===(e=this.docIdToServerTimestamp.get(r))||void 0===e?void 0:e.timestamp;i&&i>n||t.push(r)}this.refreshDocIdToTimestamp.clear();for(const e of t)try{await this.queryBuilderFactory.getForDocument(e).snapshot()}catch(e){}}groupOutgoingMutationsByIntegrationId(){const e={};for(const[t,r]of[...this.pendingOutgoingMutations.entries()]){const t=r[r.length-1];if(t&&!t.sentToServer){const r=t.mutation.squidDocIdObj.integrationId;(e[r]||(e[r]=[])).push(t),t.sentToServer=!0}}return Object.entries(e)}handleOrphanDocs(){this.querySubscriptionManager.onOrphanDocuments.subscribe((e=>{for(const t of e)this.isTracked(t)||this.forgetDocument(t)}))}acknowledgeDocument(e,t,r=!1){this.docIdToServerTimestamp.set(e,{timestamp:t}),this.setExpiration(e,r)}setExpiration(e,t){const r=this.docIdToServerTimestamp.get(e);r&&(r.expireTimestamp=t?Date.now()+2e4:void 0)}forgetDocument(e){this.docIdToLocalTimestamp.delete(e),this.setExpiration(e,!0)}migrateDocIds(e){Object.entries(e).forEach((([e,t])=>{w(this.docIdToLocalTimestamp,e,t),w(this.docIdToServerTimestamp,e,t)}))}hasPendingSentMutations(){for(const e of this.pendingOutgoingMutations.values())for(const t of e)if(t.sentToServer)return!0;return!1}}class ct{constructor(){this.predestructors=[],this.destructors=[],this.isDestructedSubject=new U.BehaviorSubject(!1)}get isDestructing(){return this.isDestructedSubject.value}observeIsDestructing(){return this.isDestructedSubject.asObservable().pipe((0,U.filter)(Boolean),Qe((()=>{})))}onPreDestruct(e){this.predestructors.push(e)}onDestruct(e){this.destructors.push(e)}async destruct(){if(this.isDestructing)return;this.isDestructedSubject.next(!0);const e=this.predestructors.concat(this.destructors);let t=e.shift();for(;t;){try{await t()}catch(e){console.error("Error while destructing Squid",e)}t=e.shift()}}}class ut{constructor(e,t){this.socketManager=e,this.destructManager=t,this.ongoingLocks={},this.acquireLockMessagesFromServer=this.socketManager.observeNotifications().pipe((0,U.filter)((e=>"lockAcquired"===e.type))),this.releaseLockMessagesFromServer=this.socketManager.observeNotifications().pipe((0,U.filter)((e=>"lockReleased"===e.type))),this.lockWaitForConnectionThreshold=2e3,t.onPreDestruct((()=>{this.releaseAllLocks()})),this.socketManager.observeConnectionReady().subscribe((e=>{e||this.releaseAllLocks()})),this.releaseLockMessagesFromServer.subscribe((e=>{const t=this.ongoingLocks[e.payload.clientRequestId];void 0!==t&&t.release().then()}))}async lock(e,t){if(!await(0,U.firstValueFrom)((0,U.race)((0,U.timer)(this.lockWaitForConnectionThreshold).pipe(Qe((()=>!1))),this.socketManager.observeConnectionReady().pipe((0,U.filter)(Boolean)),this.destructManager.observeIsDestructing())))return Promise.reject("CLIENT_NOT_CONNECTED");const r=ie(),n={type:"acquireLock",payload:{mutex:e,exclusive:t,clientRequestId:r}};this.socketManager.sendMessage(n);const i=await(0,U.firstValueFrom)((0,U.race)((0,U.timer)(5e3).pipe((0,U.take)(1),Qe((()=>({payload:{error:"TIMEOUT_GETTING_LOCK",lockId:void 0}})))),this.acquireLockMessagesFromServer.pipe((0,U.filter)((e=>e.payload.clientRequestId===r)))));if(!i.payload.lockId)throw new Error(`Failed to acquire lock: ${i.payload.error}`);const o=i.payload.lockId,s=new lt(o,r,this.ongoingLocks,this.socketManager);return this.ongoingLocks[o]=s,s}releaseAllLocks(){for(const[e,t]of Object.entries(this.ongoingLocks))t.release().then(),delete this.ongoingLocks[e]}}class lt{constructor(e,t,r,n){this.lockId=e,this.clientRequestId=t,this.ongoingLocks=r,this.socketManager=n,this.released=!1,this.onReleaseSubject=new U.Subject}async release(){if(this.released)return;this.released=!0,delete this.ongoingLocks[this.lockId];const e={type:"releaseLock",payload:{lockId:this.lockId,clientRequestId:this.clientRequestId}};this.socketManager.sendMessage(e),this.onReleaseSubject.next()}observeRelease(){return this.onReleaseSubject.asObservable()}isReleased(){return this.released}}class ft{constructor(e,t){this.documentStore=e,this.destructManager=t,this.changeNotifier=new U.BehaviorSubject({}),this.destructManager.onDestruct((()=>{this.changeNotifier.complete()}))}migrate(e){Object.entries(e).forEach((([e,t])=>{this.documentStore.migrateDocId(e,t)})),this.changeNotifier.next(e)}observeChanges(){return this.changeNotifier.asObservable()}}class ht{create(e,t){return new ce(e,y(this.dataManager,"dataManager not found"),t)}setDataManager(e){this.dataManager=e}}class dt{constructor(){this.squidDocIdToDoc=new Map}saveDocument(e,t){const r=this.squidDocIdToDoc.get(e);if(void 0===r&&!t)return;if(void 0!==r){if(t){const r=(0,l.cloneDeep)(t),n=this.removeInternalProperties(r);return this.squidDocIdToDoc.set(e,n),n}return void this.squidDocIdToDoc.delete(e)}const n=this.removeInternalProperties(t);return this.squidDocIdToDoc.set(e,n),t}hasData(e){return void 0!==this.squidDocIdToDoc.get(e)}getDocument(e){return y(this.getDocumentOrUndefined(e))}getDocumentOrUndefined(e){return this.squidDocIdToDoc.get(e)}sortAndLimitDocs(e,t){if(!e||0===e.size)return[];const r=[...e].map((e=>this.squidDocIdToDoc.get(e))).filter(f),{sortOrder:n,limit:i}=t,o=n.map((e=>e.fieldName)),s=n.map((e=>e.asc?"asc":"desc")),a=(0,l.orderBy)(r,o,s);return i<0?a:r.slice(0,i)}removeInternalProperties(e){if(!e)return;const t=Object.assign({},e);return delete t.__ts__,t}migrateDocId(e,t){const r=this.getDocument(e);w(this.squidDocIdToDoc,e,t);const n=q(t),i=I(n.docId);this.saveDocument(t,Object.assign(Object.assign(Object.assign({},r),i),{__docId__:n.docId}))}}var pt="Invariant Violation",mt=Object.setPrototypeOf,yt=void 0===mt?function(e,t){return e.__proto__=t,e}:mt,vt=function(e){function t(r){void 0===r&&(r=pt);var n=e.call(this,"number"==typeof r?pt+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=pt,yt(n,t.prototype),n}return he(t,e),t}(Error);function gt(e,t){if(!e)throw new vt(t)}var _t=["debug","log","warn","error","silent"],bt=_t.indexOf("log");function wt(e){return function(){if(_t.indexOf(e)>=bt)return(console[e]||console.log).apply(console,arguments)}}function Et(e){try{return e()}catch(e){}}!function(e){e.debug=wt("debug"),e.log=wt("log"),e.warn=wt("warn"),e.error=wt("error")}(gt||(gt={}));const St=Et((function(){return globalThis}))||Et((function(){return window}))||Et((function(){return self}))||Et((function(){return global}))||Et((function(){return Et.constructor("return this")()}));var Ot="__",It=[Ot,Ot].join("DEV");const Tt=function(){try{return Boolean(__DEV__)}catch(e){return Object.defineProperty(St,It,{value:"production"!==Et((function(){return"production"})),enumerable:!1,configurable:!0,writable:!0}),St[It]}}();function kt(e){try{return e()}catch(e){}}var Nt=kt((function(){return globalThis}))||kt((function(){return window}))||kt((function(){return self}))||kt((function(){return global}))||kt((function(){return kt.constructor("return this")()})),Dt=!1;function At(e,t){if(!Boolean(e))throw new Error(t)}!Nt||kt((function(){return"production"}))||kt((function(){return process}))||(Object.defineProperty(Nt,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),Dt=!0);const Rt=10,xt=2;function Pt(e){return $t(e,[])}function $t(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const r=[...t,e];if(function(e){return"function"==typeof e.toJSON}(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:$t(t,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>xt)return"[Array]";const r=Math.min(Rt,e.length),n=e.length-r,i=[];for(let n=0;n<r;++n)i.push($t(e[n],t));return 1===n?i.push("... 1 more item"):n>1&&i.push(`... ${n} more items`),"["+i.join(", ")+"]"}(e,r);return function(e,t){const r=Object.entries(e);if(0===r.length)return"{}";if(t.length>xt)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const n=r.map((([e,r])=>e+": "+$t(r,t)));return"{ "+n.join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}class Ct{constructor(e,t="GraphQL request",r={line:1,column:1}){"string"==typeof e||At(!1,`Body must be a string. Received: ${Pt(e)}.`),this.body=e,this.name=t,this.locationOffset=r,this.locationOffset.line>0||At(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||At(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function jt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Mt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ft(e,t,r){return t&&Mt(e.prototype,t),r&&Mt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}Dt&&(delete Nt.process,Dt=!1),__DEV__?gt("boolean"==typeof Tt,Tt):gt("boolean"==typeof Tt,39);var qt=function(){return"function"==typeof Symbol},Vt=function(e){return qt()&&Boolean(Symbol[e])},Lt=function(e){return Vt(e)?Symbol[e]:"@@"+e};qt()&&!Vt("observable")&&(Symbol.observable=Symbol("observable"));var Ut=Lt("iterator"),Qt=Lt("observable"),Bt=Lt("species");function zt(e,t){var r=e[t];if(null!=r){if("function"!=typeof r)throw new TypeError(r+" is not a function");return r}}function Yt(e){var t=e.constructor;return void 0!==t&&null===(t=t[Bt])&&(t=void 0),void 0!==t?t:rr}function Kt(e){return e instanceof rr}function Ht(e){Ht.log?Ht.log(e):setTimeout((function(){throw e}))}function Gt(e){Promise.resolve().then((function(){try{e()}catch(e){Ht(e)}}))}function Wt(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var r=zt(t,"unsubscribe");r&&r.call(t)}}catch(e){Ht(e)}}function Jt(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function Zt(e,t,r){e._state="running";var n=e._observer;try{var i=zt(n,t);switch(t){case"next":i&&i.call(n,r);break;case"error":if(Jt(e),!i)throw r;i.call(n,r);break;case"complete":Jt(e),i&&i.call(n)}}catch(e){Ht(e)}"closed"===e._state?Wt(e):"running"===e._state&&(e._state="ready")}function Xt(e,t,r){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:r}],void Gt((function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var r=0;r<t.length&&(Zt(e,t[r].type,t[r].value),"closed"!==e._state);++r);}}(e)}))):void Zt(e,t,r);e._queue.push({type:t,value:r})}}var er=function(){function e(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";var r=new tr(this);try{this._cleanup=t.call(void 0,r)}catch(e){r.error(e)}"initializing"===this._state&&(this._state="ready")}return e.prototype.unsubscribe=function(){"closed"!==this._state&&(Jt(this),Wt(this))},Ft(e,[{key:"closed",get:function(){return"closed"===this._state}}]),e}(),tr=function(){function e(e){this._subscription=e}var t=e.prototype;return t.next=function(e){Xt(this._subscription,"next",e)},t.error=function(e){Xt(this._subscription,"error",e)},t.complete=function(){Xt(this._subscription,"complete")},Ft(e,[{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),rr=function(){function e(t){if(!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}var t=e.prototype;return t.subscribe=function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new er(e,this._subscriber)},t.forEach=function(e){var t=this;return new Promise((function(r,n){if("function"==typeof e)var i=t.subscribe({next:function(t){try{e(t,o)}catch(e){n(e),i.unsubscribe()}},error:n,complete:r});else n(new TypeError(e+" is not a function"));function o(){i.unsubscribe(),r()}}))},t.map=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(Yt(this))((function(r){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return r.error(e)}r.next(t)},error:function(e){r.error(e)},complete:function(){r.complete()}})}))},t.filter=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(Yt(this))((function(r){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return r.error(e)}r.next(t)},error:function(e){r.error(e)},complete:function(){r.complete()}})}))},t.reduce=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=Yt(this),n=arguments.length>1,i=!1,o=arguments[1];return new r((function(r){return t.subscribe({next:function(t){var s=!i;if(i=!0,!s||n)try{o=e(o,t)}catch(e){return r.error(e)}else o=t},error:function(e){r.error(e)},complete:function(){if(!i&&!n)return r.error(new TypeError("Cannot reduce an empty sequence"));r.next(o),r.complete()}})}))},t.concat=function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=Yt(this);return new i((function(t){var n,o=0;return function e(s){n=s.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){o===r.length?(n=void 0,t.complete()):e(i.from(r[o++]))}})}(e),function(){n&&(n.unsubscribe(),n=void 0)}}))},t.flatMap=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=Yt(this);return new r((function(n){var i=[],o=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return n.error(e)}var o=r.from(t).subscribe({next:function(e){n.next(e)},error:function(e){n.error(e)},complete:function(){var e=i.indexOf(o);e>=0&&i.splice(e,1),s()}});i.push(o)},error:function(e){n.error(e)},complete:function(){s()}});function s(){o.closed&&0===i.length&&n.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),o.unsubscribe()}}))},t[Qt]=function(){return this},e.from=function(t){var r="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var n=zt(t,Qt);if(n){var i=n.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return Kt(i)&&i.constructor===r?i:new r((function(e){return i.subscribe(e)}))}if(Vt("iterator")&&(n=zt(t,Ut)))return new r((function(e){Gt((function(){if(!e.closed){for(var r,i=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return jt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?jt(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(n.call(t));!(r=i()).done;){var o=r.value;if(e.next(o),e.closed)return}e.complete()}}))}));if(Array.isArray(t))return new r((function(e){Gt((function(){if(!e.closed){for(var r=0;r<t.length;++r)if(e.next(t[r]),e.closed)return;e.complete()}}))}));throw new TypeError(t+" is not observable")},e.of=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return new("function"==typeof this?this:e)((function(e){Gt((function(){if(!e.closed){for(var t=0;t<r.length;++t)if(e.next(r[t]),e.closed)return;e.complete()}}))}))},Ft(e,null,[{key:Bt,get:function(){return this}}]),e}();function nr(e){return null!==e&&"object"==typeof e}function ir(e,t){var r=t,n=[];return e.definitions.forEach((function(e){if("OperationDefinition"===e.kind)throw __DEV__?new vt("Found a ".concat(e.operation," operation").concat(e.name?" named '".concat(e.name.value,"'"):"",". ")+"No operations are allowed when using a fragment as a query. Only fragments are allowed."):new vt(44);"FragmentDefinition"===e.kind&&n.push(e)})),void 0===r&&(__DEV__?gt(1===n.length,"Found ".concat(n.length," fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")):gt(1===n.length,45),r=n[0].name.value),de(de({},e),{definitions:_e([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],e.definitions,!0)})}function or(e){void 0===e&&(e=[]);var t={};return e.forEach((function(e){t[e.name.value]=e})),t}function sr(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":var r=e.name.value;if("function"==typeof t)return t(r);var n=t&&t[r];return __DEV__?gt(n,"No fragment named ".concat(r)):gt(n,46),n||null;default:return null}}function ar(e){return{__ref:String(e)}}function cr(e){return Boolean(e&&"object"==typeof e&&"string"==typeof e.__ref)}function ur(e,t,r,n){if(function(e){return"IntValue"===e.kind}(r)||function(e){return"FloatValue"===e.kind}(r))e[t.value]=Number(r.value);else if(function(e){return"BooleanValue"===e.kind}(r)||function(e){return"StringValue"===e.kind}(r))e[t.value]=r.value;else if(function(e){return"ObjectValue"===e.kind}(r)){var i={};r.fields.map((function(e){return ur(i,e.name,e.value,n)})),e[t.value]=i}else if(function(e){return"Variable"===e.kind}(r)){var o=(n||{})[r.name.value];e[t.value]=o}else if(function(e){return"ListValue"===e.kind}(r))e[t.value]=r.values.map((function(e){var r={};return ur(r,t,e,n),r[t.value]}));else if(function(e){return"EnumValue"===e.kind}(r))e[t.value]=r.value;else{if(!function(e){return"NullValue"===e.kind}(r))throw __DEV__?new vt('The inline argument "'.concat(t.value,'" of kind "').concat(r.kind,'"')+"is not supported. Use variables instead of inline arguments to overcome this limitation."):new vt(55);e[t.value]=null}}qt()&&Object.defineProperty(rr,Symbol("extensions"),{value:{symbol:Qt,hostReportError:Ht},configurable:!0});var lr=["connection","include","skip","client","rest","export"],fr=Object.assign((function(e,t,r){if(t&&r&&r.connection&&r.connection.key){if(r.connection.filter&&r.connection.filter.length>0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i={};return n.forEach((function(e){i[e]=t[e]})),"".concat(r.connection.key,"(").concat(hr(i),")")}return r.connection.key}var o=e;if(t){var s=hr(t);o+="(".concat(s,")")}return r&&Object.keys(r).forEach((function(e){-1===lr.indexOf(e)&&(r[e]&&Object.keys(r[e]).length?o+="@".concat(e,"(").concat(hr(r[e]),")"):o+="@".concat(e))})),o}),{setStringify:function(e){var t=hr;return hr=e,t}}),hr=function(e){return JSON.stringify(e,dr)};function dr(e,t){return nr(t)&&!Array.isArray(t)&&(t=Object.keys(t).sort().reduce((function(e,r){return e[r]=t[r],e}),{})),t}function pr(e,t){if(e.arguments&&e.arguments.length){var r={};return e.arguments.forEach((function(e){var n=e.name,i=e.value;return ur(r,n,i,t)})),r}return null}function mr(e){return e.alias?e.alias.value:e.name.value}function yr(e,t,r){if("string"==typeof e.__typename)return e.__typename;for(var n=0,i=t.selections;n<i.length;n++){var o=i[n];if(vr(o)){if("__typename"===o.name.value)return e[mr(o)]}else{var s=yr(e,sr(o,r).selectionSet,r);if("string"==typeof s)return s}}}function vr(e){return"Field"===e.kind}function gr(e){__DEV__?gt(e&&"Document"===e.kind,'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):gt(e&&"Document"===e.kind,47);var t=e.definitions.filter((function(e){return"FragmentDefinition"!==e.kind})).map((function(e){if("OperationDefinition"!==e.kind)throw __DEV__?new vt('Schema type definitions not allowed in queries. Found: "'.concat(e.kind,'"')):new vt(48);return e}));return __DEV__?gt(t.length<=1,"Ambiguous GraphQL document: contains ".concat(t.length," operations")):gt(t.length<=1,49),e}function _r(e){return gr(e),e.definitions.filter((function(e){return"OperationDefinition"===e.kind}))[0]}function br(e){return e.definitions.filter((function(e){return"OperationDefinition"===e.kind&&e.name})).map((function(e){return e.name.value}))[0]||null}function wr(e){return e.definitions.filter((function(e){return"FragmentDefinition"===e.kind}))}function Er(e){var t=_r(e);return __DEV__?gt(t&&"query"===t.operation,"Must contain a query definition."):gt(t&&"query"===t.operation,50),t}function Sr(e){var t;gr(e);for(var r=0,n=e.definitions;r<n.length;r++){var i=n[r];if("OperationDefinition"===i.kind){var o=i.operation;if("query"===o||"mutation"===o||"subscription"===o)return i}"FragmentDefinition"!==i.kind||t||(t=i)}if(t)return t;throw __DEV__?new vt("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new vt(54)}function Or(e){var t=Object.create(null),r=e&&e.variableDefinitions;return r&&r.length&&r.forEach((function(e){e.defaultValue&&ur(t,e.variable.name,e.defaultValue)})),t}function Ir(e,t){return t?t(e):rr.of()}function Tr(e){return"function"==typeof e?new Dr(e):e}function kr(e){return e.request.length<=1}var Nr=function(e){function t(t,r){var n=e.call(this,t)||this;return n.link=r,n}return he(t,e),t}(Error),Dr=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e((function(){return rr.of()}))},e.from=function(t){return 0===t.length?e.empty():t.map(Tr).reduce((function(e,t){return e.concat(t)}))},e.split=function(t,r,n){var i=Tr(r),o=Tr(n||new e(Ir));return kr(i)&&kr(o)?new e((function(e){return t(e)?i.request(e)||rr.of():o.request(e)||rr.of()})):new e((function(e,r){return t(e)?i.request(e,r)||rr.of():o.request(e,r)||rr.of()}))},e.execute=function(e,t){return e.request(function(e,t){var r=de({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){r=de(de({},r),"function"==typeof e?e(r):e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return de({},r)}}),t}(t.context,function(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName="string"!=typeof t.query?br(t.query)||void 0:""),t}(function(e){for(var t=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];if(t.indexOf(i)<0)throw __DEV__?new vt("illegal argument: ".concat(i)):new vt(27)}return e}(t))))||rr.of()},e.concat=function(t,r){var n=Tr(t);if(kr(n))return __DEV__&&gt.warn(new Nr("You are calling concat on a terminating link, which will have no effect",n)),n;var i=Tr(r);return kr(i)?new e((function(e){return n.request(e,(function(e){return i.request(e)||rr.of()}))||rr.of()})):new e((function(e,t){return n.request(e,(function(e){return i.request(e,t)||rr.of()}))||rr.of()}))},e.prototype.split=function(t,r,n){return this.concat(e.split(t,r,n||new e(Ir)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(e,t){throw __DEV__?new vt("request is not implemented"):new vt(22)},e.prototype.onError=function(e,t){if(t&&t.error)return t.error(e),!1;throw e},e.prototype.setOnError=function(e){return this.onError=e,this},e}(),Ar=Dr.execute;class Rr{constructor(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class xr{constructor(e,t,r,n,i,o){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const Pr={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},$r=new Set(Object.keys(Pr));function Cr(e){const t=null==e?void 0:e.kind;return"string"==typeof t&&$r.has(t)}var jr,Mr,Fr;!function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"}(jr||(jr={})),(Fr=Mr||(Mr={})).NAME="Name",Fr.DOCUMENT="Document",Fr.OPERATION_DEFINITION="OperationDefinition",Fr.VARIABLE_DEFINITION="VariableDefinition",Fr.SELECTION_SET="SelectionSet",Fr.FIELD="Field",Fr.ARGUMENT="Argument",Fr.FRAGMENT_SPREAD="FragmentSpread",Fr.INLINE_FRAGMENT="InlineFragment",Fr.FRAGMENT_DEFINITION="FragmentDefinition",Fr.VARIABLE="Variable",Fr.INT="IntValue",Fr.FLOAT="FloatValue",Fr.STRING="StringValue",Fr.BOOLEAN="BooleanValue",Fr.NULL="NullValue",Fr.ENUM="EnumValue",Fr.LIST="ListValue",Fr.OBJECT="ObjectValue",Fr.OBJECT_FIELD="ObjectField",Fr.DIRECTIVE="Directive",Fr.NAMED_TYPE="NamedType",Fr.LIST_TYPE="ListType",Fr.NON_NULL_TYPE="NonNullType",Fr.SCHEMA_DEFINITION="SchemaDefinition",Fr.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",Fr.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",Fr.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",Fr.FIELD_DEFINITION="FieldDefinition",Fr.INPUT_VALUE_DEFINITION="InputValueDefinition",Fr.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",Fr.UNION_TYPE_DEFINITION="UnionTypeDefinition",Fr.ENUM_TYPE_DEFINITION="EnumTypeDefinition",Fr.ENUM_VALUE_DEFINITION="EnumValueDefinition",Fr.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",Fr.DIRECTIVE_DEFINITION="DirectiveDefinition",Fr.SCHEMA_EXTENSION="SchemaExtension",Fr.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",Fr.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",Fr.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",Fr.UNION_TYPE_EXTENSION="UnionTypeExtension",Fr.ENUM_TYPE_EXTENSION="EnumTypeExtension",Fr.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension";const qr=Object.freeze({});function Vr(e,t,r=Pr){const n=new Map;for(const e of Object.values(Mr))n.set(e,Lr(t,e));let i,o,s,a=Array.isArray(e),c=[e],u=-1,l=[],f=e;const h=[],d=[];do{u++;const e=u===c.length,v=e&&0!==l.length;if(e){if(o=0===d.length?void 0:h[h.length-1],f=s,s=d.pop(),v)if(a){f=f.slice();let e=0;for(const[t,r]of l){const n=t-e;null===r?(f.splice(n,1),e++):f[n]=r}}else{f=Object.defineProperties({},Object.getOwnPropertyDescriptors(f));for(const[e,t]of l)f[e]=t}u=i.index,c=i.keys,l=i.edits,a=i.inArray,i=i.prev}else if(s){if(o=a?u:c[u],f=s[o],null==f)continue;h.push(o)}let g;if(!Array.isArray(f)){var p,m;Cr(f)||At(!1,`Invalid AST Node: ${Pt(f)}.`);const r=e?null===(p=n.get(f.kind))||void 0===p?void 0:p.leave:null===(m=n.get(f.kind))||void 0===m?void 0:m.enter;if(g=null==r?void 0:r.call(t,f,o,s,h,d),g===qr)break;if(!1===g){if(!e){h.pop();continue}}else if(void 0!==g&&(l.push([o,g]),!e)){if(!Cr(g)){h.pop();continue}f=g}}var y;void 0===g&&v&&l.push([o,f]),e?h.pop():(i={inArray:a,index:u,keys:c,edits:l,prev:i},a=Array.isArray(f),c=a?f:null!==(y=r[f.kind])&&void 0!==y?y:[],u=-1,l=[],s&&d.push(s),s=f)}while(void 0!==i);return 0!==l.length?l[l.length-1][1]:e}function Lr(e,t){const r=e[t];return"object"==typeof r?r:"function"==typeof r?{enter:r,leave:void 0}:{enter:e.enter,leave:e.leave}}function Ur(e,t){var r=e.directives;return!r||!r.length||function(e){var t=[];return e&&e.length&&e.forEach((function(e){if(function(e){var t=e.name.value;return"skip"===t||"include"===t}(e)){var r=e.arguments,n=e.name.value;__DEV__?gt(r&&1===r.length,"Incorrect number of arguments for the @".concat(n," directive.")):gt(r&&1===r.length,41);var i=r[0];__DEV__?gt(i.name&&"if"===i.name.value,"Invalid argument for the @".concat(n," directive.")):gt(i.name&&"if"===i.name.value,42);var o=i.value;__DEV__?gt(o&&("Variable"===o.kind||"BooleanValue"===o.kind),"Argument for the @".concat(n," directive must be a variable or a boolean value.")):gt(o&&("Variable"===o.kind||"BooleanValue"===o.kind),43),t.push({directive:e,ifArgument:i})}})),t}(r).every((function(e){var r=e.directive,n=e.ifArgument,i=!1;return"Variable"===n.value.kind?(i=t&&t[n.value.name.value],__DEV__?gt(void 0!==i,"Invalid variable referenced in @".concat(r.name.value," directive.")):gt(void 0!==i,40)):i=n.value.value,"skip"===r.name.value?!i:i}))}function Qr(e,t,r){var n=new Set(e),i=n.size;return Vr(t,{Directive:function(e){if(n.delete(e.name.value)&&(!r||!n.size))return qr}}),r?!n.size:n.size<i}function Br(e){return e&&Qr(["client","export"],e,!0)}var zr=function(e,t){var r;try{r=JSON.stringify(e)}catch(e){var n=__DEV__?new vt("Network request failed. ".concat(t," is not serializable: ").concat(e.message)):new vt(24);throw n.parseError=e,n}return r},Yr="function"==typeof WeakMap&&"ReactNative"!==Et((function(){return navigator.product})),Kr="function"==typeof WeakSet,Hr="function"==typeof Symbol&&"function"==typeof Symbol.for,Gr=Hr&&Symbol.asyncIterator;function Wr(e){var t={next:function(){return e.read()}};return Gr&&(t[Symbol.asyncIterator]=function(){return this}),t}function Jr(e){var t,r,n,i,o=e;if(e.body&&(o=e.body),i=o,Gr&&i[Symbol.asyncIterator])return function(e){var t,r=e[Symbol.asyncIterator]();return(t={next:function(){return r.next()}})[Symbol.asyncIterator]=function(){return this},t}(o);if(function(e){return!!e.getReader}(o))return Wr(o.getReader());if(function(e){return!!e.stream}(o))return Wr(o.stream().getReader());if(function(e){return!!e.arrayBuffer}(o))return t=o.arrayBuffer(),r=!1,n={next:function(){return r?Promise.resolve({value:void 0,done:!0}):(r=!0,new Promise((function(e,r){t.then((function(t){e({value:t,done:!1})})).catch(r)})))}},Gr&&(n[Symbol.asyncIterator]=function(){return this}),n;if(function(e){return!!e.pipe}(o))return function(e){var t=null,r=null,n=!1,i=[],o=[];function s(e){if(!r){if(o.length){var t=o.shift();if(Array.isArray(t)&&t[0])return t[0]({value:e,done:!1})}i.push(e)}}function a(e){r=e,o.slice().forEach((function(t){t[1](e)})),!t||t()}function c(){n=!0,o.slice().forEach((function(e){e[0]({value:void 0,done:!0})})),!t||t()}t=function(){t=null,e.removeListener("data",s),e.removeListener("error",a),e.removeListener("end",c),e.removeListener("finish",c),e.removeListener("close",c)},e.on("data",s),e.on("error",a),e.on("end",c),e.on("finish",c),e.on("close",c);var u={next:function(){return new Promise((function(e,t){return r?t(r):i.length?e({value:i.shift(),done:!1}):n?e({value:void 0,done:!0}):void o.push([e,t])}))}};return Gr&&(u[Symbol.asyncIterator]=function(){return this}),u}(o);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}Et((function(){return window.document.createElement})),Et((function(){return navigator.userAgent.indexOf("jsdom")>=0}));var Zr=function(e,t,r){var n=new Error(r);throw n.name="ServerError",n.response=e,n.statusCode=e.status,n.result=t,n},Xr=Object.prototype.hasOwnProperty;function en(e){var t={};return e.split("\n").forEach((function(e){var r=e.indexOf(":");if(r>-1){var n=e.slice(0,r).trim().toLowerCase(),i=e.slice(r+1).trim();t[n]=i}})),t}function tn(e,t){e.status>=300&&Zr(e,function(){try{return JSON.parse(t)}catch(e){return t}}(),"Response not successful: Received status code ".concat(e.status));try{return JSON.parse(t)}catch(n){var r=n;throw r.name="ServerParseError",r.response=e,r.statusCode=e.status,r.bodyText=t,r}}function rn(e,t){var r,n;"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&(null===(r=t.next)||void 0===r||r.call(t,e.result)),null===(n=t.error)||void 0===n||n.call(t,e))}function nn(e){return 9===e||32===e}function on(e){return e>=48&&e<=57}function sn(e){return e>=97&&e<=122||e>=65&&e<=90}function an(e){return sn(e)||95===e}function cn(e){var t;let r=Number.MAX_SAFE_INTEGER,n=null,i=-1;for(let t=0;t<e.length;++t){var o;const s=e[t],a=un(s);a!==s.length&&(n=null!==(o=n)&&void 0!==o?o:t,i=t,0!==t&&a<r&&(r=a))}return e.map(((e,t)=>0===t?e:e.slice(r))).slice(null!==(t=n)&&void 0!==t?t:0,i+1)}function un(e){let t=0;for(;t<e.length&&nn(e.charCodeAt(t));)++t;return t}const ln=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function fn(e){return hn[e.charCodeAt(0)]}const hn=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"];function dn(e){return Vr(e,pn)}const pn={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>mn(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=vn("(",mn(e.variableDefinitions,", "),")"),r=mn([e.operation,mn([e.name,t]),mn(e.directives," ")]," ");return("query"===r?"":r+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:r,directives:n})=>e+": "+t+vn(" = ",r)+vn(" ",mn(n," "))},SelectionSet:{leave:({selections:e})=>yn(e)},Field:{leave({alias:e,name:t,arguments:r,directives:n,selectionSet:i}){const o=vn("",e,": ")+t;let s=o+vn("(",mn(r,", "),")");return s.length>80&&(s=o+vn("(\n",gn(mn(r,"\n")),"\n)")),mn([s,mn(n," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+vn(" ",mn(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:r})=>mn(["...",vn("on ",e),mn(t," "),r]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:r,directives:n,selectionSet:i})=>`fragment ${e}${vn("(",mn(r,", "),")")} on ${t} ${vn("",mn(n," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?function(e,t){const r=e.replace(/"""/g,'\\"""'),n=r.split(/\r\n|[\n\r]/g),i=1===n.length,o=n.length>1&&n.slice(1).every((e=>0===e.length||nn(e.charCodeAt(0)))),s=r.endsWith('\\"""'),a=e.endsWith('"')&&!s,c=e.endsWith("\\"),u=a||c,l=!i||e.length>70||u||o||s;let f="";const h=i&&nn(e.charCodeAt(0));return(l&&!h||o)&&(f+="\n"),f+=r,(l||u)&&(f+="\n"),'"""'+f+'"""'}(e):`"${e.replace(ln,fn)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+mn(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+mn(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+vn("(",mn(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:r})=>vn("",e,"\n")+mn(["schema",mn(t," "),yn(r)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:r})=>vn("",e,"\n")+mn(["scalar",t,mn(r," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:n,fields:i})=>vn("",e,"\n")+mn(["type",t,vn("implements ",mn(r," & ")),mn(n," "),yn(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:r,type:n,directives:i})=>vn("",e,"\n")+t+(_n(r)?vn("(\n",gn(mn(r,"\n")),"\n)"):vn("(",mn(r,", "),")"))+": "+n+vn(" ",mn(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:r,defaultValue:n,directives:i})=>vn("",e,"\n")+mn([t+": "+r,vn("= ",n),mn(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:n,fields:i})=>vn("",e,"\n")+mn(["interface",t,vn("implements ",mn(r," & ")),mn(n," "),yn(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:r,types:n})=>vn("",e,"\n")+mn(["union",t,mn(r," "),vn("= ",mn(n," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:r,values:n})=>vn("",e,"\n")+mn(["enum",t,mn(r," "),yn(n)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:r})=>vn("",e,"\n")+mn([t,mn(r," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:r,fields:n})=>vn("",e,"\n")+mn(["input",t,mn(r," "),yn(n)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:r,repeatable:n,locations:i})=>vn("",e,"\n")+"directive @"+t+(_n(r)?vn("(\n",gn(mn(r,"\n")),"\n)"):vn("(",mn(r,", "),")"))+(n?" repeatable":"")+" on "+mn(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>mn(["extend schema",mn(e," "),yn(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>mn(["extend scalar",e,mn(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:n})=>mn(["extend type",e,vn("implements ",mn(t," & ")),mn(r," "),yn(n)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:n})=>mn(["extend interface",e,vn("implements ",mn(t," & ")),mn(r," "),yn(n)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:r})=>mn(["extend union",e,mn(t," "),vn("= ",mn(r," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:r})=>mn(["extend enum",e,mn(t," "),yn(r)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:r})=>mn(["extend input",e,mn(t," "),yn(r)]," ")}};function mn(e,t=""){var r;return null!==(r=null==e?void 0:e.filter((e=>e)).join(t))&&void 0!==r?r:""}function yn(e){return vn("{\n",gn(mn(e,"\n")),"\n}")}function vn(e,t,r=""){return null!=t&&""!==t?e+t+r:""}function gn(e){return vn(" ",e.replace(/\n/g,"\n "))}function _n(e){var t;return null!==(t=null==e?void 0:e.some((e=>e.includes("\n"))))&&void 0!==t&&t}var bn={http:{includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},wn=function(e,t){return t(e)};function En(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i={},o={};r.forEach((function(e){i=de(de(de({},i),e.options),{headers:de(de({},i.headers),e.headers)}),e.credentials&&(i.credentials=e.credentials),o=de(de({},o),e.http)})),i.headers&&(i.headers=function(e,t){if(!t){var r=Object.create(null);return Object.keys(Object(e)).forEach((function(t){r[t.toLowerCase()]=e[t]})),r}var n=Object.create(null);Object.keys(Object(e)).forEach((function(t){n[t.toLowerCase()]={originalName:t,value:e[t]}}));var i=Object.create(null);return Object.keys(n).forEach((function(e){i[n[e].originalName]=n[e].value})),i}(i.headers,o.preserveHeaderCase));var s=e.operationName,a=e.extensions,c=e.variables,u=e.query,l={operationName:s,variables:c};return o.includeExtensions&&(l.extensions=a),o.includeQuery&&(l.query=t(u,dn)),{options:i,body:l}}function Sn(e){return new rr((function(t){t.error(e)}))}var On=Et((function(){return fetch})),In=function(e){void 0===e&&(e={});var t=e.uri,r=void 0===t?"/graphql":t,n=e.fetch,i=e.print,o=void 0===i?wn:i,s=e.includeExtensions,a=e.preserveHeaderCase,c=e.useGETForQueries,u=e.includeUnusedVariables,l=void 0!==u&&u,f=pe(e,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);__DEV__&&function(e){if(!e&&"undefined"==typeof fetch)throw __DEV__?new vt("\n\"fetch\" has not been found globally and no fetcher has been configured. To fix this, install a fetch package (like https://www.npmjs.com/package/cross-fetch), instantiate the fetcher, and pass it into your HttpLink constructor. For example:\n\nimport fetch from 'cross-fetch';\nimport { ApolloClient, HttpLink } from '@apollo/client';\nconst client = new ApolloClient({\n link: new HttpLink({ uri: '/graphql', fetch })\n});\n "):new vt(23)}(n||On);var h={http:{includeExtensions:s,preserveHeaderCase:a},options:f.fetchOptions,credentials:f.credentials,headers:f.headers};return new Dr((function(e){var t=function(e,t){return e.getContext().uri||("function"==typeof t?t(e):t||"/graphql")}(e,r),i=e.getContext(),s={};if(i.clientAwareness){var a=i.clientAwareness,u=a.name,f=a.version;u&&(s["apollographql-client-name"]=u),f&&(s["apollographql-client-version"]=f)}var d,p=de(de({},s),i.headers),m={http:i.http,options:i.fetchOptions,credentials:i.credentials,headers:p},y=En(e,o,bn,h,m),v=y.options,g=y.body;if(g.variables&&!l){var _=new Set(Object.keys(g.variables));Vr(e.query,{Variable:function(e,t,r){r&&"VariableDefinition"!==r.kind&&_.delete(e.name.value)}}),_.size&&(g.variables=de({},g.variables),_.forEach((function(e){delete g.variables[e]})))}if(!v.signal){var b=function(){if("undefined"==typeof AbortController)return{controller:!1,signal:!1};var e=new AbortController;return{controller:e,signal:e.signal}}(),w=b.controller,E=b.signal;(d=w)&&(v.signal=E)}if(c&&!e.query.definitions.some((function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation}))&&(v.method="GET"),Qr(["defer"],e.query)&&(v.headers=v.headers||{},v.headers.accept="multipart/mixed; deferSpec=20220824, application/json"),"GET"===v.method){var S=function(e,t){var r=[],n=function(e,t){r.push("".concat(e,"=").concat(encodeURIComponent(t)))};if("query"in t&&n("query",t.query),t.operationName&&n("operationName",t.operationName),t.variables){var i=void 0;try{i=zr(t.variables,"Variables map")}catch(e){return{parseError:e}}n("variables",i)}if(t.extensions){var o=void 0;try{o=zr(t.extensions,"Extensions map")}catch(e){return{parseError:e}}n("extensions",o)}var s="",a=e,c=e.indexOf("#");-1!==c&&(s=e.substr(c),a=e.substr(0,c));var u=-1===a.indexOf("?")?"?":"&";return{newURI:a+u+r.join("&")+s}}(t,g),O=S.newURI,I=S.parseError;if(I)return Sn(I);t=O}else try{v.body=zr(g,"Payload")}catch(I){return Sn(I)}return new rr((function(r){return(n||Et((function(){return fetch}))||On)(t,v).then((function(t){var n;e.setContext({response:t});var i=null===(n=t.headers)||void 0===n?void 0:n.get("content-type");return null!==i&&/^multipart\/mixed/i.test(i)?function(e,t){var r,n,i;return me(this,void 0,void 0,(function(){var o,s,a,c,u,l,f,h,d,p,m,y,v,g,_,b,w,E,S,O;return ye(this,(function(I){switch(I.label){case 0:if(void 0===TextDecoder)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");o=new TextDecoder("utf-8"),s=null===(r=e.headers)||void 0===r?void 0:r.get("content-type"),a="boundary=",c=(null==s?void 0:s.includes(a))?null==s?void 0:s.substring((null==s?void 0:s.indexOf(a))+9).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",u="--".concat(c),l="",f=Jr(e),h=!0,I.label=1;case 1:return h?[4,f.next()]:[3,3];case 2:for(d=I.sent(),p=d.value,m=d.done,y="string"==typeof p?p:o.decode(p),h=!m,v=(l+=y).indexOf(u);v>-1;){if(g=void 0,O=[l.slice(0,v),l.slice(v+u.length)],l=O[1],(g=O[0]).trim()){if(_=g.indexOf("\r\n\r\n"),b=en(g.slice(0,_)),(w=b["content-type"])&&-1===w.toLowerCase().indexOf("application/json"))throw new Error("Unsupported patch content type: application/json is required.");E=g.slice(_);try{S=tn(e,E.replace("\r\n","")),(Object.keys(S).length>1||"data"in S||"incremental"in S||"errors"in S)&&(null===(n=t.next)||void 0===n||n.call(t,S))}catch(e){rn(e,t)}}v=l.indexOf(u)}return[3,1];case 3:return null===(i=t.complete)||void 0===i||i.call(t),[2]}}))}))}(t,r):function(e,t,r){var n;(n=t,function(e){return e.text().then((function(t){return tn(e,t)})).then((function(t){return e.status>=300&&Zr(e,t,"Response not successful: Received status code ".concat(e.status)),Array.isArray(t)||Xr.call(t,"data")||Xr.call(t,"errors")||Zr(e,t,"Server response was missing for query '".concat(Array.isArray(n)?n.map((function(e){return e.operationName})):n.operationName,"'.")),t}))})(e).then((function(e){var t,n;null===(t=r.next)||void 0===t||t.call(r,e),null===(n=r.complete)||void 0===n||n.call(r)})).catch((function(e){return rn(e,r)}))}(t,e,r)})).catch((function(e){return rn(e,r)})),function(){d&&d.abort()}}))}))},Tn=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,In(t).request)||this;return r.options=t,r}return he(t,e),t}(Dr),kn=Object.prototype,Nn=kn.toString,Dn=kn.hasOwnProperty,An=Function.prototype.toString,Rn=new Map;function xn(e,t){try{return Pn(e,t)}finally{Rn.clear()}}function Pn(e,t){if(e===t)return!0;var r,n,i,o=Nn.call(e);if(o!==Nn.call(t))return!1;switch(o){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":if(Mn(e,t))return!0;var s=$n(e),a=$n(t),c=s.length;if(c!==a.length)return!1;for(var u=0;u<c;++u)if(!Dn.call(t,s[u]))return!1;for(u=0;u<c;++u){var l=s[u];if(!Pn(e[l],t[l]))return!1}return!0;case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!=e)return t!=t;case"[object Boolean]":case"[object Date]":return+e==+t;case"[object RegExp]":case"[object String]":return e=="".concat(t);case"[object Map]":case"[object Set]":if(e.size!==t.size)return!1;if(Mn(e,t))return!0;for(var f=e.entries(),h="[object Map]"===o;;){var d=f.next();if(d.done)break;var p=d.value,m=p[0],y=p[1];if(!t.has(m))return!1;if(h&&!Pn(y,t.get(m)))return!1}return!0;case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":e=new Uint8Array(e),t=new Uint8Array(t);case"[object DataView]":var v=e.byteLength;if(v===t.byteLength)for(;v--&&e[v]===t[v];);return-1===v;case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":var g=An.call(e);return g===An.call(t)&&(n=jn,!((i=(r=g).length-n.length)>=0&&r.indexOf(n,i)===i))}return!1}function $n(e){return Object.keys(e).filter(Cn,e)}function Cn(e){return void 0!==this[e]}var jn="{ [native code] }";function Mn(e,t){var r=Rn.get(e);if(r){if(r.has(t))return!0}else Rn.set(e,r=new Set);return r.add(t),!1}var Fn=Array.isArray;function qn(e){return Array.isArray(e)&&e.length>0}var Vn=Object.prototype.hasOwnProperty;function Ln(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Un(e)}function Un(e){var t=e[0]||{},r=e.length;if(r>1)for(var n=new Bn,i=1;i<r;++i)t=n.merge(t,e[i]);return t}var Qn=function(e,t,r){return this.merge(e[r],t[r])},Bn=function(){function e(e){void 0===e&&(e=Qn),this.reconciler=e,this.isObject=nr,this.pastCopies=new Set}return e.prototype.merge=function(e,t){for(var r=this,n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return nr(t)&&nr(e)?(Object.keys(t).forEach((function(i){if(Vn.call(e,i)){var o=e[i];if(t[i]!==o){var s=r.reconciler.apply(r,_e([e,t,i],n,!1));s!==o&&((e=r.shallowCopyForMerge(e))[i]=s)}}else(e=r.shallowCopyForMerge(e))[i]=t[i]})),e):t},e.prototype.shallowCopyForMerge=function(e){return nr(e)&&(this.pastCopies.has(e)||(e=Array.isArray(e)?e.slice(0):de({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},e}();function zn(e){return"incremental"in e}function Yn(e,t){var r=e,n=new Bn;return zn(t)&&qn(t.incremental)&&t.incremental.forEach((function(e){for(var t=e.data,i=e.path,o=i.length-1;o>=0;--o){var s=i[o],a=isNaN(+s)?{}:[];a[s]=t,t=a}r=n.merge(r,t)})),r}var Kn,Hn,Gn=function(){return Object.create(null)},Wn=Array.prototype,Jn=Wn.forEach,Zn=Wn.slice,Xn=function(){function e(e,t){void 0===e&&(e=!0),void 0===t&&(t=Gn),this.weakness=e,this.makeData=t}return e.prototype.lookup=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.lookupArray(e)},e.prototype.lookupArray=function(e){var t=this;return Jn.call(e,(function(e){return t=t.getChildTrie(e)})),t.data||(t.data=this.makeData(Zn.call(e)))},e.prototype.getChildTrie=function(t){var r=this.weakness&&function(e){switch(typeof e){case"object":if(null===e)break;case"function":return!0}return!1}(t)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),n=r.get(t);return n||r.set(t,n=new e(this.weakness,this.makeData)),n},e}(),ei=function(){function e(){this.known=new(Kr?WeakSet:Set),this.pool=new Xn(Yr),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return e.prototype.isKnown=function(e){return nr(e)&&this.known.has(e)},e.prototype.pass=function(e){if(nr(e)){var t=function(e){return nr(e)?Fn(e)?e.slice(0):de({__proto__:Object.getPrototypeOf(e)},e):e}(e);return this.passes.set(t,e),t}return e},e.prototype.admit=function(e){var t=this;if(nr(e)){var r=this.passes.get(e);if(r)return r;switch(Object.getPrototypeOf(e)){case Array.prototype:if(this.known.has(e))return e;var n=e.map(this.admit,this);return(a=this.pool.lookupArray(n)).array||(this.known.add(a.array=n),__DEV__&&Object.freeze(n)),a.array;case null:case Object.prototype:if(this.known.has(e))return e;var i=Object.getPrototypeOf(e),o=[i],s=this.sortedKeys(e);o.push(s.json);var a,c=o.length;if(s.sorted.forEach((function(r){o.push(t.admit(e[r]))})),!(a=this.pool.lookupArray(o)).object){var u=a.object=Object.create(i);this.known.add(u),s.sorted.forEach((function(e,t){u[e]=o[c+t]})),__DEV__&&Object.freeze(u)}return a.object}}return e},e.prototype.sortedKeys=function(e){var t=Object.keys(e),r=this.pool.lookupArray(t);if(!r.keys){t.sort();var n=JSON.stringify(t);(r.keys=this.keysByJSON.get(n))||this.keysByJSON.set(n,r.keys={sorted:t,json:n})}return r.keys},e}(),ti=Object.assign((function(e){if(nr(e)){void 0===Kn&&ri();var t=Kn.admit(e),r=Hn.get(t);return void 0===r&&Hn.set(t,r=JSON.stringify(t)),r}return JSON.stringify(e)}),{reset:ri});function ri(){Kn=new ei,Hn=new(Yr?WeakMap:Map)}function ni(e,t,r){return new rr((function(n){var i=n.next,o=n.error,s=n.complete,a=0,c=!1,u={then:function(e){return new Promise((function(t){return t(e())}))}};function l(e,t){return e?function(t){++a;var r=function(){return e(t)};u=u.then(r,r).then((function(e){--a,i&&i.call(n,e),c&&f.complete()}),(function(e){throw--a,e})).catch((function(e){o&&o.call(n,e)}))}:function(e){return t&&t.call(n,e)}}var f={next:l(t,i),error:l(r,o),complete:function(){c=!0,a||s&&s.call(n)}},h=e.subscribe(f);return function(){return h.unsubscribe()}}))}function ii(e){return qn(oi(e))}function oi(e){var t=qn(e.errors)?e.errors.slice(0):[];return zn(e)&&qn(e.incremental)&&e.incremental.forEach((function(e){e.errors&&t.push.apply(t,e.errors)})),t}var si={kind:Mr.FIELD,name:{kind:Mr.NAME,value:"__typename"}};function ai(e,t){return!e||e.selectionSet.selections.every((function(e){return e.kind===Mr.FRAGMENT_SPREAD&&ai(t[e.name.value],t)}))}function ci(e){return ai(_r(e)||function(e){__DEV__?gt("Document"===e.kind,'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):gt("Document"===e.kind,51),__DEV__?gt(e.definitions.length<=1,"Fragment must have exactly one definition."):gt(e.definitions.length<=1,52);var t=e.definitions[0];return __DEV__?gt("FragmentDefinition"===t.kind,"Must be a fragment definition."):gt("FragmentDefinition"===t.kind,53),t}(e),or(wr(e)))?null:e}function ui(e){var t=new Map;return function(r){void 0===r&&(r=e);var n=t.get(r);return n||t.set(r,n={variables:new Set,fragmentSpreads:new Set}),n}}function li(e,t){for(var r=ui(""),n=ui(""),i=function(e){for(var t=0,i=void 0;t<e.length&&(i=e[t]);++t)if(!Fn(i)){if(i.kind===Mr.OPERATION_DEFINITION)return r(i.name&&i.name.value);if(i.kind===Mr.FRAGMENT_DEFINITION)return n(i.name.value)}return __DEV__&&gt.error("Could not find operation or fragment"),null},o=0,s=t.definitions.length-1;s>=0;--s)t.definitions[s].kind===Mr.OPERATION_DEFINITION&&++o;var a=function(e){var t=new Set,r=[];return e.forEach((function(e){e.name?t.add(e.name):e.test&&r.push(e.test)})),function(e){return t.has(e.name.value)||r.some((function(t){return t(e)}))}}(e),c=e.some((function(e){return e.remove})),u=function(e){return c&&e&&e.some(a)},l=new Map,f=!1,h={enter:function(e){if(u(e.directives))return f=!0,null}},d=Vr(t,{Field:h,InlineFragment:h,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(e,t,r,n,o){var s=i(o);s&&s.variables.add(e.name.value)}},FragmentSpread:{enter:function(e,t,r,n,o){if(u(e.directives))return f=!0,null;var s=i(o);s&&s.fragmentSpreads.add(e.name.value)}},FragmentDefinition:{enter:function(e,t,r,n){l.set(JSON.stringify(n),e)},leave:function(e,t,r,i){return e===l.get(JSON.stringify(i))?e:o>0&&e.selectionSet.selections.every((function(e){return e.kind===Mr.FIELD&&"__typename"===e.name.value}))?(n(e.name.value).removed=!0,f=!0,null):void 0}},Directive:{leave:function(e){if(a(e))return f=!0,null}}});if(!f)return t;var p=function(e){return e.transitiveVars||(e.transitiveVars=new Set(e.variables),e.removed||e.fragmentSpreads.forEach((function(t){p(n(t)).transitiveVars.forEach((function(t){e.transitiveVars.add(t)}))}))),e},m=new Set;d.definitions.forEach((function(e){e.kind===Mr.OPERATION_DEFINITION?p(r(e.name&&e.name.value)).fragmentSpreads.forEach((function(e){m.add(e)})):e.kind!==Mr.FRAGMENT_DEFINITION||0!==o||n(e.name.value).removed||m.add(e.name.value)})),m.forEach((function(e){p(n(e)).fragmentSpreads.forEach((function(e){m.add(e)}))}));var y={enter:function(e){if(t=e.name.value,!m.has(t)||n(t).removed)return null;var t}};return ci(Vr(d,{FragmentSpread:y,FragmentDefinition:y,OperationDefinition:{leave:function(e){if(e.variableDefinitions){var t=p(r(e.name&&e.name.value)).transitiveVars;if(t.size<e.variableDefinitions.length)return de(de({},e),{variableDefinitions:e.variableDefinitions.filter((function(e){return t.has(e.variable.name.value)}))})}}}}))}var fi=Object.assign((function(e){return Vr(e,{SelectionSet:{enter:function(e,t,r){if(!r||r.kind!==Mr.OPERATION_DEFINITION){var n=e.selections;if(n&&!n.some((function(e){return vr(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))}))){var i=r;if(!(vr(i)&&i.directives&&i.directives.some((function(e){return"export"===e.name.value}))))return de(de({},e),{selections:_e(_e([],n,!0),[si],!1)})}}}}})}),{added:function(e){return e===si}}),hi={test:function(e){var t="connection"===e.name.value;return t&&(e.arguments&&e.arguments.some((function(e){return"key"===e.name.value}))||__DEV__&&gt.warn("Removing an @connection directive even though it does not have a key. You may want to use the key parameter to specify a store key.")),t}};function di(e){return"query"===Sr(e).operation?e:Vr(e,{OperationDefinition:{enter:function(e){return de(de({},e),{operation:"query"})}}})}var pi=new Map;function mi(e){var t=pi.get(e)||1;return pi.set(e,t+1),"".concat(e,":").concat(t,":").concat(Math.random().toString(36).slice(2))}function yi(e,t,r){var n=[];e.forEach((function(e){return e[t]&&n.push(e)})),n.forEach((function(e){return e[t](r)}))}function vi(e){function t(t){Object.defineProperty(e,t,{value:rr})}return Hr&&Symbol.species&&t(Symbol.species),t("@@species"),e}function gi(e){return e&&"function"==typeof e.then}var _i=function(e){function t(t){var r=e.call(this,(function(e){return r.addObserver(e),function(){return r.removeObserver(e)}}))||this;return r.observers=new Set,r.promise=new Promise((function(e,t){r.resolve=e,r.reject=t})),r.handlers={next:function(e){null!==r.sub&&(r.latest=["next",e],r.notify("next",e),yi(r.observers,"next",e))},error:function(e){var t=r.sub;null!==t&&(t&&setTimeout((function(){return t.unsubscribe()})),r.sub=null,r.latest=["error",e],r.reject(e),r.notify("error",e),yi(r.observers,"error",e))},complete:function(){var e=r,t=e.sub,n=e.sources;if(null!==t){var i=(void 0===n?[]:n).shift();i?gi(i)?i.then((function(e){return r.sub=e.subscribe(r.handlers)})):r.sub=i.subscribe(r.handlers):(t&&setTimeout((function(){return t.unsubscribe()})),r.sub=null,r.latest&&"next"===r.latest[0]?r.resolve(r.latest[1]):r.resolve(),r.notify("complete"),yi(r.observers,"complete"))}}},r.nextResultListeners=new Set,r.cancel=function(e){r.reject(e),r.sources=[],r.handlers.complete()},r.promise.catch((function(e){})),"function"==typeof t&&(t=[new rr(t)]),gi(t)?t.then((function(e){return r.start(e)}),r.handlers.error):r.start(t),r}return he(t,e),t.prototype.start=function(e){void 0===this.sub&&(this.sources=Array.from(e),this.handlers.complete())},t.prototype.deliverLastMessage=function(e){if(this.latest){var t=this.latest[0],r=e[t];r&&r.call(e,this.latest[1]),null===this.sub&&"next"===t&&e.complete&&e.complete()}},t.prototype.addObserver=function(e){this.observers.has(e)||(this.deliverLastMessage(e),this.observers.add(e))},t.prototype.removeObserver=function(e){this.observers.delete(e)&&this.observers.size<1&&this.handlers.complete()},t.prototype.notify=function(e,t){var r=this.nextResultListeners;r.size&&(this.nextResultListeners=new Set,r.forEach((function(r){return r(e,t)})))},t.prototype.beforeNext=function(e){var t=!1;this.nextResultListeners.add((function(r,n){t||(t=!0,e(r,n))}))},t}(rr);vi(_i);var bi,wi=function(e){function t(r){var n,i,o=r.graphQLErrors,s=r.clientErrors,a=r.networkError,c=r.errorMessage,u=r.extraInfo,l=e.call(this,c)||this;return l.name="ApolloError",l.graphQLErrors=o||[],l.clientErrors=s||[],l.networkError=a||null,l.message=c||(i="",(qn((n=l).graphQLErrors)||qn(n.clientErrors))&&(n.graphQLErrors||[]).concat(n.clientErrors||[]).forEach((function(e){var t=e?e.message:"Error message not found.";i+="".concat(t,"\n")})),n.networkError&&(i+="".concat(n.networkError.message,"\n")),i=i.replace(/\n$/,"")),l.extraInfo=u,l.__proto__=t.prototype,l}return he(t,e),t}(Error);function Ei(e){return!!e&&e<7}!function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(bi||(bi={}));var Si=Object.prototype.toString;function Oi(e){return Ii(e)}function Ii(e,t){switch(Si.call(e)){case"[object Array]":if((t=t||new Map).has(e))return t.get(e);var r=e.slice(0);return t.set(e,r),r.forEach((function(e,n){r[n]=Ii(e,t)})),r;case"[object Object]":if((t=t||new Map).has(e))return t.get(e);var n=Object.create(Object.getPrototypeOf(e));return t.set(e,n),Object.keys(e).forEach((function(r){n[r]=Ii(e[r],t)})),n;default:return e}}function Ti(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Object.create(null);return e.forEach((function(e){e&&Object.keys(e).forEach((function(t){var n=e[t];void 0!==n&&(r[t]=n)}))})),r}var ki=Object.assign,Ni=Object.hasOwnProperty,Di=function(e){function t(t){var r=t.queryManager,n=t.queryInfo,i=t.options,o=e.call(this,(function(e){try{var t=e._subscription._observer;t&&!t.error&&(t.error=Ri)}catch(e){}var r=!o.observers.size;o.observers.add(e);var n=o.last;return n&&n.error?e.error&&e.error(n.error):n&&n.result&&e.next&&e.next(n.result),r&&o.reobserve().catch((function(){})),function(){o.observers.delete(e)&&!o.observers.size&&o.tearDownQuery()}}))||this;o.observers=new Set,o.subscriptions=new Set,o.queryInfo=n,o.queryManager=r,o.isTornDown=!1;var s=r.defaultOptions.watchQuery,a=(void 0===s?{}:s).fetchPolicy,c=void 0===a?"cache-first":a,u=i.fetchPolicy,l=void 0===u?c:u,f=i.initialFetchPolicy,h=void 0===f?"standby"===l?c:l:f;o.options=de(de({},i),{initialFetchPolicy:h,fetchPolicy:l}),o.queryId=n.queryId||r.generateQueryId();var d=_r(o.query);return o.queryName=d&&d.name&&d.name.value,o}return he(t,e),Object.defineProperty(t.prototype,"query",{get:function(){return this.queryManager.transform(this.options.query).document},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var e=this;return new Promise((function(t,r){var n={next:function(r){t(r),e.observers.delete(n),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout((function(){i.unsubscribe()}),0)},error:r},i=e.subscribe(n)}))},t.prototype.getCurrentResult=function(e){void 0===e&&(e=!0);var t=this.getLastResult(!0),r=this.queryInfo.networkStatus||t&&t.networkStatus||bi.ready,n=de(de({},t),{loading:Ei(r),networkStatus:r}),i=this.options.fetchPolicy,o=void 0===i?"cache-first":i;if("network-only"===o||"no-cache"===o||"standby"===o||this.queryManager.transform(this.options.query).hasForcedResolvers);else{var s=this.queryInfo.getDiff();(s.complete||this.options.returnPartialData)&&(n.data=s.result),xn(n.data,{})&&(n.data=void 0),s.complete?(delete n.partial,!s.complete||n.networkStatus!==bi.loading||"cache-first"!==o&&"cache-only"!==o||(n.networkStatus=bi.ready,n.loading=!1)):n.partial=!0,!__DEV__||s.complete||this.options.partialRefetch||n.loading||n.data||n.error||xi(s.missing)}return e&&this.updateLastResult(n),n},t.prototype.isDifferentFromLastResult=function(e,t){return!this.last||!xn(this.last.result,e)||t&&!xn(this.last.variables,t)},t.prototype.getLast=function(e,t){var r=this.last;if(r&&r[e]&&(!t||xn(r.variables,this.variables)))return r[e]},t.prototype.getLastResult=function(e){return this.getLast("result",e)},t.prototype.getLastError=function(e){return this.getLast("error",e)},t.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(e){var t,r={pollInterval:0},n=this.options.fetchPolicy;if(r.fetchPolicy="cache-and-network"===n?n:"no-cache"===n?"no-cache":"network-only",__DEV__&&e&&Ni.call(e,"variables")){var i=Er(this.query),o=i.variableDefinitions;o&&o.some((function(e){return"variables"===e.variable.name.value}))||__DEV__&&gt.warn("Called refetch(".concat(JSON.stringify(e),") for query ").concat((null===(t=i.name)||void 0===t?void 0:t.value)||JSON.stringify(i),", which does not declare a $variables variable.\nDid you mean to call refetch(variables) instead of refetch({ variables })?"))}return e&&!xn(this.options.variables,e)&&(r.variables=this.options.variables=de(de({},this.options.variables),e)),this.queryInfo.resetLastWrite(),this.reobserve(r,bi.refetch)},t.prototype.fetchMore=function(e){var t=this,r=de(de({},e.query?e:de(de(de(de({},this.options),{query:this.query}),e),{variables:de(de({},this.options.variables),e.variables)})),{fetchPolicy:"no-cache"}),n=this.queryManager.generateQueryId(),i=this.queryInfo,o=i.networkStatus;i.networkStatus=bi.fetchMore,r.notifyOnNetworkStatusChange&&this.observe();var s=new Set;return this.queryManager.fetchQuery(n,r,bi.fetchMore).then((function(a){return t.queryManager.removeQuery(n),i.networkStatus===bi.fetchMore&&(i.networkStatus=o),t.queryManager.cache.batch({update:function(n){var i=e.updateQuery;i?n.updateQuery({query:t.query,variables:t.variables,returnPartialData:!0,optimistic:!1},(function(e){return i(e,{fetchMoreResult:a.data,variables:r.variables})})):n.writeQuery({query:r.query,variables:r.variables,data:a.data})},onWatchUpdated:function(e){s.add(e.query)}}),a})).finally((function(){s.has(t.query)||Ai(t)}))},t.prototype.subscribeToMore=function(e){var t=this,r=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:function(r){var n=e.updateQuery;n&&t.updateQuery((function(e,t){var i=t.variables;return n(e,{subscriptionData:r,variables:i})}))},error:function(t){e.onError?e.onError(t):__DEV__&&gt.error("Unhandled GraphQL subscription error",t)}});return this.subscriptions.add(r),function(){t.subscriptions.delete(r)&&r.unsubscribe()}},t.prototype.setOptions=function(e){return this.reobserve(e)},t.prototype.setVariables=function(e){return xn(this.variables,e)?this.observers.size?this.result():Promise.resolve():(this.options.variables=e,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:e},bi.setVariables):Promise.resolve())},t.prototype.updateQuery=function(e){var t=this.queryManager,r=e(t.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,{variables:this.variables});r&&(t.cache.writeQuery({query:this.options.query,data:r,variables:this.variables}),t.broadcastQueries())},t.prototype.startPolling=function(e){this.options.pollInterval=e,this.updatePolling()},t.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},t.prototype.applyNextFetchPolicy=function(e,t){if(t.nextFetchPolicy){var r=t.fetchPolicy,n=void 0===r?"cache-first":r,i=t.initialFetchPolicy,o=void 0===i?n:i;"standby"===n||("function"==typeof t.nextFetchPolicy?t.fetchPolicy=t.nextFetchPolicy(n,{reason:e,options:t,observable:this,initialFetchPolicy:o}):t.fetchPolicy="variables-changed"===e?o:t.nextFetchPolicy)}return t.fetchPolicy},t.prototype.fetch=function(e,t){return this.queryManager.setObservableQuery(this),this.queryManager.fetchQueryObservable(this.queryId,e,t)},t.prototype.updatePolling=function(){var e=this;if(!this.queryManager.ssrMode){var t=this.pollingInfo,r=this.options.pollInterval;if(r){if(!t||t.interval!==r){__DEV__?gt(r,"Attempted to start a polling query without a polling interval."):gt(r,13),(t||(this.pollingInfo={})).interval=r;var n=function(){e.pollingInfo&&(Ei(e.queryInfo.networkStatus)?i():e.reobserve({fetchPolicy:"no-cache"===e.options.initialFetchPolicy?"no-cache":"network-only"},bi.poll).then(i,i))},i=function(){var t=e.pollingInfo;t&&(clearTimeout(t.timeout),t.timeout=setTimeout(n,t.interval))};i()}}else t&&(clearTimeout(t.timeout),delete this.pollingInfo)}},t.prototype.updateLastResult=function(e,t){return void 0===t&&(t=this.variables),this.last=de(de({},this.last),{result:this.queryManager.assumeImmutableResults?e:Oi(e),variables:t}),qn(e.errors)||delete this.last.error,this.last},t.prototype.reobserve=function(e,t){var r=this;this.isTornDown=!1;var n=t===bi.refetch||t===bi.fetchMore||t===bi.poll,i=this.options.variables,o=this.options.fetchPolicy,s=Ti(this.options,e||{}),a=n?s:ki(this.options,s);n||(this.updatePolling(),e&&e.variables&&!xn(e.variables,i)&&"standby"!==a.fetchPolicy&&a.fetchPolicy===o&&(this.applyNextFetchPolicy("variables-changed",a),void 0===t&&(t=bi.setVariables)));var c=a.variables&&de({},a.variables),u=this.fetch(a,t),l={next:function(e){r.reportResult(e,c)},error:function(e){r.reportError(e,c)}};return n||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=u,this.observer=l),u.addObserver(l),u.promise},t.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},t.prototype.reportResult=function(e,t){var r=this.getLastError();(r||this.isDifferentFromLastResult(e,t))&&((r||!e.partial||this.options.returnPartialData)&&this.updateLastResult(e,t),yi(this.observers,"next",e))},t.prototype.reportError=function(e,t){var r=de(de({},this.getLastResult()),{error:e,errors:e.graphQLErrors,networkStatus:bi.error,loading:!1});this.updateLastResult(r,t),yi(this.observers,"error",this.last.error=e)},t.prototype.hasObservers=function(){return this.observers.size>0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t}(rr);function Ai(e){var t=e.options,r=t.fetchPolicy,n=t.nextFetchPolicy;return"cache-and-network"===r||"network-only"===r?e.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(){return this.nextFetchPolicy=n,"function"==typeof n?n.apply(this,arguments):r}}):e.reobserve()}function Ri(e){__DEV__&&gt.error("Unhandled error",e.message,e.stack)}function xi(e){__DEV__&&e&&__DEV__&&gt.debug("Missing cache result fields: ".concat(JSON.stringify(e)),e)}function Pi(e){return e.kind===Mr.FIELD||e.kind===Mr.FRAGMENT_SPREAD||e.kind===Mr.INLINE_FRAGMENT}vi(Di);var $i=null,Ci={},ji=1;function Mi(e){try{return e()}catch(e){}}var Fi="@wry/context:Slot",qi=Mi((function(){return globalThis}))||Mi((function(){return o.g}))||Object.create(null),Vi=qi[Fi]||Array[Fi]||function(e){try{Object.defineProperty(qi,Fi,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}}(function(){function e(){this.id=["slot",ji++,Date.now(),Math.random().toString(36).slice(2)].join(":")}return e.prototype.hasValue=function(){for(var e=$i;e;e=e.parent)if(this.id in e.slots){var t=e.slots[this.id];if(t===Ci)break;return e!==$i&&($i.slots[this.id]=t),!0}return $i&&($i.slots[this.id]=Ci),!1},e.prototype.getValue=function(){if(this.hasValue())return $i.slots[this.id]},e.prototype.withValue=function(e,t,r,n){var i,o=((i={__proto__:null})[this.id]=e,i),s=$i;$i={parent:s,slots:o};try{return t.apply(n,r)}finally{$i=s}},e.bind=function(e){var t=$i;return function(){var r=$i;try{return $i=t,e.apply(this,arguments)}finally{$i=r}}},e.noContext=function(e,t,r){if(!$i)return e.apply(r,t);var n=$i;try{return $i=null,e.apply(r,t)}finally{$i=n}},e}());function Li(){}Vi.bind,Vi.noContext;var Ui,Qi=function(){function e(e,t){void 0===e&&(e=1/0),void 0===t&&(t=Li),this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}return e.prototype.has=function(e){return this.map.has(e)},e.prototype.get=function(e){var t=this.getNode(e);return t&&t.value},e.prototype.getNode=function(e){var t=this.map.get(e);if(t&&t!==this.newest){var r=t.older,n=t.newer;n&&(n.older=r),r&&(r.newer=n),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=n)}return t},e.prototype.set=function(e,t){var r=this.getNode(e);return r?r.value=t:(r={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.map.set(e,r),r.value)},e.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},e.prototype.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)},e}(),Bi=new Vi,zi=Object.prototype.hasOwnProperty,Yi=void 0===(Ui=Array.from)?function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t}:Ui;function Ki(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var Hi=[],Gi=100;function Wi(e,t){if(!e)throw new Error(t||"assertion failure")}function Ji(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}var Zi=function(){function e(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++e.count}return e.prototype.peek=function(){if(1===this.value.length&&!to(this))return Xi(this),this.value[0]},e.prototype.recompute=function(e){return Wi(!this.recomputing,"already recomputing"),Xi(this),to(this)?function(e,t){return co(e),Bi.withValue(e,eo,[e,t]),function(e,t){if("function"==typeof e.subscribe)try{Ki(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(t){return e.setDirty(),!1}return!0}(e,t)&&function(e){e.dirty=!1,to(e)||no(e)}(e),Ji(e.value)}(this,e):Ji(this.value)},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,ro(this),Ki(this))},e.prototype.dispose=function(){var e=this;this.setDirty(),co(this),io(this,(function(t,r){t.setDirty(),uo(t,e)}))},e.prototype.forget=function(){this.dispose()},e.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=Hi.pop()||new Set),this.deps.add(e)},e.prototype.forgetDeps=function(){var e=this;this.deps&&(Yi(this.deps).forEach((function(t){return t.delete(e)})),this.deps.clear(),Hi.push(this.deps),this.deps=null)},e.count=0,e}();function Xi(e){var t=Bi.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),to(e)?oo(t,e):so(t,e),t}function eo(e,t){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,t)}catch(t){e.value[1]=t}e.recomputing=!1}function to(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function ro(e){io(e,oo)}function no(e){io(e,so)}function io(e,t){var r=e.parents.size;if(r)for(var n=Yi(e.parents),i=0;i<r;++i)t(n[i],e)}function oo(e,t){Wi(e.childValues.has(t)),Wi(to(t));var r=!to(e);if(e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=Hi.pop()||new Set;e.dirtyChildren.add(t),r&&ro(e)}function so(e,t){Wi(e.childValues.has(t)),Wi(!to(t));var r,n,i,o=e.childValues.get(t);0===o.length?e.childValues.set(t,t.value.slice(0)):(r=o,n=t.value,(i=r.length)>0&&i===n.length&&r[i-1]===n[i-1]||e.setDirty()),ao(e,t),to(e)||no(e)}function ao(e,t){var r=e.dirtyChildren;r&&(r.delete(t),0===r.size&&(Hi.length<Gi&&Hi.push(r),e.dirtyChildren=null))}function co(e){e.childValues.size>0&&e.childValues.forEach((function(t,r){uo(e,r)})),e.forgetDeps(),Wi(null===e.dirtyChildren)}function uo(e,t){t.parents.delete(e),e.childValues.delete(t),ao(e,t)}var lo={setDirty:!0,dispose:!0,forget:!0};function fo(e){var t=new Map,r=e&&e.subscribe;function n(e){var n=Bi.getValue();if(n){var i=t.get(e);i||t.set(e,i=new Set),n.dependOn(i),"function"==typeof r&&(Ki(i),i.unsubscribe=r(e))}}return n.dirty=function(e,r){var n=t.get(e);if(n){var i=r&&zi.call(lo,r)?r:"setDirty";Yi(n).forEach((function(e){return e[i]()})),t.delete(e),Ki(n)}},n}function ho(){var e=new Xn("function"==typeof WeakMap);return function(){return e.lookupArray(arguments)}}ho();var po=new Set;function mo(e,t){void 0===t&&(t=Object.create(null));var r=new Qi(t.max||Math.pow(2,16),(function(e){return e.dispose()})),n=t.keyArgs,i=t.makeCacheKey||ho(),o=function(){var o=i.apply(null,n?n.apply(null,arguments):arguments);if(void 0===o)return e.apply(null,arguments);var s=r.get(o);s||(r.set(o,s=new Zi(e)),s.subscribe=t.subscribe,s.forget=function(){return r.delete(o)});var a=s.recompute(Array.prototype.slice.call(arguments));return r.set(o,s),po.add(r),Bi.hasValue()||(po.forEach((function(e){return e.clean()})),po.clear()),a};function s(e){var t=r.get(e);t&&t.setDirty()}function a(e){var t=r.get(e);if(t)return t.peek()}function c(e){return r.delete(e)}return Object.defineProperty(o,"size",{get:function(){return r.map.size},configurable:!1,enumerable:!1}),o.dirtyKey=s,o.dirty=function(){s(i.apply(null,arguments))},o.peekKey=a,o.peek=function(){return a(i.apply(null,arguments))},o.forgetKey=c,o.forget=function(){return c(i.apply(null,arguments))},o.makeCacheKey=i,o.getKey=n?function(){return i.apply(null,n.apply(null,arguments))}:i,Object.freeze(o)}var yo=new Vi,vo=new WeakMap;function go(e){var t=vo.get(e);return t||vo.set(e,t={vars:new Set,dep:fo()}),t}function _o(e){go(e).vars.forEach((function(t){return t.forgetCache(e)}))}function bo(e){var t=new Set,r=new Set,n=function(o){if(arguments.length>0){if(e!==o){e=o,t.forEach((function(e){go(e).dep.dirty(n),function(e){e.broadcastWatches&&e.broadcastWatches()}(e)}));var s=Array.from(r);r.clear(),s.forEach((function(t){return t(e)}))}}else{var a=yo.getValue();a&&(i(a),go(a).dep(n))}return e};n.onNextChange=function(e){return r.add(e),function(){r.delete(e)}};var i=n.attachCache=function(e){return t.add(e),go(e).vars.add(n),n};return n.forgetCache=function(e){return t.delete(e)},n}var wo=function(){function e(e){var t=e.cache,r=e.client,n=e.resolvers,i=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=t,r&&(this.client=r),n&&this.addResolvers(n),i&&this.setFragmentMatcher(i)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach((function(e){t.resolvers=Ln(t.resolvers,e)})):this.resolvers=Ln(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){var t=e.document,r=e.remoteResult,n=e.context,i=e.variables,o=e.onlyRunForcedResolvers,s=void 0!==o&&o;return me(this,void 0,void 0,(function(){return ye(this,(function(e){return t?[2,this.resolveDocument(t,r.data,n,i,this.fragmentMatcher,s).then((function(e){return de(de({},r),{data:e.result})}))]:[2,r]}))}))},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return Qr(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return function(e){return gr(e),li([{test:function(e){return"client"===e.name.value},remove:!0}],e)}(e)},e.prototype.prepareContext=function(e){var t=this.cache;return de(de({},e),{cache:t,getCacheKey:function(e){return t.identify(e)}})},e.prototype.addExportedVariables=function(e,t,r){return void 0===t&&(t={}),void 0===r&&(r={}),me(this,void 0,void 0,(function(){return ye(this,(function(n){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(r),t).then((function(e){return de(de({},t),e.exportedVariables)}))]:[2,de({},t)]}))}))},e.prototype.shouldForceResolvers=function(e){var t=!1;return Vr(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some((function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value}))))return qr}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:di(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t,r,n,i,o){return void 0===r&&(r={}),void 0===n&&(n={}),void 0===i&&(i=function(){return!0}),void 0===o&&(o=!1),me(this,void 0,void 0,(function(){var s,a,c,u,l,f,h,d,p,m;return ye(this,(function(y){return s=Sr(e),a=wr(e),c=or(a),u=this.collectSelectionsToResolve(s,c),l=s.operation,f=l?l.charAt(0).toUpperCase()+l.slice(1):"Query",d=(h=this).cache,p=h.client,m={fragmentMap:c,context:de(de({},r),{cache:d,client:p}),variables:n,fragmentMatcher:i,defaultOperationType:f,exportedVariables:{},selectionsToResolve:u,onlyRunForcedResolvers:o},[2,this.resolveSelectionSet(s.selectionSet,!1,t,m).then((function(e){return{result:e,exportedVariables:m.exportedVariables}}))]}))}))},e.prototype.resolveSelectionSet=function(e,t,r,n){return me(this,void 0,void 0,(function(){var i,o,s,a,c,u=this;return ye(this,(function(l){return i=n.fragmentMap,o=n.context,s=n.variables,a=[r],c=function(e){return me(u,void 0,void 0,(function(){var c,u;return ye(this,(function(l){return(t||n.selectionsToResolve.has(e))&&Ur(e,s)?vr(e)?[2,this.resolveField(e,t,r,n).then((function(t){var r;void 0!==t&&a.push(((r={})[mr(e)]=t,r))}))]:(function(e){return"InlineFragment"===e.kind}(e)?c=e:(c=i[e.name.value],__DEV__?gt(c,"No fragment named ".concat(e.name.value)):gt(c,11)),c&&c.typeCondition&&(u=c.typeCondition.name.value,n.fragmentMatcher(r,u,o))?[2,this.resolveSelectionSet(c.selectionSet,t,r,n).then((function(e){a.push(e)}))]:[2]):[2]}))}))},[2,Promise.all(e.selections.map(c)).then((function(){return Un(a)}))]}))}))},e.prototype.resolveField=function(e,t,r,n){return me(this,void 0,void 0,(function(){var i,o,s,a,c,u,l,f,h,d=this;return ye(this,(function(p){return r?(i=n.variables,o=e.name.value,s=mr(e),a=o!==s,c=r[s]||r[o],u=Promise.resolve(c),n.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(l=r.__typename||n.defaultOperationType,(f=this.resolvers&&this.resolvers[l])&&(h=f[a?o:s])&&(u=Promise.resolve(yo.withValue(this.cache,h,[r,pr(e,i),n.context,{field:e,fragmentMap:n.fragmentMap}])))),[2,u.then((function(r){var i,o;if(void 0===r&&(r=c),e.directives&&e.directives.forEach((function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach((function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(n.exportedVariables[e.value.value]=r)}))})),!e.selectionSet)return r;if(null==r)return r;var s=null!==(o=null===(i=e.directives)||void 0===i?void 0:i.some((function(e){return"client"===e.name.value})))&&void 0!==o&&o;return Array.isArray(r)?d.resolveSubSelectedArray(e,t||s,r,n):e.selectionSet?d.resolveSelectionSet(e.selectionSet,t||s,r,n):void 0}))]):[2,null]}))}))},e.prototype.resolveSubSelectedArray=function(e,t,r,n){var i=this;return Promise.all(r.map((function(r){return null===r?null:Array.isArray(r)?i.resolveSubSelectedArray(e,t,r,n):e.selectionSet?i.resolveSelectionSet(e.selectionSet,t,r,n):void 0})))},e.prototype.collectSelectionsToResolve=function(e,t){var r=function(e){return!Array.isArray(e)},n=this.selectionsToResolveCache;return function e(i){if(!n.has(i)){var o=new Set;n.set(i,o),Vr(i,{Directive:function(e,t,n,i,s){"client"===e.name.value&&s.forEach((function(e){r(e)&&Pi(e)&&o.add(e)}))},FragmentSpread:function(n,i,s,a,c){var u=t[n.name.value];__DEV__?gt(u,"No fragment named ".concat(n.name.value)):gt(u,12);var l=e(u);l.size>0&&(c.forEach((function(e){r(e)&&Pi(e)&&o.add(e)})),o.add(n),l.forEach((function(e){o.add(e)})))}})}return n.get(i)}(e)},e}(),Eo=new(Yr?WeakMap:Map);function So(e,t){var r=e[t];"function"==typeof r&&(e[t]=function(){return Eo.set(e,(Eo.get(e)+1)%1e15),r.apply(this,arguments)})}function Oo(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var Io=function(){function e(e,t){void 0===t&&(t=e.generateQueryId()),this.queryId=t,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var r=this.cache=e.cache;Eo.has(r)||(Eo.set(r,0),So(r,"evict"),So(r,"modify"),So(r,"reset"))}return e.prototype.init=function(e){var t=e.networkStatus||bi.loading;return this.variables&&this.networkStatus!==bi.loading&&!xn(this.variables,e.variables)&&(t=bi.setVariables),xn(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},e.prototype.reset=function(){Oo(this),this.dirty=!1},e.prototype.getDiff=function(e){void 0===e&&(e=this.variables);var t=this.getDiffOptions(e);if(this.lastDiff&&xn(t,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=e);var r=this.observableQuery;if(r&&"no-cache"===r.options.fetchPolicy)return{complete:!1};var n=this.cache.diff(t);return this.updateLastDiff(n,t),n},e.prototype.updateLastDiff=function(e,t){this.lastDiff=e?{diff:e,options:t||this.getDiffOptions()}:void 0},e.prototype.getDiffOptions=function(e){var t;return void 0===e&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:null===(t=this.observableQuery)||void 0===t?void 0:t.options.canonizeResults}},e.prototype.setDiff=function(e){var t=this,r=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),this.dirty||xn(r&&r.result,e&&e.result)||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout((function(){return t.notify()}),0)))},e.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){t.getDiff().fromOptimisticTransaction?e.observe():Ai(e)})):delete this.oqListener)},e.prototype.notify=function(){var e=this;Oo(this),this.shouldNotify()&&this.listeners.forEach((function(t){return t(e)})),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(Ei(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if("cache-only"!==e&&"cache-and-network"!==e)return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=e.prototype.cancel,this.subscriptions.forEach((function(e){return e.unsubscribe()}));var t=this.observableQuery;t&&t.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(e){var t=this;void 0===e&&(e=this.variables);var r=this.observableQuery;if(!r||"no-cache"!==r.options.fetchPolicy){var n=de(de({},this.getDiffOptions(e)),{watcher:this,callback:function(e){return t.setDiff(e)}});this.lastWatch&&xn(n,this.lastWatch)||(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=n))}},e.prototype.resetLastWrite=function(){this.lastWrite=void 0},e.prototype.shouldWrite=function(e,t){var r=this.lastWrite;return!(r&&r.dmCount===Eo.get(this.cache)&&xn(t,r.variables)&&xn(e.data,r.result.data))},e.prototype.markResult=function(e,t,r,n){var i=this,o=new Bn,s=qn(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&qn(e.incremental)){var a=Yn(this.getDiff().result,e);e.data=a}else if("hasNext"in e&&e.hasNext){var c=this.getDiff();e.data=o.merge(c.result,e.data)}this.graphQLErrors=s,"no-cache"===r.fetchPolicy?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(r.variables)):0!==n&&(To(e,r.errorPolicy)?this.cache.performTransaction((function(o){if(i.shouldWrite(e,r.variables))o.writeQuery({query:t,data:e.data,variables:r.variables,overwrite:1===n}),i.lastWrite={result:e,variables:r.variables,dmCount:Eo.get(i.cache)};else if(i.lastDiff&&i.lastDiff.diff.complete)return void(e.data=i.lastDiff.diff.result);var s=i.getDiffOptions(r.variables),a=o.diff(s);i.stopped||i.updateWatch(r.variables),i.updateLastDiff(a,s),a.complete&&(e.data=a.result)})):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=bi.ready},e.prototype.markError=function(e){return this.networkStatus=bi.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},e}();function To(e,t){void 0===t&&(t="none");var r="ignore"===t||"all"===t,n=!ii(e);return!n&&r&&e.data&&(n=!0),n}var ko=Object.prototype.hasOwnProperty,No=function(){function e(e){var t=e.cache,r=e.link,n=e.defaultOptions,i=e.queryDeduplication,o=void 0!==i&&i,s=e.onBroadcast,a=e.ssrMode,c=void 0!==a&&a,u=e.clientAwareness,l=void 0===u?{}:u,f=e.localState,h=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(Yr?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=t,this.link=r,this.defaultOptions=n||Object.create(null),this.queryDeduplication=o,this.clientAwareness=l,this.localState=f||new wo({cache:t}),this.ssrMode=c,this.assumeImmutableResults=!!h,(this.onBroadcast=s)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var e=this;this.queries.forEach((function(t,r){e.stopQueryNoBroadcast(r)})),this.cancelPendingFetches(__DEV__?new vt("QueryManager stopped while query was in flight"):new vt(14))},e.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach((function(t){return t(e)})),this.fetchCancelFns.clear()},e.prototype.mutate=function(e){var t,r,n=e.mutation,i=e.variables,o=e.optimisticResponse,s=e.updateQueries,a=e.refetchQueries,c=void 0===a?[]:a,u=e.awaitRefetchQueries,l=void 0!==u&&u,f=e.update,h=e.onQueryUpdated,d=e.fetchPolicy,p=void 0===d?(null===(t=this.defaultOptions.mutate)||void 0===t?void 0:t.fetchPolicy)||"network-only":d,m=e.errorPolicy,y=void 0===m?(null===(r=this.defaultOptions.mutate)||void 0===r?void 0:r.errorPolicy)||"none":m,v=e.keepRootFields,g=e.context;return me(this,void 0,void 0,(function(){var e,t,r,a,u,d;return ye(this,(function(m){switch(m.label){case 0:return __DEV__?gt(n,"mutation option is required. You must specify your GraphQL document in the mutation option."):gt(n,15),__DEV__?gt("network-only"===p||"no-cache"===p,"Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):gt("network-only"===p||"no-cache"===p,16),e=this.generateMutationId(),t=this.transform(n),r=t.document,a=t.hasClientExports,n=this.cache.transformForLink(r),i=this.getVariables(n,i),a?[4,this.localState.addExportedVariables(n,i,g)]:[3,2];case 1:i=m.sent(),m.label=2;case 2:return u=this.mutationStore&&(this.mutationStore[e]={mutation:n,variables:i,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:e,document:n,variables:i,fetchPolicy:p,errorPolicy:y,context:g,updateQueries:s,update:f,keepRootFields:v}),this.broadcastQueries(),d=this,[2,new Promise((function(t,r){return ni(d.getObservableFromLink(n,de(de({},g),{optimisticResponse:o}),i,!1),(function(t){if(ii(t)&&"none"===y)throw new wi({graphQLErrors:oi(t)});u&&(u.loading=!1,u.error=null);var r=de({},t);return"function"==typeof c&&(c=c(r)),"ignore"===y&&ii(r)&&delete r.errors,d.markMutationResult({mutationId:e,result:r,document:n,variables:i,fetchPolicy:p,errorPolicy:y,context:g,update:f,updateQueries:s,awaitRefetchQueries:l,refetchQueries:c,removeOptimistic:o?e:void 0,onQueryUpdated:h,keepRootFields:v})})).subscribe({next:function(e){d.broadcastQueries(),"hasNext"in e&&!1!==e.hasNext||t(e)},error:function(t){u&&(u.loading=!1,u.error=t),o&&d.cache.removeOptimistic(e),d.broadcastQueries(),r(t instanceof wi?t:new wi({networkError:t}))}})}))]}}))}))},e.prototype.markMutationResult=function(e,t){var r=this;void 0===t&&(t=this.cache);var n=e.result,i=[],o="no-cache"===e.fetchPolicy;if(!o&&To(n,e.errorPolicy)){if(zn(n)||i.push({result:n.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),zn(n)&&qn(n.incremental)){var s=t.diff({id:"ROOT_MUTATION",query:this.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),a=void 0;s.result&&(a=Yn(s.result,n)),void 0!==a&&(n.data=a,i.push({result:a,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var c=e.updateQueries;c&&this.queries.forEach((function(e,o){var s=e.observableQuery,a=s&&s.queryName;if(a&&ko.call(c,a)){var u=c[a],l=r.queries.get(o),f=l.document,h=l.variables,d=t.diff({query:f,variables:h,returnPartialData:!0,optimistic:!1}),p=d.result;if(d.complete&&p){var m=u(p,{mutationResult:n,queryName:f&&br(f)||void 0,queryVariables:h});m&&i.push({result:m,dataId:"ROOT_QUERY",query:f,variables:h})}}}))}if(i.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var u=[];if(this.refetchQueries({updateCache:function(t){o||i.forEach((function(e){return t.write(e)}));var s,a=e.update,c=!(zn(s=n)||function(e){return"hasNext"in e&&"data"in e}(s))||zn(n)&&!n.hasNext;if(a){if(!o){var u=t.diff({id:"ROOT_MUTATION",query:r.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});u.complete&&("incremental"in(n=de(de({},n),{data:u.result}))&&delete n.incremental,"hasNext"in n&&delete n.hasNext)}c&&a(t,n,{context:e.context,variables:e.variables})}o||e.keepRootFields||!c||t.modify({id:"ROOT_MUTATION",fields:function(e,t){var r=t.fieldName,n=t.DELETE;return"__typename"===r?e:n}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach((function(e){return u.push(e)})),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(u).then((function(){return n}))}return Promise.resolve(n)},e.prototype.markMutationOptimistic=function(e,t){var r=this,n="function"==typeof e?e(t.variables):e;return this.cache.recordOptimisticTransaction((function(e){try{r.markMutationResult(de(de({},t),{result:{data:n}}),e)}catch(e){__DEV__&&gt.error(e)}}),t.mutationId)},e.prototype.fetchQuery=function(e,t,r){return this.fetchQueryObservable(e,t,r).promise},e.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach((function(t,r){e[r]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}})),e},e.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},e.prototype.transform=function(e){var t=this.transformCache;if(!t.has(e)){var r=this.cache.transformDocument(e),n=li([hi],gr(r)),i=this.localState.clientQuery(r),o=n&&this.localState.serverQuery(n),s={document:r,hasClientExports:Br(r),hasForcedResolvers:this.localState.shouldForceResolvers(r),clientQuery:i,serverQuery:o,defaultVars:Or(_r(r)),asQuery:de(de({},r),{definitions:r.definitions.map((function(e){return"OperationDefinition"===e.kind&&"query"!==e.operation?de(de({},e),{operation:"query"}):e}))})},a=function(e){e&&!t.has(e)&&t.set(e,s)};a(e),a(r),a(i),a(o)}return t.get(e)},e.prototype.getVariables=function(e,t){return de(de({},this.transform(e).defaultVars),t)},e.prototype.watchQuery=function(e){void 0===(e=de(de({},e),{variables:this.getVariables(e.query,e.variables)})).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var t=new Io(this),r=new Di({queryManager:this,queryInfo:t,options:e});return this.queries.set(r.queryId,t),t.init({document:r.query,observableQuery:r,variables:r.variables}),r},e.prototype.query=function(e,t){var r=this;return void 0===t&&(t=this.generateQueryId()),__DEV__?gt(e.query,"query option is required. You must specify your GraphQL document in the query option."):gt(e.query,17),__DEV__?gt("Document"===e.query.kind,'You must wrap the query string in a "gql" tag.'):gt("Document"===e.query.kind,18),__DEV__?gt(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):gt(!e.returnPartialData,19),__DEV__?gt(!e.pollInterval,"pollInterval option only supported on watchQuery."):gt(!e.pollInterval,20),this.fetchQuery(t,e).finally((function(){return r.stopQuery(t)}))},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},e.prototype.clearStore=function(e){return void 0===e&&(e={discardWatches:!0}),this.cancelPendingFetches(__DEV__?new vt("Store reset while query was in flight (not completed in link chain)"):new vt(21)),this.queries.forEach((function(e){e.observableQuery?e.networkStatus=bi.loading:e.stop()})),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},e.prototype.getObservableQueries=function(e){var t=this;void 0===e&&(e="active");var r=new Map,n=new Map,i=new Set;return Array.isArray(e)&&e.forEach((function(e){var r;"string"==typeof e?n.set(e,!1):nr(r=e)&&"Document"===r.kind&&Array.isArray(r.definitions)?n.set(t.transform(e).document,!1):nr(e)&&e.query&&i.add(e)})),this.queries.forEach((function(t,i){var o=t.observableQuery,s=t.document;if(o){if("all"===e)return void r.set(i,o);var a=o.queryName;if("standby"===o.options.fetchPolicy||"active"===e&&!o.hasObservers())return;("active"===e||a&&n.has(a)||s&&n.has(s))&&(r.set(i,o),a&&n.set(a,!0),s&&n.set(s,!0))}})),i.size&&i.forEach((function(e){var n=mi("legacyOneTimeQuery"),i=t.getQuery(n).init({document:e.query,variables:e.variables}),o=new Di({queryManager:t,queryInfo:i,options:de(de({},e),{fetchPolicy:"network-only"})});gt(o.queryId===n),i.setObservableQuery(o),r.set(n,o)})),__DEV__&&n.size&&n.forEach((function(e,t){e||__DEV__&&gt.warn("Unknown query ".concat("string"==typeof t?"named ":"").concat(JSON.stringify(t,null,2)," requested in refetchQueries options.include array"))})),r},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var r=[];return this.getObservableQueries(e?"all":"active").forEach((function(n,i){var o=n.options.fetchPolicy;n.resetLastResults(),(e||"standby"!==o&&"cache-only"!==o)&&r.push(n.refetch()),t.getQuery(i).setDiff(null)})),this.broadcastQueries(),Promise.all(r)},e.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},e.prototype.startGraphQLSubscription=function(e){var t=this,r=e.query,n=e.fetchPolicy,i=e.errorPolicy,o=e.variables,s=e.context,a=void 0===s?{}:s;r=this.transform(r).document,o=this.getVariables(r,o);var c=function(e){return t.getObservableFromLink(r,a,e).map((function(o){if("no-cache"!==n&&(To(o,i)&&t.cache.write({query:r,result:o.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries()),ii(o))throw new wi({graphQLErrors:o.errors});return o}))};if(this.transform(r).hasClientExports){var u=this.localState.addExportedVariables(r,o,a).then(c);return new rr((function(e){var t=null;return u.then((function(r){return t=r.subscribe(e)}),e.error),function(){return t&&t.unsubscribe()}}))}return c(o)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach((function(e){return e.notify()}))},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,r,n){var i,o,s=this;void 0===n&&(n=null!==(i=null==t?void 0:t.queryDeduplication)&&void 0!==i?i:this.queryDeduplication);var a=this.transform(e).serverQuery;if(a){var c=this.inFlightLinkObservables,u=this.link,l={query:a,variables:r,operationName:br(a)||void 0,context:this.prepareContext(de(de({},t),{forceFetch:!n}))};if(t=l.context,n){var f=c.get(a)||new Map;c.set(a,f);var h=ti(r);if(!(o=f.get(h))){var d=new _i([Ar(u,l)]);f.set(h,o=d),d.beforeNext((function(){f.delete(h)&&f.size<1&&c.delete(a)}))}}else o=new _i([Ar(u,l)])}else o=new _i([rr.of({data:{}})]),t=this.prepareContext(t);var p=this.transform(e).clientQuery;return p&&(o=ni(o,(function(e){return s.localState.runResolvers({document:p,remoteResult:e,context:t,variables:r})}))),o},e.prototype.getResultsFromLink=function(e,t,r){var n=e.lastRequestId=this.generateRequestId(),i=this.cache.transformForLink(this.transform(e.document).document);return ni(this.getObservableFromLink(i,r.context,r.variables),(function(o){var s=oi(o),a=s.length>0;if(n>=e.lastRequestId){if(a&&"none"===r.errorPolicy)throw e.markError(new wi({graphQLErrors:s}));e.markResult(o,i,r,t),e.markReady()}var c={data:o.data,loading:!1,networkStatus:bi.ready};return a&&"ignore"!==r.errorPolicy&&(c.errors=s,c.networkStatus=bi.error),c}),(function(t){var r=t.hasOwnProperty("graphQLErrors")?t:new wi({networkError:t});throw n>=e.lastRequestId&&e.markError(r),r}))},e.prototype.fetchQueryObservable=function(e,t,r){var n=this;void 0===r&&(r=bi.loading);var i=this.transform(t.query).document,o=this.getVariables(i,t.variables),s=this.getQuery(e),a=this.defaultOptions.watchQuery,c=t.fetchPolicy,u=void 0===c?a&&a.fetchPolicy||"cache-first":c,l=t.errorPolicy,f=void 0===l?a&&a.errorPolicy||"none":l,h=t.returnPartialData,d=void 0!==h&&h,p=t.notifyOnNetworkStatusChange,m=void 0!==p&&p,y=t.context,v=void 0===y?{}:y,g=Object.assign({},t,{query:i,variables:o,fetchPolicy:u,errorPolicy:f,returnPartialData:d,notifyOnNetworkStatusChange:m,context:v}),_=function(e){g.variables=e;var i=n.fetchQueryByPolicy(s,g,r);return"standby"!==g.fetchPolicy&&i.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",t),i},b=function(){return n.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,(function(e){b(),setTimeout((function(){return w.cancel(e)}))}));var w=new _i(this.transform(g.query).hasClientExports?this.localState.addExportedVariables(g.query,g.variables,g.context).then(_):_(g.variables));return w.promise.then(b,b),w},e.prototype.refetchQueries=function(e){var t=this,r=e.updateCache,n=e.include,i=e.optimistic,o=void 0!==i&&i,s=e.removeOptimistic,a=void 0===s?o?mi("refetchQueries"):void 0:s,c=e.onQueryUpdated,u=new Map;n&&this.getObservableQueries(n).forEach((function(e,r){u.set(r,{oq:e,lastDiff:t.getQuery(r).getDiff()})}));var l=new Map;return r&&this.cache.batch({update:r,optimistic:o&&a||!1,removeOptimistic:a,onWatchUpdated:function(e,t,r){var n=e.watcher instanceof Io&&e.watcher.observableQuery;if(n){if(c){u.delete(n.queryId);var i=c(n,t,r);return!0===i&&(i=n.refetch()),!1!==i&&l.set(n,i),i}null!==c&&u.set(n.queryId,{oq:n,lastDiff:r,diff:t})}}}),u.size&&u.forEach((function(e,r){var n,i=e.oq,o=e.lastDiff,s=e.diff;if(c){if(!s){var a=i.queryInfo;a.reset(),s=a.getDiff()}n=c(i,s,o)}c&&!0!==n||(n=i.refetch()),!1!==n&&l.set(i,n),r.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(r)})),a&&this.cache.removeOptimistic(a),l},e.prototype.fetchQueryByPolicy=function(e,t,r){var n=this,i=t.query,o=t.variables,s=t.fetchPolicy,a=t.refetchWritePolicy,c=t.errorPolicy,u=t.returnPartialData,l=t.context,f=t.notifyOnNetworkStatusChange,h=e.networkStatus;e.init({document:this.transform(i).document,variables:o,networkStatus:r});var d=function(){return e.getDiff(o)},p=function(t,r){void 0===r&&(r=e.networkStatus||bi.loading);var s=t.result;!__DEV__||u||xn(s,{})||xi(t.missing);var a=function(e){return rr.of(de({data:e,loading:Ei(r),networkStatus:r},t.complete?null:{partial:!0}))};return s&&n.transform(i).hasForcedResolvers?n.localState.runResolvers({document:i,remoteResult:{data:s},context:l,variables:o,onlyRunForcedResolvers:!0}).then((function(e){return a(e.data||void 0)})):"none"===c&&r===bi.refetch&&Array.isArray(t.missing)?a(void 0):a(s)},m="no-cache"===s?0:r===bi.refetch&&"merge"!==a?1:2,y=function(){return n.getResultsFromLink(e,m,{variables:o,context:l,fetchPolicy:s,errorPolicy:c})},v=f&&"number"==typeof h&&h!==r&&Ei(r);switch(s){default:case"cache-first":return(g=d()).complete?[p(g,e.markReady())]:u||v?[p(g),y()]:[y()];case"cache-and-network":var g;return(g=d()).complete||u||v?[p(g),y()]:[y()];case"cache-only":return[p(d(),e.markReady())];case"network-only":return v?[p(d()),y()]:[y()];case"no-cache":return v?[p(e.getDiff()),y()]:[y()];case"standby":return[]}},e.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new Io(this,e)),this.queries.get(e)},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return de(de({},t),{clientAwareness:this.clientAwareness})},e}();function Do(e,t){return Ti(e,t,t.variables&&{variables:de(de({},e&&e.variables),t.variables)})}var Ao=!1,Ro=function(){function e(e){var t=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var r=e.uri,n=e.credentials,i=e.headers,o=e.cache,s=e.ssrMode,a=void 0!==s&&s,c=e.ssrForceFetchDelay,u=void 0===c?0:c,l=e.connectToDevTools,f=void 0===l?"object"==typeof window&&!window.__APOLLO_CLIENT__&&__DEV__:l,h=e.queryDeduplication,d=void 0===h||h,p=e.defaultOptions,m=e.assumeImmutableResults,y=void 0!==m&&m,v=e.resolvers,g=e.typeDefs,_=e.fragmentMatcher,b=e.name,w=e.version,E=e.link;if(E||(E=r?new Tn({uri:r,credentials:n,headers:i}):Dr.empty()),!o)throw __DEV__?new vt("To initialize Apollo Client, you must specify a 'cache' property in the options object. \nFor more information, please visit: https://go.apollo.dev/c/docs"):new vt(9);if(this.link=E,this.cache=o,this.disableNetworkFetches=a||u>0,this.queryDeduplication=d,this.defaultOptions=p||Object.create(null),this.typeDefs=g,u&&setTimeout((function(){return t.disableNetworkFetches=!1}),u),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),f&&"object"==typeof window&&(window.__APOLLO_CLIENT__=this),!Ao&&f&&__DEV__&&(Ao=!0,"undefined"!=typeof window&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var S=window.navigator,O=S&&S.userAgent,I=void 0;"string"==typeof O&&(O.indexOf("Chrome/")>-1?I="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":O.indexOf("Firefox/")>-1&&(I="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),I&&__DEV__&&gt.log("Download the Apollo DevTools for a better development experience: "+I)}this.version="3.7.9",this.localState=new wo({cache:o,client:this,resolvers:v,fragmentMatcher:_}),this.queryManager=new No({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:d,ssrMode:a,clientAwareness:{name:b,version:w},localState:this.localState,assumeImmutableResults:y,onBroadcast:f?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=Do(this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=de(de({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=Do(this.defaultOptions.query,e)),__DEV__?gt("cache-and-network"!==e.fetchPolicy,"The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):gt("cache-and-network"!==e.fetchPolicy,10),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=de(de({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Do(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){this.cache.writeQuery(e),this.queryManager.broadcastQueries()},e.prototype.writeFragment=function(e){this.cache.writeFragment(e),this.queryManager.broadcastQueries()},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return Ar(this.link,e)},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!1})})).then((function(){return Promise.all(e.resetStoreCallbacks.map((function(e){return e()})))})).then((function(){return e.reFetchObservableQueries()}))},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!0})})).then((function(){return Promise.all(e.clearStoreCallbacks.map((function(e){return e()})))}))},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),r=[],n=[];t.forEach((function(e,t){r.push(t),n.push(e)}));var i=Promise.all(n);return i.queries=r,i.results=n,i.catch((function(e){__DEV__&&gt.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(e))})),i},e.prototype.getObservableQueries=function(e){return void 0===e&&(e="active"),this.queryManager.getObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e.prototype.setLink=function(e){this.link=this.queryManager.link=e},e}(),xo=function(){function e(){this.getFragmentDoc=mo(ir)}return e.prototype.batch=function(e){var t,r=this,n="string"==typeof e.optimistic?e.optimistic:!1===e.optimistic?null:void 0;return this.performTransaction((function(){return t=e.update(r)}),n),t},e.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},e.prototype.transformDocument=function(e){return e},e.prototype.transformForLink=function(e){return e},e.prototype.identify=function(e){},e.prototype.gc=function(){return[]},e.prototype.modify=function(e){return!1},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read(de(de({},e),{rootId:e.id||"ROOT_QUERY",optimistic:t}))},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read(de(de({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:t}))},e.prototype.writeQuery=function(e){var t=e.id,r=e.data,n=pe(e,["id","data"]);return this.write(Object.assign(n,{dataId:t||"ROOT_QUERY",result:r}))},e.prototype.writeFragment=function(e){var t=e.id,r=e.data,n=e.fragment,i=e.fragmentName,o=pe(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(n,i),dataId:t,result:r}))},e.prototype.updateQuery=function(e,t){return this.batch({update:function(r){var n=r.readQuery(e),i=t(n);return null==i?n:(r.writeQuery(de(de({},e),{data:i})),i)}})},e.prototype.updateFragment=function(e,t){return this.batch({update:function(r){var n=r.readFragment(e),i=t(n);return null==i?n:(r.writeFragment(de(de({},e),{data:i})),i)}})},e}(),Po=function(e){function t(r,n,i,o){var s,a=e.call(this,r)||this;if(a.message=r,a.path=n,a.query=i,a.variables=o,Array.isArray(a.path)){a.missing=a.message;for(var c=a.path.length-1;c>=0;--c)a.missing=((s={})[a.path[c]]=a.missing,s)}else a.missing=a.path;return a.__proto__=t.prototype,a}return he(t,e),t}(Error);function $o(e){return __DEV__&&(t=e,(r=new Set([t])).forEach((function(e){nr(e)&&function(e){if(__DEV__&&!Object.isFrozen(e))try{Object.freeze(e)}catch(e){if(e instanceof TypeError)return null;throw e}return e}(e)===e&&Object.getOwnPropertyNames(e).forEach((function(t){nr(e[t])&&r.add(e[t])}))}))),e;var t,r}var Co=Object.prototype.hasOwnProperty;function jo(e){return null==e}function Mo(e,t){var r=e.__typename,n=e.id,i=e._id;if("string"==typeof r&&(t&&(t.keyObject=jo(n)?jo(i)?void 0:{_id:i}:{id:n}),jo(n)&&!jo(i)&&(n=i),!jo(n)))return"".concat(r,":").concat("number"==typeof n||"string"==typeof n?n:JSON.stringify(n))}var Fo={dataIdFromObject:Mo,addTypename:!0,resultCaching:!0,canonizeResults:!1};function qo(e){var t=e.canonizeResults;return void 0===t?Fo.canonizeResults:t}var Vo=/^[_a-z][_0-9a-z]*/i;function Lo(e){var t=e.match(Vo);return t?t[0]:e}function Uo(e,t,r){return!!nr(t)&&(Fn(t)?t.every((function(t){return Uo(e,t,r)})):e.selections.every((function(e){if(vr(e)&&Ur(e,r)){var n=mr(e);return Co.call(t,n)&&(!e.selectionSet||Uo(e.selectionSet,t[n],r))}return!0})))}function Qo(e){return nr(e)&&!cr(e)&&!Fn(e)}function Bo(e,t){var r=or(wr(e));return{fragmentMap:r,lookupFragment:function(e){var n=r[e];return!n&&t&&(n=t.lookup(e)),n||null}}}var zo=Object.create(null),Yo=function(){return zo},Ko=Object.create(null),Ho=function(){function e(e,t){var r=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(e,t){return $o(cr(e)?r.get(e.__ref,t):e&&e[t])},this.canRead=function(e){return cr(e)?r.has(e.__ref):"object"==typeof e},this.toReference=function(e,t){if("string"==typeof e)return ar(e);if(cr(e))return e;var n=r.policies.identify(e)[0];if(n){var i=ar(n);return t&&r.merge(n,e),i}}}return e.prototype.toObject=function(){return de({},this.data)},e.prototype.has=function(e){return void 0!==this.lookup(e,!0)},e.prototype.get=function(e,t){if(this.group.depend(e,t),Co.call(this.data,e)){var r=this.data[e];if(r&&Co.call(r,t))return r[t]}return"__typename"===t&&Co.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof Zo?this.parent.get(e,t):void 0},e.prototype.lookup=function(e,t){return t&&this.group.depend(e,"__exists"),Co.call(this.data,e)?this.data[e]:this instanceof Zo?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?Object.create(null):void 0},e.prototype.merge=function(e,t){var r,n=this;cr(e)&&(e=e.__ref),cr(t)&&(t=t.__ref);var i="string"==typeof e?this.lookup(r=e):e,o="string"==typeof t?this.lookup(r=t):t;if(o){__DEV__?gt("string"==typeof r,"store.merge expects a string ID"):gt("string"==typeof r,1);var s=new Bn(es).merge(i,o);if(this.data[r]=s,s!==i&&(delete this.refs[r],this.group.caching)){var a=Object.create(null);i||(a.__exists=1),Object.keys(o).forEach((function(e){if(!i||i[e]!==s[e]){a[e]=1;var t=Lo(e);t===e||n.policies.hasKeyArgs(s.__typename,t)||(a[t]=1),void 0!==s[e]||n instanceof Zo||delete s[e]}})),!a.__typename||i&&i.__typename||this.policies.rootTypenamesById[r]!==s.__typename||delete a.__typename,Object.keys(a).forEach((function(e){return n.group.dirty(r,e)}))}}},e.prototype.modify=function(e,t){var r=this,n=this.lookup(e);if(n){var i=Object.create(null),o=!1,s=!0,a={DELETE:zo,INVALIDATE:Ko,isReference:cr,toReference:this.toReference,canRead:this.canRead,readField:function(t,n){return r.policies.readField("string"==typeof t?{fieldName:t,from:n||ar(e)}:t,{store:r})}};if(Object.keys(n).forEach((function(c){var u=Lo(c),l=n[c];if(void 0!==l){var f="function"==typeof t?t:t[c]||t[u];if(f){var h=f===Yo?zo:f($o(l),de(de({},a),{fieldName:u,storeFieldName:c,storage:r.getStorage(e,c)}));h===Ko?r.group.dirty(e,c):(h===zo&&(h=void 0),h!==l&&(i[c]=h,o=!0,l=h))}void 0!==l&&(s=!1)}})),o)return this.merge(e,i),s&&(this instanceof Zo?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},e.prototype.delete=function(e,t,r){var n,i=this.lookup(e);if(i){var o=this.getFieldValue(i,"__typename"),s=t&&r?this.policies.getStoreFieldName({typename:o,fieldName:t,args:r}):t;return this.modify(e,s?((n={})[s]=Yo,n):Yo)}return!1},e.prototype.evict=function(e,t){var r=!1;return e.id&&(Co.call(this.data,e.id)&&(r=this.delete(e.id,e.fieldName,e.args)),this instanceof Zo&&this!==t&&(r=this.parent.evict(e,t)||r),(e.fieldName||r)&&this.group.dirty(e.id,e.fieldName||"__exists")),r},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var e=this,t=this.toObject(),r=[];return this.getRootIdSet().forEach((function(t){Co.call(e.policies.rootTypenamesById,t)||r.push(t)})),r.length&&(t.__META={extraRootIds:r.sort()}),t},e.prototype.replace=function(e){var t=this;if(Object.keys(this.data).forEach((function(r){e&&Co.call(e,r)||t.delete(r)})),e){var r=e.__META,n=pe(e,["__META"]);Object.keys(n).forEach((function(e){t.merge(e,n[e])})),r&&r.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},e.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},e.prototype.getRootIdSet=function(e){return void 0===e&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof Zo?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},e.prototype.gc=function(){var e=this,t=this.getRootIdSet(),r=this.toObject();t.forEach((function(n){Co.call(r,n)&&(Object.keys(e.findChildRefIds(n)).forEach(t.add,t),delete r[n])}));var n=Object.keys(r);if(n.length){for(var i=this;i instanceof Zo;)i=i.parent;n.forEach((function(e){return i.delete(e)}))}return n},e.prototype.findChildRefIds=function(e){if(!Co.call(this.refs,e)){var t=this.refs[e]=Object.create(null),r=this.data[e];if(!r)return t;var n=new Set([r]);n.forEach((function(e){cr(e)&&(t[e.__ref]=!0),nr(e)&&Object.keys(e).forEach((function(t){var r=e[t];nr(r)&&n.add(r)}))}))}return this.refs[e]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),Go=function(){function e(e,t){void 0===t&&(t=null),this.caching=e,this.parent=t,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?fo():null,this.keyMaker=new Xn(Yr)},e.prototype.depend=function(e,t){if(this.d){this.d(Wo(e,t));var r=Lo(t);r!==t&&this.d(Wo(e,r)),this.parent&&this.parent.depend(e,t)}},e.prototype.dirty=function(e,t){this.d&&this.d.dirty(Wo(e,t),"__exists"===t?"forget":"setDirty")},e}();function Wo(e,t){return t+"#"+e}function Jo(e,t){ts(e)&&e.group.depend(t,"__exists")}!function(e){var t=function(e){function t(t){var r=t.policies,n=t.resultCaching,i=void 0===n||n,o=t.seed,s=e.call(this,r,new Go(i))||this;return s.stump=new Xo(s),s.storageTrie=new Xn(Yr),o&&s.replace(o),s}return he(t,e),t.prototype.addLayer=function(e,t){return this.stump.addLayer(e,t)},t.prototype.removeLayer=function(){return this},t.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},t}(e);e.Root=t}(Ho||(Ho={}));var Zo=function(e){function t(t,r,n,i){var o=e.call(this,r.policies,i)||this;return o.id=t,o.parent=r,o.replay=n,o.group=i,n(o),o}return he(t,e),t.prototype.addLayer=function(e,r){return new t(e,this,r,this.group)},t.prototype.removeLayer=function(e){var t=this,r=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach((function(e){var n=t.data[e],i=r.lookup(e);i?n?n!==i&&Object.keys(n).forEach((function(r){xn(n[r],i[r])||t.group.dirty(e,r)})):(t.group.dirty(e,"__exists"),Object.keys(i).forEach((function(r){t.group.dirty(e,r)}))):t.delete(e)})),r):r===this.parent?this:r.addLayer(this.id,this.replay)},t.prototype.toObject=function(){return de(de({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(t){var r=this.parent.findChildRefIds(t);return Co.call(this.data,t)?de(de({},r),e.prototype.findChildRefIds.call(this,t)):r},t.prototype.getStorage=function(){for(var e=this.parent;e.parent;)e=e.parent;return e.getStorage.apply(e,arguments)},t}(Ho),Xo=function(e){function t(t){return e.call(this,"EntityStore.Stump",t,(function(){}),new Go(t.group.caching,t.group))||this}return he(t,e),t.prototype.removeLayer=function(){return this},t.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},t}(Zo);function es(e,t,r){var n=e[r],i=t[r];return xn(n,i)?n:i}function ts(e){return!!(e instanceof Ho&&e.group.caching)}function rs(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var ns=function(){function e(e){var t=this;this.knownResults=new(Yr?WeakMap:Map),this.config=Ti(e,{addTypename:!1!==e.addTypename,canonizeResults:qo(e)}),this.canon=e.canon||new ei,this.executeSelectionSet=mo((function(e){var r,n=e.context.canonizeResults,i=rs(e);i[3]=!n;var o=(r=t.executeSelectionSet).peek.apply(r,i);return o?n?de(de({},o),{result:t.canon.admit(o.result)}):o:(Jo(e.context.store,e.enclosingRef.__ref),t.execSelectionSetImpl(e))}),{max:this.config.resultCacheMaxSize,keyArgs:rs,makeCacheKey:function(e,t,r,n){if(ts(r.store))return r.store.makeCacheKey(e,cr(t)?t.__ref:t,r.varString,n)}}),this.executeSubSelectedArray=mo((function(e){return Jo(e.context.store,e.enclosingRef.__ref),t.execSubSelectedArrayImpl(e)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var t=e.field,r=e.array,n=e.context;if(ts(n.store))return n.store.makeCacheKey(t,r,n.varString)}})}return e.prototype.resetCanon=function(){this.canon=new ei},e.prototype.diffQueryAgainstStore=function(e){var t=e.store,r=e.query,n=e.rootId,i=void 0===n?"ROOT_QUERY":n,o=e.variables,s=e.returnPartialData,a=void 0===s||s,c=e.canonizeResults,u=void 0===c?this.config.canonizeResults:c,l=this.config.cache.policies;o=de(de({},Or(Er(r))),o);var f,h=ar(i),d=this.executeSelectionSet({selectionSet:Sr(r).selectionSet,objectOrReference:h,enclosingRef:h,context:de({store:t,query:r,policies:l,variables:o,varString:ti(o),canonizeResults:u},Bo(r,this.config.fragments))});if(d.missing&&(f=[new Po(is(d.missing),d.missing,r,o)],!a))throw f[0];return{result:d.result,complete:!f,missing:f}},e.prototype.isFresh=function(e,t,r,n){if(ts(n.store)&&this.knownResults.get(e)===r){var i=this.executeSelectionSet.peek(r,t,n,this.canon.isKnown(e));if(i&&e===i.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(e){var t=this,r=e.selectionSet,n=e.objectOrReference,i=e.enclosingRef,o=e.context;if(cr(n)&&!o.policies.rootTypenamesById[n.__ref]&&!o.store.has(n.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(n.__ref," object")};var s,a=o.variables,c=o.policies,u=o.store.getFieldValue(n,"__typename"),l=[],f=new Bn;function h(e,t){var r;return e.missing&&(s=f.merge(s,((r={})[t]=e.missing,r))),e.result}this.config.addTypename&&"string"==typeof u&&!c.rootIdsByTypename[u]&&l.push({__typename:u});var d=new Set(r.selections);d.forEach((function(e){var r,p;if(Ur(e,a))if(vr(e)){var m=c.readField({fieldName:e.name.value,field:e,variables:o.variables,from:n},o),y=mr(e);void 0===m?fi.added(e)||(s=f.merge(s,((r={})[y]="Can't find field '".concat(e.name.value,"' on ").concat(cr(n)?n.__ref+" object":"object "+JSON.stringify(n,null,2)),r))):Fn(m)?m=h(t.executeSubSelectedArray({field:e,array:m,enclosingRef:i,context:o}),y):e.selectionSet?null!=m&&(m=h(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:m,enclosingRef:cr(m)?m:i,context:o}),y)):o.canonizeResults&&(m=t.canon.pass(m)),void 0!==m&&l.push(((p={})[y]=m,p))}else{var v=sr(e,o.lookupFragment);if(!v&&e.kind===Mr.FRAGMENT_SPREAD)throw __DEV__?new vt("No fragment named ".concat(e.name.value)):new vt(5);v&&c.fragmentMatches(v,u)&&v.selectionSet.selections.forEach(d.add,d)}}));var p={result:Un(l),missing:s},m=o.canonizeResults?this.canon.admit(p):$o(p);return m.result&&this.knownResults.set(m.result,r),m},e.prototype.execSubSelectedArrayImpl=function(e){var t,r=this,n=e.field,i=e.array,o=e.enclosingRef,s=e.context,a=new Bn;function c(e,r){var n;return e.missing&&(t=a.merge(t,((n={})[r]=e.missing,n))),e.result}return n.selectionSet&&(i=i.filter(s.store.canRead)),i=i.map((function(e,t){return null===e?null:Fn(e)?c(r.executeSubSelectedArray({field:n,array:e,enclosingRef:o,context:s}),t):n.selectionSet?c(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:e,enclosingRef:cr(e)?e:o,context:s}),t):(__DEV__&&function(e,t,r){if(!t.selectionSet){var n=new Set([r]);n.forEach((function(r){nr(r)&&(__DEV__?gt(!cr(r),"Missing selection set for object of type ".concat(function(e,t){return cr(t)?e.get(t.__ref,"__typename"):t&&t.__typename}(e,r)," returned for query field ").concat(t.name.value)):gt(!cr(r),6),Object.values(r).forEach(n.add,n))}))}}(s.store,n,e),e)})),{result:s.canonizeResults?this.canon.admit(i):i,missing:t}},e}();function is(e){try{JSON.stringify(e,(function(e,t){if("string"==typeof t)throw t;return t}))}catch(e){return e}}var os=Object.create(null);function ss(e){var t=JSON.stringify(e);return os[t]||(os[t]=Object.create(null))}function as(e){var t=ss(e);return t.keyFieldsFn||(t.keyFieldsFn=function(t,r){var n=function(e,t){return r.readField(t,e)},i=r.keyObject=us(e,(function(e){var i=hs(r.storeObject,e,n);return void 0===i&&t!==r.storeObject&&Co.call(t,e[0])&&(i=hs(t,e,fs)),__DEV__?gt(void 0!==i,"Missing field '".concat(e.join("."),"' while extracting keyFields from ").concat(JSON.stringify(t))):gt(void 0!==i,2),i}));return"".concat(r.typename,":").concat(JSON.stringify(i))})}function cs(e){var t=ss(e);return t.keyArgsFn||(t.keyArgsFn=function(t,r){var n=r.field,i=r.variables,o=r.fieldName,s=us(e,(function(e){var r=e[0],o=r.charAt(0);if("@"!==o)if("$"!==o){if(t)return hs(t,e)}else{var s=r.slice(1);if(i&&Co.call(i,s)){var a=e.slice(0);return a[0]=s,hs(i,a)}}else if(n&&qn(n.directives)){var c=r.slice(1),u=n.directives.find((function(e){return e.name.value===c})),l=u&&pr(u,i);return l&&hs(l,e.slice(1))}})),a=JSON.stringify(s);return(t||"{}"!==a)&&(o+=":"+a),o})}function us(e,t){var r=new Bn;return ls(e).reduce((function(e,n){var i,o=t(n);if(void 0!==o){for(var s=n.length-1;s>=0;--s)(i={})[n[s]]=o,o=i;e=r.merge(e,o)}return e}),Object.create(null))}function ls(e){var t=ss(e);if(!t.paths){var r=t.paths=[],n=[];e.forEach((function(t,i){Fn(t)?(ls(t).forEach((function(e){return r.push(n.concat(e))})),n.length=0):(n.push(t),Fn(e[i+1])||(r.push(n.slice(0)),n.length=0))}))}return t.paths}function fs(e,t){return e[t]}function hs(e,t,r){return r=r||fs,ds(t.reduce((function e(t,n){return Fn(t)?t.map((function(t){return e(t,n)})):t&&r(t,n)}),e))}function ds(e){return nr(e)?Fn(e)?e.map(ds):us(Object.keys(e).sort(),(function(t){return hs(e,t)})):e}function ps(e){return void 0!==e.args?e.args:e.field?pr(e.field,e.variables):null}fr.setStringify(ti);var ms=function(){},ys=function(e,t){return t.fieldName},vs=function(e,t,r){return(0,r.mergeObjects)(e,t)},gs=function(e,t){return t},_s=function(){function e(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=de({dataIdFromObject:Mo},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return e.prototype.identify=function(e,t){var r,n=this,i=t&&(t.typename||(null===(r=t.storeObject)||void 0===r?void 0:r.__typename))||e.__typename;if(i===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o,s=t&&t.storeObject||e,a=de(de({},t),{typename:i,storeObject:s,readField:t&&t.readField||function(){var e=ws(arguments,s);return n.readField(e,{store:n.cache.data,variables:e.variables})}}),c=i&&this.getTypePolicy(i),u=c&&c.keyFn||this.config.dataIdFromObject;u;){var l=u(e,a);if(!Fn(l)){o=l;break}u=as(l)}return o=o?String(o):void 0,a.keyObject?[o,a.keyObject]:[o]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach((function(r){var n=e[r],i=n.queryType,o=n.mutationType,s=n.subscriptionType,a=pe(n,["queryType","mutationType","subscriptionType"]);i&&t.setRootTypename("Query",r),o&&t.setRootTypename("Mutation",r),s&&t.setRootTypename("Subscription",r),Co.call(t.toBeAdded,r)?t.toBeAdded[r].push(a):t.toBeAdded[r]=[a]}))},e.prototype.updateTypePolicy=function(e,t){var r=this,n=this.getTypePolicy(e),i=t.keyFields,o=t.fields;function s(e,t){e.merge="function"==typeof t?t:!0===t?vs:!1===t?gs:e.merge}s(n,t.merge),n.keyFn=!1===i?ms:Fn(i)?as(i):"function"==typeof i?i:n.keyFn,o&&Object.keys(o).forEach((function(t){var n=r.getFieldPolicy(e,t,!0),i=o[t];if("function"==typeof i)n.read=i;else{var a=i.keyArgs,c=i.read,u=i.merge;n.keyFn=!1===a?ys:Fn(a)?cs(a):"function"==typeof a?a:n.keyFn,"function"==typeof c&&(n.read=c),s(n,u)}n.read&&n.merge&&(n.keyFn=n.keyFn||ys)}))},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var r="ROOT_"+e.toUpperCase(),n=this.rootTypenamesById[r];t!==n&&(__DEV__?gt(!n||n===e,"Cannot change root ".concat(e," __typename more than once")):gt(!n||n===e,3),n&&delete this.rootIdsByTypename[n],this.rootIdsByTypename[t]=r,this.rootTypenamesById[r]=t)},e.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach((function(r){t.getSupertypeSet(r,!0),e[r].forEach((function(e){t.getSupertypeSet(e,!0).add(r);var n=e.match(Vo);n&&n[0]===e||t.fuzzySubtypes.set(e,new RegExp(e))}))}))},e.prototype.getTypePolicy=function(e){var t=this;if(!Co.call(this.typePolicies,e)){var r=this.typePolicies[e]=Object.create(null);r.fields=Object.create(null);var n=this.supertypeMap.get(e);n&&n.size&&n.forEach((function(e){var n=t.getTypePolicy(e),i=n.fields,o=pe(n,["fields"]);Object.assign(r,o),Object.assign(r.fields,i)}))}var i=this.toBeAdded[e];return i&&i.length&&i.splice(0).forEach((function(r){t.updateTypePolicy(e,r)})),this.typePolicies[e]},e.prototype.getFieldPolicy=function(e,t,r){if(e){var n=this.getTypePolicy(e).fields;return n[t]||r&&(n[t]=Object.create(null))}},e.prototype.getSupertypeSet=function(e,t){var r=this.supertypeMap.get(e);return!r&&t&&this.supertypeMap.set(e,r=new Set),r},e.prototype.fragmentMatches=function(e,t,r,n){var i=this;if(!e.typeCondition)return!0;if(!t)return!1;var o=e.typeCondition.name.value;if(t===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(t,!0),a=[s],c=function(e){var t=i.getSupertypeSet(e,!1);t&&t.size&&a.indexOf(t)<0&&a.push(t)},u=!(!r||!this.fuzzySubtypes.size),l=!1,f=0;f<a.length;++f){var h=a[f];if(h.has(o))return s.has(o)||(l&&__DEV__&&gt.warn("Inferring subtype ".concat(t," of supertype ").concat(o)),s.add(o)),!0;h.forEach(c),u&&f===a.length-1&&Uo(e.selectionSet,r,n)&&(u=!1,l=!0,this.fuzzySubtypes.forEach((function(e,r){var n=t.match(e);n&&n[0]===t&&c(r)})))}return!1},e.prototype.hasKeyArgs=function(e,t){var r=this.getFieldPolicy(e,t,!1);return!(!r||!r.keyFn)},e.prototype.getStoreFieldName=function(e){var t,r=e.typename,n=e.fieldName,i=this.getFieldPolicy(r,n,!1),o=i&&i.keyFn;if(o&&r)for(var s={typename:r,fieldName:n,field:e.field||null,variables:e.variables},a=ps(e);o;){var c=o(a,s);if(!Fn(c)){t=c||n;break}o=cs(c)}return void 0===t&&(t=e.field?function(e,t){var r=null;e.directives&&(r={},e.directives.forEach((function(e){r[e.name.value]={},e.arguments&&e.arguments.forEach((function(n){var i=n.name,o=n.value;return ur(r[e.name.value],i,o,t)}))})));var n=null;return e.arguments&&e.arguments.length&&(n={},e.arguments.forEach((function(e){var r=e.name,i=e.value;return ur(n,r,i,t)}))),fr(e.name.value,n,r)}(e.field,e.variables):fr(n,ps(e))),!1===t?n:n===Lo(t)?t:n+":"+t},e.prototype.readField=function(e,t){var r=e.from;if(r&&(e.field||e.fieldName)){if(void 0===e.typename){var n=t.store.getFieldValue(r,"__typename");n&&(e.typename=n)}var i=this.getStoreFieldName(e),o=Lo(i),s=t.store.getFieldValue(r,i),a=this.getFieldPolicy(e.typename,o,!1),c=a&&a.read;if(c){var u=bs(this,r,e,t,t.store.getStorage(cr(r)?r.__ref:r,i));return yo.withValue(this.cache,c,[s,u])}return s}},e.prototype.getReadFunction=function(e,t){var r=this.getFieldPolicy(e,t,!1);return r&&r.read},e.prototype.getMergeFunction=function(e,t,r){var n=this.getFieldPolicy(e,t,!1),i=n&&n.merge;return!i&&r&&(i=(n=this.getTypePolicy(r))&&n.merge),i},e.prototype.runMergeFunction=function(e,t,r,n,i){var o=r.field,s=r.typename,a=r.merge;return a===vs?Es(n.store)(e,t):a===gs?t:(n.overwrite&&(e=void 0),a(e,t,bs(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:n.variables},n,i||Object.create(null))))},e}();function bs(e,t,r,n,i){var o=e.getStoreFieldName(r),s=Lo(o),a=r.variables||n.variables,c=n.store,u=c.toReference,l=c.canRead;return{args:ps(r),field:r.field||null,fieldName:s,storeFieldName:o,variables:a,isReference:cr,toReference:u,storage:i,cache:e.cache,canRead:l,readField:function(){return e.readField(ws(arguments,t,a),n)},mergeObjects:Es(n.store)}}function ws(e,t,r){var n,i,o,s=e[0],a=e[1],c=e.length;return"string"==typeof s?n={fieldName:s,from:c>1?a:t}:(n=de({},s),Co.call(n,"from")||(n.from=t)),__DEV__&&void 0===n.from&&__DEV__&&gt.warn("Undefined 'from' passed to readField with arguments ".concat((i=Array.from(e),o=mi("stringifyForDisplay"),JSON.stringify(i,(function(e,t){return void 0===t?o:t})).split(JSON.stringify(o)).join("<undefined>")))),void 0===n.variables&&(n.variables=r),n}function Es(e){return function(t,r){if(Fn(t)||Fn(r))throw __DEV__?new vt("Cannot automatically merge arrays"):new vt(4);if(nr(t)&&nr(r)){var n=e.getFieldValue(t,"__typename"),i=e.getFieldValue(r,"__typename");if(n&&i&&n!==i)return r;if(cr(t)&&Qo(r))return e.merge(t.__ref,r),t;if(Qo(t)&&cr(r))return e.merge(t,r.__ref),r;if(Qo(t)&&Qo(r))return de(de({},t),r)}return r}}function Ss(e,t,r){var n="".concat(t).concat(r),i=e.flavors.get(n);return i||e.flavors.set(n,i=e.clientOnly===t&&e.deferred===r?e:de(de({},e),{clientOnly:t,deferred:r})),i}var Os=function(){function e(e,t,r){this.cache=e,this.reader=t,this.fragments=r}return e.prototype.writeToStore=function(e,t){var r=this,n=t.query,i=t.result,o=t.dataId,s=t.variables,a=t.overwrite,c=_r(n),u=new Bn;s=de(de({},Or(c)),s);var l=de(de({store:e,written:Object.create(null),merge:function(e,t){return u.merge(e,t)},variables:s,varString:ti(s)},Bo(n,this.fragments)),{overwrite:!!a,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),f=this.processSelectionSet({result:i||Object.create(null),dataId:o,selectionSet:c.selectionSet,mergeTree:{map:new Map},context:l});if(!cr(f))throw __DEV__?new vt("Could not identify object ".concat(JSON.stringify(i))):new vt(7);return l.incomingById.forEach((function(t,n){var i=t.storeObject,o=t.mergeTree,s=t.fieldNodeSet,a=ar(n);if(o&&o.map.size){var c=r.applyMerges(o,a,i,l);if(cr(c))return;i=c}if(__DEV__&&!l.overwrite){var u=Object.create(null);s.forEach((function(e){e.selectionSet&&(u[e.name.value]=!0)})),Object.keys(i).forEach((function(e){(function(e){return!0===u[Lo(e)]})(e)&&!function(e){var t=o&&o.map.get(e);return Boolean(t&&t.info&&t.info.merge)}(e)&&function(e,t,r,n){var i=function(e){var t=n.getFieldValue(e,r);return"object"==typeof t&&t},o=i(e);if(o){var s=i(t);if(s&&!cr(o)&&!xn(o,s)&&!Object.keys(o).every((function(e){return void 0!==n.getFieldValue(s,e)}))){var a=n.getFieldValue(e,"__typename")||n.getFieldValue(t,"__typename"),c=Lo(r),u="".concat(a,".").concat(c);if(!As.has(u)){As.add(u);var l=[];Fn(o)||Fn(s)||[o,s].forEach((function(e){var t=n.getFieldValue(e,"__typename");"string"!=typeof t||l.includes(t)||l.push(t)})),__DEV__&&gt.warn("Cache data may be lost when replacing the ".concat(c," field of a ").concat(a," object.\n\nTo address this problem (which is not a bug in Apollo Client), ").concat(l.length?"either ensure all objects of type "+l.join(" and ")+" have an ID or a custom merge function, or ":"","define a custom merge function for the ").concat(u," field, so InMemoryCache can safely merge these objects:\n\n existing: ").concat(JSON.stringify(o).slice(0,1e3),"\n incoming: ").concat(JSON.stringify(s).slice(0,1e3),"\n\nFor more information about these options, please refer to the documentation:\n\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n"))}}}}(a,i,e,l.store)}))}e.merge(n,i)})),e.retain(f.__ref),f},e.prototype.processSelectionSet=function(e){var t=this,r=e.dataId,n=e.result,i=e.selectionSet,o=e.context,s=e.mergeTree,a=this.cache.policies,c=Object.create(null),u=r&&a.rootTypenamesById[r]||yr(n,i,o.fragmentMap)||r&&o.store.get(r,"__typename");"string"==typeof u&&(c.__typename=u);var l=function(){var e=ws(arguments,c,o.variables);if(cr(e.from)){var t=o.incomingById.get(e.from.__ref);if(t){var r=a.readField(de(de({},e),{from:t.storeObject}),o);if(void 0!==r)return r}}return a.readField(e,o)},f=new Set;this.flattenFields(i,n,o,u).forEach((function(e,r){var i,o=mr(r),h=n[o];if(f.add(r),void 0!==h){var d=a.getStoreFieldName({typename:u,fieldName:r.name.value,field:r,variables:e.variables}),p=Ts(s,d),m=t.processFieldValue(h,r,r.selectionSet?Ss(e,!1,!1):e,p),y=void 0;r.selectionSet&&(cr(m)||Qo(m))&&(y=l("__typename",m));var v=a.getMergeFunction(u,r.name.value,y);v?p.info={field:r,typename:u,merge:v}:Ds(s,d),c=e.merge(c,((i={})[d]=m,i))}else!__DEV__||e.clientOnly||e.deferred||fi.added(r)||a.getReadFunction(u,r.name.value)||__DEV__&&gt.error("Missing field '".concat(mr(r),"' while writing result ").concat(JSON.stringify(n,null,2)).substring(0,1e3))}));try{var h=a.identify(n,{typename:u,selectionSet:i,fragmentMap:o.fragmentMap,storeObject:c,readField:l}),d=h[0],p=h[1];r=r||d,p&&(c=o.merge(c,p))}catch(e){if(!r)throw e}if("string"==typeof r){var m=ar(r),y=o.written[r]||(o.written[r]=[]);if(y.indexOf(i)>=0)return m;if(y.push(i),this.reader&&this.reader.isFresh(n,m,i,o))return m;var v=o.incomingById.get(r);return v?(v.storeObject=o.merge(v.storeObject,c),v.mergeTree=ks(v.mergeTree,s),f.forEach((function(e){return v.fieldNodeSet.add(e)}))):o.incomingById.set(r,{storeObject:c,mergeTree:Ns(s)?void 0:s,fieldNodeSet:f}),m}return c},e.prototype.processFieldValue=function(e,t,r,n){var i=this;return t.selectionSet&&null!==e?Fn(e)?e.map((function(e,o){var s=i.processFieldValue(e,t,r,Ts(n,o));return Ds(n,o),s})):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:r,mergeTree:n}):__DEV__?Oi(e):e},e.prototype.flattenFields=function(e,t,r,n){void 0===n&&(n=yr(t,e,r.fragmentMap));var i=new Map,o=this.cache.policies,s=new Xn(!1);return function e(a,c){var u=s.lookup(a,c.clientOnly,c.deferred);u.visited||(u.visited=!0,a.selections.forEach((function(s){if(Ur(s,r.variables)){var a=c.clientOnly,u=c.deferred;if(a&&u||!qn(s.directives)||s.directives.forEach((function(e){var t=e.name.value;if("client"===t&&(a=!0),"defer"===t){var n=pr(e,r.variables);n&&!1===n.if||(u=!0)}})),vr(s)){var l=i.get(s);l&&(a=a&&l.clientOnly,u=u&&l.deferred),i.set(s,Ss(r,a,u))}else{var f=sr(s,r.lookupFragment);if(!f&&s.kind===Mr.FRAGMENT_SPREAD)throw __DEV__?new vt("No fragment named ".concat(s.name.value)):new vt(8);f&&o.fragmentMatches(f,n,t,r.variables)&&e(f.selectionSet,Ss(r,a,u))}}})))}(e,r),i},e.prototype.applyMerges=function(e,t,r,n,i){var o,s=this;if(e.map.size&&!cr(r)){var a,c=Fn(r)||!cr(t)&&!Qo(t)?void 0:t,u=r;c&&!i&&(i=[cr(c)?c.__ref:c]);var l=function(e,t){return Fn(e)?"number"==typeof t?e[t]:void 0:n.store.getFieldValue(e,String(t))};e.map.forEach((function(e,t){var r=l(c,t),o=l(u,t);if(void 0!==o){i&&i.push(t);var f=s.applyMerges(e,r,o,n,i);f!==o&&(a=a||new Map).set(t,f),i&&gt(i.pop()===t)}})),a&&(r=Fn(u)?u.slice(0):de({},u),a.forEach((function(e,t){r[t]=e})))}return e.info?this.cache.policies.runMergeFunction(t,r,e.info,n,i&&(o=n.store).getStorage.apply(o,i)):r},e}(),Is=[];function Ts(e,t){var r=e.map;return r.has(t)||r.set(t,Is.pop()||{map:new Map}),r.get(t)}function ks(e,t){if(e===t||!t||Ns(t))return e;if(!e||Ns(e))return t;var r=e.info&&t.info?de(de({},e.info),t.info):e.info||t.info,n=e.map.size&&t.map.size,i={info:r,map:n?new Map:e.map.size?e.map:t.map};if(n){var o=new Set(t.map.keys());e.map.forEach((function(e,r){i.map.set(r,ks(e,t.map.get(r))),o.delete(r)})),o.forEach((function(r){i.map.set(r,ks(t.map.get(r),e.map.get(r)))}))}return i}function Ns(e){return!e||!(e.info||e.map.size)}function Ds(e,t){var r=e.map,n=r.get(t);n&&Ns(n)&&(Is.push(n),r.delete(t))}var As=new Set,Rs=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;return r.watches=new Set,r.typenameDocumentCache=new Map,r.makeVar=bo,r.txCount=0,r.config=function(e){return Ti(Fo,e)}(t),r.addTypename=!!r.config.addTypename,r.policies=new _s({cache:r,dataIdFromObject:r.config.dataIdFromObject,possibleTypes:r.config.possibleTypes,typePolicies:r.config.typePolicies}),r.init(),r}return he(t,e),t.prototype.init=function(){var e=this.data=new Ho.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()},t.prototype.resetResultCache=function(e){var t=this,r=this.storeReader,n=this.config.fragments;this.storeWriter=new Os(this,this.storeReader=new ns({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:qo(this.config),canon:e?void 0:r&&r.canon,fragments:n}),n),this.maybeBroadcastWatch=mo((function(e,r){return t.broadcastWatch(e,r)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var r=e.optimistic?t.optimisticData:t.data;if(ts(r)){var n=e.optimistic,i=e.id,o=e.variables;return r.makeCacheKey(e.query,e.callback,ti({optimistic:n,id:i,variables:o}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach((function(e){return e.resetCaching()}))},t.prototype.restore=function(e){return this.init(),e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).extract()},t.prototype.read=function(e){var t=e.returnPartialData,r=void 0!==t&&t;try{return this.storeReader.diffQueryAgainstStore(de(de({},e),{store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:r})).result||null}catch(e){if(e instanceof Po)return null;throw e}},t.prototype.write=function(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.modify=function(e){if(Co.call(e,"id")&&!e.id)return!1;var t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.diff=function(e){return this.storeReader.diffQueryAgainstStore(de(de({},e),{store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(e){var t,r=this;return this.watches.size||go(t=this).vars.forEach((function(e){return e.attachCache(t)})),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){r.watches.delete(e)&&!r.watches.size&&_o(r),r.maybeBroadcastWatch.forget(e)}},t.prototype.gc=function(e){ti.reset();var t=this.optimisticData.gc();return e&&!this.txCount&&(e.resetResultCache?this.resetResultCache(e.resetResultIdentities):e.resetResultIdentities&&this.storeReader.resetCanon()),t},t.prototype.retain=function(e,t){return(t?this.optimisticData:this.data).retain(e)},t.prototype.release=function(e,t){return(t?this.optimisticData:this.data).release(e)},t.prototype.identify=function(e){if(cr(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(e){__DEV__&&gt.warn(e)}},t.prototype.evict=function(e){if(!e.id){if(Co.call(e,"id"))return!1;e=de(de({},e),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(e,this.data)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.reset=function(e){var t=this;return this.init(),ti.reset(),e&&e.discardWatches?(this.watches.forEach((function(e){return t.maybeBroadcastWatch.forget(e)})),this.watches.clear(),_o(this)):this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){var t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())},t.prototype.batch=function(e){var t,r=this,n=e.update,i=e.optimistic,o=void 0===i||i,s=e.removeOptimistic,a=e.onWatchUpdated,c=function(e){var i=r,o=i.data,s=i.optimisticData;++r.txCount,e&&(r.data=r.optimisticData=e);try{return t=n(r)}finally{--r.txCount,r.data=o,r.optimisticData=s}},u=new Set;return a&&!this.txCount&&this.broadcastWatches(de(de({},e),{onWatchUpdated:function(e){return u.add(e),!1}})),"string"==typeof o?this.optimisticData=this.optimisticData.addLayer(o,c):!1===o?c(this.data):c(),"string"==typeof s&&(this.optimisticData=this.optimisticData.removeLayer(s)),a&&u.size?(this.broadcastWatches(de(de({},e),{onWatchUpdated:function(e,t){var r=a.call(this,e,t);return!1!==r&&u.delete(e),r}})),u.size&&u.forEach((function(e){return r.maybeBroadcastWatch.dirty(e)}))):this.broadcastWatches(e),t},t.prototype.performTransaction=function(e,t){return this.batch({update:e,optimistic:t||null!==t})},t.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(t=fi(e),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}return e},t.prototype.transformForLink=function(e){var t=this.config.fragments;return t?t.transform(e):e},t.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach((function(r){return t.maybeBroadcastWatch(r,e)}))},t.prototype.broadcastWatch=function(e,t){var r=e.lastDiff,n=this.diff(e);t&&(e.optimistic&&"string"==typeof t.optimistic&&(n.fromOptimisticTransaction=!0),t.onWatchUpdated&&!1===t.onWatchUpdated.call(this,e,n,r))||r&&xn(r.result,n.result)||e.callback(e.lastDiff=n,r)},t}(xo);function xs(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}const Ps=/\r\n|[\n\r]/g;function $s(e,t){let r=0,n=1;for(const i of e.body.matchAll(Ps)){if("number"==typeof i.index||xs(!1),i.index>=t)break;r=i.index+i[0].length,n+=1}return{line:n,column:t+1-r}}function Cs(e,t){const r=e.locationOffset.column-1,n="".padStart(r)+e.body,i=t.line-1,o=e.locationOffset.line-1,s=t.line+o,a=1===t.line?r:0,c=t.column+a,u=`${e.name}:${s}:${c}\n`,l=n.split(/\r\n|[\n\r]/g),f=l[i];if(f.length>120){const e=Math.floor(c/80),t=c%80,r=[];for(let e=0;e<f.length;e+=80)r.push(f.slice(e,e+80));return u+js([[`${s} |`,r[0]],...r.slice(1,e+1).map((e=>["|",e])),["|","^".padStart(t)],["|",r[e+1]]])}return u+js([[s-1+" |",l[i-1]],[`${s} |`,f],["|","^".padStart(c)],[`${s+1} |`,l[i+1]]])}function js(e){const t=e.filter((([e,t])=>void 0!==t)),r=Math.max(...t.map((([e])=>e.length)));return t.map((([e,t])=>e.padStart(r)+(t?" "+t:""))).join("\n")}class Ms extends Error{constructor(e,...t){var r,n,i;const{nodes:o,source:s,positions:a,path:c,originalError:u,extensions:l}=function(e){const t=e[0];return null==t||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}(t);super(e),this.name="GraphQLError",this.path=null!=c?c:void 0,this.originalError=null!=u?u:void 0,this.nodes=Fs(Array.isArray(o)?o:o?[o]:void 0);const f=Fs(null===(r=this.nodes)||void 0===r?void 0:r.map((e=>e.loc)).filter((e=>null!=e)));this.source=null!=s?s:null==f||null===(n=f[0])||void 0===n?void 0:n.source,this.positions=null!=a?a:null==f?void 0:f.map((e=>e.start)),this.locations=a&&s?a.map((e=>$s(s,e))):null==f?void 0:f.map((e=>$s(e.source,e.start)));const h="object"==typeof(d=null==u?void 0:u.extensions)&&null!==d?null==u?void 0:u.extensions:void 0;var d;this.extensions=null!==(i=null!=l?l:h)&&void 0!==i?i:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=u&&u.stack?Object.defineProperty(this,"stack",{value:u.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,Ms):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const r of this.nodes)r.loc&&(e+="\n\n"+Cs((t=r.loc).source,$s(t.source,t.start)));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+Cs(this.source,t);var t;return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function Fs(e){return void 0===e||0===e.length?void 0:e}function qs(e,t,r){return new Ms(`Syntax Error: ${r}`,{source:e,positions:[t]})}var Vs,Ls,Us;!function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"}(Vs||(Vs={})),(Us=Ls||(Ls={})).SOF="<SOF>",Us.EOF="<EOF>",Us.BANG="!",Us.DOLLAR="$",Us.AMP="&",Us.PAREN_L="(",Us.PAREN_R=")",Us.SPREAD="...",Us.COLON=":",Us.EQUALS="=",Us.AT="@",Us.BRACKET_L="[",Us.BRACKET_R="]",Us.BRACE_L="{",Us.PIPE="|",Us.BRACE_R="}",Us.NAME="Name",Us.INT="Int",Us.FLOAT="Float",Us.STRING="String",Us.BLOCK_STRING="BlockString",Us.COMMENT="Comment";class Qs{constructor(e){const t=new xr(Ls.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==Ls.EOF)do{if(e.next)e=e.next;else{const t=Ws(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===Ls.COMMENT);return e}}function Bs(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function zs(e,t){return Ys(e.charCodeAt(t))&&Ks(e.charCodeAt(t+1))}function Ys(e){return e>=55296&&e<=56319}function Ks(e){return e>=56320&&e<=57343}function Hs(e,t){const r=e.source.body.codePointAt(t);if(void 0===r)return Ls.EOF;if(r>=32&&r<=126){const e=String.fromCodePoint(r);return'"'===e?"'\"'":`"${e}"`}return"U+"+r.toString(16).toUpperCase().padStart(4,"0")}function Gs(e,t,r,n,i){const o=e.line,s=1+r-e.lineStart;return new xr(t,r,n,o,s,i)}function Ws(e,t){const r=e.source.body,n=r.length;let i=t;for(;i<n;){const t=r.charCodeAt(i);switch(t){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:10===r.charCodeAt(i+1)?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return Js(e,i);case 33:return Gs(e,Ls.BANG,i,i+1);case 36:return Gs(e,Ls.DOLLAR,i,i+1);case 38:return Gs(e,Ls.AMP,i,i+1);case 40:return Gs(e,Ls.PAREN_L,i,i+1);case 41:return Gs(e,Ls.PAREN_R,i,i+1);case 46:if(46===r.charCodeAt(i+1)&&46===r.charCodeAt(i+2))return Gs(e,Ls.SPREAD,i,i+3);break;case 58:return Gs(e,Ls.COLON,i,i+1);case 61:return Gs(e,Ls.EQUALS,i,i+1);case 64:return Gs(e,Ls.AT,i,i+1);case 91:return Gs(e,Ls.BRACKET_L,i,i+1);case 93:return Gs(e,Ls.BRACKET_R,i,i+1);case 123:return Gs(e,Ls.BRACE_L,i,i+1);case 124:return Gs(e,Ls.PIPE,i,i+1);case 125:return Gs(e,Ls.BRACE_R,i,i+1);case 34:return 34===r.charCodeAt(i+1)&&34===r.charCodeAt(i+2)?sa(e,i):ea(e,i)}if(on(t)||45===t)return Zs(e,i,t);if(an(t))return aa(e,i);throw qs(e.source,i,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":Bs(t)||zs(r,i)?`Unexpected character: ${Hs(e,i)}.`:`Invalid character: ${Hs(e,i)}.`)}return Gs(e,Ls.EOF,n,n)}function Js(e,t){const r=e.source.body,n=r.length;let i=t+1;for(;i<n;){const e=r.charCodeAt(i);if(10===e||13===e)break;if(Bs(e))++i;else{if(!zs(r,i))break;i+=2}}return Gs(e,Ls.COMMENT,t,i,r.slice(t+1,i))}function Zs(e,t,r){const n=e.source.body;let i=t,o=r,s=!1;if(45===o&&(o=n.charCodeAt(++i)),48===o){if(o=n.charCodeAt(++i),on(o))throw qs(e.source,i,`Invalid number, unexpected digit after 0: ${Hs(e,i)}.`)}else i=Xs(e,i,o),o=n.charCodeAt(i);if(46===o&&(s=!0,o=n.charCodeAt(++i),i=Xs(e,i,o),o=n.charCodeAt(i)),69!==o&&101!==o||(s=!0,o=n.charCodeAt(++i),43!==o&&45!==o||(o=n.charCodeAt(++i)),i=Xs(e,i,o),o=n.charCodeAt(i)),46===o||an(o))throw qs(e.source,i,`Invalid number, expected digit but got: ${Hs(e,i)}.`);return Gs(e,s?Ls.FLOAT:Ls.INT,t,i,n.slice(t,i))}function Xs(e,t,r){if(!on(r))throw qs(e.source,t,`Invalid number, expected digit but got: ${Hs(e,t)}.`);const n=e.source.body;let i=t+1;for(;on(n.charCodeAt(i));)++i;return i}function ea(e,t){const r=e.source.body,n=r.length;let i=t+1,o=i,s="";for(;i<n;){const n=r.charCodeAt(i);if(34===n)return s+=r.slice(o,i),Gs(e,Ls.STRING,t,i+1,s);if(92!==n){if(10===n||13===n)break;if(Bs(n))++i;else{if(!zs(r,i))throw qs(e.source,i,`Invalid character within String: ${Hs(e,i)}.`);i+=2}}else{s+=r.slice(o,i);const t=117===r.charCodeAt(i+1)?123===r.charCodeAt(i+2)?ta(e,i):ra(e,i):oa(e,i);s+=t.value,i+=t.size,o=i}}throw qs(e.source,i,"Unterminated string.")}function ta(e,t){const r=e.source.body;let n=0,i=3;for(;i<12;){const e=r.charCodeAt(t+i++);if(125===e){if(i<5||!Bs(n))break;return{value:String.fromCodePoint(n),size:i}}if(n=n<<4|ia(e),n<0)break}throw qs(e.source,t,`Invalid Unicode escape sequence: "${r.slice(t,t+i)}".`)}function ra(e,t){const r=e.source.body,n=na(r,t+2);if(Bs(n))return{value:String.fromCodePoint(n),size:6};if(Ys(n)&&92===r.charCodeAt(t+6)&&117===r.charCodeAt(t+7)){const e=na(r,t+8);if(Ks(e))return{value:String.fromCodePoint(n,e),size:12}}throw qs(e.source,t,`Invalid Unicode escape sequence: "${r.slice(t,t+6)}".`)}function na(e,t){return ia(e.charCodeAt(t))<<12|ia(e.charCodeAt(t+1))<<8|ia(e.charCodeAt(t+2))<<4|ia(e.charCodeAt(t+3))}function ia(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function oa(e,t){const r=e.source.body;switch(r.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw qs(e.source,t,`Invalid character escape sequence: "${r.slice(t,t+2)}".`)}function sa(e,t){const r=e.source.body,n=r.length;let i=e.lineStart,o=t+3,s=o,a="";const c=[];for(;o<n;){const n=r.charCodeAt(o);if(34===n&&34===r.charCodeAt(o+1)&&34===r.charCodeAt(o+2)){a+=r.slice(s,o),c.push(a);const n=Gs(e,Ls.BLOCK_STRING,t,o+3,cn(c).join("\n"));return e.line+=c.length-1,e.lineStart=i,n}if(92!==n||34!==r.charCodeAt(o+1)||34!==r.charCodeAt(o+2)||34!==r.charCodeAt(o+3))if(10!==n&&13!==n)if(Bs(n))++o;else{if(!zs(r,o))throw qs(e.source,o,`Invalid character within String: ${Hs(e,o)}.`);o+=2}else a+=r.slice(s,o),c.push(a),13===n&&10===r.charCodeAt(o+1)?o+=2:++o,a="",s=o,i=o;else a+=r.slice(s,o),s=o+1,o+=4}throw qs(e.source,o,"Unterminated string.")}function aa(e,t){const r=e.source.body,n=r.length;let i=t+1;for(;i<n&&(sn(o=r.charCodeAt(i))||on(o)||95===o);)++i;var o;return Gs(e,Ls.NAME,t,i,r.slice(t,i))}class ca{constructor(e,t={}){const r=function(e){return e instanceof Ct}(e)?e:new Ct(e);this._lexer=new Qs(r),this._options=t,this._tokenCounter=0}parseName(){const e=this.expectToken(Ls.NAME);return this.node(e,{kind:Mr.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:Mr.DOCUMENT,definitions:this.many(Ls.SOF,this.parseDefinition,Ls.EOF)})}parseDefinition(){if(this.peek(Ls.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===Ls.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw qs(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(Ls.BRACE_L))return this.node(e,{kind:Mr.OPERATION_DEFINITION,operation:jr.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let r;return this.peek(Ls.NAME)&&(r=this.parseName()),this.node(e,{kind:Mr.OPERATION_DEFINITION,operation:t,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(Ls.NAME);switch(e.value){case"query":return jr.QUERY;case"mutation":return jr.MUTATION;case"subscription":return jr.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(Ls.PAREN_L,this.parseVariableDefinition,Ls.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:Mr.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(Ls.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(Ls.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(Ls.DOLLAR),this.node(e,{kind:Mr.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:Mr.SELECTION_SET,selections:this.many(Ls.BRACE_L,this.parseSelection,Ls.BRACE_R)})}parseSelection(){return this.peek(Ls.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let r,n;return this.expectOptionalToken(Ls.COLON)?(r=t,n=this.parseName()):n=t,this.node(e,{kind:Mr.FIELD,alias:r,name:n,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(Ls.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(Ls.PAREN_L,t,Ls.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,r=this.parseName();return this.expectToken(Ls.COLON),this.node(t,{kind:Mr.ARGUMENT,name:r,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(Ls.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(Ls.NAME)?this.node(e,{kind:Mr.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:Mr.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),!0===this._options.allowLegacyFragmentVariables?this.node(e,{kind:Mr.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:Mr.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case Ls.BRACKET_L:return this.parseList(e);case Ls.BRACE_L:return this.parseObject(e);case Ls.INT:return this.advanceLexer(),this.node(t,{kind:Mr.INT,value:t.value});case Ls.FLOAT:return this.advanceLexer(),this.node(t,{kind:Mr.FLOAT,value:t.value});case Ls.STRING:case Ls.BLOCK_STRING:return this.parseStringLiteral();case Ls.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:Mr.BOOLEAN,value:!0});case"false":return this.node(t,{kind:Mr.BOOLEAN,value:!1});case"null":return this.node(t,{kind:Mr.NULL});default:return this.node(t,{kind:Mr.ENUM,value:t.value})}case Ls.DOLLAR:if(e){if(this.expectToken(Ls.DOLLAR),this._lexer.token.kind===Ls.NAME){const e=this._lexer.token.value;throw qs(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:Mr.STRING,value:e.value,block:e.kind===Ls.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:Mr.LIST,values:this.any(Ls.BRACKET_L,(()=>this.parseValueLiteral(e)),Ls.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:Mr.OBJECT,fields:this.any(Ls.BRACE_L,(()=>this.parseObjectField(e)),Ls.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,r=this.parseName();return this.expectToken(Ls.COLON),this.node(t,{kind:Mr.OBJECT_FIELD,name:r,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(Ls.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(Ls.AT),this.node(t,{kind:Mr.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(Ls.BRACKET_L)){const r=this.parseTypeReference();this.expectToken(Ls.BRACKET_R),t=this.node(e,{kind:Mr.LIST_TYPE,type:r})}else t=this.parseNamedType();return this.expectOptionalToken(Ls.BANG)?this.node(e,{kind:Mr.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:Mr.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(Ls.STRING)||this.peek(Ls.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const r=this.parseConstDirectives(),n=this.many(Ls.BRACE_L,this.parseOperationTypeDefinition,Ls.BRACE_R);return this.node(e,{kind:Mr.SCHEMA_DEFINITION,description:t,directives:r,operationTypes:n})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(Ls.COLON);const r=this.parseNamedType();return this.node(e,{kind:Mr.OPERATION_TYPE_DEFINITION,operation:t,type:r})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const r=this.parseName(),n=this.parseConstDirectives();return this.node(e,{kind:Mr.SCALAR_TYPE_DEFINITION,description:t,name:r,directives:n})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:Mr.OBJECT_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(Ls.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(Ls.BRACE_L,this.parseFieldDefinition,Ls.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseArgumentDefs();this.expectToken(Ls.COLON);const i=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:Mr.FIELD_DEFINITION,description:t,name:r,arguments:n,type:i,directives:o})}parseArgumentDefs(){return this.optionalMany(Ls.PAREN_L,this.parseInputValueDef,Ls.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),r=this.parseName();this.expectToken(Ls.COLON);const n=this.parseTypeReference();let i;this.expectOptionalToken(Ls.EQUALS)&&(i=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:Mr.INPUT_VALUE_DEFINITION,description:t,name:r,type:n,defaultValue:i,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:Mr.INTERFACE_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:Mr.UNION_TYPE_DEFINITION,description:t,name:r,directives:n,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(Ls.EQUALS)?this.delimitedMany(Ls.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:Mr.ENUM_TYPE_DEFINITION,description:t,name:r,directives:n,values:i})}parseEnumValuesDefinition(){return this.optionalMany(Ls.BRACE_L,this.parseEnumValueDefinition,Ls.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),r=this.parseEnumValueName(),n=this.parseConstDirectives();return this.node(e,{kind:Mr.ENUM_VALUE_DEFINITION,description:t,name:r,directives:n})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw qs(this._lexer.source,this._lexer.token.start,`${ua(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:Mr.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:r,directives:n,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(Ls.BRACE_L,this.parseInputValueDef,Ls.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===Ls.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),r=this.optionalMany(Ls.BRACE_L,this.parseOperationTypeDefinition,Ls.BRACE_R);if(0===t.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:Mr.SCHEMA_EXTENSION,directives:t,operationTypes:r})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),r=this.parseConstDirectives();if(0===r.length)throw this.unexpected();return this.node(e,{kind:Mr.SCALAR_TYPE_EXTENSION,name:t,directives:r})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:Mr.OBJECT_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:Mr.INTERFACE_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),r=this.parseConstDirectives(),n=this.parseUnionMemberTypes();if(0===r.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:Mr.UNION_TYPE_EXTENSION,name:t,directives:r,types:n})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),r=this.parseConstDirectives(),n=this.parseEnumValuesDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:Mr.ENUM_TYPE_EXTENSION,name:t,directives:r,values:n})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),r=this.parseConstDirectives(),n=this.parseInputFieldsDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:Mr.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:r,fields:n})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(Ls.AT);const r=this.parseName(),n=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:Mr.DIRECTIVE_DEFINITION,description:t,name:r,arguments:n,repeatable:i,locations:o})}parseDirectiveLocations(){return this.delimitedMany(Ls.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(Vs,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new Rr(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw qs(this._lexer.source,t.start,`Expected ${la(e)}, found ${ua(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==Ls.NAME||t.value!==e)throw qs(this._lexer.source,t.start,`Expected "${e}", found ${ua(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===Ls.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=null!=e?e:this._lexer.token;return qs(this._lexer.source,t.start,`Unexpected ${ua(t)}.`)}any(e,t,r){this.expectToken(e);const n=[];for(;!this.expectOptionalToken(r);)n.push(t.call(this));return n}optionalMany(e,t,r){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(r));return e}return[]}many(e,t,r){this.expectToken(e);const n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n}delimitedMany(e,t){this.expectOptionalToken(e);const r=[];do{r.push(t.call(this))}while(this.expectOptionalToken(e));return r}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(void 0!==e&&t.kind!==Ls.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw qs(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function ua(e){const t=e.value;return la(e.kind)+(null!=t?` "${t}"`:"")}function la(e){return function(e){return e===Ls.BANG||e===Ls.DOLLAR||e===Ls.AMP||e===Ls.PAREN_L||e===Ls.PAREN_R||e===Ls.SPREAD||e===Ls.COLON||e===Ls.EQUALS||e===Ls.AT||e===Ls.BRACKET_L||e===Ls.BRACKET_R||e===Ls.BRACE_L||e===Ls.PIPE||e===Ls.BRACE_R}(e)?`"${e}"`:e}var fa=new Map,ha=new Map,da=!0,pa=!1;function ma(e){return e.replace(/[\s,]+/g," ").trim()}function ya(e){var t,r,n,i=ma(e);if(!fa.has(i)){var o=function(e,t){return new ca(e,t).parseDocument()}(e,{experimentalFragmentVariables:pa,allowLegacyFragmentVariables:pa});if(!o||"Document"!==o.kind)throw new Error("Not a valid GraphQL document.");fa.set(i,function(e){var t=new Set(e.definitions);t.forEach((function(e){e.loc&&delete e.loc,Object.keys(e).forEach((function(r){var n=e[r];n&&"object"==typeof n&&t.add(n)}))}));var r=e.loc;return r&&(delete r.startToken,delete r.endToken),e}((t=o,r=new Set,n=[],t.definitions.forEach((function(e){if("FragmentDefinition"===e.kind){var t=e.name.value,i=ma((s=e.loc).source.body.substring(s.start,s.end)),o=ha.get(t);o&&!o.has(i)?da&&console.warn("Warning: fragment with name "+t+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):o||ha.set(t,o=new Set),o.add(i),r.has(i)||(r.add(i),n.push(e))}else n.push(e);var s})),de(de({},t),{definitions:n}))))}return fa.get(i)}function va(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];"string"==typeof e&&(e=[e]);var n=e[0];return t.forEach((function(t,r){t&&"Document"===t.kind?n+=t.loc.source.body:n+=t,n+=e[r+1]})),ya(n)}var ga,_a=va;(ga=va||(va={})).gql=_a,ga.resetCaches=function(){fa.clear(),ha.clear()},ga.disableFragmentWarnings=function(){da=!1},ga.enableExperimentalFragmentVariables=function(){pa=!0},ga.disableExperimentalFragmentVariables=function(){pa=!1},va.default=va;const ba=(e=>{var t={};return o.d(t,e),t})({default:()=>t.default});class wa{constructor(e,t){this.rpcManager=e;const r=`${t}/graphql`;this.client=new Ro({link:new Tn({uri:`${this.rpcManager.getEndpoint()}${r}`,headers:this.rpcManager.getStaticHeaders(),fetch:ba.default}),cache:new Rs})}async query(e){return(await this.client.query({query:va`
8
+ deps: ${r}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,r]=function({schema:e}){const t={},r={};for(const n in e)"__proto__"!==n&&((Array.isArray(e[n])?t:r)[n]=e[n]);return[t,r]}(e);a(e,t),c(e,r)}};function a(e,t=e.schema){const{gen:r,data:i,it:s}=e;if(0===Object.keys(t).length)return;const a=r.let("missing");for(const c in t){const u=t[c];if(0===u.length)continue;const l=(0,o.propertyInData)(r,i,c,s.opts.ownProperties);e.setParams({property:c,depsCount:u.length,deps:u.join(", ")}),s.allErrors?r.if(l,(()=>{for(const t of u)(0,o.checkReportMissingProp)(e,t)})):(r.if(n._`${l} && (${(0,o.checkMissingProp)(e,u,a)})`),(0,o.reportMissingProp)(e,a),r.else())}}function c(e,t=e.schema){const{gen:r,data:n,keyword:s,it:a}=e,c=r.name("valid");for(const u in t)(0,i.alwaysValidSchema)(a,t[u])||(r.if((0,o.propertyInData)(r,n,u,a.opts.ownProperties),(()=>{const t=e.subschema({keyword:s,schemaProp:u},c);e.mergeValidEvaluated(t,c)}),(()=>r.var(c,!0))),e.ok(c))}t.validatePropertyDeps=a,t.validateSchemaDeps=c,t.default=s},76:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(5669),i=r(8936),o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>n.str`must match "${e.ifClause}" schema`,params:({params:e})=>n._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:r,it:o}=e;void 0===r.then&&void 0===r.else&&(0,i.checkStrictMode)(o,'"if" without "then" and "else" is ignored');const a=s(o,"then"),c=s(o,"else");if(!a&&!c)return;const u=t.let("valid",!0),l=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);e.mergeEvaluated(t)}(),e.reset(),a&&c){const r=t.let("ifClause");e.setParams({ifClause:r}),t.if(l,f("then",r),f("else",r))}else a?t.if(l,f("then")):t.if((0,n.not)(l),f("else"));function f(r,i){return()=>{const o=e.subschema({keyword:r},l);t.assign(u,l),e.mergeValidEvaluated(o,u),i?t.assign(i,n._`${r}`):e.setParams({ifClause:r})}}e.pass(u,(()=>e.error(!0)))}};function s(e,t){const r=e.schema[t];return void 0!==r&&!(0,i.alwaysValidSchema)(e,r)}t.default=o},6951:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(8891),i=r(1162),o=r(8634),s=r(5151),a=r(5609),c=r(5463),u=r(3021),l=r(4943),f=r(4243),h=r(8103),d=r(2869),p=r(4279),m=r(4880),y=r(2609),v=r(76),g=r(5316);t.default=function(e=!1){const t=[d.default,p.default,m.default,y.default,v.default,g.default,u.default,l.default,c.default,f.default,h.default];return e?t.push(i.default,s.default):t.push(n.default,o.default),t.push(a.default),t}},8634:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;const n=r(5669),i=r(8936),o=r(3499),s={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return a(e,"additionalItems",t);r.items=!0,(0,i.alwaysValidSchema)(r,t)||e.ok((0,o.validateArray)(e))}};function a(e,t,r=e.schema){const{gen:o,parentSchema:s,data:a,keyword:c,it:u}=e;!function(e){const{opts:n,errSchemaPath:o}=u,s=r.length,a=s===e.minItems&&(s===e.maxItems||!1===e[t]);if(n.strictTuples&&!a){const e=`"${c}" is ${s}-tuple, but minItems or maxItems/${t} are not specified or different at path "${o}"`;(0,i.checkStrictMode)(u,e,n.strictTuples)}}(s),u.opts.unevaluated&&r.length&&!0!==u.items&&(u.items=i.mergeEvaluated.items(o,r.length,u.items));const l=o.name("valid"),f=o.const("len",n._`${a}.length`);r.forEach(((t,r)=>{(0,i.alwaysValidSchema)(u,t)||(o.if(n._`${f} > ${r}`,(()=>e.subschema({keyword:c,schemaProp:r,dataProp:r},l))),e.ok(l))}))}t.validateTuple=a,t.default=s},5151:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(5669),i=r(8936),o=r(3499),s=r(8891),a={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>n.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>n._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:r,it:n}=e,{prefixItems:a}=r;n.items=!0,(0,i.alwaysValidSchema)(n,t)||(a?(0,s.validateAdditionalItems)(e,a):e.ok((0,o.validateArray)(e)))}};t.default=a},2869:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(8936),i={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:i}=e;if((0,n.alwaysValidSchema)(i,r))return void e.fail();const o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,(()=>e.reset()),(()=>e.error()))},error:{message:"must NOT be valid"}};t.default=i},4880:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(5669),i=r(8936),o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>n._`{passingSchemas: ${e.passing}}`},code(e){const{gen:t,schema:r,parentSchema:o,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&o.discriminator)return;const a=r,c=t.let("valid",!1),u=t.let("passing",null),l=t.name("_valid");e.setParams({passing:u}),t.block((function(){a.forEach(((r,o)=>{let a;(0,i.alwaysValidSchema)(s,r)?t.var(l,!0):a=e.subschema({keyword:"oneOf",schemaProp:o,compositeRule:!0},l),o>0&&t.if(n._`${l} && ${c}`).assign(c,!1).assign(u,n._`[${u}, ${o}]`).else(),t.if(l,(()=>{t.assign(c,!0),t.assign(u,o),a&&e.mergeEvaluated(a,n.Name)}))}))})),e.result(c,(()=>e.reset()),(()=>e.error(!0)))}};t.default=o},8103:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(3499),i=r(5669),o=r(8936),s=r(8936),a={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:a,parentSchema:c,it:u}=e,{opts:l}=u,f=(0,n.allSchemaProperties)(r),h=f.filter((e=>(0,o.alwaysValidSchema)(u,r[e])));if(0===f.length||h.length===f.length&&(!u.opts.unevaluated||!0===u.props))return;const d=l.strictSchema&&!l.allowMatchingProperties&&c.properties,p=t.name("valid");!0===u.props||u.props instanceof i.Name||(u.props=(0,s.evaluatedPropsToName)(t,u.props));const{props:m}=u;function y(e){for(const t in d)new RegExp(e).test(t)&&(0,o.checkStrictMode)(u,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function v(r){t.forIn("key",a,(o=>{t.if(i._`${(0,n.usePattern)(e,r)}.test(${o})`,(()=>{const n=h.includes(r);n||e.subschema({keyword:"patternProperties",schemaProp:r,dataProp:o,dataPropType:s.Type.Str},p),u.opts.unevaluated&&!0!==m?t.assign(i._`${m}[${o}]`,!0):n||u.allErrors||t.if((0,i.not)(p),(()=>t.break()))}))}))}!function(){for(const e of f)d&&y(e),u.allErrors?v(e):(t.var(p,!0),v(e),t.if(p))}()}};t.default=a},1162:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(8634),i={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,n.validateTuple)(e,"items")};t.default=i},4243:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(1686),i=r(3499),o=r(8936),s=r(4943),a={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,parentSchema:a,data:c,it:u}=e;"all"===u.opts.removeAdditional&&void 0===a.additionalProperties&&s.default.code(new n.KeywordCxt(u,s.default,"additionalProperties"));const l=(0,i.allSchemaProperties)(r);for(const e of l)u.definedProperties.add(e);u.opts.unevaluated&&l.length&&!0!==u.props&&(u.props=o.mergeEvaluated.props(t,(0,o.toHash)(l),u.props));const f=l.filter((e=>!(0,o.alwaysValidSchema)(u,r[e])));if(0===f.length)return;const h=t.name("valid");for(const r of f)d(r)?p(r):(t.if((0,i.propertyInData)(t,c,r,u.opts.ownProperties)),p(r),u.allErrors||t.else().var(h,!0),t.endIf()),e.it.definedProperties.add(r),e.ok(h);function d(e){return u.opts.useDefaults&&!u.compositeRule&&void 0!==r[e].default}function p(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},h)}}};t.default=a},3021:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(5669),i=r(8936),o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>n._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:r,data:o,it:s}=e;if((0,i.alwaysValidSchema)(s,r))return;const a=t.name("valid");t.forIn("key",o,(r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},a),t.if((0,n.not)(a),(()=>{e.error(!0),s.allErrors||t.break()}))})),e.ok(a)}};t.default=o},5316:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(8936),i={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){void 0===t.if&&(0,n.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};t.default=i},3499:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;const n=r(5669),i=r(8936),o=r(7250),s=r(8936);function a(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:n._`Object.prototype.hasOwnProperty`})}function c(e,t,r){return n._`${a(e)}.call(${t}, ${r})`}function u(e,t,r,i){const o=n._`${t}${(0,n.getProperty)(r)} === undefined`;return i?(0,n.or)(o,(0,n.not)(c(e,t,r))):o}function l(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}t.checkReportMissingProp=function(e,t){const{gen:r,data:i,it:o}=e;r.if(u(r,i,t,o.opts.ownProperties),(()=>{e.setParams({missingProperty:n._`${t}`},!0),e.error()}))},t.checkMissingProp=function({gen:e,data:t,it:{opts:r}},i,o){return(0,n.or)(...i.map((i=>(0,n.and)(u(e,t,i,r.ownProperties),n._`${o} = ${i}`))))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.hasPropFunc=a,t.isOwnProperty=c,t.propertyInData=function(e,t,r,i){const o=n._`${t}${(0,n.getProperty)(r)} !== undefined`;return i?n._`${o} && ${c(e,t,r)}`:o},t.noPropertyInData=u,t.allSchemaProperties=l,t.schemaProperties=function(e,t){return l(t).filter((r=>!(0,i.alwaysValidSchema)(e,t[r])))},t.callValidateCode=function({schemaCode:e,data:t,it:{gen:r,topSchemaRef:i,schemaPath:s,errorPath:a},it:c},u,l,f){const h=f?n._`${e}, ${t}, ${i}${s}`:t,d=[[o.default.instancePath,(0,n.strConcat)(o.default.instancePath,a)],[o.default.parentData,c.parentData],[o.default.parentDataProperty,c.parentDataProperty],[o.default.rootData,o.default.rootData]];c.opts.dynamicRef&&d.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);const p=n._`${h}, ${r.object(...d)}`;return l!==n.nil?n._`${u}.call(${l}, ${p})`:n._`${u}(${p})`};const f=n._`new RegExp`;t.usePattern=function({gen:e,it:{opts:t}},r){const i=t.unicodeRegExp?"u":"",{regExp:o}=t.code,a=o(r,i);return e.scopeValue("pattern",{key:a.toString(),ref:a,code:n._`${"new RegExp"===o.code?f:(0,s.useFunc)(e,o)}(${r}, ${i})`})},t.validateArray=function(e){const{gen:t,data:r,keyword:o,it:s}=e,a=t.name("valid");if(s.allErrors){const e=t.let("valid",!0);return c((()=>t.assign(e,!1))),e}return t.var(a,!0),c((()=>t.break())),a;function c(s){const c=t.const("len",n._`${r}.length`);t.forRange("i",0,c,(r=>{e.subschema({keyword:o,dataProp:r,dataPropType:i.Type.Num},a),t.if((0,n.not)(a),s)}))}},t.validateUnion=function(e){const{gen:t,schema:r,keyword:o,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some((e=>(0,i.alwaysValidSchema)(s,e)))&&!s.opts.unevaluated)return;const a=t.let("valid",!1),c=t.name("_valid");t.block((()=>r.forEach(((r,i)=>{const s=e.subschema({keyword:o,schemaProp:i,compositeRule:!0},c);t.assign(a,n._`${a} || ${c}`),e.mergeValidEvaluated(s,c)||t.if((0,n.not)(a))})))),e.result(a,(()=>e.reset()),(()=>e.error(!0)))}},1018:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});const r={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=r},2101:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(1018),i=r(1939),o=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",n.default,i.default];t.default=o},1939:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;const n=r(1578),i=r(3499),o=r(5669),s=r(7250),a=r(7382),c=r(8936),u={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:i}=e,{baseId:s,schemaEnv:c,validateName:u,opts:h,self:d}=i,{root:p}=c;if(("#"===r||"#/"===r)&&s===p.baseId)return function(){if(c===p)return f(e,u,c,c.$async);const r=t.scopeValue("root",{ref:p});return f(e,o._`${r}.validate`,p,p.$async)}();const m=a.resolveRef.call(d,p,s,r);if(void 0===m)throw new n.default(i.opts.uriResolver,s,r);return m instanceof a.SchemaEnv?function(t){const r=l(e,t);f(e,r,t,t.$async)}(m):function(n){const i=t.scopeValue("schema",!0===h.code.source?{ref:n,code:(0,o.stringify)(n)}:{ref:n}),s=t.name("valid"),a=e.subschema({schema:n,dataTypes:[],schemaPath:o.nil,topSchemaRef:i,errSchemaPath:r},s);e.mergeEvaluated(a),e.ok(s)}(m)}};function l(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):o._`${r.scopeValue("wrapper",{ref:t})}.validate`}function f(e,t,r,n){const{gen:a,it:u}=e,{allErrors:l,schemaEnv:f,opts:h}=u,d=h.passContext?s.default.this:o.nil;function p(e){const t=o._`${e}.errors`;a.assign(s.default.vErrors,o._`${s.default.vErrors} === null ? ${t} : ${s.default.vErrors}.concat(${t})`),a.assign(s.default.errors,o._`${s.default.vErrors}.length`)}function m(e){var t;if(!u.opts.unevaluated)return;const n=null===(t=null==r?void 0:r.validate)||void 0===t?void 0:t.evaluated;if(!0!==u.props)if(n&&!n.dynamicProps)void 0!==n.props&&(u.props=c.mergeEvaluated.props(a,n.props,u.props));else{const t=a.var("props",o._`${e}.evaluated.props`);u.props=c.mergeEvaluated.props(a,t,u.props,o.Name)}if(!0!==u.items)if(n&&!n.dynamicItems)void 0!==n.items&&(u.items=c.mergeEvaluated.items(a,n.items,u.items));else{const t=a.var("items",o._`${e}.evaluated.items`);u.items=c.mergeEvaluated.items(a,t,u.items,o.Name)}}n?function(){if(!f.$async)throw new Error("async schema referenced by sync schema");const r=a.let("valid");a.try((()=>{a.code(o._`await ${(0,i.callValidateCode)(e,t,d)}`),m(t),l||a.assign(r,!0)}),(e=>{a.if(o._`!(${e} instanceof ${u.ValidationError})`,(()=>a.throw(e))),p(e),l||a.assign(r,!1)})),e.ok(r)}():e.result((0,i.callValidateCode)(e,t,d),(()=>m(t)),(()=>p(t)))}t.getValidate=l,t.callRef=f,t.default=u},2:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(5669),i=r(7421),o=r(7382),s=r(8936),a={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===i.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>n._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},code(e){const{gen:t,data:r,schema:a,parentSchema:c,it:u}=e,{oneOf:l}=c;if(!u.opts.discriminator)throw new Error("discriminator: requires discriminator option");const f=a.propertyName;if("string"!=typeof f)throw new Error("discriminator: requires propertyName");if(a.mapping)throw new Error("discriminator: mapping is not supported");if(!l)throw new Error("discriminator: requires oneOf keyword");const h=t.let("valid",!1),d=t.const("tag",n._`${r}${(0,n.getProperty)(f)}`);function p(r){const i=t.name("valid"),o=e.subschema({keyword:"oneOf",schemaProp:r},i);return e.mergeEvaluated(o,n.Name),i}t.if(n._`typeof ${d} == "string"`,(()=>function(){const r=function(){var e;const t={},r=i(c);let n=!0;for(let t=0;t<l.length;t++){let c=l[t];(null==c?void 0:c.$ref)&&!(0,s.schemaHasRulesButRef)(c,u.self.RULES)&&(c=o.resolveRef.call(u.self,u.schemaEnv.root,u.baseId,null==c?void 0:c.$ref),c instanceof o.SchemaEnv&&(c=c.schema));const h=null===(e=null==c?void 0:c.properties)||void 0===e?void 0:e[f];if("object"!=typeof h)throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${f}"`);n=n&&(r||i(c)),a(h,t)}if(!n)throw new Error(`discriminator: "${f}" must be required`);return t;function i({required:e}){return Array.isArray(e)&&e.includes(f)}function a(e,t){if(e.const)h(e.const,t);else{if(!e.enum)throw new Error(`discriminator: "properties/${f}" must have "const" or "enum"`);for(const r of e.enum)h(r,t)}}function h(e,r){if("string"!=typeof e||e in t)throw new Error(`discriminator: "${f}" values must be unique strings`);t[e]=r}}();t.if(!1);for(const e in r)t.elseIf(n._`${d} === ${e}`),t.assign(h,p(r[e]));t.else(),e.error(!1,{discrError:i.DiscrError.Mapping,tag:d,tagName:f}),t.endIf()}()),(()=>e.error(!1,{discrError:i.DiscrError.Tag,tag:d,tagName:f}))),e.ok(h)}};t.default=a},7421:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,(r=t.DiscrError||(t.DiscrError={})).Tag="tag",r.Mapping="mapping"},5671:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(2101),i=r(7499),o=r(6951),s=r(4480),a=r(2480),c=[n.default,i.default,(0,o.default)(),s.default,a.metadataVocabulary,a.contentVocabulary];t.default=c},3599:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(5669),i={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>n.str`must match format "${e}"`,params:({schemaCode:e})=>n._`{format: ${e}}`},code(e,t){const{gen:r,data:i,$data:o,schema:s,schemaCode:a,it:c}=e,{opts:u,errSchemaPath:l,schemaEnv:f,self:h}=c;u.validateFormats&&(o?function(){const o=r.scopeValue("formats",{ref:h.formats,code:u.code.formats}),s=r.const("fDef",n._`${o}[${a}]`),c=r.let("fType"),l=r.let("format");r.if(n._`typeof ${s} == "object" && !(${s} instanceof RegExp)`,(()=>r.assign(c,n._`${s}.type || "string"`).assign(l,n._`${s}.validate`)),(()=>r.assign(c,n._`"string"`).assign(l,s))),e.fail$data((0,n.or)(!1===u.strictSchema?n.nil:n._`${a} && !${l}`,function(){const e=f.$async?n._`(${s}.async ? await ${l}(${i}) : ${l}(${i}))`:n._`${l}(${i})`,r=n._`(typeof ${l} == "function" ? ${e} : ${l}.test(${i}))`;return n._`${l} && ${l} !== true && ${c} === ${t} && !${r}`}()))}():function(){const o=h.formats[s];if(!o)return void function(){if(!1!==u.strictSchema)throw new Error(e());function e(){return`unknown format "${s}" ignored in schema at path "${l}"`}h.logger.warn(e())}();if(!0===o)return;const[a,c,d]=function(e){const t=e instanceof RegExp?(0,n.regexpCode)(e):u.code.formats?n._`${u.code.formats}${(0,n.getProperty)(s)}`:void 0,i=r.scopeValue("formats",{key:s,ref:e,code:t});return"object"!=typeof e||e instanceof RegExp?["string",e,i]:[e.type||"string",e.validate,n._`${i}.validate`]}(o);a===t&&e.pass(function(){if("object"==typeof o&&!(o instanceof RegExp)&&o.async){if(!f.$async)throw new Error("async format in sync schema");return n._`await ${d}(${i})`}return"function"==typeof c?n._`${d}(${i})`:n._`${d}.test(${i})`}())}())}};t.default=i},4480:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=[r(3599).default];t.default=n},2480:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},6577:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(5669),i=r(8936),o=r(4285),s={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>n._`{allowedValue: ${e}}`},code(e){const{gen:t,data:r,$data:s,schemaCode:a,schema:c}=e;s||c&&"object"==typeof c?e.fail$data(n._`!${(0,i.useFunc)(t,o.default)}(${r}, ${a})`):e.fail(n._`${c} !== ${r}`)}};t.default=s},9450:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(5669),i=r(8936),o=r(4285),s={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>n._`{allowedValues: ${e}}`},code(e){const{gen:t,data:r,$data:s,schema:a,schemaCode:c,it:u}=e;if(!s&&0===a.length)throw new Error("enum must have non-empty array");const l=a.length>=u.opts.loopEnum;let f;const h=()=>null!=f?f:f=(0,i.useFunc)(t,o.default);let d;if(l||s)d=t.let("valid"),e.block$data(d,(function(){t.assign(d,!1),t.forOf("v",c,(e=>t.if(n._`${h()}(${r}, ${e})`,(()=>t.assign(d,!0).break()))))}));else{if(!Array.isArray(a))throw new Error("ajv implementation error");const e=t.const("vSchema",c);d=(0,n.or)(...a.map(((t,i)=>function(e,t){const i=a[t];return"object"==typeof i&&null!==i?n._`${h()}(${r}, ${e}[${t}])`:n._`${r} === ${i}`}(e,i))))}e.pass(d)}};t.default=s},7499:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(1337),i=r(9706),o=r(9507),s=r(1216),a=r(34),c=r(6962),u=r(1135),l=r(194),f=r(6577),h=r(9450),d=[n.default,i.default,o.default,s.default,a.default,c.default,u.default,l.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},f.default,h.default];t.default=d},1135:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(5669),i={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const r="maxItems"===e?"more":"fewer";return n.str`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:i}=e,o="maxItems"===t?n.operators.GT:n.operators.LT;e.fail$data(n._`${r}.length ${o} ${i}`)}};t.default=i},9507:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(5669),i=r(8936),o=r(9161),s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const r="maxLength"===e?"more":"fewer";return n.str`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:s,it:a}=e,c="maxLength"===t?n.operators.GT:n.operators.LT,u=!1===a.opts.unicode?n._`${r}.length`:n._`${(0,i.useFunc)(e.gen,o.default)}(${r})`;e.fail$data(n._`${u} ${c} ${s}`)}};t.default=s},1337:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(5669),i=n.operators,o={maximum:{okStr:"<=",ok:i.LTE,fail:i.GT},minimum:{okStr:">=",ok:i.GTE,fail:i.LT},exclusiveMaximum:{okStr:"<",ok:i.LT,fail:i.GTE},exclusiveMinimum:{okStr:">",ok:i.GT,fail:i.LTE}},s={message:({keyword:e,schemaCode:t})=>n.str`must be ${o[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>n._`{comparison: ${o[e].okStr}, limit: ${t}}`},a={keyword:Object.keys(o),type:"number",schemaType:"number",$data:!0,error:s,code(e){const{keyword:t,data:r,schemaCode:i}=e;e.fail$data(n._`${r} ${o[t].fail} ${i} || isNaN(${r})`)}};t.default=a},34:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(5669),i={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const r="maxProperties"===e?"more":"fewer";return n.str`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:i}=e,o="maxProperties"===t?n.operators.GT:n.operators.LT;e.fail$data(n._`Object.keys(${r}).length ${o} ${i}`)}};t.default=i},9706:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(5669),i={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>n.str`must be multiple of ${e}`,params:({schemaCode:e})=>n._`{multipleOf: ${e}}`},code(e){const{gen:t,data:r,schemaCode:i,it:o}=e,s=o.opts.multipleOfPrecision,a=t.let("res"),c=s?n._`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:n._`${a} !== parseInt(${a})`;e.fail$data(n._`(${i} === 0 || (${a} = ${r}/${i}, ${c}))`)}};t.default=i},1216:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(3499),i=r(5669),o={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>i.str`must match pattern "${e}"`,params:({schemaCode:e})=>i._`{pattern: ${e}}`},code(e){const{data:t,$data:r,schema:o,schemaCode:s,it:a}=e,c=a.opts.unicodeRegExp?"u":"",u=r?i._`(new RegExp(${s}, ${c}))`:(0,n.usePattern)(e,o);e.fail$data(i._`!${u}.test(${t})`)}};t.default=o},6962:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(3499),i=r(5669),o=r(8936),s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>i.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>i._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:r,schemaCode:s,data:a,$data:c,it:u}=e,{opts:l}=u;if(!c&&0===r.length)return;const f=r.length>=l.loopRequired;if(u.allErrors?function(){if(f||c)e.block$data(i.nil,h);else for(const t of r)(0,n.checkReportMissingProp)(e,t)}():function(){const o=t.let("missing");if(f||c){const r=t.let("valid",!0);e.block$data(r,(()=>function(r,o){e.setParams({missingProperty:r}),t.forOf(r,s,(()=>{t.assign(o,(0,n.propertyInData)(t,a,r,l.ownProperties)),t.if((0,i.not)(o),(()=>{e.error(),t.break()}))}),i.nil)}(o,r))),e.ok(r)}else t.if((0,n.checkMissingProp)(e,r,o)),(0,n.reportMissingProp)(e,o),t.else()}(),l.strictRequired){const t=e.parentSchema.properties,{definedProperties:n}=e.it;for(const e of r)if(void 0===(null==t?void 0:t[e])&&!n.has(e)){const t=`required property "${e}" is not defined at "${u.schemaEnv.baseId+u.errSchemaPath}" (strictRequired)`;(0,o.checkStrictMode)(u,t,u.opts.strictRequired)}}function h(){t.forOf("prop",s,(r=>{e.setParams({missingProperty:r}),t.if((0,n.noPropertyInData)(t,a,r,l.ownProperties),(()=>e.error()))}))}}};t.default=s},194:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(7332),i=r(5669),o=r(8936),s=r(4285),a={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>i.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>i._`{i: ${e}, j: ${t}}`},code(e){const{gen:t,data:r,$data:a,schema:c,parentSchema:u,schemaCode:l,it:f}=e;if(!a&&!c)return;const h=t.let("valid"),d=u.items?(0,n.getSchemaTypes)(u.items):[];function p(o,s){const a=t.name("item"),c=(0,n.checkDataTypes)(d,a,f.opts.strictNumbers,n.DataType.Wrong),u=t.const("indices",i._`{}`);t.for(i._`;${o}--;`,(()=>{t.let(a,i._`${r}[${o}]`),t.if(c,i._`continue`),d.length>1&&t.if(i._`typeof ${a} == "string"`,i._`${a} += "_"`),t.if(i._`typeof ${u}[${a}] == "number"`,(()=>{t.assign(s,i._`${u}[${a}]`),e.error(),t.assign(h,!1).break()})).code(i._`${u}[${a}] = ${o}`)}))}function m(n,a){const c=(0,o.useFunc)(t,s.default),u=t.name("outer");t.label(u).for(i._`;${n}--;`,(()=>t.for(i._`${a} = ${n}; ${a}--;`,(()=>t.if(i._`${c}(${r}[${n}], ${r}[${a}])`,(()=>{e.error(),t.assign(h,!1).break(u)}))))))}e.block$data(h,(function(){const n=t.let("i",i._`${r}.length`),o=t.let("j");e.setParams({i:n,j:o}),t.assign(h,!0),t.if(i._`${n} > 1`,(()=>(d.length>0&&!d.some((e=>"object"===e||"array"===e))?p:m)(n,o)))}),i._`${l} === false`),e.ok(h)}};t.default=a},2943:e=>{var t=e.exports=function(e,t,n){"function"==typeof t&&(n=t,t={}),r(t,"function"==typeof(n=t.cb||n)?n:n.pre||function(){},n.post||function(){},e,"",e)};function r(e,n,i,o,s,a,c,u,l,f){if(o&&"object"==typeof o&&!Array.isArray(o)){for(var h in n(o,s,a,c,u,l,f),o){var d=o[h];if(Array.isArray(d)){if(h in t.arrayKeywords)for(var p=0;p<d.length;p++)r(e,n,i,d[p],s+"/"+h+"/"+p,a,s,h,o,p)}else if(h in t.propsKeywords){if(d&&"object"==typeof d)for(var m in d)r(e,n,i,d[m],s+"/"+h+"/"+m.replace(/~/g,"~0").replace(/\//g,"~1"),a,s,h,o,m)}else(h in t.keywords||e.allKeys&&!(h in t.skipKeywords))&&r(e,n,i,d,s+"/"+h,a,s,h,o)}i(o,s,a,c,u,l,f)}}t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}},2091:function(e,t,r){var n,i;i=function(e){var t=["N","E","A","D"];function r(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function n(e,t){Object.defineProperty(this,"kind",{value:e,enumerable:!0}),t&&t.length&&Object.defineProperty(this,"path",{value:t,enumerable:!0})}function i(e,t,r){i.super_.call(this,"E",e),Object.defineProperty(this,"lhs",{value:t,enumerable:!0}),Object.defineProperty(this,"rhs",{value:r,enumerable:!0})}function o(e,t){o.super_.call(this,"N",e),Object.defineProperty(this,"rhs",{value:t,enumerable:!0})}function s(e,t){s.super_.call(this,"D",e),Object.defineProperty(this,"lhs",{value:t,enumerable:!0})}function a(e,t,r){a.super_.call(this,"A",e),Object.defineProperty(this,"index",{value:t,enumerable:!0}),Object.defineProperty(this,"item",{value:r,enumerable:!0})}function c(e,t,r){var n=e.slice((r||t)+1||e.length);return e.length=t<0?e.length+t:t,e.push.apply(e,n),e}function u(e){var t=typeof e;return"object"!==t?t:e===Math?"math":null===e?"null":Array.isArray(e)?"array":"[object Date]"===Object.prototype.toString.call(e)?"date":"function"==typeof e.toString&&/^\/.*\//.test(e.toString())?"regexp":"object"}function l(e){var t=0;if(0===e.length)return t;for(var r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t&=t;return t}function f(e){var t=0,r=u(e);if("array"===r)return e.forEach((function(e){t+=f(e)})),t+l("[type: array, hash: "+t+"]");if("object"===r){for(var n in e)if(e.hasOwnProperty(n)){var i="[ type: object, key: "+n+", value hash: "+f(e[n])+"]";t+=l(i)}return t}return t+l("[ type: "+r+" ; value: "+e+"]")}function h(e,t,r,n,c,l,d,p){r=r||[],d=d||[];var m=(c=c||[]).slice(0);if(null!=l){if(n){if("function"==typeof n&&n(m,l))return;if("object"==typeof n){if(n.prefilter&&n.prefilter(m,l))return;if(n.normalize){var y=n.normalize(m,l,e,t);y&&(e=y[0],t=y[1])}}}m.push(l)}"regexp"===u(e)&&"regexp"===u(t)&&(e=e.toString(),t=t.toString());var v,g,_,b,w=typeof e,E=typeof t,S="undefined"!==w||d&&d.length>0&&d[d.length-1].lhs&&Object.getOwnPropertyDescriptor(d[d.length-1].lhs,l),O="undefined"!==E||d&&d.length>0&&d[d.length-1].rhs&&Object.getOwnPropertyDescriptor(d[d.length-1].rhs,l);if(!S&&O)r.push(new o(m,t));else if(!O&&S)r.push(new s(m,e));else if(u(e)!==u(t))r.push(new i(m,e,t));else if("date"===u(e)&&e-t!=0)r.push(new i(m,e,t));else if("object"===w&&null!==e&&null!==t){for(v=d.length-1;v>-1;--v)if(d[v].lhs===e){b=!0;break}if(b)e!==t&&r.push(new i(m,e,t));else{if(d.push({lhs:e,rhs:t}),Array.isArray(e)){for(p&&(e.sort((function(e,t){return f(e)-f(t)})),t.sort((function(e,t){return f(e)-f(t)}))),v=t.length-1,g=e.length-1;v>g;)r.push(new a(m,v,new o(void 0,t[v--])));for(;g>v;)r.push(new a(m,g,new s(void 0,e[g--])));for(;v>=0;--v)h(e[v],t[v],r,n,m,v,d,p)}else{var T=Object.keys(e),I=Object.keys(t);for(v=0;v<T.length;++v)_=T[v],(b=I.indexOf(_))>=0?(h(e[_],t[_],r,n,m,_,d,p),I[b]=null):h(e[_],void 0,r,n,m,_,d,p);for(v=0;v<I.length;++v)(_=I[v])&&h(void 0,t[_],r,n,m,_,d,p)}d.length=d.length-1}}else e!==t&&("number"===w&&isNaN(e)&&isNaN(t)||r.push(new i(m,e,t)))}function d(e,t,r,n,i){var o=[];if(h(e,t,o,n,null,null,null,i),r)for(var s=0;s<o.length;++s)r(o[s]);return o}function p(e,t,r,n){var i=d(e,t,n?function(e){e&&n.push(e)}:void 0,r);return n||(i.length?i:void 0)}function m(e,t,r){if(r.path&&r.path.length){var n,i=e[t],o=r.path.length-1;for(n=0;n<o;n++)i=i[r.path[n]];switch(r.kind){case"A":m(i[r.path[n]],r.index,r.item);break;case"D":delete i[r.path[n]];break;case"E":case"N":i[r.path[n]]=r.rhs}}else switch(r.kind){case"A":m(e[t],r.index,r.item);break;case"D":e=c(e,t);break;case"E":case"N":e[t]=r.rhs}return e}function y(e,r,n){if(void 0===n&&r&&~t.indexOf(r.kind)&&(n=r),e&&n&&n.kind){for(var i=e,o=-1,s=n.path?n.path.length-1:0;++o<s;)void 0===i[n.path[o]]&&(i[n.path[o]]=void 0!==n.path[o+1]&&"number"==typeof n.path[o+1]?[]:{}),i=i[n.path[o]];switch(n.kind){case"A":n.path&&void 0===i[n.path[o]]&&(i[n.path[o]]=[]),m(n.path?i[n.path[o]]:i,n.index,n.item);break;case"D":delete i[n.path[o]];break;case"E":case"N":i[n.path[o]]=n.rhs}}}function v(e,t,r){if(r.path&&r.path.length){var n,i=e[t],o=r.path.length-1;for(n=0;n<o;n++)i=i[r.path[n]];switch(r.kind){case"A":v(i[r.path[n]],r.index,r.item);break;case"D":case"E":i[r.path[n]]=r.lhs;break;case"N":delete i[r.path[n]]}}else switch(r.kind){case"A":v(e[t],r.index,r.item);break;case"D":case"E":e[t]=r.lhs;break;case"N":e=c(e,t)}return e}return r(i,n),r(o,n),r(s,n),r(a,n),Object.defineProperties(p,{diff:{value:p,enumerable:!0},orderIndependentDiff:{value:function(e,t,r,n){var i=d(e,t,n?function(e){e&&n.push(e)}:void 0,r,!0);return n||(i.length?i:void 0)},enumerable:!0},observableDiff:{value:d,enumerable:!0},orderIndependentObservableDiff:{value:function(e,t,r,n,i,o,s){return h(e,t,r,n,i,o,s,!0)},enumerable:!0},orderIndepHash:{value:f,enumerable:!0},applyDiff:{value:function(e,t,r){e&&t&&d(e,t,(function(n){r&&!r(e,t,n)||y(e,t,n)}))},enumerable:!0},applyChange:{value:y,enumerable:!0},revertChange:{value:function(e,t,r){if(e&&t&&r&&r.kind){var n,i,o=e;for(i=r.path.length-1,n=0;n<i;n++)void 0===o[r.path[n]]&&(o[r.path[n]]={}),o=o[r.path[n]];switch(r.kind){case"A":v(o[r.path[n]],r.index,r.item);break;case"D":case"E":o[r.path[n]]=r.lhs;break;case"N":delete o[r.path[n]]}}},enumerable:!0},isConflict:{value:function(){return"undefined"!=typeof $conflict},enumerable:!0}}),p.DeepDiff=p,e&&(e.DeepDiff=p),p}(this),void 0===(n=function(){return i}.call(t,r,t,e))||(e.exports=n)},6471:e=>{e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(i=n;0!=i--;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(o=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;0!=i--;){var s=o[i];if(!e(t[s],r[s]))return!1}return!0}return t!=t&&r!=r}},8784:function(e,t,r){var n;e=r.nmd(e),function(){var i,o="Expected a function",s="__lodash_hash_undefined__",a="__lodash_placeholder__",c=32,u=128,l=1/0,f=9007199254740991,h=NaN,d=4294967295,p=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",c],["partialRight",64],["rearg",256]],m="[object Arguments]",y="[object Array]",v="[object Boolean]",g="[object Date]",_="[object Error]",b="[object Function]",w="[object GeneratorFunction]",E="[object Map]",S="[object Number]",O="[object Object]",T="[object Promise]",I="[object RegExp]",k="[object Set]",N="[object String]",D="[object Symbol]",A="[object WeakMap]",R="[object ArrayBuffer]",x="[object DataView]",P="[object Float32Array]",$="[object Float64Array]",C="[object Int8Array]",j="[object Int16Array]",M="[object Int32Array]",F="[object Uint8Array]",q="[object Uint8ClampedArray]",V="[object Uint16Array]",L="[object Uint32Array]",U=/\b__p \+= '';/g,Q=/\b(__p \+=) '' \+/g,B=/(__e\(.*?\)|\b__t\)) \+\n'';/g,z=/&(?:amp|lt|gt|quot|#39);/g,Y=/[&<>"']/g,K=RegExp(z.source),H=RegExp(Y.source),G=/<%-([\s\S]+?)%>/g,W=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,X=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,re=RegExp(te.source),ne=/^\s+/,ie=/\s/,oe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,se=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,ce=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ue=/[()=,{}\[\]\/\s]/,le=/\\(\\)?/g,fe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,he=/\w*$/,de=/^[-+]0x[0-9a-f]+$/i,pe=/^0b[01]+$/i,me=/^\[object .+?Constructor\]$/,ye=/^0o[0-7]+$/i,ve=/^(?:0|[1-9]\d*)$/,ge=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_e=/($^)/,be=/['\n\r\u2028\u2029\\]/g,we="\\ud800-\\udfff",Ee="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Se="\\u2700-\\u27bf",Oe="a-z\\xdf-\\xf6\\xf8-\\xff",Te="A-Z\\xc0-\\xd6\\xd8-\\xde",Ie="\\ufe0e\\ufe0f",ke="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ne="["+we+"]",De="["+ke+"]",Ae="["+Ee+"]",Re="\\d+",xe="["+Se+"]",Pe="["+Oe+"]",$e="[^"+we+ke+Re+Se+Oe+Te+"]",Ce="\\ud83c[\\udffb-\\udfff]",je="[^"+we+"]",Me="(?:\\ud83c[\\udde6-\\uddff]){2}",Fe="[\\ud800-\\udbff][\\udc00-\\udfff]",qe="["+Te+"]",Ve="\\u200d",Le="(?:"+Pe+"|"+$e+")",Ue="(?:"+qe+"|"+$e+")",Qe="(?:['’](?:d|ll|m|re|s|t|ve))?",Be="(?:['’](?:D|LL|M|RE|S|T|VE))?",ze="(?:"+Ae+"|"+Ce+")?",Ye="["+Ie+"]?",Ke=Ye+ze+"(?:"+Ve+"(?:"+[je,Me,Fe].join("|")+")"+Ye+ze+")*",He="(?:"+[xe,Me,Fe].join("|")+")"+Ke,Ge="(?:"+[je+Ae+"?",Ae,Me,Fe,Ne].join("|")+")",We=RegExp("['’]","g"),Je=RegExp(Ae,"g"),Ze=RegExp(Ce+"(?="+Ce+")|"+Ge+Ke,"g"),Xe=RegExp([qe+"?"+Pe+"+"+Qe+"(?="+[De,qe,"$"].join("|")+")",Ue+"+"+Be+"(?="+[De,qe+Le,"$"].join("|")+")",qe+"?"+Le+"+"+Qe,qe+"+"+Be,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Re,He].join("|"),"g"),et=RegExp("["+Ve+we+Ee+Ie+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],nt=-1,it={};it[P]=it[$]=it[C]=it[j]=it[M]=it[F]=it[q]=it[V]=it[L]=!0,it[m]=it[y]=it[R]=it[v]=it[x]=it[g]=it[_]=it[b]=it[E]=it[S]=it[O]=it[I]=it[k]=it[N]=it[A]=!1;var ot={};ot[m]=ot[y]=ot[R]=ot[x]=ot[v]=ot[g]=ot[P]=ot[$]=ot[C]=ot[j]=ot[M]=ot[E]=ot[S]=ot[O]=ot[I]=ot[k]=ot[N]=ot[D]=ot[F]=ot[q]=ot[V]=ot[L]=!0,ot[_]=ot[b]=ot[A]=!1;var st={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},at=parseFloat,ct=parseInt,ut="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,lt="object"==typeof self&&self&&self.Object===Object&&self,ft=ut||lt||Function("return this")(),ht=t&&!t.nodeType&&t,dt=ht&&e&&!e.nodeType&&e,pt=dt&&dt.exports===ht,mt=pt&&ut.process,yt=function(){try{return dt&&dt.require&&dt.require("util").types||mt&&mt.binding&&mt.binding("util")}catch(e){}}(),vt=yt&&yt.isArrayBuffer,gt=yt&&yt.isDate,_t=yt&&yt.isMap,bt=yt&&yt.isRegExp,wt=yt&&yt.isSet,Et=yt&&yt.isTypedArray;function St(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function Ot(e,t,r,n){for(var i=-1,o=null==e?0:e.length;++i<o;){var s=e[i];t(n,s,r(s),e)}return n}function Tt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function It(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function kt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}function Nt(e,t){for(var r=-1,n=null==e?0:e.length,i=0,o=[];++r<n;){var s=e[r];t(s,r,e)&&(o[i++]=s)}return o}function Dt(e,t){return!(null==e||!e.length)&&qt(e,t,0)>-1}function At(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}function Rt(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function xt(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function Pt(e,t,r,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(r=e[++i]);++i<o;)r=t(r,e[i],i,e);return r}function $t(e,t,r,n){var i=null==e?0:e.length;for(n&&i&&(r=e[--i]);i--;)r=t(r,e[i],i,e);return r}function Ct(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var jt=Qt("length");function Mt(e,t,r){var n;return r(e,(function(e,r,i){if(t(e,r,i))return n=r,!1})),n}function Ft(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function qt(e,t,r){return t==t?function(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}(e,t,r):Ft(e,Lt,r)}function Vt(e,t,r,n){for(var i=r-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function Lt(e){return e!=e}function Ut(e,t){var r=null==e?0:e.length;return r?Yt(e,t)/r:h}function Qt(e){return function(t){return null==t?i:t[e]}}function Bt(e){return function(t){return null==e?i:e[t]}}function zt(e,t,r,n,i){return i(e,(function(e,i,o){r=n?(n=!1,e):t(r,e,i,o)})),r}function Yt(e,t){for(var r,n=-1,o=e.length;++n<o;){var s=t(e[n]);s!==i&&(r=r===i?s:r+s)}return r}function Kt(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Ht(e){return e?e.slice(0,fr(e)+1).replace(ne,""):e}function Gt(e){return function(t){return e(t)}}function Wt(e,t){return Rt(t,(function(t){return e[t]}))}function Jt(e,t){return e.has(t)}function Zt(e,t){for(var r=-1,n=e.length;++r<n&&qt(t,e[r],0)>-1;);return r}function Xt(e,t){for(var r=e.length;r--&&qt(t,e[r],0)>-1;);return r}var er=Bt({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),tr=Bt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function rr(e){return"\\"+st[e]}function nr(e){return et.test(e)}function ir(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function or(e,t){return function(r){return e(t(r))}}function sr(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var s=e[r];s!==t&&s!==a||(e[r]=a,o[i++]=r)}return o}function ar(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}function cr(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=[e,e]})),r}function ur(e){return nr(e)?function(e){for(var t=Ze.lastIndex=0;Ze.test(e);)++t;return t}(e):jt(e)}function lr(e){return nr(e)?function(e){return e.match(Ze)||[]}(e):function(e){return e.split("")}(e)}function fr(e){for(var t=e.length;t--&&ie.test(e.charAt(t)););return t}var hr=Bt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),dr=function e(t){var r,n=(t=null==t?ft:dr.defaults(ft.Object(),t,dr.pick(ft,rt))).Array,ie=t.Date,we=t.Error,Ee=t.Function,Se=t.Math,Oe=t.Object,Te=t.RegExp,Ie=t.String,ke=t.TypeError,Ne=n.prototype,De=Ee.prototype,Ae=Oe.prototype,Re=t["__core-js_shared__"],xe=De.toString,Pe=Ae.hasOwnProperty,$e=0,Ce=(r=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",je=Ae.toString,Me=xe.call(Oe),Fe=ft._,qe=Te("^"+xe.call(Pe).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ve=pt?t.Buffer:i,Le=t.Symbol,Ue=t.Uint8Array,Qe=Ve?Ve.allocUnsafe:i,Be=or(Oe.getPrototypeOf,Oe),ze=Oe.create,Ye=Ae.propertyIsEnumerable,Ke=Ne.splice,He=Le?Le.isConcatSpreadable:i,Ge=Le?Le.iterator:i,Ze=Le?Le.toStringTag:i,et=function(){try{var e=co(Oe,"defineProperty");return e({},"",{}),e}catch(e){}}(),st=t.clearTimeout!==ft.clearTimeout&&t.clearTimeout,ut=ie&&ie.now!==ft.Date.now&&ie.now,lt=t.setTimeout!==ft.setTimeout&&t.setTimeout,ht=Se.ceil,dt=Se.floor,mt=Oe.getOwnPropertySymbols,yt=Ve?Ve.isBuffer:i,jt=t.isFinite,Bt=Ne.join,pr=or(Oe.keys,Oe),mr=Se.max,yr=Se.min,vr=ie.now,gr=t.parseInt,_r=Se.random,br=Ne.reverse,wr=co(t,"DataView"),Er=co(t,"Map"),Sr=co(t,"Promise"),Or=co(t,"Set"),Tr=co(t,"WeakMap"),Ir=co(Oe,"create"),kr=Tr&&new Tr,Nr={},Dr=Mo(wr),Ar=Mo(Er),Rr=Mo(Sr),xr=Mo(Or),Pr=Mo(Tr),$r=Le?Le.prototype:i,Cr=$r?$r.valueOf:i,jr=$r?$r.toString:i;function Mr(e){if(ea(e)&&!Qs(e)&&!(e instanceof Lr)){if(e instanceof Vr)return e;if(Pe.call(e,"__wrapped__"))return Fo(e)}return new Vr(e)}var Fr=function(){function e(){}return function(t){if(!Xs(t))return{};if(ze)return ze(t);e.prototype=t;var r=new e;return e.prototype=i,r}}();function qr(){}function Vr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function Lr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Ur(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Qr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Br(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function zr(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new Br;++t<r;)this.add(e[t])}function Yr(e){var t=this.__data__=new Qr(e);this.size=t.size}function Kr(e,t){var r=Qs(e),n=!r&&Us(e),i=!r&&!n&&Ks(e),o=!r&&!n&&!i&&ca(e),s=r||n||i||o,a=s?Kt(e.length,Ie):[],c=a.length;for(var u in e)!t&&!Pe.call(e,u)||s&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||yo(u,c))||a.push(u);return a}function Hr(e){var t=e.length;return t?e[zn(0,t-1)]:i}function Gr(e,t){return xo(Ii(e),on(t,0,e.length))}function Wr(e){return xo(Ii(e))}function Jr(e,t,r){(r!==i&&!qs(e[t],r)||r===i&&!(t in e))&&rn(e,t,r)}function Zr(e,t,r){var n=e[t];Pe.call(e,t)&&qs(n,r)&&(r!==i||t in e)||rn(e,t,r)}function Xr(e,t){for(var r=e.length;r--;)if(qs(e[r][0],t))return r;return-1}function en(e,t,r,n){return ln(e,(function(e,i,o){t(n,e,r(e),o)})),n}function tn(e,t){return e&&ki(t,Aa(t),e)}function rn(e,t,r){"__proto__"==t&&et?et(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function nn(e,t){for(var r=-1,o=t.length,s=n(o),a=null==e;++r<o;)s[r]=a?i:Ta(e,t[r]);return s}function on(e,t,r){return e==e&&(r!==i&&(e=e<=r?e:r),t!==i&&(e=e>=t?e:t)),e}function sn(e,t,r,n,o,s){var a,c=1&t,u=2&t,l=4&t;if(r&&(a=o?r(e,n,o,s):r(e)),a!==i)return a;if(!Xs(e))return e;var f=Qs(e);if(f){if(a=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&Pe.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!c)return Ii(e,a)}else{var h=fo(e),d=h==b||h==w;if(Ks(e))return bi(e,c);if(h==O||h==m||d&&!o){if(a=u||d?{}:po(e),!c)return u?function(e,t){return ki(e,lo(e),t)}(e,function(e,t){return e&&ki(t,Ra(t),e)}(a,e)):function(e,t){return ki(e,uo(e),t)}(e,tn(a,e))}else{if(!ot[h])return o?e:{};a=function(e,t,r){var n,i=e.constructor;switch(t){case R:return wi(e);case v:case g:return new i(+e);case x:return function(e,t){var r=t?wi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case P:case $:case C:case j:case M:case F:case q:case V:case L:return Ei(e,r);case E:return new i;case S:case N:return new i(e);case I:return function(e){var t=new e.constructor(e.source,he.exec(e));return t.lastIndex=e.lastIndex,t}(e);case k:return new i;case D:return n=e,Cr?Oe(Cr.call(n)):{}}}(e,h,c)}}s||(s=new Yr);var p=s.get(e);if(p)return p;s.set(e,a),oa(e)?e.forEach((function(n){a.add(sn(n,t,r,n,e,s))})):ta(e)&&e.forEach((function(n,i){a.set(i,sn(n,t,r,i,e,s))}));var y=f?i:(l?u?to:eo:u?Ra:Aa)(e);return Tt(y||e,(function(n,i){y&&(n=e[i=n]),Zr(a,i,sn(n,t,r,i,e,s))})),a}function an(e,t,r){var n=r.length;if(null==e)return!n;for(e=Oe(e);n--;){var o=r[n],s=t[o],a=e[o];if(a===i&&!(o in e)||!s(a))return!1}return!0}function cn(e,t,r){if("function"!=typeof e)throw new ke(o);return No((function(){e.apply(i,r)}),t)}function un(e,t,r,n){var i=-1,o=Dt,s=!0,a=e.length,c=[],u=t.length;if(!a)return c;r&&(t=Rt(t,Gt(r))),n?(o=At,s=!1):t.length>=200&&(o=Jt,s=!1,t=new zr(t));e:for(;++i<a;){var l=e[i],f=null==r?l:r(l);if(l=n||0!==l?l:0,s&&f==f){for(var h=u;h--;)if(t[h]===f)continue e;c.push(l)}else o(t,f,n)||c.push(l)}return c}Mr.templateSettings={escape:G,evaluate:W,interpolate:J,variable:"",imports:{_:Mr}},Mr.prototype=qr.prototype,Mr.prototype.constructor=Mr,Vr.prototype=Fr(qr.prototype),Vr.prototype.constructor=Vr,Lr.prototype=Fr(qr.prototype),Lr.prototype.constructor=Lr,Ur.prototype.clear=function(){this.__data__=Ir?Ir(null):{},this.size=0},Ur.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ur.prototype.get=function(e){var t=this.__data__;if(Ir){var r=t[e];return r===s?i:r}return Pe.call(t,e)?t[e]:i},Ur.prototype.has=function(e){var t=this.__data__;return Ir?t[e]!==i:Pe.call(t,e)},Ur.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Ir&&t===i?s:t,this},Qr.prototype.clear=function(){this.__data__=[],this.size=0},Qr.prototype.delete=function(e){var t=this.__data__,r=Xr(t,e);return!(r<0||(r==t.length-1?t.pop():Ke.call(t,r,1),--this.size,0))},Qr.prototype.get=function(e){var t=this.__data__,r=Xr(t,e);return r<0?i:t[r][1]},Qr.prototype.has=function(e){return Xr(this.__data__,e)>-1},Qr.prototype.set=function(e,t){var r=this.__data__,n=Xr(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Br.prototype.clear=function(){this.size=0,this.__data__={hash:new Ur,map:new(Er||Qr),string:new Ur}},Br.prototype.delete=function(e){var t=so(this,e).delete(e);return this.size-=t?1:0,t},Br.prototype.get=function(e){return so(this,e).get(e)},Br.prototype.has=function(e){return so(this,e).has(e)},Br.prototype.set=function(e,t){var r=so(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},zr.prototype.add=zr.prototype.push=function(e){return this.__data__.set(e,s),this},zr.prototype.has=function(e){return this.__data__.has(e)},Yr.prototype.clear=function(){this.__data__=new Qr,this.size=0},Yr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Yr.prototype.get=function(e){return this.__data__.get(e)},Yr.prototype.has=function(e){return this.__data__.has(e)},Yr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Qr){var n=r.__data__;if(!Er||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Br(n)}return r.set(e,t),this.size=r.size,this};var ln=Ai(gn),fn=Ai(_n,!0);function hn(e,t){var r=!0;return ln(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function dn(e,t,r){for(var n=-1,o=e.length;++n<o;){var s=e[n],a=t(s);if(null!=a&&(c===i?a==a&&!aa(a):r(a,c)))var c=a,u=s}return u}function pn(e,t){var r=[];return ln(e,(function(e,n,i){t(e,n,i)&&r.push(e)})),r}function mn(e,t,r,n,i){var o=-1,s=e.length;for(r||(r=mo),i||(i=[]);++o<s;){var a=e[o];t>0&&r(a)?t>1?mn(a,t-1,r,n,i):xt(i,a):n||(i[i.length]=a)}return i}var yn=Ri(),vn=Ri(!0);function gn(e,t){return e&&yn(e,t,Aa)}function _n(e,t){return e&&vn(e,t,Aa)}function bn(e,t){return Nt(t,(function(t){return Ws(e[t])}))}function wn(e,t){for(var r=0,n=(t=yi(t,e)).length;null!=e&&r<n;)e=e[jo(t[r++])];return r&&r==n?e:i}function En(e,t,r){var n=t(e);return Qs(e)?n:xt(n,r(e))}function Sn(e){return null==e?e===i?"[object Undefined]":"[object Null]":Ze&&Ze in Oe(e)?function(e){var t=Pe.call(e,Ze),r=e[Ze];try{e[Ze]=i;var n=!0}catch(e){}var o=je.call(e);return n&&(t?e[Ze]=r:delete e[Ze]),o}(e):function(e){return je.call(e)}(e)}function On(e,t){return e>t}function Tn(e,t){return null!=e&&Pe.call(e,t)}function In(e,t){return null!=e&&t in Oe(e)}function kn(e,t,r){for(var o=r?At:Dt,s=e[0].length,a=e.length,c=a,u=n(a),l=1/0,f=[];c--;){var h=e[c];c&&t&&(h=Rt(h,Gt(t))),l=yr(h.length,l),u[c]=!r&&(t||s>=120&&h.length>=120)?new zr(c&&h):i}h=e[0];var d=-1,p=u[0];e:for(;++d<s&&f.length<l;){var m=h[d],y=t?t(m):m;if(m=r||0!==m?m:0,!(p?Jt(p,y):o(f,y,r))){for(c=a;--c;){var v=u[c];if(!(v?Jt(v,y):o(e[c],y,r)))continue e}p&&p.push(y),f.push(m)}}return f}function Nn(e,t,r){var n=null==(e=To(e,t=yi(t,e)))?e:e[jo(Go(t))];return null==n?i:St(n,e,r)}function Dn(e){return ea(e)&&Sn(e)==m}function An(e,t,r,n,o){return e===t||(null==e||null==t||!ea(e)&&!ea(t)?e!=e&&t!=t:function(e,t,r,n,o,s){var a=Qs(e),c=Qs(t),u=a?y:fo(e),l=c?y:fo(t),f=(u=u==m?O:u)==O,h=(l=l==m?O:l)==O,d=u==l;if(d&&Ks(e)){if(!Ks(t))return!1;a=!0,f=!1}if(d&&!f)return s||(s=new Yr),a||ca(e)?Zi(e,t,r,n,o,s):function(e,t,r,n,i,o,s){switch(r){case x:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case R:return!(e.byteLength!=t.byteLength||!o(new Ue(e),new Ue(t)));case v:case g:case S:return qs(+e,+t);case _:return e.name==t.name&&e.message==t.message;case I:case N:return e==t+"";case E:var a=ir;case k:var c=1&n;if(a||(a=ar),e.size!=t.size&&!c)return!1;var u=s.get(e);if(u)return u==t;n|=2,s.set(e,t);var l=Zi(a(e),a(t),n,i,o,s);return s.delete(e),l;case D:if(Cr)return Cr.call(e)==Cr.call(t)}return!1}(e,t,u,r,n,o,s);if(!(1&r)){var p=f&&Pe.call(e,"__wrapped__"),b=h&&Pe.call(t,"__wrapped__");if(p||b){var w=p?e.value():e,T=b?t.value():t;return s||(s=new Yr),o(w,T,r,n,s)}}return!!d&&(s||(s=new Yr),function(e,t,r,n,o,s){var a=1&r,c=eo(e),u=c.length;if(u!=eo(t).length&&!a)return!1;for(var l=u;l--;){var f=c[l];if(!(a?f in t:Pe.call(t,f)))return!1}var h=s.get(e),d=s.get(t);if(h&&d)return h==t&&d==e;var p=!0;s.set(e,t),s.set(t,e);for(var m=a;++l<u;){var y=e[f=c[l]],v=t[f];if(n)var g=a?n(v,y,f,t,e,s):n(y,v,f,e,t,s);if(!(g===i?y===v||o(y,v,r,n,s):g)){p=!1;break}m||(m="constructor"==f)}if(p&&!m){var _=e.constructor,b=t.constructor;_==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof _&&_ instanceof _&&"function"==typeof b&&b instanceof b||(p=!1)}return s.delete(e),s.delete(t),p}(e,t,r,n,o,s))}(e,t,r,n,An,o))}function Rn(e,t,r,n){var o=r.length,s=o,a=!n;if(null==e)return!s;for(e=Oe(e);o--;){var c=r[o];if(a&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++o<s;){var u=(c=r[o])[0],l=e[u],f=c[1];if(a&&c[2]){if(l===i&&!(u in e))return!1}else{var h=new Yr;if(n)var d=n(l,f,u,e,t,h);if(!(d===i?An(f,l,3,n,h):d))return!1}}return!0}function xn(e){return!(!Xs(e)||(t=e,Ce&&Ce in t))&&(Ws(e)?qe:me).test(Mo(e));var t}function Pn(e){return"function"==typeof e?e:null==e?rc:"object"==typeof e?Qs(e)?Fn(e[0],e[1]):Mn(e):fc(e)}function $n(e){if(!wo(e))return pr(e);var t=[];for(var r in Oe(e))Pe.call(e,r)&&"constructor"!=r&&t.push(r);return t}function Cn(e,t){return e<t}function jn(e,t){var r=-1,i=zs(e)?n(e.length):[];return ln(e,(function(e,n,o){i[++r]=t(e,n,o)})),i}function Mn(e){var t=ao(e);return 1==t.length&&t[0][2]?So(t[0][0],t[0][1]):function(r){return r===e||Rn(r,e,t)}}function Fn(e,t){return go(e)&&Eo(t)?So(jo(e),t):function(r){var n=Ta(r,e);return n===i&&n===t?Ia(r,e):An(t,n,3)}}function qn(e,t,r,n,o){e!==t&&yn(t,(function(s,a){if(o||(o=new Yr),Xs(s))!function(e,t,r,n,o,s,a){var c=Io(e,r),u=Io(t,r),l=a.get(u);if(l)Jr(e,r,l);else{var f=s?s(c,u,r+"",e,t,a):i,h=f===i;if(h){var d=Qs(u),p=!d&&Ks(u),m=!d&&!p&&ca(u);f=u,d||p||m?Qs(c)?f=c:Ys(c)?f=Ii(c):p?(h=!1,f=bi(u,!0)):m?(h=!1,f=Ei(u,!0)):f=[]:na(u)||Us(u)?(f=c,Us(c)?f=ya(c):Xs(c)&&!Ws(c)||(f=po(u))):h=!1}h&&(a.set(u,f),o(f,u,n,s,a),a.delete(u)),Jr(e,r,f)}}(e,t,a,r,qn,n,o);else{var c=n?n(Io(e,a),s,a+"",e,t,o):i;c===i&&(c=s),Jr(e,a,c)}}),Ra)}function Vn(e,t){var r=e.length;if(r)return yo(t+=t<0?r:0,r)?e[t]:i}function Ln(e,t,r){t=t.length?Rt(t,(function(e){return Qs(e)?function(t){return wn(t,1===e.length?e[0]:e)}:e})):[rc];var n=-1;t=Rt(t,Gt(oo()));var i=jn(e,(function(e,r,i){var o=Rt(t,(function(t){return t(e)}));return{criteria:o,index:++n,value:e}}));return function(e,t){var n=e.length;for(e.sort((function(e,t){return function(e,t,r){for(var n=-1,i=e.criteria,o=t.criteria,s=i.length,a=r.length;++n<s;){var c=Si(i[n],o[n]);if(c)return n>=a?c:c*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}));n--;)e[n]=e[n].value;return e}(i)}function Un(e,t,r){for(var n=-1,i=t.length,o={};++n<i;){var s=t[n],a=wn(e,s);r(a,s)&&Wn(o,yi(s,e),a)}return o}function Qn(e,t,r,n){var i=n?Vt:qt,o=-1,s=t.length,a=e;for(e===t&&(t=Ii(t)),r&&(a=Rt(e,Gt(r)));++o<s;)for(var c=0,u=t[o],l=r?r(u):u;(c=i(a,l,c,n))>-1;)a!==e&&Ke.call(a,c,1),Ke.call(e,c,1);return e}function Bn(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==o){var o=i;yo(i)?Ke.call(e,i,1):ci(e,i)}}return e}function zn(e,t){return e+dt(_r()*(t-e+1))}function Yn(e,t){var r="";if(!e||t<1||t>f)return r;do{t%2&&(r+=e),(t=dt(t/2))&&(e+=e)}while(t);return r}function Kn(e,t){return Do(Oo(e,t,rc),e+"")}function Hn(e){return Hr(qa(e))}function Gn(e,t){var r=qa(e);return xo(r,on(t,0,r.length))}function Wn(e,t,r,n){if(!Xs(e))return e;for(var o=-1,s=(t=yi(t,e)).length,a=s-1,c=e;null!=c&&++o<s;){var u=jo(t[o]),l=r;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(o!=a){var f=c[u];(l=n?n(f,u,c):i)===i&&(l=Xs(f)?f:yo(t[o+1])?[]:{})}Zr(c,u,l),c=c[u]}return e}var Jn=kr?function(e,t){return kr.set(e,t),e}:rc,Zn=et?function(e,t){return et(e,"toString",{configurable:!0,enumerable:!1,value:Xa(t),writable:!0})}:rc;function Xn(e){return xo(qa(e))}function ei(e,t,r){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var s=n(o);++i<o;)s[i]=e[i+t];return s}function ti(e,t){var r;return ln(e,(function(e,n,i){return!(r=t(e,n,i))})),!!r}function ri(e,t,r){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var o=n+i>>>1,s=e[o];null!==s&&!aa(s)&&(r?s<=t:s<t)?n=o+1:i=o}return i}return ni(e,t,rc,r)}function ni(e,t,r,n){var o=0,s=null==e?0:e.length;if(0===s)return 0;for(var a=(t=r(t))!=t,c=null===t,u=aa(t),l=t===i;o<s;){var f=dt((o+s)/2),h=r(e[f]),d=h!==i,p=null===h,m=h==h,y=aa(h);if(a)var v=n||m;else v=l?m&&(n||d):c?m&&d&&(n||!p):u?m&&d&&!p&&(n||!y):!p&&!y&&(n?h<=t:h<t);v?o=f+1:s=f}return yr(s,4294967294)}function ii(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var s=e[r],a=t?t(s):s;if(!r||!qs(a,c)){var c=a;o[i++]=0===s?0:s}}return o}function oi(e){return"number"==typeof e?e:aa(e)?h:+e}function si(e){if("string"==typeof e)return e;if(Qs(e))return Rt(e,si)+"";if(aa(e))return jr?jr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ai(e,t,r){var n=-1,i=Dt,o=e.length,s=!0,a=[],c=a;if(r)s=!1,i=At;else if(o>=200){var u=t?null:Yi(e);if(u)return ar(u);s=!1,i=Jt,c=new zr}else c=t?[]:a;e:for(;++n<o;){var l=e[n],f=t?t(l):l;if(l=r||0!==l?l:0,s&&f==f){for(var h=c.length;h--;)if(c[h]===f)continue e;t&&c.push(f),a.push(l)}else i(c,f,r)||(c!==a&&c.push(f),a.push(l))}return a}function ci(e,t){return null==(e=To(e,t=yi(t,e)))||delete e[jo(Go(t))]}function ui(e,t,r,n){return Wn(e,t,r(wn(e,t)),n)}function li(e,t,r,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return r?ei(e,n?0:o,n?o+1:i):ei(e,n?o+1:0,n?i:o)}function fi(e,t){var r=e;return r instanceof Lr&&(r=r.value()),Pt(t,(function(e,t){return t.func.apply(t.thisArg,xt([e],t.args))}),r)}function hi(e,t,r){var i=e.length;if(i<2)return i?ai(e[0]):[];for(var o=-1,s=n(i);++o<i;)for(var a=e[o],c=-1;++c<i;)c!=o&&(s[o]=un(s[o]||a,e[c],t,r));return ai(mn(s,1),t,r)}function di(e,t,r){for(var n=-1,o=e.length,s=t.length,a={};++n<o;){var c=n<s?t[n]:i;r(a,e[n],c)}return a}function pi(e){return Ys(e)?e:[]}function mi(e){return"function"==typeof e?e:rc}function yi(e,t){return Qs(e)?e:go(e,t)?[e]:Co(va(e))}var vi=Kn;function gi(e,t,r){var n=e.length;return r=r===i?n:r,!t&&r>=n?e:ei(e,t,r)}var _i=st||function(e){return ft.clearTimeout(e)};function bi(e,t){if(t)return e.slice();var r=e.length,n=Qe?Qe(r):new e.constructor(r);return e.copy(n),n}function wi(e){var t=new e.constructor(e.byteLength);return new Ue(t).set(new Ue(e)),t}function Ei(e,t){var r=t?wi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Si(e,t){if(e!==t){var r=e!==i,n=null===e,o=e==e,s=aa(e),a=t!==i,c=null===t,u=t==t,l=aa(t);if(!c&&!l&&!s&&e>t||s&&a&&u&&!c&&!l||n&&a&&u||!r&&u||!o)return 1;if(!n&&!s&&!l&&e<t||l&&r&&o&&!n&&!s||c&&r&&o||!a&&o||!u)return-1}return 0}function Oi(e,t,r,i){for(var o=-1,s=e.length,a=r.length,c=-1,u=t.length,l=mr(s-a,0),f=n(u+l),h=!i;++c<u;)f[c]=t[c];for(;++o<a;)(h||o<s)&&(f[r[o]]=e[o]);for(;l--;)f[c++]=e[o++];return f}function Ti(e,t,r,i){for(var o=-1,s=e.length,a=-1,c=r.length,u=-1,l=t.length,f=mr(s-c,0),h=n(f+l),d=!i;++o<f;)h[o]=e[o];for(var p=o;++u<l;)h[p+u]=t[u];for(;++a<c;)(d||o<s)&&(h[p+r[a]]=e[o++]);return h}function Ii(e,t){var r=-1,i=e.length;for(t||(t=n(i));++r<i;)t[r]=e[r];return t}function ki(e,t,r,n){var o=!r;r||(r={});for(var s=-1,a=t.length;++s<a;){var c=t[s],u=n?n(r[c],e[c],c,r,e):i;u===i&&(u=e[c]),o?rn(r,c,u):Zr(r,c,u)}return r}function Ni(e,t){return function(r,n){var i=Qs(r)?Ot:en,o=t?t():{};return i(r,e,oo(n,2),o)}}function Di(e){return Kn((function(t,r){var n=-1,o=r.length,s=o>1?r[o-1]:i,a=o>2?r[2]:i;for(s=e.length>3&&"function"==typeof s?(o--,s):i,a&&vo(r[0],r[1],a)&&(s=o<3?i:s,o=1),t=Oe(t);++n<o;){var c=r[n];c&&e(t,c,n,s)}return t}))}function Ai(e,t){return function(r,n){if(null==r)return r;if(!zs(r))return e(r,n);for(var i=r.length,o=t?i:-1,s=Oe(r);(t?o--:++o<i)&&!1!==n(s[o],o,s););return r}}function Ri(e){return function(t,r,n){for(var i=-1,o=Oe(t),s=n(t),a=s.length;a--;){var c=s[e?a:++i];if(!1===r(o[c],c,o))break}return t}}function xi(e){return function(t){var r=nr(t=va(t))?lr(t):i,n=r?r[0]:t.charAt(0),o=r?gi(r,1).join(""):t.slice(1);return n[e]()+o}}function Pi(e){return function(t){return Pt(Wa(Ua(t).replace(We,"")),e,"")}}function $i(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Fr(e.prototype),n=e.apply(r,t);return Xs(n)?n:r}}function Ci(e){return function(t,r,n){var o=Oe(t);if(!zs(t)){var s=oo(r,3);t=Aa(t),r=function(e){return s(o[e],e,o)}}var a=e(t,r,n);return a>-1?o[s?t[a]:a]:i}}function ji(e){return Xi((function(t){var r=t.length,n=r,s=Vr.prototype.thru;for(e&&t.reverse();n--;){var a=t[n];if("function"!=typeof a)throw new ke(o);if(s&&!c&&"wrapper"==no(a))var c=new Vr([],!0)}for(n=c?n:r;++n<r;){var u=no(a=t[n]),l="wrapper"==u?ro(a):i;c=l&&_o(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?c[no(l[0])].apply(c,l[3]):1==a.length&&_o(a)?c[u]():c.thru(a)}return function(){var e=arguments,n=e[0];if(c&&1==e.length&&Qs(n))return c.plant(n).value();for(var i=0,o=r?t[i].apply(this,e):n;++i<r;)o=t[i].call(this,o);return o}}))}function Mi(e,t,r,o,s,a,c,l,f,h){var d=t&u,p=1&t,m=2&t,y=24&t,v=512&t,g=m?i:$i(e);return function u(){for(var _=arguments.length,b=n(_),w=_;w--;)b[w]=arguments[w];if(y)var E=io(u),S=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}(b,E);if(o&&(b=Oi(b,o,s,y)),a&&(b=Ti(b,a,c,y)),_-=S,y&&_<h){var O=sr(b,E);return Bi(e,t,Mi,u.placeholder,r,b,O,l,f,h-_)}var T=p?r:this,I=m?T[e]:e;return _=b.length,l?b=function(e,t){for(var r=e.length,n=yr(t.length,r),o=Ii(e);n--;){var s=t[n];e[n]=yo(s,r)?o[s]:i}return e}(b,l):v&&_>1&&b.reverse(),d&&f<_&&(b.length=f),this&&this!==ft&&this instanceof u&&(I=g||$i(I)),I.apply(T,b)}}function Fi(e,t){return function(r,n){return function(e,t,r,n){return gn(e,(function(e,i,o){t(n,r(e),i,o)})),n}(r,e,t(n),{})}}function qi(e,t){return function(r,n){var o;if(r===i&&n===i)return t;if(r!==i&&(o=r),n!==i){if(o===i)return n;"string"==typeof r||"string"==typeof n?(r=si(r),n=si(n)):(r=oi(r),n=oi(n)),o=e(r,n)}return o}}function Vi(e){return Xi((function(t){return t=Rt(t,Gt(oo())),Kn((function(r){var n=this;return e(t,(function(e){return St(e,n,r)}))}))}))}function Li(e,t){var r=(t=t===i?" ":si(t)).length;if(r<2)return r?Yn(t,e):t;var n=Yn(t,ht(e/ur(t)));return nr(t)?gi(lr(n),0,e).join(""):n.slice(0,e)}function Ui(e){return function(t,r,o){return o&&"number"!=typeof o&&vo(t,r,o)&&(r=o=i),t=ha(t),r===i?(r=t,t=0):r=ha(r),function(e,t,r,i){for(var o=-1,s=mr(ht((t-e)/(r||1)),0),a=n(s);s--;)a[i?s:++o]=e,e+=r;return a}(t,r,o=o===i?t<r?1:-1:ha(o),e)}}function Qi(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=ma(t),r=ma(r)),e(t,r)}}function Bi(e,t,r,n,o,s,a,u,l,f){var h=8&t;t|=h?c:64,4&(t&=~(h?64:c))||(t&=-4);var d=[e,t,o,h?s:i,h?a:i,h?i:s,h?i:a,u,l,f],p=r.apply(i,d);return _o(e)&&ko(p,d),p.placeholder=n,Ao(p,e,t)}function zi(e){var t=Se[e];return function(e,r){if(e=ma(e),(r=null==r?0:yr(da(r),292))&&jt(e)){var n=(va(e)+"e").split("e");return+((n=(va(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var Yi=Or&&1/ar(new Or([,-0]))[1]==l?function(e){return new Or(e)}:ac;function Ki(e){return function(t){var r=fo(t);return r==E?ir(t):r==k?cr(t):function(e,t){return Rt(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Hi(e,t,r,s,l,f,h,d){var p=2&t;if(!p&&"function"!=typeof e)throw new ke(o);var m=s?s.length:0;if(m||(t&=-97,s=l=i),h=h===i?h:mr(da(h),0),d=d===i?d:da(d),m-=l?l.length:0,64&t){var y=s,v=l;s=l=i}var g=p?i:ro(e),_=[e,t,r,s,l,y,v,f,h,d];if(g&&function(e,t){var r=e[1],n=t[1],i=r|n,o=i<131,s=n==u&&8==r||n==u&&256==r&&e[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==r;if(!o&&!s)return e;1&n&&(e[2]=t[2],i|=1&r?0:4);var c=t[3];if(c){var l=e[3];e[3]=l?Oi(l,c,t[4]):c,e[4]=l?sr(e[3],a):t[4]}(c=t[5])&&(l=e[5],e[5]=l?Ti(l,c,t[6]):c,e[6]=l?sr(e[5],a):t[6]),(c=t[7])&&(e[7]=c),n&u&&(e[8]=null==e[8]?t[8]:yr(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(_,g),e=_[0],t=_[1],r=_[2],s=_[3],l=_[4],!(d=_[9]=_[9]===i?p?0:e.length:mr(_[9]-m,0))&&24&t&&(t&=-25),t&&1!=t)b=8==t||16==t?function(e,t,r){var o=$i(e);return function s(){for(var a=arguments.length,c=n(a),u=a,l=io(s);u--;)c[u]=arguments[u];var f=a<3&&c[0]!==l&&c[a-1]!==l?[]:sr(c,l);return(a-=f.length)<r?Bi(e,t,Mi,s.placeholder,i,c,f,i,i,r-a):St(this&&this!==ft&&this instanceof s?o:e,this,c)}}(e,t,d):t!=c&&33!=t||l.length?Mi.apply(i,_):function(e,t,r,i){var o=1&t,s=$i(e);return function t(){for(var a=-1,c=arguments.length,u=-1,l=i.length,f=n(l+c),h=this&&this!==ft&&this instanceof t?s:e;++u<l;)f[u]=i[u];for(;c--;)f[u++]=arguments[++a];return St(h,o?r:this,f)}}(e,t,r,s);else var b=function(e,t,r){var n=1&t,i=$i(e);return function t(){return(this&&this!==ft&&this instanceof t?i:e).apply(n?r:this,arguments)}}(e,t,r);return Ao((g?Jn:ko)(b,_),e,t)}function Gi(e,t,r,n){return e===i||qs(e,Ae[r])&&!Pe.call(n,r)?t:e}function Wi(e,t,r,n,o,s){return Xs(e)&&Xs(t)&&(s.set(t,e),qn(e,t,i,Wi,s),s.delete(t)),e}function Ji(e){return na(e)?i:e}function Zi(e,t,r,n,o,s){var a=1&r,c=e.length,u=t.length;if(c!=u&&!(a&&u>c))return!1;var l=s.get(e),f=s.get(t);if(l&&f)return l==t&&f==e;var h=-1,d=!0,p=2&r?new zr:i;for(s.set(e,t),s.set(t,e);++h<c;){var m=e[h],y=t[h];if(n)var v=a?n(y,m,h,t,e,s):n(m,y,h,e,t,s);if(v!==i){if(v)continue;d=!1;break}if(p){if(!Ct(t,(function(e,t){if(!Jt(p,t)&&(m===e||o(m,e,r,n,s)))return p.push(t)}))){d=!1;break}}else if(m!==y&&!o(m,y,r,n,s)){d=!1;break}}return s.delete(e),s.delete(t),d}function Xi(e){return Do(Oo(e,i,Bo),e+"")}function eo(e){return En(e,Aa,uo)}function to(e){return En(e,Ra,lo)}var ro=kr?function(e){return kr.get(e)}:ac;function no(e){for(var t=e.name+"",r=Nr[t],n=Pe.call(Nr,t)?r.length:0;n--;){var i=r[n],o=i.func;if(null==o||o==e)return i.name}return t}function io(e){return(Pe.call(Mr,"placeholder")?Mr:e).placeholder}function oo(){var e=Mr.iteratee||nc;return e=e===nc?Pn:e,arguments.length?e(arguments[0],arguments[1]):e}function so(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function ao(e){for(var t=Aa(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,Eo(i)]}return t}function co(e,t){var r=function(e,t){return null==e?i:e[t]}(e,t);return xn(r)?r:i}var uo=mt?function(e){return null==e?[]:(e=Oe(e),Nt(mt(e),(function(t){return Ye.call(e,t)})))}:pc,lo=mt?function(e){for(var t=[];e;)xt(t,uo(e)),e=Be(e);return t}:pc,fo=Sn;function ho(e,t,r){for(var n=-1,i=(t=yi(t,e)).length,o=!1;++n<i;){var s=jo(t[n]);if(!(o=null!=e&&r(e,s)))break;e=e[s]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&Zs(i)&&yo(s,i)&&(Qs(e)||Us(e))}function po(e){return"function"!=typeof e.constructor||wo(e)?{}:Fr(Be(e))}function mo(e){return Qs(e)||Us(e)||!!(He&&e&&e[He])}function yo(e,t){var r=typeof e;return!!(t=null==t?f:t)&&("number"==r||"symbol"!=r&&ve.test(e))&&e>-1&&e%1==0&&e<t}function vo(e,t,r){if(!Xs(r))return!1;var n=typeof t;return!!("number"==n?zs(r)&&yo(t,r.length):"string"==n&&t in r)&&qs(r[t],e)}function go(e,t){if(Qs(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!aa(e))||X.test(e)||!Z.test(e)||null!=t&&e in Oe(t)}function _o(e){var t=no(e),r=Mr[t];if("function"!=typeof r||!(t in Lr.prototype))return!1;if(e===r)return!0;var n=ro(r);return!!n&&e===n[0]}(wr&&fo(new wr(new ArrayBuffer(1)))!=x||Er&&fo(new Er)!=E||Sr&&fo(Sr.resolve())!=T||Or&&fo(new Or)!=k||Tr&&fo(new Tr)!=A)&&(fo=function(e){var t=Sn(e),r=t==O?e.constructor:i,n=r?Mo(r):"";if(n)switch(n){case Dr:return x;case Ar:return E;case Rr:return T;case xr:return k;case Pr:return A}return t});var bo=Re?Ws:mc;function wo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ae)}function Eo(e){return e==e&&!Xs(e)}function So(e,t){return function(r){return null!=r&&r[e]===t&&(t!==i||e in Oe(r))}}function Oo(e,t,r){return t=mr(t===i?e.length-1:t,0),function(){for(var i=arguments,o=-1,s=mr(i.length-t,0),a=n(s);++o<s;)a[o]=i[t+o];o=-1;for(var c=n(t+1);++o<t;)c[o]=i[o];return c[t]=r(a),St(e,this,c)}}function To(e,t){return t.length<2?e:wn(e,ei(t,0,-1))}function Io(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var ko=Ro(Jn),No=lt||function(e,t){return ft.setTimeout(e,t)},Do=Ro(Zn);function Ao(e,t,r){var n=t+"";return Do(e,function(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(oe,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return Tt(p,(function(r){var n="_."+r[0];t&r[1]&&!Dt(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(se);return t?t[1].split(ae):[]}(n),r)))}function Ro(e){var t=0,r=0;return function(){var n=vr(),o=16-(n-r);if(r=n,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function xo(e,t){var r=-1,n=e.length,o=n-1;for(t=t===i?n:t;++r<t;){var s=zn(r,o),a=e[s];e[s]=e[r],e[r]=a}return e.length=t,e}var Po,$o,Co=(Po=Ps((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ee,(function(e,r,n,i){t.push(n?i.replace(le,"$1"):r||e)})),t}),(function(e){return 500===$o.size&&$o.clear(),e})),$o=Po.cache,Po);function jo(e){if("string"==typeof e||aa(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Mo(e){if(null!=e){try{return xe.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Fo(e){if(e instanceof Lr)return e.clone();var t=new Vr(e.__wrapped__,e.__chain__);return t.__actions__=Ii(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var qo=Kn((function(e,t){return Ys(e)?un(e,mn(t,1,Ys,!0)):[]})),Vo=Kn((function(e,t){var r=Go(t);return Ys(r)&&(r=i),Ys(e)?un(e,mn(t,1,Ys,!0),oo(r,2)):[]})),Lo=Kn((function(e,t){var r=Go(t);return Ys(r)&&(r=i),Ys(e)?un(e,mn(t,1,Ys,!0),i,r):[]}));function Uo(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:da(r);return i<0&&(i=mr(n+i,0)),Ft(e,oo(t,3),i)}function Qo(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=n-1;return r!==i&&(o=da(r),o=r<0?mr(n+o,0):yr(o,n-1)),Ft(e,oo(t,3),o,!0)}function Bo(e){return null!=e&&e.length?mn(e,1):[]}function zo(e){return e&&e.length?e[0]:i}var Yo=Kn((function(e){var t=Rt(e,pi);return t.length&&t[0]===e[0]?kn(t):[]})),Ko=Kn((function(e){var t=Go(e),r=Rt(e,pi);return t===Go(r)?t=i:r.pop(),r.length&&r[0]===e[0]?kn(r,oo(t,2)):[]})),Ho=Kn((function(e){var t=Go(e),r=Rt(e,pi);return(t="function"==typeof t?t:i)&&r.pop(),r.length&&r[0]===e[0]?kn(r,i,t):[]}));function Go(e){var t=null==e?0:e.length;return t?e[t-1]:i}var Wo=Kn(Jo);function Jo(e,t){return e&&e.length&&t&&t.length?Qn(e,t):e}var Zo=Xi((function(e,t){var r=null==e?0:e.length,n=nn(e,t);return Bn(e,Rt(t,(function(e){return yo(e,r)?+e:e})).sort(Si)),n}));function Xo(e){return null==e?e:br.call(e)}var es=Kn((function(e){return ai(mn(e,1,Ys,!0))})),ts=Kn((function(e){var t=Go(e);return Ys(t)&&(t=i),ai(mn(e,1,Ys,!0),oo(t,2))})),rs=Kn((function(e){var t=Go(e);return t="function"==typeof t?t:i,ai(mn(e,1,Ys,!0),i,t)}));function ns(e){if(!e||!e.length)return[];var t=0;return e=Nt(e,(function(e){if(Ys(e))return t=mr(e.length,t),!0})),Kt(t,(function(t){return Rt(e,Qt(t))}))}function is(e,t){if(!e||!e.length)return[];var r=ns(e);return null==t?r:Rt(r,(function(e){return St(t,i,e)}))}var os=Kn((function(e,t){return Ys(e)?un(e,t):[]})),ss=Kn((function(e){return hi(Nt(e,Ys))})),as=Kn((function(e){var t=Go(e);return Ys(t)&&(t=i),hi(Nt(e,Ys),oo(t,2))})),cs=Kn((function(e){var t=Go(e);return t="function"==typeof t?t:i,hi(Nt(e,Ys),i,t)})),us=Kn(ns),ls=Kn((function(e){var t=e.length,r=t>1?e[t-1]:i;return r="function"==typeof r?(e.pop(),r):i,is(e,r)}));function fs(e){var t=Mr(e);return t.__chain__=!0,t}function hs(e,t){return t(e)}var ds=Xi((function(e){var t=e.length,r=t?e[0]:0,n=this.__wrapped__,o=function(t){return nn(t,e)};return!(t>1||this.__actions__.length)&&n instanceof Lr&&yo(r)?((n=n.slice(r,+r+(t?1:0))).__actions__.push({func:hs,args:[o],thisArg:i}),new Vr(n,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)})),ps=Ni((function(e,t,r){Pe.call(e,r)?++e[r]:rn(e,r,1)})),ms=Ci(Uo),ys=Ci(Qo);function vs(e,t){return(Qs(e)?Tt:ln)(e,oo(t,3))}function gs(e,t){return(Qs(e)?It:fn)(e,oo(t,3))}var _s=Ni((function(e,t,r){Pe.call(e,r)?e[r].push(t):rn(e,r,[t])})),bs=Kn((function(e,t,r){var i=-1,o="function"==typeof t,s=zs(e)?n(e.length):[];return ln(e,(function(e){s[++i]=o?St(t,e,r):Nn(e,t,r)})),s})),ws=Ni((function(e,t,r){rn(e,r,t)}));function Es(e,t){return(Qs(e)?Rt:jn)(e,oo(t,3))}var Ss=Ni((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]})),Os=Kn((function(e,t){if(null==e)return[];var r=t.length;return r>1&&vo(e,t[0],t[1])?t=[]:r>2&&vo(t[0],t[1],t[2])&&(t=[t[0]]),Ln(e,mn(t,1),[])})),Ts=ut||function(){return ft.Date.now()};function Is(e,t,r){return t=r?i:t,t=e&&null==t?e.length:t,Hi(e,u,i,i,i,i,t)}function ks(e,t){var r;if("function"!=typeof t)throw new ke(o);return e=da(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=i),r}}var Ns=Kn((function(e,t,r){var n=1;if(r.length){var i=sr(r,io(Ns));n|=c}return Hi(e,n,t,r,i)})),Ds=Kn((function(e,t,r){var n=3;if(r.length){var i=sr(r,io(Ds));n|=c}return Hi(t,n,e,r,i)}));function As(e,t,r){var n,s,a,c,u,l,f=0,h=!1,d=!1,p=!0;if("function"!=typeof e)throw new ke(o);function m(t){var r=n,o=s;return n=s=i,f=t,c=e.apply(o,r)}function y(e){var r=e-l;return l===i||r>=t||r<0||d&&e-f>=a}function v(){var e=Ts();if(y(e))return g(e);u=No(v,function(e){var r=t-(e-l);return d?yr(r,a-(e-f)):r}(e))}function g(e){return u=i,p&&n?m(e):(n=s=i,c)}function _(){var e=Ts(),r=y(e);if(n=arguments,s=this,l=e,r){if(u===i)return function(e){return f=e,u=No(v,t),h?m(e):c}(l);if(d)return _i(u),u=No(v,t),m(l)}return u===i&&(u=No(v,t)),c}return t=ma(t)||0,Xs(r)&&(h=!!r.leading,a=(d="maxWait"in r)?mr(ma(r.maxWait)||0,t):a,p="trailing"in r?!!r.trailing:p),_.cancel=function(){u!==i&&_i(u),f=0,n=l=s=u=i},_.flush=function(){return u===i?c:g(Ts())},_}var Rs=Kn((function(e,t){return cn(e,1,t)})),xs=Kn((function(e,t,r){return cn(e,ma(t)||0,r)}));function Ps(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new ke(o);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=e.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(Ps.Cache||Br),r}function $s(e){if("function"!=typeof e)throw new ke(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ps.Cache=Br;var Cs=vi((function(e,t){var r=(t=1==t.length&&Qs(t[0])?Rt(t[0],Gt(oo())):Rt(mn(t,1),Gt(oo()))).length;return Kn((function(n){for(var i=-1,o=yr(n.length,r);++i<o;)n[i]=t[i].call(this,n[i]);return St(e,this,n)}))})),js=Kn((function(e,t){var r=sr(t,io(js));return Hi(e,c,i,t,r)})),Ms=Kn((function(e,t){var r=sr(t,io(Ms));return Hi(e,64,i,t,r)})),Fs=Xi((function(e,t){return Hi(e,256,i,i,i,t)}));function qs(e,t){return e===t||e!=e&&t!=t}var Vs=Qi(On),Ls=Qi((function(e,t){return e>=t})),Us=Dn(function(){return arguments}())?Dn:function(e){return ea(e)&&Pe.call(e,"callee")&&!Ye.call(e,"callee")},Qs=n.isArray,Bs=vt?Gt(vt):function(e){return ea(e)&&Sn(e)==R};function zs(e){return null!=e&&Zs(e.length)&&!Ws(e)}function Ys(e){return ea(e)&&zs(e)}var Ks=yt||mc,Hs=gt?Gt(gt):function(e){return ea(e)&&Sn(e)==g};function Gs(e){if(!ea(e))return!1;var t=Sn(e);return t==_||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!na(e)}function Ws(e){if(!Xs(e))return!1;var t=Sn(e);return t==b||t==w||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Js(e){return"number"==typeof e&&e==da(e)}function Zs(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=f}function Xs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ea(e){return null!=e&&"object"==typeof e}var ta=_t?Gt(_t):function(e){return ea(e)&&fo(e)==E};function ra(e){return"number"==typeof e||ea(e)&&Sn(e)==S}function na(e){if(!ea(e)||Sn(e)!=O)return!1;var t=Be(e);if(null===t)return!0;var r=Pe.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&xe.call(r)==Me}var ia=bt?Gt(bt):function(e){return ea(e)&&Sn(e)==I},oa=wt?Gt(wt):function(e){return ea(e)&&fo(e)==k};function sa(e){return"string"==typeof e||!Qs(e)&&ea(e)&&Sn(e)==N}function aa(e){return"symbol"==typeof e||ea(e)&&Sn(e)==D}var ca=Et?Gt(Et):function(e){return ea(e)&&Zs(e.length)&&!!it[Sn(e)]},ua=Qi(Cn),la=Qi((function(e,t){return e<=t}));function fa(e){if(!e)return[];if(zs(e))return sa(e)?lr(e):Ii(e);if(Ge&&e[Ge])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Ge]());var t=fo(e);return(t==E?ir:t==k?ar:qa)(e)}function ha(e){return e?(e=ma(e))===l||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function da(e){var t=ha(e),r=t%1;return t==t?r?t-r:t:0}function pa(e){return e?on(da(e),0,d):0}function ma(e){if("number"==typeof e)return e;if(aa(e))return h;if(Xs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Xs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Ht(e);var r=pe.test(e);return r||ye.test(e)?ct(e.slice(2),r?2:8):de.test(e)?h:+e}function ya(e){return ki(e,Ra(e))}function va(e){return null==e?"":si(e)}var ga=Di((function(e,t){if(wo(t)||zs(t))ki(t,Aa(t),e);else for(var r in t)Pe.call(t,r)&&Zr(e,r,t[r])})),_a=Di((function(e,t){ki(t,Ra(t),e)})),ba=Di((function(e,t,r,n){ki(t,Ra(t),e,n)})),wa=Di((function(e,t,r,n){ki(t,Aa(t),e,n)})),Ea=Xi(nn),Sa=Kn((function(e,t){e=Oe(e);var r=-1,n=t.length,o=n>2?t[2]:i;for(o&&vo(t[0],t[1],o)&&(n=1);++r<n;)for(var s=t[r],a=Ra(s),c=-1,u=a.length;++c<u;){var l=a[c],f=e[l];(f===i||qs(f,Ae[l])&&!Pe.call(e,l))&&(e[l]=s[l])}return e})),Oa=Kn((function(e){return e.push(i,Wi),St(Pa,i,e)}));function Ta(e,t,r){var n=null==e?i:wn(e,t);return n===i?r:n}function Ia(e,t){return null!=e&&ho(e,t,In)}var ka=Fi((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=je.call(t)),e[t]=r}),Xa(rc)),Na=Fi((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=je.call(t)),Pe.call(e,t)?e[t].push(r):e[t]=[r]}),oo),Da=Kn(Nn);function Aa(e){return zs(e)?Kr(e):$n(e)}function Ra(e){return zs(e)?Kr(e,!0):function(e){if(!Xs(e))return function(e){var t=[];if(null!=e)for(var r in Oe(e))t.push(r);return t}(e);var t=wo(e),r=[];for(var n in e)("constructor"!=n||!t&&Pe.call(e,n))&&r.push(n);return r}(e)}var xa=Di((function(e,t,r){qn(e,t,r)})),Pa=Di((function(e,t,r,n){qn(e,t,r,n)})),$a=Xi((function(e,t){var r={};if(null==e)return r;var n=!1;t=Rt(t,(function(t){return t=yi(t,e),n||(n=t.length>1),t})),ki(e,to(e),r),n&&(r=sn(r,7,Ji));for(var i=t.length;i--;)ci(r,t[i]);return r})),Ca=Xi((function(e,t){return null==e?{}:function(e,t){return Un(e,t,(function(t,r){return Ia(e,r)}))}(e,t)}));function ja(e,t){if(null==e)return{};var r=Rt(to(e),(function(e){return[e]}));return t=oo(t),Un(e,r,(function(e,r){return t(e,r[0])}))}var Ma=Ki(Aa),Fa=Ki(Ra);function qa(e){return null==e?[]:Wt(e,Aa(e))}var Va=Pi((function(e,t,r){return t=t.toLowerCase(),e+(r?La(t):t)}));function La(e){return Ga(va(e).toLowerCase())}function Ua(e){return(e=va(e))&&e.replace(ge,er).replace(Je,"")}var Qa=Pi((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),Ba=Pi((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),za=xi("toLowerCase"),Ya=Pi((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()})),Ka=Pi((function(e,t,r){return e+(r?" ":"")+Ga(t)})),Ha=Pi((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Ga=xi("toUpperCase");function Wa(e,t,r){return e=va(e),(t=r?i:t)===i?function(e){return tt.test(e)}(e)?function(e){return e.match(Xe)||[]}(e):function(e){return e.match(ce)||[]}(e):e.match(t)||[]}var Ja=Kn((function(e,t){try{return St(e,i,t)}catch(e){return Gs(e)?e:new we(e)}})),Za=Xi((function(e,t){return Tt(t,(function(t){t=jo(t),rn(e,t,Ns(e[t],e))})),e}));function Xa(e){return function(){return e}}var ec=ji(),tc=ji(!0);function rc(e){return e}function nc(e){return Pn("function"==typeof e?e:sn(e,1))}var ic=Kn((function(e,t){return function(r){return Nn(r,e,t)}})),oc=Kn((function(e,t){return function(r){return Nn(e,r,t)}}));function sc(e,t,r){var n=Aa(t),i=bn(t,n);null!=r||Xs(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=bn(t,Aa(t)));var o=!(Xs(r)&&"chain"in r&&!r.chain),s=Ws(e);return Tt(i,(function(r){var n=t[r];e[r]=n,s&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__);return(r.__actions__=Ii(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,xt([this.value()],arguments))})})),e}function ac(){}var cc=Vi(Rt),uc=Vi(kt),lc=Vi(Ct);function fc(e){return go(e)?Qt(jo(e)):function(e){return function(t){return wn(t,e)}}(e)}var hc=Ui(),dc=Ui(!0);function pc(){return[]}function mc(){return!1}var yc,vc=qi((function(e,t){return e+t}),0),gc=zi("ceil"),_c=qi((function(e,t){return e/t}),1),bc=zi("floor"),wc=qi((function(e,t){return e*t}),1),Ec=zi("round"),Sc=qi((function(e,t){return e-t}),0);return Mr.after=function(e,t){if("function"!=typeof t)throw new ke(o);return e=da(e),function(){if(--e<1)return t.apply(this,arguments)}},Mr.ary=Is,Mr.assign=ga,Mr.assignIn=_a,Mr.assignInWith=ba,Mr.assignWith=wa,Mr.at=Ea,Mr.before=ks,Mr.bind=Ns,Mr.bindAll=Za,Mr.bindKey=Ds,Mr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Qs(e)?e:[e]},Mr.chain=fs,Mr.chunk=function(e,t,r){t=(r?vo(e,t,r):t===i)?1:mr(da(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var s=0,a=0,c=n(ht(o/t));s<o;)c[a++]=ei(e,s,s+=t);return c},Mr.compact=function(e){for(var t=-1,r=null==e?0:e.length,n=0,i=[];++t<r;){var o=e[t];o&&(i[n++]=o)}return i},Mr.concat=function(){var e=arguments.length;if(!e)return[];for(var t=n(e-1),r=arguments[0],i=e;i--;)t[i-1]=arguments[i];return xt(Qs(r)?Ii(r):[r],mn(t,1))},Mr.cond=function(e){var t=null==e?0:e.length,r=oo();return e=t?Rt(e,(function(e){if("function"!=typeof e[1])throw new ke(o);return[r(e[0]),e[1]]})):[],Kn((function(r){for(var n=-1;++n<t;){var i=e[n];if(St(i[0],this,r))return St(i[1],this,r)}}))},Mr.conforms=function(e){return function(e){var t=Aa(e);return function(r){return an(r,e,t)}}(sn(e,1))},Mr.constant=Xa,Mr.countBy=ps,Mr.create=function(e,t){var r=Fr(e);return null==t?r:tn(r,t)},Mr.curry=function e(t,r,n){var o=Hi(t,8,i,i,i,i,i,r=n?i:r);return o.placeholder=e.placeholder,o},Mr.curryRight=function e(t,r,n){var o=Hi(t,16,i,i,i,i,i,r=n?i:r);return o.placeholder=e.placeholder,o},Mr.debounce=As,Mr.defaults=Sa,Mr.defaultsDeep=Oa,Mr.defer=Rs,Mr.delay=xs,Mr.difference=qo,Mr.differenceBy=Vo,Mr.differenceWith=Lo,Mr.drop=function(e,t,r){var n=null==e?0:e.length;return n?ei(e,(t=r||t===i?1:da(t))<0?0:t,n):[]},Mr.dropRight=function(e,t,r){var n=null==e?0:e.length;return n?ei(e,0,(t=n-(t=r||t===i?1:da(t)))<0?0:t):[]},Mr.dropRightWhile=function(e,t){return e&&e.length?li(e,oo(t,3),!0,!0):[]},Mr.dropWhile=function(e,t){return e&&e.length?li(e,oo(t,3),!0):[]},Mr.fill=function(e,t,r,n){var o=null==e?0:e.length;return o?(r&&"number"!=typeof r&&vo(e,t,r)&&(r=0,n=o),function(e,t,r,n){var o=e.length;for((r=da(r))<0&&(r=-r>o?0:o+r),(n=n===i||n>o?o:da(n))<0&&(n+=o),n=r>n?0:pa(n);r<n;)e[r++]=t;return e}(e,t,r,n)):[]},Mr.filter=function(e,t){return(Qs(e)?Nt:pn)(e,oo(t,3))},Mr.flatMap=function(e,t){return mn(Es(e,t),1)},Mr.flatMapDeep=function(e,t){return mn(Es(e,t),l)},Mr.flatMapDepth=function(e,t,r){return r=r===i?1:da(r),mn(Es(e,t),r)},Mr.flatten=Bo,Mr.flattenDeep=function(e){return null!=e&&e.length?mn(e,l):[]},Mr.flattenDepth=function(e,t){return null!=e&&e.length?mn(e,t=t===i?1:da(t)):[]},Mr.flip=function(e){return Hi(e,512)},Mr.flow=ec,Mr.flowRight=tc,Mr.fromPairs=function(e){for(var t=-1,r=null==e?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n},Mr.functions=function(e){return null==e?[]:bn(e,Aa(e))},Mr.functionsIn=function(e){return null==e?[]:bn(e,Ra(e))},Mr.groupBy=_s,Mr.initial=function(e){return null!=e&&e.length?ei(e,0,-1):[]},Mr.intersection=Yo,Mr.intersectionBy=Ko,Mr.intersectionWith=Ho,Mr.invert=ka,Mr.invertBy=Na,Mr.invokeMap=bs,Mr.iteratee=nc,Mr.keyBy=ws,Mr.keys=Aa,Mr.keysIn=Ra,Mr.map=Es,Mr.mapKeys=function(e,t){var r={};return t=oo(t,3),gn(e,(function(e,n,i){rn(r,t(e,n,i),e)})),r},Mr.mapValues=function(e,t){var r={};return t=oo(t,3),gn(e,(function(e,n,i){rn(r,n,t(e,n,i))})),r},Mr.matches=function(e){return Mn(sn(e,1))},Mr.matchesProperty=function(e,t){return Fn(e,sn(t,1))},Mr.memoize=Ps,Mr.merge=xa,Mr.mergeWith=Pa,Mr.method=ic,Mr.methodOf=oc,Mr.mixin=sc,Mr.negate=$s,Mr.nthArg=function(e){return e=da(e),Kn((function(t){return Vn(t,e)}))},Mr.omit=$a,Mr.omitBy=function(e,t){return ja(e,$s(oo(t)))},Mr.once=function(e){return ks(2,e)},Mr.orderBy=function(e,t,r,n){return null==e?[]:(Qs(t)||(t=null==t?[]:[t]),Qs(r=n?i:r)||(r=null==r?[]:[r]),Ln(e,t,r))},Mr.over=cc,Mr.overArgs=Cs,Mr.overEvery=uc,Mr.overSome=lc,Mr.partial=js,Mr.partialRight=Ms,Mr.partition=Ss,Mr.pick=Ca,Mr.pickBy=ja,Mr.property=fc,Mr.propertyOf=function(e){return function(t){return null==e?i:wn(e,t)}},Mr.pull=Wo,Mr.pullAll=Jo,Mr.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?Qn(e,t,oo(r,2)):e},Mr.pullAllWith=function(e,t,r){return e&&e.length&&t&&t.length?Qn(e,t,i,r):e},Mr.pullAt=Zo,Mr.range=hc,Mr.rangeRight=dc,Mr.rearg=Fs,Mr.reject=function(e,t){return(Qs(e)?Nt:pn)(e,$s(oo(t,3)))},Mr.remove=function(e,t){var r=[];if(!e||!e.length)return r;var n=-1,i=[],o=e.length;for(t=oo(t,3);++n<o;){var s=e[n];t(s,n,e)&&(r.push(s),i.push(n))}return Bn(e,i),r},Mr.rest=function(e,t){if("function"!=typeof e)throw new ke(o);return Kn(e,t=t===i?t:da(t))},Mr.reverse=Xo,Mr.sampleSize=function(e,t,r){return t=(r?vo(e,t,r):t===i)?1:da(t),(Qs(e)?Gr:Gn)(e,t)},Mr.set=function(e,t,r){return null==e?e:Wn(e,t,r)},Mr.setWith=function(e,t,r,n){return n="function"==typeof n?n:i,null==e?e:Wn(e,t,r,n)},Mr.shuffle=function(e){return(Qs(e)?Wr:Xn)(e)},Mr.slice=function(e,t,r){var n=null==e?0:e.length;return n?(r&&"number"!=typeof r&&vo(e,t,r)?(t=0,r=n):(t=null==t?0:da(t),r=r===i?n:da(r)),ei(e,t,r)):[]},Mr.sortBy=Os,Mr.sortedUniq=function(e){return e&&e.length?ii(e):[]},Mr.sortedUniqBy=function(e,t){return e&&e.length?ii(e,oo(t,2)):[]},Mr.split=function(e,t,r){return r&&"number"!=typeof r&&vo(e,t,r)&&(t=r=i),(r=r===i?d:r>>>0)?(e=va(e))&&("string"==typeof t||null!=t&&!ia(t))&&!(t=si(t))&&nr(e)?gi(lr(e),0,r):e.split(t,r):[]},Mr.spread=function(e,t){if("function"!=typeof e)throw new ke(o);return t=null==t?0:mr(da(t),0),Kn((function(r){var n=r[t],i=gi(r,0,t);return n&&xt(i,n),St(e,this,i)}))},Mr.tail=function(e){var t=null==e?0:e.length;return t?ei(e,1,t):[]},Mr.take=function(e,t,r){return e&&e.length?ei(e,0,(t=r||t===i?1:da(t))<0?0:t):[]},Mr.takeRight=function(e,t,r){var n=null==e?0:e.length;return n?ei(e,(t=n-(t=r||t===i?1:da(t)))<0?0:t,n):[]},Mr.takeRightWhile=function(e,t){return e&&e.length?li(e,oo(t,3),!1,!0):[]},Mr.takeWhile=function(e,t){return e&&e.length?li(e,oo(t,3)):[]},Mr.tap=function(e,t){return t(e),e},Mr.throttle=function(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new ke(o);return Xs(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),As(e,t,{leading:n,maxWait:t,trailing:i})},Mr.thru=hs,Mr.toArray=fa,Mr.toPairs=Ma,Mr.toPairsIn=Fa,Mr.toPath=function(e){return Qs(e)?Rt(e,jo):aa(e)?[e]:Ii(Co(va(e)))},Mr.toPlainObject=ya,Mr.transform=function(e,t,r){var n=Qs(e),i=n||Ks(e)||ca(e);if(t=oo(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:Xs(e)&&Ws(o)?Fr(Be(e)):{}}return(i?Tt:gn)(e,(function(e,n,i){return t(r,e,n,i)})),r},Mr.unary=function(e){return Is(e,1)},Mr.union=es,Mr.unionBy=ts,Mr.unionWith=rs,Mr.uniq=function(e){return e&&e.length?ai(e):[]},Mr.uniqBy=function(e,t){return e&&e.length?ai(e,oo(t,2)):[]},Mr.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?ai(e,i,t):[]},Mr.unset=function(e,t){return null==e||ci(e,t)},Mr.unzip=ns,Mr.unzipWith=is,Mr.update=function(e,t,r){return null==e?e:ui(e,t,mi(r))},Mr.updateWith=function(e,t,r,n){return n="function"==typeof n?n:i,null==e?e:ui(e,t,mi(r),n)},Mr.values=qa,Mr.valuesIn=function(e){return null==e?[]:Wt(e,Ra(e))},Mr.without=os,Mr.words=Wa,Mr.wrap=function(e,t){return js(mi(t),e)},Mr.xor=ss,Mr.xorBy=as,Mr.xorWith=cs,Mr.zip=us,Mr.zipObject=function(e,t){return di(e||[],t||[],Zr)},Mr.zipObjectDeep=function(e,t){return di(e||[],t||[],Wn)},Mr.zipWith=ls,Mr.entries=Ma,Mr.entriesIn=Fa,Mr.extend=_a,Mr.extendWith=ba,sc(Mr,Mr),Mr.add=vc,Mr.attempt=Ja,Mr.camelCase=Va,Mr.capitalize=La,Mr.ceil=gc,Mr.clamp=function(e,t,r){return r===i&&(r=t,t=i),r!==i&&(r=(r=ma(r))==r?r:0),t!==i&&(t=(t=ma(t))==t?t:0),on(ma(e),t,r)},Mr.clone=function(e){return sn(e,4)},Mr.cloneDeep=function(e){return sn(e,5)},Mr.cloneDeepWith=function(e,t){return sn(e,5,t="function"==typeof t?t:i)},Mr.cloneWith=function(e,t){return sn(e,4,t="function"==typeof t?t:i)},Mr.conformsTo=function(e,t){return null==t||an(e,t,Aa(t))},Mr.deburr=Ua,Mr.defaultTo=function(e,t){return null==e||e!=e?t:e},Mr.divide=_c,Mr.endsWith=function(e,t,r){e=va(e),t=si(t);var n=e.length,o=r=r===i?n:on(da(r),0,n);return(r-=t.length)>=0&&e.slice(r,o)==t},Mr.eq=qs,Mr.escape=function(e){return(e=va(e))&&H.test(e)?e.replace(Y,tr):e},Mr.escapeRegExp=function(e){return(e=va(e))&&re.test(e)?e.replace(te,"\\$&"):e},Mr.every=function(e,t,r){var n=Qs(e)?kt:hn;return r&&vo(e,t,r)&&(t=i),n(e,oo(t,3))},Mr.find=ms,Mr.findIndex=Uo,Mr.findKey=function(e,t){return Mt(e,oo(t,3),gn)},Mr.findLast=ys,Mr.findLastIndex=Qo,Mr.findLastKey=function(e,t){return Mt(e,oo(t,3),_n)},Mr.floor=bc,Mr.forEach=vs,Mr.forEachRight=gs,Mr.forIn=function(e,t){return null==e?e:yn(e,oo(t,3),Ra)},Mr.forInRight=function(e,t){return null==e?e:vn(e,oo(t,3),Ra)},Mr.forOwn=function(e,t){return e&&gn(e,oo(t,3))},Mr.forOwnRight=function(e,t){return e&&_n(e,oo(t,3))},Mr.get=Ta,Mr.gt=Vs,Mr.gte=Ls,Mr.has=function(e,t){return null!=e&&ho(e,t,Tn)},Mr.hasIn=Ia,Mr.head=zo,Mr.identity=rc,Mr.includes=function(e,t,r,n){e=zs(e)?e:qa(e),r=r&&!n?da(r):0;var i=e.length;return r<0&&(r=mr(i+r,0)),sa(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&qt(e,t,r)>-1},Mr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:da(r);return i<0&&(i=mr(n+i,0)),qt(e,t,i)},Mr.inRange=function(e,t,r){return t=ha(t),r===i?(r=t,t=0):r=ha(r),function(e,t,r){return e>=yr(t,r)&&e<mr(t,r)}(e=ma(e),t,r)},Mr.invoke=Da,Mr.isArguments=Us,Mr.isArray=Qs,Mr.isArrayBuffer=Bs,Mr.isArrayLike=zs,Mr.isArrayLikeObject=Ys,Mr.isBoolean=function(e){return!0===e||!1===e||ea(e)&&Sn(e)==v},Mr.isBuffer=Ks,Mr.isDate=Hs,Mr.isElement=function(e){return ea(e)&&1===e.nodeType&&!na(e)},Mr.isEmpty=function(e){if(null==e)return!0;if(zs(e)&&(Qs(e)||"string"==typeof e||"function"==typeof e.splice||Ks(e)||ca(e)||Us(e)))return!e.length;var t=fo(e);if(t==E||t==k)return!e.size;if(wo(e))return!$n(e).length;for(var r in e)if(Pe.call(e,r))return!1;return!0},Mr.isEqual=function(e,t){return An(e,t)},Mr.isEqualWith=function(e,t,r){var n=(r="function"==typeof r?r:i)?r(e,t):i;return n===i?An(e,t,i,r):!!n},Mr.isError=Gs,Mr.isFinite=function(e){return"number"==typeof e&&jt(e)},Mr.isFunction=Ws,Mr.isInteger=Js,Mr.isLength=Zs,Mr.isMap=ta,Mr.isMatch=function(e,t){return e===t||Rn(e,t,ao(t))},Mr.isMatchWith=function(e,t,r){return r="function"==typeof r?r:i,Rn(e,t,ao(t),r)},Mr.isNaN=function(e){return ra(e)&&e!=+e},Mr.isNative=function(e){if(bo(e))throw new we("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return xn(e)},Mr.isNil=function(e){return null==e},Mr.isNull=function(e){return null===e},Mr.isNumber=ra,Mr.isObject=Xs,Mr.isObjectLike=ea,Mr.isPlainObject=na,Mr.isRegExp=ia,Mr.isSafeInteger=function(e){return Js(e)&&e>=-9007199254740991&&e<=f},Mr.isSet=oa,Mr.isString=sa,Mr.isSymbol=aa,Mr.isTypedArray=ca,Mr.isUndefined=function(e){return e===i},Mr.isWeakMap=function(e){return ea(e)&&fo(e)==A},Mr.isWeakSet=function(e){return ea(e)&&"[object WeakSet]"==Sn(e)},Mr.join=function(e,t){return null==e?"":Bt.call(e,t)},Mr.kebabCase=Qa,Mr.last=Go,Mr.lastIndexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=n;return r!==i&&(o=(o=da(r))<0?mr(n+o,0):yr(o,n-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,o):Ft(e,Lt,o,!0)},Mr.lowerCase=Ba,Mr.lowerFirst=za,Mr.lt=ua,Mr.lte=la,Mr.max=function(e){return e&&e.length?dn(e,rc,On):i},Mr.maxBy=function(e,t){return e&&e.length?dn(e,oo(t,2),On):i},Mr.mean=function(e){return Ut(e,rc)},Mr.meanBy=function(e,t){return Ut(e,oo(t,2))},Mr.min=function(e){return e&&e.length?dn(e,rc,Cn):i},Mr.minBy=function(e,t){return e&&e.length?dn(e,oo(t,2),Cn):i},Mr.stubArray=pc,Mr.stubFalse=mc,Mr.stubObject=function(){return{}},Mr.stubString=function(){return""},Mr.stubTrue=function(){return!0},Mr.multiply=wc,Mr.nth=function(e,t){return e&&e.length?Vn(e,da(t)):i},Mr.noConflict=function(){return ft._===this&&(ft._=Fe),this},Mr.noop=ac,Mr.now=Ts,Mr.pad=function(e,t,r){e=va(e);var n=(t=da(t))?ur(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Li(dt(i),r)+e+Li(ht(i),r)},Mr.padEnd=function(e,t,r){e=va(e);var n=(t=da(t))?ur(e):0;return t&&n<t?e+Li(t-n,r):e},Mr.padStart=function(e,t,r){e=va(e);var n=(t=da(t))?ur(e):0;return t&&n<t?Li(t-n,r)+e:e},Mr.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),gr(va(e).replace(ne,""),t||0)},Mr.random=function(e,t,r){if(r&&"boolean"!=typeof r&&vo(e,t,r)&&(t=r=i),r===i&&("boolean"==typeof t?(r=t,t=i):"boolean"==typeof e&&(r=e,e=i)),e===i&&t===i?(e=0,t=1):(e=ha(e),t===i?(t=e,e=0):t=ha(t)),e>t){var n=e;e=t,t=n}if(r||e%1||t%1){var o=_r();return yr(e+o*(t-e+at("1e-"+((o+"").length-1))),t)}return zn(e,t)},Mr.reduce=function(e,t,r){var n=Qs(e)?Pt:zt,i=arguments.length<3;return n(e,oo(t,4),r,i,ln)},Mr.reduceRight=function(e,t,r){var n=Qs(e)?$t:zt,i=arguments.length<3;return n(e,oo(t,4),r,i,fn)},Mr.repeat=function(e,t,r){return t=(r?vo(e,t,r):t===i)?1:da(t),Yn(va(e),t)},Mr.replace=function(){var e=arguments,t=va(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Mr.result=function(e,t,r){var n=-1,o=(t=yi(t,e)).length;for(o||(o=1,e=i);++n<o;){var s=null==e?i:e[jo(t[n])];s===i&&(n=o,s=r),e=Ws(s)?s.call(e):s}return e},Mr.round=Ec,Mr.runInContext=e,Mr.sample=function(e){return(Qs(e)?Hr:Hn)(e)},Mr.size=function(e){if(null==e)return 0;if(zs(e))return sa(e)?ur(e):e.length;var t=fo(e);return t==E||t==k?e.size:$n(e).length},Mr.snakeCase=Ya,Mr.some=function(e,t,r){var n=Qs(e)?Ct:ti;return r&&vo(e,t,r)&&(t=i),n(e,oo(t,3))},Mr.sortedIndex=function(e,t){return ri(e,t)},Mr.sortedIndexBy=function(e,t,r){return ni(e,t,oo(r,2))},Mr.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var n=ri(e,t);if(n<r&&qs(e[n],t))return n}return-1},Mr.sortedLastIndex=function(e,t){return ri(e,t,!0)},Mr.sortedLastIndexBy=function(e,t,r){return ni(e,t,oo(r,2),!0)},Mr.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var r=ri(e,t,!0)-1;if(qs(e[r],t))return r}return-1},Mr.startCase=Ka,Mr.startsWith=function(e,t,r){return e=va(e),r=null==r?0:on(da(r),0,e.length),t=si(t),e.slice(r,r+t.length)==t},Mr.subtract=Sc,Mr.sum=function(e){return e&&e.length?Yt(e,rc):0},Mr.sumBy=function(e,t){return e&&e.length?Yt(e,oo(t,2)):0},Mr.template=function(e,t,r){var n=Mr.templateSettings;r&&vo(e,t,r)&&(t=i),e=va(e),t=ba({},t,n,Gi);var o,s,a=ba({},t.imports,n.imports,Gi),c=Aa(a),u=Wt(a,c),l=0,f=t.interpolate||_e,h="__p += '",d=Te((t.escape||_e).source+"|"+f.source+"|"+(f===J?fe:_e).source+"|"+(t.evaluate||_e).source+"|$","g"),p="//# sourceURL="+(Pe.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++nt+"]")+"\n";e.replace(d,(function(t,r,n,i,a,c){return n||(n=i),h+=e.slice(l,c).replace(be,rr),r&&(o=!0,h+="' +\n__e("+r+") +\n'"),a&&(s=!0,h+="';\n"+a+";\n__p += '"),n&&(h+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),l=c+t.length,t})),h+="';\n";var m=Pe.call(t,"variable")&&t.variable;if(m){if(ue.test(m))throw new we("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(s?h.replace(U,""):h).replace(Q,"$1").replace(B,"$1;"),h="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var y=Ja((function(){return Ee(c,p+"return "+h).apply(i,u)}));if(y.source=h,Gs(y))throw y;return y},Mr.times=function(e,t){if((e=da(e))<1||e>f)return[];var r=d,n=yr(e,d);t=oo(t),e-=d;for(var i=Kt(n,t);++r<e;)t(r);return i},Mr.toFinite=ha,Mr.toInteger=da,Mr.toLength=pa,Mr.toLower=function(e){return va(e).toLowerCase()},Mr.toNumber=ma,Mr.toSafeInteger=function(e){return e?on(da(e),-9007199254740991,f):0===e?e:0},Mr.toString=va,Mr.toUpper=function(e){return va(e).toUpperCase()},Mr.trim=function(e,t,r){if((e=va(e))&&(r||t===i))return Ht(e);if(!e||!(t=si(t)))return e;var n=lr(e),o=lr(t);return gi(n,Zt(n,o),Xt(n,o)+1).join("")},Mr.trimEnd=function(e,t,r){if((e=va(e))&&(r||t===i))return e.slice(0,fr(e)+1);if(!e||!(t=si(t)))return e;var n=lr(e);return gi(n,0,Xt(n,lr(t))+1).join("")},Mr.trimStart=function(e,t,r){if((e=va(e))&&(r||t===i))return e.replace(ne,"");if(!e||!(t=si(t)))return e;var n=lr(e);return gi(n,Zt(n,lr(t))).join("")},Mr.truncate=function(e,t){var r=30,n="...";if(Xs(t)){var o="separator"in t?t.separator:o;r="length"in t?da(t.length):r,n="omission"in t?si(t.omission):n}var s=(e=va(e)).length;if(nr(e)){var a=lr(e);s=a.length}if(r>=s)return e;var c=r-ur(n);if(c<1)return n;var u=a?gi(a,0,c).join(""):e.slice(0,c);if(o===i)return u+n;if(a&&(c+=u.length-c),ia(o)){if(e.slice(c).search(o)){var l,f=u;for(o.global||(o=Te(o.source,va(he.exec(o))+"g")),o.lastIndex=0;l=o.exec(f);)var h=l.index;u=u.slice(0,h===i?c:h)}}else if(e.indexOf(si(o),c)!=c){var d=u.lastIndexOf(o);d>-1&&(u=u.slice(0,d))}return u+n},Mr.unescape=function(e){return(e=va(e))&&K.test(e)?e.replace(z,hr):e},Mr.uniqueId=function(e){var t=++$e;return va(e)+t},Mr.upperCase=Ha,Mr.upperFirst=Ga,Mr.each=vs,Mr.eachRight=gs,Mr.first=zo,sc(Mr,(yc={},gn(Mr,(function(e,t){Pe.call(Mr.prototype,t)||(yc[t]=e)})),yc),{chain:!1}),Mr.VERSION="4.17.21",Tt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Mr[e].placeholder=Mr})),Tt(["drop","take"],(function(e,t){Lr.prototype[e]=function(r){r=r===i?1:mr(da(r),0);var n=this.__filtered__&&!t?new Lr(this):this.clone();return n.__filtered__?n.__takeCount__=yr(r,n.__takeCount__):n.__views__.push({size:yr(r,d),type:e+(n.__dir__<0?"Right":"")}),n},Lr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Tt(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;Lr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:oo(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),Tt(["head","last"],(function(e,t){var r="take"+(t?"Right":"");Lr.prototype[e]=function(){return this[r](1).value()[0]}})),Tt(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");Lr.prototype[e]=function(){return this.__filtered__?new Lr(this):this[r](1)}})),Lr.prototype.compact=function(){return this.filter(rc)},Lr.prototype.find=function(e){return this.filter(e).head()},Lr.prototype.findLast=function(e){return this.reverse().find(e)},Lr.prototype.invokeMap=Kn((function(e,t){return"function"==typeof e?new Lr(this):this.map((function(r){return Nn(r,e,t)}))})),Lr.prototype.reject=function(e){return this.filter($s(oo(e)))},Lr.prototype.slice=function(e,t){e=da(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Lr(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==i&&(r=(t=da(t))<0?r.dropRight(-t):r.take(t-e)),r)},Lr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Lr.prototype.toArray=function(){return this.take(d)},gn(Lr.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),o=Mr[n?"take"+("last"==t?"Right":""):t],s=n||/^find/.test(t);o&&(Mr.prototype[t]=function(){var t=this.__wrapped__,a=n?[1]:arguments,c=t instanceof Lr,u=a[0],l=c||Qs(t),f=function(e){var t=o.apply(Mr,xt([e],a));return n&&h?t[0]:t};l&&r&&"function"==typeof u&&1!=u.length&&(c=l=!1);var h=this.__chain__,d=!!this.__actions__.length,p=s&&!h,m=c&&!d;if(!s&&l){t=m?t:new Lr(this);var y=e.apply(t,a);return y.__actions__.push({func:hs,args:[f],thisArg:i}),new Vr(y,h)}return p&&m?e.apply(this,a):(y=this.thru(f),p?n?y.value()[0]:y.value():y)})})),Tt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Ne[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Mr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(Qs(i)?i:[],e)}return this[r]((function(r){return t.apply(Qs(r)?r:[],e)}))}})),gn(Lr.prototype,(function(e,t){var r=Mr[t];if(r){var n=r.name+"";Pe.call(Nr,n)||(Nr[n]=[]),Nr[n].push({name:t,func:r})}})),Nr[Mi(i,2).name]=[{name:"wrapper",func:i}],Lr.prototype.clone=function(){var e=new Lr(this.__wrapped__);return e.__actions__=Ii(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ii(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ii(this.__views__),e},Lr.prototype.reverse=function(){if(this.__filtered__){var e=new Lr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Lr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=Qs(e),n=t<0,i=r?e.length:0,o=function(e,t,r){for(var n=-1,i=r.length;++n<i;){var o=r[n],s=o.size;switch(o.type){case"drop":e+=s;break;case"dropRight":t-=s;break;case"take":t=yr(t,e+s);break;case"takeRight":e=mr(e,t-s)}}return{start:e,end:t}}(0,i,this.__views__),s=o.start,a=o.end,c=a-s,u=n?a:s-1,l=this.__iteratees__,f=l.length,h=0,d=yr(c,this.__takeCount__);if(!r||!n&&i==c&&d==c)return fi(e,this.__actions__);var p=[];e:for(;c--&&h<d;){for(var m=-1,y=e[u+=t];++m<f;){var v=l[m],g=v.iteratee,_=v.type,b=g(y);if(2==_)y=b;else if(!b){if(1==_)continue e;break e}}p[h++]=y}return p},Mr.prototype.at=ds,Mr.prototype.chain=function(){return fs(this)},Mr.prototype.commit=function(){return new Vr(this.value(),this.__chain__)},Mr.prototype.next=function(){this.__values__===i&&(this.__values__=fa(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Mr.prototype.plant=function(e){for(var t,r=this;r instanceof qr;){var n=Fo(r);n.__index__=0,n.__values__=i,t?o.__wrapped__=n:t=n;var o=n;r=r.__wrapped__}return o.__wrapped__=e,t},Mr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Lr){var t=e;return this.__actions__.length&&(t=new Lr(this)),(t=t.reverse()).__actions__.push({func:hs,args:[Xo],thisArg:i}),new Vr(t,this.__chain__)}return this.thru(Xo)},Mr.prototype.toJSON=Mr.prototype.valueOf=Mr.prototype.value=function(){return fi(this.__wrapped__,this.__actions__)},Mr.prototype.first=Mr.prototype.head,Ge&&(Mr.prototype[Ge]=function(){return this}),Mr}();ft._=dr,(n=function(){return dr}.call(t,r,t,e))===i||(e.exports=n)}.call(this)},2371:function(e,t){!function(e){function t(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(t.length>1){t[0]=t[0].slice(0,-1);for(var n=t.length-1,i=1;i<n;++i)t[i]=t[i].slice(1,-1);return t[n]=t[n].slice(1),t.join("")}return t[0]}function r(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function i(e){return e.toUpperCase()}function o(e){var n="[A-Za-z]",i="[0-9]",o=t(i,"[A-Fa-f]"),s=r(r("%[EFef]"+o+"%"+o+o+"%"+o+o)+"|"+r("%[89A-Fa-f]"+o+"%"+o+o)+"|"+r("%"+o+o)),a="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=t("[\\:\\/\\?\\#\\[\\]\\@]",a),u=e?"[\\uE000-\\uF8FF]":"[]",l=t(n,i,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]"),f=r(n+t(n,i,"[\\+\\-\\.]")+"*"),h=r(r(s+"|"+t(l,a,"[\\:]"))+"*"),d=(r(r("25[0-5]")+"|"+r("2[0-4]"+i)+"|"+r("1"+i+i)+"|"+r("[1-9]"+i)+"|"+i),r(r("25[0-5]")+"|"+r("2[0-4]"+i)+"|"+r("1"+i+i)+"|"+r("0?[1-9]"+i)+"|0?0?"+i)),p=r(d+"\\."+d+"\\."+d+"\\."+d),m=r(o+"{1,4}"),y=r(r(m+"\\:"+m)+"|"+p),v=r(r(m+"\\:")+"{6}"+y),g=r("\\:\\:"+r(m+"\\:")+"{5}"+y),_=r(r(m)+"?\\:\\:"+r(m+"\\:")+"{4}"+y),b=r(r(r(m+"\\:")+"{0,1}"+m)+"?\\:\\:"+r(m+"\\:")+"{3}"+y),w=r(r(r(m+"\\:")+"{0,2}"+m)+"?\\:\\:"+r(m+"\\:")+"{2}"+y),E=r(r(r(m+"\\:")+"{0,3}"+m)+"?\\:\\:"+m+"\\:"+y),S=r(r(r(m+"\\:")+"{0,4}"+m)+"?\\:\\:"+y),O=r(r(r(m+"\\:")+"{0,5}"+m)+"?\\:\\:"+m),T=r(r(r(m+"\\:")+"{0,6}"+m)+"?\\:\\:"),I=r([v,g,_,b,w,E,S,O,T].join("|")),k=r(r(l+"|"+s)+"+"),N=(r(I+"\\%25"+k),r(I+r("\\%25|\\%(?!"+o+"{2})")+k)),D=r("[vV]"+o+"+\\."+t(l,a,"[\\:]")+"+"),A=r("\\["+r(N+"|"+I+"|"+D)+"\\]"),R=r(r(s+"|"+t(l,a))+"*"),x=r(A+"|"+p+"(?!"+R+")|"+R),P=r(i+"*"),$=r(r(h+"@")+"?"+x+r("\\:"+P)+"?"),C=r(s+"|"+t(l,a,"[\\:\\@]")),j=r(C+"*"),M=r(C+"+"),F=r(r(s+"|"+t(l,a,"[\\@]"))+"+"),q=r(r("\\/"+j)+"*"),V=r("\\/"+r(M+q)+"?"),L=r(F+q),U=r(M+q),Q="(?!"+C+")",B=(r(q+"|"+V+"|"+L+"|"+U+"|"+Q),r(r(C+"|"+t("[\\/\\?]",u))+"*")),z=r(r(C+"|[\\/\\?]")+"*"),Y=r(r("\\/\\/"+$+q)+"|"+V+"|"+U+"|"+Q),K=r(f+"\\:"+Y+r("\\?"+B)+"?"+r("\\#"+z)+"?"),H=r(r("\\/\\/"+$+q)+"|"+V+"|"+L+"|"+Q),G=r(H+r("\\?"+B)+"?"+r("\\#"+z)+"?");return r(K+"|"+G),r(f+"\\:"+Y+r("\\?"+B)+"?"),r(r("\\/\\/("+r("("+h+")@")+"?("+x+")"+r("\\:("+P+")")+"?)")+"?("+q+"|"+V+"|"+U+"|"+Q+")"),r("\\?("+B+")"),r("\\#("+z+")"),r(r("\\/\\/("+r("("+h+")@")+"?("+x+")"+r("\\:("+P+")")+"?)")+"?("+q+"|"+V+"|"+L+"|"+Q+")"),r("\\?("+B+")"),r("\\#("+z+")"),r(r("\\/\\/("+r("("+h+")@")+"?("+x+")"+r("\\:("+P+")")+"?)")+"?("+q+"|"+V+"|"+U+"|"+Q+")"),r("\\?("+B+")"),r("\\#("+z+")"),r("("+h+")@"),r("\\:("+P+")"),{NOT_SCHEME:new RegExp(t("[^]",n,i,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(t("[^\\%\\:]",l,a),"g"),NOT_HOST:new RegExp(t("[^\\%\\[\\]\\:]",l,a),"g"),NOT_PATH:new RegExp(t("[^\\%\\/\\:\\@]",l,a),"g"),NOT_PATH_NOSCHEME:new RegExp(t("[^\\%\\/\\@]",l,a),"g"),NOT_QUERY:new RegExp(t("[^\\%]",l,a,"[\\:\\@\\/\\?]",u),"g"),NOT_FRAGMENT:new RegExp(t("[^\\%]",l,a,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(t("[^]",l,a),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(t("[^\\%]",l,c),"g"),PCT_ENCODED:new RegExp(s,"g"),IPV4ADDRESS:new RegExp("^("+p+")$"),IPV6ADDRESS:new RegExp("^\\[?("+I+")"+r(r("\\%25|\\%(?!"+o+"{2})")+"("+k+")")+"?\\]?$")}}var s=o(!1),a=o(!0),c=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{!n&&a.return&&a.return()}finally{if(i)throw o}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},u=2147483647,l=36,f=/^xn--/,h=/[^\0-\x7E]/,d=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,y=String.fromCharCode;function v(e){throw new RangeError(p[e])}function g(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+function(e,t){for(var r=[],n=e.length;n--;)r[n]=t(e[n]);return r}((e=e.replace(d,".")).split("."),t).join(".")}function _(e){for(var t=[],r=0,n=e.length;r<n;){var i=e.charCodeAt(r++);if(i>=55296&&i<=56319&&r<n){var o=e.charCodeAt(r++);56320==(64512&o)?t.push(((1023&i)<<10)+(1023&o)+65536):(t.push(i),r--)}else t.push(i)}return t}var b=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},w=function(e,t,r){var n=0;for(e=r?m(e/700):e>>1,e+=m(e/t);e>455;n+=l)e=m(e/35);return m(n+36*e/(e+38))},E=function(e){var t,r=[],n=e.length,i=0,o=128,s=72,a=e.lastIndexOf("-");a<0&&(a=0);for(var c=0;c<a;++c)e.charCodeAt(c)>=128&&v("not-basic"),r.push(e.charCodeAt(c));for(var f=a>0?a+1:0;f<n;){for(var h=i,d=1,p=l;;p+=l){f>=n&&v("invalid-input");var y=(t=e.charCodeAt(f++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:l;(y>=l||y>m((u-i)/d))&&v("overflow"),i+=y*d;var g=p<=s?1:p>=s+26?26:p-s;if(y<g)break;var _=l-g;d>m(u/_)&&v("overflow"),d*=_}var b=r.length+1;s=w(i-h,b,0==h),m(i/b)>u-o&&v("overflow"),o+=m(i/b),i%=b,r.splice(i++,0,o)}return String.fromCodePoint.apply(String,r)},S=function(e){var t=[],r=(e=_(e)).length,n=128,i=0,o=72,s=!0,a=!1,c=void 0;try{for(var f,h=e[Symbol.iterator]();!(s=(f=h.next()).done);s=!0){var d=f.value;d<128&&t.push(y(d))}}catch(e){a=!0,c=e}finally{try{!s&&h.return&&h.return()}finally{if(a)throw c}}var p=t.length,g=p;for(p&&t.push("-");g<r;){var E=u,S=!0,O=!1,T=void 0;try{for(var I,k=e[Symbol.iterator]();!(S=(I=k.next()).done);S=!0){var N=I.value;N>=n&&N<E&&(E=N)}}catch(e){O=!0,T=e}finally{try{!S&&k.return&&k.return()}finally{if(O)throw T}}var D=g+1;E-n>m((u-i)/D)&&v("overflow"),i+=(E-n)*D,n=E;var A=!0,R=!1,x=void 0;try{for(var P,$=e[Symbol.iterator]();!(A=(P=$.next()).done);A=!0){var C=P.value;if(C<n&&++i>u&&v("overflow"),C==n){for(var j=i,M=l;;M+=l){var F=M<=o?1:M>=o+26?26:M-o;if(j<F)break;var q=j-F,V=l-F;t.push(y(b(F+q%V,0))),j=m(q/V)}t.push(y(b(j,0))),o=w(i,D,g==p),i=0,++g}}}catch(e){R=!0,x=e}finally{try{!A&&$.return&&$.return()}finally{if(R)throw x}}++i,++n}return t.join("")},O={version:"2.1.0",ucs2:{decode:_,encode:function(e){return String.fromCodePoint.apply(String,function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}(e))}},decode:E,encode:S,toASCII:function(e){return g(e,(function(e){return h.test(e)?"xn--"+S(e):e}))},toUnicode:function(e){return g(e,(function(e){return f.test(e)?E(e.slice(4).toLowerCase()):e}))}},T={};function I(e){var t=e.charCodeAt(0);return t<16?"%0"+t.toString(16).toUpperCase():t<128?"%"+t.toString(16).toUpperCase():t<2048?"%"+(t>>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function k(e){for(var t="",r=0,n=e.length;r<n;){var i=parseInt(e.substr(r+1,2),16);if(i<128)t+=String.fromCharCode(i),r+=3;else if(i>=194&&i<224){if(n-r>=6){var o=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&i)<<6|63&o)}else t+=e.substr(r,6);r+=6}else if(i>=224){if(n-r>=9){var s=parseInt(e.substr(r+4,2),16),a=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&i)<<12|(63&s)<<6|63&a)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function N(e,t){function r(e){var r=k(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,I).replace(t.PCT_ENCODED,i)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,I).replace(t.PCT_ENCODED,i)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,I).replace(t.PCT_ENCODED,i)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,I).replace(t.PCT_ENCODED,i)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,I).replace(t.PCT_ENCODED,i)),e}function D(e){return e.replace(/^0*(.*)/,"$1")||"0"}function A(e,t){var r=e.match(t.IPV4ADDRESS)||[],n=c(r,2)[1];return n?n.split(".").map(D).join("."):e}function R(e,t){var r=e.match(t.IPV6ADDRESS)||[],n=c(r,3),i=n[1],o=n[2];if(i){for(var s=i.toLowerCase().split("::").reverse(),a=c(s,2),u=a[0],l=a[1],f=l?l.split(":").map(D):[],h=u.split(":").map(D),d=t.IPV4ADDRESS.test(h[h.length-1]),p=d?7:8,m=h.length-p,y=Array(p),v=0;v<p;++v)y[v]=f[v]||h[m+v]||"";d&&(y[p-1]=A(y[p-1],t));var g=y.reduce((function(e,t,r){if(!t||"0"===t){var n=e[e.length-1];n&&n.index+n.length===r?n.length++:e.push({index:r,length:1})}return e}),[]).sort((function(e,t){return t.length-e.length}))[0],_=void 0;if(g&&g.length>1){var b=y.slice(0,g.index),w=y.slice(g.index+g.length);_=b.join(":")+"::"+w.join(":")}else _=y.join(":");return o&&(_+="%"+o),_}return e}var x=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,P=void 0==="".match(/(){0}/)[1];function $(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},n=!1!==t.iri?a:s;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var i=e.match(x);if(i){P?(r.scheme=i[1],r.userinfo=i[3],r.host=i[4],r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=i[7],r.fragment=i[8],isNaN(r.port)&&(r.port=i[5])):(r.scheme=i[1]||void 0,r.userinfo=-1!==e.indexOf("@")?i[3]:void 0,r.host=-1!==e.indexOf("//")?i[4]:void 0,r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=-1!==e.indexOf("?")?i[7]:void 0,r.fragment=-1!==e.indexOf("#")?i[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?i[4]:void 0)),r.host&&(r.host=R(A(r.host,n),n)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var o=T[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||o&&o.unicodeSupport)N(r,n);else{if(r.host&&(t.domainHost||o&&o.domainHost))try{r.host=O.toASCII(r.host.replace(n.PCT_ENCODED,k).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}N(r,s)}o&&o.parse&&o.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}var C=/^\.\.?\//,j=/^\/\.(\/|$)/,M=/^\/\.\.(\/|$)/,F=/^\/?(?:.|\n)*?(?=\/|$)/;function q(e){for(var t=[];e.length;)if(e.match(C))e=e.replace(C,"");else if(e.match(j))e=e.replace(j,"/");else if(e.match(M))e=e.replace(M,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(F);if(!r)throw new Error("Unexpected dot segment condition");var n=r[0];e=e.slice(n.length),t.push(n)}return t.join("")}function V(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?a:s,n=[],i=T[(t.scheme||e.scheme||"").toLowerCase()];if(i&&i.serialize&&i.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||i&&i.domainHost)try{e.host=t.iri?O.toUnicode(e.host):O.toASCII(e.host.replace(r.PCT_ENCODED,k).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}N(e,r),"suffix"!==t.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var o=function(e,t){var r=!1!==t.iri?a:s,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(R(A(String(e.host),r),r).replace(r.IPV6ADDRESS,(function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}(e,t);if(void 0!==o&&("suffix"!==t.reference&&n.push("//"),n.push(o),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var c=e.path;t.absolutePath||i&&i.absolutePath||(c=q(c)),void 0===o&&(c=c.replace(/^\/\//,"/%2F")),n.push(c)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function L(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=$(V(e,r),r),t=$(V(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(n.scheme=t.scheme,n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=q(t.path||""),n.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=q(t.path||""),n.query=t.query):(t.path?("/"===t.path.charAt(0)?n.path=q(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:n.path=t.path:n.path="/"+t.path,n.path=q(n.path)),n.query=t.query):(n.path=e.path,void 0!==t.query?n.query=t.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=t.fragment,n}function U(e,t){return e&&e.toString().replace(t&&t.iri?a.PCT_ENCODED:s.PCT_ENCODED,k)}var Q={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var r="https"===String(e.scheme).toLowerCase();return e.port!==(r?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},B={scheme:"https",domainHost:Q.domainHost,parse:Q.parse,serialize:Q.serialize};function z(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var Y={scheme:"ws",domainHost:!0,parse:function(e,t){var r=e;return r.secure=z(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r},serialize:function(e,t){if(e.port!==(z(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var r=e.resourceName.split("?"),n=c(r,2),i=n[0],o=n[1];e.path=i&&"/"!==i?i:void 0,e.query=o,e.resourceName=void 0}return e.fragment=void 0,e}},K={scheme:"wss",domainHost:Y.domainHost,parse:Y.parse,serialize:Y.serialize},H={},G="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",W="[0-9A-Fa-f]",J=r(r("%[EFef]"+W+"%"+W+W+"%"+W+W)+"|"+r("%[89A-Fa-f]"+W+"%"+W+W)+"|"+r("%"+W+W)),Z=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),X=new RegExp(G,"g"),ee=new RegExp(J,"g"),te=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',Z),"g"),re=new RegExp(t("[^]",G,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),ne=re;function ie(e){var t=k(e);return t.match(X)?t:e}var oe={scheme:"mailto",parse:function(e,t){var r=e,n=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var i=!1,o={},s=r.query.split("&"),a=0,c=s.length;a<c;++a){var u=s[a].split("=");switch(u[0]){case"to":for(var l=u[1].split(","),f=0,h=l.length;f<h;++f)n.push(l[f]);break;case"subject":r.subject=U(u[1],t);break;case"body":r.body=U(u[1],t);break;default:i=!0,o[U(u[0],t)]=U(u[1],t)}}i&&(r.headers=o)}r.query=void 0;for(var d=0,p=n.length;d<p;++d){var m=n[d].split("@");if(m[0]=U(m[0]),t.unicodeSupport)m[1]=U(m[1],t).toLowerCase();else try{m[1]=O.toASCII(U(m[1],t).toLowerCase())}catch(e){r.error=r.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[d]=m.join("@")}return r},serialize:function(e,t){var r,n=e,o=null!=(r=e.to)?r instanceof Array?r:"number"!=typeof r.length||r.split||r.setInterval||r.call?[r]:Array.prototype.slice.call(r):[];if(o){for(var s=0,a=o.length;s<a;++s){var c=String(o[s]),u=c.lastIndexOf("@"),l=c.slice(0,u).replace(ee,ie).replace(ee,i).replace(te,I),f=c.slice(u+1);try{f=t.iri?O.toUnicode(f):O.toASCII(U(f,t).toLowerCase())}catch(e){n.error=n.error||"Email address's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+e}o[s]=l+"@"+f}n.path=o.join(",")}var h=e.headers=e.headers||{};e.subject&&(h.subject=e.subject),e.body&&(h.body=e.body);var d=[];for(var p in h)h[p]!==H[p]&&d.push(p.replace(ee,ie).replace(ee,i).replace(re,I)+"="+h[p].replace(ee,ie).replace(ee,i).replace(ne,I));return d.length&&(n.query=d.join("&")),n}},se=/^([^\:]+)\:(.*)/,ae={scheme:"urn",parse:function(e,t){var r=e.path&&e.path.match(se),n=e;if(r){var i=t.scheme||n.scheme||"urn",o=r[1].toLowerCase(),s=r[2],a=i+":"+(t.nid||o),c=T[a];n.nid=o,n.nss=s,n.path=void 0,c&&(n=c.parse(n,t))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,t){var r=t.scheme||e.scheme||"urn",n=e.nid,i=r+":"+(t.nid||n),o=T[i];o&&(e=o.serialize(e,t));var s=e,a=e.nss;return s.path=(n||t.nid)+":"+a,s}},ce=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,ue={scheme:"urn:uuid",parse:function(e,t){var r=e;return r.uuid=r.nss,r.nss=void 0,t.tolerant||r.uuid&&r.uuid.match(ce)||(r.error=r.error||"UUID is not valid."),r},serialize:function(e,t){var r=e;return r.nss=(e.uuid||"").toLowerCase(),r}};T[Q.scheme]=Q,T[B.scheme]=B,T[Y.scheme]=Y,T[K.scheme]=K,T[oe.scheme]=oe,T[ae.scheme]=ae,T[ue.scheme]=ue,e.SCHEMES=T,e.pctEncChar=I,e.pctDecChars=k,e.parse=$,e.removeDotSegments=q,e.serialize=V,e.resolveComponents=L,e.resolve=function(e,t,r){var n=function(e,t){var r=e;if(t)for(var n in t)r[n]=t[n];return r}({scheme:"null"},r);return V(L($(e,n),$(t,n),n,!0),n)},e.normalize=function(e,t){return"string"==typeof e?e=V($(e,t),t):"object"===n(e)&&(e=$(V(e,t),t)),e},e.equal=function(e,t,r){return"string"==typeof e?e=V($(e,r),r):"object"===n(e)&&(e=V(e,r)),"string"==typeof t?t=V($(t,r),r):"object"===n(t)&&(t=V(t,r)),e===t},e.escapeComponent=function(e,t){return e&&e.toString().replace(t&&t.iri?a.ESCAPE:s.ESCAPE,I)},e.unescapeComponent=U,Object.defineProperty(e,"__esModule",{value:!0})}(t)},1143:e=>{e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},1512:e=>{e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')}},i={};function o(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={id:e,loaded:!1,exports:{}};return n[e].call(r.exports,r,r.exports,o),r.loaded=!0,r.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var s={};(()=>{var n,i;o.d(s,{Jk:()=>Je,hx:()=>ze,my:()=>Ke,g6:()=>Oa,jP:()=>Le,zk:()=>We,VE:()=>ec}),function(e){e.database="database",e.api="api",e.observability="observability",e.crm="crm",e.auth="auth",e.ai="ai"}(n||(n={})),function(e){e.built_in_db="built_in_db",e.mongo="mongo",e.mysql="mysql",e.mssql="mssql",e.postgres="postgres",e.cockroach="cockroach",e.api="api",e.graphql="graphql",e.snowflake="snowflake",e.datadog="datadog",e.newrelic="newrelic",e.auth0="auth0",e.jwt_rsa="jwt_rsa",e.jwt_hmac="jwt_hmac",e.ai_assistant="ai_assistant",e.cognito="cognito",e.okta="okta",e.algolia="algolia",e.elastic_observability="elastic_observability",e.elastic_search="elastic_search",e.elastic_enterprise_search="elastic_enterprise_search",e.sentry="sentry",e.sap_hana="sap_hana",e.salesforce_crm="salesforce_crm",e.documentdb="documentdb",e.dynamodb="dynamodb",e.cassandra="cassandra",e.clickhouse="clickhouse",e.alloydb="alloydb",e.spanner="spanner",e.db2="db2",e.mariadb="mariadb",e.oracledb="oracledb",e.redis="redis",e.xata="xata",e.azure_sql="azure_sql"}(i||(i={})),i.built_in_db,i.mongo,i.mysql,i.mssql,i.postgres,i.cockroach,i.snowflake,i.oracledb,i.api,i.graphql,i.datadog,i.newrelic,i.auth0,i.jwt_rsa,i.jwt_hmac,i.cognito,i.okta;var a;i.built_in_db,i.mysql,i.oracledb,i.mssql,i.postgres,i.cockroach,i.mongo,i.api,i.graphql,i.snowflake,i.datadog,Object.keys({us1:"US1 - East",us3:"US3 - West",us5:"US5 - Central",eu1:"EU1 - Europe",ap1:"AP1 - Asia","us1-fed":"US1-FED (FedRamp)"}),i.newrelic,Object.keys({worldwide:"Worldwide",eu:"Europe"}),i.auth0,i.jwt_rsa,i.jwt_hmac,i.ai_assistant,i.cognito,i.okta,i.mysql,i.oracledb,i.mssql,i.postgres,i.cockroach,i.mongo,i.snowflake,i.graphql,i.mysql,i.oracledb,i.mssql,i.snowflake,i.postgres,i.cockroach,i.mongo,i.built_in_db,i.graphql,function(e){e.EVERY_SECOND="* * * * * *",e.EVERY_5_SECONDS="*/5 * * * * *",e.EVERY_10_SECONDS="*/10 * * * * *",e.EVERY_30_SECONDS="*/30 * * * * *",e.EVERY_MINUTE="*/1 * * * *",e.EVERY_5_MINUTES="0 */5 * * * *",e.EVERY_10_MINUTES="0 */10 * * * *",e.EVERY_30_MINUTES="0 */30 * * * *",e.EVERY_HOUR="0 0-23/1 * * *",e.EVERY_2_HOURS="0 0-23/2 * * *",e.EVERY_3_HOURS="0 0-23/3 * * *",e.EVERY_4_HOURS="0 0-23/4 * * *",e.EVERY_5_HOURS="0 0-23/5 * * *",e.EVERY_6_HOURS="0 0-23/6 * * *",e.EVERY_7_HOURS="0 0-23/7 * * *",e.EVERY_8_HOURS="0 0-23/8 * * *",e.EVERY_9_HOURS="0 0-23/9 * * *",e.EVERY_10_HOURS="0 0-23/10 * * *",e.EVERY_11_HOURS="0 0-23/11 * * *",e.EVERY_12_HOURS="0 0-23/12 * * *",e.EVERY_DAY_AT_1AM="0 01 * * *",e.EVERY_DAY_AT_2AM="0 02 * * *",e.EVERY_DAY_AT_3AM="0 03 * * *",e.EVERY_DAY_AT_4AM="0 04 * * *",e.EVERY_DAY_AT_5AM="0 05 * * *",e.EVERY_DAY_AT_6AM="0 06 * * *",e.EVERY_DAY_AT_7AM="0 07 * * *",e.EVERY_DAY_AT_8AM="0 08 * * *",e.EVERY_DAY_AT_9AM="0 09 * * *",e.EVERY_DAY_AT_10AM="0 10 * * *",e.EVERY_DAY_AT_11AM="0 11 * * *",e.EVERY_DAY_AT_NOON="0 12 * * *",e.EVERY_DAY_AT_1PM="0 13 * * *",e.EVERY_DAY_AT_2PM="0 14 * * *",e.EVERY_DAY_AT_3PM="0 15 * * *",e.EVERY_DAY_AT_4PM="0 16 * * *",e.EVERY_DAY_AT_5PM="0 17 * * *",e.EVERY_DAY_AT_6PM="0 18 * * *",e.EVERY_DAY_AT_7PM="0 19 * * *",e.EVERY_DAY_AT_8PM="0 20 * * *",e.EVERY_DAY_AT_9PM="0 21 * * *",e.EVERY_DAY_AT_10PM="0 22 * * *",e.EVERY_DAY_AT_11PM="0 23 * * *",e.EVERY_DAY_AT_MIDNIGHT="0 0 * * *",e.EVERY_WEEK="0 0 * * 0",e.EVERY_WEEKDAY="0 0 * * 1-5",e.EVERY_WEEKEND="0 0 * * 6,0",e.EVERY_1ST_DAY_OF_MONTH_AT_MIDNIGHT="0 0 1 * *",e.EVERY_1ST_DAY_OF_MONTH_AT_NOON="0 12 1 * *",e.EVERY_2ND_HOUR="0 */2 * * *",e.EVERY_2ND_HOUR_FROM_1AM_THROUGH_11PM="0 1-23/2 * * *",e.EVERY_2ND_MONTH="0 0 1 */2 *",e.EVERY_QUARTER="0 0 1 */3 *",e.EVERY_6_MONTHS="0 0 1 */6 *",e.EVERY_YEAR="0 0 1 0 *",e.EVERY_30_MINUTES_BETWEEN_9AM_AND_5PM="0 */30 9-17 * * *",e.EVERY_30_MINUTES_BETWEEN_9AM_AND_6PM="0 */30 9-18 * * *",e.EVERY_30_MINUTES_BETWEEN_10AM_AND_7PM="0 */30 10-19 * * *",e.MONDAY_TO_FRIDAY_AT_1AM="0 0 01 * * 1-5",e.MONDAY_TO_FRIDAY_AT_2AM="0 0 02 * * 1-5",e.MONDAY_TO_FRIDAY_AT_3AM="0 0 03 * * 1-5",e.MONDAY_TO_FRIDAY_AT_4AM="0 0 04 * * 1-5",e.MONDAY_TO_FRIDAY_AT_5AM="0 0 05 * * 1-5",e.MONDAY_TO_FRIDAY_AT_6AM="0 0 06 * * 1-5",e.MONDAY_TO_FRIDAY_AT_7AM="0 0 07 * * 1-5",e.MONDAY_TO_FRIDAY_AT_8AM="0 0 08 * * 1-5",e.MONDAY_TO_FRIDAY_AT_9AM="0 0 09 * * 1-5",e.MONDAY_TO_FRIDAY_AT_09_30AM="0 30 09 * * 1-5",e.MONDAY_TO_FRIDAY_AT_10AM="0 0 10 * * 1-5",e.MONDAY_TO_FRIDAY_AT_11AM="0 0 11 * * 1-5",e.MONDAY_TO_FRIDAY_AT_11_30AM="0 30 11 * * 1-5",e.MONDAY_TO_FRIDAY_AT_12PM="0 0 12 * * 1-5",e.MONDAY_TO_FRIDAY_AT_1PM="0 0 13 * * 1-5",e.MONDAY_TO_FRIDAY_AT_2PM="0 0 14 * * 1-5",e.MONDAY_TO_FRIDAY_AT_3PM="0 0 15 * * 1-5",e.MONDAY_TO_FRIDAY_AT_4PM="0 0 16 * * 1-5",e.MONDAY_TO_FRIDAY_AT_5PM="0 0 17 * * 1-5",e.MONDAY_TO_FRIDAY_AT_6PM="0 0 18 * * 1-5",e.MONDAY_TO_FRIDAY_AT_7PM="0 0 19 * * 1-5",e.MONDAY_TO_FRIDAY_AT_8PM="0 0 20 * * 1-5",e.MONDAY_TO_FRIDAY_AT_9PM="0 0 21 * * 1-5",e.MONDAY_TO_FRIDAY_AT_10PM="0 0 22 * * 1-5",e.MONDAY_TO_FRIDAY_AT_11PM="0 0 23 * * 1-5"}(a||(a={}));var c,u,l=o(8784);function f(e){return null!=e}(u=c||(c={}))[u.CONTINUE=100]="CONTINUE",u[u.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",u[u.PROCESSING=102]="PROCESSING",u[u.EARLYHINTS=103]="EARLYHINTS",u[u.OK=200]="OK",u[u.CREATED=201]="CREATED",u[u.ACCEPTED=202]="ACCEPTED",u[u.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",u[u.NO_CONTENT=204]="NO_CONTENT",u[u.RESET_CONTENT=205]="RESET_CONTENT",u[u.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",u[u.AMBIGUOUS=300]="AMBIGUOUS",u[u.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",u[u.FOUND=302]="FOUND",u[u.SEE_OTHER=303]="SEE_OTHER",u[u.NOT_MODIFIED=304]="NOT_MODIFIED",u[u.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",u[u.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",u[u.BAD_REQUEST=400]="BAD_REQUEST",u[u.UNAUTHORIZED=401]="UNAUTHORIZED",u[u.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",u[u.FORBIDDEN=403]="FORBIDDEN",u[u.NOT_FOUND=404]="NOT_FOUND",u[u.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",u[u.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",u[u.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",u[u.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",u[u.CONFLICT=409]="CONFLICT",u[u.GONE=410]="GONE",u[u.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",u[u.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",u[u.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",u[u.URI_TOO_LONG=414]="URI_TOO_LONG",u[u.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",u[u.REQUESTED_RANGE_NOT_SATISFIABLE=416]="REQUESTED_RANGE_NOT_SATISFIABLE",u[u.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",u[u.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",u[u.MISDIRECTED=421]="MISDIRECTED",u[u.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",u[u.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",u[u.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",u[u.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",u[u.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",u[u.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",u[u.BAD_GATEWAY=502]="BAD_GATEWAY",u[u.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",u[u.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",u[u.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED";class h extends Error{constructor(e,t,r){super(e),this.statusCode=t,this.details=r}}function d(e){if(!(e instanceof Object))throw new Error("Field sort has to be an object");var t,r;m((t=e,r=["fieldName","asc"],!Array.isArray(t)&&[...Object.keys(t)].every((e=>r.includes(e)))),"Field sort should only contain a fieldName and asc"),m(p(e.asc,"boolean"),"Asc needs to be boolean"),function(e){if(!e||"string"!=typeof e)throw new Error("Field name has to be a non-empty string");if("__docId__"!==e&&!e.match(/^[a-zA-Z][a-zA-Z0-9!@#$%^&*~_]{0,49}$/))throw new Error("A Field name can contain only a-z, A-Z, 0-9,!@#$%^&*~_, starting with a letter, at least one character, and up to 50. Field name: "+e)}(e.fieldName)}function p(e,t){return Array.isArray(e)?e.every((e=>typeof e===t)):typeof e===t}function m(e,t){if(e)return;const r="function"==typeof t?t():t;throw r instanceof Error?r:new Error(null!=r?r:"Assertion error")}function y(e,t){return m(e,t),e}function v(e,t,r="."){const n=t.split(r);let i,o=e;for(;o&&n.length;){const e=y(n.shift());if(!(o instanceof Object&&e in o))return;i=o[e],o=i}return i}function g(e){return"object"==typeof e&&Reflect.getPrototypeOf(e)===Object.prototype}function _(e,t,r,n="."){var i;const o=t.split(n);let s=e;for(;o.length;){const e=y(o.shift());if(o.length){const t=g(s[e])&&null!==(i=l.clone(s[e]))&&void 0!==i?i:{};s[e]=t,s=t}else s[e]=r}}function b(e,t,r="."){var n;const i=t.split(r);let o=e;for(;i.length;){const e=y(i.shift());if(i.length){const t=g(o[e])&&null!==(n=l.clone(o[e]))&&void 0!==n?n:{};o[e]=t,o=t}else delete o[e]}}function w(e,t,r){if(e.has(t)){const n=e.get(t);e.delete(t),e.set(r,n)}}function E(e){if(Array.isArray(e))return e.map((e=>E(e)));if("object"!=typeof e||null===e||e instanceof Date)return e;const t=Object.keys(e),r={};return t.sort().forEach((t=>{r[t]=E(e[t])})),r}function S(e){return O(E(e))}function O(e){if(void 0===e)return null;const t=l.cloneDeepWith(e,(e=>l.isDate(e)?{$date:e.toISOString()}:void 0));return JSON.stringify(t)}function T(e){const t=JSON.parse(e);return l.cloneDeepWith(t,(e=>l.isObject(e)&&l.has(e,"$date")&&1===Object.keys(e).length?new Date(e.$date):void 0))}function I(e){if(void 0===e)throw new Error("INVALID_ENCODE_VALUE");const t=O(e);if("undefined"!=typeof Buffer)return Buffer.from(t,"utf8").toString("base64");{const e=(new TextEncoder).encode(t);let r="";for(let t=0;t<e.length;t++)r+=String.fromCharCode(e[t]);return window.btoa(r)}}function k(e){let t;if("undefined"!=typeof Buffer)t=Buffer.from(e,"base64").toString("utf8");else{const r=window.atob(e),n=new Uint8Array(r.length);for(let e=0;e<n.length;e++)n[e]=r.charCodeAt(e);t=(new TextDecoder).decode(n)}return T(t)}class N{}class D extends N{async findQueriesForDocument(e,t,r,n){const i=await this.getMapping(e,r,n);return i?A(i,t):[]}}function A(e,t){var r;const n=[...e.unconditional||[]],i=new Set,o=new Map;for(const[n,s]of Object.entries(e.conditional||{})){const e=k(n);for(const[n,a]of Object.entries(s)){const s=[],c=null!==(r=v(t,e))&&void 0!==r?r:null,u=I(c);switch(n){case"==":s.push(...a[u]||[]);break;case"!=":{(a[u]||[]).forEach((e=>i.add(e)));const e=Object.entries(a).filter((([e])=>e!==u));for(const[t,r]of e)s.push(...r);break}case"<":case"<=":case">":case">=":case"like":case"not like":case"like_cs":case"not like_cs":f(c)&&s.push(...Object.entries(a).filter((([e])=>R(k(e),c,n))).reduce(((e,[t,r])=>(e.push(...r),e)),[]));break;default:throw new Error("Unsupported operator: "+n)}for(const e of s)o.set(e,(o.get(e)||0)+1)}}for(const[t,r]of o.entries())i.has(t)||r>=e.queriesMetadata[t].condCount&&n.push(t);return n}function R(e,t,r){if(null===e||null===t)return!1;switch(r){case"<":return t<e;case"<=":return t<=e;case">":return t>e;case">=":return t>=e;case"like":return"string"==typeof t&&"string"==typeof e&&x(t,e,!1);case"not like":return!("string"==typeof t&&"string"==typeof e&&x(t,e,!1));case"like_cs":return"string"==typeof t&&"string"==typeof e&&x(t,e,!0);case"not like_cs":return!("string"==typeof t&&"string"==typeof e&&x(t,e,!0));default:throw new Error(`Unsupported operator comparison: ${r}`)}}function x(e,t,r){r||(e=e.toLowerCase(),t=t.toLowerCase());const n=t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&").replace(/%/g,".*");return new RegExp(`^${n}$`).test(e)}function P(e,t){return`${e}_${t}`}const $={"in:in":(e,t)=>e.every((e=>t.includes(e))),"in:not in":(e,t)=>e.every((e=>!t.includes(e))),"not in:not in":(e,t)=>t.every((t=>e.includes(t))),">:not in":(e,t)=>t.every((t=>e>=t)),">=:not in":(e,t)=>t.every((t=>e>t)),"<:not in":(e,t)=>t.every((t=>e<=t)),"<=:not in":(e,t)=>t.every((t=>e<t)),">:>":(e,t)=>e>=t,">=:>":(e,t)=>e>t,"in:>":(e,t)=>e.every((e=>e>t)),">:>=":(e,t)=>e>=t,">=:>=":(e,t)=>e>=t,"in:>=":(e,t)=>e.every((e=>e>=t)),"<:<":(e,t)=>e<=t,"<=:<":(e,t)=>e<t,"in:<":(e,t)=>e.every((e=>e<t)),"<:<=":(e,t)=>e<=t,"<=:<=":(e,t)=>e<=t,"in:<=":(e,t)=>e.every((e=>e<=t))};class C{constructor(e){this.query=e,this.query=e,this.parsedConditions=this.parseConditions(this.query.conditions)}get integrationId(){return this.query.integrationId}get collectionName(){return this.query.collectionName}get limit(){return this.query.limit}sortedBy(e){const t=e.find(((e,t)=>{var r;return!(0,l.isEqual)(this.query.sortOrder[t],Object.assign(Object.assign({},e),{asc:null===(r=e.asc)||void 0===r||r}))}));return!t}sortedByExact(e){return e.length===this.query.sortOrder.length&&this.sortedBy(e)}isSubqueryOf(e,t,r){return this.isSubqueryOfCondition({fieldName:e,operator:t,value:r})}isSubqueryOfCondition(e){return!!this.parsedConditions.filter((t=>t.fieldName===e.fieldName)).find((t=>this.evaluateSubset(t,e)))}isSubqueryOfConditions(e){return this.parseConditions(e).every((e=>this.isSubqueryOfCondition(e)))}isSubqueryOfQuery(e){if(e.collectionName!==this.collectionName||e.integrationId!==this.integrationId)return!1;const t=this.isSubqueryOfConditions(e.conditions),r=this.sortedBy(e.sortOrder),n=-1===e.limit||this.limit>-1&&this.limit<e.limit;return t&&r&&n}getConditionsFor(...e){return this.parsedConditions.filter((t=>e.includes(t.fieldName)))}getConditionsForField(e){return this.parsedConditions.filter((t=>t.fieldName===e))}documentMatchesQuery(e){for(const t of this.parsedConditions){const r=t.fieldName,n=t.operator,i=l.get(e,r);if("in"===n){if(t.value.includes(i))continue;return!1}if("not in"!==n){if(!R(t.value,i,n))return!1}else if(t.value.includes(i))return!1}return!0}evaluateSubset(e,t){const{operator:r,value:n}=e,{operator:i,value:o}=this.parseConditions([t])[0],s=$[`${r}:${i}`];return!!s&&s(n,o)}evaluateIncludes(e,t){const{operator:r,value:n}=e,{operator:i,value:o}=this.parseConditions([t])[0],s=Array.isArray(n)?n.sort():n,a=Array.isArray(o)?o.sort():o;return i===r&&(0,l.isEqual)(a,s)}parseConditions(e){const t=[],r=new Map,n=new Map;return e.forEach((e=>{switch(e.operator){case"==":case"in":r.set(e.fieldName,(r.get(e.fieldName)||[]).concat(e.value));break;case"!=":case"not in":n.set(e.fieldName,(n.get(e.fieldName)||[]).concat(e.value));break;default:t.push(e)}})),r.forEach(((e,r)=>{t.push({fieldName:r,operator:"in",value:e})})),n.forEach(((e,r)=>{t.push({fieldName:r,operator:"not in",value:e})})),t}}class j{eq(e,t){return this.where(e,"==",t)}neq(e,t){return this.where(e,"!=",t)}in(e,t){return this.where(e,"in",t)}nin(e,t){return this.where(e,"not in",t)}gt(e,t){return this.where(e,">",t)}gte(e,t){return this.where(e,">=",t)}lt(e,t){return this.where(e,"<",t)}lte(e,t){return this.where(e,"<=",t)}like(e,t,r){return this.where(e,r?"like_cs":"like",t)}notLike(e,t,r){return this.where(e,r?"not like_cs":"not like",t)}}function M(e,t){return`${function(e){const[t,r,n,i]=e.split(/[_-]/);return m(!i,"Invalid appId: "+e),{appId:t,environmentId:null!=r?r:"prod",squidDeveloperId:n}}(e).appId}${t&&"prod"!==t?`-${t}`:""}`}o(2091);const F="__squidId";function q(e){return T(e)}function V(...e){const[t,r,n]=e,i="object"==typeof t?t:{docId:t,collectionName:r,integrationId:n};return i.integrationId||(i.integrationId=void 0),S(i)}var L;!function(e){e.TRACE="trace",e.DEBUG="debug",e.INFO="info",e.WARN="warn",e.ERROR="error"}(L||(L={}));const U=(Q={BehaviorSubject:()=>e.BehaviorSubject,NEVER:()=>e.NEVER,Observable:()=>e.Observable,ReplaySubject:()=>e.ReplaySubject,Subject:()=>e.Subject,combineLatest:()=>e.combineLatest,combineLatestWith:()=>e.combineLatestWith,debounceTime:()=>e.debounceTime,defer:()=>e.defer,delay:()=>e.delay,distinctUntilChanged:()=>e.distinctUntilChanged,filter:()=>e.filter,finalize:()=>e.finalize,firstValueFrom:()=>e.firstValueFrom,from:()=>e.from,groupBy:()=>e.groupBy,lastValueFrom:()=>e.lastValueFrom,map:()=>e.map,mergeMap:()=>e.mergeMap,of:()=>e.of,pairwise:()=>e.pairwise,race:()=>e.race,reduce:()=>e.reduce,share:()=>e.share,skip:()=>e.skip,startWith:()=>e.startWith,switchMap:()=>e.switchMap,take:()=>e.take,takeUntil:()=>e.takeUntil,takeWhile:()=>e.takeWhile,tap:()=>e.tap,timer:()=>e.timer,toArray:()=>e.toArray},B={},o.d(B,Q),B);var Q,B;function z(e,t){switch(t.type){case"applyNumericFn":return function(e,t){if("increment"===t.fn)return null==e?t.value:e+t.value;throw new Error("Unknown numeric function: "+JSON.stringify(t))}(e,t);case"applyStringFn":return function(e,t){switch(t.fn){case"trim":return"string"!=typeof e?e:e.trim();case"extendString":return null==e?t.value:e+t.value;default:throw new Error("Unknown string function: "+JSON.stringify(t))}}(e,t);case"update":return"object"==typeof t.value?l.cloneDeep(t.value):t.value;case"removeProperty":return;default:throw new Error("Unknown property mutation type: "+JSON.stringify(t))}}function Y(e){return Object.entries(e.properties).sort((([e],[t])=>e.split(".").length-t.split(".").length))}function K(e){let t=[];return(0,U.from)(e).pipe((0,U.groupBy)((e=>`${e.squidDocIdObj.integrationId}${e.squidDocIdObj.collectionName}/${e.squidDocIdObj.docId}`)),(0,U.mergeMap)((e=>e.pipe((0,U.reduce)(((e,t)=>function(e,t){if("insert"===t.type)return t;if("delete"===t.type)return t;if("delete"===e.type)throw new Error("Cannot delete and then update");if(m("update"===t.type,"Invalid mutation type"),"update"===e.type)return function(e,t){const r=l.cloneDeep(e);t=l.cloneDeep(t);for(const[e]of Y(r)){const n=e.split(".").length;Object.entries(t.properties).some((([t])=>e.startsWith(t+".")&&n>t.split(".").length))&&delete r.properties[e]}for(const[e,n]of Y(t))r.properties[e]=[...r.properties[e]||[],...n];return r}(e,t);const r=l.cloneDeep(e);for(const[e,n]of Y(t)){const t=n;for(const n of t){const t=z(v(r.properties,e),n);void 0===t?b(r.properties,e):_(r.properties,e,t)}}return r}(e,t)))))),(0,U.toArray)()).subscribe((e=>{t=e})),t}var H=o(6236),G=o.n(H),W=o(8414),J=o.n(W);const Z=new(G())({allErrors:!0,allowUnionTypes:!1,useDefaults:!1});function X(e,t,r=((e,t)=>e>t?1:e<t?-1:0),n=0,i=e.length-1){if(i<n)return-1;const o=Math.trunc((n+i)/2);return 0===r(t,e[o])?o:r(t,e[o])>0?X(e,t,r,o+1,i):X(e,t,r,n,o-1)}function ee(e,t,r=((e,t)=>e>t?1:e<t?-1:0)){let n;for(n=e.length-1;n>=0&&r(e[n],t)>0;n--)e[n+1]=e[n];e[n+1]=t}function te(e,t,r=((e,t)=>e>t?1:e<t?-1:0)){const n=X(e,t,r);n>-1&&e.splice(n,1)}J()(Z),Z.addKeyword({keyword:"isDate",type:"object",validate:(e,t)=>e===t instanceof Date}),Z.addKeyword({keyword:"isJSON",type:"object",validate:(e,t)=>{try{const e=JSON.stringify(t);return JSON.parse(e),!0}catch(e){return!1}}}),Z.addKeyword({keyword:"isComputed",validate:(e,t)=>!e||null!==t}),Z.addKeyword({keyword:"isDefaultComputed",validate:(e,t)=>!e||null!==t}),Z.addKeyword({keyword:"primaryKey",validate:(e,t)=>!e||null!==t}),Z.addKeyword({keyword:"insertable",validate:(e,t)=>!e||null!==t}),Z.addKeyword({keyword:"deletable",validate:(e,t)=>!e||null!==t}),Z.addKeyword({keyword:"applyDefaultValueOn",validate:(e,t)=>!e||["always","empty","updateOrEmpty"].includes(e)}),Z.addKeyword({keyword:"dataType",validate:(e,t)=>!0});class re extends Error{constructor(e,t){super(e),this.details=t}}function ne(e){return/^local/.test(e)}function ie(){let e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){const r=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?r:3&r|8).toString(16)}))}class oe{constructor(){this.locks={}}async lock(...e){if(this.canGetLock(...e))return void this.lockSync(...e);const t=Object.entries(this.locks).filter((([t])=>e.includes(t))).map((([e,t])=>t));await(0,U.lastValueFrom)((0,U.combineLatest)(t).pipe((0,U.filter)((e=>!e.includes(!0))),(0,U.take)(1))),await this.lock(...e)}release(...e){for(const t of e){const e=y(this.locks[t]);e.next(!1),e.complete(),delete this.locks[t]}}canGetLock(...e){return!e.some((e=>{var t;return null===(t=this.locks[e])||void 0===t?void 0:t.value}))}lockSync(...e){m(this.canGetLock(...e),"Cannot acquire lock sync");for(const t of e)this.locks[t]=new U.BehaviorSubject(!0)}}function se(e){return"function"==typeof e}function ae(e){return function(t){if(function(e){return se(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}var ce=function(e,t){return ce=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},ce(e,t)};function ue(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ce(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var le=function(){return le=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},le.apply(this,arguments)};function fe(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function he(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))}function de(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function pe(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function me(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function ye(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}Object.create,Object.create;var ve,ge=((ve=function(e){var t;t=this,Error.call(t),t.stack=(new Error).stack,this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}).prototype=Object.create(Error.prototype),ve.prototype.constructor=ve,ve);function _e(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var be=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,r,n,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=pe(o),a=s.next();!a.done;a=s.next())a.value.remove(this)}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}else o.remove(this);var c=this.initialTeardown;if(se(c))try{c()}catch(e){i=e instanceof ge?e.errors:[e]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var l=pe(u),f=l.next();!f.done;f=l.next()){var h=f.value;try{we(h)}catch(e){i=null!=i?i:[],e instanceof ge?i=ye(ye([],me(i)),me(e.errors)):i.push(e)}}}catch(e){r={error:e}}finally{try{f&&!f.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}}if(i)throw new ge(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)we(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&_e(t,e)},e.prototype.remove=function(t){var r=this._finalizers;r&&_e(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}();function we(e){se(e)?e():e.unsubscribe()}be.EMPTY;var Ee=null,Se=null,Oe=!1,Te=!1,Ie={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=Ie.delegate;return(null==i?void 0:i.setTimeout)?i.setTimeout.apply(i,ye([e,t],me(r))):setTimeout.apply(void 0,ye([e,t],me(r)))},clearTimeout:function(e){var t=Ie.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function ke(){}var Ne=De("C",void 0,void 0);function De(e,t,r){return{kind:e,value:t,error:r}}var Ae=function(e){function t(t){var r,n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,((r=t)instanceof be||r&&"closed"in r&&se(r.remove)&&se(r.add)&&se(r.unsubscribe))&&t.add(n)):n.destination=Me,n}return ue(t,e),t.create=function(e,t,r){return new $e(e,t,r)},t.prototype.next=function(e){this.isStopped?je(function(e){return De("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?je(De("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?je(Ne,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(be),Re=Function.prototype.bind;function xe(e,t){return Re.call(e,t)}var Pe=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){Ce(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){Ce(e)}else Ce(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){Ce(e)}},e}(),$e=function(e){function t(t,r,n){var i,o,s=e.call(this)||this;return se(t)||!t?i={next:null!=t?t:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}:s&&Te?((o=Object.create(t)).unsubscribe=function(){return s.unsubscribe()},i={next:t.next&&xe(t.next,o),error:t.error&&xe(t.error,o),complete:t.complete&&xe(t.complete,o)}):i=t,s.destination=new Pe(i),s}return ue(t,e),t}(Ae);function Ce(e){Oe||function(e){Ie.setTimeout((function(){if(!Ee)throw e;Ee(e)}))}(e)}function je(e,t){var r=Se;r&&Ie.setTimeout((function(){return r(e,t)}))}var Me={closed:!0,next:ke,error:function(e){throw e},complete:ke};function Fe(e,t,r,n,i){return new qe(e,t,r,n,i)}var qe=function(e){function t(t,r,n,i,o,s){var a=e.call(this,t)||this;return a.onFinalize=o,a.shouldUnsubscribe=s,a._next=r?function(e){try{r(e)}catch(e){t.error(e)}}:e.prototype._next,a._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=n?function(){try{n()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,a}return ue(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(Ae);function Ve(e,t){return ae((function(r,n){var i=0;r.subscribe(Fe(n,(function(r){n.next(e.call(t,r,i++))})))}))}class Le extends j{constructor(e,t,r,n,i,o,s,a,c,u,l){super(),this.collectionName=e,this.integrationId=t,this.querySubscriptionManager=r,this.documentReferenceFactory=n,this.queryBuilderFactory=i,this.rootAlias=o,this.latestAlias=s,this.leftToRight=a,this.joins=c,this.joinConditions=u,this.queryBuilder=l}where(e,t,r){return this.queryBuilder.where(e,t,r),this}limit(e){return this.queryBuilder.limit(e),this}sortBy(e,t=!0){return this.queryBuilder.sortBy(e,t),this}join(e,t,r,n){var i;const o=null!==(i=null==n?void 0:n.leftAlias)&&void 0!==i?i:this.latestAlias,s=Object.assign(Object.assign({},r),{leftAlias:o}),a=Object.assign(Object.assign({},this.leftToRight),{[t]:[]});return a[o].push(t),new Le(this.collectionName,this.integrationId,this.querySubscriptionManager,this.documentReferenceFactory,this.queryBuilderFactory,this.rootAlias,t,a,Object.assign(Object.assign({},this.joins),{[t]:e.build()}),Object.assign(Object.assign({},this.joinConditions),{[t]:s}),this.queryBuilder)}snapshot(){return(0,U.firstValueFrom)(this.snapshots(!1))}snapshots(e=!0){return this.querySubscriptionManager.processQuery(this.build(),this.rootAlias,l.cloneDeep(this.joins),l.cloneDeep(this.joinConditions),e,!1).pipe(Ve((e=>e.map((e=>{const t={};for(const[r,n]of Object.entries(e)){const e=r===this.rootAlias?this.collectionName:this.joins[r].collectionName,i=r===this.rootAlias?this.integrationId:this.joins[r].integrationId,o=n?V(n.__docId__,e,i):void 0;t[r]=o?this.documentReferenceFactory.create(o,this.queryBuilderFactory):void 0}return t})))))}grouped(){return new Be(this)}dereference(){return new Ue(this)}build(){return this.queryBuilder.build()}}class Ue{constructor(e){this.joinQueryBuilder=e}grouped(){return this.joinQueryBuilder.grouped().dereference()}snapshot(){return(0,U.firstValueFrom)(this.snapshots(!1))}snapshots(e){return this.joinQueryBuilder.snapshots(e).pipe(Ve((e=>e.map((e=>l.mapValues(e,(e=>null==e?void 0:e.data)))))))}}class Qe{constructor(e){this.groupedJoin=e}snapshot(){return(0,U.firstValueFrom)(this.snapshots(!1))}snapshots(e){return this.groupedJoin.snapshots(e).pipe(Ve((e=>e.map((e=>this.dereference(e,this.groupedJoin.joinQueryBuilder.rootAlias))))))}dereference(e,t){const r=this.groupedJoin.joinQueryBuilder.leftToRight[t];if(r.length){const n={[t]:e[t].data};for(const t of r)n[t]=e[t].map((e=>this.dereference(e,t)));return n}return e.data}}class Be{constructor(e){this.joinQueryBuilder=e}snapshot(){return(0,U.firstValueFrom)(this.snapshots(!1))}snapshots(e){return this.joinQueryBuilder.snapshots(e).pipe(Ve((e=>this.groupData(e,this.joinQueryBuilder.rootAlias))))}dereference(){return new Qe(this)}groupData(e,t){const r=l.groupBy(e,(e=>{var r;return null===(r=e[t])||void 0===r?void 0:r.squidDocId}));return Object.values(r).filter((e=>void 0!==e[0][t])).map((e=>{const r=this.joinQueryBuilder.leftToRight[t],n=e[0][t];if(0===r.length)return n;const i={[t]:n};for(const t of r)i[t]=this.groupData(e,t);return i}))}}class ze{constructor(e,t,r,n,i){this.collectionName=e,this.integrationId=t,this.documentReferenceFactory=r,this.queryBuilderFactory=n,this.querySubscriptionManager=i,this.refId=ie()}doc(e){if(e&&"string"!=typeof e&&"object"!=typeof e&&!Array.isArray(e))throw new Error("Invalid doc id. Can be only object or string.");if(this.integrationId!==i.built_in_db)if(e){if("object"!=typeof e)throw new Error("Invalid doc id. String doc ids are only supported for the built_in_db integration. For all other integrations, the doc id must be an object.")}else e={[F]:ie()};else e=e&&"string"!=typeof e?{__id:S(e)}:{__id:e||ie()};const t=V(S(e),this.collectionName,this.integrationId);return this.documentReferenceFactory.create(t,this.queryBuilderFactory)}query(){return this.queryBuilderFactory.get(this.collectionName,this.integrationId)}joinQuery(e){return new Le(this.collectionName,this.integrationId,this.querySubscriptionManager,this.documentReferenceFactory,this.queryBuilderFactory,e,e,{[e]:[]},{},{},this.query())}or(...e){return new Ye(...e)}}class Ye{constructor(...e){if(0===e.length)throw new Error("At least one query builder must be provided");this.builders=e}snapshot(){return(0,U.firstValueFrom)(this.snapshots(!1))}snapshots(e=!0){const t=this.builders.map((t=>t.snapshots(e)));return this.or(this.builders[0].getSortOrder(),...t)}or(e,...t){return(0,U.combineLatest)([...t]).pipe((0,U.map)((t=>{const r=new Set,n=t.flat(),i=[];for(const e of n)r.has(e.data)||(r.add(e.data),i.push(e));return i.sort(((t,r)=>{for(const{fieldName:n,asc:i}of e){const e=t.data[n],o=r.data[n];if(e<o)return i?-1:1;if(e>o)return i?1:-1}return 0}))})))}}class Ke{constructor(e,t,r){this._squidDocId=e,this.dataManager=t,this.queryBuilderFactory=r,this.refId=ie()}get squidDocId(){return this._squidDocId}get data(){return y(this.dataManager.getProperties(this.squidDocId),(()=>{const{collectionName:e,integrationId:t,docId:r}=q(this.squidDocId);return`No data found for document reference: ${JSON.stringify({docId:r,collectionName:e,integrationId:t},null,2)}`})())}get hasData(){return!!this.dataManager.getProperties(this.squidDocId)}async snapshot(){if(this.isTracked()&&this.dataManager.getProperties(this.squidDocId))return this;const e=await this.queryBuilderFactory.getForDocument(this.squidDocId).snapshot();return y(e.length<=1,"Got more than one doc for the same id:"+this.squidDocId),e.length?this:void 0}snapshots(){return this.queryBuilderFactory.getForDocument(this.squidDocId).snapshots().pipe((0,U.map)((e=>(y(e.length<=1,"Got more than one doc for the same id:"+this.squidDocId),e.length?this:void 0))))}isDirty(){return this.dataManager.isDirty(this.squidDocId)}isTracked(){return this.dataManager.isTracked(this.squidDocId)}async update(e,t){const r={};Object.entries(e).forEach((([e,t])=>{const n=void 0!==t?{type:"update",value:t}:{type:"removeProperty"};r[e]=[n]}));const n={type:"update",squidDocIdObj:q(this.squidDocId),properties:r};return this.dataManager.applyOutgoingMutation(n,t)}async setInPath(e,t,r){return this.update({[e]:l.cloneDeep(t)},r)}async deleteInPath(e,t){return this.update({[e]:void 0},t)}incrementInPath(e,t,r){const n={type:"applyNumericFn",fn:"increment",value:t},i={type:"update",squidDocIdObj:q(this.squidDocId),properties:{[e]:[n]}};return this.dataManager.applyOutgoingMutation(i,r)}decrementInPath(e,t,r){return this.incrementInPath(e,-t,r)}async insert(e,t){const r=q(this.squidDocId),n=r.integrationId;let o=T(r.docId);if(o[F]&&(o={}),n===i.built_in_db&&o.__id)try{const e=T(o.__id);o=Object.assign(Object.assign({},o),e)}catch(e){}const s={type:"insert",squidDocIdObj:r,properties:Object.assign(Object.assign(Object.assign({},e),{__docId__:r.docId}),o)};return this.dataManager.applyOutgoingMutation(s,t)}async delete(e){const t={type:"delete",squidDocIdObj:q(this.squidDocId)};return this.dataManager.applyOutgoingMutation(t,e)}migrateDocIds(e){const t=e[this.squidDocId];t&&(this._squidDocId=t)}}class He{constructor(e,t,r){this.querySubscriptionManager=e,this.documentReferenceFactory=t,this.documentIdentityService=r}getForDocument(e){const{collectionName:t,integrationId:r,docId:n}=q(e),i=T(n),o=this.get(t,r);return Object.entries(i).forEach((([e,t])=>{o.where(e,"==",t)})),o}get(e,t){return new We(e,t,this.querySubscriptionManager,this.documentReferenceFactory,this,this.documentIdentityService)}}class Ge{constructor(e){this.queryBuilder=e}snapshot(){return(0,U.firstValueFrom)(this.snapshots(!1))}snapshots(e){return this.queryBuilder.snapshots(e).pipe(Ve((e=>e.map((e=>e.data)))))}}class We extends j{constructor(e,t,r,n,i,o){super(),this.collectionName=e,this.integrationId=t,this.querySubscriptionManager=r,this.documentReferenceFactory=n,this.queryBuilderFactory=i,this.documentIdentityService=o,this.forceFetchFromServer=!1,this.query={integrationId:t,collectionName:e,conditions:[],limit:-1,sortOrder:[]}}where(e,t,r){if("in"===t||"not in"===t){const n=r instanceof Array?[...r]:[r];for(const r of n)this.query.conditions.push({fieldName:e,operator:"in"===t?"==":"!=",value:r});return this}return this.query.conditions.push({fieldName:e,operator:t,value:r}),this}limit(e){return function(e){m(p(e,"number"),"Limit needs to be a number"),-1!==e&&(m(e>0,"query limit has to be greater than 0"),m(Math.floor(e)===e,"query limit has to be an integer"),m(e<=2e4,"Limit can be maximum 20000"))}(e),m(-1===this.query.limit,"The limit was already set."),this.query.limit=e,this}sortBy(e,t=!0){const r={asc:t,fieldName:e};return d(r),m(!this.query.sortOrder.some((t=>t.fieldName===e)),`${e} already in the sort list.`),this.query.sortOrder.push(r),this}build(){const e=this.mergeConditions();return Object.assign(Object.assign({},this.query),{conditions:e})}mergeConditions(){const e=[],t=l.groupBy(this.query.conditions||[],(e=>e.fieldName));for(const r of Object.values(t)){const t=l.groupBy(r,(e=>e.operator));for(const[r,n]of Object.entries(t)){if("=="===r||"!="===r){e.push(...n);continue}const t=l.sortBy(n,(e=>e.value));">"===r||">="===r?e.push(t[t.length-1]):e.push(t[0])}}return e}getSortOrder(){return this.query.sortOrder}snapshot(){return(0,U.firstValueFrom)(this.snapshots(!1))}setForceFetchFromServer(){return this.forceFetchFromServer=!0,this}snapshots(e=!0){return this.querySubscriptionManager.processQuery(this.build(),this.collectionName,{},{},e,this.forceFetchFromServer).pipe(Ve((e=>e.map((e=>{m(1===Object.keys(e).length);const t=V(y(e[this.collectionName]).__docId__,this.collectionName,this.integrationId);return this.documentReferenceFactory.create(t,this.queryBuilderFactory)})))))}changes(){let e,t=new Set;return this.snapshots().pipe((0,U.combineLatestWith)(this.documentIdentityService.observeChanges().pipe((0,U.switchMap)((t=>(Object.entries(t).forEach((([t,r])=>{!function(e,t,r){const n=e[t];void 0!==n&&(e[r]=n,delete e[t])}(e||{},t,r)})),U.NEVER))),(0,U.startWith)({}))),Ve((([r])=>{let n=[];const i=[],o=[];if(e){for(const o of r){const r=o.squidDocId,s=o.data;if(t.has(s))delete e[r],t.delete(s);else if(e[r]){i.push(o);const n=e[r];delete e[r],t.delete(n)}else n.push(o)}for(const e of t)o.push(e)}else n=r;e={},t=new Set;for(const n of r){const r=n.data;e[n.squidDocId]=r,t.add(r)}return new Je(n,i,o)})))}get hash(){return I(this.build())}dereference(){return new Ge(this)}}class Je{constructor(e,t,r){this.inserts=e,this.updates=t,this.deletes=r}}class Ze{constructor(e,t,r){this.rpcManager=e,this.socketManager=t,this.integrationId=r,this.ongoingChatRequests={},this.socketManager.observeNotifications().pipe((0,U.filter)((e=>"aiAssistant"===e.type)),Ve((e=>e))).subscribe((e=>{this.handleChatResponse(e)}))}profile(e){return new Xe(this,this.integrationId,e)}async mutate(e){await this.rpcManager.post("ai/assistant/mutate",e)}chat(e,t){const r=ie(),n=new U.BehaviorSubject("");this.ongoingChatRequests[r]=n;const i={profileId:e,prompt:t,integrationId:this.integrationId,clientRequestId:r};return this.rpcManager.post("ai/assistant/chat",i).catch((e=>{n.error(e),n.complete()})),n.pipe((0,U.finalize)((()=>{delete this.ongoingChatRequests[r]})),(0,U.share)())}handleChatResponse(e){const t=this.ongoingChatRequests[e.clientRequestId];t&&(e.payload.complete?t.complete():t.next(t.value+e.payload.token))}}class Xe{constructor(e,t,r){this.client=e,this.integrationId=t,this.profileId=r}chat(e){return this.client.chat(this.profileId,e)}context(e){return new et(this.client,this.integrationId,this.profileId,e)}instruction(e){return new tt(this.client,this.integrationId,this.profileId,e)}insert(e){const{modelName:t}=e,r={type:"insert",resource:"profile",profileId:this.profileId,payload:{modelName:t,strictContext:!1},integrationId:this.integrationId};return this.client.mutate(r)}update(e){const{modelName:t}=e,r={type:"update",resource:"profile",profileId:this.profileId,payload:{modelName:t,strictContext:!1},integrationId:this.integrationId};return this.client.mutate(r)}delete(){const e={type:"delete",resource:"profile",profileId:this.profileId,integrationId:this.integrationId,payload:{}};return this.client.mutate(e)}}class et{constructor(e,t,r,n){this.client=e,this.integrationId=t,this.profileId=r,this.id=n||ie()}insert(e){const{title:t,context:r}=e,n={type:"insert",resource:"context",profileId:this.profileId,integrationId:this.integrationId,payload:{id:this.id,title:t,context:r}};return this.client.mutate(n)}update(e){const{title:t,context:r}=e,n={type:"update",resource:"context",profileId:this.profileId,integrationId:this.integrationId,payload:{id:this.id,title:t,context:r}};return this.client.mutate(n)}delete(){const e={type:"delete",resource:"context",profileId:this.profileId,integrationId:this.integrationId,payload:{id:this.id}};return this.client.mutate(e)}}class tt{constructor(e,t,r,n){this.client=e,this.integrationId=t,this.profileId=r,this.id=n||ie()}insert(e){const{instruction:t}=e,r={type:"insert",resource:"instruction",profileId:this.profileId,integrationId:this.integrationId,payload:{id:this.id,instruction:t}};return this.client.mutate(r)}update(e){const{instruction:t}=e,r={type:"update",resource:"instruction",profileId:this.profileId,integrationId:this.integrationId,payload:{id:this.id,instruction:t}};return this.client.mutate(r)}delete(){const e={type:"delete",resource:"instruction",profileId:this.profileId,integrationId:this.integrationId,payload:{id:this.id}};return this.client.mutate(e)}}class rt{constructor(e,t){this.rpcManager=e,this.socketManager=t,this.assistantsMap=new Map}getAssistant(e){let t=this.assistantsMap.get(e);return t||(t=new Ze(this.rpcManager,this.socketManager,e),this.assistantsMap.set(e,t),t)}}class nt{constructor(e,t,r,n={}){this.clientIdService=e,this.rpcManager=t,this.socketManager=r,this.apiServerUrlOverrideMapping=n,this.ongoingApiExecutions={},r.observeNotifications().pipe((0,U.filter)((e=>"api"===e.type)),Ve((e=>e))).subscribe((e=>{this.handleApiResponse(e.clientRequestId,e).then()}))}callApiAndSubscribe(e,t,r){const n=ie(),i=new U.Subject;this.ongoingApiExecutions[n]=i;const o={integrationId:e,endpointId:t,request:r,clientRequestId:n,serverUrlOverride:this.apiServerUrlOverrideMapping[e]};return this.rpcManager.post("api/call",o).catch((n=>{console.error("Got error while calling API",e,t,r,n),i.error(n),i.complete()})),(0,U.race)(i.pipe((0,U.finalize)((()=>{delete this.ongoingApiExecutions[n]})),(0,U.share)()),this.clientIdService.observeClientTooOld().pipe(Ve((()=>{throw new Error("CLIENT_NOT_CONNECTED")}))))}async handleApiResponse(e,t){const r=this.ongoingApiExecutions[e];r&&(t.success?r.next(T(t.payload)):r.error((0,l.pick)(t,"httpStatus","payload")),r.complete())}}class it{constructor(e,t){this.destructManager=e,this.apiKey=t,this.authIdTokenSet=new U.BehaviorSubject(!1),this.authIdTokenObservableSubject=new U.Subject,this.shouldWaitForAuth=!1,this.observeAuthIdToken().subscribe((e=>{this.idToken=e.token,this.integrationId=e.integrationId,this.authIdTokenSet.next(!0)}))}setAuthIdToken(e,t){this.shouldWaitForAuth=!0,this.authIdTokenSet.next(!1);const r=e&&"string"!=typeof e?(0,U.from)(e).pipe((0,U.map)((e=>({token:e,integrationId:t})))):(0,U.of)({token:e,integrationId:t});this.authIdTokenObservableSubject.next(r)}observeAuthIdToken(){return this.authIdTokenObservableSubject.pipe((0,U.switchMap)((e=>e)),(0,U.takeUntil)(this.destructManager.observeIsDestructing()))}async waitForReadyState(){this.shouldWaitForAuth&&!this.destructManager.isDestructing&&await(0,U.firstValueFrom)((0,U.race)(this.authIdTokenSet.asObservable().pipe((0,U.filter)(Boolean)),this.destructManager.observeIsDestructing()))}getApiKey(){return this.apiKey}getAuthToken(){return this.apiKey?{type:"ApiKey",token:this.apiKey}:this.idToken?{type:"Bearer",token:this.idToken,integrationId:this.integrationId}:void 0}}class ot{constructor(e,t,r){this.clientIdService=e,this.rpcManager=t,this.socketManager=r,this.ongoingFunctionExecutions={},r.observeNotifications().pipe((0,U.filter)((e=>"backendFunction"===e.type)),Ve((e=>e))).subscribe((e=>{this.handleFunctionResponse(e.clientRequestId,e.payload)}))}executeFunctionAndSubscribe(e,...t){const r=ie(),n=new U.Subject;this.ongoingFunctionExecutions[r]=n;const i={functionName:e,paramsArrayStr:O(t),clientRequestId:r};return this.rpcManager.post("backend-function/execute",i).catch((t=>{console.error("Got error while executing function",e,t),n.error(t),n.complete()})),(0,U.race)(n.pipe((0,U.finalize)((()=>{delete this.ongoingFunctionExecutions[r]})),(0,U.share)()),this.clientIdService.observeClientTooOld().pipe(Ve((()=>{throw new Error("CLIENT_NOT_CONNECTED")}))))}handleFunctionResponse(e,t){const r=this.ongoingFunctionExecutions[e];if(!r)return;const n=T(t);n.success?r.next(n.response):(r.error(new Error(n.response)),r.complete())}}class st{constructor(e){this.destructManager=e,this.clientTooOldSubject=new U.BehaviorSubject(!1),this.clientIdSubject=new U.BehaviorSubject(ie()),this.destructManager.onDestruct((()=>{this.clientTooOldSubject.complete(),this.clientIdSubject.complete()}))}observeClientId(){return this.clientIdSubject}observeClientTooOld(){return this.clientTooOldSubject.pipe((0,U.filter)((e=>e)),(0,U.map)((e=>{})))}notifyClientTooOld(){this.clientTooOldSubject.next(!0),this.clientIdSubject.next(ie())}notifyClientReadyToBeRegenerated(){this.clientTooOldSubject.next(!1)}observeClientReadyToBeRegenerated(){return this.clientTooOldSubject.pipe((0,U.skip)(1),(0,U.filter)((e=>!e)),(0,U.map)((e=>{})))}getClientId(){return this.clientIdSubject.value}isClientTooOld(){return this.clientTooOldSubject.value}}class at{constructor(e,t,r){this.documentReferenceFactory=e,this.queryBuilderFactory=t,this.querySubscriptionManager=r,this.collections=new Map}get(e,t){let r=this.collections.get(t);r||(r=new Map,this.collections.set(t,r));let n=r.get(e);return n||(n=new ze(e,t,this.documentReferenceFactory,this.queryBuilderFactory,this.querySubscriptionManager),r.set(e,n),n)}}var ct=o(3910);const ut="dataManager_runInTransaction";class lt{constructor(e,t,r,n,i,o,s,a){this.documentStore=e,this.mutationSender=t,this.socketManager=r,this.querySubscriptionManager=n,this.queryBuilderFactory=i,this.lockManager=o,this.destructManager=s,this.documentIdentityService=a,this.docIdToLocalTimestamp=new Map,this.batchClientRequestIds=new Set,this.docIdToServerTimestamp=new Map,this.pendingIncomingUpdates=new Map,this.pendingOutgoingMutations=new Map,this.pendingOutgoingMutationsChanged=new U.Subject,this.outgoingMutationsEmpty=new U.BehaviorSubject(!0),this.knownDirtyDocs=new Set,this.failedDocsToResync=[],this.refreshDocIdToTimestamp=new Map,this.handleIncomingMessagesForTests=!0,this.destructManager.onDestruct((()=>{this.destruct()})),this.documentIdentityService.observeChanges().subscribe(this.migrateDocIds.bind(this)),this.handleNotifications(),this.startDeleteExpiredTimestampsJob(),this.handleOrphanDocs(),this.outgoingMutationsEmpty.subscribe((e=>{this.querySubscriptionManager.safeToSendQueriesToServer.next(e)}))}getProperties(e){return this.documentStore.getDocumentOrUndefined(e)}isDirty(e){var t;if(this.knownDirtyDocs.has(e))return!0;if(null===(t=this.pendingOutgoingMutations.get(e))||void 0===t?void 0:t.length)return!0;const r=this.docIdToServerTimestamp.get(e),n=r&&!r.expireTimestamp?r.timestamp:void 0,i=this.docIdToLocalTimestamp.get(e);return!((!i||n)&&!this.isForgotten(e)&&!this.isLocalOnly(e)&&i===n)}async runInTransaction(e,t){return t?(m(t===this.currentTransactionId,"Transaction already ended."),e(t).then((e=>Promise.resolve()))):(this.lockManager.canGetLock(ut)?this.lockManager.lockSync(ut):await this.lockManager.lock(ut),new Promise((async(t,r)=>{try{this.currentTransactionId=ie();try{return await e(this.currentTransactionId)}catch(e){console.error("error while executing callback function in transaction",e)}finally{this.finishTransaction({resolve:t,reject:r})}}catch(e){console.error("error while executing transaction",e)}finally{this.lockManager.release(ut)}})))}async applyOutgoingMutation(e,t){var r;const n=V(e.squidDocIdObj);this.knownDirtyDocs.add(n),t||this.lockManager.canGetLock(ut)||(await this.lockManager.lock(ut),this.lockManager.release(ut)),this.knownDirtyDocs.delete(n);const i=null===(r=this.pendingOutgoingMutations.get(n))||void 0===r?void 0:r.slice(-1)[0];if(i&&!i.sentToServer)i.mutation=K([i.mutation,e])[0],this.outgoingMutationsEmpty.next(!1);else{const t={mutation:this.removeInternalProperties(e),sentToServer:!1},r=this.pendingOutgoingMutations.get(n)||[];r.push(t),this.pendingOutgoingMutations.set(n,r),this.outgoingMutationsEmpty.next(!1),this.pendingOutgoingMutationsChanged.next()}return this.runInTransaction((async()=>{const t=this.documentStore.getDocumentOrUndefined(n),r="delete"===e.type?void 0:"update"===e.type?function(e,t){if(!e)return;const r=Object.assign({},e),n=Y(t);for(const[e,t]of n){const n=t;for(const t of n){const n=z(v(r,e),t);void 0===n?b(r,e):_(r,e,n)}}return r}(t,e):Object.assign({},e.properties);this.updateDocumentFromSnapshot(n,r)&&("insert"===e.type&&this.docIdToLocalTimestamp.set(n,(new Date).getTime()),this.querySubscriptionManager.setClientRequestIdsForLocalDoc(n,r).forEach((e=>this.batchClientRequestIds.add(e))))}),t)}async runInTransactionSync(e,t){if(t)return m(t===this.currentTransactionId,"Transaction already ended."),void e(t);await this.lockManager.lock(ut);try{this.currentTransactionId=ie();try{return e(this.currentTransactionId)}catch(e){console.error("error while executing callback function in transaction",e)}finally{this.finishTransaction()}}catch(e){console.error("error while executing transaction",e)}finally{this.lockManager.release(ut)}}removeInternalProperties(e){if("delete"===e.type)return e;const t=Object.assign(Object.assign({},e),{properties:Object.assign({},e.properties)});return delete t.properties.__docId__,delete t.properties.__ts__,t}handleNotifications(){this.socketManager.observeNotifications().pipe((0,U.filter)((e=>"mutations"===e.type)),Ve((e=>e))).subscribe((e=>{this.outgoingMutationsEmpty.pipe((0,U.filter)(Boolean),(0,U.take)(1)).subscribe((()=>{this.handleIncomingMutations(e.payload)}))})),this.socketManager.observeNotifications().pipe((0,U.filter)((e=>"query"===e.type)),Ve((e=>e))).subscribe((e=>{this.outgoingMutationsEmpty.pipe((0,U.filter)(Boolean),(0,U.take)(1)).subscribe((()=>{this.handleIncomingQuerySnapshots(e.payload)}))}))}handleIncomingMutations(e){if(!this.handleIncomingMessagesForTests)return;const t=e.reduce(((e,t)=>this.querySubscriptionManager.hasOngoingQuery(t.clientRequestId)?(e[t.squidDocId]={properties:t.doc,timestamp:t.mutationTimestamp},e):e),{});this.applyIncomingUpdates(t)}handleIncomingQuerySnapshots(e){if(!this.handleIncomingMessagesForTests)return;if(!this.querySubscriptionManager.hasOngoingQuery(e.clientRequestId))return;const t=this.querySubscriptionManager.getQuery(e.clientRequestId),r={};for(const n of e.docs){const e=V(n.__docId__,t.collectionName,t.integrationId);r[e]={properties:n,timestamp:n.__ts__}}this.querySubscriptionManager.setGotInitialResult(e.clientRequestId),this.runInTransactionSync((t=>{this.batchClientRequestIds.add(e.clientRequestId),this.applyIncomingUpdates(r,t)&&this.querySubscriptionManager.hasSubscription(e.clientRequestId)&&this.batchClientRequestIds.delete(e.clientRequestId)})).then()}applyIncomingUpdates(e,t){let r=!1;const n=new Set;for(const[t,i]of Object.entries(e))this.addPendingIncomingUpdate(t,i),this.pendingIncomingUpdates.get(t)||(r=!0),n.add(t);return this.runInTransactionSync((()=>{for(const e of n)this.maybeApplyIncomingUpdate(e)}),t).then(),r}addPendingIncomingUpdate(e,t){const r=this.pendingIncomingUpdates.get(e),n=this.docIdToServerTimestamp.get(e);r&&r.timestamp>t.timestamp||n&&n.timestamp>t.timestamp||this.pendingIncomingUpdates.set(e,t)}maybeApplyIncomingUpdate(e){const t=this.pendingIncomingUpdates.get(e);if(!t)return;const r=this.pendingOutgoingMutations.get(e);r&&r.length||(this.updateDocumentFromSnapshot(e,t.properties),this.acknowledgeDocument(e,t.timestamp,!t.properties),this.docIdToLocalTimestamp.set(e,t.timestamp),this.pendingIncomingUpdates.delete(e),this.querySubscriptionManager.setClientRequestIdsForLocalDoc(e,t.properties).forEach((e=>{this.batchClientRequestIds.add(e)})),t.properties&&(this.querySubscriptionManager.findQueriesForDocument(t.properties,e).length||this.forgetDocument(e)))}destruct(){this.stopDeleteExpiredTimestampsJob()}stopDeleteExpiredTimestampsJob(){void 0!==this.deleteExpiredTimestampsInterval&&(clearInterval(this.deleteExpiredTimestampsInterval),this.deleteExpiredTimestampsInterval=void 0)}startDeleteExpiredTimestampsJob(){this.deleteExpiredTimestampsInterval=setInterval((()=>{const e=[...this.docIdToServerTimestamp.entries()].filter((([e,t])=>!(!t.expireTimestamp||t.expireTimestamp>Date.now()||this.isTracked(e))));for(const[t]of e)this.docIdToServerTimestamp.delete(t),this.forgetDocument(t)}),1e4)}isTracked(e){if(this.pendingIncomingUpdates.get(e))return!0;const t=this.pendingOutgoingMutations.get(e);return!(!t||!t.length)||this.querySubscriptionManager.hasOngoingQueryForDocId(e)}isForgotten(e){return this.documentStore.hasData(e)&&!this.isTracked(e)}isLocalOnly(e){return!this.hasBeenAcknowledged(e)&&this.documentStore.hasData(e)}hasBeenAcknowledged(e){return this.docIdToServerTimestamp.has(e)}updateDocumentFromSnapshot(e,t){const r=this.documentStore.getDocumentOrUndefined(e);return!(!r&&!t||r===t)&&((!r||!t||S(Object.assign(Object.assign({},t),{__ts__:void 0}))!==S(r))&&(this.documentStore.saveDocument(e,t),!0))}finishTransaction(e){this.currentTransactionId=void 0;const t=[...this.batchClientRequestIds.values()];this.batchClientRequestIds.clear(),this.querySubscriptionManager.notifyAllSubscriptions(t),this.sendAllUnsentOutgoingMutations(e).then()}async sendAllUnsentOutgoingMutations(e){const t=this.groupOutgoingMutationsByIntegrationId();try{await ct.PromisePool.for(t).withConcurrency(t.length||1).handleError((e=>{throw e})).process((async([e,t])=>{await this.sendMutationsForIntegration([...t],e)})),this.pendingOutgoingMutations.size||this.outgoingMutationsEmpty.next(!0),await this.refreshUpdatedDocuments(),this.hasPendingSentMutations()?(await(0,U.firstValueFrom)(this.pendingOutgoingMutationsChanged.pipe((0,U.filter)((()=>!this.hasPendingSentMutations())))),null==e||e.resolve()):null==e||e.resolve()}catch(t){this.pendingOutgoingMutations.size||(this.outgoingMutationsEmpty.next(!0),await this.resyncFailedUpdates()),null==e||e.reject(t)}}async sendMutationsForIntegration(e,t){try{const{timestamp:r,idResolutionMap:n={},refreshList:i=[]}=await this.mutationSender.sendMutations(e.map((e=>e.mutation)),t);await this.documentIdentityService.migrate(n),i.forEach((e=>{this.refreshDocIdToTimestamp.set(n[e]||e,r)}));for(const t of e){let e=this.removeOutgoingMutation(t);n[e]&&(e=n[e]),this.acknowledgeDocument(e,r),this.isTracked(e)||(this.setExpiration(e,!0),this.forgetDocument(e))}}catch(t){for(const t of e){const e=this.removeOutgoingMutation(t);this.forgetDocument(e),(this.hasBeenAcknowledged(e)||"insert"===t.mutation.type)&&this.failedDocsToResync.push(e)}throw t}}removeOutgoingMutation(e){const t=V(e.mutation.squidDocIdObj),r=y(this.pendingOutgoingMutations.get(t));return r.splice(r.indexOf(e),1),r.length||this.pendingOutgoingMutations.delete(t),this.pendingOutgoingMutationsChanged.next(),t}async resyncFailedUpdates(){const e=[...this.failedDocsToResync];this.failedDocsToResync.splice(0);for(const t of e){this.setExpiration(t,!0);try{const e=await this.queryBuilderFactory.getForDocument(t).setForceFetchFromServer().snapshot();if(y(e.length<=1,"Got more than one doc for the same id:"+t),!e.length){this.forgetDocument(t);const e=this.querySubscriptionManager.setClientRequestIdsForLocalDoc(t,void 0);this.querySubscriptionManager.notifyAllSubscriptions(e)}}catch(e){this.querySubscriptionManager.errorOutAllQueries(t,e)}}}async refreshUpdatedDocuments(){var e;const t=[];for(const[r,n]of this.refreshDocIdToTimestamp.entries()){const i=null===(e=this.docIdToServerTimestamp.get(r))||void 0===e?void 0:e.timestamp;i&&i>n||t.push(r)}this.refreshDocIdToTimestamp.clear();for(const e of t)try{await this.queryBuilderFactory.getForDocument(e).snapshot()}catch(e){}}groupOutgoingMutationsByIntegrationId(){const e={};for(const[t,r]of[...this.pendingOutgoingMutations.entries()]){const t=r[r.length-1];if(t&&!t.sentToServer){const r=t.mutation.squidDocIdObj.integrationId;(e[r]||(e[r]=[])).push(t),t.sentToServer=!0}}return Object.entries(e)}handleOrphanDocs(){this.querySubscriptionManager.onOrphanDocuments.subscribe((e=>{for(const t of e)this.isTracked(t)||this.forgetDocument(t)}))}acknowledgeDocument(e,t,r=!1){this.docIdToServerTimestamp.set(e,{timestamp:t}),this.setExpiration(e,r)}setExpiration(e,t){const r=this.docIdToServerTimestamp.get(e);r&&(r.expireTimestamp=t?Date.now()+2e4:void 0)}forgetDocument(e){this.docIdToLocalTimestamp.delete(e),this.setExpiration(e,!0)}migrateDocIds(e){this.pendingOutgoingMutations.forEach((t=>{t.forEach((t=>{const r=V(t.mutation.squidDocIdObj),n=e[r];n&&(t.mutation.squidDocIdObj=q(n))}))})),Object.entries(e).forEach((([e,t])=>{w(this.pendingOutgoingMutations,e,t),w(this.docIdToLocalTimestamp,e,t),w(this.docIdToServerTimestamp,e,t)}))}hasPendingSentMutations(){for(const e of this.pendingOutgoingMutations.values())for(const t of e)if(t.sentToServer)return!0;return!1}}class ft{constructor(){this.predestructors=[],this.destructors=[],this.isDestructedSubject=new U.BehaviorSubject(!1)}get isDestructing(){return this.isDestructedSubject.value}observeIsDestructing(){return this.isDestructedSubject.asObservable().pipe((0,U.filter)(Boolean),Ve((()=>{})))}onPreDestruct(e){this.predestructors.push(e)}onDestruct(e){this.destructors.push(e)}async destruct(){if(this.isDestructing)return;this.isDestructedSubject.next(!0);const e=this.predestructors.concat(this.destructors);let t=e.shift();for(;t;){try{await t()}catch(e){console.error("Error while destructing Squid",e)}t=e.shift()}}}class ht{constructor(e,t){this.socketManager=e,this.destructManager=t,this.ongoingLocks={},this.acquireLockMessagesFromServer=this.socketManager.observeNotifications().pipe((0,U.filter)((e=>"lockAcquired"===e.type))),this.releaseLockMessagesFromServer=this.socketManager.observeNotifications().pipe((0,U.filter)((e=>"lockReleased"===e.type))),this.lockWaitForConnectionThreshold=2e3,t.onPreDestruct((()=>{this.releaseAllLocks()})),this.socketManager.observeConnectionReady().subscribe((e=>{e||this.releaseAllLocks()})),this.releaseLockMessagesFromServer.subscribe((e=>{const t=this.ongoingLocks[e.payload.clientRequestId];void 0!==t&&t.release().then()}))}async lock(e,t){if(!await(0,U.firstValueFrom)((0,U.race)((0,U.timer)(this.lockWaitForConnectionThreshold).pipe(Ve((()=>!1))),this.socketManager.observeConnectionReady().pipe((0,U.filter)(Boolean)),this.destructManager.observeIsDestructing())))return Promise.reject("CLIENT_NOT_CONNECTED");const r=ie(),n={type:"acquireLock",payload:{mutex:e,exclusive:t,clientRequestId:r}};this.socketManager.sendMessage(n);const i=await(0,U.firstValueFrom)((0,U.race)((0,U.timer)(5e3).pipe((0,U.take)(1),Ve((()=>({payload:{error:"TIMEOUT_GETTING_LOCK",lockId:void 0}})))),this.acquireLockMessagesFromServer.pipe((0,U.filter)((e=>e.payload.clientRequestId===r)))));if(!i.payload.lockId)throw new Error(`Failed to acquire lock: ${i.payload.error}`);const o=i.payload.lockId,s=new dt(o,r,this.ongoingLocks,this.socketManager);return this.ongoingLocks[o]=s,s}releaseAllLocks(){for(const[e,t]of Object.entries(this.ongoingLocks))t.release().then(),delete this.ongoingLocks[e]}}class dt{constructor(e,t,r,n){this.lockId=e,this.clientRequestId=t,this.ongoingLocks=r,this.socketManager=n,this.released=!1,this.onReleaseSubject=new U.Subject}async release(){if(this.released)return;this.released=!0,delete this.ongoingLocks[this.lockId];const e={type:"releaseLock",payload:{lockId:this.lockId,clientRequestId:this.clientRequestId}};this.socketManager.sendMessage(e),this.onReleaseSubject.next()}observeRelease(){return this.onReleaseSubject.asObservable()}isReleased(){return this.released}}class pt{constructor(e,t){this.documentStore=e,this.destructManager=t,this.changeNotifier=new U.BehaviorSubject({}),this.destructManager.onDestruct((()=>{this.changeNotifier.complete()}))}migrate(e){Object.entries(e).forEach((([e,t])=>{this.documentStore.migrateDocId(e,t)})),this.changeNotifier.next(e)}observeChanges(){return this.changeNotifier.asObservable()}}class mt{constructor(e){this.documentIdentityService=e,this.documents=new Map,this.documentIdentityService.observeChanges().subscribe(this.migrateDocIds.bind(this))}create(e,t){let r=this.documents.get(e);return r||(r=new Ke(e,y(this.dataManager,"dataManager not found"),t),this.documents.set(e,r),r)}setDataManager(e){this.dataManager=e}migrateDocIds(e){for(const[t,r]of this.documents)r.migrateDocIds(e);Object.entries(e).forEach((([e,t])=>{const r=q(e),n=q(t);w(this.documents,r.docId,n.docId)}))}}class yt{constructor(){this.squidDocIdToDoc=new Map}saveDocument(e,t){const r=this.squidDocIdToDoc.get(e);if(void 0===r&&!t)return;if(void 0!==r){if(t){const r=(0,l.cloneDeep)(t),n=this.removeInternalProperties(r);return this.squidDocIdToDoc.set(e,n),n}return void this.squidDocIdToDoc.delete(e)}const n=this.removeInternalProperties(t);return this.squidDocIdToDoc.set(e,n),t}hasData(e){return void 0!==this.squidDocIdToDoc.get(e)}getDocument(e){return y(this.getDocumentOrUndefined(e))}getDocumentOrUndefined(e){return this.squidDocIdToDoc.get(e)}sortAndLimitDocs(e,t){if(!e||0===e.size)return[];const r=[...e].map((e=>this.squidDocIdToDoc.get(e))).filter(f),{sortOrder:n,limit:i}=t,o=n.map((e=>e.fieldName)),s=n.map((e=>e.asc?"asc":"desc")),a=(0,l.orderBy)(r,o,s);return i<0?a:r.slice(0,i)}removeInternalProperties(e){if(!e)return;const t=Object.assign({},e);return delete t.__ts__,t}migrateDocId(e,t){const r=this.getDocumentOrUndefined(e);if(!r)return;w(this.squidDocIdToDoc,e,t);const n=q(t),i=T(n.docId);this.saveDocument(t,Object.assign(Object.assign(Object.assign({},r),i),{__docId__:n.docId}))}}var vt="Invariant Violation",gt=Object.setPrototypeOf,_t=void 0===gt?function(e,t){return e.__proto__=t,e}:gt,bt=function(e){function t(r){void 0===r&&(r=vt);var n=e.call(this,"number"==typeof r?vt+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=vt,_t(n,t.prototype),n}return ue(t,e),t}(Error);function wt(e,t){if(!e)throw new bt(t)}var Et=["debug","log","warn","error","silent"],St=Et.indexOf("log");function Ot(e){return function(){if(Et.indexOf(e)>=St)return(console[e]||console.log).apply(console,arguments)}}function Tt(e){try{return e()}catch(e){}}!function(e){e.debug=Ot("debug"),e.log=Ot("log"),e.warn=Ot("warn"),e.error=Ot("error")}(wt||(wt={}));const It=Tt((function(){return globalThis}))||Tt((function(){return window}))||Tt((function(){return self}))||Tt((function(){return global}))||Tt((function(){return Tt.constructor("return this")()}));var kt="__",Nt=[kt,kt].join("DEV");const Dt=function(){try{return Boolean(__DEV__)}catch(e){return Object.defineProperty(It,Nt,{value:"production"!==Tt((function(){return"production"})),enumerable:!1,configurable:!0,writable:!0}),It[Nt]}}();function At(e){try{return e()}catch(e){}}var Rt=At((function(){return globalThis}))||At((function(){return window}))||At((function(){return self}))||At((function(){return global}))||At((function(){return At.constructor("return this")()})),xt=!1;function Pt(e,t){if(!Boolean(e))throw new Error(t)}!Rt||At((function(){return"production"}))||At((function(){return process}))||(Object.defineProperty(Rt,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),xt=!0);const $t=10,Ct=2;function jt(e){return Mt(e,[])}function Mt(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const r=[...t,e];if(function(e){return"function"==typeof e.toJSON}(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:Mt(t,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>Ct)return"[Array]";const r=Math.min($t,e.length),n=e.length-r,i=[];for(let n=0;n<r;++n)i.push(Mt(e[n],t));return 1===n?i.push("... 1 more item"):n>1&&i.push(`... ${n} more items`),"["+i.join(", ")+"]"}(e,r);return function(e,t){const r=Object.entries(e);if(0===r.length)return"{}";if(t.length>Ct)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const n=r.map((([e,r])=>e+": "+Mt(r,t)));return"{ "+n.join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}class Ft{constructor(e,t="GraphQL request",r={line:1,column:1}){"string"==typeof e||Pt(!1,`Body must be a string. Received: ${jt(e)}.`),this.body=e,this.name=t,this.locationOffset=r,this.locationOffset.line>0||Pt(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Pt(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function qt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Vt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Lt(e,t,r){return t&&Vt(e.prototype,t),r&&Vt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}xt&&(delete Rt.process,xt=!1),__DEV__?wt("boolean"==typeof Dt,Dt):wt("boolean"==typeof Dt,39);var Ut=function(){return"function"==typeof Symbol},Qt=function(e){return Ut()&&Boolean(Symbol[e])},Bt=function(e){return Qt(e)?Symbol[e]:"@@"+e};Ut()&&!Qt("observable")&&(Symbol.observable=Symbol("observable"));var zt=Bt("iterator"),Yt=Bt("observable"),Kt=Bt("species");function Ht(e,t){var r=e[t];if(null!=r){if("function"!=typeof r)throw new TypeError(r+" is not a function");return r}}function Gt(e){var t=e.constructor;return void 0!==t&&null===(t=t[Kt])&&(t=void 0),void 0!==t?t:or}function Wt(e){return e instanceof or}function Jt(e){Jt.log?Jt.log(e):setTimeout((function(){throw e}))}function Zt(e){Promise.resolve().then((function(){try{e()}catch(e){Jt(e)}}))}function Xt(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var r=Ht(t,"unsubscribe");r&&r.call(t)}}catch(e){Jt(e)}}function er(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function tr(e,t,r){e._state="running";var n=e._observer;try{var i=Ht(n,t);switch(t){case"next":i&&i.call(n,r);break;case"error":if(er(e),!i)throw r;i.call(n,r);break;case"complete":er(e),i&&i.call(n)}}catch(e){Jt(e)}"closed"===e._state?Xt(e):"running"===e._state&&(e._state="ready")}function rr(e,t,r){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:r}],void Zt((function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var r=0;r<t.length&&(tr(e,t[r].type,t[r].value),"closed"!==e._state);++r);}}(e)}))):void tr(e,t,r);e._queue.push({type:t,value:r})}}var nr=function(){function e(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";var r=new ir(this);try{this._cleanup=t.call(void 0,r)}catch(e){r.error(e)}"initializing"===this._state&&(this._state="ready")}return e.prototype.unsubscribe=function(){"closed"!==this._state&&(er(this),Xt(this))},Lt(e,[{key:"closed",get:function(){return"closed"===this._state}}]),e}(),ir=function(){function e(e){this._subscription=e}var t=e.prototype;return t.next=function(e){rr(this._subscription,"next",e)},t.error=function(e){rr(this._subscription,"error",e)},t.complete=function(){rr(this._subscription,"complete")},Lt(e,[{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),or=function(){function e(t){if(!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}var t=e.prototype;return t.subscribe=function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new nr(e,this._subscriber)},t.forEach=function(e){var t=this;return new Promise((function(r,n){if("function"==typeof e)var i=t.subscribe({next:function(t){try{e(t,o)}catch(e){n(e),i.unsubscribe()}},error:n,complete:r});else n(new TypeError(e+" is not a function"));function o(){i.unsubscribe(),r()}}))},t.map=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(Gt(this))((function(r){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return r.error(e)}r.next(t)},error:function(e){r.error(e)},complete:function(){r.complete()}})}))},t.filter=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(Gt(this))((function(r){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return r.error(e)}r.next(t)},error:function(e){r.error(e)},complete:function(){r.complete()}})}))},t.reduce=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=Gt(this),n=arguments.length>1,i=!1,o=arguments[1];return new r((function(r){return t.subscribe({next:function(t){var s=!i;if(i=!0,!s||n)try{o=e(o,t)}catch(e){return r.error(e)}else o=t},error:function(e){r.error(e)},complete:function(){if(!i&&!n)return r.error(new TypeError("Cannot reduce an empty sequence"));r.next(o),r.complete()}})}))},t.concat=function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=Gt(this);return new i((function(t){var n,o=0;return function e(s){n=s.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){o===r.length?(n=void 0,t.complete()):e(i.from(r[o++]))}})}(e),function(){n&&(n.unsubscribe(),n=void 0)}}))},t.flatMap=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=Gt(this);return new r((function(n){var i=[],o=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return n.error(e)}var o=r.from(t).subscribe({next:function(e){n.next(e)},error:function(e){n.error(e)},complete:function(){var e=i.indexOf(o);e>=0&&i.splice(e,1),s()}});i.push(o)},error:function(e){n.error(e)},complete:function(){s()}});function s(){o.closed&&0===i.length&&n.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),o.unsubscribe()}}))},t[Yt]=function(){return this},e.from=function(t){var r="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var n=Ht(t,Yt);if(n){var i=n.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return Wt(i)&&i.constructor===r?i:new r((function(e){return i.subscribe(e)}))}if(Qt("iterator")&&(n=Ht(t,zt)))return new r((function(e){Zt((function(){if(!e.closed){for(var r,i=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return qt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?qt(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(n.call(t));!(r=i()).done;){var o=r.value;if(e.next(o),e.closed)return}e.complete()}}))}));if(Array.isArray(t))return new r((function(e){Zt((function(){if(!e.closed){for(var r=0;r<t.length;++r)if(e.next(t[r]),e.closed)return;e.complete()}}))}));throw new TypeError(t+" is not observable")},e.of=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return new("function"==typeof this?this:e)((function(e){Zt((function(){if(!e.closed){for(var t=0;t<r.length;++t)if(e.next(r[t]),e.closed)return;e.complete()}}))}))},Lt(e,null,[{key:Kt,get:function(){return this}}]),e}();function sr(e){return null!==e&&"object"==typeof e}function ar(e,t){var r=t,n=[];return e.definitions.forEach((function(e){if("OperationDefinition"===e.kind)throw __DEV__?new bt("Found a ".concat(e.operation," operation").concat(e.name?" named '".concat(e.name.value,"'"):"",". ")+"No operations are allowed when using a fragment as a query. Only fragments are allowed."):new bt(44);"FragmentDefinition"===e.kind&&n.push(e)})),void 0===r&&(__DEV__?wt(1===n.length,"Found ".concat(n.length," fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")):wt(1===n.length,45),r=n[0].name.value),le(le({},e),{definitions:ye([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],e.definitions,!0)})}function cr(e){void 0===e&&(e=[]);var t={};return e.forEach((function(e){t[e.name.value]=e})),t}function ur(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":var r=e.name.value;if("function"==typeof t)return t(r);var n=t&&t[r];return __DEV__?wt(n,"No fragment named ".concat(r)):wt(n,46),n||null;default:return null}}function lr(e){return{__ref:String(e)}}function fr(e){return Boolean(e&&"object"==typeof e&&"string"==typeof e.__ref)}function hr(e,t,r,n){if(function(e){return"IntValue"===e.kind}(r)||function(e){return"FloatValue"===e.kind}(r))e[t.value]=Number(r.value);else if(function(e){return"BooleanValue"===e.kind}(r)||function(e){return"StringValue"===e.kind}(r))e[t.value]=r.value;else if(function(e){return"ObjectValue"===e.kind}(r)){var i={};r.fields.map((function(e){return hr(i,e.name,e.value,n)})),e[t.value]=i}else if(function(e){return"Variable"===e.kind}(r)){var o=(n||{})[r.name.value];e[t.value]=o}else if(function(e){return"ListValue"===e.kind}(r))e[t.value]=r.values.map((function(e){var r={};return hr(r,t,e,n),r[t.value]}));else if(function(e){return"EnumValue"===e.kind}(r))e[t.value]=r.value;else{if(!function(e){return"NullValue"===e.kind}(r))throw __DEV__?new bt('The inline argument "'.concat(t.value,'" of kind "').concat(r.kind,'"')+"is not supported. Use variables instead of inline arguments to overcome this limitation."):new bt(55);e[t.value]=null}}Ut()&&Object.defineProperty(or,Symbol("extensions"),{value:{symbol:Yt,hostReportError:Jt},configurable:!0});var dr=["connection","include","skip","client","rest","export"],pr=Object.assign((function(e,t,r){if(t&&r&&r.connection&&r.connection.key){if(r.connection.filter&&r.connection.filter.length>0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i={};return n.forEach((function(e){i[e]=t[e]})),"".concat(r.connection.key,"(").concat(mr(i),")")}return r.connection.key}var o=e;if(t){var s=mr(t);o+="(".concat(s,")")}return r&&Object.keys(r).forEach((function(e){-1===dr.indexOf(e)&&(r[e]&&Object.keys(r[e]).length?o+="@".concat(e,"(").concat(mr(r[e]),")"):o+="@".concat(e))})),o}),{setStringify:function(e){var t=mr;return mr=e,t}}),mr=function(e){return JSON.stringify(e,yr)};function yr(e,t){return sr(t)&&!Array.isArray(t)&&(t=Object.keys(t).sort().reduce((function(e,r){return e[r]=t[r],e}),{})),t}function vr(e,t){if(e.arguments&&e.arguments.length){var r={};return e.arguments.forEach((function(e){var n=e.name,i=e.value;return hr(r,n,i,t)})),r}return null}function gr(e){return e.alias?e.alias.value:e.name.value}function _r(e,t,r){if("string"==typeof e.__typename)return e.__typename;for(var n=0,i=t.selections;n<i.length;n++){var o=i[n];if(br(o)){if("__typename"===o.name.value)return e[gr(o)]}else{var s=_r(e,ur(o,r).selectionSet,r);if("string"==typeof s)return s}}}function br(e){return"Field"===e.kind}function wr(e){__DEV__?wt(e&&"Document"===e.kind,'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):wt(e&&"Document"===e.kind,47);var t=e.definitions.filter((function(e){return"FragmentDefinition"!==e.kind})).map((function(e){if("OperationDefinition"!==e.kind)throw __DEV__?new bt('Schema type definitions not allowed in queries. Found: "'.concat(e.kind,'"')):new bt(48);return e}));return __DEV__?wt(t.length<=1,"Ambiguous GraphQL document: contains ".concat(t.length," operations")):wt(t.length<=1,49),e}function Er(e){return wr(e),e.definitions.filter((function(e){return"OperationDefinition"===e.kind}))[0]}function Sr(e){return e.definitions.filter((function(e){return"OperationDefinition"===e.kind&&e.name})).map((function(e){return e.name.value}))[0]||null}function Or(e){return e.definitions.filter((function(e){return"FragmentDefinition"===e.kind}))}function Tr(e){var t=Er(e);return __DEV__?wt(t&&"query"===t.operation,"Must contain a query definition."):wt(t&&"query"===t.operation,50),t}function Ir(e){var t;wr(e);for(var r=0,n=e.definitions;r<n.length;r++){var i=n[r];if("OperationDefinition"===i.kind){var o=i.operation;if("query"===o||"mutation"===o||"subscription"===o)return i}"FragmentDefinition"!==i.kind||t||(t=i)}if(t)return t;throw __DEV__?new bt("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new bt(54)}function kr(e){var t=Object.create(null),r=e&&e.variableDefinitions;return r&&r.length&&r.forEach((function(e){e.defaultValue&&hr(t,e.variable.name,e.defaultValue)})),t}function Nr(e,t){return t?t(e):or.of()}function Dr(e){return"function"==typeof e?new xr(e):e}function Ar(e){return e.request.length<=1}var Rr=function(e){function t(t,r){var n=e.call(this,t)||this;return n.link=r,n}return ue(t,e),t}(Error),xr=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e((function(){return or.of()}))},e.from=function(t){return 0===t.length?e.empty():t.map(Dr).reduce((function(e,t){return e.concat(t)}))},e.split=function(t,r,n){var i=Dr(r),o=Dr(n||new e(Nr));return Ar(i)&&Ar(o)?new e((function(e){return t(e)?i.request(e)||or.of():o.request(e)||or.of()})):new e((function(e,r){return t(e)?i.request(e,r)||or.of():o.request(e,r)||or.of()}))},e.execute=function(e,t){return e.request(function(e,t){var r=le({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){r=le(le({},r),"function"==typeof e?e(r):e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return le({},r)}}),t}(t.context,function(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName="string"!=typeof t.query?Sr(t.query)||void 0:""),t}(function(e){for(var t=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];if(t.indexOf(i)<0)throw __DEV__?new bt("illegal argument: ".concat(i)):new bt(27)}return e}(t))))||or.of()},e.concat=function(t,r){var n=Dr(t);if(Ar(n))return __DEV__&&wt.warn(new Rr("You are calling concat on a terminating link, which will have no effect",n)),n;var i=Dr(r);return Ar(i)?new e((function(e){return n.request(e,(function(e){return i.request(e)||or.of()}))||or.of()})):new e((function(e,t){return n.request(e,(function(e){return i.request(e,t)||or.of()}))||or.of()}))},e.prototype.split=function(t,r,n){return this.concat(e.split(t,r,n||new e(Nr)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(e,t){throw __DEV__?new bt("request is not implemented"):new bt(22)},e.prototype.onError=function(e,t){if(t&&t.error)return t.error(e),!1;throw e},e.prototype.setOnError=function(e){return this.onError=e,this},e}(),Pr=xr.execute;class $r{constructor(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class Cr{constructor(e,t,r,n,i,o){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const jr={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},Mr=new Set(Object.keys(jr));function Fr(e){const t=null==e?void 0:e.kind;return"string"==typeof t&&Mr.has(t)}var qr,Vr,Lr;!function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"}(qr||(qr={})),(Lr=Vr||(Vr={})).NAME="Name",Lr.DOCUMENT="Document",Lr.OPERATION_DEFINITION="OperationDefinition",Lr.VARIABLE_DEFINITION="VariableDefinition",Lr.SELECTION_SET="SelectionSet",Lr.FIELD="Field",Lr.ARGUMENT="Argument",Lr.FRAGMENT_SPREAD="FragmentSpread",Lr.INLINE_FRAGMENT="InlineFragment",Lr.FRAGMENT_DEFINITION="FragmentDefinition",Lr.VARIABLE="Variable",Lr.INT="IntValue",Lr.FLOAT="FloatValue",Lr.STRING="StringValue",Lr.BOOLEAN="BooleanValue",Lr.NULL="NullValue",Lr.ENUM="EnumValue",Lr.LIST="ListValue",Lr.OBJECT="ObjectValue",Lr.OBJECT_FIELD="ObjectField",Lr.DIRECTIVE="Directive",Lr.NAMED_TYPE="NamedType",Lr.LIST_TYPE="ListType",Lr.NON_NULL_TYPE="NonNullType",Lr.SCHEMA_DEFINITION="SchemaDefinition",Lr.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",Lr.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",Lr.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",Lr.FIELD_DEFINITION="FieldDefinition",Lr.INPUT_VALUE_DEFINITION="InputValueDefinition",Lr.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",Lr.UNION_TYPE_DEFINITION="UnionTypeDefinition",Lr.ENUM_TYPE_DEFINITION="EnumTypeDefinition",Lr.ENUM_VALUE_DEFINITION="EnumValueDefinition",Lr.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",Lr.DIRECTIVE_DEFINITION="DirectiveDefinition",Lr.SCHEMA_EXTENSION="SchemaExtension",Lr.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",Lr.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",Lr.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",Lr.UNION_TYPE_EXTENSION="UnionTypeExtension",Lr.ENUM_TYPE_EXTENSION="EnumTypeExtension",Lr.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension";const Ur=Object.freeze({});function Qr(e,t,r=jr){const n=new Map;for(const e of Object.values(Vr))n.set(e,Br(t,e));let i,o,s,a=Array.isArray(e),c=[e],u=-1,l=[],f=e;const h=[],d=[];do{u++;const e=u===c.length,v=e&&0!==l.length;if(e){if(o=0===d.length?void 0:h[h.length-1],f=s,s=d.pop(),v)if(a){f=f.slice();let e=0;for(const[t,r]of l){const n=t-e;null===r?(f.splice(n,1),e++):f[n]=r}}else{f=Object.defineProperties({},Object.getOwnPropertyDescriptors(f));for(const[e,t]of l)f[e]=t}u=i.index,c=i.keys,l=i.edits,a=i.inArray,i=i.prev}else if(s){if(o=a?u:c[u],f=s[o],null==f)continue;h.push(o)}let g;if(!Array.isArray(f)){var p,m;Fr(f)||Pt(!1,`Invalid AST Node: ${jt(f)}.`);const r=e?null===(p=n.get(f.kind))||void 0===p?void 0:p.leave:null===(m=n.get(f.kind))||void 0===m?void 0:m.enter;if(g=null==r?void 0:r.call(t,f,o,s,h,d),g===Ur)break;if(!1===g){if(!e){h.pop();continue}}else if(void 0!==g&&(l.push([o,g]),!e)){if(!Fr(g)){h.pop();continue}f=g}}var y;void 0===g&&v&&l.push([o,f]),e?h.pop():(i={inArray:a,index:u,keys:c,edits:l,prev:i},a=Array.isArray(f),c=a?f:null!==(y=r[f.kind])&&void 0!==y?y:[],u=-1,l=[],s&&d.push(s),s=f)}while(void 0!==i);return 0!==l.length?l[l.length-1][1]:e}function Br(e,t){const r=e[t];return"object"==typeof r?r:"function"==typeof r?{enter:r,leave:void 0}:{enter:e.enter,leave:e.leave}}function zr(e,t){var r=e.directives;return!r||!r.length||function(e){var t=[];return e&&e.length&&e.forEach((function(e){if(function(e){var t=e.name.value;return"skip"===t||"include"===t}(e)){var r=e.arguments,n=e.name.value;__DEV__?wt(r&&1===r.length,"Incorrect number of arguments for the @".concat(n," directive.")):wt(r&&1===r.length,41);var i=r[0];__DEV__?wt(i.name&&"if"===i.name.value,"Invalid argument for the @".concat(n," directive.")):wt(i.name&&"if"===i.name.value,42);var o=i.value;__DEV__?wt(o&&("Variable"===o.kind||"BooleanValue"===o.kind),"Argument for the @".concat(n," directive must be a variable or a boolean value.")):wt(o&&("Variable"===o.kind||"BooleanValue"===o.kind),43),t.push({directive:e,ifArgument:i})}})),t}(r).every((function(e){var r=e.directive,n=e.ifArgument,i=!1;return"Variable"===n.value.kind?(i=t&&t[n.value.name.value],__DEV__?wt(void 0!==i,"Invalid variable referenced in @".concat(r.name.value," directive.")):wt(void 0!==i,40)):i=n.value.value,"skip"===r.name.value?!i:i}))}function Yr(e,t,r){var n=new Set(e),i=n.size;return Qr(t,{Directive:function(e){if(n.delete(e.name.value)&&(!r||!n.size))return Ur}}),r?!n.size:n.size<i}function Kr(e){return e&&Yr(["client","export"],e,!0)}var Hr=function(e,t){var r;try{r=JSON.stringify(e)}catch(e){var n=__DEV__?new bt("Network request failed. ".concat(t," is not serializable: ").concat(e.message)):new bt(24);throw n.parseError=e,n}return r},Gr="function"==typeof WeakMap&&"ReactNative"!==Tt((function(){return navigator.product})),Wr="function"==typeof WeakSet,Jr="function"==typeof Symbol&&"function"==typeof Symbol.for,Zr=Jr&&Symbol.asyncIterator;function Xr(e){var t={next:function(){return e.read()}};return Zr&&(t[Symbol.asyncIterator]=function(){return this}),t}function en(e){var t,r,n,i,o=e;if(e.body&&(o=e.body),i=o,Zr&&i[Symbol.asyncIterator])return function(e){var t,r=e[Symbol.asyncIterator]();return(t={next:function(){return r.next()}})[Symbol.asyncIterator]=function(){return this},t}(o);if(function(e){return!!e.getReader}(o))return Xr(o.getReader());if(function(e){return!!e.stream}(o))return Xr(o.stream().getReader());if(function(e){return!!e.arrayBuffer}(o))return t=o.arrayBuffer(),r=!1,n={next:function(){return r?Promise.resolve({value:void 0,done:!0}):(r=!0,new Promise((function(e,r){t.then((function(t){e({value:t,done:!1})})).catch(r)})))}},Zr&&(n[Symbol.asyncIterator]=function(){return this}),n;if(function(e){return!!e.pipe}(o))return function(e){var t=null,r=null,n=!1,i=[],o=[];function s(e){if(!r){if(o.length){var t=o.shift();if(Array.isArray(t)&&t[0])return t[0]({value:e,done:!1})}i.push(e)}}function a(e){r=e,o.slice().forEach((function(t){t[1](e)})),!t||t()}function c(){n=!0,o.slice().forEach((function(e){e[0]({value:void 0,done:!0})})),!t||t()}t=function(){t=null,e.removeListener("data",s),e.removeListener("error",a),e.removeListener("end",c),e.removeListener("finish",c),e.removeListener("close",c)},e.on("data",s),e.on("error",a),e.on("end",c),e.on("finish",c),e.on("close",c);var u={next:function(){return new Promise((function(e,t){return r?t(r):i.length?e({value:i.shift(),done:!1}):n?e({value:void 0,done:!0}):void o.push([e,t])}))}};return Zr&&(u[Symbol.asyncIterator]=function(){return this}),u}(o);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}Tt((function(){return window.document.createElement})),Tt((function(){return navigator.userAgent.indexOf("jsdom")>=0}));var tn=function(e,t,r){var n=new Error(r);throw n.name="ServerError",n.response=e,n.statusCode=e.status,n.result=t,n},rn=Object.prototype.hasOwnProperty;function nn(e){var t={};return e.split("\n").forEach((function(e){var r=e.indexOf(":");if(r>-1){var n=e.slice(0,r).trim().toLowerCase(),i=e.slice(r+1).trim();t[n]=i}})),t}function on(e,t){e.status>=300&&tn(e,function(){try{return JSON.parse(t)}catch(e){return t}}(),"Response not successful: Received status code ".concat(e.status));try{return JSON.parse(t)}catch(n){var r=n;throw r.name="ServerParseError",r.response=e,r.statusCode=e.status,r.bodyText=t,r}}function sn(e,t){var r,n;"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&(null===(r=t.next)||void 0===r||r.call(t,e.result)),null===(n=t.error)||void 0===n||n.call(t,e))}function an(e){return 9===e||32===e}function cn(e){return e>=48&&e<=57}function un(e){return e>=97&&e<=122||e>=65&&e<=90}function ln(e){return un(e)||95===e}function fn(e){var t;let r=Number.MAX_SAFE_INTEGER,n=null,i=-1;for(let t=0;t<e.length;++t){var o;const s=e[t],a=hn(s);a!==s.length&&(n=null!==(o=n)&&void 0!==o?o:t,i=t,0!==t&&a<r&&(r=a))}return e.map(((e,t)=>0===t?e:e.slice(r))).slice(null!==(t=n)&&void 0!==t?t:0,i+1)}function hn(e){let t=0;for(;t<e.length&&an(e.charCodeAt(t));)++t;return t}const dn=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function pn(e){return mn[e.charCodeAt(0)]}const mn=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"];function yn(e){return Qr(e,vn)}const vn={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>gn(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=bn("(",gn(e.variableDefinitions,", "),")"),r=gn([e.operation,gn([e.name,t]),gn(e.directives," ")]," ");return("query"===r?"":r+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:r,directives:n})=>e+": "+t+bn(" = ",r)+bn(" ",gn(n," "))},SelectionSet:{leave:({selections:e})=>_n(e)},Field:{leave({alias:e,name:t,arguments:r,directives:n,selectionSet:i}){const o=bn("",e,": ")+t;let s=o+bn("(",gn(r,", "),")");return s.length>80&&(s=o+bn("(\n",wn(gn(r,"\n")),"\n)")),gn([s,gn(n," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+bn(" ",gn(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:r})=>gn(["...",bn("on ",e),gn(t," "),r]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:r,directives:n,selectionSet:i})=>`fragment ${e}${bn("(",gn(r,", "),")")} on ${t} ${bn("",gn(n," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?function(e,t){const r=e.replace(/"""/g,'\\"""'),n=r.split(/\r\n|[\n\r]/g),i=1===n.length,o=n.length>1&&n.slice(1).every((e=>0===e.length||an(e.charCodeAt(0)))),s=r.endsWith('\\"""'),a=e.endsWith('"')&&!s,c=e.endsWith("\\"),u=a||c,l=!i||e.length>70||u||o||s;let f="";const h=i&&an(e.charCodeAt(0));return(l&&!h||o)&&(f+="\n"),f+=r,(l||u)&&(f+="\n"),'"""'+f+'"""'}(e):`"${e.replace(dn,pn)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+gn(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+gn(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+bn("(",gn(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:r})=>bn("",e,"\n")+gn(["schema",gn(t," "),_n(r)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:r})=>bn("",e,"\n")+gn(["scalar",t,gn(r," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:n,fields:i})=>bn("",e,"\n")+gn(["type",t,bn("implements ",gn(r," & ")),gn(n," "),_n(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:r,type:n,directives:i})=>bn("",e,"\n")+t+(En(r)?bn("(\n",wn(gn(r,"\n")),"\n)"):bn("(",gn(r,", "),")"))+": "+n+bn(" ",gn(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:r,defaultValue:n,directives:i})=>bn("",e,"\n")+gn([t+": "+r,bn("= ",n),gn(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:n,fields:i})=>bn("",e,"\n")+gn(["interface",t,bn("implements ",gn(r," & ")),gn(n," "),_n(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:r,types:n})=>bn("",e,"\n")+gn(["union",t,gn(r," "),bn("= ",gn(n," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:r,values:n})=>bn("",e,"\n")+gn(["enum",t,gn(r," "),_n(n)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:r})=>bn("",e,"\n")+gn([t,gn(r," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:r,fields:n})=>bn("",e,"\n")+gn(["input",t,gn(r," "),_n(n)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:r,repeatable:n,locations:i})=>bn("",e,"\n")+"directive @"+t+(En(r)?bn("(\n",wn(gn(r,"\n")),"\n)"):bn("(",gn(r,", "),")"))+(n?" repeatable":"")+" on "+gn(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>gn(["extend schema",gn(e," "),_n(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>gn(["extend scalar",e,gn(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:n})=>gn(["extend type",e,bn("implements ",gn(t," & ")),gn(r," "),_n(n)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:n})=>gn(["extend interface",e,bn("implements ",gn(t," & ")),gn(r," "),_n(n)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:r})=>gn(["extend union",e,gn(t," "),bn("= ",gn(r," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:r})=>gn(["extend enum",e,gn(t," "),_n(r)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:r})=>gn(["extend input",e,gn(t," "),_n(r)]," ")}};function gn(e,t=""){var r;return null!==(r=null==e?void 0:e.filter((e=>e)).join(t))&&void 0!==r?r:""}function _n(e){return bn("{\n",wn(gn(e,"\n")),"\n}")}function bn(e,t,r=""){return null!=t&&""!==t?e+t+r:""}function wn(e){return bn(" ",e.replace(/\n/g,"\n "))}function En(e){var t;return null!==(t=null==e?void 0:e.some((e=>e.includes("\n"))))&&void 0!==t&&t}var Sn={http:{includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},On=function(e,t){return t(e)};function Tn(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i={},o={};r.forEach((function(e){i=le(le(le({},i),e.options),{headers:le(le({},i.headers),e.headers)}),e.credentials&&(i.credentials=e.credentials),o=le(le({},o),e.http)})),i.headers&&(i.headers=function(e,t){if(!t){var r=Object.create(null);return Object.keys(Object(e)).forEach((function(t){r[t.toLowerCase()]=e[t]})),r}var n=Object.create(null);Object.keys(Object(e)).forEach((function(t){n[t.toLowerCase()]={originalName:t,value:e[t]}}));var i=Object.create(null);return Object.keys(n).forEach((function(e){i[n[e].originalName]=n[e].value})),i}(i.headers,o.preserveHeaderCase));var s=e.operationName,a=e.extensions,c=e.variables,u=e.query,l={operationName:s,variables:c};return o.includeExtensions&&(l.extensions=a),o.includeQuery&&(l.query=t(u,yn)),{options:i,body:l}}function In(e){return new or((function(t){t.error(e)}))}var kn=Tt((function(){return fetch})),Nn=function(e){void 0===e&&(e={});var t=e.uri,r=void 0===t?"/graphql":t,n=e.fetch,i=e.print,o=void 0===i?On:i,s=e.includeExtensions,a=e.preserveHeaderCase,c=e.useGETForQueries,u=e.includeUnusedVariables,l=void 0!==u&&u,f=fe(e,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);__DEV__&&function(e){if(!e&&"undefined"==typeof fetch)throw __DEV__?new bt("\n\"fetch\" has not been found globally and no fetcher has been configured. To fix this, install a fetch package (like https://www.npmjs.com/package/cross-fetch), instantiate the fetcher, and pass it into your HttpLink constructor. For example:\n\nimport fetch from 'cross-fetch';\nimport { ApolloClient, HttpLink } from '@apollo/client';\nconst client = new ApolloClient({\n link: new HttpLink({ uri: '/graphql', fetch })\n});\n "):new bt(23)}(n||kn);var h={http:{includeExtensions:s,preserveHeaderCase:a},options:f.fetchOptions,credentials:f.credentials,headers:f.headers};return new xr((function(e){var t=function(e,t){return e.getContext().uri||("function"==typeof t?t(e):t||"/graphql")}(e,r),i=e.getContext(),s={};if(i.clientAwareness){var a=i.clientAwareness,u=a.name,f=a.version;u&&(s["apollographql-client-name"]=u),f&&(s["apollographql-client-version"]=f)}var d,p=le(le({},s),i.headers),m={http:i.http,options:i.fetchOptions,credentials:i.credentials,headers:p},y=Tn(e,o,Sn,h,m),v=y.options,g=y.body;if(g.variables&&!l){var _=new Set(Object.keys(g.variables));Qr(e.query,{Variable:function(e,t,r){r&&"VariableDefinition"!==r.kind&&_.delete(e.name.value)}}),_.size&&(g.variables=le({},g.variables),_.forEach((function(e){delete g.variables[e]})))}if(!v.signal){var b=function(){if("undefined"==typeof AbortController)return{controller:!1,signal:!1};var e=new AbortController;return{controller:e,signal:e.signal}}(),w=b.controller,E=b.signal;(d=w)&&(v.signal=E)}if(c&&!e.query.definitions.some((function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation}))&&(v.method="GET"),Yr(["defer"],e.query)&&(v.headers=v.headers||{},v.headers.accept="multipart/mixed; deferSpec=20220824, application/json"),"GET"===v.method){var S=function(e,t){var r=[],n=function(e,t){r.push("".concat(e,"=").concat(encodeURIComponent(t)))};if("query"in t&&n("query",t.query),t.operationName&&n("operationName",t.operationName),t.variables){var i=void 0;try{i=Hr(t.variables,"Variables map")}catch(e){return{parseError:e}}n("variables",i)}if(t.extensions){var o=void 0;try{o=Hr(t.extensions,"Extensions map")}catch(e){return{parseError:e}}n("extensions",o)}var s="",a=e,c=e.indexOf("#");-1!==c&&(s=e.substr(c),a=e.substr(0,c));var u=-1===a.indexOf("?")?"?":"&";return{newURI:a+u+r.join("&")+s}}(t,g),O=S.newURI,T=S.parseError;if(T)return In(T);t=O}else try{v.body=Hr(g,"Payload")}catch(T){return In(T)}return new or((function(r){return(n||Tt((function(){return fetch}))||kn)(t,v).then((function(t){var n;e.setContext({response:t});var i=null===(n=t.headers)||void 0===n?void 0:n.get("content-type");return null!==i&&/^multipart\/mixed/i.test(i)?function(e,t){var r,n,i;return he(this,void 0,void 0,(function(){var o,s,a,c,u,l,f,h,d,p,m,y,v,g,_,b,w,E,S,O;return de(this,(function(T){switch(T.label){case 0:if(void 0===TextDecoder)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");o=new TextDecoder("utf-8"),s=null===(r=e.headers)||void 0===r?void 0:r.get("content-type"),a="boundary=",c=(null==s?void 0:s.includes(a))?null==s?void 0:s.substring((null==s?void 0:s.indexOf(a))+9).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",u="--".concat(c),l="",f=en(e),h=!0,T.label=1;case 1:return h?[4,f.next()]:[3,3];case 2:for(d=T.sent(),p=d.value,m=d.done,y="string"==typeof p?p:o.decode(p),h=!m,v=(l+=y).indexOf(u);v>-1;){if(g=void 0,O=[l.slice(0,v),l.slice(v+u.length)],l=O[1],(g=O[0]).trim()){if(_=g.indexOf("\r\n\r\n"),b=nn(g.slice(0,_)),(w=b["content-type"])&&-1===w.toLowerCase().indexOf("application/json"))throw new Error("Unsupported patch content type: application/json is required.");E=g.slice(_);try{S=on(e,E.replace("\r\n","")),(Object.keys(S).length>1||"data"in S||"incremental"in S||"errors"in S)&&(null===(n=t.next)||void 0===n||n.call(t,S))}catch(e){sn(e,t)}}v=l.indexOf(u)}return[3,1];case 3:return null===(i=t.complete)||void 0===i||i.call(t),[2]}}))}))}(t,r):function(e,t,r){var n;(n=t,function(e){return e.text().then((function(t){return on(e,t)})).then((function(t){return e.status>=300&&tn(e,t,"Response not successful: Received status code ".concat(e.status)),Array.isArray(t)||rn.call(t,"data")||rn.call(t,"errors")||tn(e,t,"Server response was missing for query '".concat(Array.isArray(n)?n.map((function(e){return e.operationName})):n.operationName,"'.")),t}))})(e).then((function(e){var t,n;null===(t=r.next)||void 0===t||t.call(r,e),null===(n=r.complete)||void 0===n||n.call(r)})).catch((function(e){return sn(e,r)}))}(t,e,r)})).catch((function(e){return sn(e,r)})),function(){d&&d.abort()}}))}))},Dn=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,Nn(t).request)||this;return r.options=t,r}return ue(t,e),t}(xr),An=Object.prototype,Rn=An.toString,xn=An.hasOwnProperty,Pn=Function.prototype.toString,$n=new Map;function Cn(e,t){try{return jn(e,t)}finally{$n.clear()}}function jn(e,t){if(e===t)return!0;var r,n,i,o=Rn.call(e);if(o!==Rn.call(t))return!1;switch(o){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":if(Vn(e,t))return!0;var s=Mn(e),a=Mn(t),c=s.length;if(c!==a.length)return!1;for(var u=0;u<c;++u)if(!xn.call(t,s[u]))return!1;for(u=0;u<c;++u){var l=s[u];if(!jn(e[l],t[l]))return!1}return!0;case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!=e)return t!=t;case"[object Boolean]":case"[object Date]":return+e==+t;case"[object RegExp]":case"[object String]":return e=="".concat(t);case"[object Map]":case"[object Set]":if(e.size!==t.size)return!1;if(Vn(e,t))return!0;for(var f=e.entries(),h="[object Map]"===o;;){var d=f.next();if(d.done)break;var p=d.value,m=p[0],y=p[1];if(!t.has(m))return!1;if(h&&!jn(y,t.get(m)))return!1}return!0;case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":e=new Uint8Array(e),t=new Uint8Array(t);case"[object DataView]":var v=e.byteLength;if(v===t.byteLength)for(;v--&&e[v]===t[v];);return-1===v;case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":var g=Pn.call(e);return g===Pn.call(t)&&(n=qn,!((i=(r=g).length-n.length)>=0&&r.indexOf(n,i)===i))}return!1}function Mn(e){return Object.keys(e).filter(Fn,e)}function Fn(e){return void 0!==this[e]}var qn="{ [native code] }";function Vn(e,t){var r=$n.get(e);if(r){if(r.has(t))return!0}else $n.set(e,r=new Set);return r.add(t),!1}var Ln=Array.isArray;function Un(e){return Array.isArray(e)&&e.length>0}var Qn=Object.prototype.hasOwnProperty;function Bn(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return zn(e)}function zn(e){var t=e[0]||{},r=e.length;if(r>1)for(var n=new Kn,i=1;i<r;++i)t=n.merge(t,e[i]);return t}var Yn=function(e,t,r){return this.merge(e[r],t[r])},Kn=function(){function e(e){void 0===e&&(e=Yn),this.reconciler=e,this.isObject=sr,this.pastCopies=new Set}return e.prototype.merge=function(e,t){for(var r=this,n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return sr(t)&&sr(e)?(Object.keys(t).forEach((function(i){if(Qn.call(e,i)){var o=e[i];if(t[i]!==o){var s=r.reconciler.apply(r,ye([e,t,i],n,!1));s!==o&&((e=r.shallowCopyForMerge(e))[i]=s)}}else(e=r.shallowCopyForMerge(e))[i]=t[i]})),e):t},e.prototype.shallowCopyForMerge=function(e){return sr(e)&&(this.pastCopies.has(e)||(e=Array.isArray(e)?e.slice(0):le({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},e}();function Hn(e){return"incremental"in e}function Gn(e,t){var r=e,n=new Kn;return Hn(t)&&Un(t.incremental)&&t.incremental.forEach((function(e){for(var t=e.data,i=e.path,o=i.length-1;o>=0;--o){var s=i[o],a=isNaN(+s)?{}:[];a[s]=t,t=a}r=n.merge(r,t)})),r}var Wn,Jn,Zn=function(){return Object.create(null)},Xn=Array.prototype,ei=Xn.forEach,ti=Xn.slice,ri=function(){function e(e,t){void 0===e&&(e=!0),void 0===t&&(t=Zn),this.weakness=e,this.makeData=t}return e.prototype.lookup=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.lookupArray(e)},e.prototype.lookupArray=function(e){var t=this;return ei.call(e,(function(e){return t=t.getChildTrie(e)})),t.data||(t.data=this.makeData(ti.call(e)))},e.prototype.getChildTrie=function(t){var r=this.weakness&&function(e){switch(typeof e){case"object":if(null===e)break;case"function":return!0}return!1}(t)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),n=r.get(t);return n||r.set(t,n=new e(this.weakness,this.makeData)),n},e}(),ni=function(){function e(){this.known=new(Wr?WeakSet:Set),this.pool=new ri(Gr),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return e.prototype.isKnown=function(e){return sr(e)&&this.known.has(e)},e.prototype.pass=function(e){if(sr(e)){var t=function(e){return sr(e)?Ln(e)?e.slice(0):le({__proto__:Object.getPrototypeOf(e)},e):e}(e);return this.passes.set(t,e),t}return e},e.prototype.admit=function(e){var t=this;if(sr(e)){var r=this.passes.get(e);if(r)return r;switch(Object.getPrototypeOf(e)){case Array.prototype:if(this.known.has(e))return e;var n=e.map(this.admit,this);return(a=this.pool.lookupArray(n)).array||(this.known.add(a.array=n),__DEV__&&Object.freeze(n)),a.array;case null:case Object.prototype:if(this.known.has(e))return e;var i=Object.getPrototypeOf(e),o=[i],s=this.sortedKeys(e);o.push(s.json);var a,c=o.length;if(s.sorted.forEach((function(r){o.push(t.admit(e[r]))})),!(a=this.pool.lookupArray(o)).object){var u=a.object=Object.create(i);this.known.add(u),s.sorted.forEach((function(e,t){u[e]=o[c+t]})),__DEV__&&Object.freeze(u)}return a.object}}return e},e.prototype.sortedKeys=function(e){var t=Object.keys(e),r=this.pool.lookupArray(t);if(!r.keys){t.sort();var n=JSON.stringify(t);(r.keys=this.keysByJSON.get(n))||this.keysByJSON.set(n,r.keys={sorted:t,json:n})}return r.keys},e}(),ii=Object.assign((function(e){if(sr(e)){void 0===Wn&&oi();var t=Wn.admit(e),r=Jn.get(t);return void 0===r&&Jn.set(t,r=JSON.stringify(t)),r}return JSON.stringify(e)}),{reset:oi});function oi(){Wn=new ni,Jn=new(Gr?WeakMap:Map)}function si(e,t,r){return new or((function(n){var i=n.next,o=n.error,s=n.complete,a=0,c=!1,u={then:function(e){return new Promise((function(t){return t(e())}))}};function l(e,t){return e?function(t){++a;var r=function(){return e(t)};u=u.then(r,r).then((function(e){--a,i&&i.call(n,e),c&&f.complete()}),(function(e){throw--a,e})).catch((function(e){o&&o.call(n,e)}))}:function(e){return t&&t.call(n,e)}}var f={next:l(t,i),error:l(r,o),complete:function(){c=!0,a||s&&s.call(n)}},h=e.subscribe(f);return function(){return h.unsubscribe()}}))}function ai(e){return Un(ci(e))}function ci(e){var t=Un(e.errors)?e.errors.slice(0):[];return Hn(e)&&Un(e.incremental)&&e.incremental.forEach((function(e){e.errors&&t.push.apply(t,e.errors)})),t}var ui={kind:Vr.FIELD,name:{kind:Vr.NAME,value:"__typename"}};function li(e,t){return!e||e.selectionSet.selections.every((function(e){return e.kind===Vr.FRAGMENT_SPREAD&&li(t[e.name.value],t)}))}function fi(e){return li(Er(e)||function(e){__DEV__?wt("Document"===e.kind,'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):wt("Document"===e.kind,51),__DEV__?wt(e.definitions.length<=1,"Fragment must have exactly one definition."):wt(e.definitions.length<=1,52);var t=e.definitions[0];return __DEV__?wt("FragmentDefinition"===t.kind,"Must be a fragment definition."):wt("FragmentDefinition"===t.kind,53),t}(e),cr(Or(e)))?null:e}function hi(e){var t=new Map;return function(r){void 0===r&&(r=e);var n=t.get(r);return n||t.set(r,n={variables:new Set,fragmentSpreads:new Set}),n}}function di(e,t){for(var r=hi(""),n=hi(""),i=function(e){for(var t=0,i=void 0;t<e.length&&(i=e[t]);++t)if(!Ln(i)){if(i.kind===Vr.OPERATION_DEFINITION)return r(i.name&&i.name.value);if(i.kind===Vr.FRAGMENT_DEFINITION)return n(i.name.value)}return __DEV__&&wt.error("Could not find operation or fragment"),null},o=0,s=t.definitions.length-1;s>=0;--s)t.definitions[s].kind===Vr.OPERATION_DEFINITION&&++o;var a=function(e){var t=new Set,r=[];return e.forEach((function(e){e.name?t.add(e.name):e.test&&r.push(e.test)})),function(e){return t.has(e.name.value)||r.some((function(t){return t(e)}))}}(e),c=e.some((function(e){return e.remove})),u=function(e){return c&&e&&e.some(a)},l=new Map,f=!1,h={enter:function(e){if(u(e.directives))return f=!0,null}},d=Qr(t,{Field:h,InlineFragment:h,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(e,t,r,n,o){var s=i(o);s&&s.variables.add(e.name.value)}},FragmentSpread:{enter:function(e,t,r,n,o){if(u(e.directives))return f=!0,null;var s=i(o);s&&s.fragmentSpreads.add(e.name.value)}},FragmentDefinition:{enter:function(e,t,r,n){l.set(JSON.stringify(n),e)},leave:function(e,t,r,i){return e===l.get(JSON.stringify(i))?e:o>0&&e.selectionSet.selections.every((function(e){return e.kind===Vr.FIELD&&"__typename"===e.name.value}))?(n(e.name.value).removed=!0,f=!0,null):void 0}},Directive:{leave:function(e){if(a(e))return f=!0,null}}});if(!f)return t;var p=function(e){return e.transitiveVars||(e.transitiveVars=new Set(e.variables),e.removed||e.fragmentSpreads.forEach((function(t){p(n(t)).transitiveVars.forEach((function(t){e.transitiveVars.add(t)}))}))),e},m=new Set;d.definitions.forEach((function(e){e.kind===Vr.OPERATION_DEFINITION?p(r(e.name&&e.name.value)).fragmentSpreads.forEach((function(e){m.add(e)})):e.kind!==Vr.FRAGMENT_DEFINITION||0!==o||n(e.name.value).removed||m.add(e.name.value)})),m.forEach((function(e){p(n(e)).fragmentSpreads.forEach((function(e){m.add(e)}))}));var y={enter:function(e){if(t=e.name.value,!m.has(t)||n(t).removed)return null;var t}};return fi(Qr(d,{FragmentSpread:y,FragmentDefinition:y,OperationDefinition:{leave:function(e){if(e.variableDefinitions){var t=p(r(e.name&&e.name.value)).transitiveVars;if(t.size<e.variableDefinitions.length)return le(le({},e),{variableDefinitions:e.variableDefinitions.filter((function(e){return t.has(e.variable.name.value)}))})}}}}))}var pi=Object.assign((function(e){return Qr(e,{SelectionSet:{enter:function(e,t,r){if(!r||r.kind!==Vr.OPERATION_DEFINITION){var n=e.selections;if(n&&!n.some((function(e){return br(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))}))){var i=r;if(!(br(i)&&i.directives&&i.directives.some((function(e){return"export"===e.name.value}))))return le(le({},e),{selections:ye(ye([],n,!0),[ui],!1)})}}}}})}),{added:function(e){return e===ui}}),mi={test:function(e){var t="connection"===e.name.value;return t&&(e.arguments&&e.arguments.some((function(e){return"key"===e.name.value}))||__DEV__&&wt.warn("Removing an @connection directive even though it does not have a key. You may want to use the key parameter to specify a store key.")),t}};function yi(e){return"query"===Ir(e).operation?e:Qr(e,{OperationDefinition:{enter:function(e){return le(le({},e),{operation:"query"})}}})}var vi=new Map;function gi(e){var t=vi.get(e)||1;return vi.set(e,t+1),"".concat(e,":").concat(t,":").concat(Math.random().toString(36).slice(2))}function _i(e,t,r){var n=[];e.forEach((function(e){return e[t]&&n.push(e)})),n.forEach((function(e){return e[t](r)}))}function bi(e){function t(t){Object.defineProperty(e,t,{value:or})}return Jr&&Symbol.species&&t(Symbol.species),t("@@species"),e}function wi(e){return e&&"function"==typeof e.then}var Ei=function(e){function t(t){var r=e.call(this,(function(e){return r.addObserver(e),function(){return r.removeObserver(e)}}))||this;return r.observers=new Set,r.promise=new Promise((function(e,t){r.resolve=e,r.reject=t})),r.handlers={next:function(e){null!==r.sub&&(r.latest=["next",e],r.notify("next",e),_i(r.observers,"next",e))},error:function(e){var t=r.sub;null!==t&&(t&&setTimeout((function(){return t.unsubscribe()})),r.sub=null,r.latest=["error",e],r.reject(e),r.notify("error",e),_i(r.observers,"error",e))},complete:function(){var e=r,t=e.sub,n=e.sources;if(null!==t){var i=(void 0===n?[]:n).shift();i?wi(i)?i.then((function(e){return r.sub=e.subscribe(r.handlers)})):r.sub=i.subscribe(r.handlers):(t&&setTimeout((function(){return t.unsubscribe()})),r.sub=null,r.latest&&"next"===r.latest[0]?r.resolve(r.latest[1]):r.resolve(),r.notify("complete"),_i(r.observers,"complete"))}}},r.nextResultListeners=new Set,r.cancel=function(e){r.reject(e),r.sources=[],r.handlers.complete()},r.promise.catch((function(e){})),"function"==typeof t&&(t=[new or(t)]),wi(t)?t.then((function(e){return r.start(e)}),r.handlers.error):r.start(t),r}return ue(t,e),t.prototype.start=function(e){void 0===this.sub&&(this.sources=Array.from(e),this.handlers.complete())},t.prototype.deliverLastMessage=function(e){if(this.latest){var t=this.latest[0],r=e[t];r&&r.call(e,this.latest[1]),null===this.sub&&"next"===t&&e.complete&&e.complete()}},t.prototype.addObserver=function(e){this.observers.has(e)||(this.deliverLastMessage(e),this.observers.add(e))},t.prototype.removeObserver=function(e){this.observers.delete(e)&&this.observers.size<1&&this.handlers.complete()},t.prototype.notify=function(e,t){var r=this.nextResultListeners;r.size&&(this.nextResultListeners=new Set,r.forEach((function(r){return r(e,t)})))},t.prototype.beforeNext=function(e){var t=!1;this.nextResultListeners.add((function(r,n){t||(t=!0,e(r,n))}))},t}(or);bi(Ei);var Si,Oi=function(e){function t(r){var n,i,o=r.graphQLErrors,s=r.clientErrors,a=r.networkError,c=r.errorMessage,u=r.extraInfo,l=e.call(this,c)||this;return l.name="ApolloError",l.graphQLErrors=o||[],l.clientErrors=s||[],l.networkError=a||null,l.message=c||(i="",(Un((n=l).graphQLErrors)||Un(n.clientErrors))&&(n.graphQLErrors||[]).concat(n.clientErrors||[]).forEach((function(e){var t=e?e.message:"Error message not found.";i+="".concat(t,"\n")})),n.networkError&&(i+="".concat(n.networkError.message,"\n")),i=i.replace(/\n$/,"")),l.extraInfo=u,l.__proto__=t.prototype,l}return ue(t,e),t}(Error);function Ti(e){return!!e&&e<7}!function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(Si||(Si={}));var Ii=Object.prototype.toString;function ki(e){return Ni(e)}function Ni(e,t){switch(Ii.call(e)){case"[object Array]":if((t=t||new Map).has(e))return t.get(e);var r=e.slice(0);return t.set(e,r),r.forEach((function(e,n){r[n]=Ni(e,t)})),r;case"[object Object]":if((t=t||new Map).has(e))return t.get(e);var n=Object.create(Object.getPrototypeOf(e));return t.set(e,n),Object.keys(e).forEach((function(r){n[r]=Ni(e[r],t)})),n;default:return e}}function Di(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Object.create(null);return e.forEach((function(e){e&&Object.keys(e).forEach((function(t){var n=e[t];void 0!==n&&(r[t]=n)}))})),r}var Ai=Object.assign,Ri=Object.hasOwnProperty,xi=function(e){function t(t){var r=t.queryManager,n=t.queryInfo,i=t.options,o=e.call(this,(function(e){try{var t=e._subscription._observer;t&&!t.error&&(t.error=$i)}catch(e){}var r=!o.observers.size;o.observers.add(e);var n=o.last;return n&&n.error?e.error&&e.error(n.error):n&&n.result&&e.next&&e.next(n.result),r&&o.reobserve().catch((function(){})),function(){o.observers.delete(e)&&!o.observers.size&&o.tearDownQuery()}}))||this;o.observers=new Set,o.subscriptions=new Set,o.queryInfo=n,o.queryManager=r,o.isTornDown=!1;var s=r.defaultOptions.watchQuery,a=(void 0===s?{}:s).fetchPolicy,c=void 0===a?"cache-first":a,u=i.fetchPolicy,l=void 0===u?c:u,f=i.initialFetchPolicy,h=void 0===f?"standby"===l?c:l:f;o.options=le(le({},i),{initialFetchPolicy:h,fetchPolicy:l}),o.queryId=n.queryId||r.generateQueryId();var d=Er(o.query);return o.queryName=d&&d.name&&d.name.value,o}return ue(t,e),Object.defineProperty(t.prototype,"query",{get:function(){return this.queryManager.transform(this.options.query).document},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var e=this;return new Promise((function(t,r){var n={next:function(r){t(r),e.observers.delete(n),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout((function(){i.unsubscribe()}),0)},error:r},i=e.subscribe(n)}))},t.prototype.getCurrentResult=function(e){void 0===e&&(e=!0);var t=this.getLastResult(!0),r=this.queryInfo.networkStatus||t&&t.networkStatus||Si.ready,n=le(le({},t),{loading:Ti(r),networkStatus:r}),i=this.options.fetchPolicy,o=void 0===i?"cache-first":i;if("network-only"===o||"no-cache"===o||"standby"===o||this.queryManager.transform(this.options.query).hasForcedResolvers);else{var s=this.queryInfo.getDiff();(s.complete||this.options.returnPartialData)&&(n.data=s.result),Cn(n.data,{})&&(n.data=void 0),s.complete?(delete n.partial,!s.complete||n.networkStatus!==Si.loading||"cache-first"!==o&&"cache-only"!==o||(n.networkStatus=Si.ready,n.loading=!1)):n.partial=!0,!__DEV__||s.complete||this.options.partialRefetch||n.loading||n.data||n.error||Ci(s.missing)}return e&&this.updateLastResult(n),n},t.prototype.isDifferentFromLastResult=function(e,t){return!this.last||!Cn(this.last.result,e)||t&&!Cn(this.last.variables,t)},t.prototype.getLast=function(e,t){var r=this.last;if(r&&r[e]&&(!t||Cn(r.variables,this.variables)))return r[e]},t.prototype.getLastResult=function(e){return this.getLast("result",e)},t.prototype.getLastError=function(e){return this.getLast("error",e)},t.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(e){var t,r={pollInterval:0},n=this.options.fetchPolicy;if(r.fetchPolicy="cache-and-network"===n?n:"no-cache"===n?"no-cache":"network-only",__DEV__&&e&&Ri.call(e,"variables")){var i=Tr(this.query),o=i.variableDefinitions;o&&o.some((function(e){return"variables"===e.variable.name.value}))||__DEV__&&wt.warn("Called refetch(".concat(JSON.stringify(e),") for query ").concat((null===(t=i.name)||void 0===t?void 0:t.value)||JSON.stringify(i),", which does not declare a $variables variable.\nDid you mean to call refetch(variables) instead of refetch({ variables })?"))}return e&&!Cn(this.options.variables,e)&&(r.variables=this.options.variables=le(le({},this.options.variables),e)),this.queryInfo.resetLastWrite(),this.reobserve(r,Si.refetch)},t.prototype.fetchMore=function(e){var t=this,r=le(le({},e.query?e:le(le(le(le({},this.options),{query:this.query}),e),{variables:le(le({},this.options.variables),e.variables)})),{fetchPolicy:"no-cache"}),n=this.queryManager.generateQueryId(),i=this.queryInfo,o=i.networkStatus;i.networkStatus=Si.fetchMore,r.notifyOnNetworkStatusChange&&this.observe();var s=new Set;return this.queryManager.fetchQuery(n,r,Si.fetchMore).then((function(a){return t.queryManager.removeQuery(n),i.networkStatus===Si.fetchMore&&(i.networkStatus=o),t.queryManager.cache.batch({update:function(n){var i=e.updateQuery;i?n.updateQuery({query:t.query,variables:t.variables,returnPartialData:!0,optimistic:!1},(function(e){return i(e,{fetchMoreResult:a.data,variables:r.variables})})):n.writeQuery({query:r.query,variables:r.variables,data:a.data})},onWatchUpdated:function(e){s.add(e.query)}}),a})).finally((function(){s.has(t.query)||Pi(t)}))},t.prototype.subscribeToMore=function(e){var t=this,r=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:function(r){var n=e.updateQuery;n&&t.updateQuery((function(e,t){var i=t.variables;return n(e,{subscriptionData:r,variables:i})}))},error:function(t){e.onError?e.onError(t):__DEV__&&wt.error("Unhandled GraphQL subscription error",t)}});return this.subscriptions.add(r),function(){t.subscriptions.delete(r)&&r.unsubscribe()}},t.prototype.setOptions=function(e){return this.reobserve(e)},t.prototype.setVariables=function(e){return Cn(this.variables,e)?this.observers.size?this.result():Promise.resolve():(this.options.variables=e,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:e},Si.setVariables):Promise.resolve())},t.prototype.updateQuery=function(e){var t=this.queryManager,r=e(t.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,{variables:this.variables});r&&(t.cache.writeQuery({query:this.options.query,data:r,variables:this.variables}),t.broadcastQueries())},t.prototype.startPolling=function(e){this.options.pollInterval=e,this.updatePolling()},t.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},t.prototype.applyNextFetchPolicy=function(e,t){if(t.nextFetchPolicy){var r=t.fetchPolicy,n=void 0===r?"cache-first":r,i=t.initialFetchPolicy,o=void 0===i?n:i;"standby"===n||("function"==typeof t.nextFetchPolicy?t.fetchPolicy=t.nextFetchPolicy(n,{reason:e,options:t,observable:this,initialFetchPolicy:o}):t.fetchPolicy="variables-changed"===e?o:t.nextFetchPolicy)}return t.fetchPolicy},t.prototype.fetch=function(e,t){return this.queryManager.setObservableQuery(this),this.queryManager.fetchQueryObservable(this.queryId,e,t)},t.prototype.updatePolling=function(){var e=this;if(!this.queryManager.ssrMode){var t=this.pollingInfo,r=this.options.pollInterval;if(r){if(!t||t.interval!==r){__DEV__?wt(r,"Attempted to start a polling query without a polling interval."):wt(r,13),(t||(this.pollingInfo={})).interval=r;var n=function(){e.pollingInfo&&(Ti(e.queryInfo.networkStatus)?i():e.reobserve({fetchPolicy:"no-cache"===e.options.initialFetchPolicy?"no-cache":"network-only"},Si.poll).then(i,i))},i=function(){var t=e.pollingInfo;t&&(clearTimeout(t.timeout),t.timeout=setTimeout(n,t.interval))};i()}}else t&&(clearTimeout(t.timeout),delete this.pollingInfo)}},t.prototype.updateLastResult=function(e,t){return void 0===t&&(t=this.variables),this.last=le(le({},this.last),{result:this.queryManager.assumeImmutableResults?e:ki(e),variables:t}),Un(e.errors)||delete this.last.error,this.last},t.prototype.reobserve=function(e,t){var r=this;this.isTornDown=!1;var n=t===Si.refetch||t===Si.fetchMore||t===Si.poll,i=this.options.variables,o=this.options.fetchPolicy,s=Di(this.options,e||{}),a=n?s:Ai(this.options,s);n||(this.updatePolling(),e&&e.variables&&!Cn(e.variables,i)&&"standby"!==a.fetchPolicy&&a.fetchPolicy===o&&(this.applyNextFetchPolicy("variables-changed",a),void 0===t&&(t=Si.setVariables)));var c=a.variables&&le({},a.variables),u=this.fetch(a,t),l={next:function(e){r.reportResult(e,c)},error:function(e){r.reportError(e,c)}};return n||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=u,this.observer=l),u.addObserver(l),u.promise},t.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},t.prototype.reportResult=function(e,t){var r=this.getLastError();(r||this.isDifferentFromLastResult(e,t))&&((r||!e.partial||this.options.returnPartialData)&&this.updateLastResult(e,t),_i(this.observers,"next",e))},t.prototype.reportError=function(e,t){var r=le(le({},this.getLastResult()),{error:e,errors:e.graphQLErrors,networkStatus:Si.error,loading:!1});this.updateLastResult(r,t),_i(this.observers,"error",this.last.error=e)},t.prototype.hasObservers=function(){return this.observers.size>0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t}(or);function Pi(e){var t=e.options,r=t.fetchPolicy,n=t.nextFetchPolicy;return"cache-and-network"===r||"network-only"===r?e.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(){return this.nextFetchPolicy=n,"function"==typeof n?n.apply(this,arguments):r}}):e.reobserve()}function $i(e){__DEV__&&wt.error("Unhandled error",e.message,e.stack)}function Ci(e){__DEV__&&e&&__DEV__&&wt.debug("Missing cache result fields: ".concat(JSON.stringify(e)),e)}function ji(e){return e.kind===Vr.FIELD||e.kind===Vr.FRAGMENT_SPREAD||e.kind===Vr.INLINE_FRAGMENT}bi(xi);var Mi=null,Fi={},qi=1;function Vi(e){try{return e()}catch(e){}}var Li="@wry/context:Slot",Ui=Vi((function(){return globalThis}))||Vi((function(){return o.g}))||Object.create(null),Qi=Ui[Li]||Array[Li]||function(e){try{Object.defineProperty(Ui,Li,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}}(function(){function e(){this.id=["slot",qi++,Date.now(),Math.random().toString(36).slice(2)].join(":")}return e.prototype.hasValue=function(){for(var e=Mi;e;e=e.parent)if(this.id in e.slots){var t=e.slots[this.id];if(t===Fi)break;return e!==Mi&&(Mi.slots[this.id]=t),!0}return Mi&&(Mi.slots[this.id]=Fi),!1},e.prototype.getValue=function(){if(this.hasValue())return Mi.slots[this.id]},e.prototype.withValue=function(e,t,r,n){var i,o=((i={__proto__:null})[this.id]=e,i),s=Mi;Mi={parent:s,slots:o};try{return t.apply(n,r)}finally{Mi=s}},e.bind=function(e){var t=Mi;return function(){var r=Mi;try{return Mi=t,e.apply(this,arguments)}finally{Mi=r}}},e.noContext=function(e,t,r){if(!Mi)return e.apply(r,t);var n=Mi;try{return Mi=null,e.apply(r,t)}finally{Mi=n}},e}());function Bi(){}Qi.bind,Qi.noContext;var zi,Yi=function(){function e(e,t){void 0===e&&(e=1/0),void 0===t&&(t=Bi),this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}return e.prototype.has=function(e){return this.map.has(e)},e.prototype.get=function(e){var t=this.getNode(e);return t&&t.value},e.prototype.getNode=function(e){var t=this.map.get(e);if(t&&t!==this.newest){var r=t.older,n=t.newer;n&&(n.older=r),r&&(r.newer=n),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=n)}return t},e.prototype.set=function(e,t){var r=this.getNode(e);return r?r.value=t:(r={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.map.set(e,r),r.value)},e.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},e.prototype.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)},e}(),Ki=new Qi,Hi=Object.prototype.hasOwnProperty,Gi=void 0===(zi=Array.from)?function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t}:zi;function Wi(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var Ji=[],Zi=100;function Xi(e,t){if(!e)throw new Error(t||"assertion failure")}function eo(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}var to=function(){function e(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++e.count}return e.prototype.peek=function(){if(1===this.value.length&&!io(this))return ro(this),this.value[0]},e.prototype.recompute=function(e){return Xi(!this.recomputing,"already recomputing"),ro(this),io(this)?function(e,t){return fo(e),Ki.withValue(e,no,[e,t]),function(e,t){if("function"==typeof e.subscribe)try{Wi(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(t){return e.setDirty(),!1}return!0}(e,t)&&function(e){e.dirty=!1,io(e)||so(e)}(e),eo(e.value)}(this,e):eo(this.value)},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,oo(this),Wi(this))},e.prototype.dispose=function(){var e=this;this.setDirty(),fo(this),ao(this,(function(t,r){t.setDirty(),ho(t,e)}))},e.prototype.forget=function(){this.dispose()},e.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=Ji.pop()||new Set),this.deps.add(e)},e.prototype.forgetDeps=function(){var e=this;this.deps&&(Gi(this.deps).forEach((function(t){return t.delete(e)})),this.deps.clear(),Ji.push(this.deps),this.deps=null)},e.count=0,e}();function ro(e){var t=Ki.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),io(e)?co(t,e):uo(t,e),t}function no(e,t){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,t)}catch(t){e.value[1]=t}e.recomputing=!1}function io(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function oo(e){ao(e,co)}function so(e){ao(e,uo)}function ao(e,t){var r=e.parents.size;if(r)for(var n=Gi(e.parents),i=0;i<r;++i)t(n[i],e)}function co(e,t){Xi(e.childValues.has(t)),Xi(io(t));var r=!io(e);if(e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=Ji.pop()||new Set;e.dirtyChildren.add(t),r&&oo(e)}function uo(e,t){Xi(e.childValues.has(t)),Xi(!io(t));var r,n,i,o=e.childValues.get(t);0===o.length?e.childValues.set(t,t.value.slice(0)):(r=o,n=t.value,(i=r.length)>0&&i===n.length&&r[i-1]===n[i-1]||e.setDirty()),lo(e,t),io(e)||so(e)}function lo(e,t){var r=e.dirtyChildren;r&&(r.delete(t),0===r.size&&(Ji.length<Zi&&Ji.push(r),e.dirtyChildren=null))}function fo(e){e.childValues.size>0&&e.childValues.forEach((function(t,r){ho(e,r)})),e.forgetDeps(),Xi(null===e.dirtyChildren)}function ho(e,t){t.parents.delete(e),e.childValues.delete(t),lo(e,t)}var po={setDirty:!0,dispose:!0,forget:!0};function mo(e){var t=new Map,r=e&&e.subscribe;function n(e){var n=Ki.getValue();if(n){var i=t.get(e);i||t.set(e,i=new Set),n.dependOn(i),"function"==typeof r&&(Wi(i),i.unsubscribe=r(e))}}return n.dirty=function(e,r){var n=t.get(e);if(n){var i=r&&Hi.call(po,r)?r:"setDirty";Gi(n).forEach((function(e){return e[i]()})),t.delete(e),Wi(n)}},n}function yo(){var e=new ri("function"==typeof WeakMap);return function(){return e.lookupArray(arguments)}}yo();var vo=new Set;function go(e,t){void 0===t&&(t=Object.create(null));var r=new Yi(t.max||Math.pow(2,16),(function(e){return e.dispose()})),n=t.keyArgs,i=t.makeCacheKey||yo(),o=function(){var o=i.apply(null,n?n.apply(null,arguments):arguments);if(void 0===o)return e.apply(null,arguments);var s=r.get(o);s||(r.set(o,s=new to(e)),s.subscribe=t.subscribe,s.forget=function(){return r.delete(o)});var a=s.recompute(Array.prototype.slice.call(arguments));return r.set(o,s),vo.add(r),Ki.hasValue()||(vo.forEach((function(e){return e.clean()})),vo.clear()),a};function s(e){var t=r.get(e);t&&t.setDirty()}function a(e){var t=r.get(e);if(t)return t.peek()}function c(e){return r.delete(e)}return Object.defineProperty(o,"size",{get:function(){return r.map.size},configurable:!1,enumerable:!1}),o.dirtyKey=s,o.dirty=function(){s(i.apply(null,arguments))},o.peekKey=a,o.peek=function(){return a(i.apply(null,arguments))},o.forgetKey=c,o.forget=function(){return c(i.apply(null,arguments))},o.makeCacheKey=i,o.getKey=n?function(){return i.apply(null,n.apply(null,arguments))}:i,Object.freeze(o)}var _o=new Qi,bo=new WeakMap;function wo(e){var t=bo.get(e);return t||bo.set(e,t={vars:new Set,dep:mo()}),t}function Eo(e){wo(e).vars.forEach((function(t){return t.forgetCache(e)}))}function So(e){var t=new Set,r=new Set,n=function(o){if(arguments.length>0){if(e!==o){e=o,t.forEach((function(e){wo(e).dep.dirty(n),function(e){e.broadcastWatches&&e.broadcastWatches()}(e)}));var s=Array.from(r);r.clear(),s.forEach((function(t){return t(e)}))}}else{var a=_o.getValue();a&&(i(a),wo(a).dep(n))}return e};n.onNextChange=function(e){return r.add(e),function(){r.delete(e)}};var i=n.attachCache=function(e){return t.add(e),wo(e).vars.add(n),n};return n.forgetCache=function(e){return t.delete(e)},n}var Oo=function(){function e(e){var t=e.cache,r=e.client,n=e.resolvers,i=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=t,r&&(this.client=r),n&&this.addResolvers(n),i&&this.setFragmentMatcher(i)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach((function(e){t.resolvers=Bn(t.resolvers,e)})):this.resolvers=Bn(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){var t=e.document,r=e.remoteResult,n=e.context,i=e.variables,o=e.onlyRunForcedResolvers,s=void 0!==o&&o;return he(this,void 0,void 0,(function(){return de(this,(function(e){return t?[2,this.resolveDocument(t,r.data,n,i,this.fragmentMatcher,s).then((function(e){return le(le({},r),{data:e.result})}))]:[2,r]}))}))},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return Yr(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return function(e){return wr(e),di([{test:function(e){return"client"===e.name.value},remove:!0}],e)}(e)},e.prototype.prepareContext=function(e){var t=this.cache;return le(le({},e),{cache:t,getCacheKey:function(e){return t.identify(e)}})},e.prototype.addExportedVariables=function(e,t,r){return void 0===t&&(t={}),void 0===r&&(r={}),he(this,void 0,void 0,(function(){return de(this,(function(n){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(r),t).then((function(e){return le(le({},t),e.exportedVariables)}))]:[2,le({},t)]}))}))},e.prototype.shouldForceResolvers=function(e){var t=!1;return Qr(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some((function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value}))))return Ur}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:yi(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t,r,n,i,o){return void 0===r&&(r={}),void 0===n&&(n={}),void 0===i&&(i=function(){return!0}),void 0===o&&(o=!1),he(this,void 0,void 0,(function(){var s,a,c,u,l,f,h,d,p,m;return de(this,(function(y){return s=Ir(e),a=Or(e),c=cr(a),u=this.collectSelectionsToResolve(s,c),l=s.operation,f=l?l.charAt(0).toUpperCase()+l.slice(1):"Query",d=(h=this).cache,p=h.client,m={fragmentMap:c,context:le(le({},r),{cache:d,client:p}),variables:n,fragmentMatcher:i,defaultOperationType:f,exportedVariables:{},selectionsToResolve:u,onlyRunForcedResolvers:o},[2,this.resolveSelectionSet(s.selectionSet,!1,t,m).then((function(e){return{result:e,exportedVariables:m.exportedVariables}}))]}))}))},e.prototype.resolveSelectionSet=function(e,t,r,n){return he(this,void 0,void 0,(function(){var i,o,s,a,c,u=this;return de(this,(function(l){return i=n.fragmentMap,o=n.context,s=n.variables,a=[r],c=function(e){return he(u,void 0,void 0,(function(){var c,u;return de(this,(function(l){return(t||n.selectionsToResolve.has(e))&&zr(e,s)?br(e)?[2,this.resolveField(e,t,r,n).then((function(t){var r;void 0!==t&&a.push(((r={})[gr(e)]=t,r))}))]:(function(e){return"InlineFragment"===e.kind}(e)?c=e:(c=i[e.name.value],__DEV__?wt(c,"No fragment named ".concat(e.name.value)):wt(c,11)),c&&c.typeCondition&&(u=c.typeCondition.name.value,n.fragmentMatcher(r,u,o))?[2,this.resolveSelectionSet(c.selectionSet,t,r,n).then((function(e){a.push(e)}))]:[2]):[2]}))}))},[2,Promise.all(e.selections.map(c)).then((function(){return zn(a)}))]}))}))},e.prototype.resolveField=function(e,t,r,n){return he(this,void 0,void 0,(function(){var i,o,s,a,c,u,l,f,h,d=this;return de(this,(function(p){return r?(i=n.variables,o=e.name.value,s=gr(e),a=o!==s,c=r[s]||r[o],u=Promise.resolve(c),n.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(l=r.__typename||n.defaultOperationType,(f=this.resolvers&&this.resolvers[l])&&(h=f[a?o:s])&&(u=Promise.resolve(_o.withValue(this.cache,h,[r,vr(e,i),n.context,{field:e,fragmentMap:n.fragmentMap}])))),[2,u.then((function(r){var i,o;if(void 0===r&&(r=c),e.directives&&e.directives.forEach((function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach((function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(n.exportedVariables[e.value.value]=r)}))})),!e.selectionSet)return r;if(null==r)return r;var s=null!==(o=null===(i=e.directives)||void 0===i?void 0:i.some((function(e){return"client"===e.name.value})))&&void 0!==o&&o;return Array.isArray(r)?d.resolveSubSelectedArray(e,t||s,r,n):e.selectionSet?d.resolveSelectionSet(e.selectionSet,t||s,r,n):void 0}))]):[2,null]}))}))},e.prototype.resolveSubSelectedArray=function(e,t,r,n){var i=this;return Promise.all(r.map((function(r){return null===r?null:Array.isArray(r)?i.resolveSubSelectedArray(e,t,r,n):e.selectionSet?i.resolveSelectionSet(e.selectionSet,t,r,n):void 0})))},e.prototype.collectSelectionsToResolve=function(e,t){var r=function(e){return!Array.isArray(e)},n=this.selectionsToResolveCache;return function e(i){if(!n.has(i)){var o=new Set;n.set(i,o),Qr(i,{Directive:function(e,t,n,i,s){"client"===e.name.value&&s.forEach((function(e){r(e)&&ji(e)&&o.add(e)}))},FragmentSpread:function(n,i,s,a,c){var u=t[n.name.value];__DEV__?wt(u,"No fragment named ".concat(n.name.value)):wt(u,12);var l=e(u);l.size>0&&(c.forEach((function(e){r(e)&&ji(e)&&o.add(e)})),o.add(n),l.forEach((function(e){o.add(e)})))}})}return n.get(i)}(e)},e}(),To=new(Gr?WeakMap:Map);function Io(e,t){var r=e[t];"function"==typeof r&&(e[t]=function(){return To.set(e,(To.get(e)+1)%1e15),r.apply(this,arguments)})}function ko(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var No=function(){function e(e,t){void 0===t&&(t=e.generateQueryId()),this.queryId=t,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var r=this.cache=e.cache;To.has(r)||(To.set(r,0),Io(r,"evict"),Io(r,"modify"),Io(r,"reset"))}return e.prototype.init=function(e){var t=e.networkStatus||Si.loading;return this.variables&&this.networkStatus!==Si.loading&&!Cn(this.variables,e.variables)&&(t=Si.setVariables),Cn(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},e.prototype.reset=function(){ko(this),this.dirty=!1},e.prototype.getDiff=function(e){void 0===e&&(e=this.variables);var t=this.getDiffOptions(e);if(this.lastDiff&&Cn(t,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=e);var r=this.observableQuery;if(r&&"no-cache"===r.options.fetchPolicy)return{complete:!1};var n=this.cache.diff(t);return this.updateLastDiff(n,t),n},e.prototype.updateLastDiff=function(e,t){this.lastDiff=e?{diff:e,options:t||this.getDiffOptions()}:void 0},e.prototype.getDiffOptions=function(e){var t;return void 0===e&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:null===(t=this.observableQuery)||void 0===t?void 0:t.options.canonizeResults}},e.prototype.setDiff=function(e){var t=this,r=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),this.dirty||Cn(r&&r.result,e&&e.result)||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout((function(){return t.notify()}),0)))},e.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){t.getDiff().fromOptimisticTransaction?e.observe():Pi(e)})):delete this.oqListener)},e.prototype.notify=function(){var e=this;ko(this),this.shouldNotify()&&this.listeners.forEach((function(t){return t(e)})),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(Ti(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if("cache-only"!==e&&"cache-and-network"!==e)return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=e.prototype.cancel,this.subscriptions.forEach((function(e){return e.unsubscribe()}));var t=this.observableQuery;t&&t.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(e){var t=this;void 0===e&&(e=this.variables);var r=this.observableQuery;if(!r||"no-cache"!==r.options.fetchPolicy){var n=le(le({},this.getDiffOptions(e)),{watcher:this,callback:function(e){return t.setDiff(e)}});this.lastWatch&&Cn(n,this.lastWatch)||(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=n))}},e.prototype.resetLastWrite=function(){this.lastWrite=void 0},e.prototype.shouldWrite=function(e,t){var r=this.lastWrite;return!(r&&r.dmCount===To.get(this.cache)&&Cn(t,r.variables)&&Cn(e.data,r.result.data))},e.prototype.markResult=function(e,t,r,n){var i=this,o=new Kn,s=Un(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Un(e.incremental)){var a=Gn(this.getDiff().result,e);e.data=a}else if("hasNext"in e&&e.hasNext){var c=this.getDiff();e.data=o.merge(c.result,e.data)}this.graphQLErrors=s,"no-cache"===r.fetchPolicy?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(r.variables)):0!==n&&(Do(e,r.errorPolicy)?this.cache.performTransaction((function(o){if(i.shouldWrite(e,r.variables))o.writeQuery({query:t,data:e.data,variables:r.variables,overwrite:1===n}),i.lastWrite={result:e,variables:r.variables,dmCount:To.get(i.cache)};else if(i.lastDiff&&i.lastDiff.diff.complete)return void(e.data=i.lastDiff.diff.result);var s=i.getDiffOptions(r.variables),a=o.diff(s);i.stopped||i.updateWatch(r.variables),i.updateLastDiff(a,s),a.complete&&(e.data=a.result)})):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=Si.ready},e.prototype.markError=function(e){return this.networkStatus=Si.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},e}();function Do(e,t){void 0===t&&(t="none");var r="ignore"===t||"all"===t,n=!ai(e);return!n&&r&&e.data&&(n=!0),n}var Ao=Object.prototype.hasOwnProperty,Ro=function(){function e(e){var t=e.cache,r=e.link,n=e.defaultOptions,i=e.queryDeduplication,o=void 0!==i&&i,s=e.onBroadcast,a=e.ssrMode,c=void 0!==a&&a,u=e.clientAwareness,l=void 0===u?{}:u,f=e.localState,h=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(Gr?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=t,this.link=r,this.defaultOptions=n||Object.create(null),this.queryDeduplication=o,this.clientAwareness=l,this.localState=f||new Oo({cache:t}),this.ssrMode=c,this.assumeImmutableResults=!!h,(this.onBroadcast=s)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var e=this;this.queries.forEach((function(t,r){e.stopQueryNoBroadcast(r)})),this.cancelPendingFetches(__DEV__?new bt("QueryManager stopped while query was in flight"):new bt(14))},e.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach((function(t){return t(e)})),this.fetchCancelFns.clear()},e.prototype.mutate=function(e){var t,r,n=e.mutation,i=e.variables,o=e.optimisticResponse,s=e.updateQueries,a=e.refetchQueries,c=void 0===a?[]:a,u=e.awaitRefetchQueries,l=void 0!==u&&u,f=e.update,h=e.onQueryUpdated,d=e.fetchPolicy,p=void 0===d?(null===(t=this.defaultOptions.mutate)||void 0===t?void 0:t.fetchPolicy)||"network-only":d,m=e.errorPolicy,y=void 0===m?(null===(r=this.defaultOptions.mutate)||void 0===r?void 0:r.errorPolicy)||"none":m,v=e.keepRootFields,g=e.context;return he(this,void 0,void 0,(function(){var e,t,r,a,u,d;return de(this,(function(m){switch(m.label){case 0:return __DEV__?wt(n,"mutation option is required. You must specify your GraphQL document in the mutation option."):wt(n,15),__DEV__?wt("network-only"===p||"no-cache"===p,"Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):wt("network-only"===p||"no-cache"===p,16),e=this.generateMutationId(),t=this.transform(n),r=t.document,a=t.hasClientExports,n=this.cache.transformForLink(r),i=this.getVariables(n,i),a?[4,this.localState.addExportedVariables(n,i,g)]:[3,2];case 1:i=m.sent(),m.label=2;case 2:return u=this.mutationStore&&(this.mutationStore[e]={mutation:n,variables:i,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:e,document:n,variables:i,fetchPolicy:p,errorPolicy:y,context:g,updateQueries:s,update:f,keepRootFields:v}),this.broadcastQueries(),d=this,[2,new Promise((function(t,r){return si(d.getObservableFromLink(n,le(le({},g),{optimisticResponse:o}),i,!1),(function(t){if(ai(t)&&"none"===y)throw new Oi({graphQLErrors:ci(t)});u&&(u.loading=!1,u.error=null);var r=le({},t);return"function"==typeof c&&(c=c(r)),"ignore"===y&&ai(r)&&delete r.errors,d.markMutationResult({mutationId:e,result:r,document:n,variables:i,fetchPolicy:p,errorPolicy:y,context:g,update:f,updateQueries:s,awaitRefetchQueries:l,refetchQueries:c,removeOptimistic:o?e:void 0,onQueryUpdated:h,keepRootFields:v})})).subscribe({next:function(e){d.broadcastQueries(),"hasNext"in e&&!1!==e.hasNext||t(e)},error:function(t){u&&(u.loading=!1,u.error=t),o&&d.cache.removeOptimistic(e),d.broadcastQueries(),r(t instanceof Oi?t:new Oi({networkError:t}))}})}))]}}))}))},e.prototype.markMutationResult=function(e,t){var r=this;void 0===t&&(t=this.cache);var n=e.result,i=[],o="no-cache"===e.fetchPolicy;if(!o&&Do(n,e.errorPolicy)){if(Hn(n)||i.push({result:n.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),Hn(n)&&Un(n.incremental)){var s=t.diff({id:"ROOT_MUTATION",query:this.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),a=void 0;s.result&&(a=Gn(s.result,n)),void 0!==a&&(n.data=a,i.push({result:a,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var c=e.updateQueries;c&&this.queries.forEach((function(e,o){var s=e.observableQuery,a=s&&s.queryName;if(a&&Ao.call(c,a)){var u=c[a],l=r.queries.get(o),f=l.document,h=l.variables,d=t.diff({query:f,variables:h,returnPartialData:!0,optimistic:!1}),p=d.result;if(d.complete&&p){var m=u(p,{mutationResult:n,queryName:f&&Sr(f)||void 0,queryVariables:h});m&&i.push({result:m,dataId:"ROOT_QUERY",query:f,variables:h})}}}))}if(i.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var u=[];if(this.refetchQueries({updateCache:function(t){o||i.forEach((function(e){return t.write(e)}));var s,a=e.update,c=!(Hn(s=n)||function(e){return"hasNext"in e&&"data"in e}(s))||Hn(n)&&!n.hasNext;if(a){if(!o){var u=t.diff({id:"ROOT_MUTATION",query:r.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});u.complete&&("incremental"in(n=le(le({},n),{data:u.result}))&&delete n.incremental,"hasNext"in n&&delete n.hasNext)}c&&a(t,n,{context:e.context,variables:e.variables})}o||e.keepRootFields||!c||t.modify({id:"ROOT_MUTATION",fields:function(e,t){var r=t.fieldName,n=t.DELETE;return"__typename"===r?e:n}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach((function(e){return u.push(e)})),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(u).then((function(){return n}))}return Promise.resolve(n)},e.prototype.markMutationOptimistic=function(e,t){var r=this,n="function"==typeof e?e(t.variables):e;return this.cache.recordOptimisticTransaction((function(e){try{r.markMutationResult(le(le({},t),{result:{data:n}}),e)}catch(e){__DEV__&&wt.error(e)}}),t.mutationId)},e.prototype.fetchQuery=function(e,t,r){return this.fetchQueryObservable(e,t,r).promise},e.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach((function(t,r){e[r]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}})),e},e.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},e.prototype.transform=function(e){var t=this.transformCache;if(!t.has(e)){var r=this.cache.transformDocument(e),n=di([mi],wr(r)),i=this.localState.clientQuery(r),o=n&&this.localState.serverQuery(n),s={document:r,hasClientExports:Kr(r),hasForcedResolvers:this.localState.shouldForceResolvers(r),clientQuery:i,serverQuery:o,defaultVars:kr(Er(r)),asQuery:le(le({},r),{definitions:r.definitions.map((function(e){return"OperationDefinition"===e.kind&&"query"!==e.operation?le(le({},e),{operation:"query"}):e}))})},a=function(e){e&&!t.has(e)&&t.set(e,s)};a(e),a(r),a(i),a(o)}return t.get(e)},e.prototype.getVariables=function(e,t){return le(le({},this.transform(e).defaultVars),t)},e.prototype.watchQuery=function(e){void 0===(e=le(le({},e),{variables:this.getVariables(e.query,e.variables)})).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var t=new No(this),r=new xi({queryManager:this,queryInfo:t,options:e});return this.queries.set(r.queryId,t),t.init({document:r.query,observableQuery:r,variables:r.variables}),r},e.prototype.query=function(e,t){var r=this;return void 0===t&&(t=this.generateQueryId()),__DEV__?wt(e.query,"query option is required. You must specify your GraphQL document in the query option."):wt(e.query,17),__DEV__?wt("Document"===e.query.kind,'You must wrap the query string in a "gql" tag.'):wt("Document"===e.query.kind,18),__DEV__?wt(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):wt(!e.returnPartialData,19),__DEV__?wt(!e.pollInterval,"pollInterval option only supported on watchQuery."):wt(!e.pollInterval,20),this.fetchQuery(t,e).finally((function(){return r.stopQuery(t)}))},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},e.prototype.clearStore=function(e){return void 0===e&&(e={discardWatches:!0}),this.cancelPendingFetches(__DEV__?new bt("Store reset while query was in flight (not completed in link chain)"):new bt(21)),this.queries.forEach((function(e){e.observableQuery?e.networkStatus=Si.loading:e.stop()})),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},e.prototype.getObservableQueries=function(e){var t=this;void 0===e&&(e="active");var r=new Map,n=new Map,i=new Set;return Array.isArray(e)&&e.forEach((function(e){var r;"string"==typeof e?n.set(e,!1):sr(r=e)&&"Document"===r.kind&&Array.isArray(r.definitions)?n.set(t.transform(e).document,!1):sr(e)&&e.query&&i.add(e)})),this.queries.forEach((function(t,i){var o=t.observableQuery,s=t.document;if(o){if("all"===e)return void r.set(i,o);var a=o.queryName;if("standby"===o.options.fetchPolicy||"active"===e&&!o.hasObservers())return;("active"===e||a&&n.has(a)||s&&n.has(s))&&(r.set(i,o),a&&n.set(a,!0),s&&n.set(s,!0))}})),i.size&&i.forEach((function(e){var n=gi("legacyOneTimeQuery"),i=t.getQuery(n).init({document:e.query,variables:e.variables}),o=new xi({queryManager:t,queryInfo:i,options:le(le({},e),{fetchPolicy:"network-only"})});wt(o.queryId===n),i.setObservableQuery(o),r.set(n,o)})),__DEV__&&n.size&&n.forEach((function(e,t){e||__DEV__&&wt.warn("Unknown query ".concat("string"==typeof t?"named ":"").concat(JSON.stringify(t,null,2)," requested in refetchQueries options.include array"))})),r},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var r=[];return this.getObservableQueries(e?"all":"active").forEach((function(n,i){var o=n.options.fetchPolicy;n.resetLastResults(),(e||"standby"!==o&&"cache-only"!==o)&&r.push(n.refetch()),t.getQuery(i).setDiff(null)})),this.broadcastQueries(),Promise.all(r)},e.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},e.prototype.startGraphQLSubscription=function(e){var t=this,r=e.query,n=e.fetchPolicy,i=e.errorPolicy,o=e.variables,s=e.context,a=void 0===s?{}:s;r=this.transform(r).document,o=this.getVariables(r,o);var c=function(e){return t.getObservableFromLink(r,a,e).map((function(o){if("no-cache"!==n&&(Do(o,i)&&t.cache.write({query:r,result:o.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries()),ai(o))throw new Oi({graphQLErrors:o.errors});return o}))};if(this.transform(r).hasClientExports){var u=this.localState.addExportedVariables(r,o,a).then(c);return new or((function(e){var t=null;return u.then((function(r){return t=r.subscribe(e)}),e.error),function(){return t&&t.unsubscribe()}}))}return c(o)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach((function(e){return e.notify()}))},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,r,n){var i,o,s=this;void 0===n&&(n=null!==(i=null==t?void 0:t.queryDeduplication)&&void 0!==i?i:this.queryDeduplication);var a=this.transform(e).serverQuery;if(a){var c=this.inFlightLinkObservables,u=this.link,l={query:a,variables:r,operationName:Sr(a)||void 0,context:this.prepareContext(le(le({},t),{forceFetch:!n}))};if(t=l.context,n){var f=c.get(a)||new Map;c.set(a,f);var h=ii(r);if(!(o=f.get(h))){var d=new Ei([Pr(u,l)]);f.set(h,o=d),d.beforeNext((function(){f.delete(h)&&f.size<1&&c.delete(a)}))}}else o=new Ei([Pr(u,l)])}else o=new Ei([or.of({data:{}})]),t=this.prepareContext(t);var p=this.transform(e).clientQuery;return p&&(o=si(o,(function(e){return s.localState.runResolvers({document:p,remoteResult:e,context:t,variables:r})}))),o},e.prototype.getResultsFromLink=function(e,t,r){var n=e.lastRequestId=this.generateRequestId(),i=this.cache.transformForLink(this.transform(e.document).document);return si(this.getObservableFromLink(i,r.context,r.variables),(function(o){var s=ci(o),a=s.length>0;if(n>=e.lastRequestId){if(a&&"none"===r.errorPolicy)throw e.markError(new Oi({graphQLErrors:s}));e.markResult(o,i,r,t),e.markReady()}var c={data:o.data,loading:!1,networkStatus:Si.ready};return a&&"ignore"!==r.errorPolicy&&(c.errors=s,c.networkStatus=Si.error),c}),(function(t){var r=t.hasOwnProperty("graphQLErrors")?t:new Oi({networkError:t});throw n>=e.lastRequestId&&e.markError(r),r}))},e.prototype.fetchQueryObservable=function(e,t,r){var n=this;void 0===r&&(r=Si.loading);var i=this.transform(t.query).document,o=this.getVariables(i,t.variables),s=this.getQuery(e),a=this.defaultOptions.watchQuery,c=t.fetchPolicy,u=void 0===c?a&&a.fetchPolicy||"cache-first":c,l=t.errorPolicy,f=void 0===l?a&&a.errorPolicy||"none":l,h=t.returnPartialData,d=void 0!==h&&h,p=t.notifyOnNetworkStatusChange,m=void 0!==p&&p,y=t.context,v=void 0===y?{}:y,g=Object.assign({},t,{query:i,variables:o,fetchPolicy:u,errorPolicy:f,returnPartialData:d,notifyOnNetworkStatusChange:m,context:v}),_=function(e){g.variables=e;var i=n.fetchQueryByPolicy(s,g,r);return"standby"!==g.fetchPolicy&&i.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",t),i},b=function(){return n.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,(function(e){b(),setTimeout((function(){return w.cancel(e)}))}));var w=new Ei(this.transform(g.query).hasClientExports?this.localState.addExportedVariables(g.query,g.variables,g.context).then(_):_(g.variables));return w.promise.then(b,b),w},e.prototype.refetchQueries=function(e){var t=this,r=e.updateCache,n=e.include,i=e.optimistic,o=void 0!==i&&i,s=e.removeOptimistic,a=void 0===s?o?gi("refetchQueries"):void 0:s,c=e.onQueryUpdated,u=new Map;n&&this.getObservableQueries(n).forEach((function(e,r){u.set(r,{oq:e,lastDiff:t.getQuery(r).getDiff()})}));var l=new Map;return r&&this.cache.batch({update:r,optimistic:o&&a||!1,removeOptimistic:a,onWatchUpdated:function(e,t,r){var n=e.watcher instanceof No&&e.watcher.observableQuery;if(n){if(c){u.delete(n.queryId);var i=c(n,t,r);return!0===i&&(i=n.refetch()),!1!==i&&l.set(n,i),i}null!==c&&u.set(n.queryId,{oq:n,lastDiff:r,diff:t})}}}),u.size&&u.forEach((function(e,r){var n,i=e.oq,o=e.lastDiff,s=e.diff;if(c){if(!s){var a=i.queryInfo;a.reset(),s=a.getDiff()}n=c(i,s,o)}c&&!0!==n||(n=i.refetch()),!1!==n&&l.set(i,n),r.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(r)})),a&&this.cache.removeOptimistic(a),l},e.prototype.fetchQueryByPolicy=function(e,t,r){var n=this,i=t.query,o=t.variables,s=t.fetchPolicy,a=t.refetchWritePolicy,c=t.errorPolicy,u=t.returnPartialData,l=t.context,f=t.notifyOnNetworkStatusChange,h=e.networkStatus;e.init({document:this.transform(i).document,variables:o,networkStatus:r});var d=function(){return e.getDiff(o)},p=function(t,r){void 0===r&&(r=e.networkStatus||Si.loading);var s=t.result;!__DEV__||u||Cn(s,{})||Ci(t.missing);var a=function(e){return or.of(le({data:e,loading:Ti(r),networkStatus:r},t.complete?null:{partial:!0}))};return s&&n.transform(i).hasForcedResolvers?n.localState.runResolvers({document:i,remoteResult:{data:s},context:l,variables:o,onlyRunForcedResolvers:!0}).then((function(e){return a(e.data||void 0)})):"none"===c&&r===Si.refetch&&Array.isArray(t.missing)?a(void 0):a(s)},m="no-cache"===s?0:r===Si.refetch&&"merge"!==a?1:2,y=function(){return n.getResultsFromLink(e,m,{variables:o,context:l,fetchPolicy:s,errorPolicy:c})},v=f&&"number"==typeof h&&h!==r&&Ti(r);switch(s){default:case"cache-first":return(g=d()).complete?[p(g,e.markReady())]:u||v?[p(g),y()]:[y()];case"cache-and-network":var g;return(g=d()).complete||u||v?[p(g),y()]:[y()];case"cache-only":return[p(d(),e.markReady())];case"network-only":return v?[p(d()),y()]:[y()];case"no-cache":return v?[p(e.getDiff()),y()]:[y()];case"standby":return[]}},e.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new No(this,e)),this.queries.get(e)},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return le(le({},t),{clientAwareness:this.clientAwareness})},e}();function xo(e,t){return Di(e,t,t.variables&&{variables:le(le({},e&&e.variables),t.variables)})}var Po=!1,$o=function(){function e(e){var t=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var r=e.uri,n=e.credentials,i=e.headers,o=e.cache,s=e.ssrMode,a=void 0!==s&&s,c=e.ssrForceFetchDelay,u=void 0===c?0:c,l=e.connectToDevTools,f=void 0===l?"object"==typeof window&&!window.__APOLLO_CLIENT__&&__DEV__:l,h=e.queryDeduplication,d=void 0===h||h,p=e.defaultOptions,m=e.assumeImmutableResults,y=void 0!==m&&m,v=e.resolvers,g=e.typeDefs,_=e.fragmentMatcher,b=e.name,w=e.version,E=e.link;if(E||(E=r?new Dn({uri:r,credentials:n,headers:i}):xr.empty()),!o)throw __DEV__?new bt("To initialize Apollo Client, you must specify a 'cache' property in the options object. \nFor more information, please visit: https://go.apollo.dev/c/docs"):new bt(9);if(this.link=E,this.cache=o,this.disableNetworkFetches=a||u>0,this.queryDeduplication=d,this.defaultOptions=p||Object.create(null),this.typeDefs=g,u&&setTimeout((function(){return t.disableNetworkFetches=!1}),u),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),f&&"object"==typeof window&&(window.__APOLLO_CLIENT__=this),!Po&&f&&__DEV__&&(Po=!0,"undefined"!=typeof window&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var S=window.navigator,O=S&&S.userAgent,T=void 0;"string"==typeof O&&(O.indexOf("Chrome/")>-1?T="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":O.indexOf("Firefox/")>-1&&(T="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),T&&__DEV__&&wt.log("Download the Apollo DevTools for a better development experience: "+T)}this.version="3.7.9",this.localState=new Oo({cache:o,client:this,resolvers:v,fragmentMatcher:_}),this.queryManager=new Ro({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:d,ssrMode:a,clientAwareness:{name:b,version:w},localState:this.localState,assumeImmutableResults:y,onBroadcast:f?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=xo(this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=le(le({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=xo(this.defaultOptions.query,e)),__DEV__?wt("cache-and-network"!==e.fetchPolicy,"The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):wt("cache-and-network"!==e.fetchPolicy,10),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=le(le({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=xo(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){this.cache.writeQuery(e),this.queryManager.broadcastQueries()},e.prototype.writeFragment=function(e){this.cache.writeFragment(e),this.queryManager.broadcastQueries()},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return Pr(this.link,e)},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!1})})).then((function(){return Promise.all(e.resetStoreCallbacks.map((function(e){return e()})))})).then((function(){return e.reFetchObservableQueries()}))},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!0})})).then((function(){return Promise.all(e.clearStoreCallbacks.map((function(e){return e()})))}))},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),r=[],n=[];t.forEach((function(e,t){r.push(t),n.push(e)}));var i=Promise.all(n);return i.queries=r,i.results=n,i.catch((function(e){__DEV__&&wt.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(e))})),i},e.prototype.getObservableQueries=function(e){return void 0===e&&(e="active"),this.queryManager.getObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e.prototype.setLink=function(e){this.link=this.queryManager.link=e},e}(),Co=function(){function e(){this.getFragmentDoc=go(ar)}return e.prototype.batch=function(e){var t,r=this,n="string"==typeof e.optimistic?e.optimistic:!1===e.optimistic?null:void 0;return this.performTransaction((function(){return t=e.update(r)}),n),t},e.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},e.prototype.transformDocument=function(e){return e},e.prototype.transformForLink=function(e){return e},e.prototype.identify=function(e){},e.prototype.gc=function(){return[]},e.prototype.modify=function(e){return!1},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read(le(le({},e),{rootId:e.id||"ROOT_QUERY",optimistic:t}))},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read(le(le({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:t}))},e.prototype.writeQuery=function(e){var t=e.id,r=e.data,n=fe(e,["id","data"]);return this.write(Object.assign(n,{dataId:t||"ROOT_QUERY",result:r}))},e.prototype.writeFragment=function(e){var t=e.id,r=e.data,n=e.fragment,i=e.fragmentName,o=fe(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(n,i),dataId:t,result:r}))},e.prototype.updateQuery=function(e,t){return this.batch({update:function(r){var n=r.readQuery(e),i=t(n);return null==i?n:(r.writeQuery(le(le({},e),{data:i})),i)}})},e.prototype.updateFragment=function(e,t){return this.batch({update:function(r){var n=r.readFragment(e),i=t(n);return null==i?n:(r.writeFragment(le(le({},e),{data:i})),i)}})},e}(),jo=function(e){function t(r,n,i,o){var s,a=e.call(this,r)||this;if(a.message=r,a.path=n,a.query=i,a.variables=o,Array.isArray(a.path)){a.missing=a.message;for(var c=a.path.length-1;c>=0;--c)a.missing=((s={})[a.path[c]]=a.missing,s)}else a.missing=a.path;return a.__proto__=t.prototype,a}return ue(t,e),t}(Error);function Mo(e){return __DEV__&&(t=e,(r=new Set([t])).forEach((function(e){sr(e)&&function(e){if(__DEV__&&!Object.isFrozen(e))try{Object.freeze(e)}catch(e){if(e instanceof TypeError)return null;throw e}return e}(e)===e&&Object.getOwnPropertyNames(e).forEach((function(t){sr(e[t])&&r.add(e[t])}))}))),e;var t,r}var Fo=Object.prototype.hasOwnProperty;function qo(e){return null==e}function Vo(e,t){var r=e.__typename,n=e.id,i=e._id;if("string"==typeof r&&(t&&(t.keyObject=qo(n)?qo(i)?void 0:{_id:i}:{id:n}),qo(n)&&!qo(i)&&(n=i),!qo(n)))return"".concat(r,":").concat("number"==typeof n||"string"==typeof n?n:JSON.stringify(n))}var Lo={dataIdFromObject:Vo,addTypename:!0,resultCaching:!0,canonizeResults:!1};function Uo(e){var t=e.canonizeResults;return void 0===t?Lo.canonizeResults:t}var Qo=/^[_a-z][_0-9a-z]*/i;function Bo(e){var t=e.match(Qo);return t?t[0]:e}function zo(e,t,r){return!!sr(t)&&(Ln(t)?t.every((function(t){return zo(e,t,r)})):e.selections.every((function(e){if(br(e)&&zr(e,r)){var n=gr(e);return Fo.call(t,n)&&(!e.selectionSet||zo(e.selectionSet,t[n],r))}return!0})))}function Yo(e){return sr(e)&&!fr(e)&&!Ln(e)}function Ko(e,t){var r=cr(Or(e));return{fragmentMap:r,lookupFragment:function(e){var n=r[e];return!n&&t&&(n=t.lookup(e)),n||null}}}var Ho=Object.create(null),Go=function(){return Ho},Wo=Object.create(null),Jo=function(){function e(e,t){var r=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(e,t){return Mo(fr(e)?r.get(e.__ref,t):e&&e[t])},this.canRead=function(e){return fr(e)?r.has(e.__ref):"object"==typeof e},this.toReference=function(e,t){if("string"==typeof e)return lr(e);if(fr(e))return e;var n=r.policies.identify(e)[0];if(n){var i=lr(n);return t&&r.merge(n,e),i}}}return e.prototype.toObject=function(){return le({},this.data)},e.prototype.has=function(e){return void 0!==this.lookup(e,!0)},e.prototype.get=function(e,t){if(this.group.depend(e,t),Fo.call(this.data,e)){var r=this.data[e];if(r&&Fo.call(r,t))return r[t]}return"__typename"===t&&Fo.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof ts?this.parent.get(e,t):void 0},e.prototype.lookup=function(e,t){return t&&this.group.depend(e,"__exists"),Fo.call(this.data,e)?this.data[e]:this instanceof ts?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?Object.create(null):void 0},e.prototype.merge=function(e,t){var r,n=this;fr(e)&&(e=e.__ref),fr(t)&&(t=t.__ref);var i="string"==typeof e?this.lookup(r=e):e,o="string"==typeof t?this.lookup(r=t):t;if(o){__DEV__?wt("string"==typeof r,"store.merge expects a string ID"):wt("string"==typeof r,1);var s=new Kn(ns).merge(i,o);if(this.data[r]=s,s!==i&&(delete this.refs[r],this.group.caching)){var a=Object.create(null);i||(a.__exists=1),Object.keys(o).forEach((function(e){if(!i||i[e]!==s[e]){a[e]=1;var t=Bo(e);t===e||n.policies.hasKeyArgs(s.__typename,t)||(a[t]=1),void 0!==s[e]||n instanceof ts||delete s[e]}})),!a.__typename||i&&i.__typename||this.policies.rootTypenamesById[r]!==s.__typename||delete a.__typename,Object.keys(a).forEach((function(e){return n.group.dirty(r,e)}))}}},e.prototype.modify=function(e,t){var r=this,n=this.lookup(e);if(n){var i=Object.create(null),o=!1,s=!0,a={DELETE:Ho,INVALIDATE:Wo,isReference:fr,toReference:this.toReference,canRead:this.canRead,readField:function(t,n){return r.policies.readField("string"==typeof t?{fieldName:t,from:n||lr(e)}:t,{store:r})}};if(Object.keys(n).forEach((function(c){var u=Bo(c),l=n[c];if(void 0!==l){var f="function"==typeof t?t:t[c]||t[u];if(f){var h=f===Go?Ho:f(Mo(l),le(le({},a),{fieldName:u,storeFieldName:c,storage:r.getStorage(e,c)}));h===Wo?r.group.dirty(e,c):(h===Ho&&(h=void 0),h!==l&&(i[c]=h,o=!0,l=h))}void 0!==l&&(s=!1)}})),o)return this.merge(e,i),s&&(this instanceof ts?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},e.prototype.delete=function(e,t,r){var n,i=this.lookup(e);if(i){var o=this.getFieldValue(i,"__typename"),s=t&&r?this.policies.getStoreFieldName({typename:o,fieldName:t,args:r}):t;return this.modify(e,s?((n={})[s]=Go,n):Go)}return!1},e.prototype.evict=function(e,t){var r=!1;return e.id&&(Fo.call(this.data,e.id)&&(r=this.delete(e.id,e.fieldName,e.args)),this instanceof ts&&this!==t&&(r=this.parent.evict(e,t)||r),(e.fieldName||r)&&this.group.dirty(e.id,e.fieldName||"__exists")),r},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var e=this,t=this.toObject(),r=[];return this.getRootIdSet().forEach((function(t){Fo.call(e.policies.rootTypenamesById,t)||r.push(t)})),r.length&&(t.__META={extraRootIds:r.sort()}),t},e.prototype.replace=function(e){var t=this;if(Object.keys(this.data).forEach((function(r){e&&Fo.call(e,r)||t.delete(r)})),e){var r=e.__META,n=fe(e,["__META"]);Object.keys(n).forEach((function(e){t.merge(e,n[e])})),r&&r.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},e.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},e.prototype.getRootIdSet=function(e){return void 0===e&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof ts?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},e.prototype.gc=function(){var e=this,t=this.getRootIdSet(),r=this.toObject();t.forEach((function(n){Fo.call(r,n)&&(Object.keys(e.findChildRefIds(n)).forEach(t.add,t),delete r[n])}));var n=Object.keys(r);if(n.length){for(var i=this;i instanceof ts;)i=i.parent;n.forEach((function(e){return i.delete(e)}))}return n},e.prototype.findChildRefIds=function(e){if(!Fo.call(this.refs,e)){var t=this.refs[e]=Object.create(null),r=this.data[e];if(!r)return t;var n=new Set([r]);n.forEach((function(e){fr(e)&&(t[e.__ref]=!0),sr(e)&&Object.keys(e).forEach((function(t){var r=e[t];sr(r)&&n.add(r)}))}))}return this.refs[e]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),Zo=function(){function e(e,t){void 0===t&&(t=null),this.caching=e,this.parent=t,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?mo():null,this.keyMaker=new ri(Gr)},e.prototype.depend=function(e,t){if(this.d){this.d(Xo(e,t));var r=Bo(t);r!==t&&this.d(Xo(e,r)),this.parent&&this.parent.depend(e,t)}},e.prototype.dirty=function(e,t){this.d&&this.d.dirty(Xo(e,t),"__exists"===t?"forget":"setDirty")},e}();function Xo(e,t){return t+"#"+e}function es(e,t){is(e)&&e.group.depend(t,"__exists")}!function(e){var t=function(e){function t(t){var r=t.policies,n=t.resultCaching,i=void 0===n||n,o=t.seed,s=e.call(this,r,new Zo(i))||this;return s.stump=new rs(s),s.storageTrie=new ri(Gr),o&&s.replace(o),s}return ue(t,e),t.prototype.addLayer=function(e,t){return this.stump.addLayer(e,t)},t.prototype.removeLayer=function(){return this},t.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},t}(e);e.Root=t}(Jo||(Jo={}));var ts=function(e){function t(t,r,n,i){var o=e.call(this,r.policies,i)||this;return o.id=t,o.parent=r,o.replay=n,o.group=i,n(o),o}return ue(t,e),t.prototype.addLayer=function(e,r){return new t(e,this,r,this.group)},t.prototype.removeLayer=function(e){var t=this,r=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach((function(e){var n=t.data[e],i=r.lookup(e);i?n?n!==i&&Object.keys(n).forEach((function(r){Cn(n[r],i[r])||t.group.dirty(e,r)})):(t.group.dirty(e,"__exists"),Object.keys(i).forEach((function(r){t.group.dirty(e,r)}))):t.delete(e)})),r):r===this.parent?this:r.addLayer(this.id,this.replay)},t.prototype.toObject=function(){return le(le({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(t){var r=this.parent.findChildRefIds(t);return Fo.call(this.data,t)?le(le({},r),e.prototype.findChildRefIds.call(this,t)):r},t.prototype.getStorage=function(){for(var e=this.parent;e.parent;)e=e.parent;return e.getStorage.apply(e,arguments)},t}(Jo),rs=function(e){function t(t){return e.call(this,"EntityStore.Stump",t,(function(){}),new Zo(t.group.caching,t.group))||this}return ue(t,e),t.prototype.removeLayer=function(){return this},t.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},t}(ts);function ns(e,t,r){var n=e[r],i=t[r];return Cn(n,i)?n:i}function is(e){return!!(e instanceof Jo&&e.group.caching)}function os(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var ss=function(){function e(e){var t=this;this.knownResults=new(Gr?WeakMap:Map),this.config=Di(e,{addTypename:!1!==e.addTypename,canonizeResults:Uo(e)}),this.canon=e.canon||new ni,this.executeSelectionSet=go((function(e){var r,n=e.context.canonizeResults,i=os(e);i[3]=!n;var o=(r=t.executeSelectionSet).peek.apply(r,i);return o?n?le(le({},o),{result:t.canon.admit(o.result)}):o:(es(e.context.store,e.enclosingRef.__ref),t.execSelectionSetImpl(e))}),{max:this.config.resultCacheMaxSize,keyArgs:os,makeCacheKey:function(e,t,r,n){if(is(r.store))return r.store.makeCacheKey(e,fr(t)?t.__ref:t,r.varString,n)}}),this.executeSubSelectedArray=go((function(e){return es(e.context.store,e.enclosingRef.__ref),t.execSubSelectedArrayImpl(e)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var t=e.field,r=e.array,n=e.context;if(is(n.store))return n.store.makeCacheKey(t,r,n.varString)}})}return e.prototype.resetCanon=function(){this.canon=new ni},e.prototype.diffQueryAgainstStore=function(e){var t=e.store,r=e.query,n=e.rootId,i=void 0===n?"ROOT_QUERY":n,o=e.variables,s=e.returnPartialData,a=void 0===s||s,c=e.canonizeResults,u=void 0===c?this.config.canonizeResults:c,l=this.config.cache.policies;o=le(le({},kr(Tr(r))),o);var f,h=lr(i),d=this.executeSelectionSet({selectionSet:Ir(r).selectionSet,objectOrReference:h,enclosingRef:h,context:le({store:t,query:r,policies:l,variables:o,varString:ii(o),canonizeResults:u},Ko(r,this.config.fragments))});if(d.missing&&(f=[new jo(as(d.missing),d.missing,r,o)],!a))throw f[0];return{result:d.result,complete:!f,missing:f}},e.prototype.isFresh=function(e,t,r,n){if(is(n.store)&&this.knownResults.get(e)===r){var i=this.executeSelectionSet.peek(r,t,n,this.canon.isKnown(e));if(i&&e===i.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(e){var t=this,r=e.selectionSet,n=e.objectOrReference,i=e.enclosingRef,o=e.context;if(fr(n)&&!o.policies.rootTypenamesById[n.__ref]&&!o.store.has(n.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(n.__ref," object")};var s,a=o.variables,c=o.policies,u=o.store.getFieldValue(n,"__typename"),l=[],f=new Kn;function h(e,t){var r;return e.missing&&(s=f.merge(s,((r={})[t]=e.missing,r))),e.result}this.config.addTypename&&"string"==typeof u&&!c.rootIdsByTypename[u]&&l.push({__typename:u});var d=new Set(r.selections);d.forEach((function(e){var r,p;if(zr(e,a))if(br(e)){var m=c.readField({fieldName:e.name.value,field:e,variables:o.variables,from:n},o),y=gr(e);void 0===m?pi.added(e)||(s=f.merge(s,((r={})[y]="Can't find field '".concat(e.name.value,"' on ").concat(fr(n)?n.__ref+" object":"object "+JSON.stringify(n,null,2)),r))):Ln(m)?m=h(t.executeSubSelectedArray({field:e,array:m,enclosingRef:i,context:o}),y):e.selectionSet?null!=m&&(m=h(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:m,enclosingRef:fr(m)?m:i,context:o}),y)):o.canonizeResults&&(m=t.canon.pass(m)),void 0!==m&&l.push(((p={})[y]=m,p))}else{var v=ur(e,o.lookupFragment);if(!v&&e.kind===Vr.FRAGMENT_SPREAD)throw __DEV__?new bt("No fragment named ".concat(e.name.value)):new bt(5);v&&c.fragmentMatches(v,u)&&v.selectionSet.selections.forEach(d.add,d)}}));var p={result:zn(l),missing:s},m=o.canonizeResults?this.canon.admit(p):Mo(p);return m.result&&this.knownResults.set(m.result,r),m},e.prototype.execSubSelectedArrayImpl=function(e){var t,r=this,n=e.field,i=e.array,o=e.enclosingRef,s=e.context,a=new Kn;function c(e,r){var n;return e.missing&&(t=a.merge(t,((n={})[r]=e.missing,n))),e.result}return n.selectionSet&&(i=i.filter(s.store.canRead)),i=i.map((function(e,t){return null===e?null:Ln(e)?c(r.executeSubSelectedArray({field:n,array:e,enclosingRef:o,context:s}),t):n.selectionSet?c(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:e,enclosingRef:fr(e)?e:o,context:s}),t):(__DEV__&&function(e,t,r){if(!t.selectionSet){var n=new Set([r]);n.forEach((function(r){sr(r)&&(__DEV__?wt(!fr(r),"Missing selection set for object of type ".concat(function(e,t){return fr(t)?e.get(t.__ref,"__typename"):t&&t.__typename}(e,r)," returned for query field ").concat(t.name.value)):wt(!fr(r),6),Object.values(r).forEach(n.add,n))}))}}(s.store,n,e),e)})),{result:s.canonizeResults?this.canon.admit(i):i,missing:t}},e}();function as(e){try{JSON.stringify(e,(function(e,t){if("string"==typeof t)throw t;return t}))}catch(e){return e}}var cs=Object.create(null);function us(e){var t=JSON.stringify(e);return cs[t]||(cs[t]=Object.create(null))}function ls(e){var t=us(e);return t.keyFieldsFn||(t.keyFieldsFn=function(t,r){var n=function(e,t){return r.readField(t,e)},i=r.keyObject=hs(e,(function(e){var i=ms(r.storeObject,e,n);return void 0===i&&t!==r.storeObject&&Fo.call(t,e[0])&&(i=ms(t,e,ps)),__DEV__?wt(void 0!==i,"Missing field '".concat(e.join("."),"' while extracting keyFields from ").concat(JSON.stringify(t))):wt(void 0!==i,2),i}));return"".concat(r.typename,":").concat(JSON.stringify(i))})}function fs(e){var t=us(e);return t.keyArgsFn||(t.keyArgsFn=function(t,r){var n=r.field,i=r.variables,o=r.fieldName,s=hs(e,(function(e){var r=e[0],o=r.charAt(0);if("@"!==o)if("$"!==o){if(t)return ms(t,e)}else{var s=r.slice(1);if(i&&Fo.call(i,s)){var a=e.slice(0);return a[0]=s,ms(i,a)}}else if(n&&Un(n.directives)){var c=r.slice(1),u=n.directives.find((function(e){return e.name.value===c})),l=u&&vr(u,i);return l&&ms(l,e.slice(1))}})),a=JSON.stringify(s);return(t||"{}"!==a)&&(o+=":"+a),o})}function hs(e,t){var r=new Kn;return ds(e).reduce((function(e,n){var i,o=t(n);if(void 0!==o){for(var s=n.length-1;s>=0;--s)(i={})[n[s]]=o,o=i;e=r.merge(e,o)}return e}),Object.create(null))}function ds(e){var t=us(e);if(!t.paths){var r=t.paths=[],n=[];e.forEach((function(t,i){Ln(t)?(ds(t).forEach((function(e){return r.push(n.concat(e))})),n.length=0):(n.push(t),Ln(e[i+1])||(r.push(n.slice(0)),n.length=0))}))}return t.paths}function ps(e,t){return e[t]}function ms(e,t,r){return r=r||ps,ys(t.reduce((function e(t,n){return Ln(t)?t.map((function(t){return e(t,n)})):t&&r(t,n)}),e))}function ys(e){return sr(e)?Ln(e)?e.map(ys):hs(Object.keys(e).sort(),(function(t){return ms(e,t)})):e}function vs(e){return void 0!==e.args?e.args:e.field?vr(e.field,e.variables):null}pr.setStringify(ii);var gs=function(){},_s=function(e,t){return t.fieldName},bs=function(e,t,r){return(0,r.mergeObjects)(e,t)},ws=function(e,t){return t},Es=function(){function e(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=le({dataIdFromObject:Vo},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return e.prototype.identify=function(e,t){var r,n=this,i=t&&(t.typename||(null===(r=t.storeObject)||void 0===r?void 0:r.__typename))||e.__typename;if(i===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o,s=t&&t.storeObject||e,a=le(le({},t),{typename:i,storeObject:s,readField:t&&t.readField||function(){var e=Os(arguments,s);return n.readField(e,{store:n.cache.data,variables:e.variables})}}),c=i&&this.getTypePolicy(i),u=c&&c.keyFn||this.config.dataIdFromObject;u;){var l=u(e,a);if(!Ln(l)){o=l;break}u=ls(l)}return o=o?String(o):void 0,a.keyObject?[o,a.keyObject]:[o]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach((function(r){var n=e[r],i=n.queryType,o=n.mutationType,s=n.subscriptionType,a=fe(n,["queryType","mutationType","subscriptionType"]);i&&t.setRootTypename("Query",r),o&&t.setRootTypename("Mutation",r),s&&t.setRootTypename("Subscription",r),Fo.call(t.toBeAdded,r)?t.toBeAdded[r].push(a):t.toBeAdded[r]=[a]}))},e.prototype.updateTypePolicy=function(e,t){var r=this,n=this.getTypePolicy(e),i=t.keyFields,o=t.fields;function s(e,t){e.merge="function"==typeof t?t:!0===t?bs:!1===t?ws:e.merge}s(n,t.merge),n.keyFn=!1===i?gs:Ln(i)?ls(i):"function"==typeof i?i:n.keyFn,o&&Object.keys(o).forEach((function(t){var n=r.getFieldPolicy(e,t,!0),i=o[t];if("function"==typeof i)n.read=i;else{var a=i.keyArgs,c=i.read,u=i.merge;n.keyFn=!1===a?_s:Ln(a)?fs(a):"function"==typeof a?a:n.keyFn,"function"==typeof c&&(n.read=c),s(n,u)}n.read&&n.merge&&(n.keyFn=n.keyFn||_s)}))},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var r="ROOT_"+e.toUpperCase(),n=this.rootTypenamesById[r];t!==n&&(__DEV__?wt(!n||n===e,"Cannot change root ".concat(e," __typename more than once")):wt(!n||n===e,3),n&&delete this.rootIdsByTypename[n],this.rootIdsByTypename[t]=r,this.rootTypenamesById[r]=t)},e.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach((function(r){t.getSupertypeSet(r,!0),e[r].forEach((function(e){t.getSupertypeSet(e,!0).add(r);var n=e.match(Qo);n&&n[0]===e||t.fuzzySubtypes.set(e,new RegExp(e))}))}))},e.prototype.getTypePolicy=function(e){var t=this;if(!Fo.call(this.typePolicies,e)){var r=this.typePolicies[e]=Object.create(null);r.fields=Object.create(null);var n=this.supertypeMap.get(e);n&&n.size&&n.forEach((function(e){var n=t.getTypePolicy(e),i=n.fields,o=fe(n,["fields"]);Object.assign(r,o),Object.assign(r.fields,i)}))}var i=this.toBeAdded[e];return i&&i.length&&i.splice(0).forEach((function(r){t.updateTypePolicy(e,r)})),this.typePolicies[e]},e.prototype.getFieldPolicy=function(e,t,r){if(e){var n=this.getTypePolicy(e).fields;return n[t]||r&&(n[t]=Object.create(null))}},e.prototype.getSupertypeSet=function(e,t){var r=this.supertypeMap.get(e);return!r&&t&&this.supertypeMap.set(e,r=new Set),r},e.prototype.fragmentMatches=function(e,t,r,n){var i=this;if(!e.typeCondition)return!0;if(!t)return!1;var o=e.typeCondition.name.value;if(t===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(t,!0),a=[s],c=function(e){var t=i.getSupertypeSet(e,!1);t&&t.size&&a.indexOf(t)<0&&a.push(t)},u=!(!r||!this.fuzzySubtypes.size),l=!1,f=0;f<a.length;++f){var h=a[f];if(h.has(o))return s.has(o)||(l&&__DEV__&&wt.warn("Inferring subtype ".concat(t," of supertype ").concat(o)),s.add(o)),!0;h.forEach(c),u&&f===a.length-1&&zo(e.selectionSet,r,n)&&(u=!1,l=!0,this.fuzzySubtypes.forEach((function(e,r){var n=t.match(e);n&&n[0]===t&&c(r)})))}return!1},e.prototype.hasKeyArgs=function(e,t){var r=this.getFieldPolicy(e,t,!1);return!(!r||!r.keyFn)},e.prototype.getStoreFieldName=function(e){var t,r=e.typename,n=e.fieldName,i=this.getFieldPolicy(r,n,!1),o=i&&i.keyFn;if(o&&r)for(var s={typename:r,fieldName:n,field:e.field||null,variables:e.variables},a=vs(e);o;){var c=o(a,s);if(!Ln(c)){t=c||n;break}o=fs(c)}return void 0===t&&(t=e.field?function(e,t){var r=null;e.directives&&(r={},e.directives.forEach((function(e){r[e.name.value]={},e.arguments&&e.arguments.forEach((function(n){var i=n.name,o=n.value;return hr(r[e.name.value],i,o,t)}))})));var n=null;return e.arguments&&e.arguments.length&&(n={},e.arguments.forEach((function(e){var r=e.name,i=e.value;return hr(n,r,i,t)}))),pr(e.name.value,n,r)}(e.field,e.variables):pr(n,vs(e))),!1===t?n:n===Bo(t)?t:n+":"+t},e.prototype.readField=function(e,t){var r=e.from;if(r&&(e.field||e.fieldName)){if(void 0===e.typename){var n=t.store.getFieldValue(r,"__typename");n&&(e.typename=n)}var i=this.getStoreFieldName(e),o=Bo(i),s=t.store.getFieldValue(r,i),a=this.getFieldPolicy(e.typename,o,!1),c=a&&a.read;if(c){var u=Ss(this,r,e,t,t.store.getStorage(fr(r)?r.__ref:r,i));return _o.withValue(this.cache,c,[s,u])}return s}},e.prototype.getReadFunction=function(e,t){var r=this.getFieldPolicy(e,t,!1);return r&&r.read},e.prototype.getMergeFunction=function(e,t,r){var n=this.getFieldPolicy(e,t,!1),i=n&&n.merge;return!i&&r&&(i=(n=this.getTypePolicy(r))&&n.merge),i},e.prototype.runMergeFunction=function(e,t,r,n,i){var o=r.field,s=r.typename,a=r.merge;return a===bs?Ts(n.store)(e,t):a===ws?t:(n.overwrite&&(e=void 0),a(e,t,Ss(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:n.variables},n,i||Object.create(null))))},e}();function Ss(e,t,r,n,i){var o=e.getStoreFieldName(r),s=Bo(o),a=r.variables||n.variables,c=n.store,u=c.toReference,l=c.canRead;return{args:vs(r),field:r.field||null,fieldName:s,storeFieldName:o,variables:a,isReference:fr,toReference:u,storage:i,cache:e.cache,canRead:l,readField:function(){return e.readField(Os(arguments,t,a),n)},mergeObjects:Ts(n.store)}}function Os(e,t,r){var n,i,o,s=e[0],a=e[1],c=e.length;return"string"==typeof s?n={fieldName:s,from:c>1?a:t}:(n=le({},s),Fo.call(n,"from")||(n.from=t)),__DEV__&&void 0===n.from&&__DEV__&&wt.warn("Undefined 'from' passed to readField with arguments ".concat((i=Array.from(e),o=gi("stringifyForDisplay"),JSON.stringify(i,(function(e,t){return void 0===t?o:t})).split(JSON.stringify(o)).join("<undefined>")))),void 0===n.variables&&(n.variables=r),n}function Ts(e){return function(t,r){if(Ln(t)||Ln(r))throw __DEV__?new bt("Cannot automatically merge arrays"):new bt(4);if(sr(t)&&sr(r)){var n=e.getFieldValue(t,"__typename"),i=e.getFieldValue(r,"__typename");if(n&&i&&n!==i)return r;if(fr(t)&&Yo(r))return e.merge(t.__ref,r),t;if(Yo(t)&&fr(r))return e.merge(t,r.__ref),r;if(Yo(t)&&Yo(r))return le(le({},t),r)}return r}}function Is(e,t,r){var n="".concat(t).concat(r),i=e.flavors.get(n);return i||e.flavors.set(n,i=e.clientOnly===t&&e.deferred===r?e:le(le({},e),{clientOnly:t,deferred:r})),i}var ks=function(){function e(e,t,r){this.cache=e,this.reader=t,this.fragments=r}return e.prototype.writeToStore=function(e,t){var r=this,n=t.query,i=t.result,o=t.dataId,s=t.variables,a=t.overwrite,c=Er(n),u=new Kn;s=le(le({},kr(c)),s);var l=le(le({store:e,written:Object.create(null),merge:function(e,t){return u.merge(e,t)},variables:s,varString:ii(s)},Ko(n,this.fragments)),{overwrite:!!a,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),f=this.processSelectionSet({result:i||Object.create(null),dataId:o,selectionSet:c.selectionSet,mergeTree:{map:new Map},context:l});if(!fr(f))throw __DEV__?new bt("Could not identify object ".concat(JSON.stringify(i))):new bt(7);return l.incomingById.forEach((function(t,n){var i=t.storeObject,o=t.mergeTree,s=t.fieldNodeSet,a=lr(n);if(o&&o.map.size){var c=r.applyMerges(o,a,i,l);if(fr(c))return;i=c}if(__DEV__&&!l.overwrite){var u=Object.create(null);s.forEach((function(e){e.selectionSet&&(u[e.name.value]=!0)})),Object.keys(i).forEach((function(e){(function(e){return!0===u[Bo(e)]})(e)&&!function(e){var t=o&&o.map.get(e);return Boolean(t&&t.info&&t.info.merge)}(e)&&function(e,t,r,n){var i=function(e){var t=n.getFieldValue(e,r);return"object"==typeof t&&t},o=i(e);if(o){var s=i(t);if(s&&!fr(o)&&!Cn(o,s)&&!Object.keys(o).every((function(e){return void 0!==n.getFieldValue(s,e)}))){var a=n.getFieldValue(e,"__typename")||n.getFieldValue(t,"__typename"),c=Bo(r),u="".concat(a,".").concat(c);if(!Ps.has(u)){Ps.add(u);var l=[];Ln(o)||Ln(s)||[o,s].forEach((function(e){var t=n.getFieldValue(e,"__typename");"string"!=typeof t||l.includes(t)||l.push(t)})),__DEV__&&wt.warn("Cache data may be lost when replacing the ".concat(c," field of a ").concat(a," object.\n\nTo address this problem (which is not a bug in Apollo Client), ").concat(l.length?"either ensure all objects of type "+l.join(" and ")+" have an ID or a custom merge function, or ":"","define a custom merge function for the ").concat(u," field, so InMemoryCache can safely merge these objects:\n\n existing: ").concat(JSON.stringify(o).slice(0,1e3),"\n incoming: ").concat(JSON.stringify(s).slice(0,1e3),"\n\nFor more information about these options, please refer to the documentation:\n\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n"))}}}}(a,i,e,l.store)}))}e.merge(n,i)})),e.retain(f.__ref),f},e.prototype.processSelectionSet=function(e){var t=this,r=e.dataId,n=e.result,i=e.selectionSet,o=e.context,s=e.mergeTree,a=this.cache.policies,c=Object.create(null),u=r&&a.rootTypenamesById[r]||_r(n,i,o.fragmentMap)||r&&o.store.get(r,"__typename");"string"==typeof u&&(c.__typename=u);var l=function(){var e=Os(arguments,c,o.variables);if(fr(e.from)){var t=o.incomingById.get(e.from.__ref);if(t){var r=a.readField(le(le({},e),{from:t.storeObject}),o);if(void 0!==r)return r}}return a.readField(e,o)},f=new Set;this.flattenFields(i,n,o,u).forEach((function(e,r){var i,o=gr(r),h=n[o];if(f.add(r),void 0!==h){var d=a.getStoreFieldName({typename:u,fieldName:r.name.value,field:r,variables:e.variables}),p=Ds(s,d),m=t.processFieldValue(h,r,r.selectionSet?Is(e,!1,!1):e,p),y=void 0;r.selectionSet&&(fr(m)||Yo(m))&&(y=l("__typename",m));var v=a.getMergeFunction(u,r.name.value,y);v?p.info={field:r,typename:u,merge:v}:xs(s,d),c=e.merge(c,((i={})[d]=m,i))}else!__DEV__||e.clientOnly||e.deferred||pi.added(r)||a.getReadFunction(u,r.name.value)||__DEV__&&wt.error("Missing field '".concat(gr(r),"' while writing result ").concat(JSON.stringify(n,null,2)).substring(0,1e3))}));try{var h=a.identify(n,{typename:u,selectionSet:i,fragmentMap:o.fragmentMap,storeObject:c,readField:l}),d=h[0],p=h[1];r=r||d,p&&(c=o.merge(c,p))}catch(e){if(!r)throw e}if("string"==typeof r){var m=lr(r),y=o.written[r]||(o.written[r]=[]);if(y.indexOf(i)>=0)return m;if(y.push(i),this.reader&&this.reader.isFresh(n,m,i,o))return m;var v=o.incomingById.get(r);return v?(v.storeObject=o.merge(v.storeObject,c),v.mergeTree=As(v.mergeTree,s),f.forEach((function(e){return v.fieldNodeSet.add(e)}))):o.incomingById.set(r,{storeObject:c,mergeTree:Rs(s)?void 0:s,fieldNodeSet:f}),m}return c},e.prototype.processFieldValue=function(e,t,r,n){var i=this;return t.selectionSet&&null!==e?Ln(e)?e.map((function(e,o){var s=i.processFieldValue(e,t,r,Ds(n,o));return xs(n,o),s})):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:r,mergeTree:n}):__DEV__?ki(e):e},e.prototype.flattenFields=function(e,t,r,n){void 0===n&&(n=_r(t,e,r.fragmentMap));var i=new Map,o=this.cache.policies,s=new ri(!1);return function e(a,c){var u=s.lookup(a,c.clientOnly,c.deferred);u.visited||(u.visited=!0,a.selections.forEach((function(s){if(zr(s,r.variables)){var a=c.clientOnly,u=c.deferred;if(a&&u||!Un(s.directives)||s.directives.forEach((function(e){var t=e.name.value;if("client"===t&&(a=!0),"defer"===t){var n=vr(e,r.variables);n&&!1===n.if||(u=!0)}})),br(s)){var l=i.get(s);l&&(a=a&&l.clientOnly,u=u&&l.deferred),i.set(s,Is(r,a,u))}else{var f=ur(s,r.lookupFragment);if(!f&&s.kind===Vr.FRAGMENT_SPREAD)throw __DEV__?new bt("No fragment named ".concat(s.name.value)):new bt(8);f&&o.fragmentMatches(f,n,t,r.variables)&&e(f.selectionSet,Is(r,a,u))}}})))}(e,r),i},e.prototype.applyMerges=function(e,t,r,n,i){var o,s=this;if(e.map.size&&!fr(r)){var a,c=Ln(r)||!fr(t)&&!Yo(t)?void 0:t,u=r;c&&!i&&(i=[fr(c)?c.__ref:c]);var l=function(e,t){return Ln(e)?"number"==typeof t?e[t]:void 0:n.store.getFieldValue(e,String(t))};e.map.forEach((function(e,t){var r=l(c,t),o=l(u,t);if(void 0!==o){i&&i.push(t);var f=s.applyMerges(e,r,o,n,i);f!==o&&(a=a||new Map).set(t,f),i&&wt(i.pop()===t)}})),a&&(r=Ln(u)?u.slice(0):le({},u),a.forEach((function(e,t){r[t]=e})))}return e.info?this.cache.policies.runMergeFunction(t,r,e.info,n,i&&(o=n.store).getStorage.apply(o,i)):r},e}(),Ns=[];function Ds(e,t){var r=e.map;return r.has(t)||r.set(t,Ns.pop()||{map:new Map}),r.get(t)}function As(e,t){if(e===t||!t||Rs(t))return e;if(!e||Rs(e))return t;var r=e.info&&t.info?le(le({},e.info),t.info):e.info||t.info,n=e.map.size&&t.map.size,i={info:r,map:n?new Map:e.map.size?e.map:t.map};if(n){var o=new Set(t.map.keys());e.map.forEach((function(e,r){i.map.set(r,As(e,t.map.get(r))),o.delete(r)})),o.forEach((function(r){i.map.set(r,As(t.map.get(r),e.map.get(r)))}))}return i}function Rs(e){return!e||!(e.info||e.map.size)}function xs(e,t){var r=e.map,n=r.get(t);n&&Rs(n)&&(Ns.push(n),r.delete(t))}var Ps=new Set,$s=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;return r.watches=new Set,r.typenameDocumentCache=new Map,r.makeVar=So,r.txCount=0,r.config=function(e){return Di(Lo,e)}(t),r.addTypename=!!r.config.addTypename,r.policies=new Es({cache:r,dataIdFromObject:r.config.dataIdFromObject,possibleTypes:r.config.possibleTypes,typePolicies:r.config.typePolicies}),r.init(),r}return ue(t,e),t.prototype.init=function(){var e=this.data=new Jo.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()},t.prototype.resetResultCache=function(e){var t=this,r=this.storeReader,n=this.config.fragments;this.storeWriter=new ks(this,this.storeReader=new ss({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:Uo(this.config),canon:e?void 0:r&&r.canon,fragments:n}),n),this.maybeBroadcastWatch=go((function(e,r){return t.broadcastWatch(e,r)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var r=e.optimistic?t.optimisticData:t.data;if(is(r)){var n=e.optimistic,i=e.id,o=e.variables;return r.makeCacheKey(e.query,e.callback,ii({optimistic:n,id:i,variables:o}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach((function(e){return e.resetCaching()}))},t.prototype.restore=function(e){return this.init(),e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).extract()},t.prototype.read=function(e){var t=e.returnPartialData,r=void 0!==t&&t;try{return this.storeReader.diffQueryAgainstStore(le(le({},e),{store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:r})).result||null}catch(e){if(e instanceof jo)return null;throw e}},t.prototype.write=function(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.modify=function(e){if(Fo.call(e,"id")&&!e.id)return!1;var t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.diff=function(e){return this.storeReader.diffQueryAgainstStore(le(le({},e),{store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(e){var t,r=this;return this.watches.size||wo(t=this).vars.forEach((function(e){return e.attachCache(t)})),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){r.watches.delete(e)&&!r.watches.size&&Eo(r),r.maybeBroadcastWatch.forget(e)}},t.prototype.gc=function(e){ii.reset();var t=this.optimisticData.gc();return e&&!this.txCount&&(e.resetResultCache?this.resetResultCache(e.resetResultIdentities):e.resetResultIdentities&&this.storeReader.resetCanon()),t},t.prototype.retain=function(e,t){return(t?this.optimisticData:this.data).retain(e)},t.prototype.release=function(e,t){return(t?this.optimisticData:this.data).release(e)},t.prototype.identify=function(e){if(fr(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(e){__DEV__&&wt.warn(e)}},t.prototype.evict=function(e){if(!e.id){if(Fo.call(e,"id"))return!1;e=le(le({},e),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(e,this.data)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.reset=function(e){var t=this;return this.init(),ii.reset(),e&&e.discardWatches?(this.watches.forEach((function(e){return t.maybeBroadcastWatch.forget(e)})),this.watches.clear(),Eo(this)):this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){var t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())},t.prototype.batch=function(e){var t,r=this,n=e.update,i=e.optimistic,o=void 0===i||i,s=e.removeOptimistic,a=e.onWatchUpdated,c=function(e){var i=r,o=i.data,s=i.optimisticData;++r.txCount,e&&(r.data=r.optimisticData=e);try{return t=n(r)}finally{--r.txCount,r.data=o,r.optimisticData=s}},u=new Set;return a&&!this.txCount&&this.broadcastWatches(le(le({},e),{onWatchUpdated:function(e){return u.add(e),!1}})),"string"==typeof o?this.optimisticData=this.optimisticData.addLayer(o,c):!1===o?c(this.data):c(),"string"==typeof s&&(this.optimisticData=this.optimisticData.removeLayer(s)),a&&u.size?(this.broadcastWatches(le(le({},e),{onWatchUpdated:function(e,t){var r=a.call(this,e,t);return!1!==r&&u.delete(e),r}})),u.size&&u.forEach((function(e){return r.maybeBroadcastWatch.dirty(e)}))):this.broadcastWatches(e),t},t.prototype.performTransaction=function(e,t){return this.batch({update:e,optimistic:t||null!==t})},t.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(t=pi(e),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}return e},t.prototype.transformForLink=function(e){var t=this.config.fragments;return t?t.transform(e):e},t.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach((function(r){return t.maybeBroadcastWatch(r,e)}))},t.prototype.broadcastWatch=function(e,t){var r=e.lastDiff,n=this.diff(e);t&&(e.optimistic&&"string"==typeof t.optimistic&&(n.fromOptimisticTransaction=!0),t.onWatchUpdated&&!1===t.onWatchUpdated.call(this,e,n,r))||r&&Cn(r.result,n.result)||e.callback(e.lastDiff=n,r)},t}(Co);function Cs(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}const js=/\r\n|[\n\r]/g;function Ms(e,t){let r=0,n=1;for(const i of e.body.matchAll(js)){if("number"==typeof i.index||Cs(!1),i.index>=t)break;r=i.index+i[0].length,n+=1}return{line:n,column:t+1-r}}function Fs(e,t){const r=e.locationOffset.column-1,n="".padStart(r)+e.body,i=t.line-1,o=e.locationOffset.line-1,s=t.line+o,a=1===t.line?r:0,c=t.column+a,u=`${e.name}:${s}:${c}\n`,l=n.split(/\r\n|[\n\r]/g),f=l[i];if(f.length>120){const e=Math.floor(c/80),t=c%80,r=[];for(let e=0;e<f.length;e+=80)r.push(f.slice(e,e+80));return u+qs([[`${s} |`,r[0]],...r.slice(1,e+1).map((e=>["|",e])),["|","^".padStart(t)],["|",r[e+1]]])}return u+qs([[s-1+" |",l[i-1]],[`${s} |`,f],["|","^".padStart(c)],[`${s+1} |`,l[i+1]]])}function qs(e){const t=e.filter((([e,t])=>void 0!==t)),r=Math.max(...t.map((([e])=>e.length)));return t.map((([e,t])=>e.padStart(r)+(t?" "+t:""))).join("\n")}class Vs extends Error{constructor(e,...t){var r,n,i;const{nodes:o,source:s,positions:a,path:c,originalError:u,extensions:l}=function(e){const t=e[0];return null==t||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}(t);super(e),this.name="GraphQLError",this.path=null!=c?c:void 0,this.originalError=null!=u?u:void 0,this.nodes=Ls(Array.isArray(o)?o:o?[o]:void 0);const f=Ls(null===(r=this.nodes)||void 0===r?void 0:r.map((e=>e.loc)).filter((e=>null!=e)));this.source=null!=s?s:null==f||null===(n=f[0])||void 0===n?void 0:n.source,this.positions=null!=a?a:null==f?void 0:f.map((e=>e.start)),this.locations=a&&s?a.map((e=>Ms(s,e))):null==f?void 0:f.map((e=>Ms(e.source,e.start)));const h="object"==typeof(d=null==u?void 0:u.extensions)&&null!==d?null==u?void 0:u.extensions:void 0;var d;this.extensions=null!==(i=null!=l?l:h)&&void 0!==i?i:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=u&&u.stack?Object.defineProperty(this,"stack",{value:u.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,Vs):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const r of this.nodes)r.loc&&(e+="\n\n"+Fs((t=r.loc).source,Ms(t.source,t.start)));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+Fs(this.source,t);var t;return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function Ls(e){return void 0===e||0===e.length?void 0:e}function Us(e,t,r){return new Vs(`Syntax Error: ${r}`,{source:e,positions:[t]})}var Qs,Bs,zs;!function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"}(Qs||(Qs={})),(zs=Bs||(Bs={})).SOF="<SOF>",zs.EOF="<EOF>",zs.BANG="!",zs.DOLLAR="$",zs.AMP="&",zs.PAREN_L="(",zs.PAREN_R=")",zs.SPREAD="...",zs.COLON=":",zs.EQUALS="=",zs.AT="@",zs.BRACKET_L="[",zs.BRACKET_R="]",zs.BRACE_L="{",zs.PIPE="|",zs.BRACE_R="}",zs.NAME="Name",zs.INT="Int",zs.FLOAT="Float",zs.STRING="String",zs.BLOCK_STRING="BlockString",zs.COMMENT="Comment";class Ys{constructor(e){const t=new Cr(Bs.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==Bs.EOF)do{if(e.next)e=e.next;else{const t=Xs(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===Bs.COMMENT);return e}}function Ks(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function Hs(e,t){return Gs(e.charCodeAt(t))&&Ws(e.charCodeAt(t+1))}function Gs(e){return e>=55296&&e<=56319}function Ws(e){return e>=56320&&e<=57343}function Js(e,t){const r=e.source.body.codePointAt(t);if(void 0===r)return Bs.EOF;if(r>=32&&r<=126){const e=String.fromCodePoint(r);return'"'===e?"'\"'":`"${e}"`}return"U+"+r.toString(16).toUpperCase().padStart(4,"0")}function Zs(e,t,r,n,i){const o=e.line,s=1+r-e.lineStart;return new Cr(t,r,n,o,s,i)}function Xs(e,t){const r=e.source.body,n=r.length;let i=t;for(;i<n;){const t=r.charCodeAt(i);switch(t){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:10===r.charCodeAt(i+1)?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return ea(e,i);case 33:return Zs(e,Bs.BANG,i,i+1);case 36:return Zs(e,Bs.DOLLAR,i,i+1);case 38:return Zs(e,Bs.AMP,i,i+1);case 40:return Zs(e,Bs.PAREN_L,i,i+1);case 41:return Zs(e,Bs.PAREN_R,i,i+1);case 46:if(46===r.charCodeAt(i+1)&&46===r.charCodeAt(i+2))return Zs(e,Bs.SPREAD,i,i+3);break;case 58:return Zs(e,Bs.COLON,i,i+1);case 61:return Zs(e,Bs.EQUALS,i,i+1);case 64:return Zs(e,Bs.AT,i,i+1);case 91:return Zs(e,Bs.BRACKET_L,i,i+1);case 93:return Zs(e,Bs.BRACKET_R,i,i+1);case 123:return Zs(e,Bs.BRACE_L,i,i+1);case 124:return Zs(e,Bs.PIPE,i,i+1);case 125:return Zs(e,Bs.BRACE_R,i,i+1);case 34:return 34===r.charCodeAt(i+1)&&34===r.charCodeAt(i+2)?ua(e,i):na(e,i)}if(cn(t)||45===t)return ta(e,i,t);if(ln(t))return la(e,i);throw Us(e.source,i,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":Ks(t)||Hs(r,i)?`Unexpected character: ${Js(e,i)}.`:`Invalid character: ${Js(e,i)}.`)}return Zs(e,Bs.EOF,n,n)}function ea(e,t){const r=e.source.body,n=r.length;let i=t+1;for(;i<n;){const e=r.charCodeAt(i);if(10===e||13===e)break;if(Ks(e))++i;else{if(!Hs(r,i))break;i+=2}}return Zs(e,Bs.COMMENT,t,i,r.slice(t+1,i))}function ta(e,t,r){const n=e.source.body;let i=t,o=r,s=!1;if(45===o&&(o=n.charCodeAt(++i)),48===o){if(o=n.charCodeAt(++i),cn(o))throw Us(e.source,i,`Invalid number, unexpected digit after 0: ${Js(e,i)}.`)}else i=ra(e,i,o),o=n.charCodeAt(i);if(46===o&&(s=!0,o=n.charCodeAt(++i),i=ra(e,i,o),o=n.charCodeAt(i)),69!==o&&101!==o||(s=!0,o=n.charCodeAt(++i),43!==o&&45!==o||(o=n.charCodeAt(++i)),i=ra(e,i,o),o=n.charCodeAt(i)),46===o||ln(o))throw Us(e.source,i,`Invalid number, expected digit but got: ${Js(e,i)}.`);return Zs(e,s?Bs.FLOAT:Bs.INT,t,i,n.slice(t,i))}function ra(e,t,r){if(!cn(r))throw Us(e.source,t,`Invalid number, expected digit but got: ${Js(e,t)}.`);const n=e.source.body;let i=t+1;for(;cn(n.charCodeAt(i));)++i;return i}function na(e,t){const r=e.source.body,n=r.length;let i=t+1,o=i,s="";for(;i<n;){const n=r.charCodeAt(i);if(34===n)return s+=r.slice(o,i),Zs(e,Bs.STRING,t,i+1,s);if(92!==n){if(10===n||13===n)break;if(Ks(n))++i;else{if(!Hs(r,i))throw Us(e.source,i,`Invalid character within String: ${Js(e,i)}.`);i+=2}}else{s+=r.slice(o,i);const t=117===r.charCodeAt(i+1)?123===r.charCodeAt(i+2)?ia(e,i):oa(e,i):ca(e,i);s+=t.value,i+=t.size,o=i}}throw Us(e.source,i,"Unterminated string.")}function ia(e,t){const r=e.source.body;let n=0,i=3;for(;i<12;){const e=r.charCodeAt(t+i++);if(125===e){if(i<5||!Ks(n))break;return{value:String.fromCodePoint(n),size:i}}if(n=n<<4|aa(e),n<0)break}throw Us(e.source,t,`Invalid Unicode escape sequence: "${r.slice(t,t+i)}".`)}function oa(e,t){const r=e.source.body,n=sa(r,t+2);if(Ks(n))return{value:String.fromCodePoint(n),size:6};if(Gs(n)&&92===r.charCodeAt(t+6)&&117===r.charCodeAt(t+7)){const e=sa(r,t+8);if(Ws(e))return{value:String.fromCodePoint(n,e),size:12}}throw Us(e.source,t,`Invalid Unicode escape sequence: "${r.slice(t,t+6)}".`)}function sa(e,t){return aa(e.charCodeAt(t))<<12|aa(e.charCodeAt(t+1))<<8|aa(e.charCodeAt(t+2))<<4|aa(e.charCodeAt(t+3))}function aa(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function ca(e,t){const r=e.source.body;switch(r.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw Us(e.source,t,`Invalid character escape sequence: "${r.slice(t,t+2)}".`)}function ua(e,t){const r=e.source.body,n=r.length;let i=e.lineStart,o=t+3,s=o,a="";const c=[];for(;o<n;){const n=r.charCodeAt(o);if(34===n&&34===r.charCodeAt(o+1)&&34===r.charCodeAt(o+2)){a+=r.slice(s,o),c.push(a);const n=Zs(e,Bs.BLOCK_STRING,t,o+3,fn(c).join("\n"));return e.line+=c.length-1,e.lineStart=i,n}if(92!==n||34!==r.charCodeAt(o+1)||34!==r.charCodeAt(o+2)||34!==r.charCodeAt(o+3))if(10!==n&&13!==n)if(Ks(n))++o;else{if(!Hs(r,o))throw Us(e.source,o,`Invalid character within String: ${Js(e,o)}.`);o+=2}else a+=r.slice(s,o),c.push(a),13===n&&10===r.charCodeAt(o+1)?o+=2:++o,a="",s=o,i=o;else a+=r.slice(s,o),s=o+1,o+=4}throw Us(e.source,o,"Unterminated string.")}function la(e,t){const r=e.source.body,n=r.length;let i=t+1;for(;i<n&&(un(o=r.charCodeAt(i))||cn(o)||95===o);)++i;var o;return Zs(e,Bs.NAME,t,i,r.slice(t,i))}class fa{constructor(e,t={}){const r=function(e){return e instanceof Ft}(e)?e:new Ft(e);this._lexer=new Ys(r),this._options=t,this._tokenCounter=0}parseName(){const e=this.expectToken(Bs.NAME);return this.node(e,{kind:Vr.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:Vr.DOCUMENT,definitions:this.many(Bs.SOF,this.parseDefinition,Bs.EOF)})}parseDefinition(){if(this.peek(Bs.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===Bs.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw Us(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(Bs.BRACE_L))return this.node(e,{kind:Vr.OPERATION_DEFINITION,operation:qr.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let r;return this.peek(Bs.NAME)&&(r=this.parseName()),this.node(e,{kind:Vr.OPERATION_DEFINITION,operation:t,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(Bs.NAME);switch(e.value){case"query":return qr.QUERY;case"mutation":return qr.MUTATION;case"subscription":return qr.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(Bs.PAREN_L,this.parseVariableDefinition,Bs.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:Vr.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(Bs.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(Bs.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(Bs.DOLLAR),this.node(e,{kind:Vr.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:Vr.SELECTION_SET,selections:this.many(Bs.BRACE_L,this.parseSelection,Bs.BRACE_R)})}parseSelection(){return this.peek(Bs.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let r,n;return this.expectOptionalToken(Bs.COLON)?(r=t,n=this.parseName()):n=t,this.node(e,{kind:Vr.FIELD,alias:r,name:n,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(Bs.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(Bs.PAREN_L,t,Bs.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,r=this.parseName();return this.expectToken(Bs.COLON),this.node(t,{kind:Vr.ARGUMENT,name:r,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(Bs.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(Bs.NAME)?this.node(e,{kind:Vr.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:Vr.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),!0===this._options.allowLegacyFragmentVariables?this.node(e,{kind:Vr.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:Vr.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case Bs.BRACKET_L:return this.parseList(e);case Bs.BRACE_L:return this.parseObject(e);case Bs.INT:return this.advanceLexer(),this.node(t,{kind:Vr.INT,value:t.value});case Bs.FLOAT:return this.advanceLexer(),this.node(t,{kind:Vr.FLOAT,value:t.value});case Bs.STRING:case Bs.BLOCK_STRING:return this.parseStringLiteral();case Bs.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:Vr.BOOLEAN,value:!0});case"false":return this.node(t,{kind:Vr.BOOLEAN,value:!1});case"null":return this.node(t,{kind:Vr.NULL});default:return this.node(t,{kind:Vr.ENUM,value:t.value})}case Bs.DOLLAR:if(e){if(this.expectToken(Bs.DOLLAR),this._lexer.token.kind===Bs.NAME){const e=this._lexer.token.value;throw Us(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:Vr.STRING,value:e.value,block:e.kind===Bs.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:Vr.LIST,values:this.any(Bs.BRACKET_L,(()=>this.parseValueLiteral(e)),Bs.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:Vr.OBJECT,fields:this.any(Bs.BRACE_L,(()=>this.parseObjectField(e)),Bs.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,r=this.parseName();return this.expectToken(Bs.COLON),this.node(t,{kind:Vr.OBJECT_FIELD,name:r,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(Bs.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(Bs.AT),this.node(t,{kind:Vr.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(Bs.BRACKET_L)){const r=this.parseTypeReference();this.expectToken(Bs.BRACKET_R),t=this.node(e,{kind:Vr.LIST_TYPE,type:r})}else t=this.parseNamedType();return this.expectOptionalToken(Bs.BANG)?this.node(e,{kind:Vr.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:Vr.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(Bs.STRING)||this.peek(Bs.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const r=this.parseConstDirectives(),n=this.many(Bs.BRACE_L,this.parseOperationTypeDefinition,Bs.BRACE_R);return this.node(e,{kind:Vr.SCHEMA_DEFINITION,description:t,directives:r,operationTypes:n})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(Bs.COLON);const r=this.parseNamedType();return this.node(e,{kind:Vr.OPERATION_TYPE_DEFINITION,operation:t,type:r})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const r=this.parseName(),n=this.parseConstDirectives();return this.node(e,{kind:Vr.SCALAR_TYPE_DEFINITION,description:t,name:r,directives:n})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:Vr.OBJECT_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(Bs.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(Bs.BRACE_L,this.parseFieldDefinition,Bs.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseArgumentDefs();this.expectToken(Bs.COLON);const i=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:Vr.FIELD_DEFINITION,description:t,name:r,arguments:n,type:i,directives:o})}parseArgumentDefs(){return this.optionalMany(Bs.PAREN_L,this.parseInputValueDef,Bs.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),r=this.parseName();this.expectToken(Bs.COLON);const n=this.parseTypeReference();let i;this.expectOptionalToken(Bs.EQUALS)&&(i=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:Vr.INPUT_VALUE_DEFINITION,description:t,name:r,type:n,defaultValue:i,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:Vr.INTERFACE_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:Vr.UNION_TYPE_DEFINITION,description:t,name:r,directives:n,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(Bs.EQUALS)?this.delimitedMany(Bs.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:Vr.ENUM_TYPE_DEFINITION,description:t,name:r,directives:n,values:i})}parseEnumValuesDefinition(){return this.optionalMany(Bs.BRACE_L,this.parseEnumValueDefinition,Bs.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),r=this.parseEnumValueName(),n=this.parseConstDirectives();return this.node(e,{kind:Vr.ENUM_VALUE_DEFINITION,description:t,name:r,directives:n})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw Us(this._lexer.source,this._lexer.token.start,`${ha(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:Vr.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:r,directives:n,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(Bs.BRACE_L,this.parseInputValueDef,Bs.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===Bs.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),r=this.optionalMany(Bs.BRACE_L,this.parseOperationTypeDefinition,Bs.BRACE_R);if(0===t.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:Vr.SCHEMA_EXTENSION,directives:t,operationTypes:r})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),r=this.parseConstDirectives();if(0===r.length)throw this.unexpected();return this.node(e,{kind:Vr.SCALAR_TYPE_EXTENSION,name:t,directives:r})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:Vr.OBJECT_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:Vr.INTERFACE_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),r=this.parseConstDirectives(),n=this.parseUnionMemberTypes();if(0===r.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:Vr.UNION_TYPE_EXTENSION,name:t,directives:r,types:n})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),r=this.parseConstDirectives(),n=this.parseEnumValuesDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:Vr.ENUM_TYPE_EXTENSION,name:t,directives:r,values:n})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),r=this.parseConstDirectives(),n=this.parseInputFieldsDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:Vr.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:r,fields:n})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(Bs.AT);const r=this.parseName(),n=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:Vr.DIRECTIVE_DEFINITION,description:t,name:r,arguments:n,repeatable:i,locations:o})}parseDirectiveLocations(){return this.delimitedMany(Bs.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(Qs,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new $r(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw Us(this._lexer.source,t.start,`Expected ${da(e)}, found ${ha(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==Bs.NAME||t.value!==e)throw Us(this._lexer.source,t.start,`Expected "${e}", found ${ha(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===Bs.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=null!=e?e:this._lexer.token;return Us(this._lexer.source,t.start,`Unexpected ${ha(t)}.`)}any(e,t,r){this.expectToken(e);const n=[];for(;!this.expectOptionalToken(r);)n.push(t.call(this));return n}optionalMany(e,t,r){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(r));return e}return[]}many(e,t,r){this.expectToken(e);const n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n}delimitedMany(e,t){this.expectOptionalToken(e);const r=[];do{r.push(t.call(this))}while(this.expectOptionalToken(e));return r}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(void 0!==e&&t.kind!==Bs.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw Us(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function ha(e){const t=e.value;return da(e.kind)+(null!=t?` "${t}"`:"")}function da(e){return function(e){return e===Bs.BANG||e===Bs.DOLLAR||e===Bs.AMP||e===Bs.PAREN_L||e===Bs.PAREN_R||e===Bs.SPREAD||e===Bs.COLON||e===Bs.EQUALS||e===Bs.AT||e===Bs.BRACKET_L||e===Bs.BRACKET_R||e===Bs.BRACE_L||e===Bs.PIPE||e===Bs.BRACE_R}(e)?`"${e}"`:e}var pa=new Map,ma=new Map,ya=!0,va=!1;function ga(e){return e.replace(/[\s,]+/g," ").trim()}function _a(e){var t,r,n,i=ga(e);if(!pa.has(i)){var o=function(e,t){return new fa(e,t).parseDocument()}(e,{experimentalFragmentVariables:va,allowLegacyFragmentVariables:va});if(!o||"Document"!==o.kind)throw new Error("Not a valid GraphQL document.");pa.set(i,function(e){var t=new Set(e.definitions);t.forEach((function(e){e.loc&&delete e.loc,Object.keys(e).forEach((function(r){var n=e[r];n&&"object"==typeof n&&t.add(n)}))}));var r=e.loc;return r&&(delete r.startToken,delete r.endToken),e}((t=o,r=new Set,n=[],t.definitions.forEach((function(e){if("FragmentDefinition"===e.kind){var t=e.name.value,i=ga((s=e.loc).source.body.substring(s.start,s.end)),o=ma.get(t);o&&!o.has(i)?ya&&console.warn("Warning: fragment with name "+t+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):o||ma.set(t,o=new Set),o.add(i),r.has(i)||(r.add(i),n.push(e))}else n.push(e);var s})),le(le({},t),{definitions:n}))))}return pa.get(i)}function ba(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];"string"==typeof e&&(e=[e]);var n=e[0];return t.forEach((function(t,r){t&&"Document"===t.kind?n+=t.loc.source.body:n+=t,n+=e[r+1]})),_a(n)}var wa,Ea=ba;(wa=ba||(ba={})).gql=Ea,wa.resetCaches=function(){pa.clear(),ma.clear()},wa.disableFragmentWarnings=function(){ya=!1},wa.enableExperimentalFragmentVariables=function(){va=!0},wa.disableExperimentalFragmentVariables=function(){va=!1},ba.default=ba;const Sa=(e=>{var t={};return o.d(t,e),t})({default:()=>t.default});class Oa{constructor(e,t){this.rpcManager=e;const r=`${t}/graphql`;this.client=new $o({link:new Dn({uri:`${this.rpcManager.getEndpoint()}${r}`,headers:this.rpcManager.getStaticHeaders(),fetch:Sa.default}),cache:new $s})}async query(e){return(await this.client.query({query:ba`
9
9
  ${e.query}
10
- `,variables:e.variables})).data}async mutate(e){return(await this.client.mutate({mutation:va`
10
+ `,variables:e.variables})).data}async mutate(e){return(await this.client.mutate({mutation:ba`
11
11
  ${e.query}
12
- `})).data}}class Ea{constructor(e){this.rpcManager=e,this.clientsMap=new Map}get(e){let t=this.clientsMap.get(e);return t||(t=new wa(this.rpcManager,e),this.clientsMap.set(e,t),t)}}class Sa{constructor(e,t,r){this.rpcManager=e,this.lockManager=t,this.querySubscriptionManager=r}async sendMutations(e,t){const r=K(e),n=r.map((e=>`sendMutation_${V(e.squidDocIdObj)}`));await this.lockManager.lock(...n),await this.querySubscriptionManager.waitForAllQueriesToFinish();try{const e={mutations:r,integrationId:t};return await this.rpcManager.post("mutation/mutate",e)}finally{this.lockManager.release(...n)}}}class Oa{constructor(e,t){this.rpcManager=e,this.socketManager=t,this.ongoingNamedQueryExecutions={},t.observeNotifications().pipe((0,U.filter)((e=>"namedQuery"===e.type)),Qe((e=>e))).subscribe((e=>{this.handleNamedQueryResponse(e.clientRequestId,e.payload)}))}executeNamedQueryAndSubscribe(e,t,r){const n=ie(),i=new U.Subject;this.ongoingNamedQueryExecutions[n]=i;const o={integrationId:e,queryName:t,paramsRecordStr:O(r),clientRequestId:n};return this.rpcManager.post("named-query/execute",o).catch((r=>{console.error("Got error while executing named query",t,"for integration",e,r),i.error(r),i.complete()})),i.pipe((0,U.finalize)((()=>{delete this.ongoingNamedQueryExecutions[n]})),(0,U.share)())}handleNamedQueryResponse(e,t){const r=this.ongoingNamedQueryExecutions[e];if(!r)return;const n=I(t);n.success?r.next(n.result):(r.error(new Error(n.result)),r.complete())}}function Ia(e,t){return le((function(r,n){var i=0;r.subscribe(Le(n,(function(r){return e.call(t,r,i++)&&n.next(r)})))}))}var Ta;function ka(e){return[Ta.SET_PATH,Ta.DELETE_PATH].includes(e.type)}function Na(e){return e.type===Ta.BATCH_ACTION}function Da(e){const t=[];if(ka(e))t.push(e);else if(Na(e))for(const r of e.payload)t.push(...Da(r));return t}function Aa(e,t){return xa(e,t)}function Ra(e){return"object"==typeof e}function xa(e,t){let r=e;if(ka(t))r=function(e,t,r=[]){switch(t.type){case Ta.DELETE_PATH:return Pa(e,t.path);case Ta.SET_PATH:const n=t;return function(e,t,r,n){return $a(e,t,r,n)}(e,t.path,r,n.payload);case Ta.BATCH_ACTION:throw new Error("Unsupported")}}(e,t,[]);else{if(!Na(t))throw new Error(`Invalid action type: ${t.type}`);r=t.payload.reduce(((e,t)=>xa(e,t)),e)}return r}function Pa(e,t){if(!t.length)throw new Error("can not delete an empty path");const r=t[0];if(1===t.length)return function(e,t){if(e instanceof Array)throw new Error("Cannot remove an item from an array");const r=Object.assign({},e);return delete r[t],r}(e,r);const n=t.slice(1),i=ja(e,r);if(!i)return e;if(!Ra(i))throw new Error("Cannot delete from a non object state.");const o=Pa(i,n);return o===i?e:Ca(e,r,o)}function $a(e,t,r,n){if(!t.length){if(Ra(n))return n;throw new Error("Relative path cannot be of length 0 when the new value is not an object.")}const i=t[0],o=[...r,i];if(1===t.length)return Ca(e,i,n);const s=t.slice(1),a=ja(e,i);return void 0!==a&&Ra(a)?Ca(e,i,$a(a,s,o,n)):$a(e=Ca(e,i,{}),t,r,n)}function Ca(e,t,r){return(e=Object.assign({},e))[t]=r,e}function ja(e,t){return e instanceof Array?e[function(e){const t=Number(e);if(isNaN(t))throw new Error(`The value is not a number: Actual: ${e}`);return Math.floor(t)}(t)]:e[t]}!function(e){e.DELETE_PATH="DELETE_PATH",e.SET_PATH="SET_PATH",e.BATCH_ACTION="BATCH_ACTION"}(Ta||(Ta={}));class Ma{constructor(){this.root=new Fa}getOrCreatePathTrieNode(e,t){let r=this.root;for(const t of e)r.children.get(t)||r.children.set(t,new Fa),r=r.children.get(t);return void 0!==t&&(r.nodeData=t),r}getPathTrieNode(e){let t=this.root;for(const r of e){if(!t)return;t=t.children.get(r)}return t}getPathTrie(e){let t=this.root;for(const r of e){if(!t)return;t=t.children.get(r)}if(t){const e=new Ma;return e.root=t,e}}iterateBfs(e){this.iterateInternal(this.root,e,[])}removeNode(e){e.length||(this.root=new Fa);const t=[this.root];for(const r of e){const e=t[t.length-1].children.get(r);if(!e)throw new Error("Node does not exist");t.push(e)}for(let r=t.length-1;r>0;r--){const n=t[r],i=e[r-1];if((n.nodeData||n.children.size)&&r!==t.length-1)break;t[r-1].children.delete(i)}}clearNodeData(e){const t=this.getPathTrieNode(e);t&&(t.nodeData=void 0,t.children.size||this.removeNode(e))}getNodeList(e){const t=[];let r=this.root;for(const n of e){if(!r)return t;t.push(r),r=r.children.get(n)}return t}iterateInternal(e,t,r){if(!1!==t(e.nodeData,r))for(const[n,i]of e.children)this.iterateInternal(i,t,r.concat(n))}}class Fa{constructor(){this.children=new Map([])}}class qa{constructor(){this.subscriptionsTree=new Ma,this.state={},this.batchCount=0,this.batchedActions=[]}dispatch(e){this.batchCount>0&&this.batchedActions.push(e),this.state=Aa(this.state,e),0===this.batchCount&&this.dispatchSubscriptions(e)}runInBatch(e){this.batchCount++;try{e()}finally{if(this.batchCount--,0===this.batchCount&&this.batchedActions.length){const e={type:Ta.BATCH_ACTION,payload:[...this.batchedActions]};this.batchedActions.splice(0),this.dispatch(e)}}}observePath(e,t){return new U.Observable((r=>{const n=this.getOrCreateSubjectForPath(e);r.next(this.getStateInPath(e));const i=n.pipe(Ia((e=>{if(!t)return!0;const r=new Ma,n=t();for(const e of n)r.getOrCreatePathTrieNode(e,!0);const i=Da(e.action).map((e=>e.path));let o=!1;for(const e of i)if(0===r.getNodeList(e).length){o=!0;break}return o})),Qe((e=>e.data))).subscribe(r);return()=>{i.unsubscribe(),n.observed||(n.complete(),this.subscriptionsTree.clearNodeData(e))}}))}setKeyInPath(e,t,r,n=!1){this.setInPath([...e,t],r,n)}setPartial(e,t,r=!1){let n=this.getStateInPath(e);n||(n={}),this.setInPath(e,Object.assign(Object.assign({},n),t),r)}setInPath(e,t,r=!1){if(r&&this.getStateInPath(e)===t)return;const n={type:Ta.SET_PATH,path:e,payload:t};this.dispatch(n)}pushToArray(e,t){let r=this.getStateInPath(e);r=r?[...r]:[],r.push(t),this.setInPath(e,r)}deletePath(e){const t={type:Ta.DELETE_PATH,path:e};this.dispatch(t)}getState(){return this.state}getStateInPath(e){return Va(this.state,e)}destroy(){this.subscriptionsTree.iterateBfs((e=>{e&&e.subject&&e.subject.complete()}))}getOrCreateSubjectForPath(e){const t=this.subscriptionsTree.getOrCreatePathTrieNode(e);t.nodeData||(t.nodeData=new La);const r=t.nodeData;return r.subject||(r.subject=new U.Subject),r.subject}dispatchSubscriptions(e){const t=function(e,t){const r=new Ma;for(const n of Da(e)){let e=r.getOrCreatePathTrieNode(n.path);if(!t||e.nodeData)continue;let i=t.getPathTrieNode(n.path);if(i){const t=[[e,i]];for(;t.length;){const r=t.shift();if(e=r[0],i=r[1],!e.nodeData){for(const[r,n]of i.children)e.children.get(r)||e.children.set(r,new Fa),t.push([e.children.get(r),n]);e.nodeData=!0}}}}return r}(e,this.subscriptionsTree);t.iterateBfs(((t,r)=>{const n=this.subscriptionsTree.getPathTrieNode(r);n&&n.nodeData&&n.nodeData.subject.next({action:e,data:Va(this.getState(),r)})}))}}function Va(e,t){let r=e;for(const e of t){if(null==r)return;if(!Ra(r))throw new Error("result must be a state object");r=r[e]}return r}class La{}const Ua="client";class Qa{constructor(e,t,r,n,i){this.rpcManager=e,this.clientIdService=t,this.documentStore=r,this.destructManager=n,this.documentIdentityService=i,this.safeToSendQueriesToServer=new U.BehaviorSubject(!0),this.onOrphanDocuments=new U.Subject,this.ongoingQueries=new Map,this.inflightQueriesCount=new U.BehaviorSubject(0),this.clientRequestIdToLocalDocuments=new Map,this.localDocumentToClientRequestIds=new Map,this.queryMappingManager=new Ba,this.documentIdentityService.observeChanges().subscribe(this.migrateDocIds.bind(this)),this.clientIdService.observeClientReadyToBeRegenerated().subscribe((()=>{this.refreshOngoingQueries()})),this.destructManager.onPreDestruct((()=>{this.predestruct()}))}hasOngoingQuery(e){return this.ongoingQueries.has(e)}getQuery(e){return y(this.ongoingQueries.get(e),"UNKNOWN_QUERY").query}setGotInitialResult(e){const t=y(this.ongoingQueries.get(e));t.gotInitialResponse?this.removeClientRequestIdMapping(e):t.gotInitialResponse=!0}findQueriesForDocument(e,t){const{collectionName:r,integrationId:n}=q(t),i=this.queryMappingManager.getMapping(Ua,r,n);return i?A(i,e):[]}setClientRequestIdsForLocalDoc(e,t){const r=this.localDocumentToClientRequestIds.get(e)||new Set,n=new Set(t?this.findQueriesForDocument(t,e).map((e=>function(e){const t=e.split("_");return{clientId:t[0],clientRequestId:t[1]}}(e).clientRequestId)):[]),i=new Set([...r,...n]);for(const t of[...r]){if(n.has(t))continue;r.delete(t);const i=this.clientRequestIdToLocalDocuments.get(t);i&&(i.delete(e),i.size||this.clientRequestIdToLocalDocuments.delete(t)),r.size||this.localDocumentToClientRequestIds.delete(e)}for(const t of n){let r=this.localDocumentToClientRequestIds.get(e);r||(r=new Set,this.localDocumentToClientRequestIds.set(e,r)),r.add(t);let n=this.clientRequestIdToLocalDocuments.get(t);n||(n=new Set,this.clientRequestIdToLocalDocuments.set(t,n)),n.add(e)}return[...i]}errorOutAllQueries(e,t){const r=this.localDocumentToClientRequestIds.get(e)||new Set;for(const e of r){const r=this.ongoingQueries.get(e);r&&(r.dataSubject.error(t),r.done=!0)}}notifyAllSubscriptions(e){const t=new Set;for(const r of e){const e=this.ongoingQueries.get(r);if(!e)continue;if(!e.gotInitialResponse||!e.activated)continue;const n=this.clientRequestIdToLocalDocuments.get(r),i=this.documentStore.sortAndLimitDocs(n,e.query);let o=!1;for(const t of e.supportedQueries)o=o||this.updateOngoingQueryWithNewDataFromSupportingQuery(i,t);let s=e;for(;!s.allObservables;)s=y(null==s?void 0:s.supportingOngoingQuery);o&&t.add(s),e.dataSubject.next(i)}for(const e of t){const t=this.collectAllObservables(e);y(e.allObservables).next(t)}}findValidParentQuery(e){if(e.forceFetchFromServer)return;const t=new C(e.query);for(const r of this.ongoingQueries.values())if(e!==r&&r.activated&&!r.isInFlight&&!r.isEmptyForJoin&&!r.done&&r.subscribe&&t.isSubsetOfQuery(r.query))return r}processQuery(e,t,r,n,i,o){return(0,U.defer)((()=>{const s=this.createOngoingQueryGraph(e,t,r,n,i,!0);o&&(s.forceFetchFromServer=!0),this.sendQueryToServerOrUseParentQuery(s),s.allObservables=new U.ReplaySubject(1);const a=s.allObservables.pipe((0,U.switchMap)((e=>(0,U.combineLatest)(e).pipe(Qe((e=>this.joinResults(e,n,s)))))),Ia((()=>this.allOngoingQueriesGotInitialResult(s))),(0,U.startWith)(void 0),(0,U.pairwise)(),Ia((([e,t])=>!l.isEqual(e,t))),Qe((([e,t])=>t)),i?(0,U.tap)():(0,U.take)(1),(0,U.finalize)((()=>{var e;s.dataSubject.complete(),s.done=!0,this.completeAllSupportedQueries(s).then(),null===(e=s.allObservables)||void 0===e||e.complete()}))),c=this.collectAllObservables(s);return s.allObservables.next(c),a})).pipe((0,U.share)())}hasOngoingQueryForDocId(e){const t=this.localDocumentToClientRequestIds.get(e);return!!t&&!!t.size}removeClientRequestIdMapping(e){const t=this.clientRequestIdToLocalDocuments.get(e);if(!t)return;this.clientRequestIdToLocalDocuments.delete(e);const r=[];for(const n of t){const t=y(this.localDocumentToClientRequestIds.get(n));t.delete(e),t.size||(this.localDocumentToClientRequestIds.delete(n),r.push(n))}r.length&&this.onOrphanDocuments.next(r)}async waitForAllQueriesToFinish(){return(0,U.firstValueFrom)(this.inflightQueriesCount.pipe(Ia((e=>0===e)))).then((()=>{}))}registerQueryFinalizer(e){const t=e.clientRequestId,r=P(this.clientIdService.getClientId(),t);e.dataSubject.pipe((0,U.finalize)((async()=>{if(e.unsubscribeBlockerCount.value>0&&await(0,U.firstValueFrom)((0,U.race)(this.destructManager.observeIsDestructing(),e.unsubscribeBlockerCount.pipe(Ia((e=>0===e))))),this.queryMappingManager.removeQuery(t,r).then(),this.ongoingQueries.delete(t),e.subscribe&&!e.isEmptyForJoin&&e.activated){const r={clientRequestId:t};this.rpcManager.post("query/unsubscribe",r).catch((t=>{console.error("Got error while unsubscribing from query",e.query,t)}))}this.removeClientRequestIdMapping(t),this.ongoingQueries.delete(t)}))).subscribe({error:()=>{}})}createOngoingQueryGraph(e,t,r,n,i,o,s={}){if(s[t])return s[t];const a=ie(),c=[],u={clientRequestId:a,activated:o,alias:t,query:e,subscribe:i,dataSubject:new U.ReplaySubject(1),supportedQueries:c,supportingOngoingQuery:void 0,joinCondition:void 0,gotInitialResponse:!1,isEmptyForJoin:!1,unsubscribeBlockerCount:new U.BehaviorSubject(0),queryRegistered:new U.BehaviorSubject(!1),done:!1,isInFlight:!1,forceFetchFromServer:!1};this.registerQueryFinalizer(u),this.ongoingQueries.set(a,u),s[t]=u;for(const[e,o]of Object.entries(n)){const a=o.leftAlias;if(a!==t&&e!==t)continue;const l=a===t?e:a;if(a===t){const e=this.createOngoingQueryGraph(r[l],l,r,n,i,!1,s);e.joinCondition=o,c.push(e)}else u.supportingOngoingQuery=this.createOngoingQueryGraph(r[l],l,r,n,i,!1,s)}return u}collectAllObservables(e,t=[]){if(e.isEmptyForJoin)return t;const r=e.alias;t.push(e.dataSubject.pipe(Qe((e=>({docs:e,alias:r})))));for(const r of e.supportedQueries)this.collectAllObservables(r,t);return t}joinResults(e,t,r){const n=[],i=e.reduce(((e,t)=>(e[t.alias]?e[t.alias].push(...t.docs):e[t.alias]=[...t.docs],e)),{});i[r.alias].forEach((e=>{n.push({[r.alias]:e})}));const o=this.getOngoingQueriesBfs(r),s=new Set;for(let e=1;e<o.length;e++){const r=o[e].alias;s.has(r)||(s.add(r),this.join(n,r,i[r],t))}return n}join(e,t,r,n){var i;if(!e.length)return;const o=Object.keys(e[0]),s=n[t];if(!s||!o.includes(s.leftAlias))return;const a=new Map;(r||[]).forEach((e=>{const t=e[s.rightFieldName];a.has(t)||a.set(t,[]),y(a.get(t)).push(e)}));for(const r of[...e]){const n=a.get(null===(i=r[s.leftAlias])||void 0===i?void 0:i[s.leftFieldName])||[];if(n.length)for(const i of n)r[t]?e.push(Object.assign(Object.assign({},r),{[t]:i})):r[t]=i;else r[t]||(r[t]=void 0)}}getOngoingQueriesBfs(e){const t=[],r=[e];for(;r.length;){const e=y(r.shift());e.isEmptyForJoin||(t.push(e),r.push(...e.supportedQueries))}return t}updateOngoingQueryWithNewDataFromSupportingQuery(e,t){var r;const n=y(t.joinCondition),i=t.query;if(t.activated){const o=y(null===(r=t.supportingOngoingQuery)||void 0===r?void 0:r.supportedQueries).filter((e=>e.alias===t.alias)),s=new Set(e.map((e=>{var t;return null!==(t=e[n.leftFieldName])&&void 0!==t?t:null})));for(const e of o)e.query.conditions.filter((e=>e.fieldName===n.rightFieldName)).forEach((e=>{s.delete(e.value)}));if(0===s.size)return!1;const a=l.cloneDeep(i);a.conditions=a.conditions.filter((e=>e.fieldName!==n.rightFieldName)),[...s].forEach((e=>{a.conditions.push({fieldName:n.rightFieldName,operator:"==",value:e})}));const c=Object.assign(Object.assign({},t),{query:a,activated:!0,gotInitialResponse:!1,dataSubject:new U.ReplaySubject(1),clientRequestId:ie(),isEmptyForJoin:!1});return this.registerQueryFinalizer(c),this.ongoingQueries.set(c.clientRequestId,c),y(t.supportingOngoingQuery).supportedQueries.push(c),this.sendQueryToServerOrUseParentQuery(c),!0}{const r=e.map((e=>{var t;return{fieldName:n.rightFieldName,operator:"==",value:null!==(t=e[n.leftFieldName])&&void 0!==t?t:null}}));return t.activated=!0,r.length?(i.conditions.push(...r),this.sendQueryToServerOrUseParentQuery(t)):t.isEmptyForJoin=!0,!0}}allOngoingQueriesGotInitialResult(e){return!!e.isEmptyForJoin||!!e.gotInitialResponse&&(!e.supportedQueries.length||e.supportedQueries.every((e=>this.allOngoingQueriesGotInitialResult(e))))}async completeAllSupportedQueries(e){const t=[...e.supportedQueries||[]];for(;t.length;){const e=y(t.shift());t.push(...e.supportedQueries||[]),await(0,U.firstValueFrom)(e.unsubscribeBlockerCount.pipe(Ia((e=>0===e)))),e.dataSubject.complete()}}predestruct(){this.safeToSendQueriesToServer.next(!1),this.safeToSendQueriesToServer.complete(),this.unsubscribe()}unsubscribe(){var e;const t=[...this.ongoingQueries.values()];for(const r of t)r.dataSubject.complete(),null===(e=r.allObservables)||void 0===e||e.complete()}hasSubscription(e){var t;return!!(null===(t=this.ongoingQueries.get(e))||void 0===t?void 0:t.subscribe)}sendQueryToServerOrUseParentQuery(e){if(this.destructManager.isDestructing)return;const t=e.query,r=e.clientRequestId,n=P(this.clientIdService.getClientId(),r);this.queryMappingManager.addQuery(Ua,t,n).then(),this.ongoingQueries.set(r,e);const i=this.findValidParentQuery(e);i?this.useParentOngoingQuery(e,i).then():this.sendQueryToServer(e)}async useParentOngoingQuery(e,t){const r={clientRequestId:e.clientRequestId,query:e.query,parentClientRequestId:t.clientRequestId},n=new C(e.query);t.unsubscribeBlockerCount.next(t.unsubscribeBlockerCount.value+1);try{await(0,U.firstValueFrom)(t.queryRegistered.pipe(Ia(Boolean)))}catch(t){return e.dataSubject.error(t),e.queryRegistered.error(t),void(e.done=!0)}if(this.destructManager.isDestructing)return;if(e.done)return;this.rpcManager.post("query/register",r).then((()=>{e.queryRegistered.next(!0)})).catch((r=>{console.error("Query error",e.query,t.query,r),e.dataSubject.error(r),e.done=!0})).finally((()=>{t.unsubscribeBlockerCount.next(t.unsubscribeBlockerCount.value-1),e.isInFlight=!1}));const i=(0,U.race)(e.queryRegistered.pipe(Ia(Boolean),(0,U.delay)(2e3),(0,U.take)(1)),this.destructManager.observeIsDestructing().pipe((0,U.take)(1)));t.dataSubject.pipe((0,U.takeWhile)((()=>!e.done)),(0,U.takeUntil)(i),(0,U.tap)((()=>{e.gotInitialResponse||this.setGotInitialResult(e.clientRequestId)})),Qe((e=>e.filter((e=>n.documentMatchesQuery(e)))))).subscribe({next:t=>{for(const r of t)this.setClientRequestIdsForLocalDoc(V(r.__docId__,e.query.collectionName,e.query.integrationId),r);this.notifyAllSubscriptions([e.clientRequestId])},error:t=>e.dataSubject.error(t)})}sendQueryToServer(e){const t={query:e.query,clientRequestId:e.clientRequestId,subscribe:e.subscribe};this.safeToSendQueriesToServer.pipe(Ia(Boolean),(0,U.take)(1)).subscribe((()=>{e.done||(this.inflightQueriesCount.next(this.inflightQueriesCount.value+1),e.isInFlight=!0,this.rpcManager.post("query/query",t).catch((t=>{e.dataSubject.error(t),e.done=!0,e.queryRegistered.error("query failed")})).then((()=>{e.queryRegistered.next(!0)})).finally((()=>{this.inflightQueriesCount.next(this.inflightQueriesCount.value-1),e.isInFlight=!1})))}))}refreshOngoingQueries(){for(const e of this.ongoingQueries.values())this.sendQueryToServerOrUseParentQuery(e)}migrateDocIds(e){const t=Object.keys(e);for(const r of this.clientRequestIdToLocalDocuments.values())t.forEach((t=>{r.has(t)&&(r.delete(t),r.add(e[t]))}));t.forEach((t=>{w(this.localDocumentToClientRequestIds,t,e[t])}))}}class Ba extends D{constructor(){super(...arguments),this.stateService=new qa,this.querySubscriptionIdToQuery={}}async addQuery(e,t,r){this.stateService.runInBatch((()=>{let e=0;const n=new Set;for(const i of t.conditions){const o=this.getConditionStatePath(t,i),s=[...this.stateService.getStateInPath(o)||[]];if(ee(s,r),["==","!="].includes(i.operator)){const t=T(i.fieldName);n.has(t)||(e++,n.add(t))}else e++;this.stateService.setInPath(o,s)}if(!t.conditions.length){const e=["queryMapping",t.collectionName,t.integrationId,"mapping","unconditional"],n=[...this.stateService.getStateInPath(e)||[]];ee(n,r),this.stateService.setInPath(e,n)}this.stateService.setInPath([...this.getQueryMetadataStatePath(t,r),"condCount"],e)})),this.querySubscriptionIdToQuery[r]=t}async removeQuery(e,t){const r=this.querySubscriptionIdToQuery[t];if(r)return this.stateService.runInBatch((()=>{for(const e of r.conditions){const n=this.getConditionStatePath(r,e),i=[...this.stateService.getStateInPath(n)||[]];te(i,t),i.length?this.stateService.setInPath(n,i):this.stateService.deletePath(n)}if(!r.conditions.length){const e=["queryMapping",r.collectionName,r.integrationId,"mapping","unconditional"],n=[...this.stateService.getStateInPath(e)||[]];te(n,t),this.stateService.setInPath(e,n)}this.stateService.deletePath(this.getQueryMetadataStatePath(r,t))})),r}getMapping(e,t,r){return this.stateService.getStateInPath(["queryMapping",t,r,"mapping"])}removeLocalDevAppData(e){return Promise.resolve(void 0)}getQueryMetadataStatePath(e,t){return["queryMapping",e.collectionName,e.integrationId,"mapping","queriesMetadata",`${t}`]}getConditionStatePath(e,t){const r=T(t.fieldName),n=T(t.value);return["queryMapping",e.collectionName,e.integrationId,"mapping","conditional",`${r}`,`${t.operator}`,`${n}`]}}class za{constructor(e,t,r,n={},i,o){this.rpcEndpoint=e,this.socketManager=t,this.destructManager=r,this.headers=n,this.authManager=i,this.clientIdService=o,this.staticHeaders={},this.onGoingRpcCounter=new U.BehaviorSubject(0),m(e,"Http endpoint must be provided.");for(const[e,t]of Object.entries(n))this.setStaticHeader(e,t);const s=this.authManager.getApiKey();s&&this.setStaticHeader("Authorization",`ApiKey ${s}`),this.clientIdService.observeClientId().subscribe((e=>{e?this.setStaticHeader("x-squid-clientId",e):this.deleteStaticHeader("x-squid-clientId")})),this.rpcEndpoint.endsWith("/")||(this.rpcEndpoint+="/"),this.authManager.observeAuthIdToken().subscribe((e=>{if(e.token){let t=`Bearer ${e.token}`;e.integrationId&&(t+=`; IntegrationId ${e.integrationId}`),this.setStaticHeader("Authorization",t)}else this.deleteStaticHeader("Authorization")})),r.onDestruct((async()=>{await this.awaitAllSettled()}))}async awaitAllSettled(){await(0,U.firstValueFrom)(this.onGoingRpcCounter.pipe((0,U.filter)((e=>0===e))))}setStaticHeader(e,t){this.staticHeaders[e]=t}deleteStaticHeader(e){delete this.staticHeaders[e]}getEndpoint(){return this.rpcEndpoint}getStaticHeaders(){return this.staticHeaders}async post(e,t){this.onGoingRpcCounter.next(this.onGoingRpcCounter.value+1);try{await(0,U.firstValueFrom)((0,U.race)(this.socketManager.observeConnectionReady().pipe((0,U.filter)(Boolean)),this.destructManager.observeIsDestructing())),await this.authManager.waitForReadyState();let r={"Content-Type":"application/json"};Object.keys(this.staticHeaders)&&(r=Object.assign(Object.assign({},r),this.staticHeaders));const n=await(0,ba.default)(`${this.rpcEndpoint}${e}`,{method:"POST",body:O(t),headers:r});let i,o;try{i=await n.text();try{o=JSON.parse(i)}catch(e){}}catch(e){i="Cannot read body"}if(!n.ok)throw new Ya(n.status,n.statusText,n.headers,n.url,null==o?void 0:o.message);return o||i}finally{this.onGoingRpcCounter.next(this.onGoingRpcCounter.value-1)}}}class Ya extends Error{constructor(e,t,r,n,i){super(i||`RPC error ${e} ${t} calling ${n}`),this.statusCode=e,this.statusText=t,this.headers=r,this.url=n}}const Ka=(e=>{var t={};return o.d(t,e),t})({io:()=>r.io}),Ha=e=>e();class Ga{constructor(e,t,r=Ha,n,i={},o){this.clientIdService=e,this.socketIoEndpoint=t,this.messageNotificationWrapper=r,this.destructManager=n,this.authManager=o,this.webSocketObserver=new U.Subject,this.allMessagesObserver=new U.Subject,this.connectionReady=new U.BehaviorSubject(!1),this.seenMessageIds=new Set,this.firstConnection=!0,this.clientTooOldThreshold=3e5,this.destructManager.onDestruct((async()=>{await this.destruct()})),this.setupMessageAcknowledgments(),this.connect(Object.assign({},i)),this.connectionReady.pipe((0,U.skip)(1),(0,U.filter)((e=>!e)),(0,U.switchMap)((()=>(0,U.race)((0,U.timer)(this.clientTooOldThreshold),this.connectionReady.pipe((0,U.filter)(Boolean)),this.destructManager.observeIsDestructing())))).subscribe((()=>{this.connectionReady.value||this.destructManager.isDestructing||(this.clientIdService.notifyClientTooOld(),this.connect(Object.assign({},i)))})),this.connectionReady.pipe((0,U.filter)(Boolean)).subscribe((()=>{this.clientIdService.isClientTooOld()&&this.clientIdService.notifyClientReadyToBeRegenerated()}))}observeNotifications(){return this.webSocketObserver.asObservable()}observeConnectionReady(){return this.connectionReady.asObservable().pipe((0,U.distinctUntilChanged)())}sendMessage(e){this.authManager.waitForReadyState().then((()=>{(0,U.firstValueFrom)(this.connectionReady.pipe((0,U.filter)(Boolean))).then((()=>{const t=this.authManager.getAuthToken();y(this.socket).emit("message",Object.assign(Object.assign({},e),{authToken:t}))}))}))}connect(e){const t={clientId:this.clientIdService.getClientId()};this.socket=(0,Ka.io)(this.socketIoEndpoint,{query:t,reconnectionDelay:5e3,transports:["websocket"],extraHeaders:e}),this.socket.on("connect",(()=>{})),this.socket.on("disconnect",((e,t)=>{this.connectionReady.next(!1)})),this.socket.on("connectionReady",(()=>{this.connectionReady.next(!0),this.firstConnection||this.sendMessage({type:"catchup"}),this.firstConnection=!1})),this.socket.on("message",(e=>{const t=I(e);for(const e of t)this.allMessagesObserver.next(e),this.seenMessageIds.has(e.messageId)||(this.seenMessageIds.add(e.messageId),this.messageNotificationWrapper((()=>{this.webSocketObserver.next(e)})))}))}setupMessageAcknowledgments(){const e=new U.Subject;this.allMessagesObserver.subscribe((t=>{(null==t?void 0:t.messageId)&&e.next(t.messageId)}));const t=[];e.pipe((0,U.tap)((e=>t.push(e))),(0,U.debounceTime)(100)).subscribe((async()=>{const e=[...t.splice(0)];this.sendMessage({type:"acknowledge",payload:e})}))}async destruct(){var e;this.sendMessage({type:"kill"}),this.connectionReady.next(!1),await(0,U.firstValueFrom)((0,U.timer)(0)),null===(e=this.socket)||void 0===e||e.disconnect(),this.webSocketObserver.complete(),this.allMessagesObserver.complete()}}class Wa{constructor(e,t){this.clientIdService=e,this.socketManager=t,this.isConnected=!1,this.socketManager.observeConnectionReady().subscribe((e=>{this.isConnected=e}))}get connected(){return this.isConnected}get clientId(){return this.clientIdService.getClientId()}observeConnected(){return this.socketManager.observeConnectionReady()}}class Ja{constructor(e){this.destructManager=new ct,this.setAuthIdToken=(e,t)=>{this.authManager.setAuthIdToken(e,t)},this.collection=(e,t=i.built_in_db)=>(this.validateNotDestructed(),this.collectionReferenceFactory.get(e,t)),this.runInTransaction=e=>(this.validateNotDestructed(),this.dataManager.runInTransaction(e)),this.executeFunction=(e,...t)=>(this.validateNotDestructed(),(0,U.firstValueFrom)(this.backendFunctionManager.executeFunctionAndSubscribe(e,...t))),this.executeNamedQuery=(e,t,r)=>(this.validateNotDestructed(),(0,U.firstValueFrom)(this.namedQueryManager.executeNamedQueryAndSubscribe(e,t,r))),this.callApi=(e,t,r={})=>(this.validateNotDestructed(),(0,U.firstValueFrom)(this.apiManager.callApiAndSubscribe(e,t,r))),this.graphql=e=>(this.validateNotDestructed(),this.graphqlClientFactory.get(e)),this.ai=()=>(this.validateNotDestructed(),{assistant:e=>this.aiClientFactory.getAssistant(e)}),this.acquireLock=(e,t=!0)=>(this.validateNotDestructed(),this.distributedLockManager.lock(e,t)),this.destruct=async()=>{if(!this.destructManager.isDestructing)return this.destructManager.destruct().finally((()=>{const e=Object.entries(Ja.squidInstancesMap).find((([,e])=>e===this));e&&delete Ja.squidInstancesMap[e[0]]}))},this.connectionDetails=()=>(this.validateNotDestructed(),this._connectionDetails),this.unsubscribe=async()=>{this.querySubscriptionManager.unsubscribe(),await this.rpcManager.awaitAllSettled()},m(e.appId,"APP_ID_MUST_BE_PROVIDED");const t="prod"!==e.environmentId&&e.squidDeveloperId,r=function(e,t,r){return`${F(e,t)}${r?`-${r}`:""}`}(e.appId,e.environmentId,t?e.squidDeveloperId:void 0),n=function(e,t){const r=new URL("https://squid.cloud");r.host=`${t}.${e}.${r.host}`,ne(e)&&(r.protocol="http",r.port="8000",function(e){return/android$/.test(e)}(e)?r.host="10.0.2.2":function(e){return/ios$/.test(e)}(e)&&(r.host="localhost"));const n=r.toString();return n.endsWith("/")?n:n+"/"}(e.region,r),o=function(e,t){const r={};return ne(e)&&(r["x-squid-appid"]=t),r}(e.region,r);this.clientIdService=new nt(this.destructManager),this.authManager=new tt(this.destructManager,e.apiKey),this.socketManager=new Ga(this.clientIdService,n,e.messageNotificationWrapper,this.destructManager,o,this.authManager),this.rpcManager=new za(n,this.socketManager,this.destructManager,o,this.authManager,this.clientIdService),this.documentStore=new dt,this.lockManager=new oe,this.distributedLockManager=new ut(this.socketManager,this.destructManager),this.documentIdentityService=new ft(this.documentStore,this.destructManager),this.documentReferenceFactory=new ht,this.querySubscriptionManager=new Qa(this.rpcManager,this.clientIdService,this.documentStore,this.destructManager,this.documentIdentityService);const s=new Sa(this.rpcManager,this.lockManager,this.querySubscriptionManager);this.queryBuilderFactory=new Ye(this.querySubscriptionManager,this.documentReferenceFactory,this.documentIdentityService),this.joinQueryBuilderFactory=new Be(this.querySubscriptionManager,this.documentReferenceFactory,this.queryBuilderFactory),this.collectionReferenceFactory=new it(this.documentReferenceFactory,this.queryBuilderFactory,this.joinQueryBuilderFactory,this.documentIdentityService),this.dataManager=new at(this.documentStore,s,this.socketManager,this.querySubscriptionManager,this.queryBuilderFactory,this.lockManager,this.destructManager,this.documentIdentityService),this.documentReferenceFactory.setDataManager(this.dataManager),this.backendFunctionManager=new rt(this.clientIdService,this.rpcManager,this.socketManager),this.namedQueryManager=new Oa(this.rpcManager,this.socketManager),this.apiManager=new et(this.clientIdService,this.rpcManager,this.socketManager,e.apiServerUrlOverrideMapping),this.graphqlClientFactory=new Ea(this.rpcManager),this.aiClientFactory=new Xe(this.rpcManager,this.socketManager),this._connectionDetails=new Wa(this.clientIdService,this.socketManager)}static getInstance(e){const t=S(e);let r=Ja.squidInstancesMap[t];return r||(r=new Ja(e),Ja.squidInstancesMap[t]=r,r)}static getInstances(){return Object.values(Ja.squidInstancesMap)}validateNotDestructed(){m(!this.destructManager.isDestructing,"The client was already destructed.")}}Ja.squidInstancesMap={}})();var a=s.Jk,c=s.hx,u=s.my,l=s.g6,f=s.jP,h=s.zk,d=s.VE;export{a as Changes,c as CollectionReference,u as DocumentReference,l as GraphQLClient,f as JoinQueryBuilder,h as QueryBuilder,d as Squid};
12
+ `})).data}}class Ta{constructor(e){this.rpcManager=e,this.clientsMap=new Map}get(e){let t=this.clientsMap.get(e);return t||(t=new Oa(this.rpcManager,e),this.clientsMap.set(e,t),t)}}class Ia{constructor(e,t,r){this.rpcManager=e,this.lockManager=t,this.querySubscriptionManager=r}async sendMutations(e,t){const r=K(e),n=r.map((e=>`sendMutation_${V(e.squidDocIdObj)}`));await this.lockManager.lock(...n),await this.querySubscriptionManager.waitForAllQueriesToFinish();try{const e={mutations:r,integrationId:t};return await this.rpcManager.post("mutation/mutate",e)}finally{this.lockManager.release(...n)}}}class ka{constructor(e,t){this.rpcManager=e,this.socketManager=t,this.ongoingNamedQueryExecutions={},t.observeNotifications().pipe((0,U.filter)((e=>"namedQuery"===e.type)),Ve((e=>e))).subscribe((e=>{this.handleNamedQueryResponse(e.clientRequestId,e.payload)}))}executeNamedQueryAndSubscribe(e,t,r){const n=ie(),i=new U.Subject;this.ongoingNamedQueryExecutions[n]=i;const o={integrationId:e,queryName:t,paramsRecordStr:O(r),clientRequestId:n};return this.rpcManager.post("named-query/execute",o).catch((r=>{console.error("Got error while executing named query",t,"for integration",e,r),i.error(r),i.complete()})),i.pipe((0,U.finalize)((()=>{delete this.ongoingNamedQueryExecutions[n]})),(0,U.share)())}handleNamedQueryResponse(e,t){const r=this.ongoingNamedQueryExecutions[e];if(!r)return;const n=T(t);n.success?r.next(n.result):(r.error(new Error(n.result)),r.complete())}}function Na(e,t){return ae((function(r,n){var i=0;r.subscribe(Fe(n,(function(r){return e.call(t,r,i++)&&n.next(r)})))}))}var Da;function Aa(e){return[Da.SET_PATH,Da.DELETE_PATH].includes(e.type)}function Ra(e){return e.type===Da.BATCH_ACTION}function xa(e){const t=[];if(Aa(e))t.push(e);else if(Ra(e))for(const r of e.payload)t.push(...xa(r));return t}function Pa(e,t){return Ca(e,t)}function $a(e){return"object"==typeof e}function Ca(e,t){let r=e;if(Aa(t))r=function(e,t,r=[]){switch(t.type){case Da.DELETE_PATH:return ja(e,t.path);case Da.SET_PATH:const n=t;return function(e,t,r,n){return Ma(e,t,r,n)}(e,t.path,r,n.payload);case Da.BATCH_ACTION:throw new Error("Unsupported")}}(e,t,[]);else{if(!Ra(t))throw new Error(`Invalid action type: ${t.type}`);r=t.payload.reduce(((e,t)=>Ca(e,t)),e)}return r}function ja(e,t){if(!t.length)throw new Error("can not delete an empty path");const r=t[0];if(1===t.length)return function(e,t){if(e instanceof Array)throw new Error("Cannot remove an item from an array");const r=Object.assign({},e);return delete r[t],r}(e,r);const n=t.slice(1),i=qa(e,r);if(!i)return e;if(!$a(i))throw new Error("Cannot delete from a non object state.");const o=ja(i,n);return o===i?e:Fa(e,r,o)}function Ma(e,t,r,n){if(!t.length){if($a(n))return n;throw new Error("Relative path cannot be of length 0 when the new value is not an object.")}const i=t[0],o=[...r,i];if(1===t.length)return Fa(e,i,n);const s=t.slice(1),a=qa(e,i);return void 0!==a&&$a(a)?Fa(e,i,Ma(a,s,o,n)):Ma(e=Fa(e,i,{}),t,r,n)}function Fa(e,t,r){return(e=Object.assign({},e))[t]=r,e}function qa(e,t){return e instanceof Array?e[function(e){const t=Number(e);if(isNaN(t))throw new Error(`The value is not a number: Actual: ${e}`);return Math.floor(t)}(t)]:e[t]}!function(e){e.DELETE_PATH="DELETE_PATH",e.SET_PATH="SET_PATH",e.BATCH_ACTION="BATCH_ACTION"}(Da||(Da={}));class Va{constructor(){this.root=new La}getOrCreatePathTrieNode(e,t){let r=this.root;for(const t of e)r.children.get(t)||r.children.set(t,new La),r=r.children.get(t);return void 0!==t&&(r.nodeData=t),r}getPathTrieNode(e){let t=this.root;for(const r of e){if(!t)return;t=t.children.get(r)}return t}getPathTrie(e){let t=this.root;for(const r of e){if(!t)return;t=t.children.get(r)}if(t){const e=new Va;return e.root=t,e}}iterateBfs(e){this.iterateInternal(this.root,e,[])}removeNode(e){e.length||(this.root=new La);const t=[this.root];for(const r of e){const e=t[t.length-1].children.get(r);if(!e)throw new Error("Node does not exist");t.push(e)}for(let r=t.length-1;r>0;r--){const n=t[r],i=e[r-1];if((n.nodeData||n.children.size)&&r!==t.length-1)break;t[r-1].children.delete(i)}}clearNodeData(e){const t=this.getPathTrieNode(e);t&&(t.nodeData=void 0,t.children.size||this.removeNode(e))}getNodeList(e){const t=[];let r=this.root;for(const n of e){if(!r)return t;t.push(r),r=r.children.get(n)}return t}iterateInternal(e,t,r){if(!1!==t(e.nodeData,r))for(const[n,i]of e.children)this.iterateInternal(i,t,r.concat(n))}}class La{constructor(){this.children=new Map([])}}class Ua{constructor(){this.subscriptionsTree=new Va,this.state={},this.batchCount=0,this.batchedActions=[]}dispatch(e){this.batchCount>0&&this.batchedActions.push(e),this.state=Pa(this.state,e),0===this.batchCount&&this.dispatchSubscriptions(e)}runInBatch(e){this.batchCount++;try{e()}finally{if(this.batchCount--,0===this.batchCount&&this.batchedActions.length){const e={type:Da.BATCH_ACTION,payload:[...this.batchedActions]};this.batchedActions.splice(0),this.dispatch(e)}}}observePath(e,t){return new U.Observable((r=>{const n=this.getOrCreateSubjectForPath(e);r.next(this.getStateInPath(e));const i=n.pipe(Na((e=>{if(!t)return!0;const r=new Va,n=t();for(const e of n)r.getOrCreatePathTrieNode(e,!0);const i=xa(e.action).map((e=>e.path));let o=!1;for(const e of i)if(0===r.getNodeList(e).length){o=!0;break}return o})),Ve((e=>e.data))).subscribe(r);return()=>{i.unsubscribe(),n.observed||(n.complete(),this.subscriptionsTree.clearNodeData(e))}}))}setKeyInPath(e,t,r,n=!1){this.setInPath([...e,t],r,n)}setPartial(e,t,r=!1){let n=this.getStateInPath(e);n||(n={}),this.setInPath(e,Object.assign(Object.assign({},n),t),r)}setInPath(e,t,r=!1){if(r&&this.getStateInPath(e)===t)return;const n={type:Da.SET_PATH,path:e,payload:t};this.dispatch(n)}pushToArray(e,t){let r=this.getStateInPath(e);r=r?[...r]:[],r.push(t),this.setInPath(e,r)}deletePath(e){const t={type:Da.DELETE_PATH,path:e};this.dispatch(t)}getState(){return this.state}getStateInPath(e){return Qa(this.state,e)}destroy(){this.subscriptionsTree.iterateBfs((e=>{e&&e.subject&&e.subject.complete()}))}getOrCreateSubjectForPath(e){const t=this.subscriptionsTree.getOrCreatePathTrieNode(e);t.nodeData||(t.nodeData=new Ba);const r=t.nodeData;return r.subject||(r.subject=new U.Subject),r.subject}dispatchSubscriptions(e){const t=function(e,t){const r=new Va;for(const n of xa(e)){let e=r.getOrCreatePathTrieNode(n.path);if(!t||e.nodeData)continue;let i=t.getPathTrieNode(n.path);if(i){const t=[[e,i]];for(;t.length;){const r=t.shift();if(e=r[0],i=r[1],!e.nodeData){for(const[r,n]of i.children)e.children.get(r)||e.children.set(r,new La),t.push([e.children.get(r),n]);e.nodeData=!0}}}}return r}(e,this.subscriptionsTree);t.iterateBfs(((t,r)=>{const n=this.subscriptionsTree.getPathTrieNode(r);n&&n.nodeData&&n.nodeData.subject.next({action:e,data:Qa(this.getState(),r)})}))}}function Qa(e,t){let r=e;for(const e of t){if(null==r)return;if(!$a(r))throw new Error("result must be a state object");r=r[e]}return r}class Ba{}const za="client";class Ya{constructor(e,t,r,n,i){this.rpcManager=e,this.clientIdService=t,this.documentStore=r,this.destructManager=n,this.documentIdentityService=i,this.safeToSendQueriesToServer=new U.BehaviorSubject(!0),this.onOrphanDocuments=new U.Subject,this.ongoingQueries=new Map,this.inflightQueriesCount=new U.BehaviorSubject(0),this.clientRequestIdToLocalDocuments=new Map,this.localDocumentToClientRequestIds=new Map,this.queryMappingManager=new Ka,this.documentIdentityService.observeChanges().subscribe(this.migrateDocIds.bind(this)),this.clientIdService.observeClientReadyToBeRegenerated().subscribe((()=>{this.refreshOngoingQueries()})),this.destructManager.onPreDestruct((()=>{this.predestruct()}))}hasOngoingQuery(e){return this.ongoingQueries.has(e)}getQuery(e){return y(this.ongoingQueries.get(e),"UNKNOWN_QUERY").query}setGotInitialResult(e){const t=y(this.ongoingQueries.get(e));t.gotInitialResponse?this.removeClientRequestIdMapping(e):t.gotInitialResponse=!0}findQueriesForDocument(e,t){const{collectionName:r,integrationId:n}=q(t),i=this.queryMappingManager.getMapping(za,r,n);return i?A(i,e):[]}setClientRequestIdsForLocalDoc(e,t){const r=this.localDocumentToClientRequestIds.get(e)||new Set,n=new Set(t?this.findQueriesForDocument(t,e).map((e=>function(e){const t=e.split("_");return{clientId:t[0],clientRequestId:t[1]}}(e).clientRequestId)):[]),i=new Set([...r,...n]);for(const t of[...r]){if(n.has(t))continue;r.delete(t);const i=this.clientRequestIdToLocalDocuments.get(t);i&&(i.delete(e),i.size||this.clientRequestIdToLocalDocuments.delete(t)),r.size||this.localDocumentToClientRequestIds.delete(e)}for(const t of n){let r=this.localDocumentToClientRequestIds.get(e);r||(r=new Set,this.localDocumentToClientRequestIds.set(e,r)),r.add(t);let n=this.clientRequestIdToLocalDocuments.get(t);n||(n=new Set,this.clientRequestIdToLocalDocuments.set(t,n)),n.add(e)}return[...i]}errorOutAllQueries(e,t){const r=this.localDocumentToClientRequestIds.get(e)||new Set;for(const e of r){const r=this.ongoingQueries.get(e);r&&(r.dataSubject.error(t),r.done=!0)}}notifyAllSubscriptions(e){const t=new Set;for(const r of e){const e=this.ongoingQueries.get(r);if(!e)continue;if(!e.gotInitialResponse||!e.activated)continue;const n=this.clientRequestIdToLocalDocuments.get(r),i=this.documentStore.sortAndLimitDocs(n,e.query),o=e.supportedQueries.map((e=>this.updateOngoingQueryWithNewDataFromSupportingQuery(i,e))).some(Boolean);let s=e;for(;!s.allObservables;)s=y(null==s?void 0:s.supportingOngoingQuery);o&&t.add(s),e.dataSubject.next(i)}for(const e of t){const t=this.collectAllObservables(e);y(e.allObservables).next(t)}}findValidParentQuery(e){if(e.forceFetchFromServer)return;const t=new C(e.query);for(const r of this.ongoingQueries.values())if(e!==r&&r.activated&&!r.isInFlight&&!r.isEmptyForJoin&&!r.done&&r.subscribe&&t.isSubqueryOfQuery(r.query))return r}processQuery(e,t,r,n,i,o){return(0,U.defer)((()=>{const s=this.createOngoingQueryGraph(e,t,r,n,i,!0);o&&(s.forceFetchFromServer=!0),this.sendQueryToServerOrUseParentQuery(s),s.allObservables=new U.ReplaySubject(1);const a=s.allObservables.pipe((0,U.switchMap)((e=>(0,U.combineLatest)(e).pipe(Ve((e=>this.joinResults(e,n,s)))))),Na((()=>this.allOngoingQueriesGotInitialResult(s))),(0,U.startWith)(void 0),(0,U.pairwise)(),Na((([e,t])=>!l.isEqual(e,t))),Ve((([e,t])=>t)),i?(0,U.tap)():(0,U.take)(1),(0,U.finalize)((()=>{var e;s.dataSubject.complete(),s.done=!0,this.completeAllSupportedQueries(s).then(),null===(e=s.allObservables)||void 0===e||e.complete()}))),c=this.collectAllObservables(s);return s.allObservables.next(c),a})).pipe((0,U.share)())}hasOngoingQueryForDocId(e){const t=this.localDocumentToClientRequestIds.get(e);return!!t&&!!t.size}removeClientRequestIdMapping(e){const t=this.clientRequestIdToLocalDocuments.get(e);if(!t)return;this.clientRequestIdToLocalDocuments.delete(e);const r=[];for(const n of t){const t=y(this.localDocumentToClientRequestIds.get(n));t.delete(e),t.size||(this.localDocumentToClientRequestIds.delete(n),r.push(n))}r.length&&this.onOrphanDocuments.next(r)}async waitForAllQueriesToFinish(){return(0,U.firstValueFrom)(this.inflightQueriesCount.pipe(Na((e=>0===e)))).then((()=>{}))}registerQueryFinalizer(e){const t=e.clientRequestId,r=P(this.clientIdService.getClientId(),t);e.dataSubject.pipe((0,U.finalize)((async()=>{if(e.unsubscribeBlockerCount.value>0&&await(0,U.firstValueFrom)((0,U.race)(this.destructManager.observeIsDestructing(),e.unsubscribeBlockerCount.pipe(Na((e=>0===e))))),this.queryMappingManager.removeQuery(t,r).then(),this.ongoingQueries.delete(t),e.subscribe&&!e.isEmptyForJoin&&e.activated){const r={clientRequestId:t};this.rpcManager.post("query/unsubscribe",r).catch((t=>{console.error("Got error while unsubscribing from query",e.query,t)}))}this.removeClientRequestIdMapping(t),this.ongoingQueries.delete(t)}))).subscribe({error:()=>{}})}createOngoingQueryGraph(e,t,r,n,i,o,s={}){if(s[t])return s[t];const a=ie(),c=[],u={clientRequestId:a,activated:o,alias:t,query:e,subscribe:i,dataSubject:new U.ReplaySubject(1),supportedQueries:c,supportingOngoingQuery:void 0,joinCondition:void 0,gotInitialResponse:!1,isEmptyForJoin:!1,unsubscribeBlockerCount:new U.BehaviorSubject(0),queryRegistered:new U.BehaviorSubject(!1),done:!1,isInFlight:!1,forceFetchFromServer:!1};this.registerQueryFinalizer(u),this.ongoingQueries.set(a,u),s[t]=u;for(const[e,o]of Object.entries(n)){const a=o.leftAlias;if(a!==t&&e!==t)continue;const l=a===t?e:a;if(a===t){const e=this.createOngoingQueryGraph(r[l],l,r,n,i,!1,s);e.joinCondition=o,c.push(e)}else u.supportingOngoingQuery=this.createOngoingQueryGraph(r[l],l,r,n,i,!1,s)}return u}collectAllObservables(e,t=[]){if(e.isEmptyForJoin)return t;const r=e.alias;t.push(e.dataSubject.pipe(Ve((e=>({docs:e,alias:r})))));for(const r of e.supportedQueries)this.collectAllObservables(r,t);return t}joinResults(e,t,r){const n=[],i=e.reduce(((e,t)=>(e[t.alias]?e[t.alias].push(...t.docs):e[t.alias]=[...t.docs],e)),{});i[r.alias].forEach((e=>{n.push({[r.alias]:e})}));const o=this.getOngoingQueriesBfs(r),s=new Set;for(let e=1;e<o.length;e++){const r=o[e].alias;s.has(r)||(s.add(r),this.join(n,r,i[r],t))}return n}join(e,t,r,n){var i;if(!e.length)return;const o=Object.keys(e[0]),s=n[t];if(!s||!o.includes(s.leftAlias))throw new Error("No join condition found for alias "+t);const a=new Map;(r||[]).forEach((e=>{const t=e[s.right];a.has(t)||a.set(t,[]),y(a.get(t)).push(e)}));for(const r of[...e]){const n=a.get(null===(i=r[s.leftAlias])||void 0===i?void 0:i[s.left])||[];if(n.length)for(const i of n)r[t]?e.push(Object.assign(Object.assign({},r),{[t]:i})):r[t]=i;else r[t]||(r[t]=void 0)}}getOngoingQueriesBfs(e){const t=[],r=[e];for(;r.length;){const e=y(r.shift());e.isEmptyForJoin||(t.push(e),r.push(...e.supportedQueries))}return t}updateOngoingQueryWithNewDataFromSupportingQuery(e,t){var r;const n=y(t.joinCondition),i=t.query;if(t.activated){const o=y(null===(r=t.supportingOngoingQuery)||void 0===r?void 0:r.supportedQueries).filter((e=>e.alias===t.alias)),s=new Set(e.map((e=>{var t;return null!==(t=e[n.left])&&void 0!==t?t:null})));for(const e of o)e.query.conditions.filter((e=>e.fieldName===n.right)).forEach((e=>{s.delete(e.value)}));if(0===s.size)return!1;const a=l.cloneDeep(i);a.conditions=a.conditions.filter((e=>e.fieldName!==n.right)),[...s].forEach((e=>{a.conditions.push({fieldName:n.right,operator:"==",value:e})}));const c=Object.assign(Object.assign({},t),{query:a,activated:!0,gotInitialResponse:!1,dataSubject:new U.ReplaySubject(1),clientRequestId:ie(),isEmptyForJoin:!1});return this.registerQueryFinalizer(c),this.ongoingQueries.set(c.clientRequestId,c),y(t.supportingOngoingQuery).supportedQueries.push(c),this.sendQueryToServerOrUseParentQuery(c),!0}{const r=e.map((e=>{var t;return{fieldName:n.right,operator:"==",value:null!==(t=e[n.left])&&void 0!==t?t:null}}));return t.activated=!0,r.length?(i.conditions.push(...r),this.sendQueryToServerOrUseParentQuery(t)):t.isEmptyForJoin=!0,!0}}allOngoingQueriesGotInitialResult(e){return!!e.isEmptyForJoin||!!e.gotInitialResponse&&(!e.supportedQueries.length||e.supportedQueries.every((e=>this.allOngoingQueriesGotInitialResult(e))))}async completeAllSupportedQueries(e){const t=[...e.supportedQueries||[]];for(;t.length;){const e=y(t.shift());t.push(...e.supportedQueries||[]),await(0,U.firstValueFrom)(e.unsubscribeBlockerCount.pipe(Na((e=>0===e)))),e.dataSubject.complete()}}predestruct(){this.safeToSendQueriesToServer.next(!1),this.safeToSendQueriesToServer.complete(),this.unsubscribe()}unsubscribe(){var e;const t=[...this.ongoingQueries.values()];for(const r of t)r.dataSubject.complete(),null===(e=r.allObservables)||void 0===e||e.complete()}hasSubscription(e){var t;return!!(null===(t=this.ongoingQueries.get(e))||void 0===t?void 0:t.subscribe)}sendQueryToServerOrUseParentQuery(e){if(this.destructManager.isDestructing)return;const t=e.query,r=e.clientRequestId,n=P(this.clientIdService.getClientId(),r);this.queryMappingManager.addQuery(za,t,n).then(),this.ongoingQueries.set(r,e);const i=this.findValidParentQuery(e);i?this.useParentOngoingQuery(e,i).then():this.sendQueryToServer(e)}async useParentOngoingQuery(e,t){const r={clientRequestId:e.clientRequestId,query:e.query,parentClientRequestId:t.clientRequestId},n=new C(e.query);t.unsubscribeBlockerCount.next(t.unsubscribeBlockerCount.value+1);try{await(0,U.firstValueFrom)(t.queryRegistered.pipe(Na(Boolean)))}catch(t){return e.dataSubject.error(t),e.queryRegistered.error(t),void(e.done=!0)}if(this.destructManager.isDestructing)return;if(e.done)return;this.rpcManager.post("query/register",r).then((()=>{e.queryRegistered.next(!0)})).catch((r=>{console.error("Query error",e.query,t.query,r),e.dataSubject.error(r),e.done=!0})).finally((()=>{t.unsubscribeBlockerCount.next(t.unsubscribeBlockerCount.value-1),e.isInFlight=!1}));const i=(0,U.race)(e.queryRegistered.pipe(Na(Boolean),(0,U.delay)(2e3),(0,U.take)(1)),this.destructManager.observeIsDestructing().pipe((0,U.take)(1)));t.dataSubject.pipe((0,U.takeWhile)((()=>!e.done)),(0,U.takeUntil)(i),(0,U.tap)((()=>{e.gotInitialResponse||this.setGotInitialResult(e.clientRequestId)})),Ve((e=>e.filter((e=>n.documentMatchesQuery(e)))))).subscribe({next:t=>{for(const r of t)this.setClientRequestIdsForLocalDoc(V(r.__docId__,e.query.collectionName,e.query.integrationId),r);this.notifyAllSubscriptions([e.clientRequestId])},error:t=>e.dataSubject.error(t)})}sendQueryToServer(e){const t={query:e.query,clientRequestId:e.clientRequestId,subscribe:e.subscribe};this.safeToSendQueriesToServer.pipe(Na(Boolean),(0,U.take)(1)).subscribe((()=>{e.done||(this.inflightQueriesCount.next(this.inflightQueriesCount.value+1),e.isInFlight=!0,this.rpcManager.post("query/query",t).catch((t=>{e.dataSubject.error(t),e.done=!0,e.queryRegistered.error("query failed")})).then((()=>{e.queryRegistered.next(!0)})).finally((()=>{this.inflightQueriesCount.next(this.inflightQueriesCount.value-1),e.isInFlight=!1})))}))}refreshOngoingQueries(){for(const e of this.ongoingQueries.values())this.sendQueryToServerOrUseParentQuery(e)}migrateDocIds(e){const t=Object.keys(e);for(const r of this.clientRequestIdToLocalDocuments.values())t.forEach((t=>{r.has(t)&&(r.delete(t),r.add(e[t]))}));t.forEach((t=>{w(this.localDocumentToClientRequestIds,t,e[t])}))}}class Ka extends D{constructor(){super(...arguments),this.stateService=new Ua,this.querySubscriptionIdToQuery={}}async addQuery(e,t,r){this.stateService.runInBatch((()=>{let e=0;const n=new Set;for(const i of t.conditions){const o=this.getConditionStatePath(t,i),s=[...this.stateService.getStateInPath(o)||[]];if(ee(s,r),["==","!="].includes(i.operator)){const t=I(i.fieldName);n.has(t)||(e++,n.add(t))}else e++;this.stateService.setInPath(o,s)}if(!t.conditions.length){const e=["queryMapping",t.collectionName,t.integrationId,"mapping","unconditional"],n=[...this.stateService.getStateInPath(e)||[]];ee(n,r),this.stateService.setInPath(e,n)}this.stateService.setInPath([...this.getQueryMetadataStatePath(t,r),"condCount"],e)})),this.querySubscriptionIdToQuery[r]=t}async removeQuery(e,t){const r=this.querySubscriptionIdToQuery[t];if(r)return this.stateService.runInBatch((()=>{for(const e of r.conditions){const n=this.getConditionStatePath(r,e),i=[...this.stateService.getStateInPath(n)||[]];te(i,t),i.length?this.stateService.setInPath(n,i):this.stateService.deletePath(n)}if(!r.conditions.length){const e=["queryMapping",r.collectionName,r.integrationId,"mapping","unconditional"],n=[...this.stateService.getStateInPath(e)||[]];te(n,t),this.stateService.setInPath(e,n)}this.stateService.deletePath(this.getQueryMetadataStatePath(r,t))})),r}getMapping(e,t,r){return this.stateService.getStateInPath(["queryMapping",t,r,"mapping"])}removeLocalDevAppData(e){return Promise.resolve(void 0)}getQueryMetadataStatePath(e,t){return["queryMapping",e.collectionName,e.integrationId,"mapping","queriesMetadata",`${t}`]}getConditionStatePath(e,t){const r=I(t.fieldName),n=I(t.value);return["queryMapping",e.collectionName,e.integrationId,"mapping","conditional",`${r}`,`${t.operator}`,`${n}`]}}class Ha{constructor(e,t,r,n={},i,o){this.rpcEndpoint=e,this.socketManager=t,this.destructManager=r,this.headers=n,this.authManager=i,this.clientIdService=o,this.staticHeaders={},this.onGoingRpcCounter=new U.BehaviorSubject(0),m(e,"Http endpoint must be provided.");for(const[e,t]of Object.entries(n))this.setStaticHeader(e,t);const s=this.authManager.getApiKey();s&&this.setStaticHeader("Authorization",`ApiKey ${s}`),this.clientIdService.observeClientId().subscribe((e=>{e?this.setStaticHeader("x-squid-clientid",e):this.deleteStaticHeader("x-squid-clientid")})),this.rpcEndpoint.endsWith("/")||(this.rpcEndpoint+="/"),this.authManager.observeAuthIdToken().subscribe((e=>{if(e.token){let t=`Bearer ${e.token}`;e.integrationId&&(t+=`; IntegrationId ${e.integrationId}`),this.setStaticHeader("Authorization",t)}else this.deleteStaticHeader("Authorization")})),r.onDestruct((async()=>{await this.awaitAllSettled()}))}async awaitAllSettled(){await(0,U.firstValueFrom)(this.onGoingRpcCounter.pipe((0,U.filter)((e=>0===e))))}setStaticHeader(e,t){this.staticHeaders[e]=t}deleteStaticHeader(e){delete this.staticHeaders[e]}getEndpoint(){return this.rpcEndpoint}getStaticHeaders(){return this.staticHeaders}async post(e,t){this.onGoingRpcCounter.next(this.onGoingRpcCounter.value+1);try{await(0,U.firstValueFrom)((0,U.race)(this.socketManager.observeConnectionReady().pipe((0,U.filter)(Boolean)),this.destructManager.observeIsDestructing())),await this.authManager.waitForReadyState();let r={"Content-Type":"application/json"};Object.keys(this.staticHeaders)&&(r=Object.assign(Object.assign({},r),this.staticHeaders));const n=await(0,Sa.default)(`${this.rpcEndpoint}${e}`,{method:"POST",body:O(t),headers:r});let i,o;try{i=await n.text();try{o=JSON.parse(i)}catch(e){}}catch(e){i="Cannot read body"}if(!n.ok)throw new Ga(n.status,n.statusText,n.headers,n.url,null==o?void 0:o.message);return o||i}finally{this.onGoingRpcCounter.next(this.onGoingRpcCounter.value-1)}}}class Ga extends Error{constructor(e,t,r,n,i){super(i||`RPC error ${e} ${t} calling ${n}`),this.statusCode=e,this.statusText=t,this.headers=r,this.url=n}}const Wa=(e=>{var t={};return o.d(t,e),t})({io:()=>r.io}),Ja=e=>e();class Za{constructor(e,t,r=Ja,n,i={},o){this.clientIdService=e,this.socketIoEndpoint=t,this.messageNotificationWrapper=r,this.destructManager=n,this.authManager=o,this.webSocketObserver=new U.Subject,this.allMessagesObserver=new U.Subject,this.connectionReady=new U.BehaviorSubject(!1),this.seenMessageIds=new Set,this.firstConnection=!0,this.clientTooOldThreshold=3e5,this.destructManager.onDestruct((async()=>{await this.destruct()})),this.setupMessageAcknowledgments(),this.connect(Object.assign({},i)),this.connectionReady.pipe((0,U.skip)(1),(0,U.filter)((e=>!e)),(0,U.switchMap)((()=>(0,U.race)((0,U.timer)(this.clientTooOldThreshold),this.connectionReady.pipe((0,U.filter)(Boolean)),this.destructManager.observeIsDestructing())))).subscribe((()=>{this.connectionReady.value||this.destructManager.isDestructing||(this.clientIdService.notifyClientTooOld(),this.connect(Object.assign({},i)))})),this.connectionReady.pipe((0,U.filter)(Boolean)).subscribe((()=>{this.clientIdService.isClientTooOld()&&this.clientIdService.notifyClientReadyToBeRegenerated()}))}observeNotifications(){return this.webSocketObserver.asObservable()}observeConnectionReady(){return this.connectionReady.asObservable().pipe((0,U.distinctUntilChanged)())}sendMessage(e){this.authManager.waitForReadyState().then((()=>{(0,U.firstValueFrom)(this.connectionReady.pipe((0,U.filter)(Boolean))).then((()=>{const t=this.authManager.getAuthToken();y(this.socket).emit("message",Object.assign(Object.assign({},e),{authToken:t}))}))}))}connect(e){const t={clientId:this.clientIdService.getClientId()};this.socket=(0,Wa.io)(this.socketIoEndpoint,{query:t,reconnectionDelay:5e3,transports:["websocket"],extraHeaders:e}),this.socket.on("connect",(()=>{})),this.socket.on("disconnect",((e,t)=>{this.connectionReady.next(!1)})),this.socket.on("connectionReady",(()=>{this.connectionReady.next(!0),this.firstConnection||this.sendMessage({type:"catchup"}),this.firstConnection=!1})),this.socket.on("message",(e=>{const t=T(e);for(const e of t)this.allMessagesObserver.next(e),this.seenMessageIds.has(e.messageId)||(this.seenMessageIds.add(e.messageId),this.messageNotificationWrapper((()=>{this.webSocketObserver.next(e)})))}))}setupMessageAcknowledgments(){const e=new U.Subject;this.allMessagesObserver.subscribe((t=>{(null==t?void 0:t.messageId)&&e.next(t.messageId)}));const t=[];e.pipe((0,U.tap)((e=>t.push(e))),(0,U.debounceTime)(100)).subscribe((async()=>{const e=[...t.splice(0)];this.sendMessage({type:"acknowledge",payload:e})}))}async destruct(){var e;this.sendMessage({type:"kill"}),this.connectionReady.next(!1),await(0,U.firstValueFrom)((0,U.timer)(0)),null===(e=this.socket)||void 0===e||e.disconnect(),this.webSocketObserver.complete(),this.allMessagesObserver.complete()}}class Xa{constructor(e,t){this.clientIdService=e,this.socketManager=t,this.isConnected=!1,this.socketManager.observeConnectionReady().subscribe((e=>{this.isConnected=e}))}get connected(){return this.isConnected}get clientId(){return this.clientIdService.getClientId()}observeConnected(){return this.socketManager.observeConnectionReady()}}class ec{constructor(e){this.destructManager=new ft,this.setAuthIdToken=(e,t)=>{this.authManager.setAuthIdToken(e,t)},this.collection=(e,t=i.built_in_db)=>(this.validateNotDestructed(),this.collectionReferenceFactory.get(e,t)),this.runInTransaction=e=>(this.validateNotDestructed(),this.dataManager.runInTransaction(e)),this.executeFunction=(e,...t)=>(this.validateNotDestructed(),(0,U.firstValueFrom)(this.backendFunctionManager.executeFunctionAndSubscribe(e,...t))),this.executeNamedQuery=(e,t,r)=>(this.validateNotDestructed(),(0,U.firstValueFrom)(this.namedQueryManager.executeNamedQueryAndSubscribe(e,t,r))),this.callApi=(e,t,r={})=>(this.validateNotDestructed(),(0,U.firstValueFrom)(this.apiManager.callApiAndSubscribe(e,t,r))),this.graphql=e=>(this.validateNotDestructed(),this.graphqlClientFactory.get(e)),this.ai=()=>(this.validateNotDestructed(),{assistant:e=>this.aiClientFactory.getAssistant(e)}),this.acquireLock=(e,t=!0)=>(this.validateNotDestructed(),this.distributedLockManager.lock(e,t)),this.destruct=async()=>{if(!this.destructManager.isDestructing)return this.destructManager.destruct().finally((()=>{const e=Object.entries(ec.squidInstancesMap).find((([,e])=>e===this));e&&delete ec.squidInstancesMap[e[0]]}))},this.connectionDetails=()=>(this.validateNotDestructed(),this._connectionDetails),this.unsubscribe=async()=>{this.querySubscriptionManager.unsubscribe(),await this.rpcManager.awaitAllSettled()},m(e.appId,"APP_ID_MUST_BE_PROVIDED");const t="prod"!==e.environmentId&&e.squidDeveloperId,r=function(e,t,r){return`${M(e,t)}${r?`-${r}`:""}`}(e.appId,e.environmentId,t?e.squidDeveloperId:void 0),n=function(e,t){const r=new URL("https://squid.cloud");r.host=`${t}.${e}.${r.host}`,ne(e)&&(r.protocol="http",r.port="8000",function(e){return/android$/.test(e)}(e)?r.host="10.0.2.2":function(e){return/ios$/.test(e)}(e)&&(r.host="localhost"));const n=r.toString();return n.endsWith("/")?n:n+"/"}(e.region,r),o=function(e,t){const r={};return ne(e)&&(r["x-squid-appid"]=t),r}(e.region,r);this.clientIdService=new st(this.destructManager),this.authManager=new it(this.destructManager,e.apiKey),this.socketManager=new Za(this.clientIdService,n,e.messageNotificationWrapper,this.destructManager,o,this.authManager),this.rpcManager=new Ha(n,this.socketManager,this.destructManager,o,this.authManager,this.clientIdService),this.documentStore=new yt,this.lockManager=new oe,this.distributedLockManager=new ht(this.socketManager,this.destructManager),this.documentIdentityService=new pt(this.documentStore,this.destructManager),this.documentReferenceFactory=new mt(this.documentIdentityService),this.querySubscriptionManager=new Ya(this.rpcManager,this.clientIdService,this.documentStore,this.destructManager,this.documentIdentityService);const s=new Ia(this.rpcManager,this.lockManager,this.querySubscriptionManager);this.queryBuilderFactory=new He(this.querySubscriptionManager,this.documentReferenceFactory,this.documentIdentityService),this.collectionReferenceFactory=new at(this.documentReferenceFactory,this.queryBuilderFactory,this.querySubscriptionManager),this.dataManager=new lt(this.documentStore,s,this.socketManager,this.querySubscriptionManager,this.queryBuilderFactory,this.lockManager,this.destructManager,this.documentIdentityService),this.documentReferenceFactory.setDataManager(this.dataManager),this.backendFunctionManager=new ot(this.clientIdService,this.rpcManager,this.socketManager),this.namedQueryManager=new ka(this.rpcManager,this.socketManager),this.apiManager=new nt(this.clientIdService,this.rpcManager,this.socketManager,e.apiServerUrlOverrideMapping),this.graphqlClientFactory=new Ta(this.rpcManager),this.aiClientFactory=new rt(this.rpcManager,this.socketManager),this._connectionDetails=new Xa(this.clientIdService,this.socketManager)}static getInstance(e){const t=S(e);let r=ec.squidInstancesMap[t];return r||(r=new ec(e),ec.squidInstancesMap[t]=r,r)}static getInstances(){return Object.values(ec.squidInstancesMap)}validateNotDestructed(){m(!this.destructManager.isDestructing,"The client was already destructed.")}}ec.squidInstancesMap={}})();var a=s.Jk,c=s.hx,u=s.my,l=s.g6,f=s.jP,h=s.zk,d=s.VE;export{a as Changes,c as CollectionReference,u as DocumentReference,l as GraphQLClient,f as JoinQueryBuilder,h as QueryBuilder,d as Squid};