@coasys/ad4m-connect 0.10.1-rc8 → 0.10.1-rc9-dev
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/core.js +16 -8
- package/dist/utils.js +1 -1
- package/dist/web.js +31 -23
- package/package.json +1 -1
package/dist/web.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var u1=Object.defineProperty;var l1=Object.getOwnPropertyDescriptor;var ve=(t,e,r,n)=>{for(var i=n>1?void 0:n?l1(e,r):e,a=t.length-1,o;a>=0;a--)(o=t[a])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&u1(e,r,i),i};var pe=(t,e,r)=>new Promise((n,i)=>{var a=u=>{try{s(r.next(u))}catch(c){i(c)}},o=u=>{try{s(r.throw(u))}catch(c){i(c)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(a,o);s((r=r.apply(t,e)).next())});import{ZBarSymbolType as re,ZBarConfigType as Pl,scanRGBABuffer as f1,getDefaultScanner as p1}from"https://cdn.jsdelivr.net/npm/@undecaf/zbar-wasm@0.9.15/dist/main.js";function d1(t,e,r,n){return new(r||(r=Promise))(function(i,a){function o(c){try{u(n.next(c))}catch(l){a(l)}}function s(c){try{u(n.throw(c))}catch(l){a(l)}}function u(c){var l;c.done?i(c.value):(l=c.value,l instanceof r?l:new r(function(d){d(l)})).then(o,s)}u((n=n.apply(t,e||[])).next())})}var R=class{constructor(e,r=Pl.ZBAR_CFG_ENABLE,n=1){this.symbolType=e,this.configType=r,this.number=n,this.configSteps=[this]}static register(e,r,n=r.symbolType){return R.formatsToConfigs[e]=r,R.typesToFormats[n]=R.typesToFormats[n]||e,r}static formats(){return Object.keys(R.formatsToConfigs)}static toFormat(e){return R.typesToFormats[e]}static configure(e,r){var n;(n=R.formatsToConfigs[r])===null||n===void 0||n.configSteps.forEach(i=>e.setConfig(i.symbolType,i.configType,i.number))}add(e){return this.configSteps.push(e),this}},Rl;R.formatsToConfigs={},R.typesToFormats={},R.register("codabar",new R(re.ZBAR_CODABAR)),R.register("code_39",new R(re.ZBAR_CODE39)),R.register("code_93",new R(re.ZBAR_CODE93)),R.register("code_128",new R(re.ZBAR_CODE128)),R.register("databar",new R(re.ZBAR_DATABAR)),R.register("databar_exp",new R(re.ZBAR_DATABAR_EXP)),R.register("ean_2",new R(re.ZBAR_EAN2)),R.register("ean_5",new R(re.ZBAR_EAN5)),R.register("ean_8",new R(re.ZBAR_EAN8)),R.register("ean_13",new R(re.ZBAR_EAN13)),R.register("ean_13+2",new R(re.ZBAR_EAN13)).add(new R(re.ZBAR_EAN2)),R.register("ean_13+5",new R(re.ZBAR_EAN13)).add(new R(re.ZBAR_EAN5)),R.register("isbn_10",new R(re.ZBAR_ISBN10)).add(new R(re.ZBAR_EAN13)),R.register("isbn_13",new R(re.ZBAR_ISBN13)).add(new R(re.ZBAR_EAN13)),R.register("isbn_13+2",new R(re.ZBAR_ISBN13)).add(new R(re.ZBAR_EAN13)).add(new R(re.ZBAR_EAN2)),R.register("isbn_13+5",new R(re.ZBAR_ISBN13)).add(new R(re.ZBAR_EAN13)).add(new R(re.ZBAR_EAN5)),R.register("itf",new R(re.ZBAR_I25)),R.register("qr_code",new R(re.ZBAR_QRCODE)),R.register("sq_code",new R(re.ZBAR_SQCODE)),R.register("upc_a",new R(re.ZBAR_UPCA)).add(new R(re.ZBAR_EAN13)),R.register("upc_e",new R(re.ZBAR_UPCE)).add(new R(re.ZBAR_EAN13)),function(t){t[t.UNKNOWN=-1]="UNKNOWN",t[t.UPRIGHT=0]="UPRIGHT",t[t.ROTATED_RIGHT=1]="ROTATED_RIGHT",t[t.UPSIDE_DOWN=2]="UPSIDE_DOWN",t[t.ROTATED_LEFT=3]="ROTATED_LEFT"}(Rl||(Rl={}));var $s=class{},h1=(()=>{try{return new OffscreenCanvas(1,1).getContext("2d")instanceof OffscreenCanvasRenderingContext2D}catch{return!1}})(),pr=class{constructor(e={}){if(e.formats!==void 0){if(!Array.isArray(e.formats)||!e.formats.length)throw new TypeError(`Barcode formats should be a non-empty array of strings but are: ${JSON.stringify(e)}`);let r=e.formats.filter(n=>!R.formats().includes(n));if(r.length)throw new TypeError(`Unsupported barcode format(s): ${r.join(", ")}`)}this.formats=e.formats||R.formats(),this.zbarConfig=e.zbar||new $s}static getSupportedFormats(){return Promise.resolve(R.formats())}detect(e){if(!pr.isImageBitmapSource(e))throw new TypeError("BarcodeDetector.detect() argument is not an ImageBitmapSource");let r=pr.intrinsicDimensions(e);if(r.width===0||r.height===0)return Promise.resolve([]);try{return Promise.all([this.toImageData(e),this.getScanner()]).then(n=>{let i=n[0],a=n[1];return this.zbarConfig.enableCache!==void 0&&a.enableCache(this.zbarConfig.enableCache),f1(i.data,i.width,i.height,a)}).then(n=>n.map(i=>this.toBarcodeDetectorResult(i)))}catch(n){return Promise.reject(n)}}getScanner(){return new Promise((e,r)=>d1(this,void 0,void 0,function*(){if(!this.scanner){let n=yield p1();this.formats.length>0&&(n.setConfig(re.ZBAR_NONE,Pl.ZBAR_CFG_ENABLE,0),this.formats.forEach(i=>R.configure(n,i))),this.scanner=n}e(this.scanner)}))}toImageData(e){let r=n=>{let i=pr.intrinsicDimensions(n);this.canvas&&this.canvas.width===i.width&&this.canvas.height===i.height||(this.canvas=function(s,u){if(h1)return new OffscreenCanvas(s,u);{let c=document.createElement("canvas");return c.width=s,c.height=u,c}}(i.width,i.height));let a=this.canvas,o=a.getContext("2d");return o.drawImage(n,0,0),o.getImageData(0,0,a.width,a.height)};if(e instanceof ImageData)return Promise.resolve(e);if(e instanceof Blob){let n=document.createElement("img");return n.src=URL.createObjectURL(e),n.decode().then(()=>r(n)).finally(()=>URL.revokeObjectURL(n.src))}return e instanceof CanvasRenderingContext2D?Promise.resolve(e.getImageData(0,0,e.canvas.width,e.canvas.height)):Promise.resolve(r(e))}toBarcodeDetectorResult(e){let r={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0};return e.points.forEach(n=>{r.minX=Math.min(r.minX,n.x),r.maxX=Math.max(r.maxX,n.x),r.minY=Math.min(r.minY,n.y),r.maxY=Math.max(r.maxY,n.y)}),{format:R.toFormat(e.type),rawValue:e.decode(this.zbarConfig.encoding),orientation:e.orientation,quality:e.quality,boundingBox:DOMRectReadOnly.fromRect({x:r.minX,y:r.minY,width:r.maxX-r.minX,height:r.maxY-r.minY}),cornerPoints:[{x:r.minX,y:r.minY},{x:r.maxX,y:r.minY},{x:r.maxX,y:r.maxY},{x:r.minX,y:r.maxY}]}}static isImageBitmapSource(e){return e instanceof HTMLImageElement||e instanceof HTMLVideoElement||e instanceof HTMLCanvasElement||e instanceof Blob||e instanceof ImageData||e instanceof CanvasRenderingContext2D||e instanceof ImageBitmap||e&&e.width==0||e&&e.height==0}static intrinsicDimensions(e){return{width:Number(e.naturalWidth||e.videoWidth||e.width),height:Number(e.naturalHeight||e.videoHeight||e.height)}}};var Va=window,za=Va.ShadowRoot&&(Va.ShadyCSS===void 0||Va.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Fs=Symbol(),Ll=new WeakMap,xi=class{constructor(e,r,n){if(this._$cssResult$=!0,n!==Fs)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o,r=this.t;if(za&&e===void 0){let n=r!==void 0&&r.length===1;n&&(e=Ll.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Ll.set(r,e))}return e}toString(){return this.cssText}},$l=t=>new xi(typeof t=="string"?t:t+"",void 0,Fs),Ms=(t,...e)=>{let r=t.length===1?t[0]:e.reduce((n,i,a)=>n+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[a+1],t[0]);return new xi(r,t,Fs)},Us=(t,e)=>{za?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{let n=document.createElement("style"),i=Va.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)})},Qa=za?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let n of e.cssRules)r+=n.cssText;return $l(r)})(t):t;var js,Ga=window,Fl=Ga.trustedTypes,m1=Fl?Fl.emptyScript:"",Ml=Ga.reactiveElementPolyfillSupport,Bs={toAttribute(t,e){switch(e){case Boolean:t=t?m1:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},Ul=(t,e)=>e!==t&&(e==e||t==t),qs={attribute:!0,type:String,converter:Bs,reflect:!1,hasChanged:Ul},Vs="finalized",Xt=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var r;this.finalize(),((r=this.h)!==null&&r!==void 0?r:this.h=[]).push(e)}static get observedAttributes(){this.finalize();let e=[];return this.elementProperties.forEach((r,n)=>{let i=this._$Ep(n,r);i!==void 0&&(this._$Ev.set(i,n),e.push(i))}),e}static createProperty(e,r=qs){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(e,r),!r.noAccessor&&!this.prototype.hasOwnProperty(e)){let n=typeof e=="symbol"?Symbol():"__"+e,i=this.getPropertyDescriptor(e,n,r);i!==void 0&&Object.defineProperty(this.prototype,e,i)}}static getPropertyDescriptor(e,r,n){return{get(){return this[r]},set(i){let a=this[e];this[r]=i,this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||qs}static finalize(){if(this.hasOwnProperty(Vs))return!1;this[Vs]=!0;let e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let r=this.properties,n=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let i of n)this.createProperty(i,r[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){let r=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let i of n)r.unshift(Qa(i))}else e!==void 0&&r.push(Qa(e));return r}static _$Ep(e,r){let n=r.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(r=>r(this))}addController(e){var r,n;((r=this._$ES)!==null&&r!==void 0?r:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((n=e.hostConnected)===null||n===void 0||n.call(e))}removeController(e){var r;(r=this._$ES)===null||r===void 0||r.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,r)=>{this.hasOwnProperty(r)&&(this._$Ei.set(r,this[r]),delete this[r])})}createRenderRoot(){var e;let r=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return Us(r,this.constructor.elementStyles),r}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(r=>{var n;return(n=r.hostConnected)===null||n===void 0?void 0:n.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(r=>{var n;return(n=r.hostDisconnected)===null||n===void 0?void 0:n.call(r)})}attributeChangedCallback(e,r,n){this._$AK(e,n)}_$EO(e,r,n=qs){var i;let a=this.constructor._$Ep(e,n);if(a!==void 0&&n.reflect===!0){let o=(((i=n.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?n.converter:Bs).toAttribute(r,n.type);this._$El=e,o==null?this.removeAttribute(a):this.setAttribute(a,o),this._$El=null}}_$AK(e,r){var n;let i=this.constructor,a=i._$Ev.get(e);if(a!==void 0&&this._$El!==a){let o=i.getPropertyOptions(a),s=typeof o.converter=="function"?{fromAttribute:o.converter}:((n=o.converter)===null||n===void 0?void 0:n.fromAttribute)!==void 0?o.converter:Bs;this._$El=a,this[a]=s.fromAttribute(r,o.type),this._$El=null}}requestUpdate(e,r,n){let i=!0;e!==void 0&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||Ul)(this[e],r)?(this._$AL.has(e)||this._$AL.set(e,r),n.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,n))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(r){Promise.reject(r)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((i,a)=>this[a]=i),this._$Ei=void 0);let r=!1,n=this._$AL;try{r=this.shouldUpdate(n),r?(this.willUpdate(n),(e=this._$ES)===null||e===void 0||e.forEach(i=>{var a;return(a=i.hostUpdate)===null||a===void 0?void 0:a.call(i)}),this.update(n)):this._$Ek()}catch(i){throw r=!1,this._$Ek(),i}r&&this._$AE(n)}willUpdate(e){}_$AE(e){var r;(r=this._$ES)===null||r===void 0||r.forEach(n=>{var i;return(i=n.hostUpdated)===null||i===void 0?void 0:i.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((r,n)=>this._$EO(n,this[n],r)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};Xt[Vs]=!0,Xt.elementProperties=new Map,Xt.elementStyles=[],Xt.shadowRootOptions={mode:"open"},Ml?.({ReactiveElement:Xt}),((js=Ga.reactiveElementVersions)!==null&&js!==void 0?js:Ga.reactiveElementVersions=[]).push("1.6.3");var zs,Ha=window,Fn=Ha.trustedTypes,jl=Fn?Fn.createPolicy("lit-html",{createHTML:t=>t}):void 0,Gs="$lit$",dr=`lit$${(Math.random()+"").slice(9)}$`,Hl="?"+dr,g1=`<${Hl}>`,Qr=document,Ti=()=>Qr.createComment(""),Ai=t=>t===null||typeof t!="object"&&typeof t!="function",Wl=Array.isArray,y1=t=>Wl(t)||typeof t?.[Symbol.iterator]=="function",Qs=`[
|
|
1
|
+
var um=Object.defineProperty;var lm=Object.getOwnPropertyDescriptor;var ve=(t,e,r,n)=>{for(var i=n>1?void 0:n?lm(e,r):e,a=t.length-1,o;a>=0;a--)(o=t[a])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&um(e,r,i),i};var pe=(t,e,r)=>new Promise((n,i)=>{var a=u=>{try{s(r.next(u))}catch(c){i(c)}},o=u=>{try{s(r.throw(u))}catch(c){i(c)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(a,o);s((r=r.apply(t,e)).next())});import{ZBarSymbolType as re,ZBarConfigType as Pl,scanRGBABuffer as fm,getDefaultScanner as pm}from"https://cdn.jsdelivr.net/npm/@undecaf/zbar-wasm@0.9.15/dist/main.js";function dm(t,e,r,n){return new(r||(r=Promise))(function(i,a){function o(c){try{u(n.next(c))}catch(l){a(l)}}function s(c){try{u(n.throw(c))}catch(l){a(l)}}function u(c){var l;c.done?i(c.value):(l=c.value,l instanceof r?l:new r(function(d){d(l)})).then(o,s)}u((n=n.apply(t,e||[])).next())})}var R=class{constructor(e,r=Pl.ZBAR_CFG_ENABLE,n=1){this.symbolType=e,this.configType=r,this.number=n,this.configSteps=[this]}static register(e,r,n=r.symbolType){return R.formatsToConfigs[e]=r,R.typesToFormats[n]=R.typesToFormats[n]||e,r}static formats(){return Object.keys(R.formatsToConfigs)}static toFormat(e){return R.typesToFormats[e]}static configure(e,r){var n;(n=R.formatsToConfigs[r])===null||n===void 0||n.configSteps.forEach(i=>e.setConfig(i.symbolType,i.configType,i.number))}add(e){return this.configSteps.push(e),this}},Rl;R.formatsToConfigs={},R.typesToFormats={},R.register("codabar",new R(re.ZBAR_CODABAR)),R.register("code_39",new R(re.ZBAR_CODE39)),R.register("code_93",new R(re.ZBAR_CODE93)),R.register("code_128",new R(re.ZBAR_CODE128)),R.register("databar",new R(re.ZBAR_DATABAR)),R.register("databar_exp",new R(re.ZBAR_DATABAR_EXP)),R.register("ean_2",new R(re.ZBAR_EAN2)),R.register("ean_5",new R(re.ZBAR_EAN5)),R.register("ean_8",new R(re.ZBAR_EAN8)),R.register("ean_13",new R(re.ZBAR_EAN13)),R.register("ean_13+2",new R(re.ZBAR_EAN13)).add(new R(re.ZBAR_EAN2)),R.register("ean_13+5",new R(re.ZBAR_EAN13)).add(new R(re.ZBAR_EAN5)),R.register("isbn_10",new R(re.ZBAR_ISBN10)).add(new R(re.ZBAR_EAN13)),R.register("isbn_13",new R(re.ZBAR_ISBN13)).add(new R(re.ZBAR_EAN13)),R.register("isbn_13+2",new R(re.ZBAR_ISBN13)).add(new R(re.ZBAR_EAN13)).add(new R(re.ZBAR_EAN2)),R.register("isbn_13+5",new R(re.ZBAR_ISBN13)).add(new R(re.ZBAR_EAN13)).add(new R(re.ZBAR_EAN5)),R.register("itf",new R(re.ZBAR_I25)),R.register("qr_code",new R(re.ZBAR_QRCODE)),R.register("sq_code",new R(re.ZBAR_SQCODE)),R.register("upc_a",new R(re.ZBAR_UPCA)).add(new R(re.ZBAR_EAN13)),R.register("upc_e",new R(re.ZBAR_UPCE)).add(new R(re.ZBAR_EAN13)),function(t){t[t.UNKNOWN=-1]="UNKNOWN",t[t.UPRIGHT=0]="UPRIGHT",t[t.ROTATED_RIGHT=1]="ROTATED_RIGHT",t[t.UPSIDE_DOWN=2]="UPSIDE_DOWN",t[t.ROTATED_LEFT=3]="ROTATED_LEFT"}(Rl||(Rl={}));var $s=class{},hm=(()=>{try{return new OffscreenCanvas(1,1).getContext("2d")instanceof OffscreenCanvasRenderingContext2D}catch{return!1}})(),pr=class{constructor(e={}){if(e.formats!==void 0){if(!Array.isArray(e.formats)||!e.formats.length)throw new TypeError(`Barcode formats should be a non-empty array of strings but are: ${JSON.stringify(e)}`);let r=e.formats.filter(n=>!R.formats().includes(n));if(r.length)throw new TypeError(`Unsupported barcode format(s): ${r.join(", ")}`)}this.formats=e.formats||R.formats(),this.zbarConfig=e.zbar||new $s}static getSupportedFormats(){return Promise.resolve(R.formats())}detect(e){if(!pr.isImageBitmapSource(e))throw new TypeError("BarcodeDetector.detect() argument is not an ImageBitmapSource");let r=pr.intrinsicDimensions(e);if(r.width===0||r.height===0)return Promise.resolve([]);try{return Promise.all([this.toImageData(e),this.getScanner()]).then(n=>{let i=n[0],a=n[1];return this.zbarConfig.enableCache!==void 0&&a.enableCache(this.zbarConfig.enableCache),fm(i.data,i.width,i.height,a)}).then(n=>n.map(i=>this.toBarcodeDetectorResult(i)))}catch(n){return Promise.reject(n)}}getScanner(){return new Promise((e,r)=>dm(this,void 0,void 0,function*(){if(!this.scanner){let n=yield pm();this.formats.length>0&&(n.setConfig(re.ZBAR_NONE,Pl.ZBAR_CFG_ENABLE,0),this.formats.forEach(i=>R.configure(n,i))),this.scanner=n}e(this.scanner)}))}toImageData(e){let r=n=>{let i=pr.intrinsicDimensions(n);this.canvas&&this.canvas.width===i.width&&this.canvas.height===i.height||(this.canvas=function(s,u){if(hm)return new OffscreenCanvas(s,u);{let c=document.createElement("canvas");return c.width=s,c.height=u,c}}(i.width,i.height));let a=this.canvas,o=a.getContext("2d");return o.drawImage(n,0,0),o.getImageData(0,0,a.width,a.height)};if(e instanceof ImageData)return Promise.resolve(e);if(e instanceof Blob){let n=document.createElement("img");return n.src=URL.createObjectURL(e),n.decode().then(()=>r(n)).finally(()=>URL.revokeObjectURL(n.src))}return e instanceof CanvasRenderingContext2D?Promise.resolve(e.getImageData(0,0,e.canvas.width,e.canvas.height)):Promise.resolve(r(e))}toBarcodeDetectorResult(e){let r={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0};return e.points.forEach(n=>{r.minX=Math.min(r.minX,n.x),r.maxX=Math.max(r.maxX,n.x),r.minY=Math.min(r.minY,n.y),r.maxY=Math.max(r.maxY,n.y)}),{format:R.toFormat(e.type),rawValue:e.decode(this.zbarConfig.encoding),orientation:e.orientation,quality:e.quality,boundingBox:DOMRectReadOnly.fromRect({x:r.minX,y:r.minY,width:r.maxX-r.minX,height:r.maxY-r.minY}),cornerPoints:[{x:r.minX,y:r.minY},{x:r.maxX,y:r.minY},{x:r.maxX,y:r.maxY},{x:r.minX,y:r.maxY}]}}static isImageBitmapSource(e){return e instanceof HTMLImageElement||e instanceof HTMLVideoElement||e instanceof HTMLCanvasElement||e instanceof Blob||e instanceof ImageData||e instanceof CanvasRenderingContext2D||e instanceof ImageBitmap||e&&e.width==0||e&&e.height==0}static intrinsicDimensions(e){return{width:Number(e.naturalWidth||e.videoWidth||e.width),height:Number(e.naturalHeight||e.videoHeight||e.height)}}};var Va=window,za=Va.ShadowRoot&&(Va.ShadyCSS===void 0||Va.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Fs=Symbol(),Ll=new WeakMap,xi=class{constructor(e,r,n){if(this._$cssResult$=!0,n!==Fs)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o,r=this.t;if(za&&e===void 0){let n=r!==void 0&&r.length===1;n&&(e=Ll.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Ll.set(r,e))}return e}toString(){return this.cssText}},$l=t=>new xi(typeof t=="string"?t:t+"",void 0,Fs),Ms=(t,...e)=>{let r=t.length===1?t[0]:e.reduce((n,i,a)=>n+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[a+1],t[0]);return new xi(r,t,Fs)},Us=(t,e)=>{za?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{let n=document.createElement("style"),i=Va.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)})},Qa=za?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let n of e.cssRules)r+=n.cssText;return $l(r)})(t):t;var js,Ga=window,Fl=Ga.trustedTypes,mm=Fl?Fl.emptyScript:"",Ml=Ga.reactiveElementPolyfillSupport,Bs={toAttribute(t,e){switch(e){case Boolean:t=t?mm:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},Ul=(t,e)=>e!==t&&(e==e||t==t),qs={attribute:!0,type:String,converter:Bs,reflect:!1,hasChanged:Ul},Vs="finalized",Xt=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var r;this.finalize(),((r=this.h)!==null&&r!==void 0?r:this.h=[]).push(e)}static get observedAttributes(){this.finalize();let e=[];return this.elementProperties.forEach((r,n)=>{let i=this._$Ep(n,r);i!==void 0&&(this._$Ev.set(i,n),e.push(i))}),e}static createProperty(e,r=qs){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(e,r),!r.noAccessor&&!this.prototype.hasOwnProperty(e)){let n=typeof e=="symbol"?Symbol():"__"+e,i=this.getPropertyDescriptor(e,n,r);i!==void 0&&Object.defineProperty(this.prototype,e,i)}}static getPropertyDescriptor(e,r,n){return{get(){return this[r]},set(i){let a=this[e];this[r]=i,this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||qs}static finalize(){if(this.hasOwnProperty(Vs))return!1;this[Vs]=!0;let e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let r=this.properties,n=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let i of n)this.createProperty(i,r[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){let r=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let i of n)r.unshift(Qa(i))}else e!==void 0&&r.push(Qa(e));return r}static _$Ep(e,r){let n=r.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(r=>r(this))}addController(e){var r,n;((r=this._$ES)!==null&&r!==void 0?r:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((n=e.hostConnected)===null||n===void 0||n.call(e))}removeController(e){var r;(r=this._$ES)===null||r===void 0||r.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,r)=>{this.hasOwnProperty(r)&&(this._$Ei.set(r,this[r]),delete this[r])})}createRenderRoot(){var e;let r=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return Us(r,this.constructor.elementStyles),r}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(r=>{var n;return(n=r.hostConnected)===null||n===void 0?void 0:n.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(r=>{var n;return(n=r.hostDisconnected)===null||n===void 0?void 0:n.call(r)})}attributeChangedCallback(e,r,n){this._$AK(e,n)}_$EO(e,r,n=qs){var i;let a=this.constructor._$Ep(e,n);if(a!==void 0&&n.reflect===!0){let o=(((i=n.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?n.converter:Bs).toAttribute(r,n.type);this._$El=e,o==null?this.removeAttribute(a):this.setAttribute(a,o),this._$El=null}}_$AK(e,r){var n;let i=this.constructor,a=i._$Ev.get(e);if(a!==void 0&&this._$El!==a){let o=i.getPropertyOptions(a),s=typeof o.converter=="function"?{fromAttribute:o.converter}:((n=o.converter)===null||n===void 0?void 0:n.fromAttribute)!==void 0?o.converter:Bs;this._$El=a,this[a]=s.fromAttribute(r,o.type),this._$El=null}}requestUpdate(e,r,n){let i=!0;e!==void 0&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||Ul)(this[e],r)?(this._$AL.has(e)||this._$AL.set(e,r),n.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,n))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(r){Promise.reject(r)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((i,a)=>this[a]=i),this._$Ei=void 0);let r=!1,n=this._$AL;try{r=this.shouldUpdate(n),r?(this.willUpdate(n),(e=this._$ES)===null||e===void 0||e.forEach(i=>{var a;return(a=i.hostUpdate)===null||a===void 0?void 0:a.call(i)}),this.update(n)):this._$Ek()}catch(i){throw r=!1,this._$Ek(),i}r&&this._$AE(n)}willUpdate(e){}_$AE(e){var r;(r=this._$ES)===null||r===void 0||r.forEach(n=>{var i;return(i=n.hostUpdated)===null||i===void 0?void 0:i.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((r,n)=>this._$EO(n,this[n],r)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};Xt[Vs]=!0,Xt.elementProperties=new Map,Xt.elementStyles=[],Xt.shadowRootOptions={mode:"open"},Ml?.({ReactiveElement:Xt}),((js=Ga.reactiveElementVersions)!==null&&js!==void 0?js:Ga.reactiveElementVersions=[]).push("1.6.3");var zs,Ha=window,Fn=Ha.trustedTypes,jl=Fn?Fn.createPolicy("lit-html",{createHTML:t=>t}):void 0,Gs="$lit$",dr=`lit$${(Math.random()+"").slice(9)}$`,Hl="?"+dr,gm=`<${Hl}>`,Qr=document,Ti=()=>Qr.createComment(""),Ai=t=>t===null||typeof t!="object"&&typeof t!="function",Wl=Array.isArray,ym=t=>Wl(t)||typeof t?.[Symbol.iterator]=="function",Qs=`[
|
|
2
2
|
\f\r]`,ki=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ql=/-->/g,Bl=/>/g,Vr=RegExp(`>|${Qs}(?:([^\\s"'>=/]+)(${Qs}*=${Qs}*(?:[^
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Vl=/'/g,zl=/"/g,Kl=/^(?:script|style|textarea|title)$/i,Zl=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),B=Zl(1),Q2=Zl(2),Gr=Symbol.for("lit-noChange"),Me=Symbol.for("lit-nothing"),Ql=new WeakMap,zr=Qr.createTreeWalker(Qr,129,null,!1);function Yl(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return jl!==void 0?jl.createHTML(e):e}var v1=(t,e)=>{let r=t.length-1,n=[],i,a=e===2?"<svg>":"",o=ki;for(let s=0;s<r;s++){let u=t[s],c,l,d=-1,p=0;for(;p<u.length&&(o.lastIndex=p,l=o.exec(u),l!==null);)p=o.lastIndex,o===ki?l[1]==="!--"?o=ql:l[1]!==void 0?o=Bl:l[2]!==void 0?(Kl.test(l[2])&&(i=RegExp("</"+l[2],"g")),o=Vr):l[3]!==void 0&&(o=Vr):o===Vr?l[0]===">"?(o=i??ki,d=-1):l[1]===void 0?d=-2:(d=o.lastIndex-l[2].length,c=l[1],o=l[3]===void 0?Vr:l[3]==='"'?zl:Vl):o===zl||o===Vl?o=Vr:o===ql||o===Bl?o=ki:(o=Vr,i=void 0);let f=o===Vr&&t[s+1].startsWith("/>")?" ":"";a+=o===ki?u+g1:d>=0?(n.push(c),u.slice(0,d)+Gs+u.slice(d)+dr+f):u+dr+(d===-2?(n.push(void 0),s):f)}return[Yl(t,a+(t[r]||"<?>")+(e===2?"</svg>":"")),n]},Hr=class{constructor({strings:e,_$litType$:r},n){let i;this.parts=[];let a=0,o=0,s=e.length-1,u=this.parts,[c,l]=v1(e,r);if(this.el=Hr.createElement(c,n),zr.currentNode=this.el.content,r===2){let d=this.el.content,p=d.firstChild;p.remove(),d.append(...p.childNodes)}for(;(i=zr.nextNode())!==null&&u.length<s;){if(i.nodeType===1){if(i.hasAttributes()){let d=[];for(let p of i.getAttributeNames())if(p.endsWith(Gs)||p.startsWith(dr)){let f=l[o++];if(d.push(p),f!==void 0){let h=i.getAttribute(f.toLowerCase()+Gs).split(dr),g=/([.?@])?(.*)/.exec(f);u.push({type:1,index:a,name:g[2],strings:h,ctor:g[1]==="."?Ws:g[1]==="?"?Ks:g[1]==="@"?Zs:Un})}else u.push({type:6,index:a})}for(let p of d)i.removeAttribute(p)}if(Kl.test(i.tagName)){let d=i.textContent.split(dr),p=d.length-1;if(p>0){i.textContent=Fn?Fn.emptyScript:"";for(let f=0;f<p;f++)i.append(d[f],Ti()),zr.nextNode(),u.push({type:2,index:++a});i.append(d[p],Ti())}}}else if(i.nodeType===8)if(i.data===Hl)u.push({type:2,index:a});else{let d=-1;for(;(d=i.data.indexOf(dr,d+1))!==-1;)u.push({type:7,index:a}),d+=dr.length-1}a++}}static createElement(e,r){let n=Qr.createElement("template");return n.innerHTML=e,n}};function Mn(t,e,r=t,n){var i,a,o,s;if(e===Gr)return e;let u=n!==void 0?(i=r._$Co)===null||i===void 0?void 0:i[n]:r._$Cl,c=Ai(e)?void 0:e._$litDirective$;return u?.constructor!==c&&((a=u?._$AO)===null||a===void 0||a.call(u,!1),c===void 0?u=void 0:(u=new c(t),u._$AT(t,r,n)),n!==void 0?((o=(s=r)._$Co)!==null&&o!==void 0?o:s._$Co=[])[n]=u:r._$Cl=u),u!==void 0&&(e=Mn(t,u._$AS(t,e.values),u,n)),e}var Hs=class{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var r;let{el:{content:n},parts:i}=this._$AD,a=((r=e?.creationScope)!==null&&r!==void 0?r:Qr).importNode(n,!0);zr.currentNode=a;let o=zr.nextNode(),s=0,u=0,c=i[0];for(;c!==void 0;){if(s===c.index){let l;c.type===2?l=new Wr(o,o.nextSibling,this,e):c.type===1?l=new c.ctor(o,c.name,c.strings,this,e):c.type===6&&(l=new Ys(o,this,e)),this._$AV.push(l),c=i[++u]}s!==c?.index&&(o=zr.nextNode(),s++)}return zr.currentNode=Qr,a}v(e){let r=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,r),r+=n.strings.length-2):n._$AI(e[r])),r++}},Wr=class{constructor(e,r,n,i){var a;this.type=2,this._$AH=Me,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=n,this.options=i,this._$Cp=(a=i?.isConnected)===null||a===void 0||a}get _$AU(){var e,r;return(r=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&r!==void 0?r:this._$Cp}get parentNode(){let e=this._$AA.parentNode,r=this._$AM;return r!==void 0&&e?.nodeType===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=Mn(this,e,r),Ai(e)?e===Me||e==null||e===""?(this._$AH!==Me&&this._$AR(),this._$AH=Me):e!==this._$AH&&e!==Gr&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):y1(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==Me&&Ai(this._$AH)?this._$AA.nextSibling.data=e:this.$(Qr.createTextNode(e)),this._$AH=e}g(e){var r;let{values:n,_$litType$:i}=e,a=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Hr.createElement(Yl(i.h,i.h[0]),this.options)),i);if(((r=this._$AH)===null||r===void 0?void 0:r._$AD)===a)this._$AH.v(n);else{let o=new Hs(a,this),s=o.u(this.options);o.v(n),this.$(s),this._$AH=o}}_$AC(e){let r=Ql.get(e.strings);return r===void 0&&Ql.set(e.strings,r=new Hr(e)),r}T(e){Wl(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,n,i=0;for(let a of e)i===r.length?r.push(n=new Wr(this.k(Ti()),this.k(Ti()),this,this.options)):n=r[i],n._$AI(a),i++;i<r.length&&(this._$AR(n&&n._$AB.nextSibling,i),r.length=i)}_$AR(e=this._$AA.nextSibling,r){var n;for((n=this._$AP)===null||n===void 0||n.call(this,!1,!0,r);e&&e!==this._$AB;){let i=e.nextSibling;e.remove(),e=i}}setConnected(e){var r;this._$AM===void 0&&(this._$Cp=e,(r=this._$AP)===null||r===void 0||r.call(this,e))}},Un=class{constructor(e,r,n,i,a){this.type=1,this._$AH=Me,this._$AN=void 0,this.element=e,this.name=r,this._$AM=i,this.options=a,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=Me}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,r=this,n,i){let a=this.strings,o=!1;if(a===void 0)e=Mn(this,e,r,0),o=!Ai(e)||e!==this._$AH&&e!==Gr,o&&(this._$AH=e);else{let s=e,u,c;for(e=a[0],u=0;u<a.length-1;u++)c=Mn(this,s[n+u],r,u),c===Gr&&(c=this._$AH[u]),o||(o=!Ai(c)||c!==this._$AH[u]),c===Me?e=Me:e!==Me&&(e+=(c??"")+a[u+1]),this._$AH[u]=c}o&&!i&&this.j(e)}j(e){e===Me?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Ws=class extends Un{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Me?void 0:e}},b1=Fn?Fn.emptyScript:"",Ks=class extends Un{constructor(){super(...arguments),this.type=4}j(e){e&&e!==Me?this.element.setAttribute(this.name,b1):this.element.removeAttribute(this.name)}},Zs=class extends Un{constructor(e,r,n,i,a){super(e,r,n,i,a),this.type=5}_$AI(e,r=this){var n;if((e=(n=Mn(this,e,r,0))!==null&&n!==void 0?n:Me)===Gr)return;let i=this._$AH,a=e===Me&&i!==Me||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,o=e!==Me&&(i===Me||a);a&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var r,n;typeof this._$AH=="function"?this._$AH.call((n=(r=this.options)===null||r===void 0?void 0:r.host)!==null&&n!==void 0?n:this.element,e):this._$AH.handleEvent(e)}},Ys=class{constructor(e,r,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){Mn(this,e)}};var Gl=Ha.litHtmlPolyfillSupport;Gl?.(Hr,Wr),((zs=Ha.litHtmlVersions)!==null&&zs!==void 0?zs:Ha.litHtmlVersions=[]).push("2.8.0");var Jl=(t,e,r)=>{var n,i;let a=(n=r?.renderBefore)!==null&&n!==void 0?n:e,o=a._$litPart$;if(o===void 0){let s=(i=r?.renderBefore)!==null&&i!==void 0?i:null;a._$litPart$=o=new Wr(e.insertBefore(Ti(),s),s,void 0,r??{})}return o._$AI(t),o};var Js,Xs;var hr=class extends Xt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,r;let n=super.createRenderRoot();return(e=(r=this.renderOptions).renderBefore)!==null&&e!==void 0||(r.renderBefore=n.firstChild),n}update(e){let r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Jl(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return Gr}};hr.finalized=!0,hr._$litElement$=!0,(Js=globalThis.litElementHydrateSupport)===null||Js===void 0||Js.call(globalThis,{LitElement:hr});var Xl=globalThis.litElementPolyfillSupport;Xl?.({LitElement:hr});((Xs=globalThis.litElementVersions)!==null&&Xs!==void 0?Xs:globalThis.litElementVersions=[]).push("3.3.3");var ef=t=>e=>typeof e=="function"?((r,n)=>(customElements.define(r,n),n))(t,e):((r,n)=>{let{kind:i,elements:a}=n;return{kind:i,elements:a,finisher(o){customElements.define(r,o)}}})(t,e);var _1=(t,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(r){r.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(r){r.createProperty(e.key,t)}},w1=(t,e,r)=>{e.constructor.createProperty(r,t)};function ft(t){return(e,r)=>r!==void 0?w1(t,e,r):_1(t,e)}function Ze(t){return ft({...t,state:!0})}var ec,v3=((ec=window.HTMLSlotElement)===null||ec===void 0?void 0:ec.prototype.assignedElements)!=null?(t,e)=>t.assignedElements(e):(t,e)=>t.assignedNodes(e).filter(r=>r.nodeType===Node.ELEMENT_NODE);var tc=function(t,e){return tc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},tc(t,e)};function xe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");tc(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var _=function(){return _=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},_.apply(this,arguments)};function Ut(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function Tt(t,e,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(l){try{c(n.next(l))}catch(d){o(d)}}function u(l){try{c(n.throw(l))}catch(d){o(d)}}function c(l){l.done?a(l.value):i(l.value).then(s,u)}c((n=n.apply(t,e||[])).next())})}function At(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(a=c[0]&2?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){r.label=c[1];break}if(c[0]===6&&r.label<a[1]){r.label=a[1],a=c;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(c);break}a[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function mr(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))}var rc="Invariant Violation",tf=Object.setPrototypeOf,S1=tf===void 0?function(t,e){return t.__proto__=e,t}:tf,V=function(t){xe(e,t);function e(r){r===void 0&&(r=rc);var n=t.call(this,typeof r=="number"?rc+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=rc,S1(n,e.prototype),n}return e}(Error);function I(t,e){if(!t)throw new V(e)}var Ka=["debug","log","warn","error","silent"],nc=Ka.indexOf("log");function Wa(t){return function(){if(Ka.indexOf(t)>=nc){var e=console[t]||console.log;return e.apply(console,arguments)}}}(function(t){t.debug=Wa("debug"),t.log=Wa("log"),t.warn=Wa("warn"),t.error=Wa("error")})(I||(I={}));function rf(t){var e=Ka[nc];return nc=Math.max(0,Ka.indexOf(t)),e}function Ue(t){try{return t()}catch{}}var Za=Ue(function(){return globalThis})||Ue(function(){return window})||Ue(function(){return self})||Ue(function(){return global})||Ue(function(){return Ue.constructor("return this")()});var nf="__",af=[nf,nf].join("DEV");function C1(){try{return Boolean(__DEV__)}catch{return Object.defineProperty(Za,af,{value:Ue(function(){return"production"})!=="production",enumerable:!1,configurable:!0,writable:!0}),Za[af]}}var Kr=C1();function gr(t){try{return t()}catch{}}var ic=gr(function(){return globalThis})||gr(function(){return window})||gr(function(){return self})||gr(function(){return global})||gr(function(){return gr.constructor("return this")()}),ac=!1;function E1(){ic&&!gr(function(){return"production"})&&!gr(function(){return process})&&(Object.defineProperty(ic,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),ac=!0)}E1();function oc(){ac&&(delete ic.process,ac=!1)}var z3=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",Q3=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator",of=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";var Oe=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});function sc(t,e){var r=Boolean(t);if(!r)throw new Error(e??"Unexpected invariant triggered.")}var x1=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,Oi=x1;function Ya(t){var e=t.prototype.toJSON;typeof e=="function"||sc(0),t.prototype.inspect=e,Oi&&(t.prototype[Oi]=e)}var sf=function(){function t(r,n,i){this.start=r.start,this.end=n.end,this.startToken=r,this.endToken=n,this.source=i}var e=t.prototype;return e.toJSON=function(){return{start:this.start,end:this.end}},t}();Ya(sf);var cf=function(){function t(r,n,i,a,o,s,u){this.kind=r,this.start=n,this.end=i,this.line=a,this.column=o,this.value=u,this.prev=s,this.next=null}var e=t.prototype;return e.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},t}();Ya(cf);function cc(t){return t!=null&&typeof t.kind=="string"}function Ja(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ja=function(r){return typeof r}:Ja=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ja(t)}var k1=10,uf=2;function Di(t){return Xa(t,[])}function Xa(t,e){switch(Ja(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return t===null?"null":T1(t,e);default:return String(t)}}function T1(t,e){if(e.indexOf(t)!==-1)return"[Circular]";var r=[].concat(e,[t]),n=O1(t);if(n!==void 0){var i=n.call(t);if(i!==t)return typeof i=="string"?i:Xa(i,r)}else if(Array.isArray(t))return I1(t,r);return A1(t,r)}function A1(t,e){var r=Object.keys(t);if(r.length===0)return"{}";if(e.length>uf)return"["+D1(t)+"]";var n=r.map(function(i){var a=Xa(t[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function I1(t,e){if(t.length===0)return"[]";if(e.length>uf)return"[Array]";for(var r=Math.min(k1,t.length),n=t.length-r,i=[],a=0;a<r;++a)i.push(Xa(t[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function O1(t){var e=t[String(Oi)];if(typeof e=="function")return e;if(typeof t.inspect=="function")return t.inspect}function D1(t){var e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof t.constructor=="function"){var r=t.constructor.name;if(typeof r=="string"&&r!=="")return r}return e}function Ni(t,e){var r=Boolean(t);if(!r)throw new Error(e)}function lf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function N1(t,e,r){return e&&lf(t.prototype,e),r&&lf(t,r),t}var eo=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GraphQL request",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{line:1,column:1};typeof e=="string"||Ni(0,"Body must be a string. Received: ".concat(Di(e),".")),this.body=e,this.name=r,this.locationOffset=n,this.locationOffset.line>0||Ni(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Ni(0,"column in locationOffset is 1-indexed and must be positive.")}return N1(t,[{key:of,get:function(){return"Source"}}]),t}();function ff(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=t.indexOf(`
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Vl=/'/g,zl=/"/g,Kl=/^(?:script|style|textarea|title)$/i,Zl=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),B=Zl(1),Q2=Zl(2),Gr=Symbol.for("lit-noChange"),Me=Symbol.for("lit-nothing"),Ql=new WeakMap,zr=Qr.createTreeWalker(Qr,129,null,!1);function Yl(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return jl!==void 0?jl.createHTML(e):e}var vm=(t,e)=>{let r=t.length-1,n=[],i,a=e===2?"<svg>":"",o=ki;for(let s=0;s<r;s++){let u=t[s],c,l,d=-1,p=0;for(;p<u.length&&(o.lastIndex=p,l=o.exec(u),l!==null);)p=o.lastIndex,o===ki?l[1]==="!--"?o=ql:l[1]!==void 0?o=Bl:l[2]!==void 0?(Kl.test(l[2])&&(i=RegExp("</"+l[2],"g")),o=Vr):l[3]!==void 0&&(o=Vr):o===Vr?l[0]===">"?(o=i??ki,d=-1):l[1]===void 0?d=-2:(d=o.lastIndex-l[2].length,c=l[1],o=l[3]===void 0?Vr:l[3]==='"'?zl:Vl):o===zl||o===Vl?o=Vr:o===ql||o===Bl?o=ki:(o=Vr,i=void 0);let f=o===Vr&&t[s+1].startsWith("/>")?" ":"";a+=o===ki?u+gm:d>=0?(n.push(c),u.slice(0,d)+Gs+u.slice(d)+dr+f):u+dr+(d===-2?(n.push(void 0),s):f)}return[Yl(t,a+(t[r]||"<?>")+(e===2?"</svg>":"")),n]},Hr=class{constructor({strings:e,_$litType$:r},n){let i;this.parts=[];let a=0,o=0,s=e.length-1,u=this.parts,[c,l]=vm(e,r);if(this.el=Hr.createElement(c,n),zr.currentNode=this.el.content,r===2){let d=this.el.content,p=d.firstChild;p.remove(),d.append(...p.childNodes)}for(;(i=zr.nextNode())!==null&&u.length<s;){if(i.nodeType===1){if(i.hasAttributes()){let d=[];for(let p of i.getAttributeNames())if(p.endsWith(Gs)||p.startsWith(dr)){let f=l[o++];if(d.push(p),f!==void 0){let h=i.getAttribute(f.toLowerCase()+Gs).split(dr),g=/([.?@])?(.*)/.exec(f);u.push({type:1,index:a,name:g[2],strings:h,ctor:g[1]==="."?Ws:g[1]==="?"?Ks:g[1]==="@"?Zs:Un})}else u.push({type:6,index:a})}for(let p of d)i.removeAttribute(p)}if(Kl.test(i.tagName)){let d=i.textContent.split(dr),p=d.length-1;if(p>0){i.textContent=Fn?Fn.emptyScript:"";for(let f=0;f<p;f++)i.append(d[f],Ti()),zr.nextNode(),u.push({type:2,index:++a});i.append(d[p],Ti())}}}else if(i.nodeType===8)if(i.data===Hl)u.push({type:2,index:a});else{let d=-1;for(;(d=i.data.indexOf(dr,d+1))!==-1;)u.push({type:7,index:a}),d+=dr.length-1}a++}}static createElement(e,r){let n=Qr.createElement("template");return n.innerHTML=e,n}};function Mn(t,e,r=t,n){var i,a,o,s;if(e===Gr)return e;let u=n!==void 0?(i=r._$Co)===null||i===void 0?void 0:i[n]:r._$Cl,c=Ai(e)?void 0:e._$litDirective$;return u?.constructor!==c&&((a=u?._$AO)===null||a===void 0||a.call(u,!1),c===void 0?u=void 0:(u=new c(t),u._$AT(t,r,n)),n!==void 0?((o=(s=r)._$Co)!==null&&o!==void 0?o:s._$Co=[])[n]=u:r._$Cl=u),u!==void 0&&(e=Mn(t,u._$AS(t,e.values),u,n)),e}var Hs=class{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var r;let{el:{content:n},parts:i}=this._$AD,a=((r=e?.creationScope)!==null&&r!==void 0?r:Qr).importNode(n,!0);zr.currentNode=a;let o=zr.nextNode(),s=0,u=0,c=i[0];for(;c!==void 0;){if(s===c.index){let l;c.type===2?l=new Wr(o,o.nextSibling,this,e):c.type===1?l=new c.ctor(o,c.name,c.strings,this,e):c.type===6&&(l=new Ys(o,this,e)),this._$AV.push(l),c=i[++u]}s!==c?.index&&(o=zr.nextNode(),s++)}return zr.currentNode=Qr,a}v(e){let r=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,r),r+=n.strings.length-2):n._$AI(e[r])),r++}},Wr=class{constructor(e,r,n,i){var a;this.type=2,this._$AH=Me,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=n,this.options=i,this._$Cp=(a=i?.isConnected)===null||a===void 0||a}get _$AU(){var e,r;return(r=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&r!==void 0?r:this._$Cp}get parentNode(){let e=this._$AA.parentNode,r=this._$AM;return r!==void 0&&e?.nodeType===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=Mn(this,e,r),Ai(e)?e===Me||e==null||e===""?(this._$AH!==Me&&this._$AR(),this._$AH=Me):e!==this._$AH&&e!==Gr&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):ym(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==Me&&Ai(this._$AH)?this._$AA.nextSibling.data=e:this.$(Qr.createTextNode(e)),this._$AH=e}g(e){var r;let{values:n,_$litType$:i}=e,a=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Hr.createElement(Yl(i.h,i.h[0]),this.options)),i);if(((r=this._$AH)===null||r===void 0?void 0:r._$AD)===a)this._$AH.v(n);else{let o=new Hs(a,this),s=o.u(this.options);o.v(n),this.$(s),this._$AH=o}}_$AC(e){let r=Ql.get(e.strings);return r===void 0&&Ql.set(e.strings,r=new Hr(e)),r}T(e){Wl(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,n,i=0;for(let a of e)i===r.length?r.push(n=new Wr(this.k(Ti()),this.k(Ti()),this,this.options)):n=r[i],n._$AI(a),i++;i<r.length&&(this._$AR(n&&n._$AB.nextSibling,i),r.length=i)}_$AR(e=this._$AA.nextSibling,r){var n;for((n=this._$AP)===null||n===void 0||n.call(this,!1,!0,r);e&&e!==this._$AB;){let i=e.nextSibling;e.remove(),e=i}}setConnected(e){var r;this._$AM===void 0&&(this._$Cp=e,(r=this._$AP)===null||r===void 0||r.call(this,e))}},Un=class{constructor(e,r,n,i,a){this.type=1,this._$AH=Me,this._$AN=void 0,this.element=e,this.name=r,this._$AM=i,this.options=a,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=Me}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,r=this,n,i){let a=this.strings,o=!1;if(a===void 0)e=Mn(this,e,r,0),o=!Ai(e)||e!==this._$AH&&e!==Gr,o&&(this._$AH=e);else{let s=e,u,c;for(e=a[0],u=0;u<a.length-1;u++)c=Mn(this,s[n+u],r,u),c===Gr&&(c=this._$AH[u]),o||(o=!Ai(c)||c!==this._$AH[u]),c===Me?e=Me:e!==Me&&(e+=(c??"")+a[u+1]),this._$AH[u]=c}o&&!i&&this.j(e)}j(e){e===Me?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Ws=class extends Un{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Me?void 0:e}},bm=Fn?Fn.emptyScript:"",Ks=class extends Un{constructor(){super(...arguments),this.type=4}j(e){e&&e!==Me?this.element.setAttribute(this.name,bm):this.element.removeAttribute(this.name)}},Zs=class extends Un{constructor(e,r,n,i,a){super(e,r,n,i,a),this.type=5}_$AI(e,r=this){var n;if((e=(n=Mn(this,e,r,0))!==null&&n!==void 0?n:Me)===Gr)return;let i=this._$AH,a=e===Me&&i!==Me||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,o=e!==Me&&(i===Me||a);a&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var r,n;typeof this._$AH=="function"?this._$AH.call((n=(r=this.options)===null||r===void 0?void 0:r.host)!==null&&n!==void 0?n:this.element,e):this._$AH.handleEvent(e)}},Ys=class{constructor(e,r,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){Mn(this,e)}};var Gl=Ha.litHtmlPolyfillSupport;Gl?.(Hr,Wr),((zs=Ha.litHtmlVersions)!==null&&zs!==void 0?zs:Ha.litHtmlVersions=[]).push("2.8.0");var Jl=(t,e,r)=>{var n,i;let a=(n=r?.renderBefore)!==null&&n!==void 0?n:e,o=a._$litPart$;if(o===void 0){let s=(i=r?.renderBefore)!==null&&i!==void 0?i:null;a._$litPart$=o=new Wr(e.insertBefore(Ti(),s),s,void 0,r??{})}return o._$AI(t),o};var Js,Xs;var hr=class extends Xt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,r;let n=super.createRenderRoot();return(e=(r=this.renderOptions).renderBefore)!==null&&e!==void 0||(r.renderBefore=n.firstChild),n}update(e){let r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Jl(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return Gr}};hr.finalized=!0,hr._$litElement$=!0,(Js=globalThis.litElementHydrateSupport)===null||Js===void 0||Js.call(globalThis,{LitElement:hr});var Xl=globalThis.litElementPolyfillSupport;Xl?.({LitElement:hr});((Xs=globalThis.litElementVersions)!==null&&Xs!==void 0?Xs:globalThis.litElementVersions=[]).push("3.3.3");var ef=t=>e=>typeof e=="function"?((r,n)=>(customElements.define(r,n),n))(t,e):((r,n)=>{let{kind:i,elements:a}=n;return{kind:i,elements:a,finisher(o){customElements.define(r,o)}}})(t,e);var _m=(t,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(r){r.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(r){r.createProperty(e.key,t)}},wm=(t,e,r)=>{e.constructor.createProperty(r,t)};function ft(t){return(e,r)=>r!==void 0?wm(t,e,r):_m(t,e)}function Ze(t){return ft({...t,state:!0})}var ec,v3=((ec=window.HTMLSlotElement)===null||ec===void 0?void 0:ec.prototype.assignedElements)!=null?(t,e)=>t.assignedElements(e):(t,e)=>t.assignedNodes(e).filter(r=>r.nodeType===Node.ELEMENT_NODE);var tc=function(t,e){return tc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},tc(t,e)};function xe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");tc(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var _=function(){return _=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},_.apply(this,arguments)};function Ut(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function Tt(t,e,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(l){try{c(n.next(l))}catch(d){o(d)}}function u(l){try{c(n.throw(l))}catch(d){o(d)}}function c(l){l.done?a(l.value):i(l.value).then(s,u)}c((n=n.apply(t,e||[])).next())})}function At(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(a=c[0]&2?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){r.label=c[1];break}if(c[0]===6&&r.label<a[1]){r.label=a[1],a=c;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(c);break}a[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function mr(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))}var rc="Invariant Violation",tf=Object.setPrototypeOf,Sm=tf===void 0?function(t,e){return t.__proto__=e,t}:tf,V=function(t){xe(e,t);function e(r){r===void 0&&(r=rc);var n=t.call(this,typeof r=="number"?rc+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=rc,Sm(n,e.prototype),n}return e}(Error);function I(t,e){if(!t)throw new V(e)}var Ka=["debug","log","warn","error","silent"],nc=Ka.indexOf("log");function Wa(t){return function(){if(Ka.indexOf(t)>=nc){var e=console[t]||console.log;return e.apply(console,arguments)}}}(function(t){t.debug=Wa("debug"),t.log=Wa("log"),t.warn=Wa("warn"),t.error=Wa("error")})(I||(I={}));function rf(t){var e=Ka[nc];return nc=Math.max(0,Ka.indexOf(t)),e}function Ue(t){try{return t()}catch{}}var Za=Ue(function(){return globalThis})||Ue(function(){return window})||Ue(function(){return self})||Ue(function(){return global})||Ue(function(){return Ue.constructor("return this")()});var nf="__",af=[nf,nf].join("DEV");function Cm(){try{return Boolean(__DEV__)}catch{return Object.defineProperty(Za,af,{value:Ue(function(){return"production"})!=="production",enumerable:!1,configurable:!0,writable:!0}),Za[af]}}var Kr=Cm();function gr(t){try{return t()}catch{}}var ic=gr(function(){return globalThis})||gr(function(){return window})||gr(function(){return self})||gr(function(){return global})||gr(function(){return gr.constructor("return this")()}),ac=!1;function Em(){ic&&!gr(function(){return"production"})&&!gr(function(){return process})&&(Object.defineProperty(ic,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),ac=!0)}Em();function oc(){ac&&(delete ic.process,ac=!1)}var z3=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",Q3=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator",of=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";var Oe=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});function sc(t,e){var r=Boolean(t);if(!r)throw new Error(e??"Unexpected invariant triggered.")}var xm=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,Oi=xm;function Ya(t){var e=t.prototype.toJSON;typeof e=="function"||sc(0),t.prototype.inspect=e,Oi&&(t.prototype[Oi]=e)}var sf=function(){function t(r,n,i){this.start=r.start,this.end=n.end,this.startToken=r,this.endToken=n,this.source=i}var e=t.prototype;return e.toJSON=function(){return{start:this.start,end:this.end}},t}();Ya(sf);var cf=function(){function t(r,n,i,a,o,s,u){this.kind=r,this.start=n,this.end=i,this.line=a,this.column=o,this.value=u,this.prev=s,this.next=null}var e=t.prototype;return e.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},t}();Ya(cf);function cc(t){return t!=null&&typeof t.kind=="string"}function Ja(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ja=function(r){return typeof r}:Ja=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ja(t)}var km=10,uf=2;function Di(t){return Xa(t,[])}function Xa(t,e){switch(Ja(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return t===null?"null":Tm(t,e);default:return String(t)}}function Tm(t,e){if(e.indexOf(t)!==-1)return"[Circular]";var r=[].concat(e,[t]),n=Om(t);if(n!==void 0){var i=n.call(t);if(i!==t)return typeof i=="string"?i:Xa(i,r)}else if(Array.isArray(t))return Im(t,r);return Am(t,r)}function Am(t,e){var r=Object.keys(t);if(r.length===0)return"{}";if(e.length>uf)return"["+Dm(t)+"]";var n=r.map(function(i){var a=Xa(t[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function Im(t,e){if(t.length===0)return"[]";if(e.length>uf)return"[Array]";for(var r=Math.min(km,t.length),n=t.length-r,i=[],a=0;a<r;++a)i.push(Xa(t[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function Om(t){var e=t[String(Oi)];if(typeof e=="function")return e;if(typeof t.inspect=="function")return t.inspect}function Dm(t){var e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof t.constructor=="function"){var r=t.constructor.name;if(typeof r=="string"&&r!=="")return r}return e}function Ni(t,e){var r=Boolean(t);if(!r)throw new Error(e)}function lf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Nm(t,e,r){return e&&lf(t.prototype,e),r&&lf(t,r),t}var eo=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GraphQL request",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{line:1,column:1};typeof e=="string"||Ni(0,"Body must be a string. Received: ".concat(Di(e),".")),this.body=e,this.name=r,this.locationOffset=n,this.locationOffset.line>0||Ni(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Ni(0,"column in locationOffset is 1-indexed and must be positive.")}return Nm(t,[{key:of,get:function(){return"Source"}}]),t}();function ff(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=t.indexOf(`
|
|
4
4
|
`)===-1,i=t[0]===" "||t[0]===" ",a=t[t.length-1]==='"',o=t[t.length-1]==="\\",s=!n||a||o||r,u="";return s&&!(n&&i)&&(u+=`
|
|
5
5
|
`+e),u+=e?t.replace(/\n/g,`
|
|
6
6
|
`+e):t,s&&(u+=`
|
|
7
|
-
`),'"""'+u.replace(/"""/g,'\\"""')+'"""'}var
|
|
7
|
+
`),'"""'+u.replace(/"""/g,'\\"""')+'"""'}var Rm={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"]},Zr=Object.freeze({});function Ke(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Rm,n=void 0,i=Array.isArray(t),a=[t],o=-1,s=[],u=void 0,c=void 0,l=void 0,d=[],p=[],f=t;do{o++;var h=o===a.length,g=h&&s.length!==0;if(h){if(c=p.length===0?void 0:d[d.length-1],u=l,l=p.pop(),g){if(i)u=u.slice();else{for(var y={},S=0,b=Object.keys(u);S<b.length;S++){var v=b[S];y[v]=u[v]}u=y}for(var m=0,A=0;A<s.length;A++){var D=s[A][0],E=s[A][1];i&&(D-=m),i&&E===null?(u.splice(D,1),m++):u[D]=E}}o=n.index,a=n.keys,s=n.edits,i=n.inArray,n=n.prev}else{if(c=l?i?o:a[o]:void 0,u=l?l[c]:f,u==null)continue;l&&d.push(c)}var O=void 0;if(!Array.isArray(u)){if(!cc(u))throw new Error("Invalid AST Node: ".concat(Di(u),"."));var P=uc(e,u.kind,h);if(P){if(O=P.call(e,u,c,l,d,p),O===Zr)break;if(O===!1){if(!h){d.pop();continue}}else if(O!==void 0&&(s.push([c,O]),!h))if(cc(O))u=O;else{d.pop();continue}}}if(O===void 0&&g&&s.push([c,u]),h)d.pop();else{var N;n={inArray:i,index:o,keys:a,edits:s,prev:n},i=Array.isArray(u),a=i?u:(N=r[u.kind])!==null&&N!==void 0?N:[],o=-1,s=[],l&&p.push(l),l=u}}while(n!==void 0);return s.length!==0&&(f=s[s.length-1][1]),f}function uc(t,e,r){var n=t[e];if(n){if(!r&&typeof n=="function")return n;var i=r?n.leave:n.enter;if(typeof i=="function")return i}else{var a=r?t.leave:t.enter;if(a){if(typeof a=="function")return a;var o=a[e];if(typeof o=="function")return o}}}function jn(t){return Ke(t,{leave:Lm})}var Pm=80,Lm={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return L(e.definitions,`
|
|
8
8
|
|
|
9
9
|
`)+`
|
|
10
|
-
`},OperationDefinition:function(e){var r=e.operation,n=e.name,i=Ce("(",L(e.variableDefinitions,", "),")"),a=L(e.directives," "),o=e.selectionSet;return!n&&!a&&!i&&r==="query"?o:L([r,L([n,i]),a,o]," ")},VariableDefinition:function(e){var r=e.variable,n=e.type,i=e.defaultValue,a=e.directives;return r+": "+n+Ce(" = ",i)+Ce(" ",L(a," "))},SelectionSet:function(e){var r=e.selections;return Ot(r)},Field:function(e){var r=e.alias,n=e.name,i=e.arguments,a=e.directives,o=e.selectionSet,s=Ce("",r,": ")+n,u=s+Ce("(",L(i,", "),")");return u.length>
|
|
10
|
+
`},OperationDefinition:function(e){var r=e.operation,n=e.name,i=Ce("(",L(e.variableDefinitions,", "),")"),a=L(e.directives," "),o=e.selectionSet;return!n&&!a&&!i&&r==="query"?o:L([r,L([n,i]),a,o]," ")},VariableDefinition:function(e){var r=e.variable,n=e.type,i=e.defaultValue,a=e.directives;return r+": "+n+Ce(" = ",i)+Ce(" ",L(a," "))},SelectionSet:function(e){var r=e.selections;return Ot(r)},Field:function(e){var r=e.alias,n=e.name,i=e.arguments,a=e.directives,o=e.selectionSet,s=Ce("",r,": ")+n,u=s+Ce("(",L(i,", "),")");return u.length>Pm&&(u=s+Ce(`(
|
|
11
11
|
`,to(L(i,`
|
|
12
12
|
`)),`
|
|
13
13
|
)`)),L([u,L(a," "),o]," ")},Argument:function(e){var r=e.name,n=e.value;return r+": "+n},FragmentSpread:function(e){var r=e.name,n=e.directives;return"..."+r+Ce(" ",L(n," "))},InlineFragment:function(e){var r=e.typeCondition,n=e.directives,i=e.selectionSet;return L(["...",Ce("on ",r),L(n," "),i]," ")},FragmentDefinition:function(e){var r=e.name,n=e.typeCondition,i=e.variableDefinitions,a=e.directives,o=e.selectionSet;return"fragment ".concat(r).concat(Ce("(",L(i,", "),")")," ")+"on ".concat(n," ").concat(Ce("",L(a," ")," "))+o},IntValue:function(e){var r=e.value;return r},FloatValue:function(e){var r=e.value;return r},StringValue:function(e,r){var n=e.value,i=e.block;return i?ff(n,r==="description"?"":" "):JSON.stringify(n)},BooleanValue:function(e){var r=e.value;return r?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){var r=e.value;return r},ListValue:function(e){var r=e.values;return"["+L(r,", ")+"]"},ObjectValue:function(e){var r=e.fields;return"{"+L(r,", ")+"}"},ObjectField:function(e){var r=e.name,n=e.value;return r+": "+n},Directive:function(e){var r=e.name,n=e.arguments;return"@"+r+Ce("(",L(n,", "),")")},NamedType:function(e){var r=e.name;return r},ListType:function(e){var r=e.type;return"["+r+"]"},NonNullType:function(e){var r=e.type;return r+"!"},SchemaDefinition:It(function(t){var e=t.directives,r=t.operationTypes;return L(["schema",L(e," "),Ot(r)]," ")}),OperationTypeDefinition:function(e){var r=e.operation,n=e.type;return r+": "+n},ScalarTypeDefinition:It(function(t){var e=t.name,r=t.directives;return L(["scalar",e,L(r," ")]," ")}),ObjectTypeDefinition:It(function(t){var e=t.name,r=t.interfaces,n=t.directives,i=t.fields;return L(["type",e,Ce("implements ",L(r," & ")),L(n," "),Ot(i)]," ")}),FieldDefinition:It(function(t){var e=t.name,r=t.arguments,n=t.type,i=t.directives;return e+(pf(r)?Ce(`(
|
|
@@ -21,13 +21,13 @@ var u1=Object.defineProperty;var l1=Object.getOwnPropertyDescriptor;var ve=(t,e,
|
|
|
21
21
|
`,to(L(t,`
|
|
22
22
|
`)),`
|
|
23
23
|
}`)}function Ce(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return e!=null&&e!==""?t+e+r:""}function to(t){return Ce(" ",t.replace(/\n/g,`
|
|
24
|
-
`))}function $
|
|
25
|
-
`)!==-1}function pf(t){return t!=null&&t.some($1)}function Ri(t){return t.kind===Oe.FIELD||t.kind===Oe.FRAGMENT_SPREAD||t.kind===Oe.INLINE_FRAGMENT}function df(){return typeof eo=="function"?oc():oc()}function G1(){__DEV__?I(typeof Kr=="boolean",Kr):I(typeof Kr=="boolean",39)}df();G1();function er(t,e){var r=t.directives;return!r||!r.length?!0:hf(r).every(function(n){var i=n.directive,a=n.ifArgument,o=!1;return a.value.kind==="Variable"?(o=e&&e[a.value.name.value],__DEV__?I(o!==void 0,"Invalid variable referenced in @".concat(i.name.value," directive.")):I(o!==void 0,40)):o=a.value.value,i.name.value==="skip"?!o:o})}function qn(t,e,r){var n=new Set(t),i=n.size;return Ke(e,{Directive:function(a){if(n.delete(a.name.value)&&(!r||!n.size))return Zr}}),r?!n.size:n.size<i}function lc(t){return t&&qn(["client","export"],t,!0)}function H1(t){var e=t.name.value;return e==="skip"||e==="include"}function hf(t){var e=[];return t&&t.length&&t.forEach(function(r){if(!!H1(r)){var n=r.arguments,i=r.name.value;__DEV__?I(n&&n.length===1,"Incorrect number of arguments for the @".concat(i," directive.")):I(n&&n.length===1,41);var a=n[0];__DEV__?I(a.name&&a.name.value==="if","Invalid argument for the @".concat(i," directive.")):I(a.name&&a.name.value==="if",42);var o=a.value;__DEV__?I(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),"Argument for the @".concat(i," directive must be a variable or a boolean value.")):I(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),43),e.push({directive:r,ifArgument:a})}}),e}function fc(t,e){var r=e,n=[];t.definitions.forEach(function(a){if(a.kind==="OperationDefinition")throw __DEV__?new V("Found a ".concat(a.operation," operation").concat(a.name?" named '".concat(a.name.value,"'"):"",". ")+"No operations are allowed when using a fragment as a query. Only fragments are allowed."):new V(44);a.kind==="FragmentDefinition"&&n.push(a)}),typeof r>"u"&&(__DEV__?I(n.length===1,"Found ".concat(n.length," fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")):I(n.length===1,45),r=n[0].name.value);var i=_(_({},t),{definitions:mr([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],t.definitions,!0)});return i}function Yr(t){t===void 0&&(t=[]);var e={};return t.forEach(function(r){e[r.name.value]=r}),e}function Jr(t,e){switch(t.kind){case"InlineFragment":return t;case"FragmentSpread":{var r=t.name.value;if(typeof e=="function")return e(r);var n=e&&e[r];return __DEV__?I(n,"No fragment named ".concat(r)):I(n,46),n||null}default:return null}}function ee(t){return t!==null&&typeof t=="object"}function jt(t){return{__ref:String(t)}}function K(t){return Boolean(t&&typeof t=="object"&&typeof t.__ref=="string")}function pc(t){return ee(t)&&t.kind==="Document"&&Array.isArray(t.definitions)}function W1(t){return t.kind==="StringValue"}function K1(t){return t.kind==="BooleanValue"}function Z1(t){return t.kind==="IntValue"}function Y1(t){return t.kind==="FloatValue"}function J1(t){return t.kind==="Variable"}function X1(t){return t.kind==="ObjectValue"}function em(t){return t.kind==="ListValue"}function tm(t){return t.kind==="EnumValue"}function rm(t){return t.kind==="NullValue"}function yr(t,e,r,n){if(Z1(r)||Y1(r))t[e.value]=Number(r.value);else if(K1(r)||W1(r))t[e.value]=r.value;else if(X1(r)){var i={};r.fields.map(function(o){return yr(i,o.name,o.value,n)}),t[e.value]=i}else if(J1(r)){var a=(n||{})[r.name.value];t[e.value]=a}else if(em(r))t[e.value]=r.values.map(function(o){var s={};return yr(s,e,o,n),s[e.value]});else if(tm(r))t[e.value]=r.value;else if(rm(r))t[e.value]=null;else throw __DEV__?new V('The inline argument "'.concat(e.value,'" of kind "').concat(r.kind,'"')+"is not supported. Use variables instead of inline arguments to overcome this limitation."):new V(55)}function dc(t,e){var r=null;t.directives&&(r={},t.directives.forEach(function(i){r[i.name.value]={},i.arguments&&i.arguments.forEach(function(a){var o=a.name,s=a.value;return yr(r[i.name.value],o,s,e)})}));var n=null;return t.arguments&&t.arguments.length&&(n={},t.arguments.forEach(function(i){var a=i.name,o=i.value;return yr(n,a,o,e)})),Li(t.name.value,n,r)}var nm=["connection","include","skip","client","rest","export"],Li=Object.assign(function(t,e,r){if(e&&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(s){i[s]=e[s]}),"".concat(r.connection.key,"(").concat(Pi(i),")")}else return r.connection.key;var a=t;if(e){var o=Pi(e);a+="(".concat(o,")")}return r&&Object.keys(r).forEach(function(s){nm.indexOf(s)===-1&&(r[s]&&Object.keys(r[s]).length?a+="@".concat(s,"(").concat(Pi(r[s]),")"):a+="@".concat(s))}),a},{setStringify:function(t){var e=Pi;return Pi=t,e}}),Pi=function(e){return JSON.stringify(e,im)};function im(t,e){return ee(e)&&!Array.isArray(e)&&(e=Object.keys(e).sort().reduce(function(r,n){return r[n]=e[n],r},{})),e}function tr(t,e){if(t.arguments&&t.arguments.length){var r={};return t.arguments.forEach(function(n){var i=n.name,a=n.value;return yr(r,i,a,e)}),r}return null}function _t(t){return t.alias?t.alias.value:t.name.value}function $i(t,e,r){if(typeof t.__typename=="string")return t.__typename;for(var n=0,i=e.selections;n<i.length;n++){var a=i[n];if(pt(a)){if(a.name.value==="__typename")return t[_t(a)]}else{var o=$i(t,Jr(a,r).selectionSet,r);if(typeof o=="string")return o}}}function pt(t){return t.kind==="Field"}function hc(t){return t.kind==="InlineFragment"}function Bn(t){__DEV__?I(t&&t.kind==="Document",'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'):I(t&&t.kind==="Document",47);var e=t.definitions.filter(function(r){return r.kind!=="FragmentDefinition"}).map(function(r){if(r.kind!=="OperationDefinition")throw __DEV__?new V('Schema type definitions not allowed in queries. Found: "'.concat(r.kind,'"')):new V(48);return r});return __DEV__?I(e.length<=1,"Ambiguous GraphQL document: contains ".concat(e.length," operations")):I(e.length<=1,49),t}function qt(t){return Bn(t),t.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function Vn(t){return t.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function Xr(t){return t.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function Fi(t){var e=qt(t);return __DEV__?I(e&&e.operation==="query","Must contain a query definition."):I(e&&e.operation==="query",50),e}function mc(t){__DEV__?I(t.kind==="Document",'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'):I(t.kind==="Document",51),__DEV__?I(t.definitions.length<=1,"Fragment must have exactly one definition."):I(t.definitions.length<=1,52);var e=t.definitions[0];return __DEV__?I(e.kind==="FragmentDefinition","Must be a fragment definition."):I(e.kind==="FragmentDefinition",53),e}function en(t){Bn(t);for(var e,r=0,n=t.definitions;r<n.length;r++){var i=n[r];if(i.kind==="OperationDefinition"){var a=i.operation;if(a==="query"||a==="mutation"||a==="subscription")return i}i.kind==="FragmentDefinition"&&!e&&(e=i)}if(e)return e;throw __DEV__?new V("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new V(54)}function tn(t){var e=Object.create(null),r=t&&t.variableDefinitions;return r&&r.length&&r.forEach(function(n){n.defaultValue&&yr(e,n.variable.name,n.defaultValue)}),e}var ue=Array.isArray;function Re(t){return Array.isArray(t)&&t.length>0}var mf={kind:Oe.FIELD,name:{kind:Oe.NAME,value:"__typename"}};function yf(t,e){return!t||t.selectionSet.selections.every(function(r){return r.kind===Oe.FRAGMENT_SPREAD&&yf(e[r.name.value],e)})}function am(t){return yf(qt(t)||mc(t),Yr(Xr(t)))?null:t}function om(t){var e=new Set,r=[];return t.forEach(function(n){n.name?e.add(n.name):n.test&&r.push(n.test)}),function(n){return e.has(n.name.value)||r.some(function(i){return i(n)})}}function gf(t){var e=new Map;return function(n){n===void 0&&(n=t);var i=e.get(n);return i||e.set(n,i={variables:new Set,fragmentSpreads:new Set}),i}}function gc(t,e){for(var r=gf(""),n=gf(""),i=function(b){for(var v=0,m=void 0;v<b.length&&(m=b[v]);++v)if(!ue(m)){if(m.kind===Oe.OPERATION_DEFINITION)return r(m.name&&m.name.value);if(m.kind===Oe.FRAGMENT_DEFINITION)return n(m.name.value)}return __DEV__&&I.error("Could not find operation or fragment"),null},a=0,o=e.definitions.length-1;o>=0;--o)e.definitions[o].kind===Oe.OPERATION_DEFINITION&&++a;var s=om(t),u=t.some(function(b){return b.remove}),c=function(b){return u&&b&&b.some(s)},l=new Map,d=!1,p={enter:function(b){if(c(b.directives))return d=!0,null}},f=Ke(e,{Field:p,InlineFragment:p,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(b,v,m,A,D){var E=i(D);E&&E.variables.add(b.name.value)}},FragmentSpread:{enter:function(b,v,m,A,D){if(c(b.directives))return d=!0,null;var E=i(D);E&&E.fragmentSpreads.add(b.name.value)}},FragmentDefinition:{enter:function(b,v,m,A){l.set(JSON.stringify(A),b)},leave:function(b,v,m,A){var D=l.get(JSON.stringify(A));if(b===D)return b;if(a>0&&b.selectionSet.selections.every(function(E){return E.kind===Oe.FIELD&&E.name.value==="__typename"}))return n(b.name.value).removed=!0,d=!0,null}},Directive:{leave:function(b){if(s(b))return d=!0,null}}});if(!d)return e;var h=function(b){return b.transitiveVars||(b.transitiveVars=new Set(b.variables),b.removed||b.fragmentSpreads.forEach(function(v){h(n(v)).transitiveVars.forEach(function(m){b.transitiveVars.add(m)})})),b},g=new Set;f.definitions.forEach(function(b){b.kind===Oe.OPERATION_DEFINITION?h(r(b.name&&b.name.value)).fragmentSpreads.forEach(function(v){g.add(v)}):b.kind===Oe.FRAGMENT_DEFINITION&&a===0&&!n(b.name.value).removed&&g.add(b.name.value)}),g.forEach(function(b){h(n(b)).fragmentSpreads.forEach(function(v){g.add(v)})});var y=function(b){return!!(!g.has(b)||n(b).removed)},S={enter:function(b){if(y(b.name.value))return null}};return am(Ke(f,{FragmentSpread:S,FragmentDefinition:S,OperationDefinition:{leave:function(b){if(b.variableDefinitions){var v=h(r(b.name&&b.name.value)).transitiveVars;if(v.size<b.variableDefinitions.length)return _(_({},b),{variableDefinitions:b.variableDefinitions.filter(function(m){return v.has(m.variable.name.value)})})}}}}))}var rn=Object.assign(function(t){return Ke(t,{SelectionSet:{enter:function(e,r,n){if(!(n&&n.kind===Oe.OPERATION_DEFINITION)){var i=e.selections;if(!!i){var a=i.some(function(s){return pt(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=n;if(!(pt(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return _(_({},e),{selections:mr(mr([],i,!0),[mf],!1)})}}}}}})},{added:function(t){return t===mf}}),sm={test:function(t){var e=t.name.value==="connection";return e&&(!t.arguments||!t.arguments.some(function(r){return r.name.value==="key"}))&&__DEV__&&I.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."),e}};function yc(t){return gc([sm],Bn(t))}function vc(t){var e=en(t),r=e.operation;if(r==="query")return t;var n=Ke(t,{OperationDefinition:{enter:function(i){return _(_({},i),{operation:"query"})}}});return n}function bc(t){Bn(t);var e=gc([{test:function(r){return r.name.value==="client"},remove:!0}],t);return e}var cm=Object.prototype.hasOwnProperty;function _c(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Mi(t)}function Mi(t){var e=t[0]||{},r=t.length;if(r>1)for(var n=new it,i=1;i<r;++i)e=n.merge(e,t[i]);return e}var um=function(t,e,r){return this.merge(t[r],e[r])},it=function(){function t(e){e===void 0&&(e=um),this.reconciler=e,this.isObject=ee,this.pastCopies=new Set}return t.prototype.merge=function(e,r){for(var n=this,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];return ee(r)&&ee(e)?(Object.keys(r).forEach(function(o){if(cm.call(e,o)){var s=e[o];if(r[o]!==s){var u=n.reconciler.apply(n,mr([e,r,o],i,!1));u!==s&&(e=n.shallowCopyForMerge(e),e[o]=u)}}else e=n.shallowCopyForMerge(e),e[o]=r[o]}),e):r},t.prototype.shallowCopyForMerge=function(e){return ee(e)&&(this.pastCopies.has(e)||(Array.isArray(e)?e=e.slice(0):e=_({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},t}();function lm(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=fm(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
26
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fm(t,e){if(!!t){if(typeof t=="string")return vf(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vf(t,e)}}function vf(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function bf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ec(t,e,r){return e&&bf(t.prototype,e),r&&bf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var xc=function(){return typeof Symbol=="function"},kc=function(t){return xc()&&Boolean(Symbol[t])},Tc=function(t){return kc(t)?Symbol[t]:"@@"+t};xc()&&!kc("observable")&&(Symbol.observable=Symbol("observable"));var pm=Tc("iterator"),Sc=Tc("observable"),_f=Tc("species");function no(t,e){var r=t[e];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function Ui(t){var e=t.constructor;return e!==void 0&&(e=e[_f],e===null&&(e=void 0)),e!==void 0?e:W}function dm(t){return t instanceof W}function zn(t){zn.log?zn.log(t):setTimeout(function(){throw t})}function ro(t){Promise.resolve().then(function(){try{t()}catch(e){zn(e)}})}function wf(t){var e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var r=no(e,"unsubscribe");r&&r.call(e)}}catch(n){zn(n)}}function Cc(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function hm(t){var e=t._queue;if(!!e){t._queue=void 0,t._state="ready";for(var r=0;r<e.length&&(Sf(t,e[r].type,e[r].value),t._state!=="closed");++r);}}function Sf(t,e,r){t._state="running";var n=t._observer;try{var i=no(n,e);switch(e){case"next":i&&i.call(n,r);break;case"error":if(Cc(t),i)i.call(n,r);else throw r;break;case"complete":Cc(t),i&&i.call(n);break}}catch(a){zn(a)}t._state==="closed"?wf(t):t._state==="running"&&(t._state="ready")}function wc(t,e,r){if(t._state!=="closed"){if(t._state==="buffering"){t._queue.push({type:e,value:r});return}if(t._state!=="ready"){t._state="buffering",t._queue=[{type:e,value:r}],ro(function(){return hm(t)});return}Sf(t,e,r)}}var mm=function(){function t(r,n){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var i=new gm(this);try{this._cleanup=n.call(void 0,i)}catch(a){i.error(a)}this._state==="initializing"&&(this._state="ready")}var e=t.prototype;return e.unsubscribe=function(){this._state!=="closed"&&(Cc(this),wf(this))},Ec(t,[{key:"closed",get:function(){return this._state==="closed"}}]),t}(),gm=function(){function t(r){this._subscription=r}var e=t.prototype;return e.next=function(n){wc(this._subscription,"next",n)},e.error=function(n){wc(this._subscription,"error",n)},e.complete=function(){wc(this._subscription,"complete")},Ec(t,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),t}(),W=function(){function t(r){if(!(this instanceof t))throw new TypeError("Observable cannot be called as a function");if(typeof r!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=r}var e=t.prototype;return e.subscribe=function(n){return(typeof n!="object"||n===null)&&(n={next:n,error:arguments[1],complete:arguments[2]}),new mm(n,this._subscriber)},e.forEach=function(n){var i=this;return new Promise(function(a,o){if(typeof n!="function"){o(new TypeError(n+" is not a function"));return}function s(){u.unsubscribe(),a()}var u=i.subscribe({next:function(c){try{n(c,s)}catch(l){o(l),u.unsubscribe()}},error:o,complete:a})})},e.map=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Ui(this);return new a(function(o){return i.subscribe({next:function(s){try{s=n(s)}catch(u){return o.error(u)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},e.filter=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Ui(this);return new a(function(o){return i.subscribe({next:function(s){try{if(!n(s))return}catch(u){return o.error(u)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},e.reduce=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Ui(this),o=arguments.length>1,s=!1,u=arguments[1],c=u;return new a(function(l){return i.subscribe({next:function(d){var p=!s;if(s=!0,!p||o)try{c=n(c,d)}catch(f){return l.error(f)}else c=d},error:function(d){l.error(d)},complete:function(){if(!s&&!o)return l.error(new TypeError("Cannot reduce an empty sequence"));l.next(c),l.complete()}})})},e.concat=function(){for(var n=this,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];var s=Ui(this);return new s(function(u){var c,l=0;function d(p){c=p.subscribe({next:function(f){u.next(f)},error:function(f){u.error(f)},complete:function(){l===a.length?(c=void 0,u.complete()):d(s.from(a[l++]))}})}return d(n),function(){c&&(c.unsubscribe(),c=void 0)}})},e.flatMap=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Ui(this);return new a(function(o){var s=[],u=i.subscribe({next:function(l){if(n)try{l=n(l)}catch(p){return o.error(p)}var d=a.from(l).subscribe({next:function(p){o.next(p)},error:function(p){o.error(p)},complete:function(){var p=s.indexOf(d);p>=0&&s.splice(p,1),c()}});s.push(d)},error:function(l){o.error(l)},complete:function(){c()}});function c(){u.closed&&s.length===0&&o.complete()}return function(){s.forEach(function(l){return l.unsubscribe()}),u.unsubscribe()}})},e[Sc]=function(){return this},t.from=function(n){var i=typeof this=="function"?this:t;if(n==null)throw new TypeError(n+" is not an object");var a=no(n,Sc);if(a){var o=a.call(n);if(Object(o)!==o)throw new TypeError(o+" is not an object");return dm(o)&&o.constructor===i?o:new i(function(s){return o.subscribe(s)})}if(kc("iterator")&&(a=no(n,pm),a))return new i(function(s){ro(function(){if(!s.closed){for(var u=lm(a.call(n)),c;!(c=u()).done;){var l=c.value;if(s.next(l),s.closed)return}s.complete()}})});if(Array.isArray(n))return new i(function(s){ro(function(){if(!s.closed){for(var u=0;u<n.length;++u)if(s.next(n[u]),s.closed)return;s.complete()}})});throw new TypeError(n+" is not observable")},t.of=function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];var o=typeof this=="function"?this:t;return new o(function(s){ro(function(){if(!s.closed){for(var u=0;u<i.length;++u)if(s.next(i[u]),s.closed)return;s.complete()}})})},Ec(t,null,[{key:_f,get:function(){return this}}]),t}();xc()&&Object.defineProperty(W,Symbol("extensions"),{value:{symbol:Sc,hostReportError:zn},configurable:!0});function Ac(t){var e,r=t.Symbol;if(typeof r=="function")if(r.observable)e=r.observable;else{typeof r.for=="function"?e=r.for("https://github.com/benlesh/symbol-observable"):e=r("https://github.com/benlesh/symbol-observable");try{r.observable=e}catch{}}else e="@@observable";return e}var Qn;typeof self<"u"?Qn=self:typeof window<"u"?Qn=window:typeof global<"u"?Qn=global:typeof module<"u"?Qn=module:Qn=Function("return this")();var v_=Ac(Qn);var Cf=W.prototype,Ef="@@observable";Cf[Ef]||(Cf[Ef]=function(){return this});var ym=Object.prototype.toString;function io(t){return Ic(t)}function Ic(t,e){switch(ym.call(t)){case"[object Array]":{if(e=e||new Map,e.has(t))return e.get(t);var r=t.slice(0);return e.set(t,r),r.forEach(function(i,a){r[a]=Ic(i,e)}),r}case"[object Object]":{if(e=e||new Map,e.has(t))return e.get(t);var n=Object.create(Object.getPrototypeOf(t));return e.set(t,n),Object.keys(t).forEach(function(i){n[i]=Ic(t[i],e)}),n}default:return t}}function vm(t){var e=new Set([t]);return e.forEach(function(r){ee(r)&&bm(r)===r&&Object.getOwnPropertyNames(r).forEach(function(n){ee(r[n])&&e.add(r[n])})}),t}function bm(t){if(__DEV__&&!Object.isFrozen(t))try{Object.freeze(t)}catch(e){if(e instanceof TypeError)return null;throw e}return t}function ji(t){return __DEV__&&vm(t),t}function nn(t,e,r){var n=[];t.forEach(function(i){return i[e]&&n.push(i)}),n.forEach(function(i){return i[e](r)})}function ao(t,e,r){return new W(function(n){var i=n.next,a=n.error,o=n.complete,s=0,u=!1,c={then:function(f){return new Promise(function(h){return h(f())})}};function l(f,h){return f?function(g){++s;var y=function(){return f(g)};c=c.then(y,y).then(function(S){--s,i&&i.call(n,S),u&&d.complete()},function(S){throw--s,S}).catch(function(S){a&&a.call(n,S)})}:function(g){return h&&h.call(n,g)}}var d={next:l(e,i),error:l(r,a),complete:function(){u=!0,s||o&&o.call(n)}},p=t.subscribe(d);return function(){return p.unsubscribe()}})}var wt=typeof WeakMap=="function"&&Ue(function(){return navigator.product})!=="ReactNative",xf=typeof WeakSet=="function",Oc=typeof Symbol=="function"&&typeof Symbol.for=="function",vr=Oc&&Symbol.asyncIterator,D_=typeof Ue(function(){return window.document.createElement})=="function",N_=Ue(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1;function oo(t){function e(r){Object.defineProperty(t,r,{value:W})}return Oc&&Symbol.species&&e(Symbol.species),e("@@species"),t}function kf(t){return t&&typeof t.then=="function"}var Gn=function(t){xe(e,t);function e(r){var n=t.call(this,function(i){return n.addObserver(i),function(){return n.removeObserver(i)}})||this;return n.observers=new Set,n.promise=new Promise(function(i,a){n.resolve=i,n.reject=a}),n.handlers={next:function(i){n.sub!==null&&(n.latest=["next",i],n.notify("next",i),nn(n.observers,"next",i))},error:function(i){var a=n.sub;a!==null&&(a&&setTimeout(function(){return a.unsubscribe()}),n.sub=null,n.latest=["error",i],n.reject(i),n.notify("error",i),nn(n.observers,"error",i))},complete:function(){var i=n,a=i.sub,o=i.sources,s=o===void 0?[]:o;if(a!==null){var u=s.shift();u?kf(u)?u.then(function(c){return n.sub=c.subscribe(n.handlers)}):n.sub=u.subscribe(n.handlers):(a&&setTimeout(function(){return a.unsubscribe()}),n.sub=null,n.latest&&n.latest[0]==="next"?n.resolve(n.latest[1]):n.resolve(),n.notify("complete"),nn(n.observers,"complete"))}}},n.nextResultListeners=new Set,n.cancel=function(i){n.reject(i),n.sources=[],n.handlers.complete()},n.promise.catch(function(i){}),typeof r=="function"&&(r=[new W(r)]),kf(r)?r.then(function(i){return n.start(i)},n.handlers.error):n.start(r),n}return e.prototype.start=function(r){this.sub===void 0&&(this.sources=Array.from(r),this.handlers.complete())},e.prototype.deliverLastMessage=function(r){if(this.latest){var n=this.latest[0],i=r[n];i&&i.call(r,this.latest[1]),this.sub===null&&n==="next"&&r.complete&&r.complete()}},e.prototype.addObserver=function(r){this.observers.has(r)||(this.deliverLastMessage(r),this.observers.add(r))},e.prototype.removeObserver=function(r){this.observers.delete(r)&&this.observers.size<1&&this.handlers.complete()},e.prototype.notify=function(r,n){var i=this.nextResultListeners;i.size&&(this.nextResultListeners=new Set,i.forEach(function(a){return a(r,n)}))},e.prototype.beforeNext=function(r){var n=!1;this.nextResultListeners.add(function(i,a){n||(n=!0,r(i,a))})},e}(W);oo(Gn);function br(t){return"incremental"in t}function _m(t){return"hasNext"in t&&"data"in t}function Tf(t){return br(t)||_m(t)}function so(t,e){var r=t,n=new it;return br(e)&&Re(e.incremental)&&e.incremental.forEach(function(i){for(var a=i.data,o=i.path,s=o.length-1;s>=0;--s){var u=o[s],c=!isNaN(+u),l=c?[]:{};l[u]=a,a=l}r=n.merge(r,a)}),r}function Hn(t){var e=co(t);return Re(e)}function co(t){var e=Re(t.errors)?t.errors.slice(0):[];return br(t)&&Re(t.incremental)&&t.incremental.forEach(function(r){r.errors&&e.push.apply(e,r.errors)}),e}function _r(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Object.create(null);return t.forEach(function(n){!n||Object.keys(n).forEach(function(i){var a=n[i];a!==void 0&&(r[i]=a)})}),r}var Af=new Map;function qi(t){var e=Af.get(t)||1;return Af.set(t,e+1),"".concat(t,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function If(t){var e=qi("stringifyForDisplay");return JSON.stringify(t,function(r,n){return n===void 0?e:n}).split(JSON.stringify(e)).join("<undefined>")}function Bi(t,e){return _r(t,e,e.variables&&{variables:_(_({},t&&t.variables),e.variables)})}function uo(t){return new W(function(e){e.error(t)})}var Vi=function(t,e,r){var n=new Error(r);throw n.name="ServerError",n.response=t,n.statusCode=t.status,n.result=e,n};function Dc(t){for(var e=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(t);r<n.length;r++){var i=n[r];if(e.indexOf(i)<0)throw __DEV__?new V("illegal argument: ".concat(i)):new V(27)}return t}function Nc(t,e){var r=_({},t),n=function(a){typeof a=="function"?r=_(_({},r),a(r)):r=_(_({},r),a)},i=function(){return _({},r)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:n}),Object.defineProperty(e,"getContext",{enumerable:!1,value:i}),e}function Rc(t){var e={variables:t.variables||{},extensions:t.extensions||{},operationName:t.operationName,query:t.query};return e.operationName||(e.operationName=typeof e.query!="string"?Vn(e.query)||void 0:""),e}function Of(t,e){return e?e(t):W.of()}function zi(t){return typeof t=="function"?new St(t):t}function lo(t){return t.request.length<=1}var wm=function(t){xe(e,t);function e(r,n){var i=t.call(this,r)||this;return i.link=n,i}return e}(Error),St=function(){function t(e){e&&(this.request=e)}return t.empty=function(){return new t(function(){return W.of()})},t.from=function(e){return e.length===0?t.empty():e.map(zi).reduce(function(r,n){return r.concat(n)})},t.split=function(e,r,n){var i=zi(r),a=zi(n||new t(Of));return lo(i)&&lo(a)?new t(function(o){return e(o)?i.request(o)||W.of():a.request(o)||W.of()}):new t(function(o,s){return e(o)?i.request(o,s)||W.of():a.request(o,s)||W.of()})},t.execute=function(e,r){return e.request(Nc(r.context,Rc(Dc(r))))||W.of()},t.concat=function(e,r){var n=zi(e);if(lo(n))return __DEV__&&I.warn(new wm("You are calling concat on a terminating link, which will have no effect",n)),n;var i=zi(r);return lo(i)?new t(function(a){return n.request(a,function(o){return i.request(o)||W.of()})||W.of()}):new t(function(a,o){return n.request(a,function(s){return i.request(s,o)||W.of()})||W.of()})},t.prototype.split=function(e,r,n){return this.concat(t.split(e,r,n||new t(Of)))},t.prototype.concat=function(e){return t.concat(this,e)},t.prototype.request=function(e,r){throw __DEV__?new V("request is not implemented"):new V(22)},t.prototype.onError=function(e,r){if(r&&r.error)return r.error(e),!1;throw e},t.prototype.setOnError=function(e){return this.onError=e,this},t}();var Wn=St.execute;var Df="3.7.10";function Nf(t){return!!t.body}function Rf(t){return!!t.getReader}function Pf(t){return!!(vr&&t[Symbol.asyncIterator])}function Lf(t){return!!t.stream}function $f(t){return!!t.arrayBuffer}function Ff(t){return!!t.pipe}function Pc(t){var e,r=t[Symbol.asyncIterator]();return e={next:function(){return r.next()}},e[Symbol.asyncIterator]=function(){return this},e}function Lc(t){var e=null,r=null,n=!1,i=[],a=[];function o(d){if(!r){if(a.length){var p=a.shift();if(Array.isArray(p)&&p[0])return p[0]({value:d,done:!1})}i.push(d)}}function s(d){r=d;var p=a.slice();p.forEach(function(f){f[1](d)}),!e||e()}function u(){n=!0;var d=a.slice();d.forEach(function(p){p[0]({value:void 0,done:!0})}),!e||e()}e=function(){e=null,t.removeListener("data",o),t.removeListener("error",s),t.removeListener("end",u),t.removeListener("finish",u),t.removeListener("close",u)},t.on("data",o),t.on("error",s),t.on("end",u),t.on("finish",u),t.on("close",u);function c(){return new Promise(function(d,p){if(r)return p(r);if(i.length)return d({value:i.shift(),done:!1});if(n)return d({value:void 0,done:!0});a.push([d,p])})}var l={next:function(){return c()}};return vr&&(l[Symbol.asyncIterator]=function(){return this}),l}function $c(t){var e=!1,r={next:function(){return e?Promise.resolve({value:void 0,done:!0}):(e=!0,new Promise(function(n,i){t.then(function(a){n({value:a,done:!1})}).catch(i)}))}};return vr&&(r[Symbol.asyncIterator]=function(){return this}),r}function fo(t){var e={next:function(){return t.read()}};return vr&&(e[Symbol.asyncIterator]=function(){return this}),e}function Mf(t){var e=t;if(Nf(t)&&(e=t.body),Pf(e))return Pc(e);if(Rf(e))return fo(e.getReader());if(Lf(e))return fo(e.stream().getReader());if($f(e))return $c(e.arrayBuffer());if(Ff(e))return Lc(e);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var Uf=Object.prototype.hasOwnProperty;function jf(t,e){var r,n,i;return Tt(this,void 0,void 0,function(){var a,o,s,u,c,l,d,p,f,h,g,y,S,b,v,m,A,D,E,O;return At(this,function(P){switch(P.label){case 0:if(TextDecoder===void 0)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");a=new TextDecoder("utf-8"),o=(r=t.headers)===null||r===void 0?void 0:r.get("content-type"),s="boundary=",u=o?.includes(s)?o?.substring(o?.indexOf(s)+s.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",c="--".concat(u),l="",d=Mf(t),p=!0,P.label=1;case 1:return p?[4,d.next()]:[3,3];case 2:for(f=P.sent(),h=f.value,g=f.done,y=typeof h=="string"?h:a.decode(h),p=!g,l+=y,S=l.indexOf(c);S>-1;){if(b=void 0,O=[l.slice(0,S),l.slice(S+c.length)],b=O[0],l=O[1],b.trim()){if(v=b.indexOf(`\r
|
|
24
|
+
`))}function $m(t){return t.indexOf(`
|
|
25
|
+
`)!==-1}function pf(t){return t!=null&&t.some($m)}function Ri(t){return t.kind===Oe.FIELD||t.kind===Oe.FRAGMENT_SPREAD||t.kind===Oe.INLINE_FRAGMENT}function df(){return typeof eo=="function"?oc():oc()}function Gm(){__DEV__?I(typeof Kr=="boolean",Kr):I(typeof Kr=="boolean",39)}df();Gm();function er(t,e){var r=t.directives;return!r||!r.length?!0:hf(r).every(function(n){var i=n.directive,a=n.ifArgument,o=!1;return a.value.kind==="Variable"?(o=e&&e[a.value.name.value],__DEV__?I(o!==void 0,"Invalid variable referenced in @".concat(i.name.value," directive.")):I(o!==void 0,40)):o=a.value.value,i.name.value==="skip"?!o:o})}function qn(t,e,r){var n=new Set(t),i=n.size;return Ke(e,{Directive:function(a){if(n.delete(a.name.value)&&(!r||!n.size))return Zr}}),r?!n.size:n.size<i}function lc(t){return t&&qn(["client","export"],t,!0)}function Hm(t){var e=t.name.value;return e==="skip"||e==="include"}function hf(t){var e=[];return t&&t.length&&t.forEach(function(r){if(!!Hm(r)){var n=r.arguments,i=r.name.value;__DEV__?I(n&&n.length===1,"Incorrect number of arguments for the @".concat(i," directive.")):I(n&&n.length===1,41);var a=n[0];__DEV__?I(a.name&&a.name.value==="if","Invalid argument for the @".concat(i," directive.")):I(a.name&&a.name.value==="if",42);var o=a.value;__DEV__?I(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),"Argument for the @".concat(i," directive must be a variable or a boolean value.")):I(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),43),e.push({directive:r,ifArgument:a})}}),e}function fc(t,e){var r=e,n=[];t.definitions.forEach(function(a){if(a.kind==="OperationDefinition")throw __DEV__?new V("Found a ".concat(a.operation," operation").concat(a.name?" named '".concat(a.name.value,"'"):"",". ")+"No operations are allowed when using a fragment as a query. Only fragments are allowed."):new V(44);a.kind==="FragmentDefinition"&&n.push(a)}),typeof r>"u"&&(__DEV__?I(n.length===1,"Found ".concat(n.length," fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")):I(n.length===1,45),r=n[0].name.value);var i=_(_({},t),{definitions:mr([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],t.definitions,!0)});return i}function Yr(t){t===void 0&&(t=[]);var e={};return t.forEach(function(r){e[r.name.value]=r}),e}function Jr(t,e){switch(t.kind){case"InlineFragment":return t;case"FragmentSpread":{var r=t.name.value;if(typeof e=="function")return e(r);var n=e&&e[r];return __DEV__?I(n,"No fragment named ".concat(r)):I(n,46),n||null}default:return null}}function ee(t){return t!==null&&typeof t=="object"}function jt(t){return{__ref:String(t)}}function K(t){return Boolean(t&&typeof t=="object"&&typeof t.__ref=="string")}function pc(t){return ee(t)&&t.kind==="Document"&&Array.isArray(t.definitions)}function Wm(t){return t.kind==="StringValue"}function Km(t){return t.kind==="BooleanValue"}function Zm(t){return t.kind==="IntValue"}function Ym(t){return t.kind==="FloatValue"}function Jm(t){return t.kind==="Variable"}function Xm(t){return t.kind==="ObjectValue"}function e1(t){return t.kind==="ListValue"}function t1(t){return t.kind==="EnumValue"}function r1(t){return t.kind==="NullValue"}function yr(t,e,r,n){if(Zm(r)||Ym(r))t[e.value]=Number(r.value);else if(Km(r)||Wm(r))t[e.value]=r.value;else if(Xm(r)){var i={};r.fields.map(function(o){return yr(i,o.name,o.value,n)}),t[e.value]=i}else if(Jm(r)){var a=(n||{})[r.name.value];t[e.value]=a}else if(e1(r))t[e.value]=r.values.map(function(o){var s={};return yr(s,e,o,n),s[e.value]});else if(t1(r))t[e.value]=r.value;else if(r1(r))t[e.value]=null;else throw __DEV__?new V('The inline argument "'.concat(e.value,'" of kind "').concat(r.kind,'"')+"is not supported. Use variables instead of inline arguments to overcome this limitation."):new V(55)}function dc(t,e){var r=null;t.directives&&(r={},t.directives.forEach(function(i){r[i.name.value]={},i.arguments&&i.arguments.forEach(function(a){var o=a.name,s=a.value;return yr(r[i.name.value],o,s,e)})}));var n=null;return t.arguments&&t.arguments.length&&(n={},t.arguments.forEach(function(i){var a=i.name,o=i.value;return yr(n,a,o,e)})),Li(t.name.value,n,r)}var n1=["connection","include","skip","client","rest","export"],Li=Object.assign(function(t,e,r){if(e&&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(s){i[s]=e[s]}),"".concat(r.connection.key,"(").concat(Pi(i),")")}else return r.connection.key;var a=t;if(e){var o=Pi(e);a+="(".concat(o,")")}return r&&Object.keys(r).forEach(function(s){n1.indexOf(s)===-1&&(r[s]&&Object.keys(r[s]).length?a+="@".concat(s,"(").concat(Pi(r[s]),")"):a+="@".concat(s))}),a},{setStringify:function(t){var e=Pi;return Pi=t,e}}),Pi=function(e){return JSON.stringify(e,i1)};function i1(t,e){return ee(e)&&!Array.isArray(e)&&(e=Object.keys(e).sort().reduce(function(r,n){return r[n]=e[n],r},{})),e}function tr(t,e){if(t.arguments&&t.arguments.length){var r={};return t.arguments.forEach(function(n){var i=n.name,a=n.value;return yr(r,i,a,e)}),r}return null}function _t(t){return t.alias?t.alias.value:t.name.value}function $i(t,e,r){if(typeof t.__typename=="string")return t.__typename;for(var n=0,i=e.selections;n<i.length;n++){var a=i[n];if(pt(a)){if(a.name.value==="__typename")return t[_t(a)]}else{var o=$i(t,Jr(a,r).selectionSet,r);if(typeof o=="string")return o}}}function pt(t){return t.kind==="Field"}function hc(t){return t.kind==="InlineFragment"}function Bn(t){__DEV__?I(t&&t.kind==="Document",'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'):I(t&&t.kind==="Document",47);var e=t.definitions.filter(function(r){return r.kind!=="FragmentDefinition"}).map(function(r){if(r.kind!=="OperationDefinition")throw __DEV__?new V('Schema type definitions not allowed in queries. Found: "'.concat(r.kind,'"')):new V(48);return r});return __DEV__?I(e.length<=1,"Ambiguous GraphQL document: contains ".concat(e.length," operations")):I(e.length<=1,49),t}function qt(t){return Bn(t),t.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function Vn(t){return t.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function Xr(t){return t.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function Fi(t){var e=qt(t);return __DEV__?I(e&&e.operation==="query","Must contain a query definition."):I(e&&e.operation==="query",50),e}function mc(t){__DEV__?I(t.kind==="Document",'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'):I(t.kind==="Document",51),__DEV__?I(t.definitions.length<=1,"Fragment must have exactly one definition."):I(t.definitions.length<=1,52);var e=t.definitions[0];return __DEV__?I(e.kind==="FragmentDefinition","Must be a fragment definition."):I(e.kind==="FragmentDefinition",53),e}function en(t){Bn(t);for(var e,r=0,n=t.definitions;r<n.length;r++){var i=n[r];if(i.kind==="OperationDefinition"){var a=i.operation;if(a==="query"||a==="mutation"||a==="subscription")return i}i.kind==="FragmentDefinition"&&!e&&(e=i)}if(e)return e;throw __DEV__?new V("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new V(54)}function tn(t){var e=Object.create(null),r=t&&t.variableDefinitions;return r&&r.length&&r.forEach(function(n){n.defaultValue&&yr(e,n.variable.name,n.defaultValue)}),e}var ue=Array.isArray;function Re(t){return Array.isArray(t)&&t.length>0}var mf={kind:Oe.FIELD,name:{kind:Oe.NAME,value:"__typename"}};function yf(t,e){return!t||t.selectionSet.selections.every(function(r){return r.kind===Oe.FRAGMENT_SPREAD&&yf(e[r.name.value],e)})}function a1(t){return yf(qt(t)||mc(t),Yr(Xr(t)))?null:t}function o1(t){var e=new Set,r=[];return t.forEach(function(n){n.name?e.add(n.name):n.test&&r.push(n.test)}),function(n){return e.has(n.name.value)||r.some(function(i){return i(n)})}}function gf(t){var e=new Map;return function(n){n===void 0&&(n=t);var i=e.get(n);return i||e.set(n,i={variables:new Set,fragmentSpreads:new Set}),i}}function gc(t,e){for(var r=gf(""),n=gf(""),i=function(b){for(var v=0,m=void 0;v<b.length&&(m=b[v]);++v)if(!ue(m)){if(m.kind===Oe.OPERATION_DEFINITION)return r(m.name&&m.name.value);if(m.kind===Oe.FRAGMENT_DEFINITION)return n(m.name.value)}return __DEV__&&I.error("Could not find operation or fragment"),null},a=0,o=e.definitions.length-1;o>=0;--o)e.definitions[o].kind===Oe.OPERATION_DEFINITION&&++a;var s=o1(t),u=t.some(function(b){return b.remove}),c=function(b){return u&&b&&b.some(s)},l=new Map,d=!1,p={enter:function(b){if(c(b.directives))return d=!0,null}},f=Ke(e,{Field:p,InlineFragment:p,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(b,v,m,A,D){var E=i(D);E&&E.variables.add(b.name.value)}},FragmentSpread:{enter:function(b,v,m,A,D){if(c(b.directives))return d=!0,null;var E=i(D);E&&E.fragmentSpreads.add(b.name.value)}},FragmentDefinition:{enter:function(b,v,m,A){l.set(JSON.stringify(A),b)},leave:function(b,v,m,A){var D=l.get(JSON.stringify(A));if(b===D)return b;if(a>0&&b.selectionSet.selections.every(function(E){return E.kind===Oe.FIELD&&E.name.value==="__typename"}))return n(b.name.value).removed=!0,d=!0,null}},Directive:{leave:function(b){if(s(b))return d=!0,null}}});if(!d)return e;var h=function(b){return b.transitiveVars||(b.transitiveVars=new Set(b.variables),b.removed||b.fragmentSpreads.forEach(function(v){h(n(v)).transitiveVars.forEach(function(m){b.transitiveVars.add(m)})})),b},g=new Set;f.definitions.forEach(function(b){b.kind===Oe.OPERATION_DEFINITION?h(r(b.name&&b.name.value)).fragmentSpreads.forEach(function(v){g.add(v)}):b.kind===Oe.FRAGMENT_DEFINITION&&a===0&&!n(b.name.value).removed&&g.add(b.name.value)}),g.forEach(function(b){h(n(b)).fragmentSpreads.forEach(function(v){g.add(v)})});var y=function(b){return!!(!g.has(b)||n(b).removed)},S={enter:function(b){if(y(b.name.value))return null}};return a1(Ke(f,{FragmentSpread:S,FragmentDefinition:S,OperationDefinition:{leave:function(b){if(b.variableDefinitions){var v=h(r(b.name&&b.name.value)).transitiveVars;if(v.size<b.variableDefinitions.length)return _(_({},b),{variableDefinitions:b.variableDefinitions.filter(function(m){return v.has(m.variable.name.value)})})}}}}))}var rn=Object.assign(function(t){return Ke(t,{SelectionSet:{enter:function(e,r,n){if(!(n&&n.kind===Oe.OPERATION_DEFINITION)){var i=e.selections;if(!!i){var a=i.some(function(s){return pt(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=n;if(!(pt(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return _(_({},e),{selections:mr(mr([],i,!0),[mf],!1)})}}}}}})},{added:function(t){return t===mf}}),s1={test:function(t){var e=t.name.value==="connection";return e&&(!t.arguments||!t.arguments.some(function(r){return r.name.value==="key"}))&&__DEV__&&I.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."),e}};function yc(t){return gc([s1],Bn(t))}function vc(t){var e=en(t),r=e.operation;if(r==="query")return t;var n=Ke(t,{OperationDefinition:{enter:function(i){return _(_({},i),{operation:"query"})}}});return n}function bc(t){Bn(t);var e=gc([{test:function(r){return r.name.value==="client"},remove:!0}],t);return e}var c1=Object.prototype.hasOwnProperty;function _c(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Mi(t)}function Mi(t){var e=t[0]||{},r=t.length;if(r>1)for(var n=new it,i=1;i<r;++i)e=n.merge(e,t[i]);return e}var u1=function(t,e,r){return this.merge(t[r],e[r])},it=function(){function t(e){e===void 0&&(e=u1),this.reconciler=e,this.isObject=ee,this.pastCopies=new Set}return t.prototype.merge=function(e,r){for(var n=this,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];return ee(r)&&ee(e)?(Object.keys(r).forEach(function(o){if(c1.call(e,o)){var s=e[o];if(r[o]!==s){var u=n.reconciler.apply(n,mr([e,r,o],i,!1));u!==s&&(e=n.shallowCopyForMerge(e),e[o]=u)}}else e=n.shallowCopyForMerge(e),e[o]=r[o]}),e):r},t.prototype.shallowCopyForMerge=function(e){return ee(e)&&(this.pastCopies.has(e)||(Array.isArray(e)?e=e.slice(0):e=_({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},t}();function l1(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=f1(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
26
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function f1(t,e){if(!!t){if(typeof t=="string")return vf(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vf(t,e)}}function vf(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function bf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ec(t,e,r){return e&&bf(t.prototype,e),r&&bf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var xc=function(){return typeof Symbol=="function"},kc=function(t){return xc()&&Boolean(Symbol[t])},Tc=function(t){return kc(t)?Symbol[t]:"@@"+t};xc()&&!kc("observable")&&(Symbol.observable=Symbol("observable"));var p1=Tc("iterator"),Sc=Tc("observable"),_f=Tc("species");function no(t,e){var r=t[e];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function Ui(t){var e=t.constructor;return e!==void 0&&(e=e[_f],e===null&&(e=void 0)),e!==void 0?e:W}function d1(t){return t instanceof W}function zn(t){zn.log?zn.log(t):setTimeout(function(){throw t})}function ro(t){Promise.resolve().then(function(){try{t()}catch(e){zn(e)}})}function wf(t){var e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var r=no(e,"unsubscribe");r&&r.call(e)}}catch(n){zn(n)}}function Cc(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function h1(t){var e=t._queue;if(!!e){t._queue=void 0,t._state="ready";for(var r=0;r<e.length&&(Sf(t,e[r].type,e[r].value),t._state!=="closed");++r);}}function Sf(t,e,r){t._state="running";var n=t._observer;try{var i=no(n,e);switch(e){case"next":i&&i.call(n,r);break;case"error":if(Cc(t),i)i.call(n,r);else throw r;break;case"complete":Cc(t),i&&i.call(n);break}}catch(a){zn(a)}t._state==="closed"?wf(t):t._state==="running"&&(t._state="ready")}function wc(t,e,r){if(t._state!=="closed"){if(t._state==="buffering"){t._queue.push({type:e,value:r});return}if(t._state!=="ready"){t._state="buffering",t._queue=[{type:e,value:r}],ro(function(){return h1(t)});return}Sf(t,e,r)}}var m1=function(){function t(r,n){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var i=new g1(this);try{this._cleanup=n.call(void 0,i)}catch(a){i.error(a)}this._state==="initializing"&&(this._state="ready")}var e=t.prototype;return e.unsubscribe=function(){this._state!=="closed"&&(Cc(this),wf(this))},Ec(t,[{key:"closed",get:function(){return this._state==="closed"}}]),t}(),g1=function(){function t(r){this._subscription=r}var e=t.prototype;return e.next=function(n){wc(this._subscription,"next",n)},e.error=function(n){wc(this._subscription,"error",n)},e.complete=function(){wc(this._subscription,"complete")},Ec(t,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),t}(),W=function(){function t(r){if(!(this instanceof t))throw new TypeError("Observable cannot be called as a function");if(typeof r!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=r}var e=t.prototype;return e.subscribe=function(n){return(typeof n!="object"||n===null)&&(n={next:n,error:arguments[1],complete:arguments[2]}),new m1(n,this._subscriber)},e.forEach=function(n){var i=this;return new Promise(function(a,o){if(typeof n!="function"){o(new TypeError(n+" is not a function"));return}function s(){u.unsubscribe(),a()}var u=i.subscribe({next:function(c){try{n(c,s)}catch(l){o(l),u.unsubscribe()}},error:o,complete:a})})},e.map=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Ui(this);return new a(function(o){return i.subscribe({next:function(s){try{s=n(s)}catch(u){return o.error(u)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},e.filter=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Ui(this);return new a(function(o){return i.subscribe({next:function(s){try{if(!n(s))return}catch(u){return o.error(u)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},e.reduce=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Ui(this),o=arguments.length>1,s=!1,u=arguments[1],c=u;return new a(function(l){return i.subscribe({next:function(d){var p=!s;if(s=!0,!p||o)try{c=n(c,d)}catch(f){return l.error(f)}else c=d},error:function(d){l.error(d)},complete:function(){if(!s&&!o)return l.error(new TypeError("Cannot reduce an empty sequence"));l.next(c),l.complete()}})})},e.concat=function(){for(var n=this,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];var s=Ui(this);return new s(function(u){var c,l=0;function d(p){c=p.subscribe({next:function(f){u.next(f)},error:function(f){u.error(f)},complete:function(){l===a.length?(c=void 0,u.complete()):d(s.from(a[l++]))}})}return d(n),function(){c&&(c.unsubscribe(),c=void 0)}})},e.flatMap=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Ui(this);return new a(function(o){var s=[],u=i.subscribe({next:function(l){if(n)try{l=n(l)}catch(p){return o.error(p)}var d=a.from(l).subscribe({next:function(p){o.next(p)},error:function(p){o.error(p)},complete:function(){var p=s.indexOf(d);p>=0&&s.splice(p,1),c()}});s.push(d)},error:function(l){o.error(l)},complete:function(){c()}});function c(){u.closed&&s.length===0&&o.complete()}return function(){s.forEach(function(l){return l.unsubscribe()}),u.unsubscribe()}})},e[Sc]=function(){return this},t.from=function(n){var i=typeof this=="function"?this:t;if(n==null)throw new TypeError(n+" is not an object");var a=no(n,Sc);if(a){var o=a.call(n);if(Object(o)!==o)throw new TypeError(o+" is not an object");return d1(o)&&o.constructor===i?o:new i(function(s){return o.subscribe(s)})}if(kc("iterator")&&(a=no(n,p1),a))return new i(function(s){ro(function(){if(!s.closed){for(var u=l1(a.call(n)),c;!(c=u()).done;){var l=c.value;if(s.next(l),s.closed)return}s.complete()}})});if(Array.isArray(n))return new i(function(s){ro(function(){if(!s.closed){for(var u=0;u<n.length;++u)if(s.next(n[u]),s.closed)return;s.complete()}})});throw new TypeError(n+" is not observable")},t.of=function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];var o=typeof this=="function"?this:t;return new o(function(s){ro(function(){if(!s.closed){for(var u=0;u<i.length;++u)if(s.next(i[u]),s.closed)return;s.complete()}})})},Ec(t,null,[{key:_f,get:function(){return this}}]),t}();xc()&&Object.defineProperty(W,Symbol("extensions"),{value:{symbol:Sc,hostReportError:zn},configurable:!0});function Ac(t){var e,r=t.Symbol;if(typeof r=="function")if(r.observable)e=r.observable;else{typeof r.for=="function"?e=r.for("https://github.com/benlesh/symbol-observable"):e=r("https://github.com/benlesh/symbol-observable");try{r.observable=e}catch{}}else e="@@observable";return e}var Qn;typeof self<"u"?Qn=self:typeof window<"u"?Qn=window:typeof global<"u"?Qn=global:typeof module<"u"?Qn=module:Qn=Function("return this")();var v_=Ac(Qn);var Cf=W.prototype,Ef="@@observable";Cf[Ef]||(Cf[Ef]=function(){return this});var y1=Object.prototype.toString;function io(t){return Ic(t)}function Ic(t,e){switch(y1.call(t)){case"[object Array]":{if(e=e||new Map,e.has(t))return e.get(t);var r=t.slice(0);return e.set(t,r),r.forEach(function(i,a){r[a]=Ic(i,e)}),r}case"[object Object]":{if(e=e||new Map,e.has(t))return e.get(t);var n=Object.create(Object.getPrototypeOf(t));return e.set(t,n),Object.keys(t).forEach(function(i){n[i]=Ic(t[i],e)}),n}default:return t}}function v1(t){var e=new Set([t]);return e.forEach(function(r){ee(r)&&b1(r)===r&&Object.getOwnPropertyNames(r).forEach(function(n){ee(r[n])&&e.add(r[n])})}),t}function b1(t){if(__DEV__&&!Object.isFrozen(t))try{Object.freeze(t)}catch(e){if(e instanceof TypeError)return null;throw e}return t}function ji(t){return __DEV__&&v1(t),t}function nn(t,e,r){var n=[];t.forEach(function(i){return i[e]&&n.push(i)}),n.forEach(function(i){return i[e](r)})}function ao(t,e,r){return new W(function(n){var i=n.next,a=n.error,o=n.complete,s=0,u=!1,c={then:function(f){return new Promise(function(h){return h(f())})}};function l(f,h){return f?function(g){++s;var y=function(){return f(g)};c=c.then(y,y).then(function(S){--s,i&&i.call(n,S),u&&d.complete()},function(S){throw--s,S}).catch(function(S){a&&a.call(n,S)})}:function(g){return h&&h.call(n,g)}}var d={next:l(e,i),error:l(r,a),complete:function(){u=!0,s||o&&o.call(n)}},p=t.subscribe(d);return function(){return p.unsubscribe()}})}var wt=typeof WeakMap=="function"&&Ue(function(){return navigator.product})!=="ReactNative",xf=typeof WeakSet=="function",Oc=typeof Symbol=="function"&&typeof Symbol.for=="function",vr=Oc&&Symbol.asyncIterator,D_=typeof Ue(function(){return window.document.createElement})=="function",N_=Ue(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1;function oo(t){function e(r){Object.defineProperty(t,r,{value:W})}return Oc&&Symbol.species&&e(Symbol.species),e("@@species"),t}function kf(t){return t&&typeof t.then=="function"}var Gn=function(t){xe(e,t);function e(r){var n=t.call(this,function(i){return n.addObserver(i),function(){return n.removeObserver(i)}})||this;return n.observers=new Set,n.promise=new Promise(function(i,a){n.resolve=i,n.reject=a}),n.handlers={next:function(i){n.sub!==null&&(n.latest=["next",i],n.notify("next",i),nn(n.observers,"next",i))},error:function(i){var a=n.sub;a!==null&&(a&&setTimeout(function(){return a.unsubscribe()}),n.sub=null,n.latest=["error",i],n.reject(i),n.notify("error",i),nn(n.observers,"error",i))},complete:function(){var i=n,a=i.sub,o=i.sources,s=o===void 0?[]:o;if(a!==null){var u=s.shift();u?kf(u)?u.then(function(c){return n.sub=c.subscribe(n.handlers)}):n.sub=u.subscribe(n.handlers):(a&&setTimeout(function(){return a.unsubscribe()}),n.sub=null,n.latest&&n.latest[0]==="next"?n.resolve(n.latest[1]):n.resolve(),n.notify("complete"),nn(n.observers,"complete"))}}},n.nextResultListeners=new Set,n.cancel=function(i){n.reject(i),n.sources=[],n.handlers.complete()},n.promise.catch(function(i){}),typeof r=="function"&&(r=[new W(r)]),kf(r)?r.then(function(i){return n.start(i)},n.handlers.error):n.start(r),n}return e.prototype.start=function(r){this.sub===void 0&&(this.sources=Array.from(r),this.handlers.complete())},e.prototype.deliverLastMessage=function(r){if(this.latest){var n=this.latest[0],i=r[n];i&&i.call(r,this.latest[1]),this.sub===null&&n==="next"&&r.complete&&r.complete()}},e.prototype.addObserver=function(r){this.observers.has(r)||(this.deliverLastMessage(r),this.observers.add(r))},e.prototype.removeObserver=function(r){this.observers.delete(r)&&this.observers.size<1&&this.handlers.complete()},e.prototype.notify=function(r,n){var i=this.nextResultListeners;i.size&&(this.nextResultListeners=new Set,i.forEach(function(a){return a(r,n)}))},e.prototype.beforeNext=function(r){var n=!1;this.nextResultListeners.add(function(i,a){n||(n=!0,r(i,a))})},e}(W);oo(Gn);function br(t){return"incremental"in t}function _1(t){return"hasNext"in t&&"data"in t}function Tf(t){return br(t)||_1(t)}function so(t,e){var r=t,n=new it;return br(e)&&Re(e.incremental)&&e.incremental.forEach(function(i){for(var a=i.data,o=i.path,s=o.length-1;s>=0;--s){var u=o[s],c=!isNaN(+u),l=c?[]:{};l[u]=a,a=l}r=n.merge(r,a)}),r}function Hn(t){var e=co(t);return Re(e)}function co(t){var e=Re(t.errors)?t.errors.slice(0):[];return br(t)&&Re(t.incremental)&&t.incremental.forEach(function(r){r.errors&&e.push.apply(e,r.errors)}),e}function _r(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Object.create(null);return t.forEach(function(n){!n||Object.keys(n).forEach(function(i){var a=n[i];a!==void 0&&(r[i]=a)})}),r}var Af=new Map;function qi(t){var e=Af.get(t)||1;return Af.set(t,e+1),"".concat(t,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function If(t){var e=qi("stringifyForDisplay");return JSON.stringify(t,function(r,n){return n===void 0?e:n}).split(JSON.stringify(e)).join("<undefined>")}function Bi(t,e){return _r(t,e,e.variables&&{variables:_(_({},t&&t.variables),e.variables)})}function uo(t){return new W(function(e){e.error(t)})}var Vi=function(t,e,r){var n=new Error(r);throw n.name="ServerError",n.response=t,n.statusCode=t.status,n.result=e,n};function Dc(t){for(var e=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(t);r<n.length;r++){var i=n[r];if(e.indexOf(i)<0)throw __DEV__?new V("illegal argument: ".concat(i)):new V(27)}return t}function Nc(t,e){var r=_({},t),n=function(a){typeof a=="function"?r=_(_({},r),a(r)):r=_(_({},r),a)},i=function(){return _({},r)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:n}),Object.defineProperty(e,"getContext",{enumerable:!1,value:i}),e}function Rc(t){var e={variables:t.variables||{},extensions:t.extensions||{},operationName:t.operationName,query:t.query};return e.operationName||(e.operationName=typeof e.query!="string"?Vn(e.query)||void 0:""),e}function Of(t,e){return e?e(t):W.of()}function zi(t){return typeof t=="function"?new St(t):t}function lo(t){return t.request.length<=1}var w1=function(t){xe(e,t);function e(r,n){var i=t.call(this,r)||this;return i.link=n,i}return e}(Error),St=function(){function t(e){e&&(this.request=e)}return t.empty=function(){return new t(function(){return W.of()})},t.from=function(e){return e.length===0?t.empty():e.map(zi).reduce(function(r,n){return r.concat(n)})},t.split=function(e,r,n){var i=zi(r),a=zi(n||new t(Of));return lo(i)&&lo(a)?new t(function(o){return e(o)?i.request(o)||W.of():a.request(o)||W.of()}):new t(function(o,s){return e(o)?i.request(o,s)||W.of():a.request(o,s)||W.of()})},t.execute=function(e,r){return e.request(Nc(r.context,Rc(Dc(r))))||W.of()},t.concat=function(e,r){var n=zi(e);if(lo(n))return __DEV__&&I.warn(new w1("You are calling concat on a terminating link, which will have no effect",n)),n;var i=zi(r);return lo(i)?new t(function(a){return n.request(a,function(o){return i.request(o)||W.of()})||W.of()}):new t(function(a,o){return n.request(a,function(s){return i.request(s,o)||W.of()})||W.of()})},t.prototype.split=function(e,r,n){return this.concat(t.split(e,r,n||new t(Of)))},t.prototype.concat=function(e){return t.concat(this,e)},t.prototype.request=function(e,r){throw __DEV__?new V("request is not implemented"):new V(22)},t.prototype.onError=function(e,r){if(r&&r.error)return r.error(e),!1;throw e},t.prototype.setOnError=function(e){return this.onError=e,this},t}();var Wn=St.execute;var Df="3.7.10";function Nf(t){return!!t.body}function Rf(t){return!!t.getReader}function Pf(t){return!!(vr&&t[Symbol.asyncIterator])}function Lf(t){return!!t.stream}function $f(t){return!!t.arrayBuffer}function Ff(t){return!!t.pipe}function Pc(t){var e,r=t[Symbol.asyncIterator]();return e={next:function(){return r.next()}},e[Symbol.asyncIterator]=function(){return this},e}function Lc(t){var e=null,r=null,n=!1,i=[],a=[];function o(d){if(!r){if(a.length){var p=a.shift();if(Array.isArray(p)&&p[0])return p[0]({value:d,done:!1})}i.push(d)}}function s(d){r=d;var p=a.slice();p.forEach(function(f){f[1](d)}),!e||e()}function u(){n=!0;var d=a.slice();d.forEach(function(p){p[0]({value:void 0,done:!0})}),!e||e()}e=function(){e=null,t.removeListener("data",o),t.removeListener("error",s),t.removeListener("end",u),t.removeListener("finish",u),t.removeListener("close",u)},t.on("data",o),t.on("error",s),t.on("end",u),t.on("finish",u),t.on("close",u);function c(){return new Promise(function(d,p){if(r)return p(r);if(i.length)return d({value:i.shift(),done:!1});if(n)return d({value:void 0,done:!0});a.push([d,p])})}var l={next:function(){return c()}};return vr&&(l[Symbol.asyncIterator]=function(){return this}),l}function $c(t){var e=!1,r={next:function(){return e?Promise.resolve({value:void 0,done:!0}):(e=!0,new Promise(function(n,i){t.then(function(a){n({value:a,done:!1})}).catch(i)}))}};return vr&&(r[Symbol.asyncIterator]=function(){return this}),r}function fo(t){var e={next:function(){return t.read()}};return vr&&(e[Symbol.asyncIterator]=function(){return this}),e}function Mf(t){var e=t;if(Nf(t)&&(e=t.body),Pf(e))return Pc(e);if(Rf(e))return fo(e.getReader());if(Lf(e))return fo(e.stream().getReader());if($f(e))return $c(e.arrayBuffer());if(Ff(e))return Lc(e);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var Uf=Object.prototype.hasOwnProperty;function jf(t,e){var r,n,i;return Tt(this,void 0,void 0,function(){var a,o,s,u,c,l,d,p,f,h,g,y,S,b,v,m,A,D,E,O;return At(this,function(P){switch(P.label){case 0:if(TextDecoder===void 0)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");a=new TextDecoder("utf-8"),o=(r=t.headers)===null||r===void 0?void 0:r.get("content-type"),s="boundary=",u=o?.includes(s)?o?.substring(o?.indexOf(s)+s.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",c="--".concat(u),l="",d=Mf(t),p=!0,P.label=1;case 1:return p?[4,d.next()]:[3,3];case 2:for(f=P.sent(),h=f.value,g=f.done,y=typeof h=="string"?h:a.decode(h),p=!g,l+=y,S=l.indexOf(c);S>-1;){if(b=void 0,O=[l.slice(0,S),l.slice(S+c.length)],b=O[0],l=O[1],b.trim()){if(v=b.indexOf(`\r
|
|
27
27
|
\r
|
|
28
|
-
`),m=
|
|
29
|
-
`,"")),(Object.keys(E).length>1||"data"in E||"incremental"in E||"errors"in E)&&((n=e.next)===null||n===void 0||n.call(e,E))}catch(N){po(N,e)}}S=l.indexOf(c)}return[3,1];case 3:return(i=e.complete)===null||i===void 0||i.call(e),[2]}})})}function
|
|
30
|
-
`).forEach(function(r){var n=r.indexOf(":");if(n>-1){var i=r.slice(0,n).trim().toLowerCase(),a=r.slice(n+1).trim();e[i]=a}}),e}function qf(t,e){if(t.status>=300){var r=function(){try{return JSON.parse(e)}catch{return e}};Vi(t,r(),"Response not successful: Received status code ".concat(t.status))}try{return JSON.parse(e)}catch(i){var n=i;throw n.name="ServerParseError",n.response=t,n.statusCode=t.status,n.bodyText=e,n}}function po(t,e){var r,n;t.name!=="AbortError"&&(t.result&&t.result.errors&&t.result.data&&((r=e.next)===null||r===void 0||r.call(e,t.result)),(n=e.error)===null||n===void 0||n.call(e,t))}function Bf(t,e,r){
|
|
28
|
+
`),m=S1(b.slice(0,v)),A=m["content-type"],A&&A.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");D=b.slice(v);try{E=qf(t,D.replace(`\r
|
|
29
|
+
`,"")),(Object.keys(E).length>1||"data"in E||"incremental"in E||"errors"in E)&&((n=e.next)===null||n===void 0||n.call(e,E))}catch(N){po(N,e)}}S=l.indexOf(c)}return[3,1];case 3:return(i=e.complete)===null||i===void 0||i.call(e),[2]}})})}function S1(t){var e={};return t.split(`
|
|
30
|
+
`).forEach(function(r){var n=r.indexOf(":");if(n>-1){var i=r.slice(0,n).trim().toLowerCase(),a=r.slice(n+1).trim();e[i]=a}}),e}function qf(t,e){if(t.status>=300){var r=function(){try{return JSON.parse(e)}catch{return e}};Vi(t,r(),"Response not successful: Received status code ".concat(t.status))}try{return JSON.parse(e)}catch(i){var n=i;throw n.name="ServerParseError",n.response=t,n.statusCode=t.status,n.bodyText=e,n}}function po(t,e){var r,n;t.name!=="AbortError"&&(t.result&&t.result.errors&&t.result.data&&((r=e.next)===null||r===void 0||r.call(e,t.result)),(n=e.error)===null||n===void 0||n.call(e,t))}function Bf(t,e,r){C1(e)(t).then(function(n){var i,a;(i=r.next)===null||i===void 0||i.call(r,n),(a=r.complete)===null||a===void 0||a.call(r)}).catch(function(n){return po(n,r)})}function C1(t){return function(e){return e.text().then(function(r){return qf(e,r)}).then(function(r){return e.status>=300&&Vi(e,r,"Response not successful: Received status code ".concat(e.status)),!Array.isArray(r)&&!Uf.call(r,"data")&&!Uf.call(r,"errors")&&Vi(e,r,"Server response was missing for query '".concat(Array.isArray(t)?t.map(function(n){return n.operationName}):t.operationName,"'.")),r})}}var Qi=function(t,e){var r;try{r=JSON.stringify(t)}catch(i){var n=__DEV__?new V("Network request failed. ".concat(e," is not serializable: ").concat(i.message)):new V(24);throw n.parseError=i,n}return r};var E1={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},x1={accept:"*/*","content-type":"application/json"},k1={method:"POST"},Vf={http:E1,headers:x1,options:k1},zf=function(t,e){return e(t)};function Qf(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i={},a={};r.forEach(function(d){i=_(_(_({},i),d.options),{headers:_(_({},i.headers),d.headers)}),d.credentials&&(i.credentials=d.credentials),a=_(_({},a),d.http)}),i.headers&&(i.headers=T1(i.headers,a.preserveHeaderCase));var o=t.operationName,s=t.extensions,u=t.variables,c=t.query,l={operationName:o,variables:u};return a.includeExtensions&&(l.extensions=s),a.includeQuery&&(l.query=e(c,jn)),{options:i,body:l}}function T1(t,e){if(!e){var r=Object.create(null);return Object.keys(Object(t)).forEach(function(a){r[a.toLowerCase()]=t[a]}),r}var n=Object.create(null);Object.keys(Object(t)).forEach(function(a){n[a.toLowerCase()]={originalName:a,value:t[a]}});var i=Object.create(null);return Object.keys(n).forEach(function(a){i[n[a].originalName]=n[a].value}),i}var Gf=function(t){if(!t&&typeof fetch>"u")throw __DEV__?new V(`
|
|
31
31
|
"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:
|
|
32
32
|
|
|
33
33
|
import fetch from 'cross-fetch';
|
|
@@ -35,7 +35,7 @@ import { ApolloClient, HttpLink } from '@apollo/client';
|
|
|
35
35
|
const client = new ApolloClient({
|
|
36
36
|
link: new HttpLink({ uri: '/graphql', fetch })
|
|
37
37
|
});
|
|
38
|
-
`):new V(23)};var Hf=function(){if(typeof AbortController>"u")return{controller:!1,signal:!1};var t=new AbortController,e=t.signal;return{controller:t,signal:e}};var Wf=function(t,e){var r=t.getContext(),n=r.uri;return n||(typeof e=="function"?e(t):e||"/graphql")};function Kf(t,e){var r=[],n=function(d,p){r.push("".concat(d,"=").concat(encodeURIComponent(p)))};if("query"in e&&n("query",e.query),e.operationName&&n("operationName",e.operationName),e.variables){var i=void 0;try{i=Qi(e.variables,"Variables map")}catch(d){return{parseError:d}}n("variables",i)}if(e.extensions){var a=void 0;try{a=Qi(e.extensions,"Extensions map")}catch(d){return{parseError:d}}n("extensions",a)}var o="",s=t,u=t.indexOf("#");u!==-1&&(o=t.substr(u),s=t.substr(0,u));var c=s.indexOf("?")===-1?"?":"&",l=s+c+r.join("&")+o;return{newURI:l}}var Zf=Ue(function(){return fetch}),Yf=function(t){t===void 0&&(t={});var e=t.uri,r=e===void 0?"/graphql":e,n=t.fetch,i=t.print,a=i===void 0?zf:i,o=t.includeExtensions,s=t.preserveHeaderCase,u=t.useGETForQueries,c=t.includeUnusedVariables,l=c===void 0?!1:c,d=Ut(t,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);__DEV__&&Gf(n||Zf);var p={http:{includeExtensions:o,preserveHeaderCase:s},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new St(function(f){var h=Wf(f,r),g=f.getContext(),y={};if(g.clientAwareness){var S=g.clientAwareness,b=S.name,v=S.version;b&&(y["apollographql-client-name"]=b),v&&(y["apollographql-client-version"]=v)}var m=_(_({},y),g.headers),A={http:g.http,options:g.fetchOptions,credentials:g.credentials,headers:m},D=Qf(f,a,Vf,p,A),E=D.options,O=D.body;if(O.variables&&!l){var P=new Set(Object.keys(O.variables));Ke(f.query,{Variable:function(X,Ft,H){H&&H.kind!=="VariableDefinition"&&P.delete(X.name.value)}}),P.size&&(O.variables=_({},O.variables),P.forEach(function(X){delete O.variables[X]}))}var N;if(!E.signal){var j=Hf(),qe=j.controller,Ne=j.signal;N=qe,N&&(E.signal=Ne)}var q=function(X){return X.kind==="OperationDefinition"&&X.operation==="mutation"};if(u&&!f.query.definitions.some(q)&&(E.method="GET"),qn(["defer"],f.query)&&(E.headers=E.headers||{},E.headers.accept="multipart/mixed; deferSpec=20220824, application/json"),E.method==="GET"){var de=Kf(h,O),he=de.newURI,J=de.parseError;if(J)return uo(J);h=he}else try{E.body=Qi(O,"Payload")}catch(X){return uo(X)}return new W(function(X){var Ft=n||Ue(function(){return fetch})||Zf;return Ft(h,E).then(function(H){var Mt;f.setContext({response:H});var fr=(Mt=H.headers)===null||Mt===void 0?void 0:Mt.get("content-type");return fr!==null&&/^multipart\/mixed/i.test(fr)?jf(H,X):Bf(H,f,X)}).catch(function(H){return po(H,X)}),function(){N&&N.abort()}})})};var Fc=function(t){xe(e,t);function e(r){r===void 0&&(r={});var n=t.call(this,Yf(r).request)||this;return n.options=r,n}return e}(St);var{toString:Jf,hasOwnProperty:Am}=Object.prototype,Xf=Function.prototype.toString,Mc=new Map;function be(t,e){try{return Uc(t,e)}finally{Mc.clear()}}function Uc(t,e){if(t===e)return!0;let r=Jf.call(t),n=Jf.call(e);if(r!==n)return!1;switch(r){case"[object Array]":if(t.length!==e.length)return!1;case"[object Object]":{if(tp(t,e))return!0;let i=ep(t),a=ep(e),o=i.length;if(o!==a.length)return!1;for(let s=0;s<o;++s)if(!Am.call(e,i[s]))return!1;for(let s=0;s<o;++s){let u=i[s];if(!Uc(t[u],e[u]))return!1}return!0}case"[object Error]":return t.name===e.name&&t.message===e.message;case"[object Number]":if(t!==t)return e!==e;case"[object Boolean]":case"[object Date]":return+t==+e;case"[object RegExp]":case"[object String]":return t==`${e}`;case"[object Map]":case"[object Set]":{if(t.size!==e.size)return!1;if(tp(t,e))return!0;let i=t.entries(),a=r==="[object Map]";for(;;){let o=i.next();if(o.done)break;let[s,u]=o.value;if(!e.has(s)||a&&!Uc(u,e.get(s)))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]":t=new Uint8Array(t),e=new Uint8Array(e);case"[object DataView]":{let i=t.byteLength;if(i===e.byteLength)for(;i--&&t[i]===e[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{let i=Xf.call(t);return i!==Xf.call(e)?!1:!Dm(i,Om)}}return!1}function ep(t){return Object.keys(t).filter(Im,t)}function Im(t){return this[t]!==void 0}var Om="{ [native code] }";function Dm(t,e){let r=t.length-e.length;return r>=0&&t.indexOf(e,r)===r}function tp(t,e){let r=Mc.get(t);if(r){if(r.has(e))return!0}else Mc.set(t,r=new Set);return r.add(e),!1}var Nm=function(){return Object.create(null)},rp=Array.prototype,Rm=rp.forEach,Pm=rp.slice,Bt=function(){function t(e,r){e===void 0&&(e=!0),r===void 0&&(r=Nm),this.weakness=e,this.makeData=r}return t.prototype.lookup=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return this.lookupArray(e)},t.prototype.lookupArray=function(e){var r=this;return Rm.call(e,function(n){return r=r.getChildTrie(n)}),r.data||(r.data=this.makeData(Pm.call(e)))},t.prototype.getChildTrie=function(e){var r=this.weakness&&Lm(e)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),n=r.get(e);return n||r.set(e,n=new t(this.weakness,this.makeData)),n},t}();function Lm(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}var ze=null,np={},$m=1,Fm=()=>class{constructor(){this.id=["slot",$m++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=ze;e;e=e.parent)if(this.id in e.slots){let r=e.slots[this.id];if(r===np)break;return e!==ze&&(ze.slots[this.id]=r),!0}return ze&&(ze.slots[this.id]=np),!1}getValue(){if(this.hasValue())return ze.slots[this.id]}withValue(e,r,n,i){let a={__proto__:null,[this.id]:e},o=ze;ze={parent:o,slots:a};try{return r.apply(i,n)}finally{ze=o}}static bind(e){let r=ze;return function(){let n=ze;try{return ze=r,e.apply(this,arguments)}finally{ze=n}}}static noContext(e,r,n){if(ze){let i=ze;try{return ze=null,e.apply(n,r)}finally{ze=i}}else return e.apply(n,r)}};function ip(t){try{return t()}catch{}}var jc="@wry/context:Slot",Mm=ip(()=>globalThis)||ip(()=>global)||Object.create(null),ap=Mm,Kn=ap[jc]||Array[jc]||function(t){try{Object.defineProperty(ap,jc,{value:t,enumerable:!1,writable:!1,configurable:!0})}finally{return t}}(Fm());var{bind:Um,noContext:jm}=Kn;function qm(){}var Bm=function(){function t(e,r){e===void 0&&(e=1/0),r===void 0&&(r=qm),this.max=e,this.dispose=r,this.map=new Map,this.newest=null,this.oldest=null}return t.prototype.has=function(e){return this.map.has(e)},t.prototype.get=function(e){var r=this.getNode(e);return r&&r.value},t.prototype.getNode=function(e){var r=this.map.get(e);if(r&&r!==this.newest){var n=r.older,i=r.newer;i&&(i.older=n),n&&(n.newer=i),r.older=this.newest,r.older.newer=r,r.newer=null,this.newest=r,r===this.oldest&&(this.oldest=i)}return r},t.prototype.set=function(e,r){var n=this.getNode(e);return n?n.value=r:(n={key:e,value:r,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)},t.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},t.prototype.delete=function(e){var r=this.map.get(e);return r?(r===this.newest&&(this.newest=r.older),r===this.oldest&&(this.oldest=r.newer),r.newer&&(r.newer.older=r.older),r.older&&(r.older.newer=r.newer),this.map.delete(e),this.dispose(r.value,e),!0):!1},t}(),mo=new Kn,qc,Vm=Object.prototype.hasOwnProperty,Vc=(qc=Array.from,qc===void 0?function(t){var e=[];return t.forEach(function(r){return e.push(r)}),e}:qc);function ho(t){var e=t.unsubscribe;typeof e=="function"&&(t.unsubscribe=void 0,e())}var Gi=[],zm=100;function Zn(t,e){if(!t)throw new Error(e||"assertion failure")}function Qm(t,e){var r=t.length;return r>0&&r===e.length&&t[r-1]===e[r-1]}function sp(t){switch(t.length){case 0:throw new Error("unknown value");case 1:return t[0];case 2:throw t[1]}}function Gm(t){return t.slice(0)}var Hm=function(){function t(e){this.fn=e,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++t.count}return t.prototype.peek=function(){if(this.value.length===1&&!wr(this))return op(this),this.value[0]},t.prototype.recompute=function(e){return Zn(!this.recomputing,"already recomputing"),op(this),wr(this)?Wm(this,e):sp(this.value)},t.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,cp(this),ho(this))},t.prototype.dispose=function(){var e=this;this.setDirty(),dp(this),zc(this,function(r,n){r.setDirty(),hp(r,e)})},t.prototype.forget=function(){this.dispose()},t.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=Gi.pop()||new Set),this.deps.add(e)},t.prototype.forgetDeps=function(){var e=this;this.deps&&(Vc(this.deps).forEach(function(r){return r.delete(e)}),this.deps.clear(),Gi.push(this.deps),this.deps=null)},t.count=0,t}();function op(t){var e=mo.getValue();if(e)return t.parents.add(e),e.childValues.has(t)||e.childValues.set(t,[]),wr(t)?lp(e,t):fp(e,t),e}function Wm(t,e){return dp(t),mo.withValue(t,Km,[t,e]),Ym(t,e)&&Zm(t),sp(t.value)}function Km(t,e){t.recomputing=!0,t.value.length=0;try{t.value[0]=t.fn.apply(null,e)}catch(r){t.value[1]=r}t.recomputing=!1}function wr(t){return t.dirty||!!(t.dirtyChildren&&t.dirtyChildren.size)}function Zm(t){t.dirty=!1,!wr(t)&&up(t)}function cp(t){zc(t,lp)}function up(t){zc(t,fp)}function zc(t,e){var r=t.parents.size;if(r)for(var n=Vc(t.parents),i=0;i<r;++i)e(n[i],t)}function lp(t,e){Zn(t.childValues.has(e)),Zn(wr(e));var r=!wr(t);if(!t.dirtyChildren)t.dirtyChildren=Gi.pop()||new Set;else if(t.dirtyChildren.has(e))return;t.dirtyChildren.add(e),r&&cp(t)}function fp(t,e){Zn(t.childValues.has(e)),Zn(!wr(e));var r=t.childValues.get(e);r.length===0?t.childValues.set(e,Gm(e.value)):Qm(r,e.value)||t.setDirty(),pp(t,e),!wr(t)&&up(t)}function pp(t,e){var r=t.dirtyChildren;r&&(r.delete(e),r.size===0&&(Gi.length<zm&&Gi.push(r),t.dirtyChildren=null))}function dp(t){t.childValues.size>0&&t.childValues.forEach(function(e,r){hp(t,r)}),t.forgetDeps(),Zn(t.dirtyChildren===null)}function hp(t,e){e.parents.delete(t),t.childValues.delete(e),pp(t,e)}function Ym(t,e){if(typeof t.subscribe=="function")try{ho(t),t.unsubscribe=t.subscribe.apply(null,e)}catch{return t.setDirty(),!1}return!0}var Jm={setDirty:!0,dispose:!0,forget:!0};function go(t){var e=new Map,r=t&&t.subscribe;function n(i){var a=mo.getValue();if(a){var o=e.get(i);o||e.set(i,o=new Set),a.dependOn(o),typeof r=="function"&&(ho(o),o.unsubscribe=r(i))}}return n.dirty=function(a,o){var s=e.get(a);if(s){var u=o&&Vm.call(Jm,o)?o:"setDirty";Vc(s).forEach(function(c){return c[u]()}),e.delete(a),ho(s)}},n}function mp(){var t=new Bt(typeof WeakMap=="function");return function(){return t.lookupArray(arguments)}}var d6=mp(),Bc=new Set;function an(t,e){e===void 0&&(e=Object.create(null));var r=new Bm(e.max||Math.pow(2,16),function(c){return c.dispose()}),n=e.keyArgs,i=e.makeCacheKey||mp(),a=function(){var c=i.apply(null,n?n.apply(null,arguments):arguments);if(c===void 0)return t.apply(null,arguments);var l=r.get(c);l||(r.set(c,l=new Hm(t)),l.subscribe=e.subscribe,l.forget=function(){return r.delete(c)});var d=l.recompute(Array.prototype.slice.call(arguments));return r.set(c,l),Bc.add(r),mo.hasValue()||(Bc.forEach(function(p){return p.clean()}),Bc.clear()),d};Object.defineProperty(a,"size",{get:function(){return r.map.size},configurable:!1,enumerable:!1});function o(c){var l=r.get(c);l&&l.setDirty()}a.dirtyKey=o,a.dirty=function(){o(i.apply(null,arguments))};function s(c){var l=r.get(c);if(l)return l.peek()}a.peekKey=s,a.peek=function(){return s(i.apply(null,arguments))};function u(c){return r.delete(c)}return a.forgetKey=u,a.forget=function(){return u(i.apply(null,arguments))},a.makeCacheKey=i,a.getKey=n?function(){return i.apply(null,n.apply(null,arguments))}:i,Object.freeze(a)}var Qc=function(){function t(){this.getFragmentDoc=an(fc)}return t.prototype.batch=function(e){var r=this,n=typeof e.optimistic=="string"?e.optimistic:e.optimistic===!1?null:void 0,i;return this.performTransaction(function(){return i=e.update(r)},n),i},t.prototype.recordOptimisticTransaction=function(e,r){this.performTransaction(e,r)},t.prototype.transformDocument=function(e){return e},t.prototype.transformForLink=function(e){return e},t.prototype.identify=function(e){},t.prototype.gc=function(){return[]},t.prototype.modify=function(e){return!1},t.prototype.readQuery=function(e,r){return r===void 0&&(r=!!e.optimistic),this.read(_(_({},e),{rootId:e.id||"ROOT_QUERY",optimistic:r}))},t.prototype.readFragment=function(e,r){return r===void 0&&(r=!!e.optimistic),this.read(_(_({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:r}))},t.prototype.writeQuery=function(e){var r=e.id,n=e.data,i=Ut(e,["id","data"]);return this.write(Object.assign(i,{dataId:r||"ROOT_QUERY",result:n}))},t.prototype.writeFragment=function(e){var r=e.id,n=e.data,i=e.fragment,a=e.fragmentName,o=Ut(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(i,a),dataId:r,result:n}))},t.prototype.updateQuery=function(e,r){return this.batch({update:function(n){var i=n.readQuery(e),a=r(i);return a==null?i:(n.writeQuery(_(_({},e),{data:a})),a)}})},t.prototype.updateFragment=function(e,r){return this.batch({update:function(n){var i=n.readFragment(e),a=r(i);return a==null?i:(n.writeFragment(_(_({},e),{data:a})),a)}})},t}();var Hi=function(t){xe(e,t);function e(r,n,i,a){var o,s=t.call(this,r)||this;if(s.message=r,s.path=n,s.query=i,s.variables=a,Array.isArray(s.path)){s.missing=s.message;for(var u=s.path.length-1;u>=0;--u)s.missing=(o={},o[s.path[u]]=s.missing,o)}else s.missing=s.path;return s.__proto__=e.prototype,s}return e}(Error);var ke=Object.prototype.hasOwnProperty;function Wi(t){return t==null}function vo(t,e){var r=t.__typename,n=t.id,i=t._id;if(typeof r=="string"&&(e&&(e.keyObject=Wi(n)?Wi(i)?void 0:{_id:i}:{id:n}),Wi(n)&&!Wi(i)&&(n=i),!Wi(n)))return"".concat(r,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var gp={dataIdFromObject:vo,addTypename:!0,resultCaching:!0,canonizeResults:!1};function yp(t){return _r(gp,t)}function bo(t){var e=t.canonizeResults;return e===void 0?gp.canonizeResults:e}function vp(t,e){return K(e)?t.get(e.__ref,"__typename"):e&&e.__typename}var Gc=/^[_a-z][_0-9a-z]*/i;function Dt(t){var e=t.match(Gc);return e?e[0]:t}function yo(t,e,r){return ee(e)?ue(e)?e.every(function(n){return yo(t,n,r)}):t.selections.every(function(n){if(pt(n)&&er(n,r)){var i=_t(n);return ke.call(e,i)&&(!n.selectionSet||yo(n.selectionSet,e[i],r))}return!0}):!1}function Sr(t){return ee(t)&&!K(t)&&!ue(t)}function bp(){return new it}function _o(t,e){var r=Yr(Xr(t));return{fragmentMap:r,lookupFragment:function(n){var i=r[n];return!i&&e&&(i=e.lookup(n)),i||null}}}var wo=Object.create(null),Hc=function(){return wo},_p=Object.create(null),Yn=function(){function t(e,r){var n=this;this.policies=e,this.group=r,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(i,a){return ji(K(i)?n.get(i.__ref,a):i&&i[a])},this.canRead=function(i){return K(i)?n.has(i.__ref):typeof i=="object"},this.toReference=function(i,a){if(typeof i=="string")return jt(i);if(K(i))return i;var o=n.policies.identify(i)[0];if(o){var s=jt(o);return a&&n.merge(o,i),s}}}return t.prototype.toObject=function(){return _({},this.data)},t.prototype.has=function(e){return this.lookup(e,!0)!==void 0},t.prototype.get=function(e,r){if(this.group.depend(e,r),ke.call(this.data,e)){var n=this.data[e];if(n&&ke.call(n,r))return n[r]}if(r==="__typename"&&ke.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof Cr)return this.parent.get(e,r)},t.prototype.lookup=function(e,r){if(r&&this.group.depend(e,"__exists"),ke.call(this.data,e))return this.data[e];if(this instanceof Cr)return this.parent.lookup(e,r);if(this.policies.rootTypenamesById[e])return Object.create(null)},t.prototype.merge=function(e,r){var n=this,i;K(e)&&(e=e.__ref),K(r)&&(r=r.__ref);var a=typeof e=="string"?this.lookup(i=e):e,o=typeof r=="string"?this.lookup(i=r):r;if(!!o){__DEV__?I(typeof i=="string","store.merge expects a string ID"):I(typeof i=="string",1);var s=new it(eg).merge(a,o);if(this.data[i]=s,s!==a&&(delete this.refs[i],this.group.caching)){var u=Object.create(null);a||(u.__exists=1),Object.keys(o).forEach(function(c){if(!a||a[c]!==s[c]){u[c]=1;var l=Dt(c);l!==c&&!n.policies.hasKeyArgs(s.__typename,l)&&(u[l]=1),s[c]===void 0&&!(n instanceof Cr)&&delete s[c]}}),u.__typename&&!(a&&a.__typename)&&this.policies.rootTypenamesById[i]===s.__typename&&delete u.__typename,Object.keys(u).forEach(function(c){return n.group.dirty(i,c)})}}},t.prototype.modify=function(e,r){var n=this,i=this.lookup(e);if(i){var a=Object.create(null),o=!1,s=!0,u={DELETE:wo,INVALIDATE:_p,isReference:K,toReference:this.toReference,canRead:this.canRead,readField:function(c,l){return n.policies.readField(typeof c=="string"?{fieldName:c,from:l||jt(e)}:c,{store:n})}};if(Object.keys(i).forEach(function(c){var l=Dt(c),d=i[c];if(d!==void 0){var p=typeof r=="function"?r:r[c]||r[l];if(p){var f=p===Hc?wo:p(ji(d),_(_({},u),{fieldName:l,storeFieldName:c,storage:n.getStorage(e,c)}));f===_p?n.group.dirty(e,c):(f===wo&&(f=void 0),f!==d&&(a[c]=f,o=!0,d=f))}d!==void 0&&(s=!1)}}),o)return this.merge(e,a),s&&(this instanceof Cr?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},t.prototype.delete=function(e,r,n){var i,a=this.lookup(e);if(a){var o=this.getFieldValue(a,"__typename"),s=r&&n?this.policies.getStoreFieldName({typename:o,fieldName:r,args:n}):r;return this.modify(e,s?(i={},i[s]=Hc,i):Hc)}return!1},t.prototype.evict=function(e,r){var n=!1;return e.id&&(ke.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof Cr&&this!==r&&(n=this.parent.evict(e,r)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n},t.prototype.clear=function(){this.replace(null)},t.prototype.extract=function(){var e=this,r=this.toObject(),n=[];return this.getRootIdSet().forEach(function(i){ke.call(e.policies.rootTypenamesById,i)||n.push(i)}),n.length&&(r.__META={extraRootIds:n.sort()}),r},t.prototype.replace=function(e){var r=this;if(Object.keys(this.data).forEach(function(a){e&&ke.call(e,a)||r.delete(a)}),e){var n=e.__META,i=Ut(e,["__META"]);Object.keys(i).forEach(function(a){r.merge(a,i[a])}),n&&n.extraRootIds.forEach(this.retain,this)}},t.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},t.prototype.release=function(e){if(this.rootIds[e]>0){var r=--this.rootIds[e];return r||delete this.rootIds[e],r}return 0},t.prototype.getRootIdSet=function(e){return e===void 0&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof Cr?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},t.prototype.gc=function(){var e=this,r=this.getRootIdSet(),n=this.toObject();r.forEach(function(o){ke.call(n,o)&&(Object.keys(e.findChildRefIds(o)).forEach(r.add,r),delete n[o])});var i=Object.keys(n);if(i.length){for(var a=this;a instanceof Cr;)a=a.parent;i.forEach(function(o){return a.delete(o)})}return i},t.prototype.findChildRefIds=function(e){if(!ke.call(this.refs,e)){var r=this.refs[e]=Object.create(null),n=this.data[e];if(!n)return r;var i=new Set([n]);i.forEach(function(a){K(a)&&(r[a.__ref]=!0),ee(a)&&Object.keys(a).forEach(function(o){var s=a[o];ee(s)&&i.add(s)})})}return this.refs[e]},t.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},t}();var wp=function(){function t(e,r){r===void 0&&(r=null),this.caching=e,this.parent=r,this.d=null,this.resetCaching()}return t.prototype.resetCaching=function(){this.d=this.caching?go():null,this.keyMaker=new Bt(wt)},t.prototype.depend=function(e,r){if(this.d){this.d(Wc(e,r));var n=Dt(r);n!==r&&this.d(Wc(e,n)),this.parent&&this.parent.depend(e,r)}},t.prototype.dirty=function(e,r){this.d&&this.d.dirty(Wc(e,r),r==="__exists"?"forget":"setDirty")},t}();function Wc(t,e){return e+"#"+t}function Kc(t,e){on(t)&&t.group.depend(e,"__exists")}(function(t){var e=function(r){xe(n,r);function n(i){var a=i.policies,o=i.resultCaching,s=o===void 0?!0:o,u=i.seed,c=r.call(this,a,new wp(s))||this;return c.stump=new Xm(c),c.storageTrie=new Bt(wt),u&&c.replace(u),c}return n.prototype.addLayer=function(i,a){return this.stump.addLayer(i,a)},n.prototype.removeLayer=function(){return this},n.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},n}(t);t.Root=e})(Yn||(Yn={}));var Cr=function(t){xe(e,t);function e(r,n,i,a){var o=t.call(this,n.policies,a)||this;return o.id=r,o.parent=n,o.replay=i,o.group=a,i(o),o}return e.prototype.addLayer=function(r,n){return new e(r,this,n,this.group)},e.prototype.removeLayer=function(r){var n=this,i=this.parent.removeLayer(r);return r===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(a){var o=n.data[a],s=i.lookup(a);s?o?o!==s&&Object.keys(o).forEach(function(u){be(o[u],s[u])||n.group.dirty(a,u)}):(n.group.dirty(a,"__exists"),Object.keys(s).forEach(function(u){n.group.dirty(a,u)})):n.delete(a)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return _(_({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(r){var n=this.parent.findChildRefIds(r);return ke.call(this.data,r)?_(_({},n),t.prototype.findChildRefIds.call(this,r)):n},e.prototype.getStorage=function(){for(var r=this.parent;r.parent;)r=r.parent;return r.getStorage.apply(r,arguments)},e}(Yn),Xm=function(t){xe(e,t);function e(r){return t.call(this,"EntityStore.Stump",r,function(){},new wp(r.group.caching,r.group))||this}return e.prototype.removeLayer=function(){return this},e.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},e}(Cr);function eg(t,e,r){var n=t[r],i=e[r];return be(n,i)?n:i}function on(t){return!!(t instanceof Yn&&t.group.caching)}function tg(t){return ee(t)?ue(t)?t.slice(0):_({__proto__:Object.getPrototypeOf(t)},t):t}var So=function(){function t(){this.known=new(xf?WeakSet:Set),this.pool=new Bt(wt),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return t.prototype.isKnown=function(e){return ee(e)&&this.known.has(e)},t.prototype.pass=function(e){if(ee(e)){var r=tg(e);return this.passes.set(r,e),r}return e},t.prototype.admit=function(e){var r=this;if(ee(e)){var n=this.passes.get(e);if(n)return n;var i=Object.getPrototypeOf(e);switch(i){case Array.prototype:{if(this.known.has(e))return e;var a=e.map(this.admit,this),o=this.pool.lookupArray(a);return o.array||(this.known.add(o.array=a),__DEV__&&Object.freeze(a)),o.array}case null:case Object.prototype:{if(this.known.has(e))return e;var s=Object.getPrototypeOf(e),u=[s],c=this.sortedKeys(e);u.push(c.json);var l=u.length;c.sorted.forEach(function(f){u.push(r.admit(e[f]))});var o=this.pool.lookupArray(u);if(!o.object){var d=o.object=Object.create(s);this.known.add(d),c.sorted.forEach(function(f,h){d[f]=u[l+h]}),__DEV__&&Object.freeze(d)}return o.object}}}return e},t.prototype.sortedKeys=function(e){var r=Object.keys(e),n=this.pool.lookupArray(r);if(!n.keys){r.sort();var i=JSON.stringify(r);(n.keys=this.keysByJSON.get(i))||this.keysByJSON.set(i,n.keys={sorted:r,json:i})}return n.keys},t}();var dt=Object.assign(function(t){if(ee(t)){Zc===void 0&&Sp();var e=Zc.admit(t),r=Yc.get(e);return r===void 0&&Yc.set(e,r=JSON.stringify(e)),r}return JSON.stringify(t)},{reset:Sp}),Zc,Yc;function Sp(){Zc=new So,Yc=new(wt?WeakMap:Map)}function Cp(t){return[t.selectionSet,t.objectOrReference,t.context,t.context.canonizeResults]}var Ep=function(){function t(e){var r=this;this.knownResults=new(wt?WeakMap:Map),this.config=_r(e,{addTypename:e.addTypename!==!1,canonizeResults:bo(e)}),this.canon=e.canon||new So,this.executeSelectionSet=an(function(n){var i,a=n.context.canonizeResults,o=Cp(n);o[3]=!a;var s=(i=r.executeSelectionSet).peek.apply(i,o);return s?a?_(_({},s),{result:r.canon.admit(s.result)}):s:(Kc(n.context.store,n.enclosingRef.__ref),r.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize,keyArgs:Cp,makeCacheKey:function(n,i,a,o){if(on(a.store))return a.store.makeCacheKey(n,K(i)?i.__ref:i,a.varString,o)}}),this.executeSubSelectedArray=an(function(n){return Kc(n.context.store,n.enclosingRef.__ref),r.execSubSelectedArrayImpl(n)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(n){var i=n.field,a=n.array,o=n.context;if(on(o.store))return o.store.makeCacheKey(i,a,o.varString)}})}return t.prototype.resetCanon=function(){this.canon=new So},t.prototype.diffQueryAgainstStore=function(e){var r=e.store,n=e.query,i=e.rootId,a=i===void 0?"ROOT_QUERY":i,o=e.variables,s=e.returnPartialData,u=s===void 0?!0:s,c=e.canonizeResults,l=c===void 0?this.config.canonizeResults:c,d=this.config.cache.policies;o=_(_({},tn(Fi(n))),o);var p=jt(a),f=this.executeSelectionSet({selectionSet:en(n).selectionSet,objectOrReference:p,enclosingRef:p,context:_({store:r,query:n,policies:d,variables:o,varString:dt(o),canonizeResults:l},_o(n,this.config.fragments))}),h;if(f.missing&&(h=[new Hi(rg(f.missing),f.missing,n,o)],!u))throw h[0];return{result:f.result,complete:!h,missing:h}},t.prototype.isFresh=function(e,r,n,i){if(on(i.store)&&this.knownResults.get(e)===n){var a=this.executeSelectionSet.peek(n,r,i,this.canon.isKnown(e));if(a&&e===a.result)return!0}return!1},t.prototype.execSelectionSetImpl=function(e){var r=this,n=e.selectionSet,i=e.objectOrReference,a=e.enclosingRef,o=e.context;if(K(i)&&!o.policies.rootTypenamesById[i.__ref]&&!o.store.has(i.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(i.__ref," object")};var s=o.variables,u=o.policies,c=o.store,l=c.getFieldValue(i,"__typename"),d=[],p,f=new it;this.config.addTypename&&typeof l=="string"&&!u.rootIdsByTypename[l]&&d.push({__typename:l});function h(v,m){var A;return v.missing&&(p=f.merge(p,(A={},A[m]=v.missing,A))),v.result}var g=new Set(n.selections);g.forEach(function(v){var m,A;if(!!er(v,s))if(pt(v)){var D=u.readField({fieldName:v.name.value,field:v,variables:o.variables,from:i},o),E=_t(v);D===void 0?rn.added(v)||(p=f.merge(p,(m={},m[E]="Can't find field '".concat(v.name.value,"' on ").concat(K(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),m))):ue(D)?D=h(r.executeSubSelectedArray({field:v,array:D,enclosingRef:a,context:o}),E):v.selectionSet?D!=null&&(D=h(r.executeSelectionSet({selectionSet:v.selectionSet,objectOrReference:D,enclosingRef:K(D)?D:a,context:o}),E)):o.canonizeResults&&(D=r.canon.pass(D)),D!==void 0&&d.push((A={},A[E]=D,A))}else{var O=Jr(v,o.lookupFragment);if(!O&&v.kind===Oe.FRAGMENT_SPREAD)throw __DEV__?new V("No fragment named ".concat(v.name.value)):new V(5);O&&u.fragmentMatches(O,l)&&O.selectionSet.selections.forEach(g.add,g)}});var y=Mi(d),S={result:y,missing:p},b=o.canonizeResults?this.canon.admit(S):ji(S);return b.result&&this.knownResults.set(b.result,n),b},t.prototype.execSubSelectedArrayImpl=function(e){var r=this,n=e.field,i=e.array,a=e.enclosingRef,o=e.context,s,u=new it;function c(l,d){var p;return l.missing&&(s=u.merge(s,(p={},p[d]=l.missing,p))),l.result}return n.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(l,d){return l===null?null:ue(l)?c(r.executeSubSelectedArray({field:n,array:l,enclosingRef:a,context:o}),d):n.selectionSet?c(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:l,enclosingRef:K(l)?l:a,context:o}),d):(__DEV__&&ng(o.store,n,l),l)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:s}},t}();function rg(t){try{JSON.stringify(t,function(e,r){if(typeof r=="string")throw r;return r})}catch(e){return e}}function ng(t,e,r){if(!e.selectionSet){var n=new Set([r]);n.forEach(function(i){ee(i)&&(__DEV__?I(!K(i),"Missing selection set for object of type ".concat(vp(t,i)," returned for query field ").concat(e.name.value)):I(!K(i),6),Object.values(i).forEach(n.add,n))})}}var Jn=new Kn,xp=new WeakMap;function Ki(t){var e=xp.get(t);return e||xp.set(t,e={vars:new Set,dep:go()}),e}function Jc(t){Ki(t).vars.forEach(function(e){return e.forgetCache(t)})}function kp(t){Ki(t).vars.forEach(function(e){return e.attachCache(t)})}function Co(t){var e=new Set,r=new Set,n=function(a){if(arguments.length>0){if(t!==a){t=a,e.forEach(function(u){Ki(u).dep.dirty(n),ig(u)});var o=Array.from(r);r.clear(),o.forEach(function(u){return u(t)})}}else{var s=Jn.getValue();s&&(i(s),Ki(s).dep(n))}return t};n.onNextChange=function(a){return r.add(a),function(){r.delete(a)}};var i=n.attachCache=function(a){return e.add(a),Ki(a).vars.add(n),n};return n.forgetCache=function(a){return e.delete(a)},n}function ig(t){t.broadcastWatches&&t.broadcastWatches()}var Tp=Object.create(null);function Xc(t){var e=JSON.stringify(t);return Tp[e]||(Tp[e]=Object.create(null))}function eu(t){var e=Xc(t);return e.keyFieldsFn||(e.keyFieldsFn=function(r,n){var i=function(o,s){return n.readField(s,o)},a=n.keyObject=ru(t,function(o){var s=Xn(n.storeObject,o,i);return s===void 0&&r!==n.storeObject&&ke.call(r,o[0])&&(s=Xn(r,o,Ip)),__DEV__?I(s!==void 0,"Missing field '".concat(o.join("."),"' while extracting keyFields from ").concat(JSON.stringify(r))):I(s!==void 0,2),s});return"".concat(n.typename,":").concat(JSON.stringify(a))})}function tu(t){var e=Xc(t);return e.keyArgsFn||(e.keyArgsFn=function(r,n){var i=n.field,a=n.variables,o=n.fieldName,s=ru(t,function(c){var l=c[0],d=l.charAt(0);if(d==="@"){if(i&&Re(i.directives)){var p=l.slice(1),f=i.directives.find(function(S){return S.name.value===p}),h=f&&tr(f,a);return h&&Xn(h,c.slice(1))}return}if(d==="$"){var g=l.slice(1);if(a&&ke.call(a,g)){var y=c.slice(0);return y[0]=g,Xn(a,y)}return}if(r)return Xn(r,c)}),u=JSON.stringify(s);return(r||u!=="{}")&&(o+=":"+u),o})}function ru(t,e){var r=new it;return Ap(t).reduce(function(n,i){var a,o=e(i);if(o!==void 0){for(var s=i.length-1;s>=0;--s)o=(a={},a[i[s]]=o,a);n=r.merge(n,o)}return n},Object.create(null))}function Ap(t){var e=Xc(t);if(!e.paths){var r=e.paths=[],n=[];t.forEach(function(i,a){ue(i)?(Ap(i).forEach(function(o){return r.push(n.concat(o))}),n.length=0):(n.push(i),ue(t[a+1])||(r.push(n.slice(0)),n.length=0))})}return e.paths}function Ip(t,e){return t[e]}function Xn(t,e,r){return r=r||Ip,Op(e.reduce(function n(i,a){return ue(i)?i.map(function(o){return n(o,a)}):i&&r(i,a)},t))}function Op(t){return ee(t)?ue(t)?t.map(Op):ru(Object.keys(t).sort(),function(e){return Xn(t,e)}):t}Li.setStringify(dt);function nu(t){return t.args!==void 0?t.args:t.field?tr(t.field,t.variables):null}var ag=function(){},Dp=function(t,e){return e.fieldName},Np=function(t,e,r){var n=r.mergeObjects;return n(t,e)},Rp=function(t,e){return e},Lp=function(){function t(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=_({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 t.prototype.identify=function(e,r){var n,i=this,a=r&&(r.typename||((n=r.storeObject)===null||n===void 0?void 0:n.__typename))||e.__typename;if(a===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=r&&r.storeObject||e,s=_(_({},r),{typename:a,storeObject:o,readField:r&&r.readField||function(){var p=Eo(arguments,o);return i.readField(p,{store:i.cache.data,variables:p.variables})}}),u,c=a&&this.getTypePolicy(a),l=c&&c.keyFn||this.config.dataIdFromObject;l;){var d=l(e,s);if(ue(d))l=eu(d);else{u=d;break}}return u=u?String(u):void 0,s.keyObject?[u,s.keyObject]:[u]},t.prototype.addTypePolicies=function(e){var r=this;Object.keys(e).forEach(function(n){var i=e[n],a=i.queryType,o=i.mutationType,s=i.subscriptionType,u=Ut(i,["queryType","mutationType","subscriptionType"]);a&&r.setRootTypename("Query",n),o&&r.setRootTypename("Mutation",n),s&&r.setRootTypename("Subscription",n),ke.call(r.toBeAdded,n)?r.toBeAdded[n].push(u):r.toBeAdded[n]=[u]})},t.prototype.updateTypePolicy=function(e,r){var n=this,i=this.getTypePolicy(e),a=r.keyFields,o=r.fields;function s(u,c){u.merge=typeof c=="function"?c:c===!0?Np:c===!1?Rp:u.merge}s(i,r.merge),i.keyFn=a===!1?ag:ue(a)?eu(a):typeof a=="function"?a:i.keyFn,o&&Object.keys(o).forEach(function(u){var c=n.getFieldPolicy(e,u,!0),l=o[u];if(typeof l=="function")c.read=l;else{var d=l.keyArgs,p=l.read,f=l.merge;c.keyFn=d===!1?Dp:ue(d)?tu(d):typeof d=="function"?d:c.keyFn,typeof p=="function"&&(c.read=p),s(c,f)}c.read&&c.merge&&(c.keyFn=c.keyFn||Dp)})},t.prototype.setRootTypename=function(e,r){r===void 0&&(r=e);var n="ROOT_"+e.toUpperCase(),i=this.rootTypenamesById[n];r!==i&&(__DEV__?I(!i||i===e,"Cannot change root ".concat(e," __typename more than once")):I(!i||i===e,3),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[r]=n,this.rootTypenamesById[n]=r)},t.prototype.addPossibleTypes=function(e){var r=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(n){r.getSupertypeSet(n,!0),e[n].forEach(function(i){r.getSupertypeSet(i,!0).add(n);var a=i.match(Gc);(!a||a[0]!==i)&&r.fuzzySubtypes.set(i,new RegExp(i))})})},t.prototype.getTypePolicy=function(e){var r=this;if(!ke.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var i=this.supertypeMap.get(e);i&&i.size&&i.forEach(function(o){var s=r.getTypePolicy(o),u=s.fields,c=Ut(s,["fields"]);Object.assign(n,c),Object.assign(n.fields,u)})}var a=this.toBeAdded[e];return a&&a.length&&a.splice(0).forEach(function(o){r.updateTypePolicy(e,o)}),this.typePolicies[e]},t.prototype.getFieldPolicy=function(e,r,n){if(e){var i=this.getTypePolicy(e).fields;return i[r]||n&&(i[r]=Object.create(null))}},t.prototype.getSupertypeSet=function(e,r){var n=this.supertypeMap.get(e);return!n&&r&&this.supertypeMap.set(e,n=new Set),n},t.prototype.fragmentMatches=function(e,r,n,i){var a=this;if(!e.typeCondition)return!0;if(!r)return!1;var o=e.typeCondition.name.value;if(r===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(r,!0),u=[s],c=function(h){var g=a.getSupertypeSet(h,!1);g&&g.size&&u.indexOf(g)<0&&u.push(g)},l=!!(n&&this.fuzzySubtypes.size),d=!1,p=0;p<u.length;++p){var f=u[p];if(f.has(o))return s.has(o)||(d&&__DEV__&&I.warn("Inferring subtype ".concat(r," of supertype ").concat(o)),s.add(o)),!0;f.forEach(c),l&&p===u.length-1&&yo(e.selectionSet,n,i)&&(l=!1,d=!0,this.fuzzySubtypes.forEach(function(h,g){var y=r.match(h);y&&y[0]===r&&c(g)}))}return!1},t.prototype.hasKeyArgs=function(e,r){var n=this.getFieldPolicy(e,r,!1);return!!(n&&n.keyFn)},t.prototype.getStoreFieldName=function(e){var r=e.typename,n=e.fieldName,i=this.getFieldPolicy(r,n,!1),a,o=i&&i.keyFn;if(o&&r)for(var s={typename:r,fieldName:n,field:e.field||null,variables:e.variables},u=nu(e);o;){var c=o(u,s);if(ue(c))o=tu(c);else{a=c||n;break}}return a===void 0&&(a=e.field?dc(e.field,e.variables):Li(n,nu(e))),a===!1?n:n===Dt(a)?a:n+":"+a},t.prototype.readField=function(e,r){var n=e.from;if(!!n){var i=e.field||e.fieldName;if(!!i){if(e.typename===void 0){var a=r.store.getFieldValue(n,"__typename");a&&(e.typename=a)}var o=this.getStoreFieldName(e),s=Dt(o),u=r.store.getFieldValue(n,o),c=this.getFieldPolicy(e.typename,s,!1),l=c&&c.read;if(l){var d=Pp(this,n,e,r,r.store.getStorage(K(n)?n.__ref:n,o));return Jn.withValue(this.cache,l,[u,d])}return u}}},t.prototype.getReadFunction=function(e,r){var n=this.getFieldPolicy(e,r,!1);return n&&n.read},t.prototype.getMergeFunction=function(e,r,n){var i=this.getFieldPolicy(e,r,!1),a=i&&i.merge;return!a&&n&&(i=this.getTypePolicy(n),a=i&&i.merge),a},t.prototype.runMergeFunction=function(e,r,n,i,a){var o=n.field,s=n.typename,u=n.merge;return u===Np?$p(i.store)(e,r):u===Rp?r:(i.overwrite&&(e=void 0),u(e,r,Pp(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:i.variables},i,a||Object.create(null))))},t}();function Pp(t,e,r,n,i){var a=t.getStoreFieldName(r),o=Dt(a),s=r.variables||n.variables,u=n.store,c=u.toReference,l=u.canRead;return{args:nu(r),field:r.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:K,toReference:c,storage:i,cache:t.cache,canRead:l,readField:function(){return t.readField(Eo(arguments,e,s),n)},mergeObjects:$p(n.store)}}function Eo(t,e,r){var n=t[0],i=t[1],a=t.length,o;return typeof n=="string"?o={fieldName:n,from:a>1?i:e}:(o=_({},n),ke.call(o,"from")||(o.from=e)),__DEV__&&o.from===void 0&&__DEV__&&I.warn("Undefined 'from' passed to readField with arguments ".concat(If(Array.from(t)))),o.variables===void 0&&(o.variables=r),o}function $p(t){return function(r,n){if(ue(r)||ue(n))throw __DEV__?new V("Cannot automatically merge arrays"):new V(4);if(ee(r)&&ee(n)){var i=t.getFieldValue(r,"__typename"),a=t.getFieldValue(n,"__typename"),o=i&&a&&i!==a;if(o)return n;if(K(r)&&Sr(n))return t.merge(r.__ref,n),r;if(Sr(r)&&K(n))return t.merge(r,n.__ref),n;if(Sr(r)&&Sr(n))return _(_({},r),n)}return n}}function iu(t,e,r){var n="".concat(e).concat(r),i=t.flavors.get(n);return i||t.flavors.set(n,i=t.clientOnly===e&&t.deferred===r?t:_(_({},t),{clientOnly:e,deferred:r})),i}var jp=function(){function t(e,r,n){this.cache=e,this.reader=r,this.fragments=n}return t.prototype.writeToStore=function(e,r){var n=this,i=r.query,a=r.result,o=r.dataId,s=r.variables,u=r.overwrite,c=qt(i),l=bp();s=_(_({},tn(c)),s);var d=_(_({store:e,written:Object.create(null),merge:function(f,h){return l.merge(f,h)},variables:s,varString:dt(s)},_o(i,this.fragments)),{overwrite:!!u,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),p=this.processSelectionSet({result:a||Object.create(null),dataId:o,selectionSet:c.selectionSet,mergeTree:{map:new Map},context:d});if(!K(p))throw __DEV__?new V("Could not identify object ".concat(JSON.stringify(a))):new V(7);return d.incomingById.forEach(function(f,h){var g=f.storeObject,y=f.mergeTree,S=f.fieldNodeSet,b=jt(h);if(y&&y.map.size){var v=n.applyMerges(y,b,g,d);if(K(v))return;g=v}if(__DEV__&&!d.overwrite){var m=Object.create(null);S.forEach(function(E){E.selectionSet&&(m[E.name.value]=!0)});var A=function(E){return m[Dt(E)]===!0},D=function(E){var O=y&&y.map.get(E);return Boolean(O&&O.info&&O.info.merge)};Object.keys(g).forEach(function(E){A(E)&&!D(E)&&og(b,g,E,d.store)})}e.merge(h,g)}),e.retain(p.__ref),p},t.prototype.processSelectionSet=function(e){var r=this,n=e.dataId,i=e.result,a=e.selectionSet,o=e.context,s=e.mergeTree,u=this.cache.policies,c=Object.create(null),l=n&&u.rootTypenamesById[n]||$i(i,a,o.fragmentMap)||n&&o.store.get(n,"__typename");typeof l=="string"&&(c.__typename=l);var d=function(){var v=Eo(arguments,c,o.variables);if(K(v.from)){var m=o.incomingById.get(v.from.__ref);if(m){var A=u.readField(_(_({},v),{from:m.storeObject}),o);if(A!==void 0)return A}}return u.readField(v,o)},p=new Set;this.flattenFields(a,i,o,l).forEach(function(v,m){var A,D=_t(m),E=i[D];if(p.add(m),E!==void 0){var O=u.getStoreFieldName({typename:l,fieldName:m.name.value,field:m,variables:v.variables}),P=Fp(s,O),N=r.processFieldValue(E,m,m.selectionSet?iu(v,!1,!1):v,P),j=void 0;m.selectionSet&&(K(N)||Sr(N))&&(j=d("__typename",N));var qe=u.getMergeFunction(l,m.name.value,j);qe?P.info={field:m,typename:l,merge:qe}:Mp(s,O),c=v.merge(c,(A={},A[O]=N,A))}else __DEV__&&!v.clientOnly&&!v.deferred&&!rn.added(m)&&!u.getReadFunction(l,m.name.value)&&__DEV__&&I.error("Missing field '".concat(_t(m),"' while writing result ").concat(JSON.stringify(i,null,2)).substring(0,1e3))});try{var f=u.identify(i,{typename:l,selectionSet:a,fragmentMap:o.fragmentMap,storeObject:c,readField:d}),h=f[0],g=f[1];n=n||h,g&&(c=o.merge(c,g))}catch(v){if(!n)throw v}if(typeof n=="string"){var y=jt(n),S=o.written[n]||(o.written[n]=[]);if(S.indexOf(a)>=0||(S.push(a),this.reader&&this.reader.isFresh(i,y,a,o)))return y;var b=o.incomingById.get(n);return b?(b.storeObject=o.merge(b.storeObject,c),b.mergeTree=au(b.mergeTree,s),p.forEach(function(v){return b.fieldNodeSet.add(v)})):o.incomingById.set(n,{storeObject:c,mergeTree:xo(s)?void 0:s,fieldNodeSet:p}),y}return c},t.prototype.processFieldValue=function(e,r,n,i){var a=this;return!r.selectionSet||e===null?__DEV__?io(e):e:ue(e)?e.map(function(o,s){var u=a.processFieldValue(o,r,n,Fp(i,s));return Mp(i,s),u}):this.processSelectionSet({result:e,selectionSet:r.selectionSet,context:n,mergeTree:i})},t.prototype.flattenFields=function(e,r,n,i){i===void 0&&(i=$i(r,e,n.fragmentMap));var a=new Map,o=this.cache.policies,s=new Bt(!1);return function u(c,l){var d=s.lookup(c,l.clientOnly,l.deferred);d.visited||(d.visited=!0,c.selections.forEach(function(p){if(!!er(p,n.variables)){var f=l.clientOnly,h=l.deferred;if(!(f&&h)&&Re(p.directives)&&p.directives.forEach(function(S){var b=S.name.value;if(b==="client"&&(f=!0),b==="defer"){var v=tr(S,n.variables);(!v||v.if!==!1)&&(h=!0)}}),pt(p)){var g=a.get(p);g&&(f=f&&g.clientOnly,h=h&&g.deferred),a.set(p,iu(n,f,h))}else{var y=Jr(p,n.lookupFragment);if(!y&&p.kind===Oe.FRAGMENT_SPREAD)throw __DEV__?new V("No fragment named ".concat(p.name.value)):new V(8);y&&o.fragmentMatches(y,i,r,n.variables)&&u(y.selectionSet,iu(n,f,h))}}}))}(e,n),a},t.prototype.applyMerges=function(e,r,n,i,a){var o,s=this;if(e.map.size&&!K(n)){var u=!ue(n)&&(K(r)||Sr(r))?r:void 0,c=n;u&&!a&&(a=[K(u)?u.__ref:u]);var l,d=function(p,f){return ue(p)?typeof f=="number"?p[f]:void 0:i.store.getFieldValue(p,String(f))};e.map.forEach(function(p,f){var h=d(u,f),g=d(c,f);if(g!==void 0){a&&a.push(f);var y=s.applyMerges(p,h,g,i,a);y!==g&&(l=l||new Map,l.set(f,y)),a&&I(a.pop()===f)}}),l&&(n=ue(c)?c.slice(0):_({},c),l.forEach(function(p,f){n[f]=p}))}return e.info?this.cache.policies.runMergeFunction(r,n,e.info,i,a&&(o=i.store).getStorage.apply(o,a)):n},t}();var qp=[];function Fp(t,e){var r=t.map;return r.has(e)||r.set(e,qp.pop()||{map:new Map}),r.get(e)}function au(t,e){if(t===e||!e||xo(e))return t;if(!t||xo(t))return e;var r=t.info&&e.info?_(_({},t.info),e.info):t.info||e.info,n=t.map.size&&e.map.size,i=n?new Map:t.map.size?t.map:e.map,a={info:r,map:i};if(n){var o=new Set(e.map.keys());t.map.forEach(function(s,u){a.map.set(u,au(s,e.map.get(u))),o.delete(u)}),o.forEach(function(s){a.map.set(s,au(e.map.get(s),t.map.get(s)))})}return a}function xo(t){return!t||!(t.info||t.map.size)}function Mp(t,e){var r=t.map,n=r.get(e);n&&xo(n)&&(qp.push(n),r.delete(e))}var Up=new Set;function og(t,e,r,n){var i=function(d){var p=n.getFieldValue(d,r);return typeof p=="object"&&p},a=i(t);if(!!a){var o=i(e);if(!!o&&!K(a)&&!be(a,o)&&!Object.keys(a).every(function(d){return n.getFieldValue(o,d)!==void 0})){var s=n.getFieldValue(t,"__typename")||n.getFieldValue(e,"__typename"),u=Dt(r),c="".concat(s,".").concat(u);if(!Up.has(c)){Up.add(c);var l=[];!ue(a)&&!ue(o)&&[a,o].forEach(function(d){var p=n.getFieldValue(d,"__typename");typeof p=="string"&&!l.includes(p)&&l.push(p)}),__DEV__&&I.warn("Cache data may be lost when replacing the ".concat(u," field of a ").concat(s,` object.
|
|
38
|
+
`):new V(23)};var Hf=function(){if(typeof AbortController>"u")return{controller:!1,signal:!1};var t=new AbortController,e=t.signal;return{controller:t,signal:e}};var Wf=function(t,e){var r=t.getContext(),n=r.uri;return n||(typeof e=="function"?e(t):e||"/graphql")};function Kf(t,e){var r=[],n=function(d,p){r.push("".concat(d,"=").concat(encodeURIComponent(p)))};if("query"in e&&n("query",e.query),e.operationName&&n("operationName",e.operationName),e.variables){var i=void 0;try{i=Qi(e.variables,"Variables map")}catch(d){return{parseError:d}}n("variables",i)}if(e.extensions){var a=void 0;try{a=Qi(e.extensions,"Extensions map")}catch(d){return{parseError:d}}n("extensions",a)}var o="",s=t,u=t.indexOf("#");u!==-1&&(o=t.substr(u),s=t.substr(0,u));var c=s.indexOf("?")===-1?"?":"&",l=s+c+r.join("&")+o;return{newURI:l}}var Zf=Ue(function(){return fetch}),Yf=function(t){t===void 0&&(t={});var e=t.uri,r=e===void 0?"/graphql":e,n=t.fetch,i=t.print,a=i===void 0?zf:i,o=t.includeExtensions,s=t.preserveHeaderCase,u=t.useGETForQueries,c=t.includeUnusedVariables,l=c===void 0?!1:c,d=Ut(t,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);__DEV__&&Gf(n||Zf);var p={http:{includeExtensions:o,preserveHeaderCase:s},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new St(function(f){var h=Wf(f,r),g=f.getContext(),y={};if(g.clientAwareness){var S=g.clientAwareness,b=S.name,v=S.version;b&&(y["apollographql-client-name"]=b),v&&(y["apollographql-client-version"]=v)}var m=_(_({},y),g.headers),A={http:g.http,options:g.fetchOptions,credentials:g.credentials,headers:m},D=Qf(f,a,Vf,p,A),E=D.options,O=D.body;if(O.variables&&!l){var P=new Set(Object.keys(O.variables));Ke(f.query,{Variable:function(X,Ft,H){H&&H.kind!=="VariableDefinition"&&P.delete(X.name.value)}}),P.size&&(O.variables=_({},O.variables),P.forEach(function(X){delete O.variables[X]}))}var N;if(!E.signal){var j=Hf(),qe=j.controller,Ne=j.signal;N=qe,N&&(E.signal=Ne)}var q=function(X){return X.kind==="OperationDefinition"&&X.operation==="mutation"};if(u&&!f.query.definitions.some(q)&&(E.method="GET"),qn(["defer"],f.query)&&(E.headers=E.headers||{},E.headers.accept="multipart/mixed; deferSpec=20220824, application/json"),E.method==="GET"){var de=Kf(h,O),he=de.newURI,J=de.parseError;if(J)return uo(J);h=he}else try{E.body=Qi(O,"Payload")}catch(X){return uo(X)}return new W(function(X){var Ft=n||Ue(function(){return fetch})||Zf;return Ft(h,E).then(function(H){var Mt;f.setContext({response:H});var fr=(Mt=H.headers)===null||Mt===void 0?void 0:Mt.get("content-type");return fr!==null&&/^multipart\/mixed/i.test(fr)?jf(H,X):Bf(H,f,X)}).catch(function(H){return po(H,X)}),function(){N&&N.abort()}})})};var Fc=function(t){xe(e,t);function e(r){r===void 0&&(r={});var n=t.call(this,Yf(r).request)||this;return n.options=r,n}return e}(St);var{toString:Jf,hasOwnProperty:A1}=Object.prototype,Xf=Function.prototype.toString,Mc=new Map;function be(t,e){try{return Uc(t,e)}finally{Mc.clear()}}function Uc(t,e){if(t===e)return!0;let r=Jf.call(t),n=Jf.call(e);if(r!==n)return!1;switch(r){case"[object Array]":if(t.length!==e.length)return!1;case"[object Object]":{if(tp(t,e))return!0;let i=ep(t),a=ep(e),o=i.length;if(o!==a.length)return!1;for(let s=0;s<o;++s)if(!A1.call(e,i[s]))return!1;for(let s=0;s<o;++s){let u=i[s];if(!Uc(t[u],e[u]))return!1}return!0}case"[object Error]":return t.name===e.name&&t.message===e.message;case"[object Number]":if(t!==t)return e!==e;case"[object Boolean]":case"[object Date]":return+t==+e;case"[object RegExp]":case"[object String]":return t==`${e}`;case"[object Map]":case"[object Set]":{if(t.size!==e.size)return!1;if(tp(t,e))return!0;let i=t.entries(),a=r==="[object Map]";for(;;){let o=i.next();if(o.done)break;let[s,u]=o.value;if(!e.has(s)||a&&!Uc(u,e.get(s)))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]":t=new Uint8Array(t),e=new Uint8Array(e);case"[object DataView]":{let i=t.byteLength;if(i===e.byteLength)for(;i--&&t[i]===e[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{let i=Xf.call(t);return i!==Xf.call(e)?!1:!D1(i,O1)}}return!1}function ep(t){return Object.keys(t).filter(I1,t)}function I1(t){return this[t]!==void 0}var O1="{ [native code] }";function D1(t,e){let r=t.length-e.length;return r>=0&&t.indexOf(e,r)===r}function tp(t,e){let r=Mc.get(t);if(r){if(r.has(e))return!0}else Mc.set(t,r=new Set);return r.add(e),!1}var N1=function(){return Object.create(null)},rp=Array.prototype,R1=rp.forEach,P1=rp.slice,Bt=function(){function t(e,r){e===void 0&&(e=!0),r===void 0&&(r=N1),this.weakness=e,this.makeData=r}return t.prototype.lookup=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return this.lookupArray(e)},t.prototype.lookupArray=function(e){var r=this;return R1.call(e,function(n){return r=r.getChildTrie(n)}),r.data||(r.data=this.makeData(P1.call(e)))},t.prototype.getChildTrie=function(e){var r=this.weakness&&L1(e)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),n=r.get(e);return n||r.set(e,n=new t(this.weakness,this.makeData)),n},t}();function L1(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}var ze=null,np={},$1=1,F1=()=>class{constructor(){this.id=["slot",$1++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=ze;e;e=e.parent)if(this.id in e.slots){let r=e.slots[this.id];if(r===np)break;return e!==ze&&(ze.slots[this.id]=r),!0}return ze&&(ze.slots[this.id]=np),!1}getValue(){if(this.hasValue())return ze.slots[this.id]}withValue(e,r,n,i){let a={__proto__:null,[this.id]:e},o=ze;ze={parent:o,slots:a};try{return r.apply(i,n)}finally{ze=o}}static bind(e){let r=ze;return function(){let n=ze;try{return ze=r,e.apply(this,arguments)}finally{ze=n}}}static noContext(e,r,n){if(ze){let i=ze;try{return ze=null,e.apply(n,r)}finally{ze=i}}else return e.apply(n,r)}};function ip(t){try{return t()}catch{}}var jc="@wry/context:Slot",M1=ip(()=>globalThis)||ip(()=>global)||Object.create(null),ap=M1,Kn=ap[jc]||Array[jc]||function(t){try{Object.defineProperty(ap,jc,{value:t,enumerable:!1,writable:!1,configurable:!0})}finally{return t}}(F1());var{bind:U1,noContext:j1}=Kn;function q1(){}var B1=function(){function t(e,r){e===void 0&&(e=1/0),r===void 0&&(r=q1),this.max=e,this.dispose=r,this.map=new Map,this.newest=null,this.oldest=null}return t.prototype.has=function(e){return this.map.has(e)},t.prototype.get=function(e){var r=this.getNode(e);return r&&r.value},t.prototype.getNode=function(e){var r=this.map.get(e);if(r&&r!==this.newest){var n=r.older,i=r.newer;i&&(i.older=n),n&&(n.newer=i),r.older=this.newest,r.older.newer=r,r.newer=null,this.newest=r,r===this.oldest&&(this.oldest=i)}return r},t.prototype.set=function(e,r){var n=this.getNode(e);return n?n.value=r:(n={key:e,value:r,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)},t.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},t.prototype.delete=function(e){var r=this.map.get(e);return r?(r===this.newest&&(this.newest=r.older),r===this.oldest&&(this.oldest=r.newer),r.newer&&(r.newer.older=r.older),r.older&&(r.older.newer=r.newer),this.map.delete(e),this.dispose(r.value,e),!0):!1},t}(),mo=new Kn,qc,V1=Object.prototype.hasOwnProperty,Vc=(qc=Array.from,qc===void 0?function(t){var e=[];return t.forEach(function(r){return e.push(r)}),e}:qc);function ho(t){var e=t.unsubscribe;typeof e=="function"&&(t.unsubscribe=void 0,e())}var Gi=[],z1=100;function Zn(t,e){if(!t)throw new Error(e||"assertion failure")}function Q1(t,e){var r=t.length;return r>0&&r===e.length&&t[r-1]===e[r-1]}function sp(t){switch(t.length){case 0:throw new Error("unknown value");case 1:return t[0];case 2:throw t[1]}}function G1(t){return t.slice(0)}var H1=function(){function t(e){this.fn=e,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++t.count}return t.prototype.peek=function(){if(this.value.length===1&&!wr(this))return op(this),this.value[0]},t.prototype.recompute=function(e){return Zn(!this.recomputing,"already recomputing"),op(this),wr(this)?W1(this,e):sp(this.value)},t.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,cp(this),ho(this))},t.prototype.dispose=function(){var e=this;this.setDirty(),dp(this),zc(this,function(r,n){r.setDirty(),hp(r,e)})},t.prototype.forget=function(){this.dispose()},t.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=Gi.pop()||new Set),this.deps.add(e)},t.prototype.forgetDeps=function(){var e=this;this.deps&&(Vc(this.deps).forEach(function(r){return r.delete(e)}),this.deps.clear(),Gi.push(this.deps),this.deps=null)},t.count=0,t}();function op(t){var e=mo.getValue();if(e)return t.parents.add(e),e.childValues.has(t)||e.childValues.set(t,[]),wr(t)?lp(e,t):fp(e,t),e}function W1(t,e){return dp(t),mo.withValue(t,K1,[t,e]),Y1(t,e)&&Z1(t),sp(t.value)}function K1(t,e){t.recomputing=!0,t.value.length=0;try{t.value[0]=t.fn.apply(null,e)}catch(r){t.value[1]=r}t.recomputing=!1}function wr(t){return t.dirty||!!(t.dirtyChildren&&t.dirtyChildren.size)}function Z1(t){t.dirty=!1,!wr(t)&&up(t)}function cp(t){zc(t,lp)}function up(t){zc(t,fp)}function zc(t,e){var r=t.parents.size;if(r)for(var n=Vc(t.parents),i=0;i<r;++i)e(n[i],t)}function lp(t,e){Zn(t.childValues.has(e)),Zn(wr(e));var r=!wr(t);if(!t.dirtyChildren)t.dirtyChildren=Gi.pop()||new Set;else if(t.dirtyChildren.has(e))return;t.dirtyChildren.add(e),r&&cp(t)}function fp(t,e){Zn(t.childValues.has(e)),Zn(!wr(e));var r=t.childValues.get(e);r.length===0?t.childValues.set(e,G1(e.value)):Q1(r,e.value)||t.setDirty(),pp(t,e),!wr(t)&&up(t)}function pp(t,e){var r=t.dirtyChildren;r&&(r.delete(e),r.size===0&&(Gi.length<z1&&Gi.push(r),t.dirtyChildren=null))}function dp(t){t.childValues.size>0&&t.childValues.forEach(function(e,r){hp(t,r)}),t.forgetDeps(),Zn(t.dirtyChildren===null)}function hp(t,e){e.parents.delete(t),t.childValues.delete(e),pp(t,e)}function Y1(t,e){if(typeof t.subscribe=="function")try{ho(t),t.unsubscribe=t.subscribe.apply(null,e)}catch{return t.setDirty(),!1}return!0}var J1={setDirty:!0,dispose:!0,forget:!0};function go(t){var e=new Map,r=t&&t.subscribe;function n(i){var a=mo.getValue();if(a){var o=e.get(i);o||e.set(i,o=new Set),a.dependOn(o),typeof r=="function"&&(ho(o),o.unsubscribe=r(i))}}return n.dirty=function(a,o){var s=e.get(a);if(s){var u=o&&V1.call(J1,o)?o:"setDirty";Vc(s).forEach(function(c){return c[u]()}),e.delete(a),ho(s)}},n}function mp(){var t=new Bt(typeof WeakMap=="function");return function(){return t.lookupArray(arguments)}}var d6=mp(),Bc=new Set;function an(t,e){e===void 0&&(e=Object.create(null));var r=new B1(e.max||Math.pow(2,16),function(c){return c.dispose()}),n=e.keyArgs,i=e.makeCacheKey||mp(),a=function(){var c=i.apply(null,n?n.apply(null,arguments):arguments);if(c===void 0)return t.apply(null,arguments);var l=r.get(c);l||(r.set(c,l=new H1(t)),l.subscribe=e.subscribe,l.forget=function(){return r.delete(c)});var d=l.recompute(Array.prototype.slice.call(arguments));return r.set(c,l),Bc.add(r),mo.hasValue()||(Bc.forEach(function(p){return p.clean()}),Bc.clear()),d};Object.defineProperty(a,"size",{get:function(){return r.map.size},configurable:!1,enumerable:!1});function o(c){var l=r.get(c);l&&l.setDirty()}a.dirtyKey=o,a.dirty=function(){o(i.apply(null,arguments))};function s(c){var l=r.get(c);if(l)return l.peek()}a.peekKey=s,a.peek=function(){return s(i.apply(null,arguments))};function u(c){return r.delete(c)}return a.forgetKey=u,a.forget=function(){return u(i.apply(null,arguments))},a.makeCacheKey=i,a.getKey=n?function(){return i.apply(null,n.apply(null,arguments))}:i,Object.freeze(a)}var Qc=function(){function t(){this.getFragmentDoc=an(fc)}return t.prototype.batch=function(e){var r=this,n=typeof e.optimistic=="string"?e.optimistic:e.optimistic===!1?null:void 0,i;return this.performTransaction(function(){return i=e.update(r)},n),i},t.prototype.recordOptimisticTransaction=function(e,r){this.performTransaction(e,r)},t.prototype.transformDocument=function(e){return e},t.prototype.transformForLink=function(e){return e},t.prototype.identify=function(e){},t.prototype.gc=function(){return[]},t.prototype.modify=function(e){return!1},t.prototype.readQuery=function(e,r){return r===void 0&&(r=!!e.optimistic),this.read(_(_({},e),{rootId:e.id||"ROOT_QUERY",optimistic:r}))},t.prototype.readFragment=function(e,r){return r===void 0&&(r=!!e.optimistic),this.read(_(_({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:r}))},t.prototype.writeQuery=function(e){var r=e.id,n=e.data,i=Ut(e,["id","data"]);return this.write(Object.assign(i,{dataId:r||"ROOT_QUERY",result:n}))},t.prototype.writeFragment=function(e){var r=e.id,n=e.data,i=e.fragment,a=e.fragmentName,o=Ut(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(i,a),dataId:r,result:n}))},t.prototype.updateQuery=function(e,r){return this.batch({update:function(n){var i=n.readQuery(e),a=r(i);return a==null?i:(n.writeQuery(_(_({},e),{data:a})),a)}})},t.prototype.updateFragment=function(e,r){return this.batch({update:function(n){var i=n.readFragment(e),a=r(i);return a==null?i:(n.writeFragment(_(_({},e),{data:a})),a)}})},t}();var Hi=function(t){xe(e,t);function e(r,n,i,a){var o,s=t.call(this,r)||this;if(s.message=r,s.path=n,s.query=i,s.variables=a,Array.isArray(s.path)){s.missing=s.message;for(var u=s.path.length-1;u>=0;--u)s.missing=(o={},o[s.path[u]]=s.missing,o)}else s.missing=s.path;return s.__proto__=e.prototype,s}return e}(Error);var ke=Object.prototype.hasOwnProperty;function Wi(t){return t==null}function vo(t,e){var r=t.__typename,n=t.id,i=t._id;if(typeof r=="string"&&(e&&(e.keyObject=Wi(n)?Wi(i)?void 0:{_id:i}:{id:n}),Wi(n)&&!Wi(i)&&(n=i),!Wi(n)))return"".concat(r,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var gp={dataIdFromObject:vo,addTypename:!0,resultCaching:!0,canonizeResults:!1};function yp(t){return _r(gp,t)}function bo(t){var e=t.canonizeResults;return e===void 0?gp.canonizeResults:e}function vp(t,e){return K(e)?t.get(e.__ref,"__typename"):e&&e.__typename}var Gc=/^[_a-z][_0-9a-z]*/i;function Dt(t){var e=t.match(Gc);return e?e[0]:t}function yo(t,e,r){return ee(e)?ue(e)?e.every(function(n){return yo(t,n,r)}):t.selections.every(function(n){if(pt(n)&&er(n,r)){var i=_t(n);return ke.call(e,i)&&(!n.selectionSet||yo(n.selectionSet,e[i],r))}return!0}):!1}function Sr(t){return ee(t)&&!K(t)&&!ue(t)}function bp(){return new it}function _o(t,e){var r=Yr(Xr(t));return{fragmentMap:r,lookupFragment:function(n){var i=r[n];return!i&&e&&(i=e.lookup(n)),i||null}}}var wo=Object.create(null),Hc=function(){return wo},_p=Object.create(null),Yn=function(){function t(e,r){var n=this;this.policies=e,this.group=r,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(i,a){return ji(K(i)?n.get(i.__ref,a):i&&i[a])},this.canRead=function(i){return K(i)?n.has(i.__ref):typeof i=="object"},this.toReference=function(i,a){if(typeof i=="string")return jt(i);if(K(i))return i;var o=n.policies.identify(i)[0];if(o){var s=jt(o);return a&&n.merge(o,i),s}}}return t.prototype.toObject=function(){return _({},this.data)},t.prototype.has=function(e){return this.lookup(e,!0)!==void 0},t.prototype.get=function(e,r){if(this.group.depend(e,r),ke.call(this.data,e)){var n=this.data[e];if(n&&ke.call(n,r))return n[r]}if(r==="__typename"&&ke.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof Cr)return this.parent.get(e,r)},t.prototype.lookup=function(e,r){if(r&&this.group.depend(e,"__exists"),ke.call(this.data,e))return this.data[e];if(this instanceof Cr)return this.parent.lookup(e,r);if(this.policies.rootTypenamesById[e])return Object.create(null)},t.prototype.merge=function(e,r){var n=this,i;K(e)&&(e=e.__ref),K(r)&&(r=r.__ref);var a=typeof e=="string"?this.lookup(i=e):e,o=typeof r=="string"?this.lookup(i=r):r;if(!!o){__DEV__?I(typeof i=="string","store.merge expects a string ID"):I(typeof i=="string",1);var s=new it(eg).merge(a,o);if(this.data[i]=s,s!==a&&(delete this.refs[i],this.group.caching)){var u=Object.create(null);a||(u.__exists=1),Object.keys(o).forEach(function(c){if(!a||a[c]!==s[c]){u[c]=1;var l=Dt(c);l!==c&&!n.policies.hasKeyArgs(s.__typename,l)&&(u[l]=1),s[c]===void 0&&!(n instanceof Cr)&&delete s[c]}}),u.__typename&&!(a&&a.__typename)&&this.policies.rootTypenamesById[i]===s.__typename&&delete u.__typename,Object.keys(u).forEach(function(c){return n.group.dirty(i,c)})}}},t.prototype.modify=function(e,r){var n=this,i=this.lookup(e);if(i){var a=Object.create(null),o=!1,s=!0,u={DELETE:wo,INVALIDATE:_p,isReference:K,toReference:this.toReference,canRead:this.canRead,readField:function(c,l){return n.policies.readField(typeof c=="string"?{fieldName:c,from:l||jt(e)}:c,{store:n})}};if(Object.keys(i).forEach(function(c){var l=Dt(c),d=i[c];if(d!==void 0){var p=typeof r=="function"?r:r[c]||r[l];if(p){var f=p===Hc?wo:p(ji(d),_(_({},u),{fieldName:l,storeFieldName:c,storage:n.getStorage(e,c)}));f===_p?n.group.dirty(e,c):(f===wo&&(f=void 0),f!==d&&(a[c]=f,o=!0,d=f))}d!==void 0&&(s=!1)}}),o)return this.merge(e,a),s&&(this instanceof Cr?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},t.prototype.delete=function(e,r,n){var i,a=this.lookup(e);if(a){var o=this.getFieldValue(a,"__typename"),s=r&&n?this.policies.getStoreFieldName({typename:o,fieldName:r,args:n}):r;return this.modify(e,s?(i={},i[s]=Hc,i):Hc)}return!1},t.prototype.evict=function(e,r){var n=!1;return e.id&&(ke.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof Cr&&this!==r&&(n=this.parent.evict(e,r)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n},t.prototype.clear=function(){this.replace(null)},t.prototype.extract=function(){var e=this,r=this.toObject(),n=[];return this.getRootIdSet().forEach(function(i){ke.call(e.policies.rootTypenamesById,i)||n.push(i)}),n.length&&(r.__META={extraRootIds:n.sort()}),r},t.prototype.replace=function(e){var r=this;if(Object.keys(this.data).forEach(function(a){e&&ke.call(e,a)||r.delete(a)}),e){var n=e.__META,i=Ut(e,["__META"]);Object.keys(i).forEach(function(a){r.merge(a,i[a])}),n&&n.extraRootIds.forEach(this.retain,this)}},t.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},t.prototype.release=function(e){if(this.rootIds[e]>0){var r=--this.rootIds[e];return r||delete this.rootIds[e],r}return 0},t.prototype.getRootIdSet=function(e){return e===void 0&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof Cr?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},t.prototype.gc=function(){var e=this,r=this.getRootIdSet(),n=this.toObject();r.forEach(function(o){ke.call(n,o)&&(Object.keys(e.findChildRefIds(o)).forEach(r.add,r),delete n[o])});var i=Object.keys(n);if(i.length){for(var a=this;a instanceof Cr;)a=a.parent;i.forEach(function(o){return a.delete(o)})}return i},t.prototype.findChildRefIds=function(e){if(!ke.call(this.refs,e)){var r=this.refs[e]=Object.create(null),n=this.data[e];if(!n)return r;var i=new Set([n]);i.forEach(function(a){K(a)&&(r[a.__ref]=!0),ee(a)&&Object.keys(a).forEach(function(o){var s=a[o];ee(s)&&i.add(s)})})}return this.refs[e]},t.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},t}();var wp=function(){function t(e,r){r===void 0&&(r=null),this.caching=e,this.parent=r,this.d=null,this.resetCaching()}return t.prototype.resetCaching=function(){this.d=this.caching?go():null,this.keyMaker=new Bt(wt)},t.prototype.depend=function(e,r){if(this.d){this.d(Wc(e,r));var n=Dt(r);n!==r&&this.d(Wc(e,n)),this.parent&&this.parent.depend(e,r)}},t.prototype.dirty=function(e,r){this.d&&this.d.dirty(Wc(e,r),r==="__exists"?"forget":"setDirty")},t}();function Wc(t,e){return e+"#"+t}function Kc(t,e){on(t)&&t.group.depend(e,"__exists")}(function(t){var e=function(r){xe(n,r);function n(i){var a=i.policies,o=i.resultCaching,s=o===void 0?!0:o,u=i.seed,c=r.call(this,a,new wp(s))||this;return c.stump=new X1(c),c.storageTrie=new Bt(wt),u&&c.replace(u),c}return n.prototype.addLayer=function(i,a){return this.stump.addLayer(i,a)},n.prototype.removeLayer=function(){return this},n.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},n}(t);t.Root=e})(Yn||(Yn={}));var Cr=function(t){xe(e,t);function e(r,n,i,a){var o=t.call(this,n.policies,a)||this;return o.id=r,o.parent=n,o.replay=i,o.group=a,i(o),o}return e.prototype.addLayer=function(r,n){return new e(r,this,n,this.group)},e.prototype.removeLayer=function(r){var n=this,i=this.parent.removeLayer(r);return r===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(a){var o=n.data[a],s=i.lookup(a);s?o?o!==s&&Object.keys(o).forEach(function(u){be(o[u],s[u])||n.group.dirty(a,u)}):(n.group.dirty(a,"__exists"),Object.keys(s).forEach(function(u){n.group.dirty(a,u)})):n.delete(a)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return _(_({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(r){var n=this.parent.findChildRefIds(r);return ke.call(this.data,r)?_(_({},n),t.prototype.findChildRefIds.call(this,r)):n},e.prototype.getStorage=function(){for(var r=this.parent;r.parent;)r=r.parent;return r.getStorage.apply(r,arguments)},e}(Yn),X1=function(t){xe(e,t);function e(r){return t.call(this,"EntityStore.Stump",r,function(){},new wp(r.group.caching,r.group))||this}return e.prototype.removeLayer=function(){return this},e.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},e}(Cr);function eg(t,e,r){var n=t[r],i=e[r];return be(n,i)?n:i}function on(t){return!!(t instanceof Yn&&t.group.caching)}function tg(t){return ee(t)?ue(t)?t.slice(0):_({__proto__:Object.getPrototypeOf(t)},t):t}var So=function(){function t(){this.known=new(xf?WeakSet:Set),this.pool=new Bt(wt),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return t.prototype.isKnown=function(e){return ee(e)&&this.known.has(e)},t.prototype.pass=function(e){if(ee(e)){var r=tg(e);return this.passes.set(r,e),r}return e},t.prototype.admit=function(e){var r=this;if(ee(e)){var n=this.passes.get(e);if(n)return n;var i=Object.getPrototypeOf(e);switch(i){case Array.prototype:{if(this.known.has(e))return e;var a=e.map(this.admit,this),o=this.pool.lookupArray(a);return o.array||(this.known.add(o.array=a),__DEV__&&Object.freeze(a)),o.array}case null:case Object.prototype:{if(this.known.has(e))return e;var s=Object.getPrototypeOf(e),u=[s],c=this.sortedKeys(e);u.push(c.json);var l=u.length;c.sorted.forEach(function(f){u.push(r.admit(e[f]))});var o=this.pool.lookupArray(u);if(!o.object){var d=o.object=Object.create(s);this.known.add(d),c.sorted.forEach(function(f,h){d[f]=u[l+h]}),__DEV__&&Object.freeze(d)}return o.object}}}return e},t.prototype.sortedKeys=function(e){var r=Object.keys(e),n=this.pool.lookupArray(r);if(!n.keys){r.sort();var i=JSON.stringify(r);(n.keys=this.keysByJSON.get(i))||this.keysByJSON.set(i,n.keys={sorted:r,json:i})}return n.keys},t}();var dt=Object.assign(function(t){if(ee(t)){Zc===void 0&&Sp();var e=Zc.admit(t),r=Yc.get(e);return r===void 0&&Yc.set(e,r=JSON.stringify(e)),r}return JSON.stringify(t)},{reset:Sp}),Zc,Yc;function Sp(){Zc=new So,Yc=new(wt?WeakMap:Map)}function Cp(t){return[t.selectionSet,t.objectOrReference,t.context,t.context.canonizeResults]}var Ep=function(){function t(e){var r=this;this.knownResults=new(wt?WeakMap:Map),this.config=_r(e,{addTypename:e.addTypename!==!1,canonizeResults:bo(e)}),this.canon=e.canon||new So,this.executeSelectionSet=an(function(n){var i,a=n.context.canonizeResults,o=Cp(n);o[3]=!a;var s=(i=r.executeSelectionSet).peek.apply(i,o);return s?a?_(_({},s),{result:r.canon.admit(s.result)}):s:(Kc(n.context.store,n.enclosingRef.__ref),r.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize,keyArgs:Cp,makeCacheKey:function(n,i,a,o){if(on(a.store))return a.store.makeCacheKey(n,K(i)?i.__ref:i,a.varString,o)}}),this.executeSubSelectedArray=an(function(n){return Kc(n.context.store,n.enclosingRef.__ref),r.execSubSelectedArrayImpl(n)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(n){var i=n.field,a=n.array,o=n.context;if(on(o.store))return o.store.makeCacheKey(i,a,o.varString)}})}return t.prototype.resetCanon=function(){this.canon=new So},t.prototype.diffQueryAgainstStore=function(e){var r=e.store,n=e.query,i=e.rootId,a=i===void 0?"ROOT_QUERY":i,o=e.variables,s=e.returnPartialData,u=s===void 0?!0:s,c=e.canonizeResults,l=c===void 0?this.config.canonizeResults:c,d=this.config.cache.policies;o=_(_({},tn(Fi(n))),o);var p=jt(a),f=this.executeSelectionSet({selectionSet:en(n).selectionSet,objectOrReference:p,enclosingRef:p,context:_({store:r,query:n,policies:d,variables:o,varString:dt(o),canonizeResults:l},_o(n,this.config.fragments))}),h;if(f.missing&&(h=[new Hi(rg(f.missing),f.missing,n,o)],!u))throw h[0];return{result:f.result,complete:!h,missing:h}},t.prototype.isFresh=function(e,r,n,i){if(on(i.store)&&this.knownResults.get(e)===n){var a=this.executeSelectionSet.peek(n,r,i,this.canon.isKnown(e));if(a&&e===a.result)return!0}return!1},t.prototype.execSelectionSetImpl=function(e){var r=this,n=e.selectionSet,i=e.objectOrReference,a=e.enclosingRef,o=e.context;if(K(i)&&!o.policies.rootTypenamesById[i.__ref]&&!o.store.has(i.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(i.__ref," object")};var s=o.variables,u=o.policies,c=o.store,l=c.getFieldValue(i,"__typename"),d=[],p,f=new it;this.config.addTypename&&typeof l=="string"&&!u.rootIdsByTypename[l]&&d.push({__typename:l});function h(v,m){var A;return v.missing&&(p=f.merge(p,(A={},A[m]=v.missing,A))),v.result}var g=new Set(n.selections);g.forEach(function(v){var m,A;if(!!er(v,s))if(pt(v)){var D=u.readField({fieldName:v.name.value,field:v,variables:o.variables,from:i},o),E=_t(v);D===void 0?rn.added(v)||(p=f.merge(p,(m={},m[E]="Can't find field '".concat(v.name.value,"' on ").concat(K(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),m))):ue(D)?D=h(r.executeSubSelectedArray({field:v,array:D,enclosingRef:a,context:o}),E):v.selectionSet?D!=null&&(D=h(r.executeSelectionSet({selectionSet:v.selectionSet,objectOrReference:D,enclosingRef:K(D)?D:a,context:o}),E)):o.canonizeResults&&(D=r.canon.pass(D)),D!==void 0&&d.push((A={},A[E]=D,A))}else{var O=Jr(v,o.lookupFragment);if(!O&&v.kind===Oe.FRAGMENT_SPREAD)throw __DEV__?new V("No fragment named ".concat(v.name.value)):new V(5);O&&u.fragmentMatches(O,l)&&O.selectionSet.selections.forEach(g.add,g)}});var y=Mi(d),S={result:y,missing:p},b=o.canonizeResults?this.canon.admit(S):ji(S);return b.result&&this.knownResults.set(b.result,n),b},t.prototype.execSubSelectedArrayImpl=function(e){var r=this,n=e.field,i=e.array,a=e.enclosingRef,o=e.context,s,u=new it;function c(l,d){var p;return l.missing&&(s=u.merge(s,(p={},p[d]=l.missing,p))),l.result}return n.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(l,d){return l===null?null:ue(l)?c(r.executeSubSelectedArray({field:n,array:l,enclosingRef:a,context:o}),d):n.selectionSet?c(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:l,enclosingRef:K(l)?l:a,context:o}),d):(__DEV__&&ng(o.store,n,l),l)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:s}},t}();function rg(t){try{JSON.stringify(t,function(e,r){if(typeof r=="string")throw r;return r})}catch(e){return e}}function ng(t,e,r){if(!e.selectionSet){var n=new Set([r]);n.forEach(function(i){ee(i)&&(__DEV__?I(!K(i),"Missing selection set for object of type ".concat(vp(t,i)," returned for query field ").concat(e.name.value)):I(!K(i),6),Object.values(i).forEach(n.add,n))})}}var Jn=new Kn,xp=new WeakMap;function Ki(t){var e=xp.get(t);return e||xp.set(t,e={vars:new Set,dep:go()}),e}function Jc(t){Ki(t).vars.forEach(function(e){return e.forgetCache(t)})}function kp(t){Ki(t).vars.forEach(function(e){return e.attachCache(t)})}function Co(t){var e=new Set,r=new Set,n=function(a){if(arguments.length>0){if(t!==a){t=a,e.forEach(function(u){Ki(u).dep.dirty(n),ig(u)});var o=Array.from(r);r.clear(),o.forEach(function(u){return u(t)})}}else{var s=Jn.getValue();s&&(i(s),Ki(s).dep(n))}return t};n.onNextChange=function(a){return r.add(a),function(){r.delete(a)}};var i=n.attachCache=function(a){return e.add(a),Ki(a).vars.add(n),n};return n.forgetCache=function(a){return e.delete(a)},n}function ig(t){t.broadcastWatches&&t.broadcastWatches()}var Tp=Object.create(null);function Xc(t){var e=JSON.stringify(t);return Tp[e]||(Tp[e]=Object.create(null))}function eu(t){var e=Xc(t);return e.keyFieldsFn||(e.keyFieldsFn=function(r,n){var i=function(o,s){return n.readField(s,o)},a=n.keyObject=ru(t,function(o){var s=Xn(n.storeObject,o,i);return s===void 0&&r!==n.storeObject&&ke.call(r,o[0])&&(s=Xn(r,o,Ip)),__DEV__?I(s!==void 0,"Missing field '".concat(o.join("."),"' while extracting keyFields from ").concat(JSON.stringify(r))):I(s!==void 0,2),s});return"".concat(n.typename,":").concat(JSON.stringify(a))})}function tu(t){var e=Xc(t);return e.keyArgsFn||(e.keyArgsFn=function(r,n){var i=n.field,a=n.variables,o=n.fieldName,s=ru(t,function(c){var l=c[0],d=l.charAt(0);if(d==="@"){if(i&&Re(i.directives)){var p=l.slice(1),f=i.directives.find(function(S){return S.name.value===p}),h=f&&tr(f,a);return h&&Xn(h,c.slice(1))}return}if(d==="$"){var g=l.slice(1);if(a&&ke.call(a,g)){var y=c.slice(0);return y[0]=g,Xn(a,y)}return}if(r)return Xn(r,c)}),u=JSON.stringify(s);return(r||u!=="{}")&&(o+=":"+u),o})}function ru(t,e){var r=new it;return Ap(t).reduce(function(n,i){var a,o=e(i);if(o!==void 0){for(var s=i.length-1;s>=0;--s)o=(a={},a[i[s]]=o,a);n=r.merge(n,o)}return n},Object.create(null))}function Ap(t){var e=Xc(t);if(!e.paths){var r=e.paths=[],n=[];t.forEach(function(i,a){ue(i)?(Ap(i).forEach(function(o){return r.push(n.concat(o))}),n.length=0):(n.push(i),ue(t[a+1])||(r.push(n.slice(0)),n.length=0))})}return e.paths}function Ip(t,e){return t[e]}function Xn(t,e,r){return r=r||Ip,Op(e.reduce(function n(i,a){return ue(i)?i.map(function(o){return n(o,a)}):i&&r(i,a)},t))}function Op(t){return ee(t)?ue(t)?t.map(Op):ru(Object.keys(t).sort(),function(e){return Xn(t,e)}):t}Li.setStringify(dt);function nu(t){return t.args!==void 0?t.args:t.field?tr(t.field,t.variables):null}var ag=function(){},Dp=function(t,e){return e.fieldName},Np=function(t,e,r){var n=r.mergeObjects;return n(t,e)},Rp=function(t,e){return e},Lp=function(){function t(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=_({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 t.prototype.identify=function(e,r){var n,i=this,a=r&&(r.typename||((n=r.storeObject)===null||n===void 0?void 0:n.__typename))||e.__typename;if(a===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=r&&r.storeObject||e,s=_(_({},r),{typename:a,storeObject:o,readField:r&&r.readField||function(){var p=Eo(arguments,o);return i.readField(p,{store:i.cache.data,variables:p.variables})}}),u,c=a&&this.getTypePolicy(a),l=c&&c.keyFn||this.config.dataIdFromObject;l;){var d=l(e,s);if(ue(d))l=eu(d);else{u=d;break}}return u=u?String(u):void 0,s.keyObject?[u,s.keyObject]:[u]},t.prototype.addTypePolicies=function(e){var r=this;Object.keys(e).forEach(function(n){var i=e[n],a=i.queryType,o=i.mutationType,s=i.subscriptionType,u=Ut(i,["queryType","mutationType","subscriptionType"]);a&&r.setRootTypename("Query",n),o&&r.setRootTypename("Mutation",n),s&&r.setRootTypename("Subscription",n),ke.call(r.toBeAdded,n)?r.toBeAdded[n].push(u):r.toBeAdded[n]=[u]})},t.prototype.updateTypePolicy=function(e,r){var n=this,i=this.getTypePolicy(e),a=r.keyFields,o=r.fields;function s(u,c){u.merge=typeof c=="function"?c:c===!0?Np:c===!1?Rp:u.merge}s(i,r.merge),i.keyFn=a===!1?ag:ue(a)?eu(a):typeof a=="function"?a:i.keyFn,o&&Object.keys(o).forEach(function(u){var c=n.getFieldPolicy(e,u,!0),l=o[u];if(typeof l=="function")c.read=l;else{var d=l.keyArgs,p=l.read,f=l.merge;c.keyFn=d===!1?Dp:ue(d)?tu(d):typeof d=="function"?d:c.keyFn,typeof p=="function"&&(c.read=p),s(c,f)}c.read&&c.merge&&(c.keyFn=c.keyFn||Dp)})},t.prototype.setRootTypename=function(e,r){r===void 0&&(r=e);var n="ROOT_"+e.toUpperCase(),i=this.rootTypenamesById[n];r!==i&&(__DEV__?I(!i||i===e,"Cannot change root ".concat(e," __typename more than once")):I(!i||i===e,3),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[r]=n,this.rootTypenamesById[n]=r)},t.prototype.addPossibleTypes=function(e){var r=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(n){r.getSupertypeSet(n,!0),e[n].forEach(function(i){r.getSupertypeSet(i,!0).add(n);var a=i.match(Gc);(!a||a[0]!==i)&&r.fuzzySubtypes.set(i,new RegExp(i))})})},t.prototype.getTypePolicy=function(e){var r=this;if(!ke.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var i=this.supertypeMap.get(e);i&&i.size&&i.forEach(function(o){var s=r.getTypePolicy(o),u=s.fields,c=Ut(s,["fields"]);Object.assign(n,c),Object.assign(n.fields,u)})}var a=this.toBeAdded[e];return a&&a.length&&a.splice(0).forEach(function(o){r.updateTypePolicy(e,o)}),this.typePolicies[e]},t.prototype.getFieldPolicy=function(e,r,n){if(e){var i=this.getTypePolicy(e).fields;return i[r]||n&&(i[r]=Object.create(null))}},t.prototype.getSupertypeSet=function(e,r){var n=this.supertypeMap.get(e);return!n&&r&&this.supertypeMap.set(e,n=new Set),n},t.prototype.fragmentMatches=function(e,r,n,i){var a=this;if(!e.typeCondition)return!0;if(!r)return!1;var o=e.typeCondition.name.value;if(r===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(r,!0),u=[s],c=function(h){var g=a.getSupertypeSet(h,!1);g&&g.size&&u.indexOf(g)<0&&u.push(g)},l=!!(n&&this.fuzzySubtypes.size),d=!1,p=0;p<u.length;++p){var f=u[p];if(f.has(o))return s.has(o)||(d&&__DEV__&&I.warn("Inferring subtype ".concat(r," of supertype ").concat(o)),s.add(o)),!0;f.forEach(c),l&&p===u.length-1&&yo(e.selectionSet,n,i)&&(l=!1,d=!0,this.fuzzySubtypes.forEach(function(h,g){var y=r.match(h);y&&y[0]===r&&c(g)}))}return!1},t.prototype.hasKeyArgs=function(e,r){var n=this.getFieldPolicy(e,r,!1);return!!(n&&n.keyFn)},t.prototype.getStoreFieldName=function(e){var r=e.typename,n=e.fieldName,i=this.getFieldPolicy(r,n,!1),a,o=i&&i.keyFn;if(o&&r)for(var s={typename:r,fieldName:n,field:e.field||null,variables:e.variables},u=nu(e);o;){var c=o(u,s);if(ue(c))o=tu(c);else{a=c||n;break}}return a===void 0&&(a=e.field?dc(e.field,e.variables):Li(n,nu(e))),a===!1?n:n===Dt(a)?a:n+":"+a},t.prototype.readField=function(e,r){var n=e.from;if(!!n){var i=e.field||e.fieldName;if(!!i){if(e.typename===void 0){var a=r.store.getFieldValue(n,"__typename");a&&(e.typename=a)}var o=this.getStoreFieldName(e),s=Dt(o),u=r.store.getFieldValue(n,o),c=this.getFieldPolicy(e.typename,s,!1),l=c&&c.read;if(l){var d=Pp(this,n,e,r,r.store.getStorage(K(n)?n.__ref:n,o));return Jn.withValue(this.cache,l,[u,d])}return u}}},t.prototype.getReadFunction=function(e,r){var n=this.getFieldPolicy(e,r,!1);return n&&n.read},t.prototype.getMergeFunction=function(e,r,n){var i=this.getFieldPolicy(e,r,!1),a=i&&i.merge;return!a&&n&&(i=this.getTypePolicy(n),a=i&&i.merge),a},t.prototype.runMergeFunction=function(e,r,n,i,a){var o=n.field,s=n.typename,u=n.merge;return u===Np?$p(i.store)(e,r):u===Rp?r:(i.overwrite&&(e=void 0),u(e,r,Pp(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:i.variables},i,a||Object.create(null))))},t}();function Pp(t,e,r,n,i){var a=t.getStoreFieldName(r),o=Dt(a),s=r.variables||n.variables,u=n.store,c=u.toReference,l=u.canRead;return{args:nu(r),field:r.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:K,toReference:c,storage:i,cache:t.cache,canRead:l,readField:function(){return t.readField(Eo(arguments,e,s),n)},mergeObjects:$p(n.store)}}function Eo(t,e,r){var n=t[0],i=t[1],a=t.length,o;return typeof n=="string"?o={fieldName:n,from:a>1?i:e}:(o=_({},n),ke.call(o,"from")||(o.from=e)),__DEV__&&o.from===void 0&&__DEV__&&I.warn("Undefined 'from' passed to readField with arguments ".concat(If(Array.from(t)))),o.variables===void 0&&(o.variables=r),o}function $p(t){return function(r,n){if(ue(r)||ue(n))throw __DEV__?new V("Cannot automatically merge arrays"):new V(4);if(ee(r)&&ee(n)){var i=t.getFieldValue(r,"__typename"),a=t.getFieldValue(n,"__typename"),o=i&&a&&i!==a;if(o)return n;if(K(r)&&Sr(n))return t.merge(r.__ref,n),r;if(Sr(r)&&K(n))return t.merge(r,n.__ref),n;if(Sr(r)&&Sr(n))return _(_({},r),n)}return n}}function iu(t,e,r){var n="".concat(e).concat(r),i=t.flavors.get(n);return i||t.flavors.set(n,i=t.clientOnly===e&&t.deferred===r?t:_(_({},t),{clientOnly:e,deferred:r})),i}var jp=function(){function t(e,r,n){this.cache=e,this.reader=r,this.fragments=n}return t.prototype.writeToStore=function(e,r){var n=this,i=r.query,a=r.result,o=r.dataId,s=r.variables,u=r.overwrite,c=qt(i),l=bp();s=_(_({},tn(c)),s);var d=_(_({store:e,written:Object.create(null),merge:function(f,h){return l.merge(f,h)},variables:s,varString:dt(s)},_o(i,this.fragments)),{overwrite:!!u,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),p=this.processSelectionSet({result:a||Object.create(null),dataId:o,selectionSet:c.selectionSet,mergeTree:{map:new Map},context:d});if(!K(p))throw __DEV__?new V("Could not identify object ".concat(JSON.stringify(a))):new V(7);return d.incomingById.forEach(function(f,h){var g=f.storeObject,y=f.mergeTree,S=f.fieldNodeSet,b=jt(h);if(y&&y.map.size){var v=n.applyMerges(y,b,g,d);if(K(v))return;g=v}if(__DEV__&&!d.overwrite){var m=Object.create(null);S.forEach(function(E){E.selectionSet&&(m[E.name.value]=!0)});var A=function(E){return m[Dt(E)]===!0},D=function(E){var O=y&&y.map.get(E);return Boolean(O&&O.info&&O.info.merge)};Object.keys(g).forEach(function(E){A(E)&&!D(E)&&og(b,g,E,d.store)})}e.merge(h,g)}),e.retain(p.__ref),p},t.prototype.processSelectionSet=function(e){var r=this,n=e.dataId,i=e.result,a=e.selectionSet,o=e.context,s=e.mergeTree,u=this.cache.policies,c=Object.create(null),l=n&&u.rootTypenamesById[n]||$i(i,a,o.fragmentMap)||n&&o.store.get(n,"__typename");typeof l=="string"&&(c.__typename=l);var d=function(){var v=Eo(arguments,c,o.variables);if(K(v.from)){var m=o.incomingById.get(v.from.__ref);if(m){var A=u.readField(_(_({},v),{from:m.storeObject}),o);if(A!==void 0)return A}}return u.readField(v,o)},p=new Set;this.flattenFields(a,i,o,l).forEach(function(v,m){var A,D=_t(m),E=i[D];if(p.add(m),E!==void 0){var O=u.getStoreFieldName({typename:l,fieldName:m.name.value,field:m,variables:v.variables}),P=Fp(s,O),N=r.processFieldValue(E,m,m.selectionSet?iu(v,!1,!1):v,P),j=void 0;m.selectionSet&&(K(N)||Sr(N))&&(j=d("__typename",N));var qe=u.getMergeFunction(l,m.name.value,j);qe?P.info={field:m,typename:l,merge:qe}:Mp(s,O),c=v.merge(c,(A={},A[O]=N,A))}else __DEV__&&!v.clientOnly&&!v.deferred&&!rn.added(m)&&!u.getReadFunction(l,m.name.value)&&__DEV__&&I.error("Missing field '".concat(_t(m),"' while writing result ").concat(JSON.stringify(i,null,2)).substring(0,1e3))});try{var f=u.identify(i,{typename:l,selectionSet:a,fragmentMap:o.fragmentMap,storeObject:c,readField:d}),h=f[0],g=f[1];n=n||h,g&&(c=o.merge(c,g))}catch(v){if(!n)throw v}if(typeof n=="string"){var y=jt(n),S=o.written[n]||(o.written[n]=[]);if(S.indexOf(a)>=0||(S.push(a),this.reader&&this.reader.isFresh(i,y,a,o)))return y;var b=o.incomingById.get(n);return b?(b.storeObject=o.merge(b.storeObject,c),b.mergeTree=au(b.mergeTree,s),p.forEach(function(v){return b.fieldNodeSet.add(v)})):o.incomingById.set(n,{storeObject:c,mergeTree:xo(s)?void 0:s,fieldNodeSet:p}),y}return c},t.prototype.processFieldValue=function(e,r,n,i){var a=this;return!r.selectionSet||e===null?__DEV__?io(e):e:ue(e)?e.map(function(o,s){var u=a.processFieldValue(o,r,n,Fp(i,s));return Mp(i,s),u}):this.processSelectionSet({result:e,selectionSet:r.selectionSet,context:n,mergeTree:i})},t.prototype.flattenFields=function(e,r,n,i){i===void 0&&(i=$i(r,e,n.fragmentMap));var a=new Map,o=this.cache.policies,s=new Bt(!1);return function u(c,l){var d=s.lookup(c,l.clientOnly,l.deferred);d.visited||(d.visited=!0,c.selections.forEach(function(p){if(!!er(p,n.variables)){var f=l.clientOnly,h=l.deferred;if(!(f&&h)&&Re(p.directives)&&p.directives.forEach(function(S){var b=S.name.value;if(b==="client"&&(f=!0),b==="defer"){var v=tr(S,n.variables);(!v||v.if!==!1)&&(h=!0)}}),pt(p)){var g=a.get(p);g&&(f=f&&g.clientOnly,h=h&&g.deferred),a.set(p,iu(n,f,h))}else{var y=Jr(p,n.lookupFragment);if(!y&&p.kind===Oe.FRAGMENT_SPREAD)throw __DEV__?new V("No fragment named ".concat(p.name.value)):new V(8);y&&o.fragmentMatches(y,i,r,n.variables)&&u(y.selectionSet,iu(n,f,h))}}}))}(e,n),a},t.prototype.applyMerges=function(e,r,n,i,a){var o,s=this;if(e.map.size&&!K(n)){var u=!ue(n)&&(K(r)||Sr(r))?r:void 0,c=n;u&&!a&&(a=[K(u)?u.__ref:u]);var l,d=function(p,f){return ue(p)?typeof f=="number"?p[f]:void 0:i.store.getFieldValue(p,String(f))};e.map.forEach(function(p,f){var h=d(u,f),g=d(c,f);if(g!==void 0){a&&a.push(f);var y=s.applyMerges(p,h,g,i,a);y!==g&&(l=l||new Map,l.set(f,y)),a&&I(a.pop()===f)}}),l&&(n=ue(c)?c.slice(0):_({},c),l.forEach(function(p,f){n[f]=p}))}return e.info?this.cache.policies.runMergeFunction(r,n,e.info,i,a&&(o=i.store).getStorage.apply(o,a)):n},t}();var qp=[];function Fp(t,e){var r=t.map;return r.has(e)||r.set(e,qp.pop()||{map:new Map}),r.get(e)}function au(t,e){if(t===e||!e||xo(e))return t;if(!t||xo(t))return e;var r=t.info&&e.info?_(_({},t.info),e.info):t.info||e.info,n=t.map.size&&e.map.size,i=n?new Map:t.map.size?t.map:e.map,a={info:r,map:i};if(n){var o=new Set(e.map.keys());t.map.forEach(function(s,u){a.map.set(u,au(s,e.map.get(u))),o.delete(u)}),o.forEach(function(s){a.map.set(s,au(e.map.get(s),t.map.get(s)))})}return a}function xo(t){return!t||!(t.info||t.map.size)}function Mp(t,e){var r=t.map,n=r.get(e);n&&xo(n)&&(qp.push(n),r.delete(e))}var Up=new Set;function og(t,e,r,n){var i=function(d){var p=n.getFieldValue(d,r);return typeof p=="object"&&p},a=i(t);if(!!a){var o=i(e);if(!!o&&!K(a)&&!be(a,o)&&!Object.keys(a).every(function(d){return n.getFieldValue(o,d)!==void 0})){var s=n.getFieldValue(t,"__typename")||n.getFieldValue(e,"__typename"),u=Dt(r),c="".concat(s,".").concat(u);if(!Up.has(c)){Up.add(c);var l=[];!ue(a)&&!ue(o)&&[a,o].forEach(function(d){var p=n.getFieldValue(d,"__typename");typeof p=="string"&&!l.includes(p)&&l.push(p)}),__DEV__&&I.warn("Cache data may be lost when replacing the ".concat(u," field of a ").concat(s,` object.
|
|
39
39
|
|
|
40
40
|
To 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(c,` field, so InMemoryCache can safely merge these objects:
|
|
41
41
|
|
|
@@ -50,7 +50,7 @@ For more information about these options, please refer to the documentation:
|
|
|
50
50
|
`)})}return t.networkError&&(e+="".concat(t.networkError.message,`
|
|
51
51
|
`)),e=e.replace(/\n$/,""),e},rr=function(t){xe(e,t);function e(r){var n=r.graphQLErrors,i=r.clientErrors,a=r.networkError,o=r.errorMessage,s=r.extraInfo,u=t.call(this,o)||this;return u.name="ApolloError",u.graphQLErrors=n||[],u.clientErrors=i||[],u.networkError=a||null,u.message=o||sg(u),u.extraInfo=s,u.__proto__=e.prototype,u}return e}(Error);var ie;(function(t){t[t.loading=1]="loading",t[t.setVariables=2]="setVariables",t[t.fetchMore=3]="fetchMore",t[t.refetch=4]="refetch",t[t.poll=6]="poll",t[t.ready=7]="ready",t[t.error=8]="error"})(ie||(ie={}));function Er(t){return t?t<7:!1}var cg=Object.assign,ug=Object.hasOwnProperty,To=function(t){xe(e,t);function e(r){var n=r.queryManager,i=r.queryInfo,a=r.options,o=t.call(this,function(y){try{var S=y._subscription._observer;S&&!S.error&&(S.error=lg)}catch{}var b=!o.observers.size;o.observers.add(y);var v=o.last;return v&&v.error?y.error&&y.error(v.error):v&&v.result&&y.next&&y.next(v.result),b&&o.reobserve().catch(function(){}),function(){o.observers.delete(y)&&!o.observers.size&&o.tearDownQuery()}})||this;o.observers=new Set,o.subscriptions=new Set,o.queryInfo=i,o.queryManager=n,o.isTornDown=!1;var s=n.defaultOptions.watchQuery,u=s===void 0?{}:s,c=u.fetchPolicy,l=c===void 0?"cache-first":c,d=a.fetchPolicy,p=d===void 0?l:d,f=a.initialFetchPolicy,h=f===void 0?p==="standby"?l:p:f;o.options=_(_({},a),{initialFetchPolicy:h,fetchPolicy:p}),o.queryId=i.queryId||n.generateQueryId();var g=qt(o.query);return o.queryName=g&&g.name&&g.name.value,o}return Object.defineProperty(e.prototype,"query",{get:function(){return this.queryManager.transform(this.options.query).document},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),e.prototype.result=function(){var r=this;return new Promise(function(n,i){var a={next:function(s){n(s),r.observers.delete(a),r.observers.size||r.queryManager.removeQuery(r.queryId),setTimeout(function(){o.unsubscribe()},0)},error:i},o=r.subscribe(a)})},e.prototype.getCurrentResult=function(r){r===void 0&&(r=!0);var n=this.getLastResult(!0),i=this.queryInfo.networkStatus||n&&n.networkStatus||ie.ready,a=_(_({},n),{loading:Er(i),networkStatus:i}),o=this.options.fetchPolicy,s=o===void 0?"cache-first":o;if(!(s==="network-only"||s==="no-cache"||s==="standby"||this.queryManager.transform(this.options.query).hasForcedResolvers)){var u=this.queryInfo.getDiff();(u.complete||this.options.returnPartialData)&&(a.data=u.result),be(a.data,{})&&(a.data=void 0),u.complete?(delete a.partial,u.complete&&a.networkStatus===ie.loading&&(s==="cache-first"||s==="cache-only")&&(a.networkStatus=ie.ready,a.loading=!1)):a.partial=!0,__DEV__&&!u.complete&&!this.options.partialRefetch&&!a.loading&&!a.data&&!a.error&&su(u.missing)}return r&&this.updateLastResult(a),a},e.prototype.isDifferentFromLastResult=function(r,n){return!this.last||!be(this.last.result,r)||n&&!be(this.last.variables,n)},e.prototype.getLast=function(r,n){var i=this.last;if(i&&i[r]&&(!n||be(i.variables,this.variables)))return i[r]},e.prototype.getLastResult=function(r){return this.getLast("result",r)},e.prototype.getLastError=function(r){return this.getLast("error",r)},e.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},e.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},e.prototype.refetch=function(r){var n,i={pollInterval:0},a=this.options.fetchPolicy;if(a==="cache-and-network"?i.fetchPolicy=a:a==="no-cache"?i.fetchPolicy="no-cache":i.fetchPolicy="network-only",__DEV__&&r&&ug.call(r,"variables")){var o=Fi(this.query),s=o.variableDefinitions;(!s||!s.some(function(u){return u.variable.name.value==="variables"}))&&__DEV__&&I.warn("Called refetch(".concat(JSON.stringify(r),") for query ").concat(((n=o.name)===null||n===void 0?void 0:n.value)||JSON.stringify(o),`, which does not declare a $variables variable.
|
|
52
52
|
Did you mean to call refetch(variables) instead of refetch({ variables })?`))}return r&&!be(this.options.variables,r)&&(i.variables=this.options.variables=_(_({},this.options.variables),r)),this.queryInfo.resetLastWrite(),this.reobserve(i,ie.refetch)},e.prototype.fetchMore=function(r){var n=this,i=_(_({},r.query?r:_(_(_(_({},this.options),{query:this.query}),r),{variables:_(_({},this.options.variables),r.variables)})),{fetchPolicy:"no-cache"}),a=this.queryManager.generateQueryId(),o=this.queryInfo,s=o.networkStatus;o.networkStatus=ie.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var u=new Set;return this.queryManager.fetchQuery(a,i,ie.fetchMore).then(function(c){return n.queryManager.removeQuery(a),o.networkStatus===ie.fetchMore&&(o.networkStatus=s),n.queryManager.cache.batch({update:function(l){var d=r.updateQuery;d?l.updateQuery({query:n.query,variables:n.variables,returnPartialData:!0,optimistic:!1},function(p){return d(p,{fetchMoreResult:c.data,variables:i.variables})}):l.writeQuery({query:i.query,variables:i.variables,data:c.data})},onWatchUpdated:function(l){u.add(l.query)}}),c}).finally(function(){u.has(n.query)||ou(n)})},e.prototype.subscribeToMore=function(r){var n=this,i=this.queryManager.startGraphQLSubscription({query:r.document,variables:r.variables,context:r.context}).subscribe({next:function(a){var o=r.updateQuery;o&&n.updateQuery(function(s,u){var c=u.variables;return o(s,{subscriptionData:a,variables:c})})},error:function(a){if(r.onError){r.onError(a);return}__DEV__&&I.error("Unhandled GraphQL subscription error",a)}});return this.subscriptions.add(i),function(){n.subscriptions.delete(i)&&i.unsubscribe()}},e.prototype.setOptions=function(r){return this.reobserve(r)},e.prototype.setVariables=function(r){return be(this.variables,r)?this.observers.size?this.result():Promise.resolve():(this.options.variables=r,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:r},ie.setVariables):Promise.resolve())},e.prototype.updateQuery=function(r){var n=this.queryManager,i=n.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,a=r(i,{variables:this.variables});a&&(n.cache.writeQuery({query:this.options.query,data:a,variables:this.variables}),n.broadcastQueries())},e.prototype.startPolling=function(r){this.options.pollInterval=r,this.updatePolling()},e.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},e.prototype.applyNextFetchPolicy=function(r,n){if(n.nextFetchPolicy){var i=n.fetchPolicy,a=i===void 0?"cache-first":i,o=n.initialFetchPolicy,s=o===void 0?a:o;a==="standby"||(typeof n.nextFetchPolicy=="function"?n.fetchPolicy=n.nextFetchPolicy(a,{reason:r,options:n,observable:this,initialFetchPolicy:s}):r==="variables-changed"?n.fetchPolicy=s:n.fetchPolicy=n.nextFetchPolicy)}return n.fetchPolicy},e.prototype.fetch=function(r,n){return this.queryManager.setObservableQuery(this),this.queryManager.fetchQueryObservable(this.queryId,r,n)},e.prototype.updatePolling=function(){var r=this;if(!this.queryManager.ssrMode){var n=this,i=n.pollingInfo,a=n.options.pollInterval;if(!a){i&&(clearTimeout(i.timeout),delete this.pollingInfo);return}if(!(i&&i.interval===a)){__DEV__?I(a,"Attempted to start a polling query without a polling interval."):I(a,13);var o=i||(this.pollingInfo={});o.interval=a;var s=function(){r.pollingInfo&&(Er(r.queryInfo.networkStatus)?u():r.reobserve({fetchPolicy:r.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},ie.poll).then(u,u))},u=function(){var c=r.pollingInfo;c&&(clearTimeout(c.timeout),c.timeout=setTimeout(s,c.interval))};u()}}},e.prototype.updateLastResult=function(r,n){return n===void 0&&(n=this.variables),this.last=_(_({},this.last),{result:this.queryManager.assumeImmutableResults?r:io(r),variables:n}),Re(r.errors)||delete this.last.error,this.last},e.prototype.reobserve=function(r,n){var i=this;this.isTornDown=!1;var a=n===ie.refetch||n===ie.fetchMore||n===ie.poll,o=this.options.variables,s=this.options.fetchPolicy,u=_r(this.options,r||{}),c=a?u:cg(this.options,u);a||(this.updatePolling(),r&&r.variables&&!be(r.variables,o)&&c.fetchPolicy!=="standby"&&c.fetchPolicy===s&&(this.applyNextFetchPolicy("variables-changed",c),n===void 0&&(n=ie.setVariables)));var l=c.variables&&_({},c.variables),d=this.fetch(c,n),p={next:function(f){i.reportResult(f,l)},error:function(f){i.reportError(f,l)}};return a||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=d,this.observer=p),d.addObserver(p),d.promise},e.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},e.prototype.reportResult=function(r,n){var i=this.getLastError();(i||this.isDifferentFromLastResult(r,n))&&((i||!r.partial||this.options.returnPartialData)&&this.updateLastResult(r,n),nn(this.observers,"next",r))},e.prototype.reportError=function(r,n){var i=_(_({},this.getLastResult()),{error:r,errors:r.graphQLErrors,networkStatus:ie.error,loading:!1});this.updateLastResult(i,n),nn(this.observers,"error",this.last.error=r)},e.prototype.hasObservers=function(){return this.observers.size>0},e.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(r){return r.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},e}(W);oo(To);function ou(t){var e=t.options,r=e.fetchPolicy,n=e.nextFetchPolicy;return r==="cache-and-network"||r==="network-only"?t.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(){return this.nextFetchPolicy=n,typeof n=="function"?n.apply(this,arguments):r}}):t.reobserve()}function lg(t){__DEV__&&I.error("Unhandled error",t.message,t.stack)}function su(t){__DEV__&&t&&__DEV__&&I.debug("Missing cache result fields: ".concat(JSON.stringify(t)),t)}var Ao=function(){function t(e){var r=e.cache,n=e.client,i=e.resolvers,a=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=r,n&&(this.client=n),i&&this.addResolvers(i),a&&this.setFragmentMatcher(a)}return t.prototype.addResolvers=function(e){var r=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(n){r.resolvers=_c(r.resolvers,n)}):this.resolvers=_c(this.resolvers,e)},t.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},t.prototype.getResolvers=function(){return this.resolvers||{}},t.prototype.runResolvers=function(e){var r=e.document,n=e.remoteResult,i=e.context,a=e.variables,o=e.onlyRunForcedResolvers,s=o===void 0?!1:o;return Tt(this,void 0,void 0,function(){return At(this,function(u){return r?[2,this.resolveDocument(r,n.data,i,a,this.fragmentMatcher,s).then(function(c){return _(_({},n),{data:c.result})})]:[2,n]})})},t.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},t.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},t.prototype.clientQuery=function(e){return qn(["client"],e)&&this.resolvers?e:null},t.prototype.serverQuery=function(e){return bc(e)},t.prototype.prepareContext=function(e){var r=this.cache;return _(_({},e),{cache:r,getCacheKey:function(n){return r.identify(n)}})},t.prototype.addExportedVariables=function(e,r,n){return r===void 0&&(r={}),n===void 0&&(n={}),Tt(this,void 0,void 0,function(){return At(this,function(i){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,r)||{},this.prepareContext(n),r).then(function(a){return _(_({},r),a.exportedVariables)})]:[2,_({},r)]})})},t.prototype.shouldForceResolvers=function(e){var r=!1;return Ke(e,{Directive:{enter:function(n){if(n.name.value==="client"&&n.arguments&&(r=n.arguments.some(function(i){return i.name.value==="always"&&i.value.kind==="BooleanValue"&&i.value.value===!0}),r))return Zr}}}),r},t.prototype.buildRootValueFromCache=function(e,r){return this.cache.diff({query:vc(e),variables:r,returnPartialData:!0,optimistic:!1}).result},t.prototype.resolveDocument=function(e,r,n,i,a,o){return n===void 0&&(n={}),i===void 0&&(i={}),a===void 0&&(a=function(){return!0}),o===void 0&&(o=!1),Tt(this,void 0,void 0,function(){var s,u,c,l,d,p,f,h,g,y,S;return At(this,function(b){return s=en(e),u=Xr(e),c=Yr(u),l=this.collectSelectionsToResolve(s,c),d=s.operation,p=d?d.charAt(0).toUpperCase()+d.slice(1):"Query",f=this,h=f.cache,g=f.client,y={fragmentMap:c,context:_(_({},n),{cache:h,client:g}),variables:i,fragmentMatcher:a,defaultOperationType:p,exportedVariables:{},selectionsToResolve:l,onlyRunForcedResolvers:o},S=!1,[2,this.resolveSelectionSet(s.selectionSet,S,r,y).then(function(v){return{result:v,exportedVariables:y.exportedVariables}})]})})},t.prototype.resolveSelectionSet=function(e,r,n,i){return Tt(this,void 0,void 0,function(){var a,o,s,u,c,l=this;return At(this,function(d){return a=i.fragmentMap,o=i.context,s=i.variables,u=[n],c=function(p){return Tt(l,void 0,void 0,function(){var f,h;return At(this,function(g){return!r&&!i.selectionsToResolve.has(p)?[2]:er(p,s)?pt(p)?[2,this.resolveField(p,r,n,i).then(function(y){var S;typeof y<"u"&&u.push((S={},S[_t(p)]=y,S))})]:(hc(p)?f=p:(f=a[p.name.value],__DEV__?I(f,"No fragment named ".concat(p.name.value)):I(f,11)),f&&f.typeCondition&&(h=f.typeCondition.name.value,i.fragmentMatcher(n,h,o))?[2,this.resolveSelectionSet(f.selectionSet,r,n,i).then(function(y){u.push(y)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(c)).then(function(){return Mi(u)})]})})},t.prototype.resolveField=function(e,r,n,i){return Tt(this,void 0,void 0,function(){var a,o,s,u,c,l,d,p,f,h=this;return At(this,function(g){return n?(a=i.variables,o=e.name.value,s=_t(e),u=o!==s,c=n[s]||n[o],l=Promise.resolve(c),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(d=n.__typename||i.defaultOperationType,p=this.resolvers&&this.resolvers[d],p&&(f=p[u?o:s],f&&(l=Promise.resolve(Jn.withValue(this.cache,f,[n,tr(e,a),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,l.then(function(y){var S,b;if(y===void 0&&(y=c),e.directives&&e.directives.forEach(function(m){m.name.value==="export"&&m.arguments&&m.arguments.forEach(function(A){A.name.value==="as"&&A.value.kind==="StringValue"&&(i.exportedVariables[A.value.value]=y)})}),!e.selectionSet||y==null)return y;var v=(b=(S=e.directives)===null||S===void 0?void 0:S.some(function(m){return m.name.value==="client"}))!==null&&b!==void 0?b:!1;if(Array.isArray(y))return h.resolveSubSelectedArray(e,r||v,y,i);if(e.selectionSet)return h.resolveSelectionSet(e.selectionSet,r||v,y,i)})]):[2,null]})})},t.prototype.resolveSubSelectedArray=function(e,r,n,i){var a=this;return Promise.all(n.map(function(o){if(o===null)return null;if(Array.isArray(o))return a.resolveSubSelectedArray(e,r,o,i);if(e.selectionSet)return a.resolveSelectionSet(e.selectionSet,r,o,i)}))},t.prototype.collectSelectionsToResolve=function(e,r){var n=function(o){return!Array.isArray(o)},i=this.selectionsToResolveCache;function a(o){if(!i.has(o)){var s=new Set;i.set(o,s),Ke(o,{Directive:function(u,c,l,d,p){u.name.value==="client"&&p.forEach(function(f){n(f)&&Ri(f)&&s.add(f)})},FragmentSpread:function(u,c,l,d,p){var f=r[u.name.value];__DEV__?I(f,"No fragment named ".concat(u.name.value)):I(f,12);var h=a(f);h.size>0&&(p.forEach(function(g){n(g)&&Ri(g)&&s.add(g)}),s.add(u),h.forEach(function(g){s.add(g)}))}})}return i.get(o)}return a(e)},t}();var ei=new(wt?WeakMap:Map);function cu(t,e){var r=t[e];typeof r=="function"&&(t[e]=function(){return ei.set(t,(ei.get(t)+1)%1e15),r.apply(this,arguments)})}function Vp(t){t.notifyTimeout&&(clearTimeout(t.notifyTimeout),t.notifyTimeout=void 0)}var Io=function(){function t(e,r){r===void 0&&(r=e.generateQueryId()),this.queryId=r,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=e.cache;ei.has(n)||(ei.set(n,0),cu(n,"evict"),cu(n,"modify"),cu(n,"reset"))}return t.prototype.init=function(e){var r=e.networkStatus||ie.loading;return this.variables&&this.networkStatus!==ie.loading&&!be(this.variables,e.variables)&&(r=ie.setVariables),be(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:r}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},t.prototype.reset=function(){Vp(this),this.dirty=!1},t.prototype.getDiff=function(e){e===void 0&&(e=this.variables);var r=this.getDiffOptions(e);if(this.lastDiff&&be(r,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=e);var n=this.observableQuery;if(n&&n.options.fetchPolicy==="no-cache")return{complete:!1};var i=this.cache.diff(r);return this.updateLastDiff(i,r),i},t.prototype.updateLastDiff=function(e,r){this.lastDiff=e?{diff:e,options:r||this.getDiffOptions()}:void 0},t.prototype.getDiffOptions=function(e){var r;return e===void 0&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:(r=this.observableQuery)===null||r===void 0?void 0:r.options.canonizeResults}},t.prototype.setDiff=function(e){var r=this,n=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),!this.dirty&&!be(n&&n.result,e&&e.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return r.notify()},0)))},t.prototype.setObservableQuery=function(e){var r=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){var n=r.getDiff();n.fromOptimisticTransaction?e.observe():ou(e)})):delete this.oqListener)},t.prototype.notify=function(){var e=this;Vp(this),this.shouldNotify()&&this.listeners.forEach(function(r){return r(e)}),this.dirty=!1},t.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(Er(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if(e!=="cache-only"&&e!=="cache-and-network")return!1}return!0},t.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=t.prototype.cancel,this.subscriptions.forEach(function(r){return r.unsubscribe()});var e=this.observableQuery;e&&e.stopPolling()}},t.prototype.cancel=function(){},t.prototype.updateWatch=function(e){var r=this;e===void 0&&(e=this.variables);var n=this.observableQuery;if(!(n&&n.options.fetchPolicy==="no-cache")){var i=_(_({},this.getDiffOptions(e)),{watcher:this,callback:function(a){return r.setDiff(a)}});(!this.lastWatch||!be(i,this.lastWatch))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=i))}},t.prototype.resetLastWrite=function(){this.lastWrite=void 0},t.prototype.shouldWrite=function(e,r){var n=this.lastWrite;return!(n&&n.dmCount===ei.get(this.cache)&&be(r,n.variables)&&be(e.data,n.result.data))},t.prototype.markResult=function(e,r,n,i){var a=this,o=new it,s=Re(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Re(e.incremental)){var u=so(this.getDiff().result,e);e.data=u}else if("hasNext"in e&&e.hasNext){var c=this.getDiff();e.data=o.merge(c.result,e.data)}this.graphQLErrors=s,n.fetchPolicy==="no-cache"?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):i!==0&&(Oo(e,n.errorPolicy)?this.cache.performTransaction(function(l){if(a.shouldWrite(e,n.variables))l.writeQuery({query:r,data:e.data,variables:n.variables,overwrite:i===1}),a.lastWrite={result:e,variables:n.variables,dmCount:ei.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){e.data=a.lastDiff.diff.result;return}var d=a.getDiffOptions(n.variables),p=l.diff(d);a.stopped||a.updateWatch(n.variables),a.updateLastDiff(p,d),p.complete&&(e.data=p.result)}):this.lastWrite=void 0)},t.prototype.markReady=function(){return this.networkError=null,this.networkStatus=ie.ready},t.prototype.markError=function(e){return this.networkStatus=ie.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},t}();function Oo(t,e){e===void 0&&(e="none");var r=e==="ignore"||e==="all",n=!Hn(t);return!n&&r&&t.data&&(n=!0),n}var fg=Object.prototype.hasOwnProperty,zp=function(){function t(e){var r=e.cache,n=e.link,i=e.defaultOptions,a=e.queryDeduplication,o=a===void 0?!1:a,s=e.onBroadcast,u=e.ssrMode,c=u===void 0?!1:u,l=e.clientAwareness,d=l===void 0?{}:l,p=e.localState,f=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(wt?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=r,this.link=n,this.defaultOptions=i||Object.create(null),this.queryDeduplication=o,this.clientAwareness=d,this.localState=p||new Ao({cache:r}),this.ssrMode=c,this.assumeImmutableResults=!!f,(this.onBroadcast=s)&&(this.mutationStore=Object.create(null))}return t.prototype.stop=function(){var e=this;this.queries.forEach(function(r,n){e.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(__DEV__?new V("QueryManager stopped while query was in flight"):new V(14))},t.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(r){return r(e)}),this.fetchCancelFns.clear()},t.prototype.mutate=function(e){var r,n,i=e.mutation,a=e.variables,o=e.optimisticResponse,s=e.updateQueries,u=e.refetchQueries,c=u===void 0?[]:u,l=e.awaitRefetchQueries,d=l===void 0?!1:l,p=e.update,f=e.onQueryUpdated,h=e.fetchPolicy,g=h===void 0?((r=this.defaultOptions.mutate)===null||r===void 0?void 0:r.fetchPolicy)||"network-only":h,y=e.errorPolicy,S=y===void 0?((n=this.defaultOptions.mutate)===null||n===void 0?void 0:n.errorPolicy)||"none":y,b=e.keepRootFields,v=e.context;return Tt(this,void 0,void 0,function(){var m,A,D,E,O,P;return At(this,function(N){switch(N.label){case 0:return __DEV__?I(i,"mutation option is required. You must specify your GraphQL document in the mutation option."):I(i,15),__DEV__?I(g==="network-only"||g==="no-cache","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."):I(g==="network-only"||g==="no-cache",16),m=this.generateMutationId(),A=this.transform(i),D=A.document,E=A.hasClientExports,i=this.cache.transformForLink(D),a=this.getVariables(i,a),E?[4,this.localState.addExportedVariables(i,a,v)]:[3,2];case 1:a=N.sent(),N.label=2;case 2:return O=this.mutationStore&&(this.mutationStore[m]={mutation:i,variables:a,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:m,document:i,variables:a,fetchPolicy:g,errorPolicy:S,context:v,updateQueries:s,update:p,keepRootFields:b}),this.broadcastQueries(),P=this,[2,new Promise(function(j,qe){return ao(P.getObservableFromLink(i,_(_({},v),{optimisticResponse:o}),a,!1),function(Ne){if(Hn(Ne)&&S==="none")throw new rr({graphQLErrors:co(Ne)});O&&(O.loading=!1,O.error=null);var q=_({},Ne);return typeof c=="function"&&(c=c(q)),S==="ignore"&&Hn(q)&&delete q.errors,P.markMutationResult({mutationId:m,result:q,document:i,variables:a,fetchPolicy:g,errorPolicy:S,context:v,update:p,updateQueries:s,awaitRefetchQueries:d,refetchQueries:c,removeOptimistic:o?m:void 0,onQueryUpdated:f,keepRootFields:b})}).subscribe({next:function(Ne){P.broadcastQueries(),(!("hasNext"in Ne)||Ne.hasNext===!1)&&j(Ne)},error:function(Ne){O&&(O.loading=!1,O.error=Ne),o&&P.cache.removeOptimistic(m),P.broadcastQueries(),qe(Ne instanceof rr?Ne:new rr({networkError:Ne}))}})})]}})})},t.prototype.markMutationResult=function(e,r){var n=this;r===void 0&&(r=this.cache);var i=e.result,a=[],o=e.fetchPolicy==="no-cache";if(!o&&Oo(i,e.errorPolicy)){if(br(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),br(i)&&Re(i.incremental)){var s=r.diff({id:"ROOT_MUTATION",query:this.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),u=void 0;s.result&&(u=so(s.result,i)),typeof u<"u"&&(i.data=u,a.push({result:u,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var c=e.updateQueries;c&&this.queries.forEach(function(d,p){var f=d.observableQuery,h=f&&f.queryName;if(!(!h||!fg.call(c,h))){var g=c[h],y=n.queries.get(p),S=y.document,b=y.variables,v=r.diff({query:S,variables:b,returnPartialData:!0,optimistic:!1}),m=v.result,A=v.complete;if(A&&m){var D=g(m,{mutationResult:i,queryName:S&&Vn(S)||void 0,queryVariables:b});D&&a.push({result:D,dataId:"ROOT_QUERY",query:S,variables:b})}}})}if(a.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(d){o||a.forEach(function(g){return d.write(g)});var p=e.update,f=!Tf(i)||br(i)&&!i.hasNext;if(p){if(!o){var h=d.diff({id:"ROOT_MUTATION",query:n.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});h.complete&&(i=_(_({},i),{data:h.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}f&&p(d,i,{context:e.context,variables:e.variables})}!o&&!e.keepRootFields&&f&&d.modify({id:"ROOT_MUTATION",fields:function(g,y){var S=y.fieldName,b=y.DELETE;return S==="__typename"?g:b}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(d){return l.push(d)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(l).then(function(){return i})}return Promise.resolve(i)},t.prototype.markMutationOptimistic=function(e,r){var n=this,i=typeof e=="function"?e(r.variables):e;return this.cache.recordOptimisticTransaction(function(a){try{n.markMutationResult(_(_({},r),{result:{data:i}}),a)}catch(o){__DEV__&&I.error(o)}},r.mutationId)},t.prototype.fetchQuery=function(e,r,n){return this.fetchQueryObservable(e,r,n).promise},t.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(r,n){e[n]={variables:r.variables,networkStatus:r.networkStatus,networkError:r.networkError,graphQLErrors:r.graphQLErrors}}),e},t.prototype.resetErrors=function(e){var r=this.queries.get(e);r&&(r.networkError=void 0,r.graphQLErrors=[])},t.prototype.transform=function(e){var r=this.transformCache;if(!r.has(e)){var n=this.cache.transformDocument(e),i=yc(n),a=this.localState.clientQuery(n),o=i&&this.localState.serverQuery(i),s={document:n,hasClientExports:lc(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:a,serverQuery:o,defaultVars:tn(qt(n)),asQuery:_(_({},n),{definitions:n.definitions.map(function(c){return c.kind==="OperationDefinition"&&c.operation!=="query"?_(_({},c),{operation:"query"}):c})})},u=function(c){c&&!r.has(c)&&r.set(c,s)};u(e),u(n),u(a),u(o)}return r.get(e)},t.prototype.getVariables=function(e,r){return _(_({},this.transform(e).defaultVars),r)},t.prototype.watchQuery=function(e){e=_(_({},e),{variables:this.getVariables(e.query,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var r=new Io(this),n=new To({queryManager:this,queryInfo:r,options:e});return this.queries.set(n.queryId,r),r.init({document:n.query,observableQuery:n,variables:n.variables}),n},t.prototype.query=function(e,r){var n=this;return r===void 0&&(r=this.generateQueryId()),__DEV__?I(e.query,"query option is required. You must specify your GraphQL document in the query option."):I(e.query,17),__DEV__?I(e.query.kind==="Document",'You must wrap the query string in a "gql" tag.'):I(e.query.kind==="Document",18),__DEV__?I(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):I(!e.returnPartialData,19),__DEV__?I(!e.pollInterval,"pollInterval option only supported on watchQuery."):I(!e.pollInterval,20),this.fetchQuery(r,e).finally(function(){return n.stopQuery(r)})},t.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},t.prototype.generateRequestId=function(){return this.requestIdCounter++},t.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},t.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryInStoreNoBroadcast=function(e){var r=this.queries.get(e);r&&r.stop()},t.prototype.clearStore=function(e){return e===void 0&&(e={discardWatches:!0}),this.cancelPendingFetches(__DEV__?new V("Store reset while query was in flight (not completed in link chain)"):new V(21)),this.queries.forEach(function(r){r.observableQuery?r.networkStatus=ie.loading:r.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},t.prototype.getObservableQueries=function(e){var r=this;e===void 0&&(e="active");var n=new Map,i=new Map,a=new Set;return Array.isArray(e)&&e.forEach(function(o){typeof o=="string"?i.set(o,!1):pc(o)?i.set(r.transform(o).document,!1):ee(o)&&o.query&&a.add(o)}),this.queries.forEach(function(o,s){var u=o.observableQuery,c=o.document;if(u){if(e==="all"){n.set(s,u);return}var l=u.queryName,d=u.options.fetchPolicy;if(d==="standby"||e==="active"&&!u.hasObservers())return;(e==="active"||l&&i.has(l)||c&&i.has(c))&&(n.set(s,u),l&&i.set(l,!0),c&&i.set(c,!0))}}),a.size&&a.forEach(function(o){var s=qi("legacyOneTimeQuery"),u=r.getQuery(s).init({document:o.query,variables:o.variables}),c=new To({queryManager:r,queryInfo:u,options:_(_({},o),{fetchPolicy:"network-only"})});I(c.queryId===s),u.setObservableQuery(c),n.set(s,c)}),__DEV__&&i.size&&i.forEach(function(o,s){o||__DEV__&&I.warn("Unknown query ".concat(typeof s=="string"?"named ":"").concat(JSON.stringify(s,null,2)," requested in refetchQueries options.include array"))}),n},t.prototype.reFetchObservableQueries=function(e){var r=this;e===void 0&&(e=!1);var n=[];return this.getObservableQueries(e?"all":"active").forEach(function(i,a){var o=i.options.fetchPolicy;i.resetLastResults(),(e||o!=="standby"&&o!=="cache-only")&&n.push(i.refetch()),r.getQuery(a).setDiff(null)}),this.broadcastQueries(),Promise.all(n)},t.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},t.prototype.startGraphQLSubscription=function(e){var r=this,n=e.query,i=e.fetchPolicy,a=e.errorPolicy,o=e.variables,s=e.context,u=s===void 0?{}:s;n=this.transform(n).document,o=this.getVariables(n,o);var c=function(d){return r.getObservableFromLink(n,u,d).map(function(p){if(i!=="no-cache"&&(Oo(p,a)&&r.cache.write({query:n,result:p.data,dataId:"ROOT_SUBSCRIPTION",variables:d}),r.broadcastQueries()),Hn(p))throw new rr({graphQLErrors:p.errors});return p})};if(this.transform(n).hasClientExports){var l=this.localState.addExportedVariables(n,o,u).then(c);return new W(function(d){var p=null;return l.then(function(f){return p=f.subscribe(d)},d.error),function(){return p&&p.unsubscribe()}})}return c(o)},t.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},t.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},t.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){return e.notify()})},t.prototype.getLocalState=function(){return this.localState},t.prototype.getObservableFromLink=function(e,r,n,i){var a=this,o;i===void 0&&(i=(o=r?.queryDeduplication)!==null&&o!==void 0?o:this.queryDeduplication);var s,u=this.transform(e).serverQuery;if(u){var c=this,l=c.inFlightLinkObservables,d=c.link,p={query:u,variables:n,operationName:Vn(u)||void 0,context:this.prepareContext(_(_({},r),{forceFetch:!i}))};if(r=p.context,i){var f=l.get(u)||new Map;l.set(u,f);var h=dt(n);if(s=f.get(h),!s){var g=new Gn([Wn(d,p)]);f.set(h,s=g),g.beforeNext(function(){f.delete(h)&&f.size<1&&l.delete(u)})}}else s=new Gn([Wn(d,p)])}else s=new Gn([W.of({data:{}})]),r=this.prepareContext(r);var y=this.transform(e).clientQuery;return y&&(s=ao(s,function(S){return a.localState.runResolvers({document:y,remoteResult:S,context:r,variables:n})})),s},t.prototype.getResultsFromLink=function(e,r,n){var i=e.lastRequestId=this.generateRequestId(),a=this.cache.transformForLink(this.transform(e.document).document);return ao(this.getObservableFromLink(a,n.context,n.variables),function(o){var s=co(o),u=s.length>0;if(i>=e.lastRequestId){if(u&&n.errorPolicy==="none")throw e.markError(new rr({graphQLErrors:s}));e.markResult(o,a,n,r),e.markReady()}var c={data:o.data,loading:!1,networkStatus:ie.ready};return u&&n.errorPolicy!=="ignore"&&(c.errors=s,c.networkStatus=ie.error),c},function(o){var s=Bp(o)?o:new rr({networkError:o});throw i>=e.lastRequestId&&e.markError(s),s})},t.prototype.fetchQueryObservable=function(e,r,n){var i=this;n===void 0&&(n=ie.loading);var a=this.transform(r.query).document,o=this.getVariables(a,r.variables),s=this.getQuery(e),u=this.defaultOptions.watchQuery,c=r.fetchPolicy,l=c===void 0?u&&u.fetchPolicy||"cache-first":c,d=r.errorPolicy,p=d===void 0?u&&u.errorPolicy||"none":d,f=r.returnPartialData,h=f===void 0?!1:f,g=r.notifyOnNetworkStatusChange,y=g===void 0?!1:g,S=r.context,b=S===void 0?{}:S,v=Object.assign({},r,{query:a,variables:o,fetchPolicy:l,errorPolicy:p,returnPartialData:h,notifyOnNetworkStatusChange:y,context:b}),m=function(E){v.variables=E;var O=i.fetchQueryByPolicy(s,v,n);return v.fetchPolicy!=="standby"&&O.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",r),O},A=function(){return i.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,function(E){A(),setTimeout(function(){return D.cancel(E)})});var D=new Gn(this.transform(v.query).hasClientExports?this.localState.addExportedVariables(v.query,v.variables,v.context).then(m):m(v.variables));return D.promise.then(A,A),D},t.prototype.refetchQueries=function(e){var r=this,n=e.updateCache,i=e.include,a=e.optimistic,o=a===void 0?!1:a,s=e.removeOptimistic,u=s===void 0?o?qi("refetchQueries"):void 0:s,c=e.onQueryUpdated,l=new Map;i&&this.getObservableQueries(i).forEach(function(p,f){l.set(f,{oq:p,lastDiff:r.getQuery(f).getDiff()})});var d=new Map;return n&&this.cache.batch({update:n,optimistic:o&&u||!1,removeOptimistic:u,onWatchUpdated:function(p,f,h){var g=p.watcher instanceof Io&&p.watcher.observableQuery;if(g){if(c){l.delete(g.queryId);var y=c(g,f,h);return y===!0&&(y=g.refetch()),y!==!1&&d.set(g,y),y}c!==null&&l.set(g.queryId,{oq:g,lastDiff:h,diff:f})}}}),l.size&&l.forEach(function(p,f){var h=p.oq,g=p.lastDiff,y=p.diff,S;if(c){if(!y){var b=h.queryInfo;b.reset(),y=b.getDiff()}S=c(h,y,g)}(!c||S===!0)&&(S=h.refetch()),S!==!1&&d.set(h,S),f.indexOf("legacyOneTimeQuery")>=0&&r.stopQueryNoBroadcast(f)}),u&&this.cache.removeOptimistic(u),d},t.prototype.fetchQueryByPolicy=function(e,r,n){var i=this,a=r.query,o=r.variables,s=r.fetchPolicy,u=r.refetchWritePolicy,c=r.errorPolicy,l=r.returnPartialData,d=r.context,p=r.notifyOnNetworkStatusChange,f=e.networkStatus;e.init({document:this.transform(a).document,variables:o,networkStatus:n});var h=function(){return e.getDiff(o)},g=function(m,A){A===void 0&&(A=e.networkStatus||ie.loading);var D=m.result;__DEV__&&!l&&!be(D,{})&&su(m.missing);var E=function(O){return W.of(_({data:O,loading:Er(A),networkStatus:A},m.complete?null:{partial:!0}))};return D&&i.transform(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:D},context:d,variables:o,onlyRunForcedResolvers:!0}).then(function(O){return E(O.data||void 0)}):c==="none"&&A===ie.refetch&&Array.isArray(m.missing)?E(void 0):E(D)},y=s==="no-cache"?0:n===ie.refetch&&u!=="merge"?1:2,S=function(){return i.getResultsFromLink(e,y,{variables:o,context:d,fetchPolicy:s,errorPolicy:c})},b=p&&typeof f=="number"&&f!==n&&Er(n);switch(s){default:case"cache-first":{var v=h();return v.complete?[g(v,e.markReady())]:l||b?[g(v),S()]:[S()]}case"cache-and-network":{var v=h();return v.complete||l||b?[g(v),S()]:[S()]}case"cache-only":return[g(h(),e.markReady())];case"network-only":return b?[g(h()),S()]:[S()];case"no-cache":return b?[g(e.getDiff()),S()]:[S()];case"standby":return[]}},t.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new Io(this,e)),this.queries.get(e)},t.prototype.prepareContext=function(e){e===void 0&&(e={});var r=this.localState.prepareContext(e);return _(_({},r),{clientAwareness:this.clientAwareness})},t}();var Qp=!1;var uu=function(){function t(e){var r=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=e.uri,i=e.credentials,a=e.headers,o=e.cache,s=e.ssrMode,u=s===void 0?!1:s,c=e.ssrForceFetchDelay,l=c===void 0?0:c,d=e.connectToDevTools,p=d===void 0?typeof window=="object"&&!window.__APOLLO_CLIENT__&&__DEV__:d,f=e.queryDeduplication,h=f===void 0?!0:f,g=e.defaultOptions,y=e.assumeImmutableResults,S=y===void 0?!1:y,b=e.resolvers,v=e.typeDefs,m=e.fragmentMatcher,A=e.name,D=e.version,E=e.link;if(E||(E=n?new Fc({uri:n,credentials:i,headers:a}):St.empty()),!o)throw __DEV__?new V(`To initialize Apollo Client, you must specify a 'cache' property in the options object.
|
|
53
|
-
For more information, please visit: https://go.apollo.dev/c/docs`):new V(9);if(this.link=E,this.cache=o,this.disableNetworkFetches=u||l>0,this.queryDeduplication=h,this.defaultOptions=g||Object.create(null),this.typeDefs=v,l&&setTimeout(function(){return r.disableNetworkFetches=!1},l),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),p&&typeof window=="object"&&(window.__APOLLO_CLIENT__=this),!Qp&&p&&__DEV__&&(Qp=!0,typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var O=window.navigator,P=O&&O.userAgent,N=void 0;typeof P=="string"&&(P.indexOf("Chrome/")>-1?N="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":P.indexOf("Firefox/")>-1&&(N="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),N&&__DEV__&&I.log("Download the Apollo DevTools for a better development experience: "+N)}this.version=Df,this.localState=new Ao({cache:o,client:this,resolvers:b,fragmentMatcher:m}),this.queryManager=new zp({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:h,ssrMode:u,clientAwareness:{name:A,version:D},localState:this.localState,assumeImmutableResults:S,onBroadcast:p?function(){r.devToolsHookCb&&r.devToolsHookCb({action:{},state:{queries:r.queryManager.getQueryStore(),mutations:r.queryManager.mutationStore||{}},dataWithOptimisticResults:r.cache.extract(!0)})}:void 0})}return t.prototype.stop=function(){this.queryManager.stop()},t.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=Bi(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=_(_({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},t.prototype.query=function(e){return this.defaultOptions.query&&(e=Bi(this.defaultOptions.query,e)),__DEV__?I(e.fetchPolicy!=="cache-and-network","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."):I(e.fetchPolicy!=="cache-and-network",10),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=_(_({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},t.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Bi(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},t.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},t.prototype.readQuery=function(e,r){return r===void 0&&(r=!1),this.cache.readQuery(e,r)},t.prototype.readFragment=function(e,r){return r===void 0&&(r=!1),this.cache.readFragment(e,r)},t.prototype.writeQuery=function(e){var r=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),r},t.prototype.writeFragment=function(e){var r=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),r},t.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},t.prototype.__requestRaw=function(e){return Wn(this.link,e)},t.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(r){return r()}))}).then(function(){return e.reFetchObservableQueries()})},t.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(r){return r()}))})},t.prototype.onResetStore=function(e){var r=this;return this.resetStoreCallbacks.push(e),function(){r.resetStoreCallbacks=r.resetStoreCallbacks.filter(function(n){return n!==e})}},t.prototype.onClearStore=function(e){var r=this;return this.clearStoreCallbacks.push(e),function(){r.clearStoreCallbacks=r.clearStoreCallbacks.filter(function(n){return n!==e})}},t.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},t.prototype.refetchQueries=function(e){var r=this.queryManager.refetchQueries(e),n=[],i=[];r.forEach(function(o,s){n.push(s),i.push(o)});var a=Promise.all(i);return a.queries=n,a.results=i,a.catch(function(o){__DEV__&&I.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(o))}),a},t.prototype.getObservableQueries=function(e){return e===void 0&&(e="active"),this.queryManager.getObservableQueries(e)},t.prototype.extract=function(e){return this.cache.extract(e)},t.prototype.restore=function(e){return this.cache.restore(e)},t.prototype.addResolvers=function(e){this.localState.addResolvers(e)},t.prototype.setResolvers=function(e){this.localState.setResolvers(e)},t.prototype.getResolvers=function(){return this.localState.getResolvers()},t.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},t.prototype.setLink=function(e){this.link=this.queryManager.link=e},t}();rf(Kr?"log":"silent");function Ye(t){return t===null?"null":Array.isArray(t)?"array":typeof t}function nr(t){return Ye(t)==="object"}function Gp(t){return Array.isArray(t)&&t.length>0&&t.every(e=>"message"in e)}function lu(t,e){return t.length<124?t:e}var Hp="graphql-transport-ws";var at;(function(t){t[t.InternalServerError=4500]="InternalServerError",t[t.InternalClientError=4005]="InternalClientError",t[t.BadRequest=4400]="BadRequest",t[t.BadResponse=4004]="BadResponse",t[t.Unauthorized=4401]="Unauthorized",t[t.Forbidden=4403]="Forbidden",t[t.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",t[t.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",t[t.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",t[t.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",t[t.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(at||(at={}));var Te;(function(t){t.ConnectionInit="connection_init",t.ConnectionAck="connection_ack",t.Ping="ping",t.Pong="pong",t.Subscribe="subscribe",t.Next="next",t.Error="error",t.Complete="complete"})(Te||(Te={}));function Wp(t){if(!nr(t))throw new Error(`Message is expected to be an object, but got ${Ye(t)}`);if(!t.type)throw new Error("Message is missing the 'type' property");if(typeof t.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${Ye(t.type)}`);switch(t.type){case Te.ConnectionInit:case Te.ConnectionAck:case Te.Ping:case Te.Pong:{if(t.payload!=null&&!nr(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${t.payload}"`);break}case Te.Subscribe:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Ye(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!nr(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${Ye(t.payload)}`);if(typeof t.payload.query!="string")throw new Error(`"${t.type}" message payload expects the 'query' property to be a string, but got ${Ye(t.payload.query)}`);if(t.payload.variables!=null&&!nr(t.payload.variables))throw new Error(`"${t.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${Ye(t.payload.variables)}`);if(t.payload.operationName!=null&&Ye(t.payload.operationName)!=="string")throw new Error(`"${t.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${Ye(t.payload.operationName)}`);if(t.payload.extensions!=null&&!nr(t.payload.extensions))throw new Error(`"${t.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${Ye(t.payload.extensions)}`);break}case Te.Next:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Ye(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!nr(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${Ye(t.payload)}`);break}case Te.Error:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Ye(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!Gp(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(t.payload)}`);break}case Te.Complete:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Ye(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${t.type}"`)}return t}function Kp(t,e){return Wp(typeof t=="string"?JSON.parse(t,e):t)}function ti(t,e){return Wp(t),JSON.stringify(t,e)}function Zp(t){let{url:e,connectionParams:r,lazy:n=!0,onNonLazyError:i=console.error,lazyCloseTimeout:a=0,keepAlive:o=0,disablePong:s,connectionAckWaitTimeout:u=0,retryAttempts:c=5,retryWait:l=async function(de){let he=1e3;for(let J=0;J<de;J++)he*=2;await new Promise(J=>setTimeout(J,he+Math.floor(Math.random()*(3e3-300)+300)))},shouldRetry:d=Do,isFatalConnectionProblem:p,on:f,webSocketImpl:h,generateID:g=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,de=>{let he=Math.random()*16|0;return(de=="x"?he:he&3|8).toString(16)})},jsonMessageReplacer:y,jsonMessageReviver:S}=t,b;if(h){if(!dg(h))throw new Error("Invalid WebSocket implementation provided");b=h}else typeof WebSocket<"u"?b=WebSocket:typeof global<"u"?b=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(b=window.WebSocket||window.MozWebSocket);if(!b)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let v=b,m=(()=>{let q=(()=>{let he={};return{on(J,X){return he[J]=X,()=>{delete he[J]}},emit(J){var X;"id"in J&&((X=he[J.id])===null||X===void 0||X.call(he,J))}}})(),de={connecting:f?.connecting?[f.connecting]:[],opened:f?.opened?[f.opened]:[],connected:f?.connected?[f.connected]:[],ping:f?.ping?[f.ping]:[],pong:f?.pong?[f.pong]:[],message:f?.message?[q.emit,f.message]:[q.emit],closed:f?.closed?[f.closed]:[],error:f?.error?[f.error]:[]};return{onMessage:q.on,on(he,J){let X=de[he];return X.push(J),()=>{X.splice(X.indexOf(J),1)}},emit(he,...J){for(let X of[...de[he]])X(...J)}}})();function A(q){let de=[m.on("error",he=>{de.forEach(J=>J()),q(he)}),m.on("closed",he=>{de.forEach(J=>J()),q(he)})]}let D,E=0,O,P=!1,N=0,j=!1;async function qe(){clearTimeout(O);let[q,de]=await(D??(D=new Promise((X,Ft)=>(async()=>{if(P){if(await l(N),!E)return D=void 0,Ft({code:1e3,reason:"All Subscriptions Gone"});N++}m.emit("connecting");let H=new v(typeof e=="function"?await e():e,Hp),Mt,fr;function Ba(){isFinite(o)&&o>0&&(clearTimeout(fr),fr=setTimeout(()=>{H.readyState===v.OPEN&&(H.send(ti({type:Te.Ping})),m.emit("ping",!1,void 0))},o))}A(Be=>{D=void 0,clearTimeout(Mt),clearTimeout(fr),Ft(Be),Do(Be)&&Be.code===4499&&(H.close(4499,"Terminated"),H.onerror=null,H.onclose=null)}),H.onerror=Be=>m.emit("error",Be),H.onclose=Be=>m.emit("closed",Be),H.onopen=async()=>{try{m.emit("opened",H);let Be=typeof r=="function"?await r():r;if(H.readyState!==v.OPEN)return;H.send(ti(Be?{type:Te.ConnectionInit,payload:Be}:{type:Te.ConnectionInit},y)),isFinite(u)&&u>0&&(Mt=setTimeout(()=>{H.close(at.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},u)),Ba()}catch(Be){m.emit("error",Be),H.close(at.InternalClientError,lu(Be instanceof Error?Be.message:new Error(Be).message,"Internal client error"))}};let $n=!1;H.onmessage=({data:Be})=>{try{let Ve=Kp(Be,S);if(m.emit("message",Ve),Ve.type==="ping"||Ve.type==="pong"){m.emit(Ve.type,!0,Ve.payload),Ve.type==="pong"?Ba():s||(H.send(ti(Ve.payload?{type:Te.Pong,payload:Ve.payload}:{type:Te.Pong})),m.emit("pong",!1,Ve.payload));return}if($n)return;if(Ve.type!==Te.ConnectionAck)throw new Error(`First message cannot be of type ${Ve.type}`);clearTimeout(Mt),$n=!0,m.emit("connected",H,Ve.payload),P=!1,N=0,X([H,new Promise((F2,c1)=>A(c1))])}catch(Ve){H.onmessage=null,m.emit("error",Ve),H.close(at.BadResponse,lu(Ve instanceof Error?Ve.message:new Error(Ve).message,"Bad response"))}}})())));q.readyState===v.CLOSING&&await de;let he=()=>{},J=new Promise(X=>he=X);return[q,he,Promise.race([J.then(()=>{if(!E){let X=()=>q.close(1e3,"Normal Closure");isFinite(a)&&a>0?O=setTimeout(()=>{q.readyState===v.OPEN&&X()},a):X()}}),de])]}function Ne(q){if(Do(q)&&(pg(q.code)||[at.InternalServerError,at.InternalClientError,at.BadRequest,at.BadResponse,at.Unauthorized,at.SubprotocolNotAcceptable,at.SubscriberAlreadyExists,at.TooManyInitialisationRequests].includes(q.code)))throw q;if(j)return!1;if(Do(q)&&q.code===1e3)return E>0;if(!c||N>=c||!d(q)||p?.(q))throw q;return P=!0}return n||(async()=>{for(E++;;)try{let[,,q]=await qe();await q}catch(q){try{if(!Ne(q))return}catch(de){return i?.(de)}}})(),{on:m.on,subscribe(q,de){let he=g(q),J=!1,X=!1,Ft=()=>{E--,J=!0};return(async()=>{for(E++;;)try{let[H,Mt,fr]=await qe();if(J)return Mt();let Ba=m.onMessage(he,$n=>{switch($n.type){case Te.Next:{de.next($n.payload);return}case Te.Error:{X=!0,J=!0,de.error($n.payload),Ft();return}case Te.Complete:{J=!0,Ft();return}}});H.send(ti({id:he,type:Te.Subscribe,payload:q},y)),Ft=()=>{!J&&H.readyState===v.OPEN&&H.send(ti({id:he,type:Te.Complete},y)),E--,J=!0,Mt()},await fr.finally(Ba);return}catch(H){if(!Ne(H))return}})().then(()=>{X||de.complete()}).catch(H=>{de.error(H)}),()=>{J||Ft()}},async dispose(){if(j=!0,D){let[q]=await D;q.close(1e3,"Normal Closure")}},terminate(){D&&m.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}function Do(t){return nr(t)&&"code"in t&&"reason"in t}function pg(t){return[1e3,1001,1006,1005,1012,1013,1013].includes(t)?!1:t>=1e3&&t<=1999}function dg(t){return typeof t=="function"&&"constructor"in t&&"CLOSED"in t&&"CLOSING"in t&&"CONNECTING"in t&&"OPEN"in t}function hg(t){return ee(t)&&"code"in t&&"reason"in t}var Yp=function(t){xe(e,t);function e(r){var n=t.call(this)||this;return n.client=r,n}return e.prototype.request=function(r){var n=this;return new W(function(i){return n.client.subscribe(_(_({},r),{query:jn(r.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(a){return a instanceof Error?i.error(a):hg(a)?i.error(new Error("Socket closed with event ".concat(a.code," ").concat(a.reason||""))):i.error(new rr({graphQLErrors:Array.isArray(a)?a:[a]}))}})})},e}(St);var as=function(){return as=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},as.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function zo(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?zo=function(r){return typeof r}:zo=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},zo(t)}function mg(t){return zo(t)=="object"&&t!==null}var sh=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function Du(t,e){for(var r=/\r\n|[\n\r]/g,n=1,i=e+1,a;(a=r.exec(t.body))&&a.index<e;)n+=1,i=e+1-(a.index+a[0].length);return{line:n,column:i}}function gg(t){return ch(t.source,Du(t.source,t.start))}function ch(t,e){var r=t.locationOffset.column-1,n=Qo(r)+t.body,i=e.line-1,a=t.locationOffset.line-1,o=e.line+a,s=e.line===1?r:0,u=e.column+s,c="".concat(t.name,":").concat(o,":").concat(u,`
|
|
53
|
+
For more information, please visit: https://go.apollo.dev/c/docs`):new V(9);if(this.link=E,this.cache=o,this.disableNetworkFetches=u||l>0,this.queryDeduplication=h,this.defaultOptions=g||Object.create(null),this.typeDefs=v,l&&setTimeout(function(){return r.disableNetworkFetches=!1},l),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),p&&typeof window=="object"&&(window.__APOLLO_CLIENT__=this),!Qp&&p&&__DEV__&&(Qp=!0,typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var O=window.navigator,P=O&&O.userAgent,N=void 0;typeof P=="string"&&(P.indexOf("Chrome/")>-1?N="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":P.indexOf("Firefox/")>-1&&(N="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),N&&__DEV__&&I.log("Download the Apollo DevTools for a better development experience: "+N)}this.version=Df,this.localState=new Ao({cache:o,client:this,resolvers:b,fragmentMatcher:m}),this.queryManager=new zp({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:h,ssrMode:u,clientAwareness:{name:A,version:D},localState:this.localState,assumeImmutableResults:S,onBroadcast:p?function(){r.devToolsHookCb&&r.devToolsHookCb({action:{},state:{queries:r.queryManager.getQueryStore(),mutations:r.queryManager.mutationStore||{}},dataWithOptimisticResults:r.cache.extract(!0)})}:void 0})}return t.prototype.stop=function(){this.queryManager.stop()},t.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=Bi(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=_(_({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},t.prototype.query=function(e){return this.defaultOptions.query&&(e=Bi(this.defaultOptions.query,e)),__DEV__?I(e.fetchPolicy!=="cache-and-network","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."):I(e.fetchPolicy!=="cache-and-network",10),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=_(_({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},t.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Bi(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},t.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},t.prototype.readQuery=function(e,r){return r===void 0&&(r=!1),this.cache.readQuery(e,r)},t.prototype.readFragment=function(e,r){return r===void 0&&(r=!1),this.cache.readFragment(e,r)},t.prototype.writeQuery=function(e){var r=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),r},t.prototype.writeFragment=function(e){var r=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),r},t.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},t.prototype.__requestRaw=function(e){return Wn(this.link,e)},t.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(r){return r()}))}).then(function(){return e.reFetchObservableQueries()})},t.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(r){return r()}))})},t.prototype.onResetStore=function(e){var r=this;return this.resetStoreCallbacks.push(e),function(){r.resetStoreCallbacks=r.resetStoreCallbacks.filter(function(n){return n!==e})}},t.prototype.onClearStore=function(e){var r=this;return this.clearStoreCallbacks.push(e),function(){r.clearStoreCallbacks=r.clearStoreCallbacks.filter(function(n){return n!==e})}},t.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},t.prototype.refetchQueries=function(e){var r=this.queryManager.refetchQueries(e),n=[],i=[];r.forEach(function(o,s){n.push(s),i.push(o)});var a=Promise.all(i);return a.queries=n,a.results=i,a.catch(function(o){__DEV__&&I.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(o))}),a},t.prototype.getObservableQueries=function(e){return e===void 0&&(e="active"),this.queryManager.getObservableQueries(e)},t.prototype.extract=function(e){return this.cache.extract(e)},t.prototype.restore=function(e){return this.cache.restore(e)},t.prototype.addResolvers=function(e){this.localState.addResolvers(e)},t.prototype.setResolvers=function(e){this.localState.setResolvers(e)},t.prototype.getResolvers=function(){return this.localState.getResolvers()},t.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},t.prototype.setLink=function(e){this.link=this.queryManager.link=e},t}();rf(Kr?"log":"silent");function Ye(t){return t===null?"null":Array.isArray(t)?"array":typeof t}function nr(t){return Ye(t)==="object"}function Gp(t){return Array.isArray(t)&&t.length>0&&t.every(e=>"message"in e)}function lu(t,e){return t.length<124?t:e}var Hp="graphql-transport-ws";var at;(function(t){t[t.InternalServerError=4500]="InternalServerError",t[t.InternalClientError=4005]="InternalClientError",t[t.BadRequest=4400]="BadRequest",t[t.BadResponse=4004]="BadResponse",t[t.Unauthorized=4401]="Unauthorized",t[t.Forbidden=4403]="Forbidden",t[t.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",t[t.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",t[t.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",t[t.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",t[t.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(at||(at={}));var Te;(function(t){t.ConnectionInit="connection_init",t.ConnectionAck="connection_ack",t.Ping="ping",t.Pong="pong",t.Subscribe="subscribe",t.Next="next",t.Error="error",t.Complete="complete"})(Te||(Te={}));function Wp(t){if(!nr(t))throw new Error(`Message is expected to be an object, but got ${Ye(t)}`);if(!t.type)throw new Error("Message is missing the 'type' property");if(typeof t.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${Ye(t.type)}`);switch(t.type){case Te.ConnectionInit:case Te.ConnectionAck:case Te.Ping:case Te.Pong:{if(t.payload!=null&&!nr(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${t.payload}"`);break}case Te.Subscribe:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Ye(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!nr(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${Ye(t.payload)}`);if(typeof t.payload.query!="string")throw new Error(`"${t.type}" message payload expects the 'query' property to be a string, but got ${Ye(t.payload.query)}`);if(t.payload.variables!=null&&!nr(t.payload.variables))throw new Error(`"${t.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${Ye(t.payload.variables)}`);if(t.payload.operationName!=null&&Ye(t.payload.operationName)!=="string")throw new Error(`"${t.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${Ye(t.payload.operationName)}`);if(t.payload.extensions!=null&&!nr(t.payload.extensions))throw new Error(`"${t.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${Ye(t.payload.extensions)}`);break}case Te.Next:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Ye(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!nr(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${Ye(t.payload)}`);break}case Te.Error:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Ye(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!Gp(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(t.payload)}`);break}case Te.Complete:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Ye(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${t.type}"`)}return t}function Kp(t,e){return Wp(typeof t=="string"?JSON.parse(t,e):t)}function ti(t,e){return Wp(t),JSON.stringify(t,e)}function Zp(t){let{url:e,connectionParams:r,lazy:n=!0,onNonLazyError:i=console.error,lazyCloseTimeout:a=0,keepAlive:o=0,disablePong:s,connectionAckWaitTimeout:u=0,retryAttempts:c=5,retryWait:l=async function(de){let he=1e3;for(let J=0;J<de;J++)he*=2;await new Promise(J=>setTimeout(J,he+Math.floor(Math.random()*(3e3-300)+300)))},shouldRetry:d=Do,isFatalConnectionProblem:p,on:f,webSocketImpl:h,generateID:g=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,de=>{let he=Math.random()*16|0;return(de=="x"?he:he&3|8).toString(16)})},jsonMessageReplacer:y,jsonMessageReviver:S}=t,b;if(h){if(!dg(h))throw new Error("Invalid WebSocket implementation provided");b=h}else typeof WebSocket<"u"?b=WebSocket:typeof global<"u"?b=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(b=window.WebSocket||window.MozWebSocket);if(!b)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let v=b,m=(()=>{let q=(()=>{let he={};return{on(J,X){return he[J]=X,()=>{delete he[J]}},emit(J){var X;"id"in J&&((X=he[J.id])===null||X===void 0||X.call(he,J))}}})(),de={connecting:f?.connecting?[f.connecting]:[],opened:f?.opened?[f.opened]:[],connected:f?.connected?[f.connected]:[],ping:f?.ping?[f.ping]:[],pong:f?.pong?[f.pong]:[],message:f?.message?[q.emit,f.message]:[q.emit],closed:f?.closed?[f.closed]:[],error:f?.error?[f.error]:[]};return{onMessage:q.on,on(he,J){let X=de[he];return X.push(J),()=>{X.splice(X.indexOf(J),1)}},emit(he,...J){for(let X of[...de[he]])X(...J)}}})();function A(q){let de=[m.on("error",he=>{de.forEach(J=>J()),q(he)}),m.on("closed",he=>{de.forEach(J=>J()),q(he)})]}let D,E=0,O,P=!1,N=0,j=!1;async function qe(){clearTimeout(O);let[q,de]=await(D??(D=new Promise((X,Ft)=>(async()=>{if(P){if(await l(N),!E)return D=void 0,Ft({code:1e3,reason:"All Subscriptions Gone"});N++}m.emit("connecting");let H=new v(typeof e=="function"?await e():e,Hp),Mt,fr;function Ba(){isFinite(o)&&o>0&&(clearTimeout(fr),fr=setTimeout(()=>{H.readyState===v.OPEN&&(H.send(ti({type:Te.Ping})),m.emit("ping",!1,void 0))},o))}A(Be=>{D=void 0,clearTimeout(Mt),clearTimeout(fr),Ft(Be),Do(Be)&&Be.code===4499&&(H.close(4499,"Terminated"),H.onerror=null,H.onclose=null)}),H.onerror=Be=>m.emit("error",Be),H.onclose=Be=>m.emit("closed",Be),H.onopen=async()=>{try{m.emit("opened",H);let Be=typeof r=="function"?await r():r;if(H.readyState!==v.OPEN)return;H.send(ti(Be?{type:Te.ConnectionInit,payload:Be}:{type:Te.ConnectionInit},y)),isFinite(u)&&u>0&&(Mt=setTimeout(()=>{H.close(at.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},u)),Ba()}catch(Be){m.emit("error",Be),H.close(at.InternalClientError,lu(Be instanceof Error?Be.message:new Error(Be).message,"Internal client error"))}};let $n=!1;H.onmessage=({data:Be})=>{try{let Ve=Kp(Be,S);if(m.emit("message",Ve),Ve.type==="ping"||Ve.type==="pong"){m.emit(Ve.type,!0,Ve.payload),Ve.type==="pong"?Ba():s||(H.send(ti(Ve.payload?{type:Te.Pong,payload:Ve.payload}:{type:Te.Pong})),m.emit("pong",!1,Ve.payload));return}if($n)return;if(Ve.type!==Te.ConnectionAck)throw new Error(`First message cannot be of type ${Ve.type}`);clearTimeout(Mt),$n=!0,m.emit("connected",H,Ve.payload),P=!1,N=0,X([H,new Promise((F2,cm)=>A(cm))])}catch(Ve){H.onmessage=null,m.emit("error",Ve),H.close(at.BadResponse,lu(Ve instanceof Error?Ve.message:new Error(Ve).message,"Bad response"))}}})())));q.readyState===v.CLOSING&&await de;let he=()=>{},J=new Promise(X=>he=X);return[q,he,Promise.race([J.then(()=>{if(!E){let X=()=>q.close(1e3,"Normal Closure");isFinite(a)&&a>0?O=setTimeout(()=>{q.readyState===v.OPEN&&X()},a):X()}}),de])]}function Ne(q){if(Do(q)&&(pg(q.code)||[at.InternalServerError,at.InternalClientError,at.BadRequest,at.BadResponse,at.Unauthorized,at.SubprotocolNotAcceptable,at.SubscriberAlreadyExists,at.TooManyInitialisationRequests].includes(q.code)))throw q;if(j)return!1;if(Do(q)&&q.code===1e3)return E>0;if(!c||N>=c||!d(q)||p?.(q))throw q;return P=!0}return n||(async()=>{for(E++;;)try{let[,,q]=await qe();await q}catch(q){try{if(!Ne(q))return}catch(de){return i?.(de)}}})(),{on:m.on,subscribe(q,de){let he=g(q),J=!1,X=!1,Ft=()=>{E--,J=!0};return(async()=>{for(E++;;)try{let[H,Mt,fr]=await qe();if(J)return Mt();let Ba=m.onMessage(he,$n=>{switch($n.type){case Te.Next:{de.next($n.payload);return}case Te.Error:{X=!0,J=!0,de.error($n.payload),Ft();return}case Te.Complete:{J=!0,Ft();return}}});H.send(ti({id:he,type:Te.Subscribe,payload:q},y)),Ft=()=>{!J&&H.readyState===v.OPEN&&H.send(ti({id:he,type:Te.Complete},y)),E--,J=!0,Mt()},await fr.finally(Ba);return}catch(H){if(!Ne(H))return}})().then(()=>{X||de.complete()}).catch(H=>{de.error(H)}),()=>{J||Ft()}},async dispose(){if(j=!0,D){let[q]=await D;q.close(1e3,"Normal Closure")}},terminate(){D&&m.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}function Do(t){return nr(t)&&"code"in t&&"reason"in t}function pg(t){return[1e3,1001,1006,1005,1012,1013,1013].includes(t)?!1:t>=1e3&&t<=1999}function dg(t){return typeof t=="function"&&"constructor"in t&&"CLOSED"in t&&"CLOSING"in t&&"CONNECTING"in t&&"OPEN"in t}function hg(t){return ee(t)&&"code"in t&&"reason"in t}var Yp=function(t){xe(e,t);function e(r){var n=t.call(this)||this;return n.client=r,n}return e.prototype.request=function(r){var n=this;return new W(function(i){return n.client.subscribe(_(_({},r),{query:jn(r.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(a){return a instanceof Error?i.error(a):hg(a)?i.error(new Error("Socket closed with event ".concat(a.code," ").concat(a.reason||""))):i.error(new rr({graphQLErrors:Array.isArray(a)?a:[a]}))}})})},e}(St);var as=function(){return as=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},as.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function zo(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?zo=function(r){return typeof r}:zo=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},zo(t)}function mg(t){return zo(t)=="object"&&t!==null}var sh=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function Du(t,e){for(var r=/\r\n|[\n\r]/g,n=1,i=e+1,a;(a=r.exec(t.body))&&a.index<e;)n+=1,i=e+1-(a.index+a[0].length);return{line:n,column:i}}function gg(t){return ch(t.source,Du(t.source,t.start))}function ch(t,e){var r=t.locationOffset.column-1,n=Qo(r)+t.body,i=e.line-1,a=t.locationOffset.line-1,o=e.line+a,s=e.line===1?r:0,u=e.column+s,c="".concat(t.name,":").concat(o,":").concat(u,`
|
|
54
54
|
`),l=n.split(/\r\n|[\n\r]/g),d=l[i];if(d.length>120){for(var p=Math.floor(u/80),f=u%80,h=[],g=0;g<d.length;g+=80)h.push(d.slice(g,g+80));return c+Jp([["".concat(o),h[0]]].concat(h.slice(1,p+1).map(function(y){return["",y]}),[[" ",Qo(f-1)+"^"],["",h[p+1]]]))}return c+Jp([["".concat(o-1),l[i-1]],["".concat(o),d],["",Qo(u-1)+"^"],["".concat(o+1),l[i+1]]])}function Jp(t){var e=t.filter(function(n){n[0];var i=n[1];return i!==void 0}),r=Math.max.apply(Math,e.map(function(n){var i=n[0];return i.length}));return e.map(function(n){var i=n[0],a=n[1];return yg(r,i)+(a?" | "+a:" |")}).join(`
|
|
55
55
|
`)}function Qo(t){return Array(t+1).join(" ")}function yg(t,e){return Qo(t-e.length)+e}function Go(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Go=function(r){return typeof r}:Go=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Go(t)}function Xp(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function vg(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Xp(Object(r),!0).forEach(function(n){bg(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Xp(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function bg(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _g(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ed(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function wg(t,e,r){return e&&ed(t.prototype,e),r&&ed(t,r),t}function Sg(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&_a(t,e)}function Cg(t){var e=lh();return function(){var n=wa(t),i;if(e){var a=wa(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return uh(this,i)}}function uh(t,e){return e&&(Go(e)==="object"||typeof e=="function")?e:Xi(t)}function Xi(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Nu(t){var e=typeof Map=="function"?new Map:void 0;return Nu=function(n){if(n===null||!Eg(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return Ho(n,arguments,wa(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),_a(i,n)},Nu(t)}function Ho(t,e,r){return lh()?Ho=Reflect.construct:Ho=function(i,a,o){var s=[null];s.push.apply(s,a);var u=Function.bind.apply(i,s),c=new u;return o&&_a(c,o.prototype),c},Ho.apply(null,arguments)}function lh(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Eg(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function _a(t,e){return _a=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},_a(t,e)}function wa(t){return wa=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},wa(t)}var xg=function(t){Sg(r,t);var e=Cg(r);function r(n,i,a,o,s,u,c){var l,d,p,f;_g(this,r),f=e.call(this,n),f.name="GraphQLError",f.originalError=u??void 0,f.nodes=td(Array.isArray(i)?i:i?[i]:void 0);for(var h=[],g=0,y=(S=f.nodes)!==null&&S!==void 0?S:[];g<y.length;g++){var S,b=y[g],v=b.loc;v!=null&&h.push(v)}h=td(h),f.source=a??((l=h)===null||l===void 0?void 0:l[0].source),f.positions=o??((d=h)===null||d===void 0?void 0:d.map(function(A){return A.start})),f.locations=o&&a?o.map(function(A){return Du(a,A)}):(p=h)===null||p===void 0?void 0:p.map(function(A){return Du(A.source,A.start)}),f.path=s??void 0;var m=u?.extensions;return c==null&&mg(m)?f.extensions=vg({},m):f.extensions=c??{},Object.defineProperties(Xi(f),{message:{enumerable:!0},locations:{enumerable:f.locations!=null},path:{enumerable:f.path!=null},extensions:{enumerable:f.extensions!=null&&Object.keys(f.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),u!=null&&u.stack?(Object.defineProperty(Xi(f),"stack",{value:u.stack,writable:!0,configurable:!0}),uh(f)):(Error.captureStackTrace?Error.captureStackTrace(Xi(f),r):Object.defineProperty(Xi(f),"stack",{value:Error().stack,writable:!0,configurable:!0}),f)}return wg(r,[{key:"toString",value:function(){return kg(this)}},{key:sh,get:function(){return"Object"}}]),r}(Nu(Error));function td(t){return t===void 0||t.length===0?void 0:t}function kg(t){var e=t.message;if(t.nodes)for(var r=0,n=t.nodes;r<n.length;r++){var i=n[r];i.loc&&(e+=`
|
|
56
56
|
|
|
@@ -647,7 +647,7 @@ triggerMatch
|
|
|
647
647
|
}
|
|
648
648
|
}`,variables:{url:e}}));return r}async interact(e,r){let{expressionInteract:n}=T(await ai(this,or,"f").mutate({mutation:C`mutation expressionInteract($url: String!, $interactionCall: InteractionCall!){
|
|
649
649
|
expressionInteract(url: $url, interactionCall: $interactionCall)
|
|
650
|
-
}`,variables:{url:e,interactionCall:r}}));return n}};or=new WeakMap;var As={};As.byteLength=Ey;As.toByteArray=ky;As.fromByteArray=Iy;var Qt=[],Ct=[],Cy=typeof Uint8Array<"u"?Uint8Array:Array,gu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(sn=0,ld=gu.length;sn<ld;++sn)Qt[sn]=gu[sn],Ct[gu.charCodeAt(sn)]=sn;var sn,ld;Ct["-".charCodeAt(0)]=62;Ct["_".charCodeAt(0)]=63;function Ch(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function Ey(t){var e=Ch(t),r=e[0],n=e[1];return(r+n)*3/4-n}function xy(t,e,r){return(e+r)*3/4-r}function ky(t){var e,r=Ch(t),n=r[0],i=r[1],a=new Cy(xy(t,n,i)),o=0,s=i>0?n-4:n,u;for(u=0;u<s;u+=4)e=Ct[t.charCodeAt(u)]<<18|Ct[t.charCodeAt(u+1)]<<12|Ct[t.charCodeAt(u+2)]<<6|Ct[t.charCodeAt(u+3)],a[o++]=e>>16&255,a[o++]=e>>8&255,a[o++]=e&255;return i===2&&(e=Ct[t.charCodeAt(u)]<<2|Ct[t.charCodeAt(u+1)]>>4,a[o++]=e&255),i===1&&(e=Ct[t.charCodeAt(u)]<<10|Ct[t.charCodeAt(u+1)]<<4|Ct[t.charCodeAt(u+2)]>>2,a[o++]=e>>8&255,a[o++]=e&255),a}function Ty(t){return Qt[t>>18&63]+Qt[t>>12&63]+Qt[t>>6&63]+Qt[t&63]}function Ay(t,e,r){for(var n,i=[],a=e;a<r;a+=3)n=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(t[a+2]&255),i.push(Ty(n));return i.join("")}function Iy(t){for(var e,r=t.length,n=r%3,i=[],a=16383,o=0,s=r-n;o<s;o+=a)i.push(Ay(t,o,o+a>s?s:o+a));return n===1?(e=t[r-1],i.push(Qt[e>>2]+Qt[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Qt[e>>10]+Qt[e>>4&63]+Qt[e<<2&63]+"=")),i.join("")}var Oy=4,fd=0,pd=1,Dy=2;function bi(t){let e=t.length;for(;--e>=0;)t[e]=0}var Ny=0,Eh=1,Ry=2,Py=3,Ly=258,sl=29,La=256,Ea=La+1+sl,li=30,cl=19,xh=2*Ea+1,gn=15,yu=16,$y=7,ul=256,kh=16,Th=17,Ah=18,Qu=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Xo=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Fy=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Ih=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),My=512,sr=new Array((Ea+2)*2);bi(sr);var ya=new Array(li*2);bi(ya);var xa=new Array(My);bi(xa);var ka=new Array(Ly-Py+1);bi(ka);var ll=new Array(sl);bi(ll);var gs=new Array(li);bi(gs);function vu(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}var Oh,Dh,Nh;function bu(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}var Rh=t=>t<256?xa[t]:xa[256+(t>>>7)],Ta=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},ut=(t,e,r)=>{t.bi_valid>yu-r?(t.bi_buf|=e<<t.bi_valid&65535,Ta(t,t.bi_buf),t.bi_buf=e>>yu-t.bi_valid,t.bi_valid+=r-yu):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)},Gt=(t,e,r)=>{ut(t,r[e*2],r[e*2+1])},Ph=(t,e)=>{let r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1},Uy=t=>{t.bi_valid===16?(Ta(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)},jy=(t,e)=>{let r=e.dyn_tree,n=e.max_code,i=e.stat_desc.static_tree,a=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,s=e.stat_desc.extra_base,u=e.stat_desc.max_length,c,l,d,p,f,h,g=0;for(p=0;p<=gn;p++)t.bl_count[p]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<xh;c++)l=t.heap[c],p=r[r[l*2+1]*2+1]+1,p>u&&(p=u,g++),r[l*2+1]=p,!(l>n)&&(t.bl_count[p]++,f=0,l>=s&&(f=o[l-s]),h=r[l*2],t.opt_len+=h*(p+f),a&&(t.static_len+=h*(i[l*2+1]+f)));if(g!==0){do{for(p=u-1;t.bl_count[p]===0;)p--;t.bl_count[p]--,t.bl_count[p+1]+=2,t.bl_count[u]--,g-=2}while(g>0);for(p=u;p!==0;p--)for(l=t.bl_count[p];l!==0;)d=t.heap[--c],!(d>n)&&(r[d*2+1]!==p&&(t.opt_len+=(p-r[d*2+1])*r[d*2],r[d*2+1]=p),l--)}},Lh=(t,e,r)=>{let n=new Array(gn+1),i=0,a,o;for(a=1;a<=gn;a++)i=i+r[a-1]<<1,n[a]=i;for(o=0;o<=e;o++){let s=t[o*2+1];s!==0&&(t[o*2]=Ph(n[s]++,s))}},qy=()=>{let t,e,r,n,i,a=new Array(gn+1);for(r=0,n=0;n<sl-1;n++)for(ll[n]=r,t=0;t<1<<Qu[n];t++)ka[r++]=n;for(ka[r-1]=n,i=0,n=0;n<16;n++)for(gs[n]=i,t=0;t<1<<Xo[n];t++)xa[i++]=n;for(i>>=7;n<li;n++)for(gs[n]=i<<7,t=0;t<1<<Xo[n]-7;t++)xa[256+i++]=n;for(e=0;e<=gn;e++)a[e]=0;for(t=0;t<=143;)sr[t*2+1]=8,t++,a[8]++;for(;t<=255;)sr[t*2+1]=9,t++,a[9]++;for(;t<=279;)sr[t*2+1]=7,t++,a[7]++;for(;t<=287;)sr[t*2+1]=8,t++,a[8]++;for(Lh(sr,Ea+1,a),t=0;t<li;t++)ya[t*2+1]=5,ya[t*2]=Ph(t,5);Oh=new vu(sr,Qu,La+1,Ea,gn),Dh=new vu(ya,Xo,0,li,gn),Nh=new vu(new Array(0),Fy,0,cl,$y)},$h=t=>{let e;for(e=0;e<Ea;e++)t.dyn_ltree[e*2]=0;for(e=0;e<li;e++)t.dyn_dtree[e*2]=0;for(e=0;e<cl;e++)t.bl_tree[e*2]=0;t.dyn_ltree[ul*2]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},Fh=t=>{t.bi_valid>8?Ta(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},dd=(t,e,r,n)=>{let i=e*2,a=r*2;return t[i]<t[a]||t[i]===t[a]&&n[e]<=n[r]},_u=(t,e,r)=>{let n=t.heap[r],i=r<<1;for(;i<=t.heap_len&&(i<t.heap_len&&dd(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!dd(e,n,t.heap[i],t.depth));)t.heap[r]=t.heap[i],r=i,i<<=1;t.heap[r]=n},hd=(t,e,r)=>{let n,i,a=0,o,s;if(t.sym_next!==0)do n=t.pending_buf[t.sym_buf+a++]&255,n+=(t.pending_buf[t.sym_buf+a++]&255)<<8,i=t.pending_buf[t.sym_buf+a++],n===0?Gt(t,i,e):(o=ka[i],Gt(t,o+La+1,e),s=Qu[o],s!==0&&(i-=ll[o],ut(t,i,s)),n--,o=Rh(n),Gt(t,o,r),s=Xo[o],s!==0&&(n-=gs[o],ut(t,n,s)));while(a<t.sym_next);Gt(t,ul,e)},Gu=(t,e)=>{let r=e.dyn_tree,n=e.stat_desc.static_tree,i=e.stat_desc.has_stree,a=e.stat_desc.elems,o,s,u=-1,c;for(t.heap_len=0,t.heap_max=xh,o=0;o<a;o++)r[o*2]!==0?(t.heap[++t.heap_len]=u=o,t.depth[o]=0):r[o*2+1]=0;for(;t.heap_len<2;)c=t.heap[++t.heap_len]=u<2?++u:0,r[c*2]=1,t.depth[c]=0,t.opt_len--,i&&(t.static_len-=n[c*2+1]);for(e.max_code=u,o=t.heap_len>>1;o>=1;o--)_u(t,r,o);c=a;do o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],_u(t,r,1),s=t.heap[1],t.heap[--t.heap_max]=o,t.heap[--t.heap_max]=s,r[c*2]=r[o*2]+r[s*2],t.depth[c]=(t.depth[o]>=t.depth[s]?t.depth[o]:t.depth[s])+1,r[o*2+1]=r[s*2+1]=c,t.heap[1]=c++,_u(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],jy(t,e),Lh(r,u,t.bl_count)},md=(t,e,r)=>{let n,i=-1,a,o=e[0*2+1],s=0,u=7,c=4;for(o===0&&(u=138,c=3),e[(r+1)*2+1]=65535,n=0;n<=r;n++)a=o,o=e[(n+1)*2+1],!(++s<u&&a===o)&&(s<c?t.bl_tree[a*2]+=s:a!==0?(a!==i&&t.bl_tree[a*2]++,t.bl_tree[kh*2]++):s<=10?t.bl_tree[Th*2]++:t.bl_tree[Ah*2]++,s=0,i=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4))},gd=(t,e,r)=>{let n,i=-1,a,o=e[0*2+1],s=0,u=7,c=4;for(o===0&&(u=138,c=3),n=0;n<=r;n++)if(a=o,o=e[(n+1)*2+1],!(++s<u&&a===o)){if(s<c)do Gt(t,a,t.bl_tree);while(--s!==0);else a!==0?(a!==i&&(Gt(t,a,t.bl_tree),s--),Gt(t,kh,t.bl_tree),ut(t,s-3,2)):s<=10?(Gt(t,Th,t.bl_tree),ut(t,s-3,3)):(Gt(t,Ah,t.bl_tree),ut(t,s-11,7));s=0,i=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4)}},By=t=>{let e;for(md(t,t.dyn_ltree,t.l_desc.max_code),md(t,t.dyn_dtree,t.d_desc.max_code),Gu(t,t.bl_desc),e=cl-1;e>=3&&t.bl_tree[Ih[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},Vy=(t,e,r,n)=>{let i;for(ut(t,e-257,5),ut(t,r-1,5),ut(t,n-4,4),i=0;i<n;i++)ut(t,t.bl_tree[Ih[i]*2+1],3);gd(t,t.dyn_ltree,e-1),gd(t,t.dyn_dtree,r-1)},zy=t=>{let e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return fd;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return pd;for(r=32;r<La;r++)if(t.dyn_ltree[r*2]!==0)return pd;return fd},yd=!1,Qy=t=>{yd||(qy(),yd=!0),t.l_desc=new bu(t.dyn_ltree,Oh),t.d_desc=new bu(t.dyn_dtree,Dh),t.bl_desc=new bu(t.bl_tree,Nh),t.bi_buf=0,t.bi_valid=0,$h(t)},Mh=(t,e,r,n)=>{ut(t,(Ny<<1)+(n?1:0),3),Fh(t),Ta(t,r),Ta(t,~r),r&&t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r},Gy=t=>{ut(t,Eh<<1,3),Gt(t,ul,sr),Uy(t)},Hy=(t,e,r,n)=>{let i,a,o=0;t.level>0?(t.strm.data_type===Dy&&(t.strm.data_type=zy(t)),Gu(t,t.l_desc),Gu(t,t.d_desc),o=By(t),i=t.opt_len+3+7>>>3,a=t.static_len+3+7>>>3,a<=i&&(i=a)):i=a=r+5,r+4<=i&&e!==-1?Mh(t,e,r,n):t.strategy===Oy||a===i?(ut(t,(Eh<<1)+(n?1:0),3),hd(t,sr,ya)):(ut(t,(Ry<<1)+(n?1:0),3),Vy(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),hd(t,t.dyn_ltree,t.dyn_dtree)),$h(t),n&&Fh(t)},Wy=(t,e,r)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=r,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(ka[r]+La+1)*2]++,t.dyn_dtree[Rh(e)*2]++),t.sym_next===t.sym_end),Ky=Qy,Zy=Mh,Yy=Hy,Jy=Wy,Xy=Gy,ev={_tr_init:Ky,_tr_stored_block:Zy,_tr_flush_block:Yy,_tr_tally:Jy,_tr_align:Xy},tv=(t,e,r,n)=>{let i=t&65535|0,a=t>>>16&65535|0,o=0;for(;r!==0;){o=r>2e3?2e3:r,r-=o;do i=i+e[n++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0},Aa=tv,rv=()=>{let t,e=[];for(var r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e},nv=new Uint32Array(rv()),iv=(t,e,r,n)=>{let i=nv,a=n+r;t^=-1;for(let o=n;o<a;o++)t=t>>>8^i[(t^e[o])&255];return t^-1},je=iv,xn={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Rn={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},{_tr_init:av,_tr_stored_block:Hu,_tr_flush_block:ov,_tr_tally:Nr,_tr_align:sv}=ev,{Z_NO_FLUSH:Rr,Z_PARTIAL_FLUSH:cv,Z_FULL_FLUSH:uv,Z_FINISH:xt,Z_BLOCK:vd,Z_OK:Ge,Z_STREAM_END:bd,Z_STREAM_ERROR:Wt,Z_DATA_ERROR:lv,Z_BUF_ERROR:wu,Z_DEFAULT_COMPRESSION:fv,Z_FILTERED:pv,Z_HUFFMAN_ONLY:Mo,Z_RLE:dv,Z_FIXED:hv,Z_DEFAULT_STRATEGY:mv,Z_UNKNOWN:gv,Z_DEFLATED:Is}=Rn,yv=9,vv=15,bv=8,_v=29,wv=256,Wu=wv+1+_v,Sv=30,Cv=19,Ev=2*Wu+1,xv=15,Y=3,Ir=258,Kt=Ir+Y+1,kv=32,hi=42,fl=57,Ku=69,Zu=73,Yu=91,Ju=103,yn=113,fa=666,rt=1,_i=2,kn=3,wi=4,Tv=3,vn=(t,e)=>(t.msg=xn[e],e),_d=t=>t*2-(t>4?9:0),Ar=t=>{let e=t.length;for(;--e>=0;)t[e]=0},Av=t=>{let e,r,n,i=t.w_size;e=t.hash_size,n=e;do r=t.head[--n],t.head[n]=r>=i?r-i:0;while(--e);e=i,n=e;do r=t.prev[--n],t.prev[n]=r>=i?r-i:0;while(--e)},Iv=(t,e,r)=>(e<<t.hash_shift^r)&t.hash_mask,Pr=Iv,mt=t=>{let e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))},yt=(t,e)=>{ov(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,mt(t.strm)},ae=(t,e)=>{t.pending_buf[t.pending++]=e},Ji=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},Xu=(t,e,r,n)=>{let i=t.avail_in;return i>n&&(i=n),i===0?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),r),t.state.wrap===1?t.adler=Aa(t.adler,e,i,r):t.state.wrap===2&&(t.adler=je(t.adler,e,i,r)),t.next_in+=i,t.total_in+=i,i)},Uh=(t,e)=>{let r=t.max_chain_length,n=t.strstart,i,a,o=t.prev_length,s=t.nice_match,u=t.strstart>t.w_size-Kt?t.strstart-(t.w_size-Kt):0,c=t.window,l=t.w_mask,d=t.prev,p=t.strstart+Ir,f=c[n+o-1],h=c[n+o];t.prev_length>=t.good_match&&(r>>=2),s>t.lookahead&&(s=t.lookahead);do if(i=e,!(c[i+o]!==h||c[i+o-1]!==f||c[i]!==c[n]||c[++i]!==c[n+1])){n+=2,i++;do;while(c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&n<p);if(a=Ir-(p-n),n=p-Ir,a>o){if(t.match_start=e,o=a,a>=s)break;f=c[n+o-1],h=c[n+o]}}while((e=d[e&l])>u&&--r!==0);return o<=t.lookahead?o:t.lookahead},mi=t=>{let e=t.w_size,r,n,i;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Kt)&&(t.window.set(t.window.subarray(e,e+e-n),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),Av(t),n+=e),t.strm.avail_in===0)break;if(r=Xu(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=r,t.lookahead+t.insert>=Y)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=Pr(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=Pr(t,t.ins_h,t.window[i+Y-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<Y)););}while(t.lookahead<Kt&&t.strm.avail_in!==0)},jh=(t,e)=>{let r=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,n,i,a,o=0,s=t.strm.avail_in;do{if(n=65535,a=t.bi_valid+42>>3,t.strm.avail_out<a||(a=t.strm.avail_out-a,i=t.strstart-t.block_start,n>i+t.strm.avail_in&&(n=i+t.strm.avail_in),n>a&&(n=a),n<r&&(n===0&&e!==xt||e===Rr||n!==i+t.strm.avail_in)))break;o=e===xt&&n===i+t.strm.avail_in?1:0,Hu(t,0,0,o),t.pending_buf[t.pending-4]=n,t.pending_buf[t.pending-3]=n>>8,t.pending_buf[t.pending-2]=~n,t.pending_buf[t.pending-1]=~n>>8,mt(t.strm),i&&(i>n&&(i=n),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,n-=i),n&&(Xu(t.strm,t.strm.output,t.strm.next_out,n),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n)}while(o===0);return s-=t.strm.avail_in,s&&(s>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=s&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-s,t.strm.next_in),t.strstart),t.strstart+=s,t.insert+=s>t.w_size-t.insert?t.w_size-t.insert:s),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),o?wi:e!==Rr&&e!==xt&&t.strm.avail_in===0&&t.strstart===t.block_start?_i:(a=t.window_size-t.strstart,t.strm.avail_in>a&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,a+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),a>t.strm.avail_in&&(a=t.strm.avail_in),a&&(Xu(t.strm,t.window,t.strstart,a),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.high_water<t.strstart&&(t.high_water=t.strstart),a=t.bi_valid+42>>3,a=t.pending_buf_size-a>65535?65535:t.pending_buf_size-a,r=a>t.w_size?t.w_size:a,i=t.strstart-t.block_start,(i>=r||(i||e===xt)&&e!==Rr&&t.strm.avail_in===0&&i<=a)&&(n=i>a?a:i,o=e===xt&&t.strm.avail_in===0&&n===i?1:0,Hu(t,t.block_start,n,o),t.block_start+=n,mt(t.strm)),o?kn:rt)},Su=(t,e)=>{let r,n;for(;;){if(t.lookahead<Kt){if(mi(t),t.lookahead<Kt&&e===Rr)return rt;if(t.lookahead===0)break}if(r=0,t.lookahead>=Y&&(t.ins_h=Pr(t,t.ins_h,t.window[t.strstart+Y-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),r!==0&&t.strstart-r<=t.w_size-Kt&&(t.match_length=Uh(t,r)),t.match_length>=Y)if(n=Nr(t,t.strstart-t.match_start,t.match_length-Y),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=Y){t.match_length--;do t.strstart++,t.ins_h=Pr(t,t.ins_h,t.window[t.strstart+Y-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=Pr(t,t.ins_h,t.window[t.strstart+1]);else n=Nr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(yt(t,!1),t.strm.avail_out===0))return rt}return t.insert=t.strstart<Y-1?t.strstart:Y-1,e===xt?(yt(t,!0),t.strm.avail_out===0?kn:wi):t.sym_next&&(yt(t,!1),t.strm.avail_out===0)?rt:_i},oi=(t,e)=>{let r,n,i;for(;;){if(t.lookahead<Kt){if(mi(t),t.lookahead<Kt&&e===Rr)return rt;if(t.lookahead===0)break}if(r=0,t.lookahead>=Y&&(t.ins_h=Pr(t,t.ins_h,t.window[t.strstart+Y-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=Y-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-Kt&&(t.match_length=Uh(t,r),t.match_length<=5&&(t.strategy===pv||t.match_length===Y&&t.strstart-t.match_start>4096)&&(t.match_length=Y-1)),t.prev_length>=Y&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-Y,n=Nr(t,t.strstart-1-t.prev_match,t.prev_length-Y),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=Pr(t,t.ins_h,t.window[t.strstart+Y-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=Y-1,t.strstart++,n&&(yt(t,!1),t.strm.avail_out===0))return rt}else if(t.match_available){if(n=Nr(t,0,t.window[t.strstart-1]),n&&yt(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return rt}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=Nr(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<Y-1?t.strstart:Y-1,e===xt?(yt(t,!0),t.strm.avail_out===0?kn:wi):t.sym_next&&(yt(t,!1),t.strm.avail_out===0)?rt:_i},Ov=(t,e)=>{let r,n,i,a,o=t.window;for(;;){if(t.lookahead<=Ir){if(mi(t),t.lookahead<=Ir&&e===Rr)return rt;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=Y&&t.strstart>0&&(i=t.strstart-1,n=o[i],n===o[++i]&&n===o[++i]&&n===o[++i])){a=t.strstart+Ir;do;while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&i<a);t.match_length=Ir-(a-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=Y?(r=Nr(t,1,t.match_length-Y),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=Nr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(yt(t,!1),t.strm.avail_out===0))return rt}return t.insert=0,e===xt?(yt(t,!0),t.strm.avail_out===0?kn:wi):t.sym_next&&(yt(t,!1),t.strm.avail_out===0)?rt:_i},Dv=(t,e)=>{let r;for(;;){if(t.lookahead===0&&(mi(t),t.lookahead===0)){if(e===Rr)return rt;break}if(t.match_length=0,r=Nr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(yt(t,!1),t.strm.avail_out===0))return rt}return t.insert=0,e===xt?(yt(t,!0),t.strm.avail_out===0?kn:wi):t.sym_next&&(yt(t,!1),t.strm.avail_out===0)?rt:_i};function Vt(t,e,r,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=i}var pa=[new Vt(0,0,0,0,jh),new Vt(4,4,8,4,Su),new Vt(4,5,16,8,Su),new Vt(4,6,32,32,Su),new Vt(4,4,16,16,oi),new Vt(8,16,32,32,oi),new Vt(8,16,128,128,oi),new Vt(8,32,128,256,oi),new Vt(32,128,258,1024,oi),new Vt(32,258,258,4096,oi)],Nv=t=>{t.window_size=2*t.w_size,Ar(t.head),t.max_lazy_match=pa[t.level].max_lazy,t.good_match=pa[t.level].good_length,t.nice_match=pa[t.level].nice_length,t.max_chain_length=pa[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=Y-1,t.match_available=0,t.ins_h=0};function Rv(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Is,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(Ev*2),this.dyn_dtree=new Uint16Array((2*Sv+1)*2),this.bl_tree=new Uint16Array((2*Cv+1)*2),Ar(this.dyn_ltree),Ar(this.dyn_dtree),Ar(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(xv+1),this.heap=new Uint16Array(2*Wu+1),Ar(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Wu+1),Ar(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var $a=t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.status!==hi&&e.status!==fl&&e.status!==Ku&&e.status!==Zu&&e.status!==Yu&&e.status!==Ju&&e.status!==yn&&e.status!==fa?1:0},qh=t=>{if($a(t))return vn(t,Wt);t.total_in=t.total_out=0,t.data_type=gv;let e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?fl:e.wrap?hi:yn,t.adler=e.wrap===2?0:1,e.last_flush=-2,av(e),Ge},Bh=t=>{let e=qh(t);return e===Ge&&Nv(t.state),e},Pv=(t,e)=>$a(t)||t.state.wrap!==2?Wt:(t.state.gzhead=e,Ge),Vh=(t,e,r,n,i,a)=>{if(!t)return Wt;let o=1;if(e===fv&&(e=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>yv||r!==Is||n<8||n>15||e<0||e>9||a<0||a>hv||n===8&&o!==1)return vn(t,Wt);n===8&&(n=9);let s=new Rv;return t.state=s,s.strm=t,s.status=hi,s.wrap=o,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+Y-1)/Y),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=e,s.strategy=a,s.method=r,Bh(t)},Lv=(t,e)=>Vh(t,e,Is,vv,bv,mv),$v=(t,e)=>{if($a(t)||e>vd||e<0)return t?vn(t,Wt):Wt;let r=t.state;if(!t.output||t.avail_in!==0&&!t.input||r.status===fa&&e!==xt)return vn(t,t.avail_out===0?wu:Wt);let n=r.last_flush;if(r.last_flush=e,r.pending!==0){if(mt(t),t.avail_out===0)return r.last_flush=-1,Ge}else if(t.avail_in===0&&_d(e)<=_d(n)&&e!==xt)return vn(t,wu);if(r.status===fa&&t.avail_in!==0)return vn(t,wu);if(r.status===hi&&r.wrap===0&&(r.status=yn),r.status===hi){let i=Is+(r.w_bits-8<<4)<<8,a=-1;if(r.strategy>=Mo||r.level<2?a=0:r.level<6?a=1:r.level===6?a=2:a=3,i|=a<<6,r.strstart!==0&&(i|=kv),i+=31-i%31,Ji(r,i),r.strstart!==0&&(Ji(r,t.adler>>>16),Ji(r,t.adler&65535)),t.adler=1,r.status=yn,mt(t),r.pending!==0)return r.last_flush=-1,Ge}if(r.status===fl){if(t.adler=0,ae(r,31),ae(r,139),ae(r,8),r.gzhead)ae(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),ae(r,r.gzhead.time&255),ae(r,r.gzhead.time>>8&255),ae(r,r.gzhead.time>>16&255),ae(r,r.gzhead.time>>24&255),ae(r,r.level===9?2:r.strategy>=Mo||r.level<2?4:0),ae(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(ae(r,r.gzhead.extra.length&255),ae(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=je(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Ku;else if(ae(r,0),ae(r,0),ae(r,0),ae(r,0),ae(r,0),ae(r,r.level===9?2:r.strategy>=Mo||r.level<2?4:0),ae(r,Tv),r.status=yn,mt(t),r.pending!==0)return r.last_flush=-1,Ge}if(r.status===Ku){if(r.gzhead.extra){let i=r.pending,a=(r.gzhead.extra.length&65535)-r.gzindex;for(;r.pending+a>r.pending_buf_size;){let s=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+s),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>i&&(t.adler=je(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex+=s,mt(t),r.pending!==0)return r.last_flush=-1,Ge;i=0,a-=s}let o=new Uint8Array(r.gzhead.extra);r.pending_buf.set(o.subarray(r.gzindex,r.gzindex+a),r.pending),r.pending+=a,r.gzhead.hcrc&&r.pending>i&&(t.adler=je(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=Zu}if(r.status===Zu){if(r.gzhead.name){let i=r.pending,a;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(t.adler=je(t.adler,r.pending_buf,r.pending-i,i)),mt(t),r.pending!==0)return r.last_flush=-1,Ge;i=0}r.gzindex<r.gzhead.name.length?a=r.gzhead.name.charCodeAt(r.gzindex++)&255:a=0,ae(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(t.adler=je(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=Yu}if(r.status===Yu){if(r.gzhead.comment){let i=r.pending,a;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(t.adler=je(t.adler,r.pending_buf,r.pending-i,i)),mt(t),r.pending!==0)return r.last_flush=-1,Ge;i=0}r.gzindex<r.gzhead.comment.length?a=r.gzhead.comment.charCodeAt(r.gzindex++)&255:a=0,ae(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(t.adler=je(t.adler,r.pending_buf,r.pending-i,i))}r.status=Ju}if(r.status===Ju){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(mt(t),r.pending!==0))return r.last_flush=-1,Ge;ae(r,t.adler&255),ae(r,t.adler>>8&255),t.adler=0}if(r.status=yn,mt(t),r.pending!==0)return r.last_flush=-1,Ge}if(t.avail_in!==0||r.lookahead!==0||e!==Rr&&r.status!==fa){let i=r.level===0?jh(r,e):r.strategy===Mo?Dv(r,e):r.strategy===dv?Ov(r,e):pa[r.level].func(r,e);if((i===kn||i===wi)&&(r.status=fa),i===rt||i===kn)return t.avail_out===0&&(r.last_flush=-1),Ge;if(i===_i&&(e===cv?sv(r):e!==vd&&(Hu(r,0,0,!1),e===uv&&(Ar(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),mt(t),t.avail_out===0))return r.last_flush=-1,Ge}return e!==xt?Ge:r.wrap<=0?bd:(r.wrap===2?(ae(r,t.adler&255),ae(r,t.adler>>8&255),ae(r,t.adler>>16&255),ae(r,t.adler>>24&255),ae(r,t.total_in&255),ae(r,t.total_in>>8&255),ae(r,t.total_in>>16&255),ae(r,t.total_in>>24&255)):(Ji(r,t.adler>>>16),Ji(r,t.adler&65535)),mt(t),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?Ge:bd)},Fv=t=>{if($a(t))return Wt;let e=t.state.status;return t.state=null,e===yn?vn(t,lv):Ge},Mv=(t,e)=>{let r=e.length;if($a(t))return Wt;let n=t.state,i=n.wrap;if(i===2||i===1&&n.status!==hi||n.lookahead)return Wt;if(i===1&&(t.adler=Aa(t.adler,e,r,0)),n.wrap=0,r>=n.w_size){i===0&&(Ar(n.head),n.strstart=0,n.block_start=0,n.insert=0);let u=new Uint8Array(n.w_size);u.set(e.subarray(r-n.w_size,r),0),e=u,r=n.w_size}let a=t.avail_in,o=t.next_in,s=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,mi(n);n.lookahead>=Y;){let u=n.strstart,c=n.lookahead-(Y-1);do n.ins_h=Pr(n,n.ins_h,n.window[u+Y-1]),n.prev[u&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=u,u++;while(--c);n.strstart=u,n.lookahead=Y-1,mi(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=Y-1,n.match_available=0,t.next_in=o,t.input=s,t.avail_in=a,n.wrap=i,Ge},Uv=Lv,jv=Vh,qv=Bh,Bv=qh,Vv=Pv,zv=$v,Qv=Fv,Gv=Mv,Hv="pako deflate (from Nodeca project)",va={deflateInit:Uv,deflateInit2:jv,deflateReset:qv,deflateResetKeep:Bv,deflateSetHeader:Vv,deflate:zv,deflateEnd:Qv,deflateSetDictionary:Gv,deflateInfo:Hv},Wv=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),Kv=function(t){let e=Array.prototype.slice.call(arguments,1);for(;e.length;){let r=e.shift();if(!!r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(let n in r)Wv(r,n)&&(t[n]=r[n])}}return t},Zv=t=>{let e=0;for(let n=0,i=t.length;n<i;n++)e+=t[n].length;let r=new Uint8Array(e);for(let n=0,i=0,a=t.length;n<a;n++){let o=t[n];r.set(o,i),i+=o.length}return r},Os={assign:Kv,flattenChunks:Zv},zh=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){zh=!1}var Ia=new Uint8Array(256);for(let t=0;t<256;t++)Ia[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Ia[254]=Ia[254]=1;var Yv=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,r,n,i,a,o=t.length,s=0;for(i=0;i<o;i++)r=t.charCodeAt(i),(r&64512)===55296&&i+1<o&&(n=t.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Uint8Array(s),a=0,i=0;a<s;i++)r=t.charCodeAt(i),(r&64512)===55296&&i+1<o&&(n=t.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?e[a++]=r:r<2048?(e[a++]=192|r>>>6,e[a++]=128|r&63):r<65536?(e[a++]=224|r>>>12,e[a++]=128|r>>>6&63,e[a++]=128|r&63):(e[a++]=240|r>>>18,e[a++]=128|r>>>12&63,e[a++]=128|r>>>6&63,e[a++]=128|r&63);return e},Jv=(t,e)=>{if(e<65534&&t.subarray&&zh)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let r="";for(let n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r},Xv=(t,e)=>{let r=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let n,i,a=new Array(r*2);for(i=0,n=0;n<r;){let o=t[n++];if(o<128){a[i++]=o;continue}let s=Ia[o];if(s>4){a[i++]=65533,n+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&n<r;)o=o<<6|t[n++]&63,s--;if(s>1){a[i++]=65533;continue}o<65536?a[i++]=o:(o-=65536,a[i++]=55296|o>>10&1023,a[i++]=56320|o&1023)}return Jv(a,i)},e0=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let r=e-1;for(;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+Ia[t[r]]>e?r:e},Oa={string2buf:Yv,buf2string:Xv,utf8border:e0};function t0(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var Qh=t0,Gh=Object.prototype.toString,{Z_NO_FLUSH:r0,Z_SYNC_FLUSH:n0,Z_FULL_FLUSH:i0,Z_FINISH:a0,Z_OK:ys,Z_STREAM_END:o0,Z_DEFAULT_COMPRESSION:s0,Z_DEFAULT_STRATEGY:c0,Z_DEFLATED:u0}=Rn;function Fa(t){this.options=Os.assign({level:s0,method:u0,chunkSize:16384,windowBits:15,memLevel:8,strategy:c0},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Qh,this.strm.avail_out=0;let r=va.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==ys)throw new Error(xn[r]);if(e.header&&va.deflateSetHeader(this.strm,e.header),e.dictionary){let n;if(typeof e.dictionary=="string"?n=Oa.string2buf(e.dictionary):Gh.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,r=va.deflateSetDictionary(this.strm,n),r!==ys)throw new Error(xn[r]);this._dict_set=!0}}Fa.prototype.push=function(t,e){let r=this.strm,n=this.options.chunkSize,i,a;if(this.ended)return!1;for(e===~~e?a=e:a=e===!0?a0:r0,typeof t=="string"?r.input=Oa.string2buf(t):Gh.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){if(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(a===n0||a===i0)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(i=va.deflate(r,a),i===o0)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=va.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===ys;if(r.avail_out===0){this.onData(r.output);continue}if(a>0&&r.next_out>0){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(r.avail_in===0)break}return!0};Fa.prototype.onData=function(t){this.chunks.push(t)};Fa.prototype.onEnd=function(t){t===ys&&(this.result=Os.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function pl(t,e){let r=new Fa(e);if(r.push(t,!0),r.err)throw r.msg||xn[r.err];return r.result}function l0(t,e){return e=e||{},e.raw=!0,pl(t,e)}function f0(t,e){return e=e||{},e.gzip=!0,pl(t,e)}var p0=Fa,d0=pl,h0=l0,m0=f0,g0=Rn,y0={Deflate:p0,deflate:d0,deflateRaw:h0,gzip:m0,constants:g0},Uo=16209,v0=16191,b0=function t(e,r){let n,i,a,o,s,u,c,l,d,p,f,h,g,y,S,b,v,m,A,D,E,O,P,N,j=e.state;n=e.next_in,P=e.input,i=n+(e.avail_in-5),a=e.next_out,N=e.output,o=a-(r-e.avail_out),s=a+(e.avail_out-257),u=j.dmax,c=j.wsize,l=j.whave,d=j.wnext,p=j.window,f=j.hold,h=j.bits,g=j.lencode,y=j.distcode,S=(1<<j.lenbits)-1,b=(1<<j.distbits)-1;e:do{h<15&&(f+=P[n++]<<h,h+=8,f+=P[n++]<<h,h+=8),v=g[f&S];t:for(;;){if(m=v>>>24,f>>>=m,h-=m,m=v>>>16&255,m===0)N[a++]=v&65535;else if(m&16){A=v&65535,m&=15,m&&(h<m&&(f+=P[n++]<<h,h+=8),A+=f&(1<<m)-1,f>>>=m,h-=m),h<15&&(f+=P[n++]<<h,h+=8,f+=P[n++]<<h,h+=8),v=y[f&b];r:for(;;){if(m=v>>>24,f>>>=m,h-=m,m=v>>>16&255,m&16){if(D=v&65535,m&=15,h<m&&(f+=P[n++]<<h,h+=8,h<m&&(f+=P[n++]<<h,h+=8)),D+=f&(1<<m)-1,D>u){e.msg="invalid distance too far back",j.mode=Uo;break e}if(f>>>=m,h-=m,m=a-o,D>m){if(m=D-m,m>l&&j.sane){e.msg="invalid distance too far back",j.mode=Uo;break e}if(E=0,O=p,d===0){if(E+=c-m,m<A){A-=m;do N[a++]=p[E++];while(--m);E=a-D,O=N}}else if(d<m){if(E+=c+d-m,m-=d,m<A){A-=m;do N[a++]=p[E++];while(--m);if(E=0,d<A){m=d,A-=m;do N[a++]=p[E++];while(--m);E=a-D,O=N}}}else if(E+=d-m,m<A){A-=m;do N[a++]=p[E++];while(--m);E=a-D,O=N}for(;A>2;)N[a++]=O[E++],N[a++]=O[E++],N[a++]=O[E++],A-=3;A&&(N[a++]=O[E++],A>1&&(N[a++]=O[E++]))}else{E=a-D;do N[a++]=N[E++],N[a++]=N[E++],N[a++]=N[E++],A-=3;while(A>2);A&&(N[a++]=N[E++],A>1&&(N[a++]=N[E++]))}}else if((m&64)===0){v=y[(v&65535)+(f&(1<<m)-1)];continue r}else{e.msg="invalid distance code",j.mode=Uo;break e}break}}else if((m&64)===0){v=g[(v&65535)+(f&(1<<m)-1)];continue t}else if(m&32){j.mode=v0;break e}else{e.msg="invalid literal/length code",j.mode=Uo;break e}break}}while(n<i&&a<s);A=h>>3,n-=A,h-=A<<3,f&=(1<<h)-1,e.next_in=n,e.next_out=a,e.avail_in=n<i?5+(i-n):5-(n-i),e.avail_out=a<s?257+(s-a):257-(a-s),j.hold=f,j.bits=h},si=15,wd=852,Sd=592,Cd=0,Cu=1,Ed=2,_0=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),w0=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),S0=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),C0=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),E0=(t,e,r,n,i,a,o,s)=>{let u=s.bits,c=0,l=0,d=0,p=0,f=0,h=0,g=0,y=0,S=0,b=0,v,m,A,D,E,O=null,P,N=new Uint16Array(si+1),j=new Uint16Array(si+1),qe=null,Ne,q,de;for(c=0;c<=si;c++)N[c]=0;for(l=0;l<n;l++)N[e[r+l]]++;for(f=u,p=si;p>=1&&N[p]===0;p--);if(f>p&&(f=p),p===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,s.bits=1,0;for(d=1;d<p&&N[d]===0;d++);for(f<d&&(f=d),y=1,c=1;c<=si;c++)if(y<<=1,y-=N[c],y<0)return-1;if(y>0&&(t===Cd||p!==1))return-1;for(j[1]=0,c=1;c<si;c++)j[c+1]=j[c]+N[c];for(l=0;l<n;l++)e[r+l]!==0&&(o[j[e[r+l]]++]=l);if(t===Cd?(O=qe=o,P=20):t===Cu?(O=_0,qe=w0,P=257):(O=S0,qe=C0,P=0),b=0,l=0,c=d,E=a,h=f,g=0,A=-1,S=1<<f,D=S-1,t===Cu&&S>wd||t===Ed&&S>Sd)return 1;for(;;){Ne=c-g,o[l]+1<P?(q=0,de=o[l]):o[l]>=P?(q=qe[o[l]-P],de=O[o[l]-P]):(q=32+64,de=0),v=1<<c-g,m=1<<h,d=m;do m-=v,i[E+(b>>g)+m]=Ne<<24|q<<16|de|0;while(m!==0);for(v=1<<c-1;b&v;)v>>=1;if(v!==0?(b&=v-1,b+=v):b=0,l++,--N[c]===0){if(c===p)break;c=e[r+o[l]]}if(c>f&&(b&D)!==A){for(g===0&&(g=f),E+=d,h=c-g,y=1<<h;h+g<p&&(y-=N[h+g],!(y<=0));)h++,y<<=1;if(S+=1<<h,t===Cu&&S>wd||t===Ed&&S>Sd)return 1;A=b&D,i[A]=f<<24|h<<16|E-a|0}}return b!==0&&(i[E+b]=c-g<<24|64<<16|0),s.bits=f,0},ba=E0,x0=0,Hh=1,Wh=2,{Z_FINISH:xd,Z_BLOCK:k0,Z_TREES:jo,Z_OK:Tn,Z_STREAM_END:T0,Z_NEED_DICT:A0,Z_STREAM_ERROR:kt,Z_DATA_ERROR:Kh,Z_MEM_ERROR:Zh,Z_BUF_ERROR:I0,Z_DEFLATED:kd}=Rn,Ds=16180,Td=16181,Ad=16182,Id=16183,Od=16184,Dd=16185,Nd=16186,Rd=16187,Pd=16188,Ld=16189,vs=16190,ir=16191,Eu=16192,$d=16193,xu=16194,Fd=16195,Md=16196,Ud=16197,jd=16198,qo=16199,Bo=16200,qd=16201,Bd=16202,Vd=16203,zd=16204,Qd=16205,ku=16206,Gd=16207,Hd=16208,_e=16209,Yh=16210,Jh=16211,O0=852,D0=592,N0=15,R0=N0,Wd=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function P0(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var Pn=t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.mode<Ds||e.mode>Jh?1:0},Xh=t=>{if(Pn(t))return kt;let e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=Ds,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(O0),e.distcode=e.distdyn=new Int32Array(D0),e.sane=1,e.back=-1,Tn},e1=t=>{if(Pn(t))return kt;let e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,Xh(t)},t1=(t,e)=>{let r;if(Pn(t))return kt;let n=t.state;return e<0?(r=0,e=-e):(r=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?kt:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,e1(t))},r1=(t,e)=>{if(!t)return kt;let r=new P0;t.state=r,r.strm=t,r.window=null,r.mode=Ds;let n=t1(t,e);return n!==Tn&&(t.state=null),n},L0=t=>r1(t,R0),Kd=!0,Tu,Au,$0=t=>{if(Kd){Tu=new Int32Array(512),Au=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(ba(Hh,t.lens,0,288,Tu,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;ba(Wh,t.lens,0,32,Au,0,t.work,{bits:5}),Kd=!1}t.lencode=Tu,t.lenbits=9,t.distcode=Au,t.distbits=5},n1=(t,e,r,n)=>{let i,a=t.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),n>=a.wsize?(a.window.set(e.subarray(r-a.wsize,r),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>n&&(i=n),a.window.set(e.subarray(r-n,r-n+i),a.wnext),n-=i,n?(a.window.set(e.subarray(r-n,r),0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},F0=(t,e)=>{let r,n,i,a,o,s,u,c,l,d,p,f,h,g,y=0,S,b,v,m,A,D,E,O,P=new Uint8Array(4),N,j,qe=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Pn(t)||!t.output||!t.input&&t.avail_in!==0)return kt;r=t.state,r.mode===ir&&(r.mode=Eu),o=t.next_out,i=t.output,u=t.avail_out,a=t.next_in,n=t.input,s=t.avail_in,c=r.hold,l=r.bits,d=s,p=u,O=Tn;e:for(;;)switch(r.mode){case Ds:if(r.wrap===0){r.mode=Eu;break}for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.wrap&2&&c===35615){r.wbits===0&&(r.wbits=15),r.check=0,P[0]=c&255,P[1]=c>>>8&255,r.check=je(r.check,P,2,0),c=0,l=0,r.mode=Td;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=_e;break}if((c&15)!==kd){t.msg="unknown compression method",r.mode=_e;break}if(c>>>=4,l-=4,E=(c&15)+8,r.wbits===0&&(r.wbits=E),E>15||E>r.wbits){t.msg="invalid window size",r.mode=_e;break}r.dmax=1<<r.wbits,r.flags=0,t.adler=r.check=1,r.mode=c&512?Ld:ir,c=0,l=0;break;case Td:for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.flags=c,(r.flags&255)!==kd){t.msg="unknown compression method",r.mode=_e;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=_e;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&r.wrap&4&&(P[0]=c&255,P[1]=c>>>8&255,r.check=je(r.check,P,2,0)),c=0,l=0,r.mode=Ad;case Ad:for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.head&&(r.head.time=c),r.flags&512&&r.wrap&4&&(P[0]=c&255,P[1]=c>>>8&255,P[2]=c>>>16&255,P[3]=c>>>24&255,r.check=je(r.check,P,4,0)),c=0,l=0,r.mode=Id;case Id:for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&r.wrap&4&&(P[0]=c&255,P[1]=c>>>8&255,r.check=je(r.check,P,2,0)),c=0,l=0,r.mode=Od;case Od:if(r.flags&1024){for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&r.wrap&4&&(P[0]=c&255,P[1]=c>>>8&255,r.check=je(r.check,P,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=Dd;case Dd:if(r.flags&1024&&(f=r.length,f>s&&(f=s),f&&(r.head&&(E=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(a,a+f),E)),r.flags&512&&r.wrap&4&&(r.check=je(r.check,n,f,a)),s-=f,a+=f,r.length-=f),r.length))break e;r.length=0,r.mode=Nd;case Nd:if(r.flags&2048){if(s===0)break e;f=0;do E=n[a+f++],r.head&&E&&r.length<65536&&(r.head.name+=String.fromCharCode(E));while(E&&f<s);if(r.flags&512&&r.wrap&4&&(r.check=je(r.check,n,f,a)),s-=f,a+=f,E)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=Rd;case Rd:if(r.flags&4096){if(s===0)break e;f=0;do E=n[a+f++],r.head&&E&&r.length<65536&&(r.head.comment+=String.fromCharCode(E));while(E&&f<s);if(r.flags&512&&r.wrap&4&&(r.check=je(r.check,n,f,a)),s-=f,a+=f,E)break e}else r.head&&(r.head.comment=null);r.mode=Pd;case Pd:if(r.flags&512){for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.wrap&4&&c!==(r.check&65535)){t.msg="header crc mismatch",r.mode=_e;break}c=0,l=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=ir;break;case Ld:for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}t.adler=r.check=Wd(c),c=0,l=0,r.mode=vs;case vs:if(r.havedict===0)return t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,A0;t.adler=r.check=1,r.mode=ir;case ir:if(e===k0||e===jo)break e;case Eu:if(r.last){c>>>=l&7,l-=l&7,r.mode=ku;break}for(;l<3;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}switch(r.last=c&1,c>>>=1,l-=1,c&3){case 0:r.mode=$d;break;case 1:if($0(r),r.mode=qo,e===jo){c>>>=2,l-=2;break e}break;case 2:r.mode=Md;break;case 3:t.msg="invalid block type",r.mode=_e}c>>>=2,l-=2;break;case $d:for(c>>>=l&7,l-=l&7;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if((c&65535)!==(c>>>16^65535)){t.msg="invalid stored block lengths",r.mode=_e;break}if(r.length=c&65535,c=0,l=0,r.mode=xu,e===jo)break e;case xu:r.mode=Fd;case Fd:if(f=r.length,f){if(f>s&&(f=s),f>u&&(f=u),f===0)break e;i.set(n.subarray(a,a+f),o),s-=f,a+=f,u-=f,o+=f,r.length-=f;break}r.mode=ir;break;case Md:for(;l<14;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.nlen=(c&31)+257,c>>>=5,l-=5,r.ndist=(c&31)+1,c>>>=5,l-=5,r.ncode=(c&15)+4,c>>>=4,l-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=_e;break}r.have=0,r.mode=Ud;case Ud:for(;r.have<r.ncode;){for(;l<3;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.lens[qe[r.have++]]=c&7,c>>>=3,l-=3}for(;r.have<19;)r.lens[qe[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,N={bits:r.lenbits},O=ba(x0,r.lens,0,19,r.lencode,0,r.work,N),r.lenbits=N.bits,O){t.msg="invalid code lengths set",r.mode=_e;break}r.have=0,r.mode=jd;case jd:for(;r.have<r.nlen+r.ndist;){for(;y=r.lencode[c&(1<<r.lenbits)-1],S=y>>>24,b=y>>>16&255,v=y&65535,!(S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(v<16)c>>>=S,l-=S,r.lens[r.have++]=v;else{if(v===16){for(j=S+2;l<j;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(c>>>=S,l-=S,r.have===0){t.msg="invalid bit length repeat",r.mode=_e;break}E=r.lens[r.have-1],f=3+(c&3),c>>>=2,l-=2}else if(v===17){for(j=S+3;l<j;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=S,l-=S,E=0,f=3+(c&7),c>>>=3,l-=3}else{for(j=S+7;l<j;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=S,l-=S,E=0,f=11+(c&127),c>>>=7,l-=7}if(r.have+f>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=_e;break}for(;f--;)r.lens[r.have++]=E}}if(r.mode===_e)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=_e;break}if(r.lenbits=9,N={bits:r.lenbits},O=ba(Hh,r.lens,0,r.nlen,r.lencode,0,r.work,N),r.lenbits=N.bits,O){t.msg="invalid literal/lengths set",r.mode=_e;break}if(r.distbits=6,r.distcode=r.distdyn,N={bits:r.distbits},O=ba(Wh,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,N),r.distbits=N.bits,O){t.msg="invalid distances set",r.mode=_e;break}if(r.mode=qo,e===jo)break e;case qo:r.mode=Bo;case Bo:if(s>=6&&u>=258){t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,b0(t,p),o=t.next_out,i=t.output,u=t.avail_out,a=t.next_in,n=t.input,s=t.avail_in,c=r.hold,l=r.bits,r.mode===ir&&(r.back=-1);break}for(r.back=0;y=r.lencode[c&(1<<r.lenbits)-1],S=y>>>24,b=y>>>16&255,v=y&65535,!(S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(b&&(b&240)===0){for(m=S,A=b,D=v;y=r.lencode[D+((c&(1<<m+A)-1)>>m)],S=y>>>24,b=y>>>16&255,v=y&65535,!(m+S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=m,l-=m,r.back+=m}if(c>>>=S,l-=S,r.back+=S,r.length=v,b===0){r.mode=Qd;break}if(b&32){r.back=-1,r.mode=ir;break}if(b&64){t.msg="invalid literal/length code",r.mode=_e;break}r.extra=b&15,r.mode=qd;case qd:if(r.extra){for(j=r.extra;l<j;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=Bd;case Bd:for(;y=r.distcode[c&(1<<r.distbits)-1],S=y>>>24,b=y>>>16&255,v=y&65535,!(S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if((b&240)===0){for(m=S,A=b,D=v;y=r.distcode[D+((c&(1<<m+A)-1)>>m)],S=y>>>24,b=y>>>16&255,v=y&65535,!(m+S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=m,l-=m,r.back+=m}if(c>>>=S,l-=S,r.back+=S,b&64){t.msg="invalid distance code",r.mode=_e;break}r.offset=v,r.extra=b&15,r.mode=Vd;case Vd:if(r.extra){for(j=r.extra;l<j;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=_e;break}r.mode=zd;case zd:if(u===0)break e;if(f=p-u,r.offset>f){if(f=r.offset-f,f>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=_e;break}f>r.wnext?(f-=r.wnext,h=r.wsize-f):h=r.wnext-f,f>r.length&&(f=r.length),g=r.window}else g=i,h=o-r.offset,f=r.length;f>u&&(f=u),u-=f,r.length-=f;do i[o++]=g[h++];while(--f);r.length===0&&(r.mode=Bo);break;case Qd:if(u===0)break e;i[o++]=r.length,u--,r.mode=Bo;break;case ku:if(r.wrap){for(;l<32;){if(s===0)break e;s--,c|=n[a++]<<l,l+=8}if(p-=u,t.total_out+=p,r.total+=p,r.wrap&4&&p&&(t.adler=r.check=r.flags?je(r.check,i,p,o-p):Aa(r.check,i,p,o-p)),p=u,r.wrap&4&&(r.flags?c:Wd(c))!==r.check){t.msg="incorrect data check",r.mode=_e;break}c=0,l=0}r.mode=Gd;case Gd:if(r.wrap&&r.flags){for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.wrap&4&&c!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=_e;break}c=0,l=0}r.mode=Hd;case Hd:O=T0;break e;case _e:O=Kh;break e;case Yh:return Zh;case Jh:default:return kt}return t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,(r.wsize||p!==t.avail_out&&r.mode<_e&&(r.mode<ku||e!==xd))&&n1(t,t.output,t.next_out,p-t.avail_out),d-=t.avail_in,p-=t.avail_out,t.total_in+=d,t.total_out+=p,r.total+=p,r.wrap&4&&p&&(t.adler=r.check=r.flags?je(r.check,i,p,t.next_out-p):Aa(r.check,i,p,t.next_out-p)),t.data_type=r.bits+(r.last?64:0)+(r.mode===ir?128:0)+(r.mode===qo||r.mode===xu?256:0),(d===0&&p===0||e===xd)&&O===Tn&&(O=I0),O},M0=t=>{if(Pn(t))return kt;let e=t.state;return e.window&&(e.window=null),t.state=null,Tn},U0=(t,e)=>{if(Pn(t))return kt;let r=t.state;return(r.wrap&2)===0?kt:(r.head=e,e.done=!1,Tn)},j0=(t,e)=>{let r=e.length,n,i,a;return Pn(t)||(n=t.state,n.wrap!==0&&n.mode!==vs)?kt:n.mode===vs&&(i=1,i=Aa(i,e,r,0),i!==n.check)?Kh:(a=n1(t,e,r,r),a?(n.mode=Yh,Zh):(n.havedict=1,Tn))},q0=e1,B0=t1,V0=Xh,z0=L0,Q0=r1,G0=F0,H0=M0,W0=U0,K0=j0,Z0="pako inflate (from Nodeca project)",cr={inflateReset:q0,inflateReset2:B0,inflateResetKeep:V0,inflateInit:z0,inflateInit2:Q0,inflate:G0,inflateEnd:H0,inflateGetHeader:W0,inflateSetDictionary:K0,inflateInfo:Z0};function Y0(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var J0=Y0,i1=Object.prototype.toString,{Z_NO_FLUSH:X0,Z_FINISH:e2,Z_OK:Da,Z_STREAM_END:Iu,Z_NEED_DICT:Ou,Z_STREAM_ERROR:t2,Z_DATA_ERROR:Zd,Z_MEM_ERROR:r2}=Rn;function Ma(t){this.options=Os.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});let e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15)===0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Qh,this.strm.avail_out=0;let r=cr.inflateInit2(this.strm,e.windowBits);if(r!==Da)throw new Error(xn[r]);if(this.header=new J0,cr.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Oa.string2buf(e.dictionary):i1.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=cr.inflateSetDictionary(this.strm,e.dictionary),r!==Da)))throw new Error(xn[r])}Ma.prototype.push=function(t,e){let r=this.strm,n=this.options.chunkSize,i=this.options.dictionary,a,o,s;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?e2:X0,i1.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),a=cr.inflate(r,o),a===Ou&&i&&(a=cr.inflateSetDictionary(r,i),a===Da?a=cr.inflate(r,o):a===Zd&&(a=Ou));r.avail_in>0&&a===Iu&&r.state.wrap>0&&t[r.next_in]!==0;)cr.inflateReset(r),a=cr.inflate(r,o);switch(a){case t2:case Zd:case Ou:case r2:return this.onEnd(a),this.ended=!0,!1}if(s=r.avail_out,r.next_out&&(r.avail_out===0||a===Iu))if(this.options.to==="string"){let u=Oa.utf8border(r.output,r.next_out),c=r.next_out-u,l=Oa.buf2string(r.output,u);r.next_out=c,r.avail_out=n-c,c&&r.output.set(r.output.subarray(u,u+c),0),this.onData(l)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(!(a===Da&&s===0)){if(a===Iu)return a=cr.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};Ma.prototype.onData=function(t){this.chunks.push(t)};Ma.prototype.onEnd=function(t){t===Da&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Os.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function dl(t,e){let r=new Ma(e);if(r.push(t),r.err)throw r.msg||xn[r.err];return r.result}function n2(t,e){return e=e||{},e.raw=!0,dl(t,e)}var i2=Ma,a2=dl,o2=n2,s2=dl,c2=Rn,u2={Inflate:i2,inflate:a2,inflateRaw:o2,ungzip:s2,constants:c2},{Deflate:l2,deflate:f2,deflateRaw:p2,gzip:d2}=y0,{Inflate:h2,inflate:m2,inflateRaw:g2,ungzip:y2}=u2,v2=l2,b2=f2,_2=p2,w2=d2,S2=h2,C2=m2,E2=g2,x2=y2,k2=Rn,T2={Deflate:v2,deflate:b2,deflateRaw:_2,gzip:w2,Inflate:S2,inflate:C2,inflateRaw:E2,ungzip:x2,constants:k2},ge=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},ye=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},bs=class{constructor(e,r){this.input=e,this.output=r}};ge([w(),ye("design:type",String)],bs.prototype,"input",void 0);ge([w(),ye("design:type",String)],bs.prototype,"output",void 0);bs=ge([He(),ye("design:paramtypes",[String,String])],bs);var _s=class{constructor(e,r){this.input=e,this.output=r}};ge([w(),ye("design:type",String)],_s.prototype,"input",void 0);ge([w(),ye("design:type",String)],_s.prototype,"output",void 0);_s=ge([Z(),ye("design:paramtypes",[String,String])],_s);var jr=class{constructor(e,r,n,i,a){this.name=e,this.modelId=r,this.systemPrompt=n,this.promptExamples=i,this.metaData=a}};ge([w(),ye("design:type",String)],jr.prototype,"name",void 0);ge([w(),ye("design:type",String)],jr.prototype,"modelId",void 0);ge([w(),ye("design:type",String)],jr.prototype,"systemPrompt",void 0);ge([w(),ye("design:type",Array)],jr.prototype,"promptExamples",void 0);ge([w(),ye("design:type",String)],jr.prototype,"metaData",void 0);jr=ge([He(),ye("design:paramtypes",[String,String,String,Array,String])],jr);var Zt=class{constructor(e,r,n,i,a,o,s,u){this.name=e,this.modelId=r,this.taskId=n,this.systemPrompt=i,this.promptExamples=a,this.metaData=o,this.createdAt=s,this.updatedAt=u}};ge([w(),ye("design:type",String)],Zt.prototype,"name",void 0);ge([w(),ye("design:type",String)],Zt.prototype,"modelId",void 0);ge([w(),ye("design:type",String)],Zt.prototype,"taskId",void 0);ge([w(),ye("design:type",String)],Zt.prototype,"systemPrompt",void 0);ge([w(),ye("design:type",Array)],Zt.prototype,"promptExamples",void 0);ge([w(),ye("design:type",String)],Zt.prototype,"metaData",void 0);ge([w(),ye("design:type",String)],Zt.prototype,"createdAt",void 0);ge([w(),ye("design:type",String)],Zt.prototype,"updatedAt",void 0);Zt=ge([Z(),ye("design:paramtypes",[String,String,String,String,Array,String,String,String])],Zt);var An=class{constructor(e,r,n,i,a){this.model=e,this.status=r,this.progress=n,this.downloaded=i,this.loaded=a}};ge([w(),ye("design:type",String)],An.prototype,"model",void 0);ge([w(),ye("design:type",String)],An.prototype,"status",void 0);ge([w(),ye("design:type",Number)],An.prototype,"progress",void 0);ge([w(),ye("design:type",Boolean)],An.prototype,"downloaded",void 0);ge([w(),ye("design:type",Boolean)],An.prototype,"loaded",void 0);An=ge([Z(),ye("design:paramtypes",[String,String,Number,Boolean,Boolean])],An);var A2=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Fe=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Le,es,el=class{constructor(e,r=!0){Le.set(this,void 0),es.set(this,new Map),A2(this,Le,e,"f")}async getModels(){let e=await Fe(this,Le,"f").query({query:C`
|
|
650
|
+
}`,variables:{url:e,interactionCall:r}}));return n}};or=new WeakMap;var As={};As.byteLength=Ey;As.toByteArray=ky;As.fromByteArray=Iy;var Qt=[],Ct=[],Cy=typeof Uint8Array<"u"?Uint8Array:Array,gu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(sn=0,ld=gu.length;sn<ld;++sn)Qt[sn]=gu[sn],Ct[gu.charCodeAt(sn)]=sn;var sn,ld;Ct["-".charCodeAt(0)]=62;Ct["_".charCodeAt(0)]=63;function Ch(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function Ey(t){var e=Ch(t),r=e[0],n=e[1];return(r+n)*3/4-n}function xy(t,e,r){return(e+r)*3/4-r}function ky(t){var e,r=Ch(t),n=r[0],i=r[1],a=new Cy(xy(t,n,i)),o=0,s=i>0?n-4:n,u;for(u=0;u<s;u+=4)e=Ct[t.charCodeAt(u)]<<18|Ct[t.charCodeAt(u+1)]<<12|Ct[t.charCodeAt(u+2)]<<6|Ct[t.charCodeAt(u+3)],a[o++]=e>>16&255,a[o++]=e>>8&255,a[o++]=e&255;return i===2&&(e=Ct[t.charCodeAt(u)]<<2|Ct[t.charCodeAt(u+1)]>>4,a[o++]=e&255),i===1&&(e=Ct[t.charCodeAt(u)]<<10|Ct[t.charCodeAt(u+1)]<<4|Ct[t.charCodeAt(u+2)]>>2,a[o++]=e>>8&255,a[o++]=e&255),a}function Ty(t){return Qt[t>>18&63]+Qt[t>>12&63]+Qt[t>>6&63]+Qt[t&63]}function Ay(t,e,r){for(var n,i=[],a=e;a<r;a+=3)n=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(t[a+2]&255),i.push(Ty(n));return i.join("")}function Iy(t){for(var e,r=t.length,n=r%3,i=[],a=16383,o=0,s=r-n;o<s;o+=a)i.push(Ay(t,o,o+a>s?s:o+a));return n===1?(e=t[r-1],i.push(Qt[e>>2]+Qt[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Qt[e>>10]+Qt[e>>4&63]+Qt[e<<2&63]+"=")),i.join("")}var Oy=4,fd=0,pd=1,Dy=2;function bi(t){let e=t.length;for(;--e>=0;)t[e]=0}var Ny=0,Eh=1,Ry=2,Py=3,Ly=258,sl=29,La=256,Ea=La+1+sl,li=30,cl=19,xh=2*Ea+1,gn=15,yu=16,$y=7,ul=256,kh=16,Th=17,Ah=18,Qu=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Xo=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Fy=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Ih=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),My=512,sr=new Array((Ea+2)*2);bi(sr);var ya=new Array(li*2);bi(ya);var xa=new Array(My);bi(xa);var ka=new Array(Ly-Py+1);bi(ka);var ll=new Array(sl);bi(ll);var gs=new Array(li);bi(gs);function vu(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}var Oh,Dh,Nh;function bu(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}var Rh=t=>t<256?xa[t]:xa[256+(t>>>7)],Ta=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},ut=(t,e,r)=>{t.bi_valid>yu-r?(t.bi_buf|=e<<t.bi_valid&65535,Ta(t,t.bi_buf),t.bi_buf=e>>yu-t.bi_valid,t.bi_valid+=r-yu):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)},Gt=(t,e,r)=>{ut(t,r[e*2],r[e*2+1])},Ph=(t,e)=>{let r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1},Uy=t=>{t.bi_valid===16?(Ta(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)},jy=(t,e)=>{let r=e.dyn_tree,n=e.max_code,i=e.stat_desc.static_tree,a=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,s=e.stat_desc.extra_base,u=e.stat_desc.max_length,c,l,d,p,f,h,g=0;for(p=0;p<=gn;p++)t.bl_count[p]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<xh;c++)l=t.heap[c],p=r[r[l*2+1]*2+1]+1,p>u&&(p=u,g++),r[l*2+1]=p,!(l>n)&&(t.bl_count[p]++,f=0,l>=s&&(f=o[l-s]),h=r[l*2],t.opt_len+=h*(p+f),a&&(t.static_len+=h*(i[l*2+1]+f)));if(g!==0){do{for(p=u-1;t.bl_count[p]===0;)p--;t.bl_count[p]--,t.bl_count[p+1]+=2,t.bl_count[u]--,g-=2}while(g>0);for(p=u;p!==0;p--)for(l=t.bl_count[p];l!==0;)d=t.heap[--c],!(d>n)&&(r[d*2+1]!==p&&(t.opt_len+=(p-r[d*2+1])*r[d*2],r[d*2+1]=p),l--)}},Lh=(t,e,r)=>{let n=new Array(gn+1),i=0,a,o;for(a=1;a<=gn;a++)i=i+r[a-1]<<1,n[a]=i;for(o=0;o<=e;o++){let s=t[o*2+1];s!==0&&(t[o*2]=Ph(n[s]++,s))}},qy=()=>{let t,e,r,n,i,a=new Array(gn+1);for(r=0,n=0;n<sl-1;n++)for(ll[n]=r,t=0;t<1<<Qu[n];t++)ka[r++]=n;for(ka[r-1]=n,i=0,n=0;n<16;n++)for(gs[n]=i,t=0;t<1<<Xo[n];t++)xa[i++]=n;for(i>>=7;n<li;n++)for(gs[n]=i<<7,t=0;t<1<<Xo[n]-7;t++)xa[256+i++]=n;for(e=0;e<=gn;e++)a[e]=0;for(t=0;t<=143;)sr[t*2+1]=8,t++,a[8]++;for(;t<=255;)sr[t*2+1]=9,t++,a[9]++;for(;t<=279;)sr[t*2+1]=7,t++,a[7]++;for(;t<=287;)sr[t*2+1]=8,t++,a[8]++;for(Lh(sr,Ea+1,a),t=0;t<li;t++)ya[t*2+1]=5,ya[t*2]=Ph(t,5);Oh=new vu(sr,Qu,La+1,Ea,gn),Dh=new vu(ya,Xo,0,li,gn),Nh=new vu(new Array(0),Fy,0,cl,$y)},$h=t=>{let e;for(e=0;e<Ea;e++)t.dyn_ltree[e*2]=0;for(e=0;e<li;e++)t.dyn_dtree[e*2]=0;for(e=0;e<cl;e++)t.bl_tree[e*2]=0;t.dyn_ltree[ul*2]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},Fh=t=>{t.bi_valid>8?Ta(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},dd=(t,e,r,n)=>{let i=e*2,a=r*2;return t[i]<t[a]||t[i]===t[a]&&n[e]<=n[r]},_u=(t,e,r)=>{let n=t.heap[r],i=r<<1;for(;i<=t.heap_len&&(i<t.heap_len&&dd(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!dd(e,n,t.heap[i],t.depth));)t.heap[r]=t.heap[i],r=i,i<<=1;t.heap[r]=n},hd=(t,e,r)=>{let n,i,a=0,o,s;if(t.sym_next!==0)do n=t.pending_buf[t.sym_buf+a++]&255,n+=(t.pending_buf[t.sym_buf+a++]&255)<<8,i=t.pending_buf[t.sym_buf+a++],n===0?Gt(t,i,e):(o=ka[i],Gt(t,o+La+1,e),s=Qu[o],s!==0&&(i-=ll[o],ut(t,i,s)),n--,o=Rh(n),Gt(t,o,r),s=Xo[o],s!==0&&(n-=gs[o],ut(t,n,s)));while(a<t.sym_next);Gt(t,ul,e)},Gu=(t,e)=>{let r=e.dyn_tree,n=e.stat_desc.static_tree,i=e.stat_desc.has_stree,a=e.stat_desc.elems,o,s,u=-1,c;for(t.heap_len=0,t.heap_max=xh,o=0;o<a;o++)r[o*2]!==0?(t.heap[++t.heap_len]=u=o,t.depth[o]=0):r[o*2+1]=0;for(;t.heap_len<2;)c=t.heap[++t.heap_len]=u<2?++u:0,r[c*2]=1,t.depth[c]=0,t.opt_len--,i&&(t.static_len-=n[c*2+1]);for(e.max_code=u,o=t.heap_len>>1;o>=1;o--)_u(t,r,o);c=a;do o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],_u(t,r,1),s=t.heap[1],t.heap[--t.heap_max]=o,t.heap[--t.heap_max]=s,r[c*2]=r[o*2]+r[s*2],t.depth[c]=(t.depth[o]>=t.depth[s]?t.depth[o]:t.depth[s])+1,r[o*2+1]=r[s*2+1]=c,t.heap[1]=c++,_u(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],jy(t,e),Lh(r,u,t.bl_count)},md=(t,e,r)=>{let n,i=-1,a,o=e[0*2+1],s=0,u=7,c=4;for(o===0&&(u=138,c=3),e[(r+1)*2+1]=65535,n=0;n<=r;n++)a=o,o=e[(n+1)*2+1],!(++s<u&&a===o)&&(s<c?t.bl_tree[a*2]+=s:a!==0?(a!==i&&t.bl_tree[a*2]++,t.bl_tree[kh*2]++):s<=10?t.bl_tree[Th*2]++:t.bl_tree[Ah*2]++,s=0,i=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4))},gd=(t,e,r)=>{let n,i=-1,a,o=e[0*2+1],s=0,u=7,c=4;for(o===0&&(u=138,c=3),n=0;n<=r;n++)if(a=o,o=e[(n+1)*2+1],!(++s<u&&a===o)){if(s<c)do Gt(t,a,t.bl_tree);while(--s!==0);else a!==0?(a!==i&&(Gt(t,a,t.bl_tree),s--),Gt(t,kh,t.bl_tree),ut(t,s-3,2)):s<=10?(Gt(t,Th,t.bl_tree),ut(t,s-3,3)):(Gt(t,Ah,t.bl_tree),ut(t,s-11,7));s=0,i=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4)}},By=t=>{let e;for(md(t,t.dyn_ltree,t.l_desc.max_code),md(t,t.dyn_dtree,t.d_desc.max_code),Gu(t,t.bl_desc),e=cl-1;e>=3&&t.bl_tree[Ih[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},Vy=(t,e,r,n)=>{let i;for(ut(t,e-257,5),ut(t,r-1,5),ut(t,n-4,4),i=0;i<n;i++)ut(t,t.bl_tree[Ih[i]*2+1],3);gd(t,t.dyn_ltree,e-1),gd(t,t.dyn_dtree,r-1)},zy=t=>{let e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return fd;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return pd;for(r=32;r<La;r++)if(t.dyn_ltree[r*2]!==0)return pd;return fd},yd=!1,Qy=t=>{yd||(qy(),yd=!0),t.l_desc=new bu(t.dyn_ltree,Oh),t.d_desc=new bu(t.dyn_dtree,Dh),t.bl_desc=new bu(t.bl_tree,Nh),t.bi_buf=0,t.bi_valid=0,$h(t)},Mh=(t,e,r,n)=>{ut(t,(Ny<<1)+(n?1:0),3),Fh(t),Ta(t,r),Ta(t,~r),r&&t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r},Gy=t=>{ut(t,Eh<<1,3),Gt(t,ul,sr),Uy(t)},Hy=(t,e,r,n)=>{let i,a,o=0;t.level>0?(t.strm.data_type===Dy&&(t.strm.data_type=zy(t)),Gu(t,t.l_desc),Gu(t,t.d_desc),o=By(t),i=t.opt_len+3+7>>>3,a=t.static_len+3+7>>>3,a<=i&&(i=a)):i=a=r+5,r+4<=i&&e!==-1?Mh(t,e,r,n):t.strategy===Oy||a===i?(ut(t,(Eh<<1)+(n?1:0),3),hd(t,sr,ya)):(ut(t,(Ry<<1)+(n?1:0),3),Vy(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),hd(t,t.dyn_ltree,t.dyn_dtree)),$h(t),n&&Fh(t)},Wy=(t,e,r)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=r,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(ka[r]+La+1)*2]++,t.dyn_dtree[Rh(e)*2]++),t.sym_next===t.sym_end),Ky=Qy,Zy=Mh,Yy=Hy,Jy=Wy,Xy=Gy,ev={_tr_init:Ky,_tr_stored_block:Zy,_tr_flush_block:Yy,_tr_tally:Jy,_tr_align:Xy},tv=(t,e,r,n)=>{let i=t&65535|0,a=t>>>16&65535|0,o=0;for(;r!==0;){o=r>2e3?2e3:r,r-=o;do i=i+e[n++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0},Aa=tv,rv=()=>{let t,e=[];for(var r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e},nv=new Uint32Array(rv()),iv=(t,e,r,n)=>{let i=nv,a=n+r;t^=-1;for(let o=n;o<a;o++)t=t>>>8^i[(t^e[o])&255];return t^-1},je=iv,xn={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Rn={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},{_tr_init:av,_tr_stored_block:Hu,_tr_flush_block:ov,_tr_tally:Nr,_tr_align:sv}=ev,{Z_NO_FLUSH:Rr,Z_PARTIAL_FLUSH:cv,Z_FULL_FLUSH:uv,Z_FINISH:xt,Z_BLOCK:vd,Z_OK:Ge,Z_STREAM_END:bd,Z_STREAM_ERROR:Wt,Z_DATA_ERROR:lv,Z_BUF_ERROR:wu,Z_DEFAULT_COMPRESSION:fv,Z_FILTERED:pv,Z_HUFFMAN_ONLY:Mo,Z_RLE:dv,Z_FIXED:hv,Z_DEFAULT_STRATEGY:mv,Z_UNKNOWN:gv,Z_DEFLATED:Is}=Rn,yv=9,vv=15,bv=8,_v=29,wv=256,Wu=wv+1+_v,Sv=30,Cv=19,Ev=2*Wu+1,xv=15,Y=3,Ir=258,Kt=Ir+Y+1,kv=32,hi=42,fl=57,Ku=69,Zu=73,Yu=91,Ju=103,yn=113,fa=666,rt=1,_i=2,kn=3,wi=4,Tv=3,vn=(t,e)=>(t.msg=xn[e],e),_d=t=>t*2-(t>4?9:0),Ar=t=>{let e=t.length;for(;--e>=0;)t[e]=0},Av=t=>{let e,r,n,i=t.w_size;e=t.hash_size,n=e;do r=t.head[--n],t.head[n]=r>=i?r-i:0;while(--e);e=i,n=e;do r=t.prev[--n],t.prev[n]=r>=i?r-i:0;while(--e)},Iv=(t,e,r)=>(e<<t.hash_shift^r)&t.hash_mask,Pr=Iv,mt=t=>{let e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))},yt=(t,e)=>{ov(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,mt(t.strm)},ae=(t,e)=>{t.pending_buf[t.pending++]=e},Ji=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},Xu=(t,e,r,n)=>{let i=t.avail_in;return i>n&&(i=n),i===0?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),r),t.state.wrap===1?t.adler=Aa(t.adler,e,i,r):t.state.wrap===2&&(t.adler=je(t.adler,e,i,r)),t.next_in+=i,t.total_in+=i,i)},Uh=(t,e)=>{let r=t.max_chain_length,n=t.strstart,i,a,o=t.prev_length,s=t.nice_match,u=t.strstart>t.w_size-Kt?t.strstart-(t.w_size-Kt):0,c=t.window,l=t.w_mask,d=t.prev,p=t.strstart+Ir,f=c[n+o-1],h=c[n+o];t.prev_length>=t.good_match&&(r>>=2),s>t.lookahead&&(s=t.lookahead);do if(i=e,!(c[i+o]!==h||c[i+o-1]!==f||c[i]!==c[n]||c[++i]!==c[n+1])){n+=2,i++;do;while(c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&n<p);if(a=Ir-(p-n),n=p-Ir,a>o){if(t.match_start=e,o=a,a>=s)break;f=c[n+o-1],h=c[n+o]}}while((e=d[e&l])>u&&--r!==0);return o<=t.lookahead?o:t.lookahead},mi=t=>{let e=t.w_size,r,n,i;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Kt)&&(t.window.set(t.window.subarray(e,e+e-n),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),Av(t),n+=e),t.strm.avail_in===0)break;if(r=Xu(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=r,t.lookahead+t.insert>=Y)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=Pr(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=Pr(t,t.ins_h,t.window[i+Y-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<Y)););}while(t.lookahead<Kt&&t.strm.avail_in!==0)},jh=(t,e)=>{let r=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,n,i,a,o=0,s=t.strm.avail_in;do{if(n=65535,a=t.bi_valid+42>>3,t.strm.avail_out<a||(a=t.strm.avail_out-a,i=t.strstart-t.block_start,n>i+t.strm.avail_in&&(n=i+t.strm.avail_in),n>a&&(n=a),n<r&&(n===0&&e!==xt||e===Rr||n!==i+t.strm.avail_in)))break;o=e===xt&&n===i+t.strm.avail_in?1:0,Hu(t,0,0,o),t.pending_buf[t.pending-4]=n,t.pending_buf[t.pending-3]=n>>8,t.pending_buf[t.pending-2]=~n,t.pending_buf[t.pending-1]=~n>>8,mt(t.strm),i&&(i>n&&(i=n),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,n-=i),n&&(Xu(t.strm,t.strm.output,t.strm.next_out,n),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n)}while(o===0);return s-=t.strm.avail_in,s&&(s>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=s&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-s,t.strm.next_in),t.strstart),t.strstart+=s,t.insert+=s>t.w_size-t.insert?t.w_size-t.insert:s),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),o?wi:e!==Rr&&e!==xt&&t.strm.avail_in===0&&t.strstart===t.block_start?_i:(a=t.window_size-t.strstart,t.strm.avail_in>a&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,a+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),a>t.strm.avail_in&&(a=t.strm.avail_in),a&&(Xu(t.strm,t.window,t.strstart,a),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.high_water<t.strstart&&(t.high_water=t.strstart),a=t.bi_valid+42>>3,a=t.pending_buf_size-a>65535?65535:t.pending_buf_size-a,r=a>t.w_size?t.w_size:a,i=t.strstart-t.block_start,(i>=r||(i||e===xt)&&e!==Rr&&t.strm.avail_in===0&&i<=a)&&(n=i>a?a:i,o=e===xt&&t.strm.avail_in===0&&n===i?1:0,Hu(t,t.block_start,n,o),t.block_start+=n,mt(t.strm)),o?kn:rt)},Su=(t,e)=>{let r,n;for(;;){if(t.lookahead<Kt){if(mi(t),t.lookahead<Kt&&e===Rr)return rt;if(t.lookahead===0)break}if(r=0,t.lookahead>=Y&&(t.ins_h=Pr(t,t.ins_h,t.window[t.strstart+Y-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),r!==0&&t.strstart-r<=t.w_size-Kt&&(t.match_length=Uh(t,r)),t.match_length>=Y)if(n=Nr(t,t.strstart-t.match_start,t.match_length-Y),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=Y){t.match_length--;do t.strstart++,t.ins_h=Pr(t,t.ins_h,t.window[t.strstart+Y-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=Pr(t,t.ins_h,t.window[t.strstart+1]);else n=Nr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(yt(t,!1),t.strm.avail_out===0))return rt}return t.insert=t.strstart<Y-1?t.strstart:Y-1,e===xt?(yt(t,!0),t.strm.avail_out===0?kn:wi):t.sym_next&&(yt(t,!1),t.strm.avail_out===0)?rt:_i},oi=(t,e)=>{let r,n,i;for(;;){if(t.lookahead<Kt){if(mi(t),t.lookahead<Kt&&e===Rr)return rt;if(t.lookahead===0)break}if(r=0,t.lookahead>=Y&&(t.ins_h=Pr(t,t.ins_h,t.window[t.strstart+Y-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=Y-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-Kt&&(t.match_length=Uh(t,r),t.match_length<=5&&(t.strategy===pv||t.match_length===Y&&t.strstart-t.match_start>4096)&&(t.match_length=Y-1)),t.prev_length>=Y&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-Y,n=Nr(t,t.strstart-1-t.prev_match,t.prev_length-Y),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=Pr(t,t.ins_h,t.window[t.strstart+Y-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=Y-1,t.strstart++,n&&(yt(t,!1),t.strm.avail_out===0))return rt}else if(t.match_available){if(n=Nr(t,0,t.window[t.strstart-1]),n&&yt(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return rt}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=Nr(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<Y-1?t.strstart:Y-1,e===xt?(yt(t,!0),t.strm.avail_out===0?kn:wi):t.sym_next&&(yt(t,!1),t.strm.avail_out===0)?rt:_i},Ov=(t,e)=>{let r,n,i,a,o=t.window;for(;;){if(t.lookahead<=Ir){if(mi(t),t.lookahead<=Ir&&e===Rr)return rt;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=Y&&t.strstart>0&&(i=t.strstart-1,n=o[i],n===o[++i]&&n===o[++i]&&n===o[++i])){a=t.strstart+Ir;do;while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&i<a);t.match_length=Ir-(a-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=Y?(r=Nr(t,1,t.match_length-Y),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=Nr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(yt(t,!1),t.strm.avail_out===0))return rt}return t.insert=0,e===xt?(yt(t,!0),t.strm.avail_out===0?kn:wi):t.sym_next&&(yt(t,!1),t.strm.avail_out===0)?rt:_i},Dv=(t,e)=>{let r;for(;;){if(t.lookahead===0&&(mi(t),t.lookahead===0)){if(e===Rr)return rt;break}if(t.match_length=0,r=Nr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(yt(t,!1),t.strm.avail_out===0))return rt}return t.insert=0,e===xt?(yt(t,!0),t.strm.avail_out===0?kn:wi):t.sym_next&&(yt(t,!1),t.strm.avail_out===0)?rt:_i};function Vt(t,e,r,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=i}var pa=[new Vt(0,0,0,0,jh),new Vt(4,4,8,4,Su),new Vt(4,5,16,8,Su),new Vt(4,6,32,32,Su),new Vt(4,4,16,16,oi),new Vt(8,16,32,32,oi),new Vt(8,16,128,128,oi),new Vt(8,32,128,256,oi),new Vt(32,128,258,1024,oi),new Vt(32,258,258,4096,oi)],Nv=t=>{t.window_size=2*t.w_size,Ar(t.head),t.max_lazy_match=pa[t.level].max_lazy,t.good_match=pa[t.level].good_length,t.nice_match=pa[t.level].nice_length,t.max_chain_length=pa[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=Y-1,t.match_available=0,t.ins_h=0};function Rv(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Is,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(Ev*2),this.dyn_dtree=new Uint16Array((2*Sv+1)*2),this.bl_tree=new Uint16Array((2*Cv+1)*2),Ar(this.dyn_ltree),Ar(this.dyn_dtree),Ar(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(xv+1),this.heap=new Uint16Array(2*Wu+1),Ar(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Wu+1),Ar(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var $a=t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.status!==hi&&e.status!==fl&&e.status!==Ku&&e.status!==Zu&&e.status!==Yu&&e.status!==Ju&&e.status!==yn&&e.status!==fa?1:0},qh=t=>{if($a(t))return vn(t,Wt);t.total_in=t.total_out=0,t.data_type=gv;let e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?fl:e.wrap?hi:yn,t.adler=e.wrap===2?0:1,e.last_flush=-2,av(e),Ge},Bh=t=>{let e=qh(t);return e===Ge&&Nv(t.state),e},Pv=(t,e)=>$a(t)||t.state.wrap!==2?Wt:(t.state.gzhead=e,Ge),Vh=(t,e,r,n,i,a)=>{if(!t)return Wt;let o=1;if(e===fv&&(e=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>yv||r!==Is||n<8||n>15||e<0||e>9||a<0||a>hv||n===8&&o!==1)return vn(t,Wt);n===8&&(n=9);let s=new Rv;return t.state=s,s.strm=t,s.status=hi,s.wrap=o,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+Y-1)/Y),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=e,s.strategy=a,s.method=r,Bh(t)},Lv=(t,e)=>Vh(t,e,Is,vv,bv,mv),$v=(t,e)=>{if($a(t)||e>vd||e<0)return t?vn(t,Wt):Wt;let r=t.state;if(!t.output||t.avail_in!==0&&!t.input||r.status===fa&&e!==xt)return vn(t,t.avail_out===0?wu:Wt);let n=r.last_flush;if(r.last_flush=e,r.pending!==0){if(mt(t),t.avail_out===0)return r.last_flush=-1,Ge}else if(t.avail_in===0&&_d(e)<=_d(n)&&e!==xt)return vn(t,wu);if(r.status===fa&&t.avail_in!==0)return vn(t,wu);if(r.status===hi&&r.wrap===0&&(r.status=yn),r.status===hi){let i=Is+(r.w_bits-8<<4)<<8,a=-1;if(r.strategy>=Mo||r.level<2?a=0:r.level<6?a=1:r.level===6?a=2:a=3,i|=a<<6,r.strstart!==0&&(i|=kv),i+=31-i%31,Ji(r,i),r.strstart!==0&&(Ji(r,t.adler>>>16),Ji(r,t.adler&65535)),t.adler=1,r.status=yn,mt(t),r.pending!==0)return r.last_flush=-1,Ge}if(r.status===fl){if(t.adler=0,ae(r,31),ae(r,139),ae(r,8),r.gzhead)ae(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),ae(r,r.gzhead.time&255),ae(r,r.gzhead.time>>8&255),ae(r,r.gzhead.time>>16&255),ae(r,r.gzhead.time>>24&255),ae(r,r.level===9?2:r.strategy>=Mo||r.level<2?4:0),ae(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(ae(r,r.gzhead.extra.length&255),ae(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=je(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Ku;else if(ae(r,0),ae(r,0),ae(r,0),ae(r,0),ae(r,0),ae(r,r.level===9?2:r.strategy>=Mo||r.level<2?4:0),ae(r,Tv),r.status=yn,mt(t),r.pending!==0)return r.last_flush=-1,Ge}if(r.status===Ku){if(r.gzhead.extra){let i=r.pending,a=(r.gzhead.extra.length&65535)-r.gzindex;for(;r.pending+a>r.pending_buf_size;){let s=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+s),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>i&&(t.adler=je(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex+=s,mt(t),r.pending!==0)return r.last_flush=-1,Ge;i=0,a-=s}let o=new Uint8Array(r.gzhead.extra);r.pending_buf.set(o.subarray(r.gzindex,r.gzindex+a),r.pending),r.pending+=a,r.gzhead.hcrc&&r.pending>i&&(t.adler=je(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=Zu}if(r.status===Zu){if(r.gzhead.name){let i=r.pending,a;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(t.adler=je(t.adler,r.pending_buf,r.pending-i,i)),mt(t),r.pending!==0)return r.last_flush=-1,Ge;i=0}r.gzindex<r.gzhead.name.length?a=r.gzhead.name.charCodeAt(r.gzindex++)&255:a=0,ae(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(t.adler=je(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=Yu}if(r.status===Yu){if(r.gzhead.comment){let i=r.pending,a;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(t.adler=je(t.adler,r.pending_buf,r.pending-i,i)),mt(t),r.pending!==0)return r.last_flush=-1,Ge;i=0}r.gzindex<r.gzhead.comment.length?a=r.gzhead.comment.charCodeAt(r.gzindex++)&255:a=0,ae(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(t.adler=je(t.adler,r.pending_buf,r.pending-i,i))}r.status=Ju}if(r.status===Ju){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(mt(t),r.pending!==0))return r.last_flush=-1,Ge;ae(r,t.adler&255),ae(r,t.adler>>8&255),t.adler=0}if(r.status=yn,mt(t),r.pending!==0)return r.last_flush=-1,Ge}if(t.avail_in!==0||r.lookahead!==0||e!==Rr&&r.status!==fa){let i=r.level===0?jh(r,e):r.strategy===Mo?Dv(r,e):r.strategy===dv?Ov(r,e):pa[r.level].func(r,e);if((i===kn||i===wi)&&(r.status=fa),i===rt||i===kn)return t.avail_out===0&&(r.last_flush=-1),Ge;if(i===_i&&(e===cv?sv(r):e!==vd&&(Hu(r,0,0,!1),e===uv&&(Ar(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),mt(t),t.avail_out===0))return r.last_flush=-1,Ge}return e!==xt?Ge:r.wrap<=0?bd:(r.wrap===2?(ae(r,t.adler&255),ae(r,t.adler>>8&255),ae(r,t.adler>>16&255),ae(r,t.adler>>24&255),ae(r,t.total_in&255),ae(r,t.total_in>>8&255),ae(r,t.total_in>>16&255),ae(r,t.total_in>>24&255)):(Ji(r,t.adler>>>16),Ji(r,t.adler&65535)),mt(t),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?Ge:bd)},Fv=t=>{if($a(t))return Wt;let e=t.state.status;return t.state=null,e===yn?vn(t,lv):Ge},Mv=(t,e)=>{let r=e.length;if($a(t))return Wt;let n=t.state,i=n.wrap;if(i===2||i===1&&n.status!==hi||n.lookahead)return Wt;if(i===1&&(t.adler=Aa(t.adler,e,r,0)),n.wrap=0,r>=n.w_size){i===0&&(Ar(n.head),n.strstart=0,n.block_start=0,n.insert=0);let u=new Uint8Array(n.w_size);u.set(e.subarray(r-n.w_size,r),0),e=u,r=n.w_size}let a=t.avail_in,o=t.next_in,s=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,mi(n);n.lookahead>=Y;){let u=n.strstart,c=n.lookahead-(Y-1);do n.ins_h=Pr(n,n.ins_h,n.window[u+Y-1]),n.prev[u&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=u,u++;while(--c);n.strstart=u,n.lookahead=Y-1,mi(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=Y-1,n.match_available=0,t.next_in=o,t.input=s,t.avail_in=a,n.wrap=i,Ge},Uv=Lv,jv=Vh,qv=Bh,Bv=qh,Vv=Pv,zv=$v,Qv=Fv,Gv=Mv,Hv="pako deflate (from Nodeca project)",va={deflateInit:Uv,deflateInit2:jv,deflateReset:qv,deflateResetKeep:Bv,deflateSetHeader:Vv,deflate:zv,deflateEnd:Qv,deflateSetDictionary:Gv,deflateInfo:Hv},Wv=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),Kv=function(t){let e=Array.prototype.slice.call(arguments,1);for(;e.length;){let r=e.shift();if(!!r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(let n in r)Wv(r,n)&&(t[n]=r[n])}}return t},Zv=t=>{let e=0;for(let n=0,i=t.length;n<i;n++)e+=t[n].length;let r=new Uint8Array(e);for(let n=0,i=0,a=t.length;n<a;n++){let o=t[n];r.set(o,i),i+=o.length}return r},Os={assign:Kv,flattenChunks:Zv},zh=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){zh=!1}var Ia=new Uint8Array(256);for(let t=0;t<256;t++)Ia[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Ia[254]=Ia[254]=1;var Yv=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,r,n,i,a,o=t.length,s=0;for(i=0;i<o;i++)r=t.charCodeAt(i),(r&64512)===55296&&i+1<o&&(n=t.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Uint8Array(s),a=0,i=0;a<s;i++)r=t.charCodeAt(i),(r&64512)===55296&&i+1<o&&(n=t.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?e[a++]=r:r<2048?(e[a++]=192|r>>>6,e[a++]=128|r&63):r<65536?(e[a++]=224|r>>>12,e[a++]=128|r>>>6&63,e[a++]=128|r&63):(e[a++]=240|r>>>18,e[a++]=128|r>>>12&63,e[a++]=128|r>>>6&63,e[a++]=128|r&63);return e},Jv=(t,e)=>{if(e<65534&&t.subarray&&zh)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let r="";for(let n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r},Xv=(t,e)=>{let r=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let n,i,a=new Array(r*2);for(i=0,n=0;n<r;){let o=t[n++];if(o<128){a[i++]=o;continue}let s=Ia[o];if(s>4){a[i++]=65533,n+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&n<r;)o=o<<6|t[n++]&63,s--;if(s>1){a[i++]=65533;continue}o<65536?a[i++]=o:(o-=65536,a[i++]=55296|o>>10&1023,a[i++]=56320|o&1023)}return Jv(a,i)},e0=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let r=e-1;for(;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+Ia[t[r]]>e?r:e},Oa={string2buf:Yv,buf2string:Xv,utf8border:e0};function t0(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var Qh=t0,Gh=Object.prototype.toString,{Z_NO_FLUSH:r0,Z_SYNC_FLUSH:n0,Z_FULL_FLUSH:i0,Z_FINISH:a0,Z_OK:ys,Z_STREAM_END:o0,Z_DEFAULT_COMPRESSION:s0,Z_DEFAULT_STRATEGY:c0,Z_DEFLATED:u0}=Rn;function Fa(t){this.options=Os.assign({level:s0,method:u0,chunkSize:16384,windowBits:15,memLevel:8,strategy:c0},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Qh,this.strm.avail_out=0;let r=va.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==ys)throw new Error(xn[r]);if(e.header&&va.deflateSetHeader(this.strm,e.header),e.dictionary){let n;if(typeof e.dictionary=="string"?n=Oa.string2buf(e.dictionary):Gh.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,r=va.deflateSetDictionary(this.strm,n),r!==ys)throw new Error(xn[r]);this._dict_set=!0}}Fa.prototype.push=function(t,e){let r=this.strm,n=this.options.chunkSize,i,a;if(this.ended)return!1;for(e===~~e?a=e:a=e===!0?a0:r0,typeof t=="string"?r.input=Oa.string2buf(t):Gh.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){if(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(a===n0||a===i0)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(i=va.deflate(r,a),i===o0)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=va.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===ys;if(r.avail_out===0){this.onData(r.output);continue}if(a>0&&r.next_out>0){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(r.avail_in===0)break}return!0};Fa.prototype.onData=function(t){this.chunks.push(t)};Fa.prototype.onEnd=function(t){t===ys&&(this.result=Os.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function pl(t,e){let r=new Fa(e);if(r.push(t,!0),r.err)throw r.msg||xn[r.err];return r.result}function l0(t,e){return e=e||{},e.raw=!0,pl(t,e)}function f0(t,e){return e=e||{},e.gzip=!0,pl(t,e)}var p0=Fa,d0=pl,h0=l0,m0=f0,g0=Rn,y0={Deflate:p0,deflate:d0,deflateRaw:h0,gzip:m0,constants:g0},Uo=16209,v0=16191,b0=function t(e,r){let n,i,a,o,s,u,c,l,d,p,f,h,g,y,S,b,v,m,A,D,E,O,P,N,j=e.state;n=e.next_in,P=e.input,i=n+(e.avail_in-5),a=e.next_out,N=e.output,o=a-(r-e.avail_out),s=a+(e.avail_out-257),u=j.dmax,c=j.wsize,l=j.whave,d=j.wnext,p=j.window,f=j.hold,h=j.bits,g=j.lencode,y=j.distcode,S=(1<<j.lenbits)-1,b=(1<<j.distbits)-1;e:do{h<15&&(f+=P[n++]<<h,h+=8,f+=P[n++]<<h,h+=8),v=g[f&S];t:for(;;){if(m=v>>>24,f>>>=m,h-=m,m=v>>>16&255,m===0)N[a++]=v&65535;else if(m&16){A=v&65535,m&=15,m&&(h<m&&(f+=P[n++]<<h,h+=8),A+=f&(1<<m)-1,f>>>=m,h-=m),h<15&&(f+=P[n++]<<h,h+=8,f+=P[n++]<<h,h+=8),v=y[f&b];r:for(;;){if(m=v>>>24,f>>>=m,h-=m,m=v>>>16&255,m&16){if(D=v&65535,m&=15,h<m&&(f+=P[n++]<<h,h+=8,h<m&&(f+=P[n++]<<h,h+=8)),D+=f&(1<<m)-1,D>u){e.msg="invalid distance too far back",j.mode=Uo;break e}if(f>>>=m,h-=m,m=a-o,D>m){if(m=D-m,m>l&&j.sane){e.msg="invalid distance too far back",j.mode=Uo;break e}if(E=0,O=p,d===0){if(E+=c-m,m<A){A-=m;do N[a++]=p[E++];while(--m);E=a-D,O=N}}else if(d<m){if(E+=c+d-m,m-=d,m<A){A-=m;do N[a++]=p[E++];while(--m);if(E=0,d<A){m=d,A-=m;do N[a++]=p[E++];while(--m);E=a-D,O=N}}}else if(E+=d-m,m<A){A-=m;do N[a++]=p[E++];while(--m);E=a-D,O=N}for(;A>2;)N[a++]=O[E++],N[a++]=O[E++],N[a++]=O[E++],A-=3;A&&(N[a++]=O[E++],A>1&&(N[a++]=O[E++]))}else{E=a-D;do N[a++]=N[E++],N[a++]=N[E++],N[a++]=N[E++],A-=3;while(A>2);A&&(N[a++]=N[E++],A>1&&(N[a++]=N[E++]))}}else if((m&64)===0){v=y[(v&65535)+(f&(1<<m)-1)];continue r}else{e.msg="invalid distance code",j.mode=Uo;break e}break}}else if((m&64)===0){v=g[(v&65535)+(f&(1<<m)-1)];continue t}else if(m&32){j.mode=v0;break e}else{e.msg="invalid literal/length code",j.mode=Uo;break e}break}}while(n<i&&a<s);A=h>>3,n-=A,h-=A<<3,f&=(1<<h)-1,e.next_in=n,e.next_out=a,e.avail_in=n<i?5+(i-n):5-(n-i),e.avail_out=a<s?257+(s-a):257-(a-s),j.hold=f,j.bits=h},si=15,wd=852,Sd=592,Cd=0,Cu=1,Ed=2,_0=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),w0=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),S0=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),C0=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),E0=(t,e,r,n,i,a,o,s)=>{let u=s.bits,c=0,l=0,d=0,p=0,f=0,h=0,g=0,y=0,S=0,b=0,v,m,A,D,E,O=null,P,N=new Uint16Array(si+1),j=new Uint16Array(si+1),qe=null,Ne,q,de;for(c=0;c<=si;c++)N[c]=0;for(l=0;l<n;l++)N[e[r+l]]++;for(f=u,p=si;p>=1&&N[p]===0;p--);if(f>p&&(f=p),p===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,s.bits=1,0;for(d=1;d<p&&N[d]===0;d++);for(f<d&&(f=d),y=1,c=1;c<=si;c++)if(y<<=1,y-=N[c],y<0)return-1;if(y>0&&(t===Cd||p!==1))return-1;for(j[1]=0,c=1;c<si;c++)j[c+1]=j[c]+N[c];for(l=0;l<n;l++)e[r+l]!==0&&(o[j[e[r+l]]++]=l);if(t===Cd?(O=qe=o,P=20):t===Cu?(O=_0,qe=w0,P=257):(O=S0,qe=C0,P=0),b=0,l=0,c=d,E=a,h=f,g=0,A=-1,S=1<<f,D=S-1,t===Cu&&S>wd||t===Ed&&S>Sd)return 1;for(;;){Ne=c-g,o[l]+1<P?(q=0,de=o[l]):o[l]>=P?(q=qe[o[l]-P],de=O[o[l]-P]):(q=32+64,de=0),v=1<<c-g,m=1<<h,d=m;do m-=v,i[E+(b>>g)+m]=Ne<<24|q<<16|de|0;while(m!==0);for(v=1<<c-1;b&v;)v>>=1;if(v!==0?(b&=v-1,b+=v):b=0,l++,--N[c]===0){if(c===p)break;c=e[r+o[l]]}if(c>f&&(b&D)!==A){for(g===0&&(g=f),E+=d,h=c-g,y=1<<h;h+g<p&&(y-=N[h+g],!(y<=0));)h++,y<<=1;if(S+=1<<h,t===Cu&&S>wd||t===Ed&&S>Sd)return 1;A=b&D,i[A]=f<<24|h<<16|E-a|0}}return b!==0&&(i[E+b]=c-g<<24|64<<16|0),s.bits=f,0},ba=E0,x0=0,Hh=1,Wh=2,{Z_FINISH:xd,Z_BLOCK:k0,Z_TREES:jo,Z_OK:Tn,Z_STREAM_END:T0,Z_NEED_DICT:A0,Z_STREAM_ERROR:kt,Z_DATA_ERROR:Kh,Z_MEM_ERROR:Zh,Z_BUF_ERROR:I0,Z_DEFLATED:kd}=Rn,Ds=16180,Td=16181,Ad=16182,Id=16183,Od=16184,Dd=16185,Nd=16186,Rd=16187,Pd=16188,Ld=16189,vs=16190,ir=16191,Eu=16192,$d=16193,xu=16194,Fd=16195,Md=16196,Ud=16197,jd=16198,qo=16199,Bo=16200,qd=16201,Bd=16202,Vd=16203,zd=16204,Qd=16205,ku=16206,Gd=16207,Hd=16208,_e=16209,Yh=16210,Jh=16211,O0=852,D0=592,N0=15,R0=N0,Wd=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function P0(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var Pn=t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.mode<Ds||e.mode>Jh?1:0},Xh=t=>{if(Pn(t))return kt;let e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=Ds,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(O0),e.distcode=e.distdyn=new Int32Array(D0),e.sane=1,e.back=-1,Tn},em=t=>{if(Pn(t))return kt;let e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,Xh(t)},tm=(t,e)=>{let r;if(Pn(t))return kt;let n=t.state;return e<0?(r=0,e=-e):(r=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?kt:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,em(t))},rm=(t,e)=>{if(!t)return kt;let r=new P0;t.state=r,r.strm=t,r.window=null,r.mode=Ds;let n=tm(t,e);return n!==Tn&&(t.state=null),n},L0=t=>rm(t,R0),Kd=!0,Tu,Au,$0=t=>{if(Kd){Tu=new Int32Array(512),Au=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(ba(Hh,t.lens,0,288,Tu,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;ba(Wh,t.lens,0,32,Au,0,t.work,{bits:5}),Kd=!1}t.lencode=Tu,t.lenbits=9,t.distcode=Au,t.distbits=5},nm=(t,e,r,n)=>{let i,a=t.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),n>=a.wsize?(a.window.set(e.subarray(r-a.wsize,r),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>n&&(i=n),a.window.set(e.subarray(r-n,r-n+i),a.wnext),n-=i,n?(a.window.set(e.subarray(r-n,r),0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},F0=(t,e)=>{let r,n,i,a,o,s,u,c,l,d,p,f,h,g,y=0,S,b,v,m,A,D,E,O,P=new Uint8Array(4),N,j,qe=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Pn(t)||!t.output||!t.input&&t.avail_in!==0)return kt;r=t.state,r.mode===ir&&(r.mode=Eu),o=t.next_out,i=t.output,u=t.avail_out,a=t.next_in,n=t.input,s=t.avail_in,c=r.hold,l=r.bits,d=s,p=u,O=Tn;e:for(;;)switch(r.mode){case Ds:if(r.wrap===0){r.mode=Eu;break}for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.wrap&2&&c===35615){r.wbits===0&&(r.wbits=15),r.check=0,P[0]=c&255,P[1]=c>>>8&255,r.check=je(r.check,P,2,0),c=0,l=0,r.mode=Td;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=_e;break}if((c&15)!==kd){t.msg="unknown compression method",r.mode=_e;break}if(c>>>=4,l-=4,E=(c&15)+8,r.wbits===0&&(r.wbits=E),E>15||E>r.wbits){t.msg="invalid window size",r.mode=_e;break}r.dmax=1<<r.wbits,r.flags=0,t.adler=r.check=1,r.mode=c&512?Ld:ir,c=0,l=0;break;case Td:for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.flags=c,(r.flags&255)!==kd){t.msg="unknown compression method",r.mode=_e;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=_e;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&r.wrap&4&&(P[0]=c&255,P[1]=c>>>8&255,r.check=je(r.check,P,2,0)),c=0,l=0,r.mode=Ad;case Ad:for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.head&&(r.head.time=c),r.flags&512&&r.wrap&4&&(P[0]=c&255,P[1]=c>>>8&255,P[2]=c>>>16&255,P[3]=c>>>24&255,r.check=je(r.check,P,4,0)),c=0,l=0,r.mode=Id;case Id:for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&r.wrap&4&&(P[0]=c&255,P[1]=c>>>8&255,r.check=je(r.check,P,2,0)),c=0,l=0,r.mode=Od;case Od:if(r.flags&1024){for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&r.wrap&4&&(P[0]=c&255,P[1]=c>>>8&255,r.check=je(r.check,P,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=Dd;case Dd:if(r.flags&1024&&(f=r.length,f>s&&(f=s),f&&(r.head&&(E=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(a,a+f),E)),r.flags&512&&r.wrap&4&&(r.check=je(r.check,n,f,a)),s-=f,a+=f,r.length-=f),r.length))break e;r.length=0,r.mode=Nd;case Nd:if(r.flags&2048){if(s===0)break e;f=0;do E=n[a+f++],r.head&&E&&r.length<65536&&(r.head.name+=String.fromCharCode(E));while(E&&f<s);if(r.flags&512&&r.wrap&4&&(r.check=je(r.check,n,f,a)),s-=f,a+=f,E)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=Rd;case Rd:if(r.flags&4096){if(s===0)break e;f=0;do E=n[a+f++],r.head&&E&&r.length<65536&&(r.head.comment+=String.fromCharCode(E));while(E&&f<s);if(r.flags&512&&r.wrap&4&&(r.check=je(r.check,n,f,a)),s-=f,a+=f,E)break e}else r.head&&(r.head.comment=null);r.mode=Pd;case Pd:if(r.flags&512){for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.wrap&4&&c!==(r.check&65535)){t.msg="header crc mismatch",r.mode=_e;break}c=0,l=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=ir;break;case Ld:for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}t.adler=r.check=Wd(c),c=0,l=0,r.mode=vs;case vs:if(r.havedict===0)return t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,A0;t.adler=r.check=1,r.mode=ir;case ir:if(e===k0||e===jo)break e;case Eu:if(r.last){c>>>=l&7,l-=l&7,r.mode=ku;break}for(;l<3;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}switch(r.last=c&1,c>>>=1,l-=1,c&3){case 0:r.mode=$d;break;case 1:if($0(r),r.mode=qo,e===jo){c>>>=2,l-=2;break e}break;case 2:r.mode=Md;break;case 3:t.msg="invalid block type",r.mode=_e}c>>>=2,l-=2;break;case $d:for(c>>>=l&7,l-=l&7;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if((c&65535)!==(c>>>16^65535)){t.msg="invalid stored block lengths",r.mode=_e;break}if(r.length=c&65535,c=0,l=0,r.mode=xu,e===jo)break e;case xu:r.mode=Fd;case Fd:if(f=r.length,f){if(f>s&&(f=s),f>u&&(f=u),f===0)break e;i.set(n.subarray(a,a+f),o),s-=f,a+=f,u-=f,o+=f,r.length-=f;break}r.mode=ir;break;case Md:for(;l<14;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.nlen=(c&31)+257,c>>>=5,l-=5,r.ndist=(c&31)+1,c>>>=5,l-=5,r.ncode=(c&15)+4,c>>>=4,l-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=_e;break}r.have=0,r.mode=Ud;case Ud:for(;r.have<r.ncode;){for(;l<3;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.lens[qe[r.have++]]=c&7,c>>>=3,l-=3}for(;r.have<19;)r.lens[qe[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,N={bits:r.lenbits},O=ba(x0,r.lens,0,19,r.lencode,0,r.work,N),r.lenbits=N.bits,O){t.msg="invalid code lengths set",r.mode=_e;break}r.have=0,r.mode=jd;case jd:for(;r.have<r.nlen+r.ndist;){for(;y=r.lencode[c&(1<<r.lenbits)-1],S=y>>>24,b=y>>>16&255,v=y&65535,!(S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(v<16)c>>>=S,l-=S,r.lens[r.have++]=v;else{if(v===16){for(j=S+2;l<j;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(c>>>=S,l-=S,r.have===0){t.msg="invalid bit length repeat",r.mode=_e;break}E=r.lens[r.have-1],f=3+(c&3),c>>>=2,l-=2}else if(v===17){for(j=S+3;l<j;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=S,l-=S,E=0,f=3+(c&7),c>>>=3,l-=3}else{for(j=S+7;l<j;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=S,l-=S,E=0,f=11+(c&127),c>>>=7,l-=7}if(r.have+f>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=_e;break}for(;f--;)r.lens[r.have++]=E}}if(r.mode===_e)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=_e;break}if(r.lenbits=9,N={bits:r.lenbits},O=ba(Hh,r.lens,0,r.nlen,r.lencode,0,r.work,N),r.lenbits=N.bits,O){t.msg="invalid literal/lengths set",r.mode=_e;break}if(r.distbits=6,r.distcode=r.distdyn,N={bits:r.distbits},O=ba(Wh,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,N),r.distbits=N.bits,O){t.msg="invalid distances set",r.mode=_e;break}if(r.mode=qo,e===jo)break e;case qo:r.mode=Bo;case Bo:if(s>=6&&u>=258){t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,b0(t,p),o=t.next_out,i=t.output,u=t.avail_out,a=t.next_in,n=t.input,s=t.avail_in,c=r.hold,l=r.bits,r.mode===ir&&(r.back=-1);break}for(r.back=0;y=r.lencode[c&(1<<r.lenbits)-1],S=y>>>24,b=y>>>16&255,v=y&65535,!(S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(b&&(b&240)===0){for(m=S,A=b,D=v;y=r.lencode[D+((c&(1<<m+A)-1)>>m)],S=y>>>24,b=y>>>16&255,v=y&65535,!(m+S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=m,l-=m,r.back+=m}if(c>>>=S,l-=S,r.back+=S,r.length=v,b===0){r.mode=Qd;break}if(b&32){r.back=-1,r.mode=ir;break}if(b&64){t.msg="invalid literal/length code",r.mode=_e;break}r.extra=b&15,r.mode=qd;case qd:if(r.extra){for(j=r.extra;l<j;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=Bd;case Bd:for(;y=r.distcode[c&(1<<r.distbits)-1],S=y>>>24,b=y>>>16&255,v=y&65535,!(S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if((b&240)===0){for(m=S,A=b,D=v;y=r.distcode[D+((c&(1<<m+A)-1)>>m)],S=y>>>24,b=y>>>16&255,v=y&65535,!(m+S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=m,l-=m,r.back+=m}if(c>>>=S,l-=S,r.back+=S,b&64){t.msg="invalid distance code",r.mode=_e;break}r.offset=v,r.extra=b&15,r.mode=Vd;case Vd:if(r.extra){for(j=r.extra;l<j;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=_e;break}r.mode=zd;case zd:if(u===0)break e;if(f=p-u,r.offset>f){if(f=r.offset-f,f>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=_e;break}f>r.wnext?(f-=r.wnext,h=r.wsize-f):h=r.wnext-f,f>r.length&&(f=r.length),g=r.window}else g=i,h=o-r.offset,f=r.length;f>u&&(f=u),u-=f,r.length-=f;do i[o++]=g[h++];while(--f);r.length===0&&(r.mode=Bo);break;case Qd:if(u===0)break e;i[o++]=r.length,u--,r.mode=Bo;break;case ku:if(r.wrap){for(;l<32;){if(s===0)break e;s--,c|=n[a++]<<l,l+=8}if(p-=u,t.total_out+=p,r.total+=p,r.wrap&4&&p&&(t.adler=r.check=r.flags?je(r.check,i,p,o-p):Aa(r.check,i,p,o-p)),p=u,r.wrap&4&&(r.flags?c:Wd(c))!==r.check){t.msg="incorrect data check",r.mode=_e;break}c=0,l=0}r.mode=Gd;case Gd:if(r.wrap&&r.flags){for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.wrap&4&&c!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=_e;break}c=0,l=0}r.mode=Hd;case Hd:O=T0;break e;case _e:O=Kh;break e;case Yh:return Zh;case Jh:default:return kt}return t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,(r.wsize||p!==t.avail_out&&r.mode<_e&&(r.mode<ku||e!==xd))&&nm(t,t.output,t.next_out,p-t.avail_out),d-=t.avail_in,p-=t.avail_out,t.total_in+=d,t.total_out+=p,r.total+=p,r.wrap&4&&p&&(t.adler=r.check=r.flags?je(r.check,i,p,t.next_out-p):Aa(r.check,i,p,t.next_out-p)),t.data_type=r.bits+(r.last?64:0)+(r.mode===ir?128:0)+(r.mode===qo||r.mode===xu?256:0),(d===0&&p===0||e===xd)&&O===Tn&&(O=I0),O},M0=t=>{if(Pn(t))return kt;let e=t.state;return e.window&&(e.window=null),t.state=null,Tn},U0=(t,e)=>{if(Pn(t))return kt;let r=t.state;return(r.wrap&2)===0?kt:(r.head=e,e.done=!1,Tn)},j0=(t,e)=>{let r=e.length,n,i,a;return Pn(t)||(n=t.state,n.wrap!==0&&n.mode!==vs)?kt:n.mode===vs&&(i=1,i=Aa(i,e,r,0),i!==n.check)?Kh:(a=nm(t,e,r,r),a?(n.mode=Yh,Zh):(n.havedict=1,Tn))},q0=em,B0=tm,V0=Xh,z0=L0,Q0=rm,G0=F0,H0=M0,W0=U0,K0=j0,Z0="pako inflate (from Nodeca project)",cr={inflateReset:q0,inflateReset2:B0,inflateResetKeep:V0,inflateInit:z0,inflateInit2:Q0,inflate:G0,inflateEnd:H0,inflateGetHeader:W0,inflateSetDictionary:K0,inflateInfo:Z0};function Y0(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var J0=Y0,im=Object.prototype.toString,{Z_NO_FLUSH:X0,Z_FINISH:e2,Z_OK:Da,Z_STREAM_END:Iu,Z_NEED_DICT:Ou,Z_STREAM_ERROR:t2,Z_DATA_ERROR:Zd,Z_MEM_ERROR:r2}=Rn;function Ma(t){this.options=Os.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});let e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15)===0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Qh,this.strm.avail_out=0;let r=cr.inflateInit2(this.strm,e.windowBits);if(r!==Da)throw new Error(xn[r]);if(this.header=new J0,cr.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Oa.string2buf(e.dictionary):im.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=cr.inflateSetDictionary(this.strm,e.dictionary),r!==Da)))throw new Error(xn[r])}Ma.prototype.push=function(t,e){let r=this.strm,n=this.options.chunkSize,i=this.options.dictionary,a,o,s;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?e2:X0,im.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),a=cr.inflate(r,o),a===Ou&&i&&(a=cr.inflateSetDictionary(r,i),a===Da?a=cr.inflate(r,o):a===Zd&&(a=Ou));r.avail_in>0&&a===Iu&&r.state.wrap>0&&t[r.next_in]!==0;)cr.inflateReset(r),a=cr.inflate(r,o);switch(a){case t2:case Zd:case Ou:case r2:return this.onEnd(a),this.ended=!0,!1}if(s=r.avail_out,r.next_out&&(r.avail_out===0||a===Iu))if(this.options.to==="string"){let u=Oa.utf8border(r.output,r.next_out),c=r.next_out-u,l=Oa.buf2string(r.output,u);r.next_out=c,r.avail_out=n-c,c&&r.output.set(r.output.subarray(u,u+c),0),this.onData(l)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(!(a===Da&&s===0)){if(a===Iu)return a=cr.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};Ma.prototype.onData=function(t){this.chunks.push(t)};Ma.prototype.onEnd=function(t){t===Da&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Os.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function dl(t,e){let r=new Ma(e);if(r.push(t),r.err)throw r.msg||xn[r.err];return r.result}function n2(t,e){return e=e||{},e.raw=!0,dl(t,e)}var i2=Ma,a2=dl,o2=n2,s2=dl,c2=Rn,u2={Inflate:i2,inflate:a2,inflateRaw:o2,ungzip:s2,constants:c2},{Deflate:l2,deflate:f2,deflateRaw:p2,gzip:d2}=y0,{Inflate:h2,inflate:m2,inflateRaw:g2,ungzip:y2}=u2,v2=l2,b2=f2,_2=p2,w2=d2,S2=h2,C2=m2,E2=g2,x2=y2,k2=Rn,T2={Deflate:v2,deflate:b2,deflateRaw:_2,gzip:w2,Inflate:S2,inflate:C2,inflateRaw:E2,ungzip:x2,constants:k2},ge=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},ye=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},bs=class{constructor(e,r){this.input=e,this.output=r}};ge([w(),ye("design:type",String)],bs.prototype,"input",void 0);ge([w(),ye("design:type",String)],bs.prototype,"output",void 0);bs=ge([He(),ye("design:paramtypes",[String,String])],bs);var _s=class{constructor(e,r){this.input=e,this.output=r}};ge([w(),ye("design:type",String)],_s.prototype,"input",void 0);ge([w(),ye("design:type",String)],_s.prototype,"output",void 0);_s=ge([Z(),ye("design:paramtypes",[String,String])],_s);var jr=class{constructor(e,r,n,i,a){this.name=e,this.modelId=r,this.systemPrompt=n,this.promptExamples=i,this.metaData=a}};ge([w(),ye("design:type",String)],jr.prototype,"name",void 0);ge([w(),ye("design:type",String)],jr.prototype,"modelId",void 0);ge([w(),ye("design:type",String)],jr.prototype,"systemPrompt",void 0);ge([w(),ye("design:type",Array)],jr.prototype,"promptExamples",void 0);ge([w(),ye("design:type",String)],jr.prototype,"metaData",void 0);jr=ge([He(),ye("design:paramtypes",[String,String,String,Array,String])],jr);var Zt=class{constructor(e,r,n,i,a,o,s,u){this.name=e,this.modelId=r,this.taskId=n,this.systemPrompt=i,this.promptExamples=a,this.metaData=o,this.createdAt=s,this.updatedAt=u}};ge([w(),ye("design:type",String)],Zt.prototype,"name",void 0);ge([w(),ye("design:type",String)],Zt.prototype,"modelId",void 0);ge([w(),ye("design:type",String)],Zt.prototype,"taskId",void 0);ge([w(),ye("design:type",String)],Zt.prototype,"systemPrompt",void 0);ge([w(),ye("design:type",Array)],Zt.prototype,"promptExamples",void 0);ge([w(),ye("design:type",String)],Zt.prototype,"metaData",void 0);ge([w(),ye("design:type",String)],Zt.prototype,"createdAt",void 0);ge([w(),ye("design:type",String)],Zt.prototype,"updatedAt",void 0);Zt=ge([Z(),ye("design:paramtypes",[String,String,String,String,Array,String,String,String])],Zt);var An=class{constructor(e,r,n,i,a){this.model=e,this.status=r,this.progress=n,this.downloaded=i,this.loaded=a}};ge([w(),ye("design:type",String)],An.prototype,"model",void 0);ge([w(),ye("design:type",String)],An.prototype,"status",void 0);ge([w(),ye("design:type",Number)],An.prototype,"progress",void 0);ge([w(),ye("design:type",Boolean)],An.prototype,"downloaded",void 0);ge([w(),ye("design:type",Boolean)],An.prototype,"loaded",void 0);An=ge([Z(),ye("design:paramtypes",[String,String,Number,Boolean,Boolean])],An);var A2=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Fe=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Le,es,el=class{constructor(e,r=!0){Le.set(this,void 0),es.set(this,new Map),A2(this,Le,e,"f")}async getModels(){let e=await Fe(this,Le,"f").query({query:C`
|
|
651
651
|
query {
|
|
652
652
|
aiGetModels {
|
|
653
653
|
id
|
|
@@ -793,13 +793,13 @@ triggerMatch
|
|
|
793
793
|
mutation aiEmbed($modelId: String!, $text: String!) {
|
|
794
794
|
aiEmbed(modelId: $modelId, text: $text)
|
|
795
795
|
}
|
|
796
|
-
`,variables:{modelId:e,text:r}})),i=As.toByteArray(n);return JSON.parse(T2.inflate(i,{to:"string"}))}async openTranscriptionStream(e,r){let{aiOpenTranscriptionStream:
|
|
797
|
-
mutation AiOpenTranscriptionStream($modelId: String
|
|
798
|
-
aiOpenTranscriptionStream(modelId: $modelId)
|
|
796
|
+
`,variables:{modelId:e,text:r}})),i=As.toByteArray(n);return JSON.parse(T2.inflate(i,{to:"string"}))}async openTranscriptionStream(e,r,n){let{aiOpenTranscriptionStream:i}=T(await Fe(this,Le,"f").mutate({mutation:C`
|
|
797
|
+
mutation AiOpenTranscriptionStream($modelId: String!, $params: VoiceActivityParamsInput) {
|
|
798
|
+
aiOpenTranscriptionStream(modelId: $modelId, params: $params)
|
|
799
799
|
}
|
|
800
|
-
`,variables:{modelId:e}})),
|
|
801
|
-
aiTranscriptionText(streamId: "${
|
|
802
|
-
}`}).subscribe({next(
|
|
800
|
+
`,variables:{modelId:e,params:n}})),a=Fe(this,Le,"f").subscribe({query:C` subscription {
|
|
801
|
+
aiTranscriptionText(streamId: "${i}")
|
|
802
|
+
}`}).subscribe({next(o){return r(o.data.aiTranscriptionText),o.data.aiTranscriptionText},error(o){console.error(o)}});return Fe(this,es,"f").set(i,a),i}async closeTranscriptionStream(e){let{aiCloseTranscriptionStream:r}=T(await Fe(this,Le,"f").mutate({mutation:C`
|
|
803
803
|
mutation aiCloseTranscriptionStream($streamId: String!) {
|
|
804
804
|
aiCloseTranscriptionStream(streamId: $streamId)
|
|
805
805
|
}
|
|
@@ -807,7 +807,7 @@ triggerMatch
|
|
|
807
807
|
mutation AiFeedTranscriptionStream($streamId: String!, $audio: [Float!]!) {
|
|
808
808
|
aiFeedTranscriptionStream(streamId: $streamId, audio: $audio)
|
|
809
809
|
}
|
|
810
|
-
`,variables:{streamId:e,audio:r}}));return n}};Le=new WeakMap,es=new WeakMap;var Tr=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Pe=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},zt,ts,da,rs,ha,hn,ns,ma,ws=class{constructor(e,r=!0){zt.set(this,void 0),ts.set(this,void 0),da.set(this,void 0),rs.set(this,void 0),ha.set(this,void 0),hn.set(this,void 0),ns.set(this,void 0),ma.set(this,void 0),Tr(this,zt,e,"f"),Tr(this,ts,new Ca(Pe(this,zt,"f"),r),"f"),Tr(this,da,new zu(Pe(this,zt,"f")),"f"),Tr(this,rs,new qu(Pe(this,zt,"f")),"f"),Tr(this,ha,new Bu(Pe(this,zt,"f")),"f"),Tr(this,ma,new el(Pe(this,zt,"f"),r),"f"),Tr(this,hn,new ms(Pe(this,zt,"f"),r),"f"),Pe(this,hn,"f").setExpressionClient(Pe(this,da,"f")),Pe(this,hn,"f").setNeighbourhoodClient(Pe(this,ha,"f")),Pe(this,hn,"f").setAIClient(Pe(this,ma,"f")),Tr(this,ns,new Vu(Pe(this,zt,"f"),r),"f")}get agent(){return Pe(this,ts,"f")}get expression(){return Pe(this,da,"f")}get languages(){return Pe(this,rs,"f")}get neighbourhood(){return Pe(this,ha,"f")}get perspective(){return Pe(this,hn,"f")}get runtime(){return Pe(this,ns,"f")}get ai(){return Pe(this,ma,"f")}};zt=new WeakMap,ts=new WeakMap,da=new WeakMap,rs=new WeakMap,ha=new WeakMap,hn=new WeakMap,ns=new WeakMap,ma=new WeakMap;var Yd;(function(t){t.LanguageIsNotLoaded="LANGUAGE_IS_NOT_LOADED",t.ExpressionIsNotVerified="EXPRESSION_IS_NOT_VERIFIED",t.AgentIsUntrusted="AGENT_IS_UNTRUSTED",t.CapabilityRequested="CAPABILITY_REQUESTED",t.InstallNotificationRequest="INSTALL_NOTIFICATION_REQUEST"})(Yd||(Yd={}));var hl=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},ml=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},bn=class{constructor(e,r){this.language=e,this.expression=r}};hl([w(),ml("design:type",Ht)],bn.prototype,"language",void 0);hl([w(),ml("design:type",String)],bn.prototype,"expression",void 0);bn=hl([Z(),ml("design:paramtypes",[Ht,String])],bn);function G9(t){return t.language.address==="did"?t.expression.toString():`${t.language.address}://${t.expression}`}function H9(t){if(t.startsWith("literal://")){let a=new Ht;a.address="literal",a.name="literal";let o=t.substring(10);return new bn(a,o)}let r=/^([^:^\s]+):\/\/([\s\S]+)$/.exec(t);if(r&&r.length==3){let a=r[1],o=r[2],s=new Ht;return s.address=a,new bn(s,o)}let i=/^did:([^\s]+)$/.exec(t);if(i&&i.length==2){let a=new Ht;return a.address="did",new bn(a,t)}throw new Error("Couldn't parse string as expression URL or DID: "+t)}var bt=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Yt=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Ss=class{};bt([w(),Yt("design:type",String)],Ss.prototype,"name",void 0);bt([w(),Yt("design:type",String)],Ss.prototype,"type",void 0);Ss=bt([Z()],Ss);var Na=class{};bt([w(),Yt("design:type",String)],Na.prototype,"label",void 0);bt([w(),Yt("design:type",String)],Na.prototype,"name",void 0);bt([w(),Yt("design:type",Array)],Na.prototype,"parameters",void 0);Na=bt([Z()],Na);var Cs=class{get parameters(){return JSON.parse(this.parametersStringified)}constructor(e,r){this.name=e,this.parametersStringified=JSON.stringify(r)}};bt([w(),Yt("design:type",String)],Cs.prototype,"name",void 0);bt([w(),Yt("design:type",String)],Cs.prototype,"parametersStringified",void 0);Cs=bt([He(),Yt("design:paramtypes",[String,Object])],Cs);var Es=class{};bt([w(),Yt("design:type",String)],Es.prototype,"did",void 0);bt([w(),Yt("design:type",Uu)],Es.prototype,"status",void 0);Es=bt([Z()],Es);var Jd=class{},Ln=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Si=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},qr=class{};Ln([w(),Si("design:type",String)],qr.prototype,"name",void 0);Ln([w(),Si("design:type",String)],qr.prototype,"address",void 0);Ln([w(),Si("design:type",String)],qr.prototype,"settings",void 0);Ln([w(),Si("design:type",wn)],qr.prototype,"icon",void 0);Ln([w(),Si("design:type",wn)],qr.prototype,"constructorIcon",void 0);Ln([w(),Si("design:type",wn)],qr.prototype,"settingsIcon",void 0);qr=Ln([Z()],qr);var nt=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},lt=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},$t=class{};nt([w(),lt("design:type",String)],$t.prototype,"name",void 0);nt([w(),lt("design:type",String)],$t.prototype,"address",void 0);nt([w(),lt("design:type",String)],$t.prototype,"description",void 0);nt([w(),lt("design:type",String)],$t.prototype,"author",void 0);nt([w(),lt("design:type",Boolean)],$t.prototype,"templated",void 0);nt([w(),lt("design:type",String)],$t.prototype,"templateSourceLanguageAddress",void 0);nt([w(),lt("design:type",String)],$t.prototype,"templateAppliedParams",void 0);nt([w(),lt("design:type",Array)],$t.prototype,"possibleTemplateParams",void 0);nt([w(),lt("design:type",String)],$t.prototype,"sourceCodeLink",void 0);$t=nt([Z()],$t);var gi=class{constructor(e,r){this.name=e,this.description=r,this.description||(this.description="")}};nt([w(),lt("design:type",String)],gi.prototype,"name",void 0);nt([w(),lt("design:type",String)],gi.prototype,"description",void 0);nt([w(),lt("design:type",Array)],gi.prototype,"possibleTemplateParams",void 0);nt([w(),lt("design:type",String)],gi.prototype,"sourceCodeLink",void 0);gi=nt([He(),lt("design:paramtypes",[String,String])],gi);var Xd=class{},eh=class extends Br(){},th=class{},Ns=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},gl=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},xs=class{constructor(e,r){this.linkLanguage=e,this.meta=r}};Ns([w(),gl("design:type",String)],xs.prototype,"linkLanguage",void 0);Ns([w(),gl("design:type",$r)],xs.prototype,"meta",void 0);xs=Ns([Z(),gl("design:paramtypes",[String,$r])],xs);var tl=class extends Br(){};tl=Ns([Z()],tl);var Ci=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Ei=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},rl;(function(t){t.Private="PRIVATE",t.NeighboudhoodCreationInitiated="NEIGHBOURHOOD_CREATION_INITIATED",t.NeighbourhoodJoinInitiated="NEIGHBOURHOOD_JOIN_INITIATED",t.LinkLanguageFailedToInstall="LINK_LANGUAGE_FAILED_TO_INSTALL",t.LinkLanguageInstalledButNotSynced="LINK_LANGUAGE_INSTALLED_BUT_NOT_SYNCED",t.Synced="SYNCED"})(rl||(rl={}));var In=class{constructor(e,r,n){this.uuid=e,this.name=r,n?this.state=n:this.state=rl.Private}};Ci([w(),Ei("design:type",String)],In.prototype,"uuid",void 0);Ci([w(),Ei("design:type",String)],In.prototype,"name",void 0);Ci([w(),Ei("design:type",String)],In.prototype,"state",void 0);Ci([w(),Ei("design:type",String)],In.prototype,"sharedUrl",void 0);Ci([w(),Ei("design:type",tl)],In.prototype,"neighbourhood",void 0);In=Ci([Z(),Ei("design:paramtypes",[String,String,String])],In);var Rs=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},a1=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ks=class{};Rs([w(),a1("design:type",Array)],ks.prototype,"additions",void 0);Rs([w(),a1("design:type",Array)],ks.prototype,"removals",void 0);ks=Rs([Z()],ks);var rh=class extends Br(){};rh=Rs([Z()],rh);var nh=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ci=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ga,mn,Vo="smart_literal://content";function I2(t){let e="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=r.length;for(let i=0;i<t;i++)e+=r.charAt(Math.floor(Math.random()*n));return e}var Ra=class{constructor(e,r){ga.set(this,void 0),mn.set(this,void 0),nh(this,ga,e,"f"),nh(this,mn,r,"f")}get base(){return ci(this,mn,"f")}static async create(e,r){let n=Lt.from(I2(10)).toUrl(),i=new Ra(e,n);return await i.set(r),i}static async isSmartLiteralBase(e,r){return(await e.get(new vt({source:r,predicate:Vo}))).length>0}static async getAllSmartLiterals(e){return(await e.get(new vt({predicate:Vo}))).map(n=>new Ra(e,n.data.source))}async get(){let e=await ci(this,ga,"f").getSingleTarget(new vt({source:ci(this,mn,"f"),predicate:Vo}));if(!e)throw`No content for smart literal ${ci(this,mn,"f")}`;return Lt.fromUrl(e).get()}async set(e){let r=Lt.from(e);await ci(this,ga,"f").setSingleTarget(new Cn({source:ci(this,mn,"f"),predicate:Vo,target:r.toUrl()}))}};ga=new WeakMap,mn=new WeakMap;var ih=class{};function o7(t,e,r){return{action:"addLink",source:t,predicate:e,target:r}}function s7(t){return`triple(this, "${t}", _)`}function c7(t){return function(e,r,n){if(typeof n.value!="function")throw new Error("InstanceQuery decorator can only be applied to methods");n.value=async function(a){let o=[],s=e.name,u=`subject_class("${s}", C), instance(C, Instance)`;if(t&&t.where)for(let l in t.where){let d=t.where[l];u+=`, property_getter(C, Instance, "${l}", "${d}")`}t&&t.condition&&(u+=", "+t.condition);let c=await a.infer(u);if(c==!1)return o;if(typeof c=="string")throw c;for(let l of c){let d=l.Instance,p=new hs(a,d,s);await p.init(),o.push(p)}return o}}}function u7(t){return function(e,r){if(t.required&&!t.initial)throw new Error("SubjectProperty requires an 'initial' option if 'required' is true");if(!t.through&&!t.getter)throw new Error("SubjectProperty requires either 'through' or 'getter' option");if(e.__properties=e.__properties||{},e.__properties[r]=e.__properties[r]||{},e.__properties[r]={...e.__properties[r],...t},t.writable){let n=r;e[`set${Dr(n)}`]=()=>{}}Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function l7(t){return function(e,r){if(!t.through&&!t.value)throw new Error("SubjectFlag requires a 'through' and 'value' option");if(!t.through)throw new Error("SubjectFlag requires a 'through' option");if(!t.value)throw new Error("SubjectFlag requires a 'value' option");e.__properties=e.__properties||{},e.__properties[r]=e.__properties[r]||{},e.__properties[r]={...e.__properties[r],through:t.through,required:!0,initial:t.value,flag:!0},e[r]=t.value,Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function f7(t){return function(e,r){e.__collections=e.__collections||{},e.__collections[r]=t;let n=r;e[`add${Dr(n)}`]=()=>{},e[`remove${Dr(n)}`]=()=>{},e[`setCollection${Dr(n)}`]=()=>{},Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function o1(t){let e="",r="abcdefghijklmnopqrstuvwxyz",n=r.length;for(let i=0;i<t;i++)e+=r.charAt(Math.floor(Math.random()*n));return e}function p7(t){return function(e){e.prototype.className=t.name,e.className=t.name,e.generateSDNA=function(){let r="",n=t.name,i=e.prototype,a=o1(8);r+=`subject_class("${n}", ${a}).
|
|
810
|
+
`,variables:{streamId:e,audio:r}}));return n}};Le=new WeakMap,es=new WeakMap;var Tr=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Pe=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},zt,ts,da,rs,ha,hn,ns,ma,ws=class{constructor(e,r=!0){zt.set(this,void 0),ts.set(this,void 0),da.set(this,void 0),rs.set(this,void 0),ha.set(this,void 0),hn.set(this,void 0),ns.set(this,void 0),ma.set(this,void 0),Tr(this,zt,e,"f"),Tr(this,ts,new Ca(Pe(this,zt,"f"),r),"f"),Tr(this,da,new zu(Pe(this,zt,"f")),"f"),Tr(this,rs,new qu(Pe(this,zt,"f")),"f"),Tr(this,ha,new Bu(Pe(this,zt,"f")),"f"),Tr(this,ma,new el(Pe(this,zt,"f"),r),"f"),Tr(this,hn,new ms(Pe(this,zt,"f"),r),"f"),Pe(this,hn,"f").setExpressionClient(Pe(this,da,"f")),Pe(this,hn,"f").setNeighbourhoodClient(Pe(this,ha,"f")),Pe(this,hn,"f").setAIClient(Pe(this,ma,"f")),Tr(this,ns,new Vu(Pe(this,zt,"f"),r),"f")}get agent(){return Pe(this,ts,"f")}get expression(){return Pe(this,da,"f")}get languages(){return Pe(this,rs,"f")}get neighbourhood(){return Pe(this,ha,"f")}get perspective(){return Pe(this,hn,"f")}get runtime(){return Pe(this,ns,"f")}get ai(){return Pe(this,ma,"f")}};zt=new WeakMap,ts=new WeakMap,da=new WeakMap,rs=new WeakMap,ha=new WeakMap,hn=new WeakMap,ns=new WeakMap,ma=new WeakMap;var Yd;(function(t){t.LanguageIsNotLoaded="LANGUAGE_IS_NOT_LOADED",t.ExpressionIsNotVerified="EXPRESSION_IS_NOT_VERIFIED",t.AgentIsUntrusted="AGENT_IS_UNTRUSTED",t.CapabilityRequested="CAPABILITY_REQUESTED",t.InstallNotificationRequest="INSTALL_NOTIFICATION_REQUEST"})(Yd||(Yd={}));var hl=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},ml=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},bn=class{constructor(e,r){this.language=e,this.expression=r}};hl([w(),ml("design:type",Ht)],bn.prototype,"language",void 0);hl([w(),ml("design:type",String)],bn.prototype,"expression",void 0);bn=hl([Z(),ml("design:paramtypes",[Ht,String])],bn);function G9(t){return t.language.address==="did"?t.expression.toString():`${t.language.address}://${t.expression}`}function H9(t){if(t.startsWith("literal://")){let a=new Ht;a.address="literal",a.name="literal";let o=t.substring(10);return new bn(a,o)}let r=/^([^:^\s]+):\/\/([\s\S]+)$/.exec(t);if(r&&r.length==3){let a=r[1],o=r[2],s=new Ht;return s.address=a,new bn(s,o)}let i=/^did:([^\s]+)$/.exec(t);if(i&&i.length==2){let a=new Ht;return a.address="did",new bn(a,t)}throw new Error("Couldn't parse string as expression URL or DID: "+t)}var bt=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Yt=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Ss=class{};bt([w(),Yt("design:type",String)],Ss.prototype,"name",void 0);bt([w(),Yt("design:type",String)],Ss.prototype,"type",void 0);Ss=bt([Z()],Ss);var Na=class{};bt([w(),Yt("design:type",String)],Na.prototype,"label",void 0);bt([w(),Yt("design:type",String)],Na.prototype,"name",void 0);bt([w(),Yt("design:type",Array)],Na.prototype,"parameters",void 0);Na=bt([Z()],Na);var Cs=class{get parameters(){return JSON.parse(this.parametersStringified)}constructor(e,r){this.name=e,this.parametersStringified=JSON.stringify(r)}};bt([w(),Yt("design:type",String)],Cs.prototype,"name",void 0);bt([w(),Yt("design:type",String)],Cs.prototype,"parametersStringified",void 0);Cs=bt([He(),Yt("design:paramtypes",[String,Object])],Cs);var Es=class{};bt([w(),Yt("design:type",String)],Es.prototype,"did",void 0);bt([w(),Yt("design:type",Uu)],Es.prototype,"status",void 0);Es=bt([Z()],Es);var Jd=class{},Ln=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Si=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},qr=class{};Ln([w(),Si("design:type",String)],qr.prototype,"name",void 0);Ln([w(),Si("design:type",String)],qr.prototype,"address",void 0);Ln([w(),Si("design:type",String)],qr.prototype,"settings",void 0);Ln([w(),Si("design:type",wn)],qr.prototype,"icon",void 0);Ln([w(),Si("design:type",wn)],qr.prototype,"constructorIcon",void 0);Ln([w(),Si("design:type",wn)],qr.prototype,"settingsIcon",void 0);qr=Ln([Z()],qr);var nt=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},lt=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},$t=class{};nt([w(),lt("design:type",String)],$t.prototype,"name",void 0);nt([w(),lt("design:type",String)],$t.prototype,"address",void 0);nt([w(),lt("design:type",String)],$t.prototype,"description",void 0);nt([w(),lt("design:type",String)],$t.prototype,"author",void 0);nt([w(),lt("design:type",Boolean)],$t.prototype,"templated",void 0);nt([w(),lt("design:type",String)],$t.prototype,"templateSourceLanguageAddress",void 0);nt([w(),lt("design:type",String)],$t.prototype,"templateAppliedParams",void 0);nt([w(),lt("design:type",Array)],$t.prototype,"possibleTemplateParams",void 0);nt([w(),lt("design:type",String)],$t.prototype,"sourceCodeLink",void 0);$t=nt([Z()],$t);var gi=class{constructor(e,r){this.name=e,this.description=r,this.description||(this.description="")}};nt([w(),lt("design:type",String)],gi.prototype,"name",void 0);nt([w(),lt("design:type",String)],gi.prototype,"description",void 0);nt([w(),lt("design:type",Array)],gi.prototype,"possibleTemplateParams",void 0);nt([w(),lt("design:type",String)],gi.prototype,"sourceCodeLink",void 0);gi=nt([He(),lt("design:paramtypes",[String,String])],gi);var Xd=class{},eh=class extends Br(){},th=class{},Ns=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},gl=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},xs=class{constructor(e,r){this.linkLanguage=e,this.meta=r}};Ns([w(),gl("design:type",String)],xs.prototype,"linkLanguage",void 0);Ns([w(),gl("design:type",$r)],xs.prototype,"meta",void 0);xs=Ns([Z(),gl("design:paramtypes",[String,$r])],xs);var tl=class extends Br(){};tl=Ns([Z()],tl);var Ci=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Ei=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},rl;(function(t){t.Private="PRIVATE",t.NeighboudhoodCreationInitiated="NEIGHBOURHOOD_CREATION_INITIATED",t.NeighbourhoodJoinInitiated="NEIGHBOURHOOD_JOIN_INITIATED",t.LinkLanguageFailedToInstall="LINK_LANGUAGE_FAILED_TO_INSTALL",t.LinkLanguageInstalledButNotSynced="LINK_LANGUAGE_INSTALLED_BUT_NOT_SYNCED",t.Synced="SYNCED"})(rl||(rl={}));var In=class{constructor(e,r,n){this.uuid=e,this.name=r,n?this.state=n:this.state=rl.Private}};Ci([w(),Ei("design:type",String)],In.prototype,"uuid",void 0);Ci([w(),Ei("design:type",String)],In.prototype,"name",void 0);Ci([w(),Ei("design:type",String)],In.prototype,"state",void 0);Ci([w(),Ei("design:type",String)],In.prototype,"sharedUrl",void 0);Ci([w(),Ei("design:type",tl)],In.prototype,"neighbourhood",void 0);In=Ci([Z(),Ei("design:paramtypes",[String,String,String])],In);var Rs=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},am=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ks=class{};Rs([w(),am("design:type",Array)],ks.prototype,"additions",void 0);Rs([w(),am("design:type",Array)],ks.prototype,"removals",void 0);ks=Rs([Z()],ks);var rh=class extends Br(){};rh=Rs([Z()],rh);var nh=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ci=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ga,mn,Vo="smart_literal://content";function I2(t){let e="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=r.length;for(let i=0;i<t;i++)e+=r.charAt(Math.floor(Math.random()*n));return e}var Ra=class{constructor(e,r){ga.set(this,void 0),mn.set(this,void 0),nh(this,ga,e,"f"),nh(this,mn,r,"f")}get base(){return ci(this,mn,"f")}static async create(e,r){let n=Lt.from(I2(10)).toUrl(),i=new Ra(e,n);return await i.set(r),i}static async isSmartLiteralBase(e,r){return(await e.get(new vt({source:r,predicate:Vo}))).length>0}static async getAllSmartLiterals(e){return(await e.get(new vt({predicate:Vo}))).map(n=>new Ra(e,n.data.source))}async get(){let e=await ci(this,ga,"f").getSingleTarget(new vt({source:ci(this,mn,"f"),predicate:Vo}));if(!e)throw`No content for smart literal ${ci(this,mn,"f")}`;return Lt.fromUrl(e).get()}async set(e){let r=Lt.from(e);await ci(this,ga,"f").setSingleTarget(new Cn({source:ci(this,mn,"f"),predicate:Vo,target:r.toUrl()}))}};ga=new WeakMap,mn=new WeakMap;var ih=class{};function o7(t,e,r){return{action:"addLink",source:t,predicate:e,target:r}}function s7(t){return`triple(this, "${t}", _)`}function c7(t){return function(e,r,n){if(typeof n.value!="function")throw new Error("InstanceQuery decorator can only be applied to methods");n.value=async function(a){let o=[],s=e.name,u=`subject_class("${s}", C), instance(C, Instance)`;if(t&&t.where)for(let l in t.where){let d=t.where[l];u+=`, property_getter(C, Instance, "${l}", "${d}")`}t&&t.condition&&(u+=", "+t.condition);let c=await a.infer(u);if(c==!1)return o;if(typeof c=="string")throw c;for(let l of c){let d=l.Instance,p=new hs(a,d,s);await p.init(),o.push(p)}return o}}}function u7(t){return function(e,r){if(t.required&&!t.initial)throw new Error("SubjectProperty requires an 'initial' option if 'required' is true");if(!t.through&&!t.getter)throw new Error("SubjectProperty requires either 'through' or 'getter' option");if(e.__properties=e.__properties||{},e.__properties[r]=e.__properties[r]||{},e.__properties[r]={...e.__properties[r],...t},t.writable){let n=r;e[`set${Dr(n)}`]=()=>{}}Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function l7(t){return function(e,r){if(!t.through&&!t.value)throw new Error("SubjectFlag requires a 'through' and 'value' option");if(!t.through)throw new Error("SubjectFlag requires a 'through' option");if(!t.value)throw new Error("SubjectFlag requires a 'value' option");e.__properties=e.__properties||{},e.__properties[r]=e.__properties[r]||{},e.__properties[r]={...e.__properties[r],through:t.through,required:!0,initial:t.value,flag:!0},e[r]=t.value,Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function f7(t){return function(e,r){e.__collections=e.__collections||{},e.__collections[r]=t;let n=r;e[`add${Dr(n)}`]=()=>{},e[`remove${Dr(n)}`]=()=>{},e[`setCollection${Dr(n)}`]=()=>{},Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function om(t){let e="",r="abcdefghijklmnopqrstuvwxyz",n=r.length;for(let i=0;i<t;i++)e+=r.charAt(Math.floor(Math.random()*n));return e}function p7(t){return function(e){e.prototype.className=t.name,e.className=t.name,e.generateSDNA=function(){let r="",n=t.name,i=e.prototype,a=om(8);r+=`subject_class("${n}", ${a}).
|
|
811
811
|
`;let o=[],s=[];i.subjectConstructor&&i.subjectConstructor.length&&(s=s.concat(i.subjectConstructor));let u=[];i.isSubjectInstance&&i.isSubjectInstance.length&&(u=u.concat(i.isSubjectInstance));let c=[],l=i.__properties||{};for(let h in l){let g=`property(${a}, "${h}").
|
|
812
812
|
`,{through:y,initial:S,required:b,resolveLanguage:v,writable:m,flag:A,getter:D,setter:E,local:O}=l[h];if(v&&(g+=`property_resolve(${a}, "${h}").
|
|
813
813
|
`,g+=`property_resolve_language(${a}, "${h}", "${v}").
|
|
@@ -1140,7 +1140,7 @@ type Mutation {
|
|
|
1140
1140
|
aiCloseTranscriptionStream(streamId: String!): String!
|
|
1141
1141
|
aiEmbed(modelId: String!, text: String!): String!
|
|
1142
1142
|
aiFeedTranscriptionStream(audio: [Float!]!, streamId: String!): String!
|
|
1143
|
-
aiOpenTranscriptionStream(modelId: String
|
|
1143
|
+
aiOpenTranscriptionStream(modelId: String!, params: VoiceActivityParamsInput): String!
|
|
1144
1144
|
aiPrompt(prompt: String!, taskId: String!): String!
|
|
1145
1145
|
aiRemoveModel(modelId: String!): Boolean!
|
|
1146
1146
|
aiRemoveTask(taskId: String!): AITask!
|
|
@@ -1355,7 +1355,15 @@ type TriggeredNotification {
|
|
|
1355
1355
|
perspectiveId: String!
|
|
1356
1356
|
triggerMatch: String!
|
|
1357
1357
|
}
|
|
1358
|
-
`;function ah(t){return t?.length?t.length===1?t.toString():t.length===2?t.join(" and "):t.slice(0,-1).join(", ")+", and "+t.slice(-1):""}function s1(t){let e=t.can.includes("*")?["READ","WRITE","UPDATE"]:t.can,r=t.with.domain==="*"?"":t.with.domain,n=t.with.pointers.includes("*")?["all AD4M data"]:t.with.pointers;return`${ah(e)} your ${r} actions, with access to ${ah(n)}`}var cn=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Q=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},tt,Pt,is,we,oh=class{constructor(t,e,r){tt.set(this,void 0),Pt.set(this,void 0),is.set(this,void 0),we.set(this,void 0),cn(this,tt,e||Lt.from(o1(24)).toUrl(),"f"),cn(this,we,t,"f"),cn(this,is,r||"ad4m://self","f")}get baseExpression(){return Q(this,tt,"f")}get perspective(){return Q(this,we,"f")}async getData(t){let e=t??Q(this,tt,"f"),r=await Q(this,we,"f").getSubjectData(Q(this,Pt,"f"),e);return Object.assign(this,r),cn(this,tt,e,"f"),this}async setProperty(key,value){let setters=await Q(this,we,"f").infer(`subject_class("${Q(this,Pt,"f")}", C), property_setter(C, "${key}", Setter)`);if(setters&&setters.length>0){let actions=eval(setters[0].Setter),resolveLanguageResults=await Q(this,we,"f").infer(`subject_class("${Q(this,Pt,"f")}", C), property_resolve_language(C, "${key}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),resolveLanguage&&(value=await Q(this,we,"f").createExpression(value,resolveLanguage)),await Q(this,we,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value}])}}async setCollectionSetter(key,value){let collectionSetters=await Q(this,we,"f").infer(`subject_class("${Q(this,Pt,"f")}", C), collection_setter(C, "${ur(key)}", Setter)`);if(collectionSetters||(collectionSetters=[]),collectionSetters.length>0){let actions=eval(collectionSetters[0].Setter);value&&(Array.isArray(value)?await Q(this,we,"f").executeAction(actions,Q(this,tt,"f"),value.map(t=>({name:"value",value:t}))):await Q(this,we,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value}]))}}async setCollectionAdder(key,value){let adders=await Q(this,we,"f").infer(`subject_class("${Q(this,Pt,"f")}", C), collection_adder(C, "${ur(key)}", Adder)`);if(adders||(adders=[]),adders.length>0){let actions=eval(adders[0].Adder);value&&(Array.isArray(value)?await Promise.all(value.map(t=>Q(this,we,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value:t}]))):await Q(this,we,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value}]))}}async setCollectionRemover(key,value){let removers=await Q(this,we,"f").infer(`subject_class("${Q(this,Pt,"f")}", C), collection_remover(C, "${ur(key)}", Remover)`);if(removers||(removers=[]),removers.length>0){let actions=eval(removers[0].Remover);value&&(Array.isArray(value)?await Promise.all(value.map(t=>Q(this,we,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value:t}]))):await Q(this,we,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value}]))}}async save(){cn(this,Pt,await Q(this,we,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await Q(this,we,"f").createSubject(this,Q(this,tt,"f")),await Q(this,we,"f").add(new Cn({source:Q(this,is,"f"),predicate:"ad4m://has_child",target:this.baseExpression})),await this.update()}async update(){cn(this,Pt,await Q(this,we,"f").stringOrTemplateObjectToSubjectClass(this),"f");let t=Object.entries(this);for(let[e,r]of t)if(r!=null)if(r?.action)switch(r.action){case"setter":await this.setCollectionSetter(e,r.value);break;case"adder":await this.setCollectionAdder(e,r.value);break;case"remover":await this.setCollectionRemover(e,r.value);default:await this.setCollectionSetter(e,r.value);break}else Array.isArray(r)&&r.length>0?await this.setCollectionSetter(e,r):r!=null&&r!==""&&await this.setProperty(e,r);await this.getData()}async get(){return cn(this,Pt,await Q(this,we,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await this.getData()}async delete(){await Q(this,we,"f").removeSubject(this,Q(this,tt,"f"))}static async all(t){let e=await t.stringOrTemplateObjectToSubjectClass(this),r=await t.getAllSubjectProxies(e),n=[];if(r){for(let i of r){let a=new this(t,i.X);n.push(await a.get())}return n}return[]}static async query(t,e){let r=e?.source||"ad4m://self",n=await t.stringOrTemplateObjectToSubjectClass(this),i=[],a=`subject_class("${n}", C), instance(C, Base), link("${r}", Predicate, Base, Timestamp, Author)`;if(e){if(e.where)if(e.where.condition)a+=", "+e.where.condition;else{let s=Object.entries(e.where);for(let u of s){let c=u[0],l=u[1];a+=`, property_getter(C, Base, "${c}", "${l}")`}}try{if((await t.infer(`findall([Timestamp, Base], (${a}), AllData), sort(AllData, SortedData), length(SortedData, DataLength).`))[0].DataLength>=e.size){let u=`findall([Timestamp, Base], (${a}), AllData), sort(AllData, SortedData), reverse(SortedData, ReverseSortedData), paginate(ReverseSortedData, ${e.page}, ${e.size}, PageData).`;i=await t.infer(u),i=i[0].PageData.map(c=>({Base:c[1],Timestamp:c[0]}))}else i=await t.infer(a)}catch(s){console.log("Query failed",s)}}else i=await t.infer(a);return i?await Promise.all(i.map(async s=>await new this(t,s.Base).get())):[]}};tt=new WeakMap,Pt=new WeakMap,is=new WeakMap,we=new WeakMap;var Ps="0.10.1-rc8";function D2(){let t=new AbortController;return setTimeout(()=>t.abort(),20),t}function yl(t,e=1e4){return pe(this,null,function*(){return Promise.race([new Promise((r,n)=>{try{t.includes("localhost")||r(new WebSocket(t));let i=new WebSocket(t);i.onopen=()=>{r(i)},i.onerror=a=>{n(a)}}catch(i){n(i)}}),new Promise((r,n)=>{setTimeout(()=>{n(new Error("WebSocket connection timed out"))},e)})])})}function vl(t){return pe(this,null,function*(){try{let e=yield fetch(`http://localhost:${t}/graphql/`,{signal:D2().signal,mode:"cors"});if(e.status===400||e.status===0||e.status===200)return t;throw new Error(`Could not connect to port ${t}`)}catch(e){throw new Error(`Could not connect to port ${t}`)}})}function N2(){return new Promise((t,e)=>{let r=document.querySelector("ad4m-connect"),n=r==null?void 0:r.getAd4mClient();n?t(n):e("No Ad4mClient found")})}function bl(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(t){return!1}return!0}function Ls(t,e){bl()&&localStorage.setItem(`${Ps}/${t}`,e)}function Jt(t){return bl()?localStorage.getItem(`${Ps}/${t}`):null}function _l(t){bl()&&localStorage.removeItem(`${Ps}/${t}`)}var R2=t=>{let e=new Set;do for(let r of Reflect.ownKeys(t))e.add([t,r]);while((t=Reflect.getPrototypeOf(t))&&t!==Object.prototype);return e};function Ua(t,{include:e,exclude:r}={}){let n=i=>{let a=o=>typeof o=="string"?i===o:o.test(i);return e?e.some(a):r?!r.some(a):!0};for(let[i,a]of R2(t.constructor.prototype)){if(a==="constructor"||!n(a))continue;let o=Reflect.getOwnPropertyDescriptor(i,a);o&&typeof o.value=="function"&&(t[a]=t[a].bind(t))}return t}var ja=class{constructor({appName:e,appDesc:r,appIconPath:n,appUrl:i,appDomain:a,capabilities:o,port:s,token:u,url:c,hosting:l}){this.activeSocket=null;this.requestedRestart=!1;this.authState="unauthenticated";this.connectionState="not_connected";this.port=12e3;this.capabilities=[];this.isHosting=!1;this.listeners={authstatechange:[],configstatechange:[],connectionstatechange:[]};Ua(this);this.appName=e,this.appDesc=r,this.appDomain=a,this.appUrl=i,this.appIconPath=n,this.capabilities=o,this.port=s||this.port,this.url=c||`ws://localhost:${this.port}/graphql`,this.token=u||this.token,this.isHosting=l||!1,this.buildClient()}notifyConfigChange(e,r){this.listeners.configstatechange.forEach(n=>{n(e,r)})}notifyConnectionChange(e){this.connectionState!==e&&(this.connectionState=e,this.listeners.connectionstatechange.forEach(r=>{r(e)}))}notifyAuthChange(e){this.authState!==e&&(this.authState=e,this.listeners.authstatechange.forEach(r=>{r(e)}))}setPort(e){this.port!==e&&(this.port=e,this.setUrl(`ws://localhost:${this.port}/graphql`),this.notifyConfigChange("port",e))}setUrl(e){this.url!==e&&(this.url=e,this.notifyConfigChange("url",e))}setToken(e){this.token!==e&&(this.token=e,this.notifyConfigChange("token",e))}on(e,r){this.listeners[e].push(r)}connect(e){return pe(this,null,function*(){try{if(e){yield yl(e,1e4),this.setUrl(e);let r=this.buildClient();return yield this.checkAuth(),r}else{let r=yield this.ensureConnection();return yield this.checkAuth(),r}}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}loginToHosting(e,r){return pe(this,null,function*(){try{let n=yield fetch("https://hosting.ad4m.dev/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,password:r})});if(n.status===200){let i=yield n.json();localStorage.setItem("hosting_token",i.token);let a=localStorage.getItem("hosting_token"),o=yield fetch("https://hosting.ad4m.dev/api/service/info",{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+a}});if(o.status===200){let s=yield o.json();if(s.serviceId)if(this.setPort(s.port),this.setUrl(s.url),this.isHosting=!0,Ls("ad4mhosting","true"),!s.paused)this.connect();else throw new Error("Hosting is not running")}}else if((yield n.json()).message==="Passwords did not match")throw new Error("Passwords did not match")}catch(n){throw console.log(n),new Error(`Error logging in ${n}`)}})}checkEmail(e){return pe(this,null,function*(){try{return(yield fetch(`https://hosting.ad4m.dev/api/auth/check-email?email=${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})).status===200}catch(r){console.log(r)}})}connectToPort(e){return pe(this,null,function*(){try{if(e){let r=yield vl(e);return this.setPort(r),this.buildClient()}else if(this.url.includes("localhost")){let r=yield this.findPort();return this.setPort(r),this.buildClient()}}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}ensureConnection(){return pe(this,null,function*(){var r,n;if(((r=this.activeSocket)==null?void 0:r.readyState)===WebSocket.OPEN&&((n=this.activeSocket)==null?void 0:n.url)===this.url&&this.ad4mClient)return this.ad4mClient;try{return this.notifyConnectionChange("connecting"),yield yl(this.url,1e4),this.buildClient()}catch(i){return this.notifyConnectionChange("not_connected"),this.connectToPort()}})}findPort(){return pe(this,null,function*(){let e=[...Array(10).keys()].map((i,a)=>vl(12e3+a)),n=(yield Promise.allSettled(e)).find(i=>i.status==="fulfilled");if(n)return n.value;throw Error("Couldn't find an open port")})}buildClient(){this.notifyConnectionChange("connecting");try{let e=new WebSocket(this.url)}catch(e){this.notifyConnectionChange("not_connected");return}return this.apolloClient&&this.wsClient&&(this.requestedRestart=!0,this.wsClient.dispose(),this.apolloClient.stop(),this.wsClient=null,this.apolloClient=null),this.wsClient=Zp({url:this.url,connectionParams:()=>pe(this,null,function*(){return{headers:{authorization:this.token}}}),on:{opened:e=>{this.activeSocket=e},error:e=>{this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")},connected:()=>{this.notifyConnectionChange("connected"),this.checkAuth()},closed:()=>pe(this,null,function*(){if(!this.requestedRestart)if(!this.token)this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1;else{let e=yield this.connect();e?this.ad4mClient=e:(this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1)}})}}),this.apolloClient=new uu({link:new Yp(this.wsClient),cache:new ko({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"},mutate:{fetchPolicy:"no-cache"}}}),this.ad4mClient=new ws(this.apolloClient),this.ad4mClient}checkAuth(){return pe(this,null,function*(){try{return(yield this.ad4mClient.agent.isLocked())?this.notifyAuthChange("locked"):(yield this.ad4mClient.agent.status(),this.notifyAuthChange("authenticated")),!0}catch(e){return e.message==="Socket closed with event 4500 Cannot extractByTags from a ciphered wallet. You must unlock first."?(this.notifyAuthChange("locked"),!0):(this.notifyAuthChange("unauthenticated"),!1)}})}requestCapability(e=!1){return pe(this,null,function*(){var r;if(e&&this.setToken(null),this.isHosting){let n=localStorage.getItem("hosting_token");(yield fetch("https://hosting.ad4m.dev/api/service/checkStatus",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+n}})).status!==200&&console.error("Looks like the client is not running you might not recieve the mail with the code, please check your dashboard logs.")}return this.requestId=yield(r=this.ad4mClient)==null?void 0:r.agent.requestCapability({appName:this.appName,appDesc:this.appDesc,appUrl:this.appUrl,appIconPath:this.appIconPath,appDomain:this.appDomain,capabilities:this.capabilities}),this.requestId})}verifyCode(e){return pe(this,null,function*(){var r;try{let n=yield(r=this.ad4mClient)==null?void 0:r.agent.generateJwt(this.requestId,e);return this.setToken(n),yield this.buildClient(),yield this.checkAuth(),this.token}catch(n){throw new Error("Invalid code")}})}clearState(){this.setToken(null),this.setPort(12e3),this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}};function wl({unlockAgent:t,reconnect:e}){return B`
|
|
1358
|
+
|
|
1359
|
+
input VoiceActivityParamsInput {
|
|
1360
|
+
endThreshold: Float
|
|
1361
|
+
endWindow: Float
|
|
1362
|
+
startThreshold: Float
|
|
1363
|
+
startWindow: Float
|
|
1364
|
+
timeBeforeSpeech: Float
|
|
1365
|
+
}
|
|
1366
|
+
`;function ah(t){return t?.length?t.length===1?t.toString():t.length===2?t.join(" and "):t.slice(0,-1).join(", ")+", and "+t.slice(-1):""}function sm(t){let e=t.can.includes("*")?["READ","WRITE","UPDATE"]:t.can,r=t.with.domain==="*"?"":t.with.domain,n=t.with.pointers.includes("*")?["all AD4M data"]:t.with.pointers;return`${ah(e)} your ${r} actions, with access to ${ah(n)}`}var cn=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Q=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},tt,Pt,is,we,oh=class{constructor(t,e,r){tt.set(this,void 0),Pt.set(this,void 0),is.set(this,void 0),we.set(this,void 0),cn(this,tt,e||Lt.from(om(24)).toUrl(),"f"),cn(this,we,t,"f"),cn(this,is,r||"ad4m://self","f")}get baseExpression(){return Q(this,tt,"f")}get perspective(){return Q(this,we,"f")}async getData(t){let e=t??Q(this,tt,"f"),r=await Q(this,we,"f").getSubjectData(Q(this,Pt,"f"),e);return Object.assign(this,r),cn(this,tt,e,"f"),this}async setProperty(key,value){let setters=await Q(this,we,"f").infer(`subject_class("${Q(this,Pt,"f")}", C), property_setter(C, "${key}", Setter)`);if(setters&&setters.length>0){let actions=eval(setters[0].Setter),resolveLanguageResults=await Q(this,we,"f").infer(`subject_class("${Q(this,Pt,"f")}", C), property_resolve_language(C, "${key}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),resolveLanguage&&(value=await Q(this,we,"f").createExpression(value,resolveLanguage)),await Q(this,we,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value}])}}async setCollectionSetter(key,value){let collectionSetters=await Q(this,we,"f").infer(`subject_class("${Q(this,Pt,"f")}", C), collection_setter(C, "${ur(key)}", Setter)`);if(collectionSetters||(collectionSetters=[]),collectionSetters.length>0){let actions=eval(collectionSetters[0].Setter);value&&(Array.isArray(value)?await Q(this,we,"f").executeAction(actions,Q(this,tt,"f"),value.map(t=>({name:"value",value:t}))):await Q(this,we,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value}]))}}async setCollectionAdder(key,value){let adders=await Q(this,we,"f").infer(`subject_class("${Q(this,Pt,"f")}", C), collection_adder(C, "${ur(key)}", Adder)`);if(adders||(adders=[]),adders.length>0){let actions=eval(adders[0].Adder);value&&(Array.isArray(value)?await Promise.all(value.map(t=>Q(this,we,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value:t}]))):await Q(this,we,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value}]))}}async setCollectionRemover(key,value){let removers=await Q(this,we,"f").infer(`subject_class("${Q(this,Pt,"f")}", C), collection_remover(C, "${ur(key)}", Remover)`);if(removers||(removers=[]),removers.length>0){let actions=eval(removers[0].Remover);value&&(Array.isArray(value)?await Promise.all(value.map(t=>Q(this,we,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value:t}]))):await Q(this,we,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value}]))}}async save(){cn(this,Pt,await Q(this,we,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await Q(this,we,"f").createSubject(this,Q(this,tt,"f")),await Q(this,we,"f").add(new Cn({source:Q(this,is,"f"),predicate:"ad4m://has_child",target:this.baseExpression})),await this.update()}async update(){cn(this,Pt,await Q(this,we,"f").stringOrTemplateObjectToSubjectClass(this),"f");let t=Object.entries(this);for(let[e,r]of t)if(r!=null)if(r?.action)switch(r.action){case"setter":await this.setCollectionSetter(e,r.value);break;case"adder":await this.setCollectionAdder(e,r.value);break;case"remover":await this.setCollectionRemover(e,r.value);default:await this.setCollectionSetter(e,r.value);break}else Array.isArray(r)&&r.length>0?await this.setCollectionSetter(e,r):r!=null&&r!==""&&await this.setProperty(e,r);await this.getData()}async get(){return cn(this,Pt,await Q(this,we,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await this.getData()}async delete(){await Q(this,we,"f").removeSubject(this,Q(this,tt,"f"))}static async all(t){let e=await t.stringOrTemplateObjectToSubjectClass(this),r=await t.getAllSubjectProxies(e),n=[];if(r){for(let i of r){let a=new this(t,i.X);n.push(await a.get())}return n}return[]}static async query(t,e){let r=e?.source||"ad4m://self",n=await t.stringOrTemplateObjectToSubjectClass(this),i=[],a=`subject_class("${n}", C), instance(C, Base), link("${r}", Predicate, Base, Timestamp, Author)`;if(e){if(e.where)if(e.where.condition)a+=", "+e.where.condition;else{let s=Object.entries(e.where);for(let u of s){let c=u[0],l=u[1];a+=`, property_getter(C, Base, "${c}", "${l}")`}}try{if((await t.infer(`findall([Timestamp, Base], (${a}), AllData), sort(AllData, SortedData), length(SortedData, DataLength).`))[0].DataLength>=e.size){let u=`findall([Timestamp, Base], (${a}), AllData), sort(AllData, SortedData), reverse(SortedData, ReverseSortedData), paginate(ReverseSortedData, ${e.page}, ${e.size}, PageData).`;i=await t.infer(u),i=i[0].PageData.map(c=>({Base:c[1],Timestamp:c[0]}))}else i=await t.infer(a)}catch(s){console.log("Query failed",s)}}else i=await t.infer(a);return i?await Promise.all(i.map(async s=>await new this(t,s.Base).get())):[]}};tt=new WeakMap,Pt=new WeakMap,is=new WeakMap,we=new WeakMap;var Ps="0.10.1-rc9-dev";function D2(){let t=new AbortController;return setTimeout(()=>t.abort(),20),t}function yl(t,e=1e4){return pe(this,null,function*(){return Promise.race([new Promise((r,n)=>{try{t.includes("localhost")||r(new WebSocket(t));let i=new WebSocket(t);i.onopen=()=>{r(i)},i.onerror=a=>{n(a)}}catch(i){n(i)}}),new Promise((r,n)=>{setTimeout(()=>{n(new Error("WebSocket connection timed out"))},e)})])})}function vl(t){return pe(this,null,function*(){try{let e=yield fetch(`http://localhost:${t}/graphql/`,{signal:D2().signal,mode:"cors"});if(e.status===400||e.status===0||e.status===200)return t;throw new Error(`Could not connect to port ${t}`)}catch(e){throw new Error(`Could not connect to port ${t}`)}})}function N2(){return new Promise((t,e)=>{let r=document.querySelector("ad4m-connect"),n=r==null?void 0:r.getAd4mClient();n?t(n):e("No Ad4mClient found")})}function bl(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(t){return!1}return!0}function Ls(t,e){bl()&&localStorage.setItem(`${Ps}/${t}`,e)}function Jt(t){return bl()?localStorage.getItem(`${Ps}/${t}`):null}function _l(t){bl()&&localStorage.removeItem(`${Ps}/${t}`)}var R2=t=>{let e=new Set;do for(let r of Reflect.ownKeys(t))e.add([t,r]);while((t=Reflect.getPrototypeOf(t))&&t!==Object.prototype);return e};function Ua(t,{include:e,exclude:r}={}){let n=i=>{let a=o=>typeof o=="string"?i===o:o.test(i);return e?e.some(a):r?!r.some(a):!0};for(let[i,a]of R2(t.constructor.prototype)){if(a==="constructor"||!n(a))continue;let o=Reflect.getOwnPropertyDescriptor(i,a);o&&typeof o.value=="function"&&(t[a]=t[a].bind(t))}return t}var ja=class{constructor({appName:e,appDesc:r,appIconPath:n,appUrl:i,appDomain:a,capabilities:o,port:s,token:u,url:c,hosting:l}){this.activeSocket=null;this.requestedRestart=!1;this.authState="unauthenticated";this.connectionState="not_connected";this.port=12e3;this.capabilities=[];this.isHosting=!1;this.listeners={authstatechange:[],configstatechange:[],connectionstatechange:[]};Ua(this);this.appName=e,this.appDesc=r,this.appDomain=a,this.appUrl=i,this.appIconPath=n,this.capabilities=o,this.port=s||this.port,this.url=c||`ws://localhost:${this.port}/graphql`,this.token=u||this.token,this.isHosting=l||!1,this.buildClient()}notifyConfigChange(e,r){this.listeners.configstatechange.forEach(n=>{n(e,r)})}notifyConnectionChange(e){this.connectionState!==e&&(this.connectionState=e,this.listeners.connectionstatechange.forEach(r=>{r(e)}))}notifyAuthChange(e){this.authState!==e&&(this.authState=e,this.listeners.authstatechange.forEach(r=>{r(e)}))}setPort(e){this.port!==e&&(this.port=e,this.setUrl(`ws://localhost:${this.port}/graphql`),this.notifyConfigChange("port",e))}setUrl(e){this.url!==e&&(this.url=e,this.notifyConfigChange("url",e))}setToken(e){this.token!==e&&(this.token=e,this.notifyConfigChange("token",e))}on(e,r){this.listeners[e].push(r)}connect(e){return pe(this,null,function*(){try{if(e){yield yl(e,1e4),this.setUrl(e);let r=this.buildClient();return yield this.checkAuth(),r}else{let r=yield this.ensureConnection();return yield this.checkAuth(),r}}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}loginToHosting(e,r){return pe(this,null,function*(){try{let n=yield fetch("https://hosting.ad4m.dev/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,password:r})});if(n.status===200){let i=yield n.json();localStorage.setItem("hosting_token",i.token);let a=localStorage.getItem("hosting_token"),o=yield fetch("https://hosting.ad4m.dev/api/service/info",{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+a}});if(o.status===200){let s=yield o.json();if(s.serviceId)if(this.setPort(s.port),this.setUrl(s.url),this.isHosting=!0,Ls("ad4mhosting","true"),!s.paused)this.connect();else throw new Error("Hosting is not running")}}else if((yield n.json()).message==="Passwords did not match")throw new Error("Passwords did not match")}catch(n){throw console.log(n),new Error(`Error logging in ${n}`)}})}checkEmail(e){return pe(this,null,function*(){try{return(yield fetch(`https://hosting.ad4m.dev/api/auth/check-email?email=${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})).status===200}catch(r){console.log(r)}})}connectToPort(e){return pe(this,null,function*(){try{if(e){let r=yield vl(e);return this.setPort(r),this.buildClient()}else if(this.url.includes("localhost")){let r=yield this.findPort();return this.setPort(r),this.buildClient()}}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}ensureConnection(){return pe(this,null,function*(){var r,n;if(((r=this.activeSocket)==null?void 0:r.readyState)===WebSocket.OPEN&&((n=this.activeSocket)==null?void 0:n.url)===this.url&&this.ad4mClient)return this.ad4mClient;try{return this.notifyConnectionChange("connecting"),yield yl(this.url,1e4),this.buildClient()}catch(i){return this.notifyConnectionChange("not_connected"),this.connectToPort()}})}findPort(){return pe(this,null,function*(){let e=[...Array(10).keys()].map((i,a)=>vl(12e3+a)),n=(yield Promise.allSettled(e)).find(i=>i.status==="fulfilled");if(n)return n.value;throw Error("Couldn't find an open port")})}buildClient(){this.notifyConnectionChange("connecting");try{let e=new WebSocket(this.url)}catch(e){this.notifyConnectionChange("not_connected");return}return this.apolloClient&&this.wsClient&&(this.requestedRestart=!0,this.wsClient.dispose(),this.apolloClient.stop(),this.wsClient=null,this.apolloClient=null),this.wsClient=Zp({url:this.url,connectionParams:()=>pe(this,null,function*(){return{headers:{authorization:this.token}}}),on:{opened:e=>{this.activeSocket=e},error:e=>{this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")},connected:()=>{this.notifyConnectionChange("connected"),this.checkAuth()},closed:()=>pe(this,null,function*(){if(!this.requestedRestart)if(!this.token)this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1;else{let e=yield this.connect();e?this.ad4mClient=e:(this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1)}})}}),this.apolloClient=new uu({link:new Yp(this.wsClient),cache:new ko({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"},mutate:{fetchPolicy:"no-cache"}}}),this.ad4mClient=new ws(this.apolloClient),this.ad4mClient}checkAuth(){return pe(this,null,function*(){try{return(yield this.ad4mClient.agent.isLocked())?this.notifyAuthChange("locked"):(yield this.ad4mClient.agent.status(),this.notifyAuthChange("authenticated")),!0}catch(e){return e.message==="Socket closed with event 4500 Cannot extractByTags from a ciphered wallet. You must unlock first."?(this.notifyAuthChange("locked"),!0):(this.notifyAuthChange("unauthenticated"),!1)}})}requestCapability(e=!1){return pe(this,null,function*(){var r;if(e&&this.setToken(null),this.isHosting){let n=localStorage.getItem("hosting_token");(yield fetch("https://hosting.ad4m.dev/api/service/checkStatus",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+n}})).status!==200&&console.error("Looks like the client is not running you might not recieve the mail with the code, please check your dashboard logs.")}return this.requestId=yield(r=this.ad4mClient)==null?void 0:r.agent.requestCapability({appName:this.appName,appDesc:this.appDesc,appUrl:this.appUrl,appIconPath:this.appIconPath,appDomain:this.appDomain,capabilities:this.capabilities}),this.requestId})}verifyCode(e){return pe(this,null,function*(){var r;try{let n=yield(r=this.ad4mClient)==null?void 0:r.agent.generateJwt(this.requestId,e);return this.setToken(n),yield this.buildClient(),yield this.checkAuth(),this.token}catch(n){throw new Error("Invalid code")}})}clearState(){this.setToken(null),this.setPort(12e3),this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}};function wl({unlockAgent:t,reconnect:e}){return B`
|
|
1359
1367
|
<div class="text-center">
|
|
1360
1368
|
<div class="items">
|
|
1361
1369
|
<div>
|
|
@@ -1527,7 +1535,7 @@ type TriggeredNotification {
|
|
|
1527
1535
|
/>
|
|
1528
1536
|
</svg>
|
|
1529
1537
|
</span>
|
|
1530
|
-
<span>${
|
|
1538
|
+
<span>${sm(o)}</span>
|
|
1531
1539
|
</li>`)}
|
|
1532
1540
|
</ul>
|
|
1533
1541
|
</div>
|