@coasys/ad4m-connect 0.10.1-dev-1 → 0.10.1-multi-user-1

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/web.js CHANGED
@@ -1,33 +1,33 @@
1
- var X1=Object.defineProperty;var em=Object.getOwnPropertyDescriptor;var Ce=(t,e,r,n)=>{for(var i=n>1?void 0:n?em(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&&X1(e,r,i),i};var ge=(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 se,ZBarConfigType as yp,scanRGBABuffer as tm,getDefaultScanner as rm}from"https://cdn.jsdelivr.net/npm/@undecaf/zbar-wasm@0.9.15/dist/main.js";function nm(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 L=class{constructor(e,r=yp.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 L.formatsToConfigs[e]=r,L.typesToFormats[n]=L.typesToFormats[n]||e,r}static formats(){return Object.keys(L.formatsToConfigs)}static toFormat(e){return L.typesToFormats[e]}static configure(e,r){var n;(n=L.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}},gp;L.formatsToConfigs={},L.typesToFormats={},L.register("codabar",new L(se.ZBAR_CODABAR)),L.register("code_39",new L(se.ZBAR_CODE39)),L.register("code_93",new L(se.ZBAR_CODE93)),L.register("code_128",new L(se.ZBAR_CODE128)),L.register("databar",new L(se.ZBAR_DATABAR)),L.register("databar_exp",new L(se.ZBAR_DATABAR_EXP)),L.register("ean_2",new L(se.ZBAR_EAN2)),L.register("ean_5",new L(se.ZBAR_EAN5)),L.register("ean_8",new L(se.ZBAR_EAN8)),L.register("ean_13",new L(se.ZBAR_EAN13)),L.register("ean_13+2",new L(se.ZBAR_EAN13)).add(new L(se.ZBAR_EAN2)),L.register("ean_13+5",new L(se.ZBAR_EAN13)).add(new L(se.ZBAR_EAN5)),L.register("isbn_10",new L(se.ZBAR_ISBN10)).add(new L(se.ZBAR_EAN13)),L.register("isbn_13",new L(se.ZBAR_ISBN13)).add(new L(se.ZBAR_EAN13)),L.register("isbn_13+2",new L(se.ZBAR_ISBN13)).add(new L(se.ZBAR_EAN13)).add(new L(se.ZBAR_EAN2)),L.register("isbn_13+5",new L(se.ZBAR_ISBN13)).add(new L(se.ZBAR_EAN13)).add(new L(se.ZBAR_EAN5)),L.register("itf",new L(se.ZBAR_I25)),L.register("qr_code",new L(se.ZBAR_QRCODE)),L.register("sq_code",new L(se.ZBAR_SQCODE)),L.register("upc_a",new L(se.ZBAR_UPCA)).add(new L(se.ZBAR_EAN13)),L.register("upc_e",new L(se.ZBAR_UPCE)).add(new L(se.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"}(gp||(gp={}));var yc=class{},im=(()=>{try{return new OffscreenCanvas(1,1).getContext("2d")instanceof OffscreenCanvasRenderingContext2D}catch{return!1}})(),Ar=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=>!L.formats().includes(n));if(r.length)throw new TypeError(`Unsupported barcode format(s): ${r.join(", ")}`)}this.formats=e.formats||L.formats(),this.zbarConfig=e.zbar||new yc}static getSupportedFormats(){return Promise.resolve(L.formats())}detect(e){if(!Ar.isImageBitmapSource(e))throw new TypeError("BarcodeDetector.detect() argument is not an ImageBitmapSource");let r=Ar.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),tm(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)=>nm(this,void 0,void 0,function*(){if(!this.scanner){let n=yield rm();this.formats.length>0&&(n.setConfig(se.ZBAR_NONE,yp.ZBAR_CFG_ENABLE,0),this.formats.forEach(i=>L.configure(n,i))),this.scanner=n}e(this.scanner)}))}toImageData(e){let r=n=>{let i=Ar.intrinsicDimensions(n);this.canvas&&this.canvas.width===i.width&&this.canvas.height===i.height||(this.canvas=function(s,u){if(im)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:L.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 bo=window,_o=bo.ShadowRoot&&(bo.ShadyCSS===void 0||bo.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,vc=Symbol(),vp=new WeakMap,Wi=class{constructor(e,r,n){if(this._$cssResult$=!0,n!==vc)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(_o&&e===void 0){let n=r!==void 0&&r.length===1;n&&(e=vp.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&vp.set(r,e))}return e}toString(){return this.cssText}},bp=t=>new Wi(typeof t=="string"?t:t+"",void 0,vc),bc=(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 Wi(r,t,vc)},_c=(t,e)=>{_o?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{let n=document.createElement("style"),i=bo.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)})},wo=_o?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let n of e.cssRules)r+=n.cssText;return bp(r)})(t):t;var wc,So=window,_p=So.trustedTypes,am=_p?_p.emptyScript:"",wp=So.reactiveElementPolyfillSupport,Cc={toAttribute(t,e){switch(e){case Boolean:t=t?am: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}},Sp=(t,e)=>e!==t&&(e==e||t==t),Sc={attribute:!0,type:String,converter:Cc,reflect:!1,hasChanged:Sp},xc="finalized",fr=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=Sc){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)||Sc}static finalize(){if(this.hasOwnProperty(xc))return!1;this[xc]=!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(wo(i))}else e!==void 0&&r.push(wo(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 _c(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=Sc){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:Cc).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:Cc;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||Sp)(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){}};fr[xc]=!0,fr.elementProperties=new Map,fr.elementStyles=[],fr.shadowRootOptions={mode:"open"},wp?.({ReactiveElement:fr}),((wc=So.reactiveElementVersions)!==null&&wc!==void 0?wc:So.reactiveElementVersions=[]).push("1.6.3");var Ec,Co=window,ri=Co.trustedTypes,Cp=ri?ri.createPolicy("lit-html",{createHTML:t=>t}):void 0,Ic="$lit$",Tr=`lit$${(Math.random()+"").slice(9)}$`,Op="?"+Tr,om=`<${Op}>`,ln=document,Zi=()=>ln.createComment(""),Ji=t=>t===null||typeof t!="object"&&typeof t!="function",Dp=Array.isArray,sm=t=>Dp(t)||typeof t?.[Symbol.iterator]=="function",kc=`[
2
- \f\r]`,Ki=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,xp=/-->/g,Ep=/>/g,cn=RegExp(`>|${kc}(?:([^\\s"'>=/]+)(${kc}*=${kc}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),kp=/'/g,Ip=/"/g,Np=/^(?:script|style|textarea|title)$/i,Pp=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),Q=Pp(1),F3=Pp(2),pn=Symbol.for("lit-noChange"),ze=Symbol.for("lit-nothing"),Ap=new WeakMap,un=ln.createTreeWalker(ln,129,null,!1);function Rp(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Cp!==void 0?Cp.createHTML(e):e}var cm=(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,f=0;for(;f<u.length&&(o.lastIndex=f,l=o.exec(u),l!==null);)f=o.lastIndex,o===Ki?l[1]==="!--"?o=xp:l[1]!==void 0?o=Ep:l[2]!==void 0?(Np.test(l[2])&&(i=RegExp("</"+l[2],"g")),o=cn):l[3]!==void 0&&(o=cn):o===cn?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?cn:l[3]==='"'?Ip:kp):o===Ip||o===kp?o=cn:o===xp||o===Ep?o=Ki:(o=cn,i=void 0);let p=o===cn&&t[s+1].startsWith("/>")?" ":"";a+=o===Ki?u+om:d>=0?(n.push(c),u.slice(0,d)+Ic+u.slice(d)+Tr+p):u+Tr+(d===-2?(n.push(void 0),s):p)}return[Rp(t,a+(t[r]||"<?>")+(e===2?"</svg>":"")),n]},fn=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]=cm(e,r);if(this.el=fn.createElement(c,n),un.currentNode=this.el.content,r===2){let d=this.el.content,f=d.firstChild;f.remove(),d.append(...f.childNodes)}for(;(i=un.nextNode())!==null&&u.length<s;){if(i.nodeType===1){if(i.hasAttributes()){let d=[];for(let f of i.getAttributeNames())if(f.endsWith(Ic)||f.startsWith(Tr)){let p=l[o++];if(d.push(f),p!==void 0){let h=i.getAttribute(p.toLowerCase()+Ic).split(Tr),g=/([.?@])?(.*)/.exec(p);u.push({type:1,index:a,name:g[2],strings:h,ctor:g[1]==="."?Tc:g[1]==="?"?Oc:g[1]==="@"?Dc:ii})}else u.push({type:6,index:a})}for(let f of d)i.removeAttribute(f)}if(Np.test(i.tagName)){let d=i.textContent.split(Tr),f=d.length-1;if(f>0){i.textContent=ri?ri.emptyScript:"";for(let p=0;p<f;p++)i.append(d[p],Zi()),un.nextNode(),u.push({type:2,index:++a});i.append(d[f],Zi())}}}else if(i.nodeType===8)if(i.data===Op)u.push({type:2,index:a});else{let d=-1;for(;(d=i.data.indexOf(Tr,d+1))!==-1;)u.push({type:7,index:a}),d+=Tr.length-1}a++}}static createElement(e,r){let n=ln.createElement("template");return n.innerHTML=e,n}};function ni(t,e,r=t,n){var i,a,o,s;if(e===pn)return e;let u=n!==void 0?(i=r._$Co)===null||i===void 0?void 0:i[n]:r._$Cl,c=Ji(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=ni(t,u._$AS(t,e.values),u,n)),e}var Ac=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:ln).importNode(n,!0);un.currentNode=a;let o=un.nextNode(),s=0,u=0,c=i[0];for(;c!==void 0;){if(s===c.index){let l;c.type===2?l=new dn(o,o.nextSibling,this,e):c.type===1?l=new c.ctor(o,c.name,c.strings,this,e):c.type===6&&(l=new Nc(o,this,e)),this._$AV.push(l),c=i[++u]}s!==c?.index&&(o=un.nextNode(),s++)}return un.currentNode=ln,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++}},dn=class{constructor(e,r,n,i){var a;this.type=2,this._$AH=ze,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=ni(this,e,r),Ji(e)?e===ze||e==null||e===""?(this._$AH!==ze&&this._$AR(),this._$AH=ze):e!==this._$AH&&e!==pn&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):sm(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!==ze&&Ji(this._$AH)?this._$AA.nextSibling.data=e:this.$(ln.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=fn.createElement(Rp(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 Ac(a,this),s=o.u(this.options);o.v(n),this.$(s),this._$AH=o}}_$AC(e){let r=Ap.get(e.strings);return r===void 0&&Ap.set(e.strings,r=new fn(e)),r}T(e){Dp(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 dn(this.k(Zi()),this.k(Zi()),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))}},ii=class{constructor(e,r,n,i,a){this.type=1,this._$AH=ze,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=ze}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=ni(this,e,r,0),o=!Ji(e)||e!==this._$AH&&e!==pn,o&&(this._$AH=e);else{let s=e,u,c;for(e=a[0],u=0;u<a.length-1;u++)c=ni(this,s[n+u],r,u),c===pn&&(c=this._$AH[u]),o||(o=!Ji(c)||c!==this._$AH[u]),c===ze?e=ze:e!==ze&&(e+=(c??"")+a[u+1]),this._$AH[u]=c}o&&!i&&this.j(e)}j(e){e===ze?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Tc=class extends ii{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===ze?void 0:e}},um=ri?ri.emptyScript:"",Oc=class extends ii{constructor(){super(...arguments),this.type=4}j(e){e&&e!==ze?this.element.setAttribute(this.name,um):this.element.removeAttribute(this.name)}},Dc=class extends ii{constructor(e,r,n,i,a){super(e,r,n,i,a),this.type=5}_$AI(e,r=this){var n;if((e=(n=ni(this,e,r,0))!==null&&n!==void 0?n:ze)===pn)return;let i=this._$AH,a=e===ze&&i!==ze||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,o=e!==ze&&(i===ze||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)}},Nc=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){ni(this,e)}};var Tp=Co.litHtmlPolyfillSupport;Tp?.(fn,dn),((Ec=Co.litHtmlVersions)!==null&&Ec!==void 0?Ec:Co.litHtmlVersions=[]).push("2.8.0");var $p=(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 dn(e.insertBefore(Zi(),s),s,void 0,r??{})}return o._$AI(t),o};var Pc,Rc;var Or=class extends fr{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=$p(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 pn}};Or.finalized=!0,Or._$litElement$=!0,(Pc=globalThis.litElementHydrateSupport)===null||Pc===void 0||Pc.call(globalThis,{LitElement:Or});var Lp=globalThis.litElementPolyfillSupport;Lp?.({LitElement:Or});((Rc=globalThis.litElementVersions)!==null&&Rc!==void 0?Rc:globalThis.litElementVersions=[]).push("3.3.3");var Fp=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 lm=(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)}},pm=(t,e,r)=>{e.constructor.createProperty(r,t)};function St(t){return(e,r)=>r!==void 0?pm(t,e,r):lm(t,e)}function ot(t){return St({...t,state:!0})}var $c,lb=(($c=window.HTMLSlotElement)===null||$c===void 0?void 0:$c.prototype.assignedElements)!=null?(t,e)=>t.assignedElements(e):(t,e)=>t.assignedNodes(e).filter(r=>r.nodeType===Node.ELEMENT_NODE);var Lc=function(t,e){return Lc=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])},Lc(t,e)};function Oe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Lc(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var w=function(){return w=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},w.apply(this,arguments)};function Zt(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 jt(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 Bt(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 Dr(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 Fc="Invariant Violation",Mp=Object.setPrototypeOf,fm=Mp===void 0?function(t,e){return t.__proto__=e,t}:Mp,z=function(t){Oe(e,t);function e(r){r===void 0&&(r=Fc);var n=t.call(this,typeof r=="number"?Fc+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=Fc,fm(n,e.prototype),n}return e}(Error);function D(t,e){if(!t)throw new z(e)}var Eo=["debug","log","warn","error","silent"],Mc=Eo.indexOf("log");function xo(t){return function(){if(Eo.indexOf(t)>=Mc){var e=console[t]||console.log;return e.apply(console,arguments)}}}(function(t){t.debug=xo("debug"),t.log=xo("log"),t.warn=xo("warn"),t.error=xo("error")})(D||(D={}));function Up(t){var e=Eo[Mc];return Mc=Math.max(0,Eo.indexOf(t)),e}function Ge(t){try{return t()}catch{}}var ko=Ge(function(){return globalThis})||Ge(function(){return window})||Ge(function(){return self})||Ge(function(){return global})||Ge(function(){return Ge.constructor("return this")()});var jp="__",Bp=[jp,jp].join("DEV");function dm(){try{return Boolean(__DEV__)}catch{return Object.defineProperty(ko,Bp,{value:Ge(function(){return"production"})!=="production",enumerable:!1,configurable:!0,writable:!0}),ko[Bp]}}var hn=dm();function Nr(t){try{return t()}catch{}}var Uc=Nr(function(){return globalThis})||Nr(function(){return window})||Nr(function(){return self})||Nr(function(){return global})||Nr(function(){return Nr.constructor("return this")()}),jc=!1;function hm(){Uc&&!Nr(function(){return"production"})&&!Nr(function(){return process})&&(Object.defineProperty(Uc,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),jc=!0)}hm();function Bc(){jc&&(delete Uc.process,jc=!1)}var Lb=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",Fb=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator",qp=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";var $e=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 qc(t,e){var r=Boolean(t);if(!r)throw new Error(e??"Unexpected invariant triggered.")}var mm=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,Xi=mm;function Io(t){var e=t.prototype.toJSON;typeof e=="function"||qc(0),t.prototype.inspect=e,Xi&&(t.prototype[Xi]=e)}var Vp=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}();Io(Vp);var Qp=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}();Io(Qp);function Vc(t){return t!=null&&typeof t.kind=="string"}function Ao(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ao=function(r){return typeof r}:Ao=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ao(t)}var gm=10,zp=2;function ea(t){return To(t,[])}function To(t,e){switch(Ao(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return t===null?"null":ym(t,e);default:return String(t)}}function ym(t,e){if(e.indexOf(t)!==-1)return"[Circular]";var r=[].concat(e,[t]),n=_m(t);if(n!==void 0){var i=n.call(t);if(i!==t)return typeof i=="string"?i:To(i,r)}else if(Array.isArray(t))return bm(t,r);return vm(t,r)}function vm(t,e){var r=Object.keys(t);if(r.length===0)return"{}";if(e.length>zp)return"["+wm(t)+"]";var n=r.map(function(i){var a=To(t[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function bm(t,e){if(t.length===0)return"[]";if(e.length>zp)return"[Array]";for(var r=Math.min(gm,t.length),n=t.length-r,i=[],a=0;a<r;++a)i.push(To(t[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function _m(t){var e=t[String(Xi)];if(typeof e=="function")return e;if(typeof t.inspect=="function")return t.inspect}function wm(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 ta(t,e){var r=Boolean(t);if(!r)throw new Error(e)}function Gp(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 Sm(t,e,r){return e&&Gp(t.prototype,e),r&&Gp(t,r),t}var Oo=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"||ta(0,"Body must be a string. Received: ".concat(ea(e),".")),this.body=e,this.name=r,this.locationOffset=n,this.locationOffset.line>0||ta(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||ta(0,"column in locationOffset is 1-indexed and must be positive.")}return Sm(t,[{key:qp,get:function(){return"Source"}}]),t}();function Hp(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(`
1
+ var im=Object.defineProperty;var am=Object.getOwnPropertyDescriptor;var X=(t,e,r,n)=>{for(var i=n>1?void 0:n?am(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&&im(e,r,i),i};var ee=(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 pe,ZBarConfigType as Cp,scanRGBABuffer as om,getDefaultScanner as sm}from"https://cdn.jsdelivr.net/npm/@undecaf/zbar-wasm@0.9.15/dist/main.js";function cm(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 F=class{constructor(e,r=Cp.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 F.formatsToConfigs[e]=r,F.typesToFormats[n]=F.typesToFormats[n]||e,r}static formats(){return Object.keys(F.formatsToConfigs)}static toFormat(e){return F.typesToFormats[e]}static configure(e,r){var n;(n=F.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}},Sp;F.formatsToConfigs={},F.typesToFormats={},F.register("codabar",new F(pe.ZBAR_CODABAR)),F.register("code_39",new F(pe.ZBAR_CODE39)),F.register("code_93",new F(pe.ZBAR_CODE93)),F.register("code_128",new F(pe.ZBAR_CODE128)),F.register("databar",new F(pe.ZBAR_DATABAR)),F.register("databar_exp",new F(pe.ZBAR_DATABAR_EXP)),F.register("ean_2",new F(pe.ZBAR_EAN2)),F.register("ean_5",new F(pe.ZBAR_EAN5)),F.register("ean_8",new F(pe.ZBAR_EAN8)),F.register("ean_13",new F(pe.ZBAR_EAN13)),F.register("ean_13+2",new F(pe.ZBAR_EAN13)).add(new F(pe.ZBAR_EAN2)),F.register("ean_13+5",new F(pe.ZBAR_EAN13)).add(new F(pe.ZBAR_EAN5)),F.register("isbn_10",new F(pe.ZBAR_ISBN10)).add(new F(pe.ZBAR_EAN13)),F.register("isbn_13",new F(pe.ZBAR_ISBN13)).add(new F(pe.ZBAR_EAN13)),F.register("isbn_13+2",new F(pe.ZBAR_ISBN13)).add(new F(pe.ZBAR_EAN13)).add(new F(pe.ZBAR_EAN2)),F.register("isbn_13+5",new F(pe.ZBAR_ISBN13)).add(new F(pe.ZBAR_EAN13)).add(new F(pe.ZBAR_EAN5)),F.register("itf",new F(pe.ZBAR_I25)),F.register("qr_code",new F(pe.ZBAR_QRCODE)),F.register("sq_code",new F(pe.ZBAR_SQCODE)),F.register("upc_a",new F(pe.ZBAR_UPCA)).add(new F(pe.ZBAR_EAN13)),F.register("upc_e",new F(pe.ZBAR_UPCE)).add(new F(pe.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"}(Sp||(Sp={}));var _c=class{},um=(()=>{try{return new OffscreenCanvas(1,1).getContext("2d")instanceof OffscreenCanvasRenderingContext2D}catch{return!1}})(),Ir=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=>!F.formats().includes(n));if(r.length)throw new TypeError(`Unsupported barcode format(s): ${r.join(", ")}`)}this.formats=e.formats||F.formats(),this.zbarConfig=e.zbar||new _c}static getSupportedFormats(){return Promise.resolve(F.formats())}detect(e){if(!Ir.isImageBitmapSource(e))throw new TypeError("BarcodeDetector.detect() argument is not an ImageBitmapSource");let r=Ir.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),om(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)=>cm(this,void 0,void 0,function*(){if(!this.scanner){let n=yield sm();this.formats.length>0&&(n.setConfig(pe.ZBAR_NONE,Cp.ZBAR_CFG_ENABLE,0),this.formats.forEach(i=>F.configure(n,i))),this.scanner=n}e(this.scanner)}))}toImageData(e){let r=n=>{let i=Ir.intrinsicDimensions(n);this.canvas&&this.canvas.width===i.width&&this.canvas.height===i.height||(this.canvas=function(s,u){if(um)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:F.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 Eo=window,ko=Eo.ShadowRoot&&(Eo.ShadyCSS===void 0||Eo.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,wc=Symbol(),xp=new WeakMap,Zi=class{constructor(e,r,n){if(this._$cssResult$=!0,n!==wc)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(ko&&e===void 0){let n=r!==void 0&&r.length===1;n&&(e=xp.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&xp.set(r,e))}return e}toString(){return this.cssText}},Ep=t=>new Zi(typeof t=="string"?t:t+"",void 0,wc),Sc=(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 Zi(r,t,wc)},Cc=(t,e)=>{ko?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{let n=document.createElement("style"),i=Eo.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)})},Ao=ko?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let n of e.cssRules)r+=n.cssText;return Ep(r)})(t):t;var xc,Io=window,kp=Io.trustedTypes,lm=kp?kp.emptyScript:"",Ap=Io.reactiveElementPolyfillSupport,kc={toAttribute(t,e){switch(e){case Boolean:t=t?lm: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}},Ip=(t,e)=>e!==t&&(e==e||t==t),Ec={attribute:!0,type:String,converter:kc,reflect:!1,hasChanged:Ip},Ac="finalized",fr=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=Ec){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)||Ec}static finalize(){if(this.hasOwnProperty(Ac))return!1;this[Ac]=!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(Ao(i))}else e!==void 0&&r.push(Ao(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 Cc(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=Ec){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:kc).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:kc;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||Ip)(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){}};fr[Ac]=!0,fr.elementProperties=new Map,fr.elementStyles=[],fr.shadowRootOptions={mode:"open"},Ap?.({ReactiveElement:fr}),((xc=Io.reactiveElementVersions)!==null&&xc!==void 0?xc:Io.reactiveElementVersions=[]).push("1.6.3");var Ic,To=window,ni=To.trustedTypes,Tp=ni?ni.createPolicy("lit-html",{createHTML:t=>t}):void 0,Oc="$lit$",Tr=`lit$${(Math.random()+"").slice(9)}$`,Lp="?"+Tr,pm=`<${Lp}>`,ln=document,Yi=()=>ln.createComment(""),Xi=t=>t===null||typeof t!="object"&&typeof t!="function",Fp=Array.isArray,fm=t=>Fp(t)||typeof t?.[Symbol.iterator]=="function",Tc=`[
2
+ \f\r]`,Ji=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Op=/-->/g,Dp=/>/g,cn=RegExp(`>|${Tc}(?:([^\\s"'>=/]+)(${Tc}*=${Tc}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Np=/'/g,Pp=/"/g,Mp=/^(?:script|style|textarea|title)$/i,Up=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),L=Up(1),q3=Up(2),pn=Symbol.for("lit-noChange"),He=Symbol.for("lit-nothing"),Rp=new WeakMap,un=ln.createTreeWalker(ln,129,null,!1);function jp(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Tp!==void 0?Tp.createHTML(e):e}var dm=(t,e)=>{let r=t.length-1,n=[],i,a=e===2?"<svg>":"",o=Ji;for(let s=0;s<r;s++){let u=t[s],c,l,d=-1,f=0;for(;f<u.length&&(o.lastIndex=f,l=o.exec(u),l!==null);)f=o.lastIndex,o===Ji?l[1]==="!--"?o=Op:l[1]!==void 0?o=Dp:l[2]!==void 0?(Mp.test(l[2])&&(i=RegExp("</"+l[2],"g")),o=cn):l[3]!==void 0&&(o=cn):o===cn?l[0]===">"?(o=i??Ji,d=-1):l[1]===void 0?d=-2:(d=o.lastIndex-l[2].length,c=l[1],o=l[3]===void 0?cn:l[3]==='"'?Pp:Np):o===Pp||o===Np?o=cn:o===Op||o===Dp?o=Ji:(o=cn,i=void 0);let p=o===cn&&t[s+1].startsWith("/>")?" ":"";a+=o===Ji?u+pm:d>=0?(n.push(c),u.slice(0,d)+Oc+u.slice(d)+Tr+p):u+Tr+(d===-2?(n.push(void 0),s):p)}return[jp(t,a+(t[r]||"<?>")+(e===2?"</svg>":"")),n]},fn=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]=dm(e,r);if(this.el=fn.createElement(c,n),un.currentNode=this.el.content,r===2){let d=this.el.content,f=d.firstChild;f.remove(),d.append(...f.childNodes)}for(;(i=un.nextNode())!==null&&u.length<s;){if(i.nodeType===1){if(i.hasAttributes()){let d=[];for(let f of i.getAttributeNames())if(f.endsWith(Oc)||f.startsWith(Tr)){let p=l[o++];if(d.push(f),p!==void 0){let h=i.getAttribute(p.toLowerCase()+Oc).split(Tr),g=/([.?@])?(.*)/.exec(p);u.push({type:1,index:a,name:g[2],strings:h,ctor:g[1]==="."?Nc:g[1]==="?"?Pc:g[1]==="@"?Rc:ai})}else u.push({type:6,index:a})}for(let f of d)i.removeAttribute(f)}if(Mp.test(i.tagName)){let d=i.textContent.split(Tr),f=d.length-1;if(f>0){i.textContent=ni?ni.emptyScript:"";for(let p=0;p<f;p++)i.append(d[p],Yi()),un.nextNode(),u.push({type:2,index:++a});i.append(d[f],Yi())}}}else if(i.nodeType===8)if(i.data===Lp)u.push({type:2,index:a});else{let d=-1;for(;(d=i.data.indexOf(Tr,d+1))!==-1;)u.push({type:7,index:a}),d+=Tr.length-1}a++}}static createElement(e,r){let n=ln.createElement("template");return n.innerHTML=e,n}};function ii(t,e,r=t,n){var i,a,o,s;if(e===pn)return e;let u=n!==void 0?(i=r._$Co)===null||i===void 0?void 0:i[n]:r._$Cl,c=Xi(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=ii(t,u._$AS(t,e.values),u,n)),e}var Dc=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:ln).importNode(n,!0);un.currentNode=a;let o=un.nextNode(),s=0,u=0,c=i[0];for(;c!==void 0;){if(s===c.index){let l;c.type===2?l=new dn(o,o.nextSibling,this,e):c.type===1?l=new c.ctor(o,c.name,c.strings,this,e):c.type===6&&(l=new $c(o,this,e)),this._$AV.push(l),c=i[++u]}s!==c?.index&&(o=un.nextNode(),s++)}return un.currentNode=ln,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++}},dn=class{constructor(e,r,n,i){var a;this.type=2,this._$AH=He,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=ii(this,e,r),Xi(e)?e===He||e==null||e===""?(this._$AH!==He&&this._$AR(),this._$AH=He):e!==this._$AH&&e!==pn&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):fm(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!==He&&Xi(this._$AH)?this._$AA.nextSibling.data=e:this.$(ln.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=fn.createElement(jp(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 Dc(a,this),s=o.u(this.options);o.v(n),this.$(s),this._$AH=o}}_$AC(e){let r=Rp.get(e.strings);return r===void 0&&Rp.set(e.strings,r=new fn(e)),r}T(e){Fp(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 dn(this.k(Yi()),this.k(Yi()),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))}},ai=class{constructor(e,r,n,i,a){this.type=1,this._$AH=He,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=He}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=ii(this,e,r,0),o=!Xi(e)||e!==this._$AH&&e!==pn,o&&(this._$AH=e);else{let s=e,u,c;for(e=a[0],u=0;u<a.length-1;u++)c=ii(this,s[n+u],r,u),c===pn&&(c=this._$AH[u]),o||(o=!Xi(c)||c!==this._$AH[u]),c===He?e=He:e!==He&&(e+=(c??"")+a[u+1]),this._$AH[u]=c}o&&!i&&this.j(e)}j(e){e===He?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Nc=class extends ai{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===He?void 0:e}},hm=ni?ni.emptyScript:"",Pc=class extends ai{constructor(){super(...arguments),this.type=4}j(e){e&&e!==He?this.element.setAttribute(this.name,hm):this.element.removeAttribute(this.name)}},Rc=class extends ai{constructor(e,r,n,i,a){super(e,r,n,i,a),this.type=5}_$AI(e,r=this){var n;if((e=(n=ii(this,e,r,0))!==null&&n!==void 0?n:He)===pn)return;let i=this._$AH,a=e===He&&i!==He||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,o=e!==He&&(i===He||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)}},$c=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){ii(this,e)}};var $p=To.litHtmlPolyfillSupport;$p?.(fn,dn),((Ic=To.litHtmlVersions)!==null&&Ic!==void 0?Ic:To.litHtmlVersions=[]).push("2.8.0");var Bp=(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 dn(e.insertBefore(Yi(),s),s,void 0,r??{})}return o._$AI(t),o};var Lc,Fc;var Or=class extends fr{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=Bp(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 pn}};Or.finalized=!0,Or._$litElement$=!0,(Lc=globalThis.litElementHydrateSupport)===null||Lc===void 0||Lc.call(globalThis,{LitElement:Or});var qp=globalThis.litElementPolyfillSupport;qp?.({LitElement:Or});((Fc=globalThis.litElementVersions)!==null&&Fc!==void 0?Fc:globalThis.litElementVersions=[]).push("3.3.3");var Vp=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 mm=(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)}},gm=(t,e,r)=>{e.constructor.createProperty(r,t)};function st(t){return(e,r)=>r!==void 0?gm(t,e,r):mm(t,e)}function xe(t){return st({...t,state:!0})}var Mc,mb=((Mc=window.HTMLSlotElement)===null||Mc===void 0?void 0:Mc.prototype.assignedElements)!=null?(t,e)=>t.assignedElements(e):(t,e)=>t.assignedNodes(e).filter(r=>r.nodeType===Node.ELEMENT_NODE);var Uc=function(t,e){return Uc=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])},Uc(t,e)};function De(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Uc(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var S=function(){return S=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},S.apply(this,arguments)};function Jt(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 Bt(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 qt(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 Dr(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 jc="Invariant Violation",Qp=Object.setPrototypeOf,ym=Qp===void 0?function(t,e){return t.__proto__=e,t}:Qp,H=function(t){De(e,t);function e(r){r===void 0&&(r=jc);var n=t.call(this,typeof r=="number"?jc+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=jc,ym(n,e.prototype),n}return e}(Error);function N(t,e){if(!t)throw new H(e)}var Do=["debug","log","warn","error","silent"],Bc=Do.indexOf("log");function Oo(t){return function(){if(Do.indexOf(t)>=Bc){var e=console[t]||console.log;return e.apply(console,arguments)}}}(function(t){t.debug=Oo("debug"),t.log=Oo("log"),t.warn=Oo("warn"),t.error=Oo("error")})(N||(N={}));function zp(t){var e=Do[Bc];return Bc=Math.max(0,Do.indexOf(t)),e}function Ge(t){try{return t()}catch{}}var No=Ge(function(){return globalThis})||Ge(function(){return window})||Ge(function(){return self})||Ge(function(){return global})||Ge(function(){return Ge.constructor("return this")()});var Hp="__",Gp=[Hp,Hp].join("DEV");function vm(){try{return Boolean(__DEV__)}catch{return Object.defineProperty(No,Gp,{value:Ge(function(){return"production"})!=="production",enumerable:!1,configurable:!0,writable:!0}),No[Gp]}}var hn=vm();function Nr(t){try{return t()}catch{}}var qc=Nr(function(){return globalThis})||Nr(function(){return window})||Nr(function(){return self})||Nr(function(){return global})||Nr(function(){return Nr.constructor("return this")()}),Vc=!1;function bm(){qc&&!Nr(function(){return"production"})&&!Nr(function(){return process})&&(Object.defineProperty(qc,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),Vc=!0)}bm();function Qc(){Vc&&(delete qc.process,Vc=!1)}var Bb=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",qb=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator",Wp=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";var Le=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 zc(t,e){var r=Boolean(t);if(!r)throw new Error(e??"Unexpected invariant triggered.")}var _m=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,ta=_m;function Po(t){var e=t.prototype.toJSON;typeof e=="function"||zc(0),t.prototype.inspect=e,ta&&(t.prototype[ta]=e)}var Kp=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}();Po(Kp);var Zp=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}();Po(Zp);function Hc(t){return t!=null&&typeof t.kind=="string"}function Ro(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ro=function(r){return typeof r}:Ro=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ro(t)}var wm=10,Jp=2;function ra(t){return $o(t,[])}function $o(t,e){switch(Ro(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return t===null?"null":Sm(t,e);default:return String(t)}}function Sm(t,e){if(e.indexOf(t)!==-1)return"[Circular]";var r=[].concat(e,[t]),n=Em(t);if(n!==void 0){var i=n.call(t);if(i!==t)return typeof i=="string"?i:$o(i,r)}else if(Array.isArray(t))return xm(t,r);return Cm(t,r)}function Cm(t,e){var r=Object.keys(t);if(r.length===0)return"{}";if(e.length>Jp)return"["+km(t)+"]";var n=r.map(function(i){var a=$o(t[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function xm(t,e){if(t.length===0)return"[]";if(e.length>Jp)return"[Array]";for(var r=Math.min(wm,t.length),n=t.length-r,i=[],a=0;a<r;++a)i.push($o(t[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function Em(t){var e=t[String(ta)];if(typeof e=="function")return e;if(typeof t.inspect=="function")return t.inspect}function km(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 na(t,e){var r=Boolean(t);if(!r)throw new Error(e)}function Yp(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 Am(t,e,r){return e&&Yp(t.prototype,e),r&&Yp(t,r),t}var Lo=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"||na(0,"Body must be a string. Received: ".concat(ra(e),".")),this.body=e,this.name=r,this.locationOffset=n,this.locationOffset.line>0||na(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||na(0,"column in locationOffset is 1-indexed and must be positive.")}return Am(t,[{key:Wp,get:function(){return"Source"}}]),t}();function Xp(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 Cm={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"]},mn=Object.freeze({});function nt(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Cm,n=void 0,i=Array.isArray(t),a=[t],o=-1,s=[],u=void 0,c=void 0,l=void 0,d=[],f=[],p=t;do{o++;var h=o===a.length,g=h&&s.length!==0;if(h){if(c=f.length===0?void 0:d[d.length-1],u=l,l=f.pop(),g){if(i)u=u.slice();else{for(var v={},C=0,_=Object.keys(u);C<_.length;C++){var b=_[C];v[b]=u[b]}u=v}for(var y=0,T=0;T<s.length;T++){var R=s[T][0],k=s[T][1];i&&(R-=y),i&&k===null?(u.splice(R,1),y++):u[R]=k}}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]:p,u==null)continue;l&&d.push(c)}var P=void 0;if(!Array.isArray(u)){if(!Vc(u))throw new Error("Invalid AST Node: ".concat(ea(u),"."));var F=Qc(e,u.kind,h);if(F){if(P=F.call(e,u,c,l,d,f),P===mn)break;if(P===!1){if(!h){d.pop();continue}}else if(P!==void 0&&(s.push([c,P]),!h))if(Vc(P))u=P;else{d.pop();continue}}}if(P===void 0&&g&&s.push([c,u]),h)d.pop();else{var $;n={inArray:i,index:o,keys:a,edits:s,prev:n},i=Array.isArray(u),a=i?u:($=r[u.kind])!==null&&$!==void 0?$:[],o=-1,s=[],l&&f.push(l),l=u}}while(n!==void 0);return s.length!==0&&(p=s[s.length-1][1]),p}function Qc(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 ai(t){return nt(t,{leave:Em})}var xm=80,Em={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return M(e.definitions,`
7
+ `),'"""'+u.replace(/"""/g,'\\"""')+'"""'}var Im={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"]},mn=Object.freeze({});function it(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Im,n=void 0,i=Array.isArray(t),a=[t],o=-1,s=[],u=void 0,c=void 0,l=void 0,d=[],f=[],p=t;do{o++;var h=o===a.length,g=h&&s.length!==0;if(h){if(c=f.length===0?void 0:d[d.length-1],u=l,l=f.pop(),g){if(i)u=u.slice();else{for(var b={},C=0,w=Object.keys(u);C<w.length;C++){var _=w[C];b[_]=u[_]}u=b}for(var y=0,T=0;T<s.length;T++){var R=s[T][0],k=s[T][1];i&&(R-=y),i&&k===null?(u.splice(R,1),y++):u[R]=k}}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]:p,u==null)continue;l&&d.push(c)}var P=void 0;if(!Array.isArray(u)){if(!Hc(u))throw new Error("Invalid AST Node: ".concat(ra(u),"."));var M=Gc(e,u.kind,h);if(M){if(P=M.call(e,u,c,l,d,f),P===mn)break;if(P===!1){if(!h){d.pop();continue}}else if(P!==void 0&&(s.push([c,P]),!h))if(Hc(P))u=P;else{d.pop();continue}}}if(P===void 0&&g&&s.push([c,u]),h)d.pop();else{var $;n={inArray:i,index:o,keys:a,edits:s,prev:n},i=Array.isArray(u),a=i?u:($=r[u.kind])!==null&&$!==void 0?$:[],o=-1,s=[],l&&f.push(l),l=u}}while(n!==void 0);return s.length!==0&&(p=s[s.length-1][1]),p}function Gc(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 oi(t){return it(t,{leave:Om})}var Tm=80,Om={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return U(e.definitions,`
8
8
 
9
9
  `)+`
10
- `},OperationDefinition:function(e){var r=e.operation,n=e.name,i=Ie("(",M(e.variableDefinitions,", "),")"),a=M(e.directives," "),o=e.selectionSet;return!n&&!a&&!i&&r==="query"?o:M([r,M([n,i]),a,o]," ")},VariableDefinition:function(e){var r=e.variable,n=e.type,i=e.defaultValue,a=e.directives;return r+": "+n+Ie(" = ",i)+Ie(" ",M(a," "))},SelectionSet:function(e){var r=e.selections;return Vt(r)},Field:function(e){var r=e.alias,n=e.name,i=e.arguments,a=e.directives,o=e.selectionSet,s=Ie("",r,": ")+n,u=s+Ie("(",M(i,", "),")");return u.length>xm&&(u=s+Ie(`(
11
- `,Do(M(i,`
10
+ `},OperationDefinition:function(e){var r=e.operation,n=e.name,i=Ie("(",U(e.variableDefinitions,", "),")"),a=U(e.directives," "),o=e.selectionSet;return!n&&!a&&!i&&r==="query"?o:U([r,U([n,i]),a,o]," ")},VariableDefinition:function(e){var r=e.variable,n=e.type,i=e.defaultValue,a=e.directives;return r+": "+n+Ie(" = ",i)+Ie(" ",U(a," "))},SelectionSet:function(e){var r=e.selections;return Qt(r)},Field:function(e){var r=e.alias,n=e.name,i=e.arguments,a=e.directives,o=e.selectionSet,s=Ie("",r,": ")+n,u=s+Ie("(",U(i,", "),")");return u.length>Tm&&(u=s+Ie(`(
11
+ `,Fo(U(i,`
12
12
  `)),`
13
- )`)),M([u,M(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+Ie(" ",M(n," "))},InlineFragment:function(e){var r=e.typeCondition,n=e.directives,i=e.selectionSet;return M(["...",Ie("on ",r),M(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(Ie("(",M(i,", "),")")," ")+"on ".concat(n," ").concat(Ie("",M(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?Hp(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"["+M(r,", ")+"]"},ObjectValue:function(e){var r=e.fields;return"{"+M(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+Ie("(",M(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:qt(function(t){var e=t.directives,r=t.operationTypes;return M(["schema",M(e," "),Vt(r)]," ")}),OperationTypeDefinition:function(e){var r=e.operation,n=e.type;return r+": "+n},ScalarTypeDefinition:qt(function(t){var e=t.name,r=t.directives;return M(["scalar",e,M(r," ")]," ")}),ObjectTypeDefinition:qt(function(t){var e=t.name,r=t.interfaces,n=t.directives,i=t.fields;return M(["type",e,Ie("implements ",M(r," & ")),M(n," "),Vt(i)]," ")}),FieldDefinition:qt(function(t){var e=t.name,r=t.arguments,n=t.type,i=t.directives;return e+(Wp(r)?Ie(`(
14
- `,Do(M(r,`
13
+ )`)),U([u,U(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+Ie(" ",U(n," "))},InlineFragment:function(e){var r=e.typeCondition,n=e.directives,i=e.selectionSet;return U(["...",Ie("on ",r),U(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(Ie("(",U(i,", "),")")," ")+"on ".concat(n," ").concat(Ie("",U(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?Xp(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"["+U(r,", ")+"]"},ObjectValue:function(e){var r=e.fields;return"{"+U(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+Ie("(",U(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:Vt(function(t){var e=t.directives,r=t.operationTypes;return U(["schema",U(e," "),Qt(r)]," ")}),OperationTypeDefinition:function(e){var r=e.operation,n=e.type;return r+": "+n},ScalarTypeDefinition:Vt(function(t){var e=t.name,r=t.directives;return U(["scalar",e,U(r," ")]," ")}),ObjectTypeDefinition:Vt(function(t){var e=t.name,r=t.interfaces,n=t.directives,i=t.fields;return U(["type",e,Ie("implements ",U(r," & ")),U(n," "),Qt(i)]," ")}),FieldDefinition:Vt(function(t){var e=t.name,r=t.arguments,n=t.type,i=t.directives;return e+(ef(r)?Ie(`(
14
+ `,Fo(U(r,`
15
15
  `)),`
16
- )`):Ie("(",M(r,", "),")"))+": "+n+Ie(" ",M(i," "))}),InputValueDefinition:qt(function(t){var e=t.name,r=t.type,n=t.defaultValue,i=t.directives;return M([e+": "+r,Ie("= ",n),M(i," ")]," ")}),InterfaceTypeDefinition:qt(function(t){var e=t.name,r=t.interfaces,n=t.directives,i=t.fields;return M(["interface",e,Ie("implements ",M(r," & ")),M(n," "),Vt(i)]," ")}),UnionTypeDefinition:qt(function(t){var e=t.name,r=t.directives,n=t.types;return M(["union",e,M(r," "),n&&n.length!==0?"= "+M(n," | "):""]," ")}),EnumTypeDefinition:qt(function(t){var e=t.name,r=t.directives,n=t.values;return M(["enum",e,M(r," "),Vt(n)]," ")}),EnumValueDefinition:qt(function(t){var e=t.name,r=t.directives;return M([e,M(r," ")]," ")}),InputObjectTypeDefinition:qt(function(t){var e=t.name,r=t.directives,n=t.fields;return M(["input",e,M(r," "),Vt(n)]," ")}),DirectiveDefinition:qt(function(t){var e=t.name,r=t.arguments,n=t.repeatable,i=t.locations;return"directive @"+e+(Wp(r)?Ie(`(
17
- `,Do(M(r,`
16
+ )`):Ie("(",U(r,", "),")"))+": "+n+Ie(" ",U(i," "))}),InputValueDefinition:Vt(function(t){var e=t.name,r=t.type,n=t.defaultValue,i=t.directives;return U([e+": "+r,Ie("= ",n),U(i," ")]," ")}),InterfaceTypeDefinition:Vt(function(t){var e=t.name,r=t.interfaces,n=t.directives,i=t.fields;return U(["interface",e,Ie("implements ",U(r," & ")),U(n," "),Qt(i)]," ")}),UnionTypeDefinition:Vt(function(t){var e=t.name,r=t.directives,n=t.types;return U(["union",e,U(r," "),n&&n.length!==0?"= "+U(n," | "):""]," ")}),EnumTypeDefinition:Vt(function(t){var e=t.name,r=t.directives,n=t.values;return U(["enum",e,U(r," "),Qt(n)]," ")}),EnumValueDefinition:Vt(function(t){var e=t.name,r=t.directives;return U([e,U(r," ")]," ")}),InputObjectTypeDefinition:Vt(function(t){var e=t.name,r=t.directives,n=t.fields;return U(["input",e,U(r," "),Qt(n)]," ")}),DirectiveDefinition:Vt(function(t){var e=t.name,r=t.arguments,n=t.repeatable,i=t.locations;return"directive @"+e+(ef(r)?Ie(`(
17
+ `,Fo(U(r,`
18
18
  `)),`
19
- )`):Ie("(",M(r,", "),")"))+(n?" repeatable":"")+" on "+M(i," | ")}),SchemaExtension:function(e){var r=e.directives,n=e.operationTypes;return M(["extend schema",M(r," "),Vt(n)]," ")},ScalarTypeExtension:function(e){var r=e.name,n=e.directives;return M(["extend scalar",r,M(n," ")]," ")},ObjectTypeExtension:function(e){var r=e.name,n=e.interfaces,i=e.directives,a=e.fields;return M(["extend type",r,Ie("implements ",M(n," & ")),M(i," "),Vt(a)]," ")},InterfaceTypeExtension:function(e){var r=e.name,n=e.interfaces,i=e.directives,a=e.fields;return M(["extend interface",r,Ie("implements ",M(n," & ")),M(i," "),Vt(a)]," ")},UnionTypeExtension:function(e){var r=e.name,n=e.directives,i=e.types;return M(["extend union",r,M(n," "),i&&i.length!==0?"= "+M(i," | "):""]," ")},EnumTypeExtension:function(e){var r=e.name,n=e.directives,i=e.values;return M(["extend enum",r,M(n," "),Vt(i)]," ")},InputObjectTypeExtension:function(e){var r=e.name,n=e.directives,i=e.fields;return M(["extend input",r,M(n," "),Vt(i)]," ")}};function qt(t){return function(e){return M([e.description,t(e)],`
20
- `)}}function M(t){var e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(e=t?.filter(function(n){return n}).join(r))!==null&&e!==void 0?e:""}function Vt(t){return Ie(`{
21
- `,Do(M(t,`
19
+ )`):Ie("(",U(r,", "),")"))+(n?" repeatable":"")+" on "+U(i," | ")}),SchemaExtension:function(e){var r=e.directives,n=e.operationTypes;return U(["extend schema",U(r," "),Qt(n)]," ")},ScalarTypeExtension:function(e){var r=e.name,n=e.directives;return U(["extend scalar",r,U(n," ")]," ")},ObjectTypeExtension:function(e){var r=e.name,n=e.interfaces,i=e.directives,a=e.fields;return U(["extend type",r,Ie("implements ",U(n," & ")),U(i," "),Qt(a)]," ")},InterfaceTypeExtension:function(e){var r=e.name,n=e.interfaces,i=e.directives,a=e.fields;return U(["extend interface",r,Ie("implements ",U(n," & ")),U(i," "),Qt(a)]," ")},UnionTypeExtension:function(e){var r=e.name,n=e.directives,i=e.types;return U(["extend union",r,U(n," "),i&&i.length!==0?"= "+U(i," | "):""]," ")},EnumTypeExtension:function(e){var r=e.name,n=e.directives,i=e.values;return U(["extend enum",r,U(n," "),Qt(i)]," ")},InputObjectTypeExtension:function(e){var r=e.name,n=e.directives,i=e.fields;return U(["extend input",r,U(n," "),Qt(i)]," ")}};function Vt(t){return function(e){return U([e.description,t(e)],`
20
+ `)}}function U(t){var e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(e=t?.filter(function(n){return n}).join(r))!==null&&e!==void 0?e:""}function Qt(t){return Ie(`{
21
+ `,Fo(U(t,`
22
22
  `)),`
23
- }`)}function Ie(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return e!=null&&e!==""?t+e+r:""}function Do(t){return Ie(" ",t.replace(/\n/g,`
24
- `))}function km(t){return t.indexOf(`
25
- `)!==-1}function Wp(t){return t!=null&&t.some(km)}function ra(t){return t.kind===$e.FIELD||t.kind===$e.FRAGMENT_SPREAD||t.kind===$e.INLINE_FRAGMENT}function Kp(){return typeof Oo=="function"?Bc():Bc()}function Lm(){__DEV__?D(typeof hn=="boolean",hn):D(typeof hn=="boolean",39)}Kp();Lm();function dr(t,e){var r=t.directives;return!r||!r.length?!0:Zp(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__?D(o!==void 0,"Invalid variable referenced in @".concat(i.name.value," directive.")):D(o!==void 0,40)):o=a.value.value,i.name.value==="skip"?!o:o})}function oi(t,e,r){var n=new Set(t),i=n.size;return nt(e,{Directive:function(a){if(n.delete(a.name.value)&&(!r||!n.size))return mn}}),r?!n.size:n.size<i}function zc(t){return t&&oi(["client","export"],t,!0)}function Fm(t){var e=t.name.value;return e==="skip"||e==="include"}function Zp(t){var e=[];return t&&t.length&&t.forEach(function(r){if(!!Fm(r)){var n=r.arguments,i=r.name.value;__DEV__?D(n&&n.length===1,"Incorrect number of arguments for the @".concat(i," directive.")):D(n&&n.length===1,41);var a=n[0];__DEV__?D(a.name&&a.name.value==="if","Invalid argument for the @".concat(i," directive.")):D(a.name&&a.name.value==="if",42);var o=a.value;__DEV__?D(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),"Argument for the @".concat(i," directive must be a variable or a boolean value.")):D(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),43),e.push({directive:r,ifArgument:a})}}),e}function Gc(t,e){var r=e,n=[];t.definitions.forEach(function(a){if(a.kind==="OperationDefinition")throw __DEV__?new z("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 z(44);a.kind==="FragmentDefinition"&&n.push(a)}),typeof r>"u"&&(__DEV__?D(n.length===1,"Found ".concat(n.length," fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")):D(n.length===1,45),r=n[0].name.value);var i=w(w({},t),{definitions:Dr([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],t.definitions,!0)});return i}function gn(t){t===void 0&&(t=[]);var e={};return t.forEach(function(r){e[r.name.value]=r}),e}function yn(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__?D(n,"No fragment named ".concat(r)):D(n,46),n||null}default:return null}}function oe(t){return t!==null&&typeof t=="object"}function Jt(t){return{__ref:String(t)}}function ee(t){return Boolean(t&&typeof t=="object"&&typeof t.__ref=="string")}function Hc(t){return oe(t)&&t.kind==="Document"&&Array.isArray(t.definitions)}function Mm(t){return t.kind==="StringValue"}function Um(t){return t.kind==="BooleanValue"}function jm(t){return t.kind==="IntValue"}function Bm(t){return t.kind==="FloatValue"}function qm(t){return t.kind==="Variable"}function Vm(t){return t.kind==="ObjectValue"}function Qm(t){return t.kind==="ListValue"}function zm(t){return t.kind==="EnumValue"}function Gm(t){return t.kind==="NullValue"}function Pr(t,e,r,n){if(jm(r)||Bm(r))t[e.value]=Number(r.value);else if(Um(r)||Mm(r))t[e.value]=r.value;else if(Vm(r)){var i={};r.fields.map(function(o){return Pr(i,o.name,o.value,n)}),t[e.value]=i}else if(qm(r)){var a=(n||{})[r.name.value];t[e.value]=a}else if(Qm(r))t[e.value]=r.values.map(function(o){var s={};return Pr(s,e,o,n),s[e.value]});else if(zm(r))t[e.value]=r.value;else if(Gm(r))t[e.value]=null;else throw __DEV__?new z('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 z(55)}function Wc(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 Pr(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 Pr(n,a,o,e)})),ia(t.name.value,n,r)}var Hm=["connection","include","skip","client","rest","export"],ia=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(na(i),")")}else return r.connection.key;var a=t;if(e){var o=na(e);a+="(".concat(o,")")}return r&&Object.keys(r).forEach(function(s){Hm.indexOf(s)===-1&&(r[s]&&Object.keys(r[s]).length?a+="@".concat(s,"(").concat(na(r[s]),")"):a+="@".concat(s))}),a},{setStringify:function(t){var e=na;return na=t,e}}),na=function(e){return JSON.stringify(e,Wm)};function Wm(t,e){return oe(e)&&!Array.isArray(e)&&(e=Object.keys(e).sort().reduce(function(r,n){return r[n]=e[n],r},{})),e}function hr(t,e){if(t.arguments&&t.arguments.length){var r={};return t.arguments.forEach(function(n){var i=n.name,a=n.value;return Pr(r,i,a,e)}),r}return null}function Nt(t){return t.alias?t.alias.value:t.name.value}function aa(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(Ct(a)){if(a.name.value==="__typename")return t[Nt(a)]}else{var o=aa(t,yn(a,r).selectionSet,r);if(typeof o=="string")return o}}}function Ct(t){return t.kind==="Field"}function Kc(t){return t.kind==="InlineFragment"}function si(t){__DEV__?D(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'):D(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 z('Schema type definitions not allowed in queries. Found: "'.concat(r.kind,'"')):new z(48);return r});return __DEV__?D(e.length<=1,"Ambiguous GraphQL document: contains ".concat(e.length," operations")):D(e.length<=1,49),t}function Yt(t){return si(t),t.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function ci(t){return t.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function vn(t){return t.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function oa(t){var e=Yt(t);return __DEV__?D(e&&e.operation==="query","Must contain a query definition."):D(e&&e.operation==="query",50),e}function Zc(t){__DEV__?D(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'):D(t.kind==="Document",51),__DEV__?D(t.definitions.length<=1,"Fragment must have exactly one definition."):D(t.definitions.length<=1,52);var e=t.definitions[0];return __DEV__?D(e.kind==="FragmentDefinition","Must be a fragment definition."):D(e.kind==="FragmentDefinition",53),e}function bn(t){si(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 z("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new z(54)}function _n(t){var e=Object.create(null),r=t&&t.variableDefinitions;return r&&r.length&&r.forEach(function(n){n.defaultValue&&Pr(e,n.variable.name,n.defaultValue)}),e}var he=Array.isArray;function Ue(t){return Array.isArray(t)&&t.length>0}var Jp={kind:$e.FIELD,name:{kind:$e.NAME,value:"__typename"}};function Xp(t,e){return!t||t.selectionSet.selections.every(function(r){return r.kind===$e.FRAGMENT_SPREAD&&Xp(e[r.name.value],e)})}function Km(t){return Xp(Yt(t)||Zc(t),gn(vn(t)))?null:t}function Zm(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 Yp(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 Jc(t,e){for(var r=Yp(""),n=Yp(""),i=function(_){for(var b=0,y=void 0;b<_.length&&(y=_[b]);++b)if(!he(y)){if(y.kind===$e.OPERATION_DEFINITION)return r(y.name&&y.name.value);if(y.kind===$e.FRAGMENT_DEFINITION)return n(y.name.value)}return __DEV__&&D.error("Could not find operation or fragment"),null},a=0,o=e.definitions.length-1;o>=0;--o)e.definitions[o].kind===$e.OPERATION_DEFINITION&&++a;var s=Zm(t),u=t.some(function(_){return _.remove}),c=function(_){return u&&_&&_.some(s)},l=new Map,d=!1,f={enter:function(_){if(c(_.directives))return d=!0,null}},p=nt(e,{Field:f,InlineFragment:f,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(_,b,y,T,R){var k=i(R);k&&k.variables.add(_.name.value)}},FragmentSpread:{enter:function(_,b,y,T,R){if(c(_.directives))return d=!0,null;var k=i(R);k&&k.fragmentSpreads.add(_.name.value)}},FragmentDefinition:{enter:function(_,b,y,T){l.set(JSON.stringify(T),_)},leave:function(_,b,y,T){var R=l.get(JSON.stringify(T));if(_===R)return _;if(a>0&&_.selectionSet.selections.every(function(k){return k.kind===$e.FIELD&&k.name.value==="__typename"}))return n(_.name.value).removed=!0,d=!0,null}},Directive:{leave:function(_){if(s(_))return d=!0,null}}});if(!d)return e;var h=function(_){return _.transitiveVars||(_.transitiveVars=new Set(_.variables),_.removed||_.fragmentSpreads.forEach(function(b){h(n(b)).transitiveVars.forEach(function(y){_.transitiveVars.add(y)})})),_},g=new Set;p.definitions.forEach(function(_){_.kind===$e.OPERATION_DEFINITION?h(r(_.name&&_.name.value)).fragmentSpreads.forEach(function(b){g.add(b)}):_.kind===$e.FRAGMENT_DEFINITION&&a===0&&!n(_.name.value).removed&&g.add(_.name.value)}),g.forEach(function(_){h(n(_)).fragmentSpreads.forEach(function(b){g.add(b)})});var v=function(_){return!!(!g.has(_)||n(_).removed)},C={enter:function(_){if(v(_.name.value))return null}};return Km(nt(p,{FragmentSpread:C,FragmentDefinition:C,OperationDefinition:{leave:function(_){if(_.variableDefinitions){var b=h(r(_.name&&_.name.value)).transitiveVars;if(b.size<_.variableDefinitions.length)return w(w({},_),{variableDefinitions:_.variableDefinitions.filter(function(y){return b.has(y.variable.name.value)})})}}}}))}var wn=Object.assign(function(t){return nt(t,{SelectionSet:{enter:function(e,r,n){if(!(n&&n.kind===$e.OPERATION_DEFINITION)){var i=e.selections;if(!!i){var a=i.some(function(s){return Ct(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=n;if(!(Ct(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return w(w({},e),{selections:Dr(Dr([],i,!0),[Jp],!1)})}}}}}})},{added:function(t){return t===Jp}}),Jm={test:function(t){var e=t.name.value==="connection";return e&&(!t.arguments||!t.arguments.some(function(r){return r.name.value==="key"}))&&__DEV__&&D.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 Jc([Jm],si(t))}function Xc(t){var e=bn(t),r=e.operation;if(r==="query")return t;var n=nt(t,{OperationDefinition:{enter:function(i){return w(w({},i),{operation:"query"})}}});return n}function eu(t){si(t);var e=Jc([{test:function(r){return r.name.value==="client"},remove:!0}],t);return e}var Ym=Object.prototype.hasOwnProperty;function tu(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return sa(t)}function sa(t){var e=t[0]||{},r=t.length;if(r>1)for(var n=new ht,i=1;i<r;++i)e=n.merge(e,t[i]);return e}var Xm=function(t,e,r){return this.merge(t[r],e[r])},ht=function(){function t(e){e===void 0&&(e=Xm),this.reconciler=e,this.isObject=oe,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 oe(r)&&oe(e)?(Object.keys(r).forEach(function(o){if(Ym.call(e,o)){var s=e[o];if(r[o]!==s){var u=n.reconciler.apply(n,Dr([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 oe(e)&&(this.pastCopies.has(e)||(Array.isArray(e)?e=e.slice(0):e=w({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},t}();function eg(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=tg(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 tg(t,e){if(!!t){if(typeof t=="string")return ef(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 ef(t,e)}}function ef(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 tf(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 au(t,e,r){return e&&tf(t.prototype,e),r&&tf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var ou=function(){return typeof Symbol=="function"},su=function(t){return ou()&&Boolean(Symbol[t])},cu=function(t){return su(t)?Symbol[t]:"@@"+t};ou()&&!su("observable")&&(Symbol.observable=Symbol("observable"));var rg=cu("iterator"),nu=cu("observable"),rf=cu("species");function Po(t,e){var r=t[e];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function ca(t){var e=t.constructor;return e!==void 0&&(e=e[rf],e===null&&(e=void 0)),e!==void 0?e:Y}function ng(t){return t instanceof Y}function ui(t){ui.log?ui.log(t):setTimeout(function(){throw t})}function No(t){Promise.resolve().then(function(){try{t()}catch(e){ui(e)}})}function nf(t){var e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var r=Po(e,"unsubscribe");r&&r.call(e)}}catch(n){ui(n)}}function iu(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function ig(t){var e=t._queue;if(!!e){t._queue=void 0,t._state="ready";for(var r=0;r<e.length&&(af(t,e[r].type,e[r].value),t._state!=="closed");++r);}}function af(t,e,r){t._state="running";var n=t._observer;try{var i=Po(n,e);switch(e){case"next":i&&i.call(n,r);break;case"error":if(iu(t),i)i.call(n,r);else throw r;break;case"complete":iu(t),i&&i.call(n);break}}catch(a){ui(a)}t._state==="closed"?nf(t):t._state==="running"&&(t._state="ready")}function ru(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}],No(function(){return ig(t)});return}af(t,e,r)}}var ag=function(){function t(r,n){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var i=new og(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"&&(iu(this),nf(this))},au(t,[{key:"closed",get:function(){return this._state==="closed"}}]),t}(),og=function(){function t(r){this._subscription=r}var e=t.prototype;return e.next=function(n){ru(this._subscription,"next",n)},e.error=function(n){ru(this._subscription,"error",n)},e.complete=function(){ru(this._subscription,"complete")},au(t,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),t}(),Y=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 ag(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=ca(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=ca(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=ca(this),o=arguments.length>1,s=!1,u=arguments[1],c=u;return new a(function(l){return i.subscribe({next:function(d){var f=!s;if(s=!0,!f||o)try{c=n(c,d)}catch(p){return l.error(p)}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=ca(this);return new s(function(u){var c,l=0;function d(f){c=f.subscribe({next:function(p){u.next(p)},error:function(p){u.error(p)},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=ca(this);return new a(function(o){var s=[],u=i.subscribe({next:function(l){if(n)try{l=n(l)}catch(f){return o.error(f)}var d=a.from(l).subscribe({next:function(f){o.next(f)},error:function(f){o.error(f)},complete:function(){var f=s.indexOf(d);f>=0&&s.splice(f,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[nu]=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=Po(n,nu);if(a){var o=a.call(n);if(Object(o)!==o)throw new TypeError(o+" is not an object");return ng(o)&&o.constructor===i?o:new i(function(s){return o.subscribe(s)})}if(su("iterator")&&(a=Po(n,rg),a))return new i(function(s){No(function(){if(!s.closed){for(var u=eg(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){No(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){No(function(){if(!s.closed){for(var u=0;u<i.length;++u)if(s.next(i[u]),s.closed)return;s.complete()}})})},au(t,null,[{key:rf,get:function(){return this}}]),t}();ou()&&Object.defineProperty(Y,Symbol("extensions"),{value:{symbol:nu,hostReportError:ui},configurable:!0});function uu(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 li;typeof self<"u"?li=self:typeof window<"u"?li=window:typeof global<"u"?li=global:typeof module<"u"?li=module:li=Function("return this")();var l_=uu(li);var of=Y.prototype,sf="@@observable";of[sf]||(of[sf]=function(){return this});var sg=Object.prototype.toString;function Ro(t){return lu(t)}function lu(t,e){switch(sg.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]=lu(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]=lu(t[i],e)}),n}default:return t}}function cg(t){var e=new Set([t]);return e.forEach(function(r){oe(r)&&ug(r)===r&&Object.getOwnPropertyNames(r).forEach(function(n){oe(r[n])&&e.add(r[n])})}),t}function ug(t){if(__DEV__&&!Object.isFrozen(t))try{Object.freeze(t)}catch(e){if(e instanceof TypeError)return null;throw e}return t}function ua(t){return __DEV__&&cg(t),t}function Sn(t,e,r){var n=[];t.forEach(function(i){return i[e]&&n.push(i)}),n.forEach(function(i){return i[e](r)})}function $o(t,e,r){return new Y(function(n){var i=n.next,a=n.error,o=n.complete,s=0,u=!1,c={then:function(p){return new Promise(function(h){return h(p())})}};function l(p,h){return p?function(g){++s;var v=function(){return p(g)};c=c.then(v,v).then(function(C){--s,i&&i.call(n,C),u&&d.complete()},function(C){throw--s,C}).catch(function(C){a&&a.call(n,C)})}: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)}},f=t.subscribe(d);return function(){return f.unsubscribe()}})}var Pt=typeof WeakMap=="function"&&Ge(function(){return navigator.product})!=="ReactNative",cf=typeof WeakSet=="function",pu=typeof Symbol=="function"&&typeof Symbol.for=="function",Rr=pu&&Symbol.asyncIterator,C_=typeof Ge(function(){return window.document.createElement})=="function",x_=Ge(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1;function Lo(t){function e(r){Object.defineProperty(t,r,{value:Y})}return pu&&Symbol.species&&e(Symbol.species),e("@@species"),t}function uf(t){return t&&typeof t.then=="function"}var pi=function(t){Oe(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),Sn(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),Sn(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?uf(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"),Sn(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 Y(r)]),uf(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}(Y);Lo(pi);function $r(t){return"incremental"in t}function lg(t){return"hasNext"in t&&"data"in t}function lf(t){return $r(t)||lg(t)}function Fo(t,e){var r=t,n=new ht;return $r(e)&&Ue(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 fi(t){var e=Mo(t);return Ue(e)}function Mo(t){var e=Ue(t.errors)?t.errors.slice(0):[];return $r(t)&&Ue(t.incremental)&&t.incremental.forEach(function(r){r.errors&&e.push.apply(e,r.errors)}),e}function Lr(){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 pf=new Map;function la(t){var e=pf.get(t)||1;return pf.set(t,e+1),"".concat(t,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function ff(t){var e=la("stringifyForDisplay");return JSON.stringify(t,function(r,n){return n===void 0?e:n}).split(JSON.stringify(e)).join("<undefined>")}function pa(t,e){return Lr(t,e,e.variables&&{variables:w(w({},t&&t.variables),e.variables)})}function Uo(t){return new Y(function(e){e.error(t)})}var fa=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 fu(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 z("illegal argument: ".concat(i)):new z(27)}return t}function du(t,e){var r=w({},t),n=function(a){typeof a=="function"?r=w(w({},r),a(r)):r=w(w({},r),a)},i=function(){return w({},r)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:n}),Object.defineProperty(e,"getContext",{enumerable:!1,value:i}),e}function hu(t){var e={variables:t.variables||{},extensions:t.extensions||{},operationName:t.operationName,query:t.query};return e.operationName||(e.operationName=typeof e.query!="string"?ci(e.query)||void 0:""),e}function df(t,e){return e?e(t):Y.of()}function da(t){return typeof t=="function"?new Rt(t):t}function jo(t){return t.request.length<=1}var pg=function(t){Oe(e,t);function e(r,n){var i=t.call(this,r)||this;return i.link=n,i}return e}(Error),Rt=function(){function t(e){e&&(this.request=e)}return t.empty=function(){return new t(function(){return Y.of()})},t.from=function(e){return e.length===0?t.empty():e.map(da).reduce(function(r,n){return r.concat(n)})},t.split=function(e,r,n){var i=da(r),a=da(n||new t(df));return jo(i)&&jo(a)?new t(function(o){return e(o)?i.request(o)||Y.of():a.request(o)||Y.of()}):new t(function(o,s){return e(o)?i.request(o,s)||Y.of():a.request(o,s)||Y.of()})},t.execute=function(e,r){return e.request(du(r.context,hu(fu(r))))||Y.of()},t.concat=function(e,r){var n=da(e);if(jo(n))return __DEV__&&D.warn(new pg("You are calling concat on a terminating link, which will have no effect",n)),n;var i=da(r);return jo(i)?new t(function(a){return n.request(a,function(o){return i.request(o)||Y.of()})||Y.of()}):new t(function(a,o){return n.request(a,function(s){return i.request(s,o)||Y.of()})||Y.of()})},t.prototype.split=function(e,r,n){return this.concat(t.split(e,r,n||new t(df)))},t.prototype.concat=function(e){return t.concat(this,e)},t.prototype.request=function(e,r){throw __DEV__?new z("request is not implemented"):new z(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 di=Rt.execute;var hf="3.7.10";function mf(t){return!!t.body}function gf(t){return!!t.getReader}function yf(t){return!!(Rr&&t[Symbol.asyncIterator])}function vf(t){return!!t.stream}function bf(t){return!!t.arrayBuffer}function _f(t){return!!t.pipe}function mu(t){var e,r=t[Symbol.asyncIterator]();return e={next:function(){return r.next()}},e[Symbol.asyncIterator]=function(){return this},e}function gu(t){var e=null,r=null,n=!1,i=[],a=[];function o(d){if(!r){if(a.length){var f=a.shift();if(Array.isArray(f)&&f[0])return f[0]({value:d,done:!1})}i.push(d)}}function s(d){r=d;var f=a.slice();f.forEach(function(p){p[1](d)}),!e||e()}function u(){n=!0;var d=a.slice();d.forEach(function(f){f[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,f){if(r)return f(r);if(i.length)return d({value:i.shift(),done:!1});if(n)return d({value:void 0,done:!0});a.push([d,f])})}var l={next:function(){return c()}};return Rr&&(l[Symbol.asyncIterator]=function(){return this}),l}function yu(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 Rr&&(r[Symbol.asyncIterator]=function(){return this}),r}function Bo(t){var e={next:function(){return t.read()}};return Rr&&(e[Symbol.asyncIterator]=function(){return this}),e}function wf(t){var e=t;if(mf(t)&&(e=t.body),yf(e))return mu(e);if(gf(e))return Bo(e.getReader());if(vf(e))return Bo(e.stream().getReader());if(bf(e))return yu(e.arrayBuffer());if(_f(e))return gu(e);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var Sf=Object.prototype.hasOwnProperty;function Cf(t,e){var r,n,i;return jt(this,void 0,void 0,function(){var a,o,s,u,c,l,d,f,p,h,g,v,C,_,b,y,T,R,k,P;return Bt(this,function(F){switch(F.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=wf(t),f=!0,F.label=1;case 1:return f?[4,d.next()]:[3,3];case 2:for(p=F.sent(),h=p.value,g=p.done,v=typeof h=="string"?h:a.decode(h),f=!g,l+=v,C=l.indexOf(c);C>-1;){if(_=void 0,P=[l.slice(0,C),l.slice(C+c.length)],_=P[0],l=P[1],_.trim()){if(b=_.indexOf(`\r
23
+ }`)}function Ie(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return e!=null&&e!==""?t+e+r:""}function Fo(t){return Ie(" ",t.replace(/\n/g,`
24
+ `))}function Dm(t){return t.indexOf(`
25
+ `)!==-1}function ef(t){return t!=null&&t.some(Dm)}function ia(t){return t.kind===Le.FIELD||t.kind===Le.FRAGMENT_SPREAD||t.kind===Le.INLINE_FRAGMENT}function tf(){return typeof Lo=="function"?Qc():Qc()}function Bm(){__DEV__?N(typeof hn=="boolean",hn):N(typeof hn=="boolean",39)}tf();Bm();function dr(t,e){var r=t.directives;return!r||!r.length?!0:rf(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__?N(o!==void 0,"Invalid variable referenced in @".concat(i.name.value," directive.")):N(o!==void 0,40)):o=a.value.value,i.name.value==="skip"?!o:o})}function si(t,e,r){var n=new Set(t),i=n.size;return it(e,{Directive:function(a){if(n.delete(a.name.value)&&(!r||!n.size))return mn}}),r?!n.size:n.size<i}function Wc(t){return t&&si(["client","export"],t,!0)}function qm(t){var e=t.name.value;return e==="skip"||e==="include"}function rf(t){var e=[];return t&&t.length&&t.forEach(function(r){if(!!qm(r)){var n=r.arguments,i=r.name.value;__DEV__?N(n&&n.length===1,"Incorrect number of arguments for the @".concat(i," directive.")):N(n&&n.length===1,41);var a=n[0];__DEV__?N(a.name&&a.name.value==="if","Invalid argument for the @".concat(i," directive.")):N(a.name&&a.name.value==="if",42);var o=a.value;__DEV__?N(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),"Argument for the @".concat(i," directive must be a variable or a boolean value.")):N(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),43),e.push({directive:r,ifArgument:a})}}),e}function Kc(t,e){var r=e,n=[];t.definitions.forEach(function(a){if(a.kind==="OperationDefinition")throw __DEV__?new H("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 H(44);a.kind==="FragmentDefinition"&&n.push(a)}),typeof r>"u"&&(__DEV__?N(n.length===1,"Found ".concat(n.length," fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")):N(n.length===1,45),r=n[0].name.value);var i=S(S({},t),{definitions:Dr([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],t.definitions,!0)});return i}function gn(t){t===void 0&&(t=[]);var e={};return t.forEach(function(r){e[r.name.value]=r}),e}function yn(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__?N(n,"No fragment named ".concat(r)):N(n,46),n||null}default:return null}}function ue(t){return t!==null&&typeof t=="object"}function Yt(t){return{__ref:String(t)}}function ie(t){return Boolean(t&&typeof t=="object"&&typeof t.__ref=="string")}function Zc(t){return ue(t)&&t.kind==="Document"&&Array.isArray(t.definitions)}function Vm(t){return t.kind==="StringValue"}function Qm(t){return t.kind==="BooleanValue"}function zm(t){return t.kind==="IntValue"}function Hm(t){return t.kind==="FloatValue"}function Gm(t){return t.kind==="Variable"}function Wm(t){return t.kind==="ObjectValue"}function Km(t){return t.kind==="ListValue"}function Zm(t){return t.kind==="EnumValue"}function Jm(t){return t.kind==="NullValue"}function Pr(t,e,r,n){if(zm(r)||Hm(r))t[e.value]=Number(r.value);else if(Qm(r)||Vm(r))t[e.value]=r.value;else if(Wm(r)){var i={};r.fields.map(function(o){return Pr(i,o.name,o.value,n)}),t[e.value]=i}else if(Gm(r)){var a=(n||{})[r.name.value];t[e.value]=a}else if(Km(r))t[e.value]=r.values.map(function(o){var s={};return Pr(s,e,o,n),s[e.value]});else if(Zm(r))t[e.value]=r.value;else if(Jm(r))t[e.value]=null;else throw __DEV__?new H('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 H(55)}function Jc(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 Pr(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 Pr(n,a,o,e)})),oa(t.name.value,n,r)}var Ym=["connection","include","skip","client","rest","export"],oa=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(aa(i),")")}else return r.connection.key;var a=t;if(e){var o=aa(e);a+="(".concat(o,")")}return r&&Object.keys(r).forEach(function(s){Ym.indexOf(s)===-1&&(r[s]&&Object.keys(r[s]).length?a+="@".concat(s,"(").concat(aa(r[s]),")"):a+="@".concat(s))}),a},{setStringify:function(t){var e=aa;return aa=t,e}}),aa=function(e){return JSON.stringify(e,Xm)};function Xm(t,e){return ue(e)&&!Array.isArray(e)&&(e=Object.keys(e).sort().reduce(function(r,n){return r[n]=e[n],r},{})),e}function hr(t,e){if(t.arguments&&t.arguments.length){var r={};return t.arguments.forEach(function(n){var i=n.name,a=n.value;return Pr(r,i,a,e)}),r}return null}function Pt(t){return t.alias?t.alias.value:t.name.value}function sa(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(Ct(a)){if(a.name.value==="__typename")return t[Pt(a)]}else{var o=sa(t,yn(a,r).selectionSet,r);if(typeof o=="string")return o}}}function Ct(t){return t.kind==="Field"}function Yc(t){return t.kind==="InlineFragment"}function ci(t){__DEV__?N(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'):N(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 H('Schema type definitions not allowed in queries. Found: "'.concat(r.kind,'"')):new H(48);return r});return __DEV__?N(e.length<=1,"Ambiguous GraphQL document: contains ".concat(e.length," operations")):N(e.length<=1,49),t}function Xt(t){return ci(t),t.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function ui(t){return t.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function vn(t){return t.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function ca(t){var e=Xt(t);return __DEV__?N(e&&e.operation==="query","Must contain a query definition."):N(e&&e.operation==="query",50),e}function Xc(t){__DEV__?N(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'):N(t.kind==="Document",51),__DEV__?N(t.definitions.length<=1,"Fragment must have exactly one definition."):N(t.definitions.length<=1,52);var e=t.definitions[0];return __DEV__?N(e.kind==="FragmentDefinition","Must be a fragment definition."):N(e.kind==="FragmentDefinition",53),e}function bn(t){ci(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 H("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new H(54)}function _n(t){var e=Object.create(null),r=t&&t.variableDefinitions;return r&&r.length&&r.forEach(function(n){n.defaultValue&&Pr(e,n.variable.name,n.defaultValue)}),e}var ye=Array.isArray;function Be(t){return Array.isArray(t)&&t.length>0}var nf={kind:Le.FIELD,name:{kind:Le.NAME,value:"__typename"}};function of(t,e){return!t||t.selectionSet.selections.every(function(r){return r.kind===Le.FRAGMENT_SPREAD&&of(e[r.name.value],e)})}function eg(t){return of(Xt(t)||Xc(t),gn(vn(t)))?null:t}function tg(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 af(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 eu(t,e){for(var r=af(""),n=af(""),i=function(w){for(var _=0,y=void 0;_<w.length&&(y=w[_]);++_)if(!ye(y)){if(y.kind===Le.OPERATION_DEFINITION)return r(y.name&&y.name.value);if(y.kind===Le.FRAGMENT_DEFINITION)return n(y.name.value)}return __DEV__&&N.error("Could not find operation or fragment"),null},a=0,o=e.definitions.length-1;o>=0;--o)e.definitions[o].kind===Le.OPERATION_DEFINITION&&++a;var s=tg(t),u=t.some(function(w){return w.remove}),c=function(w){return u&&w&&w.some(s)},l=new Map,d=!1,f={enter:function(w){if(c(w.directives))return d=!0,null}},p=it(e,{Field:f,InlineFragment:f,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(w,_,y,T,R){var k=i(R);k&&k.variables.add(w.name.value)}},FragmentSpread:{enter:function(w,_,y,T,R){if(c(w.directives))return d=!0,null;var k=i(R);k&&k.fragmentSpreads.add(w.name.value)}},FragmentDefinition:{enter:function(w,_,y,T){l.set(JSON.stringify(T),w)},leave:function(w,_,y,T){var R=l.get(JSON.stringify(T));if(w===R)return w;if(a>0&&w.selectionSet.selections.every(function(k){return k.kind===Le.FIELD&&k.name.value==="__typename"}))return n(w.name.value).removed=!0,d=!0,null}},Directive:{leave:function(w){if(s(w))return d=!0,null}}});if(!d)return e;var h=function(w){return w.transitiveVars||(w.transitiveVars=new Set(w.variables),w.removed||w.fragmentSpreads.forEach(function(_){h(n(_)).transitiveVars.forEach(function(y){w.transitiveVars.add(y)})})),w},g=new Set;p.definitions.forEach(function(w){w.kind===Le.OPERATION_DEFINITION?h(r(w.name&&w.name.value)).fragmentSpreads.forEach(function(_){g.add(_)}):w.kind===Le.FRAGMENT_DEFINITION&&a===0&&!n(w.name.value).removed&&g.add(w.name.value)}),g.forEach(function(w){h(n(w)).fragmentSpreads.forEach(function(_){g.add(_)})});var b=function(w){return!!(!g.has(w)||n(w).removed)},C={enter:function(w){if(b(w.name.value))return null}};return eg(it(p,{FragmentSpread:C,FragmentDefinition:C,OperationDefinition:{leave:function(w){if(w.variableDefinitions){var _=h(r(w.name&&w.name.value)).transitiveVars;if(_.size<w.variableDefinitions.length)return S(S({},w),{variableDefinitions:w.variableDefinitions.filter(function(y){return _.has(y.variable.name.value)})})}}}}))}var wn=Object.assign(function(t){return it(t,{SelectionSet:{enter:function(e,r,n){if(!(n&&n.kind===Le.OPERATION_DEFINITION)){var i=e.selections;if(!!i){var a=i.some(function(s){return Ct(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=n;if(!(Ct(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return S(S({},e),{selections:Dr(Dr([],i,!0),[nf],!1)})}}}}}})},{added:function(t){return t===nf}}),rg={test:function(t){var e=t.name.value==="connection";return e&&(!t.arguments||!t.arguments.some(function(r){return r.name.value==="key"}))&&__DEV__&&N.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 tu(t){return eu([rg],ci(t))}function ru(t){var e=bn(t),r=e.operation;if(r==="query")return t;var n=it(t,{OperationDefinition:{enter:function(i){return S(S({},i),{operation:"query"})}}});return n}function nu(t){ci(t);var e=eu([{test:function(r){return r.name.value==="client"},remove:!0}],t);return e}var ng=Object.prototype.hasOwnProperty;function iu(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ua(t)}function ua(t){var e=t[0]||{},r=t.length;if(r>1)for(var n=new mt,i=1;i<r;++i)e=n.merge(e,t[i]);return e}var ig=function(t,e,r){return this.merge(t[r],e[r])},mt=function(){function t(e){e===void 0&&(e=ig),this.reconciler=e,this.isObject=ue,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 ue(r)&&ue(e)?(Object.keys(r).forEach(function(o){if(ng.call(e,o)){var s=e[o];if(r[o]!==s){var u=n.reconciler.apply(n,Dr([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 ue(e)&&(this.pastCopies.has(e)||(Array.isArray(e)?e=e.slice(0):e=S({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},t}();function ag(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=og(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 og(t,e){if(!!t){if(typeof t=="string")return sf(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 sf(t,e)}}function sf(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 cf(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 cu(t,e,r){return e&&cf(t.prototype,e),r&&cf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var uu=function(){return typeof Symbol=="function"},lu=function(t){return uu()&&Boolean(Symbol[t])},pu=function(t){return lu(t)?Symbol[t]:"@@"+t};uu()&&!lu("observable")&&(Symbol.observable=Symbol("observable"));var sg=pu("iterator"),ou=pu("observable"),uf=pu("species");function Uo(t,e){var r=t[e];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function la(t){var e=t.constructor;return e!==void 0&&(e=e[uf],e===null&&(e=void 0)),e!==void 0?e:ne}function cg(t){return t instanceof ne}function li(t){li.log?li.log(t):setTimeout(function(){throw t})}function Mo(t){Promise.resolve().then(function(){try{t()}catch(e){li(e)}})}function lf(t){var e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var r=Uo(e,"unsubscribe");r&&r.call(e)}}catch(n){li(n)}}function su(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function ug(t){var e=t._queue;if(!!e){t._queue=void 0,t._state="ready";for(var r=0;r<e.length&&(pf(t,e[r].type,e[r].value),t._state!=="closed");++r);}}function pf(t,e,r){t._state="running";var n=t._observer;try{var i=Uo(n,e);switch(e){case"next":i&&i.call(n,r);break;case"error":if(su(t),i)i.call(n,r);else throw r;break;case"complete":su(t),i&&i.call(n);break}}catch(a){li(a)}t._state==="closed"?lf(t):t._state==="running"&&(t._state="ready")}function au(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}],Mo(function(){return ug(t)});return}pf(t,e,r)}}var lg=function(){function t(r,n){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var i=new pg(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"&&(su(this),lf(this))},cu(t,[{key:"closed",get:function(){return this._state==="closed"}}]),t}(),pg=function(){function t(r){this._subscription=r}var e=t.prototype;return e.next=function(n){au(this._subscription,"next",n)},e.error=function(n){au(this._subscription,"error",n)},e.complete=function(){au(this._subscription,"complete")},cu(t,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),t}(),ne=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 lg(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=la(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=la(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=la(this),o=arguments.length>1,s=!1,u=arguments[1],c=u;return new a(function(l){return i.subscribe({next:function(d){var f=!s;if(s=!0,!f||o)try{c=n(c,d)}catch(p){return l.error(p)}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=la(this);return new s(function(u){var c,l=0;function d(f){c=f.subscribe({next:function(p){u.next(p)},error:function(p){u.error(p)},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=la(this);return new a(function(o){var s=[],u=i.subscribe({next:function(l){if(n)try{l=n(l)}catch(f){return o.error(f)}var d=a.from(l).subscribe({next:function(f){o.next(f)},error:function(f){o.error(f)},complete:function(){var f=s.indexOf(d);f>=0&&s.splice(f,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[ou]=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=Uo(n,ou);if(a){var o=a.call(n);if(Object(o)!==o)throw new TypeError(o+" is not an object");return cg(o)&&o.constructor===i?o:new i(function(s){return o.subscribe(s)})}if(lu("iterator")&&(a=Uo(n,sg),a))return new i(function(s){Mo(function(){if(!s.closed){for(var u=ag(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){Mo(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){Mo(function(){if(!s.closed){for(var u=0;u<i.length;++u)if(s.next(i[u]),s.closed)return;s.complete()}})})},cu(t,null,[{key:uf,get:function(){return this}}]),t}();uu()&&Object.defineProperty(ne,Symbol("extensions"),{value:{symbol:ou,hostReportError:li},configurable:!0});function fu(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 pi;typeof self<"u"?pi=self:typeof window<"u"?pi=window:typeof global<"u"?pi=global:typeof module<"u"?pi=module:pi=Function("return this")();var m_=fu(pi);var ff=ne.prototype,df="@@observable";ff[df]||(ff[df]=function(){return this});var fg=Object.prototype.toString;function jo(t){return du(t)}function du(t,e){switch(fg.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]=du(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]=du(t[i],e)}),n}default:return t}}function dg(t){var e=new Set([t]);return e.forEach(function(r){ue(r)&&hg(r)===r&&Object.getOwnPropertyNames(r).forEach(function(n){ue(r[n])&&e.add(r[n])})}),t}function hg(t){if(__DEV__&&!Object.isFrozen(t))try{Object.freeze(t)}catch(e){if(e instanceof TypeError)return null;throw e}return t}function pa(t){return __DEV__&&dg(t),t}function Sn(t,e,r){var n=[];t.forEach(function(i){return i[e]&&n.push(i)}),n.forEach(function(i){return i[e](r)})}function Bo(t,e,r){return new ne(function(n){var i=n.next,a=n.error,o=n.complete,s=0,u=!1,c={then:function(p){return new Promise(function(h){return h(p())})}};function l(p,h){return p?function(g){++s;var b=function(){return p(g)};c=c.then(b,b).then(function(C){--s,i&&i.call(n,C),u&&d.complete()},function(C){throw--s,C}).catch(function(C){a&&a.call(n,C)})}: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)}},f=t.subscribe(d);return function(){return f.unsubscribe()}})}var Rt=typeof WeakMap=="function"&&Ge(function(){return navigator.product})!=="ReactNative",hf=typeof WeakSet=="function",hu=typeof Symbol=="function"&&typeof Symbol.for=="function",Rr=hu&&Symbol.asyncIterator,I_=typeof Ge(function(){return window.document.createElement})=="function",T_=Ge(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1;function qo(t){function e(r){Object.defineProperty(t,r,{value:ne})}return hu&&Symbol.species&&e(Symbol.species),e("@@species"),t}function mf(t){return t&&typeof t.then=="function"}var fi=function(t){De(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),Sn(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),Sn(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?mf(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"),Sn(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 ne(r)]),mf(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}(ne);qo(fi);function $r(t){return"incremental"in t}function mg(t){return"hasNext"in t&&"data"in t}function gf(t){return $r(t)||mg(t)}function Vo(t,e){var r=t,n=new mt;return $r(e)&&Be(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 di(t){var e=Qo(t);return Be(e)}function Qo(t){var e=Be(t.errors)?t.errors.slice(0):[];return $r(t)&&Be(t.incremental)&&t.incremental.forEach(function(r){r.errors&&e.push.apply(e,r.errors)}),e}function Lr(){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 yf=new Map;function fa(t){var e=yf.get(t)||1;return yf.set(t,e+1),"".concat(t,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function vf(t){var e=fa("stringifyForDisplay");return JSON.stringify(t,function(r,n){return n===void 0?e:n}).split(JSON.stringify(e)).join("<undefined>")}function da(t,e){return Lr(t,e,e.variables&&{variables:S(S({},t&&t.variables),e.variables)})}function zo(t){return new ne(function(e){e.error(t)})}var ha=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 mu(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 H("illegal argument: ".concat(i)):new H(27)}return t}function gu(t,e){var r=S({},t),n=function(a){typeof a=="function"?r=S(S({},r),a(r)):r=S(S({},r),a)},i=function(){return S({},r)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:n}),Object.defineProperty(e,"getContext",{enumerable:!1,value:i}),e}function yu(t){var e={variables:t.variables||{},extensions:t.extensions||{},operationName:t.operationName,query:t.query};return e.operationName||(e.operationName=typeof e.query!="string"?ui(e.query)||void 0:""),e}function bf(t,e){return e?e(t):ne.of()}function ma(t){return typeof t=="function"?new $t(t):t}function Ho(t){return t.request.length<=1}var gg=function(t){De(e,t);function e(r,n){var i=t.call(this,r)||this;return i.link=n,i}return e}(Error),$t=function(){function t(e){e&&(this.request=e)}return t.empty=function(){return new t(function(){return ne.of()})},t.from=function(e){return e.length===0?t.empty():e.map(ma).reduce(function(r,n){return r.concat(n)})},t.split=function(e,r,n){var i=ma(r),a=ma(n||new t(bf));return Ho(i)&&Ho(a)?new t(function(o){return e(o)?i.request(o)||ne.of():a.request(o)||ne.of()}):new t(function(o,s){return e(o)?i.request(o,s)||ne.of():a.request(o,s)||ne.of()})},t.execute=function(e,r){return e.request(gu(r.context,yu(mu(r))))||ne.of()},t.concat=function(e,r){var n=ma(e);if(Ho(n))return __DEV__&&N.warn(new gg("You are calling concat on a terminating link, which will have no effect",n)),n;var i=ma(r);return Ho(i)?new t(function(a){return n.request(a,function(o){return i.request(o)||ne.of()})||ne.of()}):new t(function(a,o){return n.request(a,function(s){return i.request(s,o)||ne.of()})||ne.of()})},t.prototype.split=function(e,r,n){return this.concat(t.split(e,r,n||new t(bf)))},t.prototype.concat=function(e){return t.concat(this,e)},t.prototype.request=function(e,r){throw __DEV__?new H("request is not implemented"):new H(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 hi=$t.execute;var _f="3.7.10";function wf(t){return!!t.body}function Sf(t){return!!t.getReader}function Cf(t){return!!(Rr&&t[Symbol.asyncIterator])}function xf(t){return!!t.stream}function Ef(t){return!!t.arrayBuffer}function kf(t){return!!t.pipe}function vu(t){var e,r=t[Symbol.asyncIterator]();return e={next:function(){return r.next()}},e[Symbol.asyncIterator]=function(){return this},e}function bu(t){var e=null,r=null,n=!1,i=[],a=[];function o(d){if(!r){if(a.length){var f=a.shift();if(Array.isArray(f)&&f[0])return f[0]({value:d,done:!1})}i.push(d)}}function s(d){r=d;var f=a.slice();f.forEach(function(p){p[1](d)}),!e||e()}function u(){n=!0;var d=a.slice();d.forEach(function(f){f[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,f){if(r)return f(r);if(i.length)return d({value:i.shift(),done:!1});if(n)return d({value:void 0,done:!0});a.push([d,f])})}var l={next:function(){return c()}};return Rr&&(l[Symbol.asyncIterator]=function(){return this}),l}function _u(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 Rr&&(r[Symbol.asyncIterator]=function(){return this}),r}function Go(t){var e={next:function(){return t.read()}};return Rr&&(e[Symbol.asyncIterator]=function(){return this}),e}function Af(t){var e=t;if(wf(t)&&(e=t.body),Cf(e))return vu(e);if(Sf(e))return Go(e.getReader());if(xf(e))return Go(e.stream().getReader());if(Ef(e))return _u(e.arrayBuffer());if(kf(e))return bu(e);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var If=Object.prototype.hasOwnProperty;function Tf(t,e){var r,n,i;return Bt(this,void 0,void 0,function(){var a,o,s,u,c,l,d,f,p,h,g,b,C,w,_,y,T,R,k,P;return qt(this,function(M){switch(M.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=Af(t),f=!0,M.label=1;case 1:return f?[4,d.next()]:[3,3];case 2:for(p=M.sent(),h=p.value,g=p.done,b=typeof h=="string"?h:a.decode(h),f=!g,l+=b,C=l.indexOf(c);C>-1;){if(w=void 0,P=[l.slice(0,C),l.slice(C+c.length)],w=P[0],l=P[1],w.trim()){if(_=w.indexOf(`\r
27
27
  \r
28
- `),y=fg(_.slice(0,b)),T=y["content-type"],T&&T.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");R=_.slice(b);try{k=xf(t,R.replace(`\r
29
- `,"")),(Object.keys(k).length>1||"data"in k||"incremental"in k||"errors"in k)&&((n=e.next)===null||n===void 0||n.call(e,k))}catch($){qo($,e)}}C=l.indexOf(c)}return[3,1];case 3:return(i=e.complete)===null||i===void 0||i.call(e),[2]}})})}function fg(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 xf(t,e){if(t.status>=300){var r=function(){try{return JSON.parse(e)}catch{return e}};fa(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 qo(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 Ef(t,e,r){dg(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 qo(n,r)})}function dg(t){return function(e){return e.text().then(function(r){return xf(e,r)}).then(function(r){return e.status>=300&&fa(e,r,"Response not successful: Received status code ".concat(e.status)),!Array.isArray(r)&&!Sf.call(r,"data")&&!Sf.call(r,"errors")&&fa(e,r,"Server response was missing for query '".concat(Array.isArray(t)?t.map(function(n){return n.operationName}):t.operationName,"'.")),r})}}var ha=function(t,e){var r;try{r=JSON.stringify(t)}catch(i){var n=__DEV__?new z("Network request failed. ".concat(e," is not serializable: ").concat(i.message)):new z(24);throw n.parseError=i,n}return r};var hg={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},mg={accept:"*/*","content-type":"application/json"},gg={method:"POST"},kf={http:hg,headers:mg,options:gg},If=function(t,e){return e(t)};function Af(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i={},a={};r.forEach(function(d){i=w(w(w({},i),d.options),{headers:w(w({},i.headers),d.headers)}),d.credentials&&(i.credentials=d.credentials),a=w(w({},a),d.http)}),i.headers&&(i.headers=yg(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,ai)),{options:i,body:l}}function yg(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 Tf=function(t){if(!t&&typeof fetch>"u")throw __DEV__?new z(`
28
+ `),y=yg(w.slice(0,_)),T=y["content-type"],T&&T.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");R=w.slice(_);try{k=Of(t,R.replace(`\r
29
+ `,"")),(Object.keys(k).length>1||"data"in k||"incremental"in k||"errors"in k)&&((n=e.next)===null||n===void 0||n.call(e,k))}catch($){Wo($,e)}}C=l.indexOf(c)}return[3,1];case 3:return(i=e.complete)===null||i===void 0||i.call(e),[2]}})})}function yg(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 Of(t,e){if(t.status>=300){var r=function(){try{return JSON.parse(e)}catch{return e}};ha(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 Wo(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 Df(t,e,r){vg(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 Wo(n,r)})}function vg(t){return function(e){return e.text().then(function(r){return Of(e,r)}).then(function(r){return e.status>=300&&ha(e,r,"Response not successful: Received status code ".concat(e.status)),!Array.isArray(r)&&!If.call(r,"data")&&!If.call(r,"errors")&&ha(e,r,"Server response was missing for query '".concat(Array.isArray(t)?t.map(function(n){return n.operationName}):t.operationName,"'.")),r})}}var ga=function(t,e){var r;try{r=JSON.stringify(t)}catch(i){var n=__DEV__?new H("Network request failed. ".concat(e," is not serializable: ").concat(i.message)):new H(24);throw n.parseError=i,n}return r};var bg={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},_g={accept:"*/*","content-type":"application/json"},wg={method:"POST"},Nf={http:bg,headers:_g,options:wg},Pf=function(t,e){return e(t)};function Rf(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i={},a={};r.forEach(function(d){i=S(S(S({},i),d.options),{headers:S(S({},i.headers),d.headers)}),d.credentials&&(i.credentials=d.credentials),a=S(S({},a),d.http)}),i.headers&&(i.headers=Sg(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,oi)),{options:i,body:l}}function Sg(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 $f=function(t){if(!t&&typeof fetch>"u")throw __DEV__?new H(`
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 z(23)};var Of=function(){if(typeof AbortController>"u")return{controller:!1,signal:!1};var t=new AbortController,e=t.signal;return{controller:t,signal:e}};var Df=function(t,e){var r=t.getContext(),n=r.uri;return n||(typeof e=="function"?e(t):e||"/graphql")};function Nf(t,e){var r=[],n=function(d,f){r.push("".concat(d,"=").concat(encodeURIComponent(f)))};if("query"in e&&n("query",e.query),e.operationName&&n("operationName",e.operationName),e.variables){var i=void 0;try{i=ha(e.variables,"Variables map")}catch(d){return{parseError:d}}n("variables",i)}if(e.extensions){var a=void 0;try{a=ha(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 Pf=Ge(function(){return fetch}),Rf=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?If:i,o=t.includeExtensions,s=t.preserveHeaderCase,u=t.useGETForQueries,c=t.includeUnusedVariables,l=c===void 0?!1:c,d=Zt(t,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);__DEV__&&Tf(n||Pf);var f={http:{includeExtensions:o,preserveHeaderCase:s},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new Rt(function(p){var h=Df(p,r),g=p.getContext(),v={};if(g.clientAwareness){var C=g.clientAwareness,_=C.name,b=C.version;_&&(v["apollographql-client-name"]=_),b&&(v["apollographql-client-version"]=b)}var y=w(w({},v),g.headers),T={http:g.http,options:g.fetchOptions,credentials:g.credentials,headers:y},R=Af(p,a,kf,f,T),k=R.options,P=R.body;if(P.variables&&!l){var F=new Set(Object.keys(P.variables));nt(p.query,{Variable:function(ae,Wt,J){J&&J.kind!=="VariableDefinition"&&F.delete(ae.name.value)}}),F.size&&(P.variables=w({},P.variables),F.forEach(function(ae){delete P.variables[ae]}))}var $;if(!k.signal){var q=Of(),Ze=q.controller,Me=q.signal;$=Ze,$&&(k.signal=Me)}var V=function(ae){return ae.kind==="OperationDefinition"&&ae.operation==="mutation"};if(u&&!p.query.definitions.some(V)&&(k.method="GET"),oi(["defer"],p.query)&&(k.headers=k.headers||{},k.headers.accept="multipart/mixed; deferSpec=20220824, application/json"),k.method==="GET"){var be=Nf(h,P),_e=be.newURI,ie=be.parseError;if(ie)return Uo(ie);h=_e}else try{k.body=ha(P,"Payload")}catch(ae){return Uo(ae)}return new Y(function(ae){var Wt=n||Ge(function(){return fetch})||Pf;return Wt(h,k).then(function(J){var Kt;p.setContext({response:J});var Ir=(Kt=J.headers)===null||Kt===void 0?void 0:Kt.get("content-type");return Ir!==null&&/^multipart\/mixed/i.test(Ir)?Cf(J,ae):Ef(J,p,ae)}).catch(function(J){return qo(J,ae)}),function(){$&&$.abort()}})})};var vu=function(t){Oe(e,t);function e(r){r===void 0&&(r={});var n=t.call(this,Rf(r).request)||this;return n.options=r,n}return e}(Rt);var{toString:$f,hasOwnProperty:vg}=Object.prototype,Lf=Function.prototype.toString,bu=new Map;function xe(t,e){try{return _u(t,e)}finally{bu.clear()}}function _u(t,e){if(t===e)return!0;let r=$f.call(t),n=$f.call(e);if(r!==n)return!1;switch(r){case"[object Array]":if(t.length!==e.length)return!1;case"[object Object]":{if(Mf(t,e))return!0;let i=Ff(t),a=Ff(e),o=i.length;if(o!==a.length)return!1;for(let s=0;s<o;++s)if(!vg.call(e,i[s]))return!1;for(let s=0;s<o;++s){let u=i[s];if(!_u(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(Mf(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&&!_u(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=Lf.call(t);return i!==Lf.call(e)?!1:!wg(i,_g)}}return!1}function Ff(t){return Object.keys(t).filter(bg,t)}function bg(t){return this[t]!==void 0}var _g="{ [native code] }";function wg(t,e){let r=t.length-e.length;return r>=0&&t.indexOf(e,r)===r}function Mf(t,e){let r=bu.get(t);if(r){if(r.has(e))return!0}else bu.set(t,r=new Set);return r.add(e),!1}var Sg=function(){return Object.create(null)},Uf=Array.prototype,Cg=Uf.forEach,xg=Uf.slice,Xt=function(){function t(e,r){e===void 0&&(e=!0),r===void 0&&(r=Sg),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 Cg.call(e,function(n){return r=r.getChildTrie(n)}),r.data||(r.data=this.makeData(xg.call(e)))},t.prototype.getChildTrie=function(e){var r=this.weakness&&Eg(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 Eg(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}var Xe=null,jf={},kg=1,Ig=()=>class{constructor(){this.id=["slot",kg++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=Xe;e;e=e.parent)if(this.id in e.slots){let r=e.slots[this.id];if(r===jf)break;return e!==Xe&&(Xe.slots[this.id]=r),!0}return Xe&&(Xe.slots[this.id]=jf),!1}getValue(){if(this.hasValue())return Xe.slots[this.id]}withValue(e,r,n,i){let a={__proto__:null,[this.id]:e},o=Xe;Xe={parent:o,slots:a};try{return r.apply(i,n)}finally{Xe=o}}static bind(e){let r=Xe;return function(){let n=Xe;try{return Xe=r,e.apply(this,arguments)}finally{Xe=n}}}static noContext(e,r,n){if(Xe){let i=Xe;try{return Xe=null,e.apply(n,r)}finally{Xe=i}}else return e.apply(n,r)}};function Bf(t){try{return t()}catch{}}var wu="@wry/context:Slot",Ag=Bf(()=>globalThis)||Bf(()=>global)||Object.create(null),qf=Ag,hi=qf[wu]||Array[wu]||function(t){try{Object.defineProperty(qf,wu,{value:t,enumerable:!1,writable:!1,configurable:!0})}finally{return t}}(Ig());var{bind:Tg,noContext:Og}=hi;function Dg(){}var Ng=function(){function t(e,r){e===void 0&&(e=1/0),r===void 0&&(r=Dg),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}(),Qo=new hi,Su,Pg=Object.prototype.hasOwnProperty,xu=(Su=Array.from,Su===void 0?function(t){var e=[];return t.forEach(function(r){return e.push(r)}),e}:Su);function Vo(t){var e=t.unsubscribe;typeof e=="function"&&(t.unsubscribe=void 0,e())}var ma=[],Rg=100;function mi(t,e){if(!t)throw new Error(e||"assertion failure")}function $g(t,e){var r=t.length;return r>0&&r===e.length&&t[r-1]===e[r-1]}function Qf(t){switch(t.length){case 0:throw new Error("unknown value");case 1:return t[0];case 2:throw t[1]}}function Lg(t){return t.slice(0)}var Fg=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&&!Fr(this))return Vf(this),this.value[0]},t.prototype.recompute=function(e){return mi(!this.recomputing,"already recomputing"),Vf(this),Fr(this)?Mg(this,e):Qf(this.value)},t.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,zf(this),Vo(this))},t.prototype.dispose=function(){var e=this;this.setDirty(),Zf(this),Eu(this,function(r,n){r.setDirty(),Jf(r,e)})},t.prototype.forget=function(){this.dispose()},t.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=ma.pop()||new Set),this.deps.add(e)},t.prototype.forgetDeps=function(){var e=this;this.deps&&(xu(this.deps).forEach(function(r){return r.delete(e)}),this.deps.clear(),ma.push(this.deps),this.deps=null)},t.count=0,t}();function Vf(t){var e=Qo.getValue();if(e)return t.parents.add(e),e.childValues.has(t)||e.childValues.set(t,[]),Fr(t)?Hf(e,t):Wf(e,t),e}function Mg(t,e){return Zf(t),Qo.withValue(t,Ug,[t,e]),Bg(t,e)&&jg(t),Qf(t.value)}function Ug(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 Fr(t){return t.dirty||!!(t.dirtyChildren&&t.dirtyChildren.size)}function jg(t){t.dirty=!1,!Fr(t)&&Gf(t)}function zf(t){Eu(t,Hf)}function Gf(t){Eu(t,Wf)}function Eu(t,e){var r=t.parents.size;if(r)for(var n=xu(t.parents),i=0;i<r;++i)e(n[i],t)}function Hf(t,e){mi(t.childValues.has(e)),mi(Fr(e));var r=!Fr(t);if(!t.dirtyChildren)t.dirtyChildren=ma.pop()||new Set;else if(t.dirtyChildren.has(e))return;t.dirtyChildren.add(e),r&&zf(t)}function Wf(t,e){mi(t.childValues.has(e)),mi(!Fr(e));var r=t.childValues.get(e);r.length===0?t.childValues.set(e,Lg(e.value)):$g(r,e.value)||t.setDirty(),Kf(t,e),!Fr(t)&&Gf(t)}function Kf(t,e){var r=t.dirtyChildren;r&&(r.delete(e),r.size===0&&(ma.length<Rg&&ma.push(r),t.dirtyChildren=null))}function Zf(t){t.childValues.size>0&&t.childValues.forEach(function(e,r){Jf(t,r)}),t.forgetDeps(),mi(t.dirtyChildren===null)}function Jf(t,e){e.parents.delete(t),t.childValues.delete(e),Kf(t,e)}function Bg(t,e){if(typeof t.subscribe=="function")try{Vo(t),t.unsubscribe=t.subscribe.apply(null,e)}catch{return t.setDirty(),!1}return!0}var qg={setDirty:!0,dispose:!0,forget:!0};function zo(t){var e=new Map,r=t&&t.subscribe;function n(i){var a=Qo.getValue();if(a){var o=e.get(i);o||e.set(i,o=new Set),a.dependOn(o),typeof r=="function"&&(Vo(o),o.unsubscribe=r(i))}}return n.dirty=function(a,o){var s=e.get(a);if(s){var u=o&&Pg.call(qg,o)?o:"setDirty";xu(s).forEach(function(c){return c[u]()}),e.delete(a),Vo(s)}},n}function Yf(){var t=new Xt(typeof WeakMap=="function");return function(){return t.lookupArray(arguments)}}var a9=Yf(),Cu=new Set;function Cn(t,e){e===void 0&&(e=Object.create(null));var r=new Ng(e.max||Math.pow(2,16),function(c){return c.dispose()}),n=e.keyArgs,i=e.makeCacheKey||Yf(),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 Fg(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),Cu.add(r),Qo.hasValue()||(Cu.forEach(function(f){return f.clean()}),Cu.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 ku=function(){function t(){this.getFragmentDoc=Cn(Gc)}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(w(w({},e),{rootId:e.id||"ROOT_QUERY",optimistic:r}))},t.prototype.readFragment=function(e,r){return r===void 0&&(r=!!e.optimistic),this.read(w(w({},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=Zt(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=Zt(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(w(w({},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(w(w({},e),{data:a})),a)}})},t}();var ga=function(t){Oe(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 De=Object.prototype.hasOwnProperty;function ya(t){return t==null}function Ho(t,e){var r=t.__typename,n=t.id,i=t._id;if(typeof r=="string"&&(e&&(e.keyObject=ya(n)?ya(i)?void 0:{_id:i}:{id:n}),ya(n)&&!ya(i)&&(n=i),!ya(n)))return"".concat(r,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var Xf={dataIdFromObject:Ho,addTypename:!0,resultCaching:!0,canonizeResults:!1};function ed(t){return Lr(Xf,t)}function Wo(t){var e=t.canonizeResults;return e===void 0?Xf.canonizeResults:e}function td(t,e){return ee(e)?t.get(e.__ref,"__typename"):e&&e.__typename}var Iu=/^[_a-z][_0-9a-z]*/i;function Qt(t){var e=t.match(Iu);return e?e[0]:t}function Go(t,e,r){return oe(e)?he(e)?e.every(function(n){return Go(t,n,r)}):t.selections.every(function(n){if(Ct(n)&&dr(n,r)){var i=Nt(n);return De.call(e,i)&&(!n.selectionSet||Go(n.selectionSet,e[i],r))}return!0}):!1}function Mr(t){return oe(t)&&!ee(t)&&!he(t)}function rd(){return new ht}function Ko(t,e){var r=gn(vn(t));return{fragmentMap:r,lookupFragment:function(n){var i=r[n];return!i&&e&&(i=e.lookup(n)),i||null}}}var Zo=Object.create(null),Au=function(){return Zo},nd=Object.create(null),gi=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 ua(ee(i)?n.get(i.__ref,a):i&&i[a])},this.canRead=function(i){return ee(i)?n.has(i.__ref):typeof i=="object"},this.toReference=function(i,a){if(typeof i=="string")return Jt(i);if(ee(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 w({},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),De.call(this.data,e)){var n=this.data[e];if(n&&De.call(n,r))return n[r]}if(r==="__typename"&&De.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof Ur)return this.parent.get(e,r)},t.prototype.lookup=function(e,r){if(r&&this.group.depend(e,"__exists"),De.call(this.data,e))return this.data[e];if(this instanceof Ur)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;ee(e)&&(e=e.__ref),ee(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__?D(typeof i=="string","store.merge expects a string ID"):D(typeof i=="string",1);var s=new ht(Qg).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=Qt(c);l!==c&&!n.policies.hasKeyArgs(s.__typename,l)&&(u[l]=1),s[c]===void 0&&!(n instanceof Ur)&&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:Zo,INVALIDATE:nd,isReference:ee,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=Qt(c),d=i[c];if(d!==void 0){var f=typeof r=="function"?r:r[c]||r[l];if(f){var p=f===Au?Zo:f(ua(d),w(w({},u),{fieldName:l,storeFieldName:c,storage:n.getStorage(e,c)}));p===nd?n.group.dirty(e,c):(p===Zo&&(p=void 0),p!==d&&(a[c]=p,o=!0,d=p))}d!==void 0&&(s=!1)}}),o)return this.merge(e,a),s&&(this instanceof Ur?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]=Au,i):Au)}return!1},t.prototype.evict=function(e,r){var n=!1;return e.id&&(De.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof Ur&&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){De.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&&De.call(e,a)||r.delete(a)}),e){var n=e.__META,i=Zt(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 Ur?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){De.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 Ur;)a=a.parent;i.forEach(function(o){return a.delete(o)})}return i},t.prototype.findChildRefIds=function(e){if(!De.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){ee(a)&&(r[a.__ref]=!0),oe(a)&&Object.keys(a).forEach(function(o){var s=a[o];oe(s)&&i.add(s)})})}return this.refs[e]},t.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},t}();var id=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?zo():null,this.keyMaker=new Xt(Pt)},t.prototype.depend=function(e,r){if(this.d){this.d(Tu(e,r));var n=Qt(r);n!==r&&this.d(Tu(e,n)),this.parent&&this.parent.depend(e,r)}},t.prototype.dirty=function(e,r){this.d&&this.d.dirty(Tu(e,r),r==="__exists"?"forget":"setDirty")},t}();function Tu(t,e){return e+"#"+t}function Ou(t,e){xn(t)&&t.group.depend(e,"__exists")}(function(t){var e=function(r){Oe(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 id(s))||this;return c.stump=new Vg(c),c.storageTrie=new Xt(Pt),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})(gi||(gi={}));var Ur=function(t){Oe(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){xe(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 w(w({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(r){var n=this.parent.findChildRefIds(r);return De.call(this.data,r)?w(w({},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}(gi),Vg=function(t){Oe(e,t);function e(r){return t.call(this,"EntityStore.Stump",r,function(){},new id(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}(Ur);function Qg(t,e,r){var n=t[r],i=e[r];return xe(n,i)?n:i}function xn(t){return!!(t instanceof gi&&t.group.caching)}function zg(t){return oe(t)?he(t)?t.slice(0):w({__proto__:Object.getPrototypeOf(t)},t):t}var Jo=function(){function t(){this.known=new(cf?WeakSet:Set),this.pool=new Xt(Pt),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return t.prototype.isKnown=function(e){return oe(e)&&this.known.has(e)},t.prototype.pass=function(e){if(oe(e)){var r=zg(e);return this.passes.set(r,e),r}return e},t.prototype.admit=function(e){var r=this;if(oe(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(p){u.push(r.admit(e[p]))});var o=this.pool.lookupArray(u);if(!o.object){var d=o.object=Object.create(s);this.known.add(d),c.sorted.forEach(function(p,h){d[p]=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 xt=Object.assign(function(t){if(oe(t)){Du===void 0&&ad();var e=Du.admit(t),r=Nu.get(e);return r===void 0&&Nu.set(e,r=JSON.stringify(e)),r}return JSON.stringify(t)},{reset:ad}),Du,Nu;function ad(){Du=new Jo,Nu=new(Pt?WeakMap:Map)}function od(t){return[t.selectionSet,t.objectOrReference,t.context,t.context.canonizeResults]}var sd=function(){function t(e){var r=this;this.knownResults=new(Pt?WeakMap:Map),this.config=Lr(e,{addTypename:e.addTypename!==!1,canonizeResults:Wo(e)}),this.canon=e.canon||new Jo,this.executeSelectionSet=Cn(function(n){var i,a=n.context.canonizeResults,o=od(n);o[3]=!a;var s=(i=r.executeSelectionSet).peek.apply(i,o);return s?a?w(w({},s),{result:r.canon.admit(s.result)}):s:(Ou(n.context.store,n.enclosingRef.__ref),r.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize,keyArgs:od,makeCacheKey:function(n,i,a,o){if(xn(a.store))return a.store.makeCacheKey(n,ee(i)?i.__ref:i,a.varString,o)}}),this.executeSubSelectedArray=Cn(function(n){return Ou(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(xn(o.store))return o.store.makeCacheKey(i,a,o.varString)}})}return t.prototype.resetCanon=function(){this.canon=new Jo},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=w(w({},_n(oa(n))),o);var f=Jt(a),p=this.executeSelectionSet({selectionSet:bn(n).selectionSet,objectOrReference:f,enclosingRef:f,context:w({store:r,query:n,policies:d,variables:o,varString:xt(o),canonizeResults:l},Ko(n,this.config.fragments))}),h;if(p.missing&&(h=[new ga(Gg(p.missing),p.missing,n,o)],!u))throw h[0];return{result:p.result,complete:!h,missing:h}},t.prototype.isFresh=function(e,r,n,i){if(xn(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(ee(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=[],f,p=new ht;this.config.addTypename&&typeof l=="string"&&!u.rootIdsByTypename[l]&&d.push({__typename:l});function h(b,y){var T;return b.missing&&(f=p.merge(f,(T={},T[y]=b.missing,T))),b.result}var g=new Set(n.selections);g.forEach(function(b){var y,T;if(!!dr(b,s))if(Ct(b)){var R=u.readField({fieldName:b.name.value,field:b,variables:o.variables,from:i},o),k=Nt(b);R===void 0?wn.added(b)||(f=p.merge(f,(y={},y[k]="Can't find field '".concat(b.name.value,"' on ").concat(ee(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),y))):he(R)?R=h(r.executeSubSelectedArray({field:b,array:R,enclosingRef:a,context:o}),k):b.selectionSet?R!=null&&(R=h(r.executeSelectionSet({selectionSet:b.selectionSet,objectOrReference:R,enclosingRef:ee(R)?R:a,context:o}),k)):o.canonizeResults&&(R=r.canon.pass(R)),R!==void 0&&d.push((T={},T[k]=R,T))}else{var P=yn(b,o.lookupFragment);if(!P&&b.kind===$e.FRAGMENT_SPREAD)throw __DEV__?new z("No fragment named ".concat(b.name.value)):new z(5);P&&u.fragmentMatches(P,l)&&P.selectionSet.selections.forEach(g.add,g)}});var v=sa(d),C={result:v,missing:f},_=o.canonizeResults?this.canon.admit(C):ua(C);return _.result&&this.knownResults.set(_.result,n),_},t.prototype.execSubSelectedArrayImpl=function(e){var r=this,n=e.field,i=e.array,a=e.enclosingRef,o=e.context,s,u=new ht;function c(l,d){var f;return l.missing&&(s=u.merge(s,(f={},f[d]=l.missing,f))),l.result}return n.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(l,d){return l===null?null:he(l)?c(r.executeSubSelectedArray({field:n,array:l,enclosingRef:a,context:o}),d):n.selectionSet?c(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:l,enclosingRef:ee(l)?l:a,context:o}),d):(__DEV__&&Hg(o.store,n,l),l)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:s}},t}();function Gg(t){try{JSON.stringify(t,function(e,r){if(typeof r=="string")throw r;return r})}catch(e){return e}}function Hg(t,e,r){if(!e.selectionSet){var n=new Set([r]);n.forEach(function(i){oe(i)&&(__DEV__?D(!ee(i),"Missing selection set for object of type ".concat(td(t,i)," returned for query field ").concat(e.name.value)):D(!ee(i),6),Object.values(i).forEach(n.add,n))})}}var yi=new hi,cd=new WeakMap;function va(t){var e=cd.get(t);return e||cd.set(t,e={vars:new Set,dep:zo()}),e}function Pu(t){va(t).vars.forEach(function(e){return e.forgetCache(t)})}function ud(t){va(t).vars.forEach(function(e){return e.attachCache(t)})}function Yo(t){var e=new Set,r=new Set,n=function(a){if(arguments.length>0){if(t!==a){t=a,e.forEach(function(u){va(u).dep.dirty(n),Wg(u)});var o=Array.from(r);r.clear(),o.forEach(function(u){return u(t)})}}else{var s=yi.getValue();s&&(i(s),va(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),va(a).vars.add(n),n};return n.forgetCache=function(a){return e.delete(a)},n}function Wg(t){t.broadcastWatches&&t.broadcastWatches()}var ld=Object.create(null);function Ru(t){var e=JSON.stringify(t);return ld[e]||(ld[e]=Object.create(null))}function $u(t){var e=Ru(t);return e.keyFieldsFn||(e.keyFieldsFn=function(r,n){var i=function(o,s){return n.readField(s,o)},a=n.keyObject=Fu(t,function(o){var s=vi(n.storeObject,o,i);return s===void 0&&r!==n.storeObject&&De.call(r,o[0])&&(s=vi(r,o,fd)),__DEV__?D(s!==void 0,"Missing field '".concat(o.join("."),"' while extracting keyFields from ").concat(JSON.stringify(r))):D(s!==void 0,2),s});return"".concat(n.typename,":").concat(JSON.stringify(a))})}function Lu(t){var e=Ru(t);return e.keyArgsFn||(e.keyArgsFn=function(r,n){var i=n.field,a=n.variables,o=n.fieldName,s=Fu(t,function(c){var l=c[0],d=l.charAt(0);if(d==="@"){if(i&&Ue(i.directives)){var f=l.slice(1),p=i.directives.find(function(C){return C.name.value===f}),h=p&&hr(p,a);return h&&vi(h,c.slice(1))}return}if(d==="$"){var g=l.slice(1);if(a&&De.call(a,g)){var v=c.slice(0);return v[0]=g,vi(a,v)}return}if(r)return vi(r,c)}),u=JSON.stringify(s);return(r||u!=="{}")&&(o+=":"+u),o})}function Fu(t,e){var r=new ht;return pd(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 pd(t){var e=Ru(t);if(!e.paths){var r=e.paths=[],n=[];t.forEach(function(i,a){he(i)?(pd(i).forEach(function(o){return r.push(n.concat(o))}),n.length=0):(n.push(i),he(t[a+1])||(r.push(n.slice(0)),n.length=0))})}return e.paths}function fd(t,e){return t[e]}function vi(t,e,r){return r=r||fd,dd(e.reduce(function n(i,a){return he(i)?i.map(function(o){return n(o,a)}):i&&r(i,a)},t))}function dd(t){return oe(t)?he(t)?t.map(dd):Fu(Object.keys(t).sort(),function(e){return vi(t,e)}):t}ia.setStringify(xt);function Mu(t){return t.args!==void 0?t.args:t.field?hr(t.field,t.variables):null}var Kg=function(){},hd=function(t,e){return e.fieldName},md=function(t,e,r){var n=r.mergeObjects;return n(t,e)},gd=function(t,e){return e},vd=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=w({dataIdFromObject:Ho},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=w(w({},r),{typename:a,storeObject:o,readField:r&&r.readField||function(){var f=Xo(arguments,o);return i.readField(f,{store:i.cache.data,variables:f.variables})}}),u,c=a&&this.getTypePolicy(a),l=c&&c.keyFn||this.config.dataIdFromObject;l;){var d=l(e,s);if(he(d))l=$u(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=Zt(i,["queryType","mutationType","subscriptionType"]);a&&r.setRootTypename("Query",n),o&&r.setRootTypename("Mutation",n),s&&r.setRootTypename("Subscription",n),De.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?md:c===!1?gd:u.merge}s(i,r.merge),i.keyFn=a===!1?Kg:he(a)?$u(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,f=l.read,p=l.merge;c.keyFn=d===!1?hd:he(d)?Lu(d):typeof d=="function"?d:c.keyFn,typeof f=="function"&&(c.read=f),s(c,p)}c.read&&c.merge&&(c.keyFn=c.keyFn||hd)})},t.prototype.setRootTypename=function(e,r){r===void 0&&(r=e);var n="ROOT_"+e.toUpperCase(),i=this.rootTypenamesById[n];r!==i&&(__DEV__?D(!i||i===e,"Cannot change root ".concat(e," __typename more than once")):D(!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(Iu);(!a||a[0]!==i)&&r.fuzzySubtypes.set(i,new RegExp(i))})})},t.prototype.getTypePolicy=function(e){var r=this;if(!De.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=Zt(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,f=0;f<u.length;++f){var p=u[f];if(p.has(o))return s.has(o)||(d&&__DEV__&&D.warn("Inferring subtype ".concat(r," of supertype ").concat(o)),s.add(o)),!0;p.forEach(c),l&&f===u.length-1&&Go(e.selectionSet,n,i)&&(l=!1,d=!0,this.fuzzySubtypes.forEach(function(h,g){var v=r.match(h);v&&v[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=Mu(e);o;){var c=o(u,s);if(he(c))o=Lu(c);else{a=c||n;break}}return a===void 0&&(a=e.field?Wc(e.field,e.variables):ia(n,Mu(e))),a===!1?n:n===Qt(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=Qt(o),u=r.store.getFieldValue(n,o),c=this.getFieldPolicy(e.typename,s,!1),l=c&&c.read;if(l){var d=yd(this,n,e,r,r.store.getStorage(ee(n)?n.__ref:n,o));return yi.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===md?bd(i.store)(e,r):u===gd?r:(i.overwrite&&(e=void 0),u(e,r,yd(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:i.variables},i,a||Object.create(null))))},t}();function yd(t,e,r,n,i){var a=t.getStoreFieldName(r),o=Qt(a),s=r.variables||n.variables,u=n.store,c=u.toReference,l=u.canRead;return{args:Mu(r),field:r.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:ee,toReference:c,storage:i,cache:t.cache,canRead:l,readField:function(){return t.readField(Xo(arguments,e,s),n)},mergeObjects:bd(n.store)}}function Xo(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=w({},n),De.call(o,"from")||(o.from=e)),__DEV__&&o.from===void 0&&__DEV__&&D.warn("Undefined 'from' passed to readField with arguments ".concat(ff(Array.from(t)))),o.variables===void 0&&(o.variables=r),o}function bd(t){return function(r,n){if(he(r)||he(n))throw __DEV__?new z("Cannot automatically merge arrays"):new z(4);if(oe(r)&&oe(n)){var i=t.getFieldValue(r,"__typename"),a=t.getFieldValue(n,"__typename"),o=i&&a&&i!==a;if(o)return n;if(ee(r)&&Mr(n))return t.merge(r.__ref,n),r;if(Mr(r)&&ee(n))return t.merge(r,n.__ref),n;if(Mr(r)&&Mr(n))return w(w({},r),n)}return n}}function Uu(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:w(w({},t),{clientOnly:e,deferred:r})),i}var Cd=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=Yt(i),l=rd();s=w(w({},_n(c)),s);var d=w(w({store:e,written:Object.create(null),merge:function(p,h){return l.merge(p,h)},variables:s,varString:xt(s)},Ko(i,this.fragments)),{overwrite:!!u,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),f=this.processSelectionSet({result:a||Object.create(null),dataId:o,selectionSet:c.selectionSet,mergeTree:{map:new Map},context:d});if(!ee(f))throw __DEV__?new z("Could not identify object ".concat(JSON.stringify(a))):new z(7);return d.incomingById.forEach(function(p,h){var g=p.storeObject,v=p.mergeTree,C=p.fieldNodeSet,_=Jt(h);if(v&&v.map.size){var b=n.applyMerges(v,_,g,d);if(ee(b))return;g=b}if(__DEV__&&!d.overwrite){var y=Object.create(null);C.forEach(function(k){k.selectionSet&&(y[k.name.value]=!0)});var T=function(k){return y[Qt(k)]===!0},R=function(k){var P=v&&v.map.get(k);return Boolean(P&&P.info&&P.info.merge)};Object.keys(g).forEach(function(k){T(k)&&!R(k)&&Zg(_,g,k,d.store)})}e.merge(h,g)}),e.retain(f.__ref),f},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]||aa(i,a,o.fragmentMap)||n&&o.store.get(n,"__typename");typeof l=="string"&&(c.__typename=l);var d=function(){var b=Xo(arguments,c,o.variables);if(ee(b.from)){var y=o.incomingById.get(b.from.__ref);if(y){var T=u.readField(w(w({},b),{from:y.storeObject}),o);if(T!==void 0)return T}}return u.readField(b,o)},f=new Set;this.flattenFields(a,i,o,l).forEach(function(b,y){var T,R=Nt(y),k=i[R];if(f.add(y),k!==void 0){var P=u.getStoreFieldName({typename:l,fieldName:y.name.value,field:y,variables:b.variables}),F=_d(s,P),$=r.processFieldValue(k,y,y.selectionSet?Uu(b,!1,!1):b,F),q=void 0;y.selectionSet&&(ee($)||Mr($))&&(q=d("__typename",$));var Ze=u.getMergeFunction(l,y.name.value,q);Ze?F.info={field:y,typename:l,merge:Ze}:wd(s,P),c=b.merge(c,(T={},T[P]=$,T))}else __DEV__&&!b.clientOnly&&!b.deferred&&!wn.added(y)&&!u.getReadFunction(l,y.name.value)&&__DEV__&&D.error("Missing field '".concat(Nt(y),"' while writing result ").concat(JSON.stringify(i,null,2)).substring(0,1e3))});try{var p=u.identify(i,{typename:l,selectionSet:a,fragmentMap:o.fragmentMap,storeObject:c,readField:d}),h=p[0],g=p[1];n=n||h,g&&(c=o.merge(c,g))}catch(b){if(!n)throw b}if(typeof n=="string"){var v=Jt(n),C=o.written[n]||(o.written[n]=[]);if(C.indexOf(a)>=0||(C.push(a),this.reader&&this.reader.isFresh(i,v,a,o)))return v;var _=o.incomingById.get(n);return _?(_.storeObject=o.merge(_.storeObject,c),_.mergeTree=ju(_.mergeTree,s),f.forEach(function(b){return _.fieldNodeSet.add(b)})):o.incomingById.set(n,{storeObject:c,mergeTree:es(s)?void 0:s,fieldNodeSet:f}),v}return c},t.prototype.processFieldValue=function(e,r,n,i){var a=this;return!r.selectionSet||e===null?__DEV__?Ro(e):e:he(e)?e.map(function(o,s){var u=a.processFieldValue(o,r,n,_d(i,s));return wd(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=aa(r,e,n.fragmentMap));var a=new Map,o=this.cache.policies,s=new Xt(!1);return function u(c,l){var d=s.lookup(c,l.clientOnly,l.deferred);d.visited||(d.visited=!0,c.selections.forEach(function(f){if(!!dr(f,n.variables)){var p=l.clientOnly,h=l.deferred;if(!(p&&h)&&Ue(f.directives)&&f.directives.forEach(function(C){var _=C.name.value;if(_==="client"&&(p=!0),_==="defer"){var b=hr(C,n.variables);(!b||b.if!==!1)&&(h=!0)}}),Ct(f)){var g=a.get(f);g&&(p=p&&g.clientOnly,h=h&&g.deferred),a.set(f,Uu(n,p,h))}else{var v=yn(f,n.lookupFragment);if(!v&&f.kind===$e.FRAGMENT_SPREAD)throw __DEV__?new z("No fragment named ".concat(f.name.value)):new z(8);v&&o.fragmentMatches(v,i,r,n.variables)&&u(v.selectionSet,Uu(n,p,h))}}}))}(e,n),a},t.prototype.applyMerges=function(e,r,n,i,a){var o,s=this;if(e.map.size&&!ee(n)){var u=!he(n)&&(ee(r)||Mr(r))?r:void 0,c=n;u&&!a&&(a=[ee(u)?u.__ref:u]);var l,d=function(f,p){return he(f)?typeof p=="number"?f[p]:void 0:i.store.getFieldValue(f,String(p))};e.map.forEach(function(f,p){var h=d(u,p),g=d(c,p);if(g!==void 0){a&&a.push(p);var v=s.applyMerges(f,h,g,i,a);v!==g&&(l=l||new Map,l.set(p,v)),a&&D(a.pop()===p)}}),l&&(n=he(c)?c.slice(0):w({},c),l.forEach(function(f,p){n[p]=f}))}return e.info?this.cache.policies.runMergeFunction(r,n,e.info,i,a&&(o=i.store).getStorage.apply(o,a)):n},t}();var xd=[];function _d(t,e){var r=t.map;return r.has(e)||r.set(e,xd.pop()||{map:new Map}),r.get(e)}function ju(t,e){if(t===e||!e||es(e))return t;if(!t||es(t))return e;var r=t.info&&e.info?w(w({},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,ju(s,e.map.get(u))),o.delete(u)}),o.forEach(function(s){a.map.set(s,ju(e.map.get(s),t.map.get(s)))})}return a}function es(t){return!t||!(t.info||t.map.size)}function wd(t,e){var r=t.map,n=r.get(e);n&&es(n)&&(xd.push(n),r.delete(e))}var Sd=new Set;function Zg(t,e,r,n){var i=function(d){var f=n.getFieldValue(d,r);return typeof f=="object"&&f},a=i(t);if(!!a){var o=i(e);if(!!o&&!ee(a)&&!xe(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=Qt(r),c="".concat(s,".").concat(u);if(!Sd.has(c)){Sd.add(c);var l=[];!he(a)&&!he(o)&&[a,o].forEach(function(d){var f=n.getFieldValue(d,"__typename");typeof f=="string"&&!l.includes(f)&&l.push(f)}),__DEV__&&D.warn("Cache data may be lost when replacing the ".concat(u," field of a ").concat(s,` object.
38
+ `):new H(23)};var Lf=function(){if(typeof AbortController>"u")return{controller:!1,signal:!1};var t=new AbortController,e=t.signal;return{controller:t,signal:e}};var Ff=function(t,e){var r=t.getContext(),n=r.uri;return n||(typeof e=="function"?e(t):e||"/graphql")};function Mf(t,e){var r=[],n=function(d,f){r.push("".concat(d,"=").concat(encodeURIComponent(f)))};if("query"in e&&n("query",e.query),e.operationName&&n("operationName",e.operationName),e.variables){var i=void 0;try{i=ga(e.variables,"Variables map")}catch(d){return{parseError:d}}n("variables",i)}if(e.extensions){var a=void 0;try{a=ga(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 Uf=Ge(function(){return fetch}),jf=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?Pf:i,o=t.includeExtensions,s=t.preserveHeaderCase,u=t.useGETForQueries,c=t.includeUnusedVariables,l=c===void 0?!1:c,d=Jt(t,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);__DEV__&&$f(n||Uf);var f={http:{includeExtensions:o,preserveHeaderCase:s},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new $t(function(p){var h=Ff(p,r),g=p.getContext(),b={};if(g.clientAwareness){var C=g.clientAwareness,w=C.name,_=C.version;w&&(b["apollographql-client-name"]=w),_&&(b["apollographql-client-version"]=_)}var y=S(S({},b),g.headers),T={http:g.http,options:g.fetchOptions,credentials:g.credentials,headers:y},R=Rf(p,a,Nf,f,T),k=R.options,P=R.body;if(P.variables&&!l){var M=new Set(Object.keys(P.variables));it(p.query,{Variable:function(ce,Kt,re){re&&re.kind!=="VariableDefinition"&&M.delete(ce.name.value)}}),M.size&&(P.variables=S({},P.variables),M.forEach(function(ce){delete P.variables[ce]}))}var $;if(!k.signal){var V=Lf(),Je=V.controller,je=V.signal;$=Je,$&&(k.signal=je)}var Q=function(ce){return ce.kind==="OperationDefinition"&&ce.operation==="mutation"};if(u&&!p.query.definitions.some(Q)&&(k.method="GET"),si(["defer"],p.query)&&(k.headers=k.headers||{},k.headers.accept="multipart/mixed; deferSpec=20220824, application/json"),k.method==="GET"){var _e=Mf(h,P),we=_e.newURI,se=_e.parseError;if(se)return zo(se);h=we}else try{k.body=ga(P,"Payload")}catch(ce){return zo(ce)}return new ne(function(ce){var Kt=n||Ge(function(){return fetch})||Uf;return Kt(h,k).then(function(re){var Zt;p.setContext({response:re});var Ar=(Zt=re.headers)===null||Zt===void 0?void 0:Zt.get("content-type");return Ar!==null&&/^multipart\/mixed/i.test(Ar)?Tf(re,ce):Df(re,p,ce)}).catch(function(re){return Wo(re,ce)}),function(){$&&$.abort()}})})};var wu=function(t){De(e,t);function e(r){r===void 0&&(r={});var n=t.call(this,jf(r).request)||this;return n.options=r,n}return e}($t);var{toString:Bf,hasOwnProperty:Cg}=Object.prototype,qf=Function.prototype.toString,Su=new Map;function Ee(t,e){try{return Cu(t,e)}finally{Su.clear()}}function Cu(t,e){if(t===e)return!0;let r=Bf.call(t),n=Bf.call(e);if(r!==n)return!1;switch(r){case"[object Array]":if(t.length!==e.length)return!1;case"[object Object]":{if(Qf(t,e))return!0;let i=Vf(t),a=Vf(e),o=i.length;if(o!==a.length)return!1;for(let s=0;s<o;++s)if(!Cg.call(e,i[s]))return!1;for(let s=0;s<o;++s){let u=i[s];if(!Cu(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(Qf(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&&!Cu(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=qf.call(t);return i!==qf.call(e)?!1:!kg(i,Eg)}}return!1}function Vf(t){return Object.keys(t).filter(xg,t)}function xg(t){return this[t]!==void 0}var Eg="{ [native code] }";function kg(t,e){let r=t.length-e.length;return r>=0&&t.indexOf(e,r)===r}function Qf(t,e){let r=Su.get(t);if(r){if(r.has(e))return!0}else Su.set(t,r=new Set);return r.add(e),!1}var Ag=function(){return Object.create(null)},zf=Array.prototype,Ig=zf.forEach,Tg=zf.slice,er=function(){function t(e,r){e===void 0&&(e=!0),r===void 0&&(r=Ag),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 Ig.call(e,function(n){return r=r.getChildTrie(n)}),r.data||(r.data=this.makeData(Tg.call(e)))},t.prototype.getChildTrie=function(e){var r=this.weakness&&Og(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 Og(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}var et=null,Hf={},Dg=1,Ng=()=>class{constructor(){this.id=["slot",Dg++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=et;e;e=e.parent)if(this.id in e.slots){let r=e.slots[this.id];if(r===Hf)break;return e!==et&&(et.slots[this.id]=r),!0}return et&&(et.slots[this.id]=Hf),!1}getValue(){if(this.hasValue())return et.slots[this.id]}withValue(e,r,n,i){let a={__proto__:null,[this.id]:e},o=et;et={parent:o,slots:a};try{return r.apply(i,n)}finally{et=o}}static bind(e){let r=et;return function(){let n=et;try{return et=r,e.apply(this,arguments)}finally{et=n}}}static noContext(e,r,n){if(et){let i=et;try{return et=null,e.apply(n,r)}finally{et=i}}else return e.apply(n,r)}};function Gf(t){try{return t()}catch{}}var xu="@wry/context:Slot",Pg=Gf(()=>globalThis)||Gf(()=>global)||Object.create(null),Wf=Pg,mi=Wf[xu]||Array[xu]||function(t){try{Object.defineProperty(Wf,xu,{value:t,enumerable:!1,writable:!1,configurable:!0})}finally{return t}}(Ng());var{bind:Rg,noContext:$g}=mi;function Lg(){}var Fg=function(){function t(e,r){e===void 0&&(e=1/0),r===void 0&&(r=Lg),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}(),Zo=new mi,Eu,Mg=Object.prototype.hasOwnProperty,Au=(Eu=Array.from,Eu===void 0?function(t){var e=[];return t.forEach(function(r){return e.push(r)}),e}:Eu);function Ko(t){var e=t.unsubscribe;typeof e=="function"&&(t.unsubscribe=void 0,e())}var ya=[],Ug=100;function gi(t,e){if(!t)throw new Error(e||"assertion failure")}function jg(t,e){var r=t.length;return r>0&&r===e.length&&t[r-1]===e[r-1]}function Zf(t){switch(t.length){case 0:throw new Error("unknown value");case 1:return t[0];case 2:throw t[1]}}function Bg(t){return t.slice(0)}var qg=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&&!Fr(this))return Kf(this),this.value[0]},t.prototype.recompute=function(e){return gi(!this.recomputing,"already recomputing"),Kf(this),Fr(this)?Vg(this,e):Zf(this.value)},t.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,Jf(this),Ko(this))},t.prototype.dispose=function(){var e=this;this.setDirty(),rd(this),Iu(this,function(r,n){r.setDirty(),nd(r,e)})},t.prototype.forget=function(){this.dispose()},t.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=ya.pop()||new Set),this.deps.add(e)},t.prototype.forgetDeps=function(){var e=this;this.deps&&(Au(this.deps).forEach(function(r){return r.delete(e)}),this.deps.clear(),ya.push(this.deps),this.deps=null)},t.count=0,t}();function Kf(t){var e=Zo.getValue();if(e)return t.parents.add(e),e.childValues.has(t)||e.childValues.set(t,[]),Fr(t)?Xf(e,t):ed(e,t),e}function Vg(t,e){return rd(t),Zo.withValue(t,Qg,[t,e]),Hg(t,e)&&zg(t),Zf(t.value)}function Qg(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 Fr(t){return t.dirty||!!(t.dirtyChildren&&t.dirtyChildren.size)}function zg(t){t.dirty=!1,!Fr(t)&&Yf(t)}function Jf(t){Iu(t,Xf)}function Yf(t){Iu(t,ed)}function Iu(t,e){var r=t.parents.size;if(r)for(var n=Au(t.parents),i=0;i<r;++i)e(n[i],t)}function Xf(t,e){gi(t.childValues.has(e)),gi(Fr(e));var r=!Fr(t);if(!t.dirtyChildren)t.dirtyChildren=ya.pop()||new Set;else if(t.dirtyChildren.has(e))return;t.dirtyChildren.add(e),r&&Jf(t)}function ed(t,e){gi(t.childValues.has(e)),gi(!Fr(e));var r=t.childValues.get(e);r.length===0?t.childValues.set(e,Bg(e.value)):jg(r,e.value)||t.setDirty(),td(t,e),!Fr(t)&&Yf(t)}function td(t,e){var r=t.dirtyChildren;r&&(r.delete(e),r.size===0&&(ya.length<Ug&&ya.push(r),t.dirtyChildren=null))}function rd(t){t.childValues.size>0&&t.childValues.forEach(function(e,r){nd(t,r)}),t.forgetDeps(),gi(t.dirtyChildren===null)}function nd(t,e){e.parents.delete(t),t.childValues.delete(e),td(t,e)}function Hg(t,e){if(typeof t.subscribe=="function")try{Ko(t),t.unsubscribe=t.subscribe.apply(null,e)}catch{return t.setDirty(),!1}return!0}var Gg={setDirty:!0,dispose:!0,forget:!0};function Jo(t){var e=new Map,r=t&&t.subscribe;function n(i){var a=Zo.getValue();if(a){var o=e.get(i);o||e.set(i,o=new Set),a.dependOn(o),typeof r=="function"&&(Ko(o),o.unsubscribe=r(i))}}return n.dirty=function(a,o){var s=e.get(a);if(s){var u=o&&Mg.call(Gg,o)?o:"setDirty";Au(s).forEach(function(c){return c[u]()}),e.delete(a),Ko(s)}},n}function id(){var t=new er(typeof WeakMap=="function");return function(){return t.lookupArray(arguments)}}var l9=id(),ku=new Set;function Cn(t,e){e===void 0&&(e=Object.create(null));var r=new Fg(e.max||Math.pow(2,16),function(c){return c.dispose()}),n=e.keyArgs,i=e.makeCacheKey||id(),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 qg(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),ku.add(r),Zo.hasValue()||(ku.forEach(function(f){return f.clean()}),ku.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 Tu=function(){function t(){this.getFragmentDoc=Cn(Kc)}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(S(S({},e),{rootId:e.id||"ROOT_QUERY",optimistic:r}))},t.prototype.readFragment=function(e,r){return r===void 0&&(r=!!e.optimistic),this.read(S(S({},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=Jt(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=Jt(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(S(S({},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(S(S({},e),{data:a})),a)}})},t}();var va=function(t){De(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 Ne=Object.prototype.hasOwnProperty;function ba(t){return t==null}function Xo(t,e){var r=t.__typename,n=t.id,i=t._id;if(typeof r=="string"&&(e&&(e.keyObject=ba(n)?ba(i)?void 0:{_id:i}:{id:n}),ba(n)&&!ba(i)&&(n=i),!ba(n)))return"".concat(r,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var ad={dataIdFromObject:Xo,addTypename:!0,resultCaching:!0,canonizeResults:!1};function od(t){return Lr(ad,t)}function es(t){var e=t.canonizeResults;return e===void 0?ad.canonizeResults:e}function sd(t,e){return ie(e)?t.get(e.__ref,"__typename"):e&&e.__typename}var Ou=/^[_a-z][_0-9a-z]*/i;function zt(t){var e=t.match(Ou);return e?e[0]:t}function Yo(t,e,r){return ue(e)?ye(e)?e.every(function(n){return Yo(t,n,r)}):t.selections.every(function(n){if(Ct(n)&&dr(n,r)){var i=Pt(n);return Ne.call(e,i)&&(!n.selectionSet||Yo(n.selectionSet,e[i],r))}return!0}):!1}function Mr(t){return ue(t)&&!ie(t)&&!ye(t)}function cd(){return new mt}function ts(t,e){var r=gn(vn(t));return{fragmentMap:r,lookupFragment:function(n){var i=r[n];return!i&&e&&(i=e.lookup(n)),i||null}}}var rs=Object.create(null),Du=function(){return rs},ud=Object.create(null),yi=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 pa(ie(i)?n.get(i.__ref,a):i&&i[a])},this.canRead=function(i){return ie(i)?n.has(i.__ref):typeof i=="object"},this.toReference=function(i,a){if(typeof i=="string")return Yt(i);if(ie(i))return i;var o=n.policies.identify(i)[0];if(o){var s=Yt(o);return a&&n.merge(o,i),s}}}return t.prototype.toObject=function(){return S({},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),Ne.call(this.data,e)){var n=this.data[e];if(n&&Ne.call(n,r))return n[r]}if(r==="__typename"&&Ne.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof Ur)return this.parent.get(e,r)},t.prototype.lookup=function(e,r){if(r&&this.group.depend(e,"__exists"),Ne.call(this.data,e))return this.data[e];if(this instanceof Ur)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;ie(e)&&(e=e.__ref),ie(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__?N(typeof i=="string","store.merge expects a string ID"):N(typeof i=="string",1);var s=new mt(Kg).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=zt(c);l!==c&&!n.policies.hasKeyArgs(s.__typename,l)&&(u[l]=1),s[c]===void 0&&!(n instanceof Ur)&&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:rs,INVALIDATE:ud,isReference:ie,toReference:this.toReference,canRead:this.canRead,readField:function(c,l){return n.policies.readField(typeof c=="string"?{fieldName:c,from:l||Yt(e)}:c,{store:n})}};if(Object.keys(i).forEach(function(c){var l=zt(c),d=i[c];if(d!==void 0){var f=typeof r=="function"?r:r[c]||r[l];if(f){var p=f===Du?rs:f(pa(d),S(S({},u),{fieldName:l,storeFieldName:c,storage:n.getStorage(e,c)}));p===ud?n.group.dirty(e,c):(p===rs&&(p=void 0),p!==d&&(a[c]=p,o=!0,d=p))}d!==void 0&&(s=!1)}}),o)return this.merge(e,a),s&&(this instanceof Ur?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]=Du,i):Du)}return!1},t.prototype.evict=function(e,r){var n=!1;return e.id&&(Ne.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof Ur&&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){Ne.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&&Ne.call(e,a)||r.delete(a)}),e){var n=e.__META,i=Jt(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 Ur?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){Ne.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 Ur;)a=a.parent;i.forEach(function(o){return a.delete(o)})}return i},t.prototype.findChildRefIds=function(e){if(!Ne.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){ie(a)&&(r[a.__ref]=!0),ue(a)&&Object.keys(a).forEach(function(o){var s=a[o];ue(s)&&i.add(s)})})}return this.refs[e]},t.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},t}();var ld=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?Jo():null,this.keyMaker=new er(Rt)},t.prototype.depend=function(e,r){if(this.d){this.d(Nu(e,r));var n=zt(r);n!==r&&this.d(Nu(e,n)),this.parent&&this.parent.depend(e,r)}},t.prototype.dirty=function(e,r){this.d&&this.d.dirty(Nu(e,r),r==="__exists"?"forget":"setDirty")},t}();function Nu(t,e){return e+"#"+t}function Pu(t,e){xn(t)&&t.group.depend(e,"__exists")}(function(t){var e=function(r){De(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 ld(s))||this;return c.stump=new Wg(c),c.storageTrie=new er(Rt),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})(yi||(yi={}));var Ur=function(t){De(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){Ee(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 S(S({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(r){var n=this.parent.findChildRefIds(r);return Ne.call(this.data,r)?S(S({},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}(yi),Wg=function(t){De(e,t);function e(r){return t.call(this,"EntityStore.Stump",r,function(){},new ld(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}(Ur);function Kg(t,e,r){var n=t[r],i=e[r];return Ee(n,i)?n:i}function xn(t){return!!(t instanceof yi&&t.group.caching)}function Zg(t){return ue(t)?ye(t)?t.slice(0):S({__proto__:Object.getPrototypeOf(t)},t):t}var ns=function(){function t(){this.known=new(hf?WeakSet:Set),this.pool=new er(Rt),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return t.prototype.isKnown=function(e){return ue(e)&&this.known.has(e)},t.prototype.pass=function(e){if(ue(e)){var r=Zg(e);return this.passes.set(r,e),r}return e},t.prototype.admit=function(e){var r=this;if(ue(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(p){u.push(r.admit(e[p]))});var o=this.pool.lookupArray(u);if(!o.object){var d=o.object=Object.create(s);this.known.add(d),c.sorted.forEach(function(p,h){d[p]=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 xt=Object.assign(function(t){if(ue(t)){Ru===void 0&&pd();var e=Ru.admit(t),r=$u.get(e);return r===void 0&&$u.set(e,r=JSON.stringify(e)),r}return JSON.stringify(t)},{reset:pd}),Ru,$u;function pd(){Ru=new ns,$u=new(Rt?WeakMap:Map)}function fd(t){return[t.selectionSet,t.objectOrReference,t.context,t.context.canonizeResults]}var dd=function(){function t(e){var r=this;this.knownResults=new(Rt?WeakMap:Map),this.config=Lr(e,{addTypename:e.addTypename!==!1,canonizeResults:es(e)}),this.canon=e.canon||new ns,this.executeSelectionSet=Cn(function(n){var i,a=n.context.canonizeResults,o=fd(n);o[3]=!a;var s=(i=r.executeSelectionSet).peek.apply(i,o);return s?a?S(S({},s),{result:r.canon.admit(s.result)}):s:(Pu(n.context.store,n.enclosingRef.__ref),r.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize,keyArgs:fd,makeCacheKey:function(n,i,a,o){if(xn(a.store))return a.store.makeCacheKey(n,ie(i)?i.__ref:i,a.varString,o)}}),this.executeSubSelectedArray=Cn(function(n){return Pu(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(xn(o.store))return o.store.makeCacheKey(i,a,o.varString)}})}return t.prototype.resetCanon=function(){this.canon=new ns},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=S(S({},_n(ca(n))),o);var f=Yt(a),p=this.executeSelectionSet({selectionSet:bn(n).selectionSet,objectOrReference:f,enclosingRef:f,context:S({store:r,query:n,policies:d,variables:o,varString:xt(o),canonizeResults:l},ts(n,this.config.fragments))}),h;if(p.missing&&(h=[new va(Jg(p.missing),p.missing,n,o)],!u))throw h[0];return{result:p.result,complete:!h,missing:h}},t.prototype.isFresh=function(e,r,n,i){if(xn(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(ie(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=[],f,p=new mt;this.config.addTypename&&typeof l=="string"&&!u.rootIdsByTypename[l]&&d.push({__typename:l});function h(_,y){var T;return _.missing&&(f=p.merge(f,(T={},T[y]=_.missing,T))),_.result}var g=new Set(n.selections);g.forEach(function(_){var y,T;if(!!dr(_,s))if(Ct(_)){var R=u.readField({fieldName:_.name.value,field:_,variables:o.variables,from:i},o),k=Pt(_);R===void 0?wn.added(_)||(f=p.merge(f,(y={},y[k]="Can't find field '".concat(_.name.value,"' on ").concat(ie(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),y))):ye(R)?R=h(r.executeSubSelectedArray({field:_,array:R,enclosingRef:a,context:o}),k):_.selectionSet?R!=null&&(R=h(r.executeSelectionSet({selectionSet:_.selectionSet,objectOrReference:R,enclosingRef:ie(R)?R:a,context:o}),k)):o.canonizeResults&&(R=r.canon.pass(R)),R!==void 0&&d.push((T={},T[k]=R,T))}else{var P=yn(_,o.lookupFragment);if(!P&&_.kind===Le.FRAGMENT_SPREAD)throw __DEV__?new H("No fragment named ".concat(_.name.value)):new H(5);P&&u.fragmentMatches(P,l)&&P.selectionSet.selections.forEach(g.add,g)}});var b=ua(d),C={result:b,missing:f},w=o.canonizeResults?this.canon.admit(C):pa(C);return w.result&&this.knownResults.set(w.result,n),w},t.prototype.execSubSelectedArrayImpl=function(e){var r=this,n=e.field,i=e.array,a=e.enclosingRef,o=e.context,s,u=new mt;function c(l,d){var f;return l.missing&&(s=u.merge(s,(f={},f[d]=l.missing,f))),l.result}return n.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(l,d){return l===null?null:ye(l)?c(r.executeSubSelectedArray({field:n,array:l,enclosingRef:a,context:o}),d):n.selectionSet?c(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:l,enclosingRef:ie(l)?l:a,context:o}),d):(__DEV__&&Yg(o.store,n,l),l)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:s}},t}();function Jg(t){try{JSON.stringify(t,function(e,r){if(typeof r=="string")throw r;return r})}catch(e){return e}}function Yg(t,e,r){if(!e.selectionSet){var n=new Set([r]);n.forEach(function(i){ue(i)&&(__DEV__?N(!ie(i),"Missing selection set for object of type ".concat(sd(t,i)," returned for query field ").concat(e.name.value)):N(!ie(i),6),Object.values(i).forEach(n.add,n))})}}var vi=new mi,hd=new WeakMap;function _a(t){var e=hd.get(t);return e||hd.set(t,e={vars:new Set,dep:Jo()}),e}function Lu(t){_a(t).vars.forEach(function(e){return e.forgetCache(t)})}function md(t){_a(t).vars.forEach(function(e){return e.attachCache(t)})}function is(t){var e=new Set,r=new Set,n=function(a){if(arguments.length>0){if(t!==a){t=a,e.forEach(function(u){_a(u).dep.dirty(n),Xg(u)});var o=Array.from(r);r.clear(),o.forEach(function(u){return u(t)})}}else{var s=vi.getValue();s&&(i(s),_a(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),_a(a).vars.add(n),n};return n.forgetCache=function(a){return e.delete(a)},n}function Xg(t){t.broadcastWatches&&t.broadcastWatches()}var gd=Object.create(null);function Fu(t){var e=JSON.stringify(t);return gd[e]||(gd[e]=Object.create(null))}function Mu(t){var e=Fu(t);return e.keyFieldsFn||(e.keyFieldsFn=function(r,n){var i=function(o,s){return n.readField(s,o)},a=n.keyObject=ju(t,function(o){var s=bi(n.storeObject,o,i);return s===void 0&&r!==n.storeObject&&Ne.call(r,o[0])&&(s=bi(r,o,vd)),__DEV__?N(s!==void 0,"Missing field '".concat(o.join("."),"' while extracting keyFields from ").concat(JSON.stringify(r))):N(s!==void 0,2),s});return"".concat(n.typename,":").concat(JSON.stringify(a))})}function Uu(t){var e=Fu(t);return e.keyArgsFn||(e.keyArgsFn=function(r,n){var i=n.field,a=n.variables,o=n.fieldName,s=ju(t,function(c){var l=c[0],d=l.charAt(0);if(d==="@"){if(i&&Be(i.directives)){var f=l.slice(1),p=i.directives.find(function(C){return C.name.value===f}),h=p&&hr(p,a);return h&&bi(h,c.slice(1))}return}if(d==="$"){var g=l.slice(1);if(a&&Ne.call(a,g)){var b=c.slice(0);return b[0]=g,bi(a,b)}return}if(r)return bi(r,c)}),u=JSON.stringify(s);return(r||u!=="{}")&&(o+=":"+u),o})}function ju(t,e){var r=new mt;return yd(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 yd(t){var e=Fu(t);if(!e.paths){var r=e.paths=[],n=[];t.forEach(function(i,a){ye(i)?(yd(i).forEach(function(o){return r.push(n.concat(o))}),n.length=0):(n.push(i),ye(t[a+1])||(r.push(n.slice(0)),n.length=0))})}return e.paths}function vd(t,e){return t[e]}function bi(t,e,r){return r=r||vd,bd(e.reduce(function n(i,a){return ye(i)?i.map(function(o){return n(o,a)}):i&&r(i,a)},t))}function bd(t){return ue(t)?ye(t)?t.map(bd):ju(Object.keys(t).sort(),function(e){return bi(t,e)}):t}oa.setStringify(xt);function Bu(t){return t.args!==void 0?t.args:t.field?hr(t.field,t.variables):null}var ey=function(){},_d=function(t,e){return e.fieldName},wd=function(t,e,r){var n=r.mergeObjects;return n(t,e)},Sd=function(t,e){return e},xd=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=S({dataIdFromObject:Xo},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=S(S({},r),{typename:a,storeObject:o,readField:r&&r.readField||function(){var f=as(arguments,o);return i.readField(f,{store:i.cache.data,variables:f.variables})}}),u,c=a&&this.getTypePolicy(a),l=c&&c.keyFn||this.config.dataIdFromObject;l;){var d=l(e,s);if(ye(d))l=Mu(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=Jt(i,["queryType","mutationType","subscriptionType"]);a&&r.setRootTypename("Query",n),o&&r.setRootTypename("Mutation",n),s&&r.setRootTypename("Subscription",n),Ne.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?wd:c===!1?Sd:u.merge}s(i,r.merge),i.keyFn=a===!1?ey:ye(a)?Mu(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,f=l.read,p=l.merge;c.keyFn=d===!1?_d:ye(d)?Uu(d):typeof d=="function"?d:c.keyFn,typeof f=="function"&&(c.read=f),s(c,p)}c.read&&c.merge&&(c.keyFn=c.keyFn||_d)})},t.prototype.setRootTypename=function(e,r){r===void 0&&(r=e);var n="ROOT_"+e.toUpperCase(),i=this.rootTypenamesById[n];r!==i&&(__DEV__?N(!i||i===e,"Cannot change root ".concat(e," __typename more than once")):N(!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(Ou);(!a||a[0]!==i)&&r.fuzzySubtypes.set(i,new RegExp(i))})})},t.prototype.getTypePolicy=function(e){var r=this;if(!Ne.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=Jt(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,f=0;f<u.length;++f){var p=u[f];if(p.has(o))return s.has(o)||(d&&__DEV__&&N.warn("Inferring subtype ".concat(r," of supertype ").concat(o)),s.add(o)),!0;p.forEach(c),l&&f===u.length-1&&Yo(e.selectionSet,n,i)&&(l=!1,d=!0,this.fuzzySubtypes.forEach(function(h,g){var b=r.match(h);b&&b[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=Bu(e);o;){var c=o(u,s);if(ye(c))o=Uu(c);else{a=c||n;break}}return a===void 0&&(a=e.field?Jc(e.field,e.variables):oa(n,Bu(e))),a===!1?n:n===zt(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=zt(o),u=r.store.getFieldValue(n,o),c=this.getFieldPolicy(e.typename,s,!1),l=c&&c.read;if(l){var d=Cd(this,n,e,r,r.store.getStorage(ie(n)?n.__ref:n,o));return vi.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===wd?Ed(i.store)(e,r):u===Sd?r:(i.overwrite&&(e=void 0),u(e,r,Cd(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:i.variables},i,a||Object.create(null))))},t}();function Cd(t,e,r,n,i){var a=t.getStoreFieldName(r),o=zt(a),s=r.variables||n.variables,u=n.store,c=u.toReference,l=u.canRead;return{args:Bu(r),field:r.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:ie,toReference:c,storage:i,cache:t.cache,canRead:l,readField:function(){return t.readField(as(arguments,e,s),n)},mergeObjects:Ed(n.store)}}function as(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=S({},n),Ne.call(o,"from")||(o.from=e)),__DEV__&&o.from===void 0&&__DEV__&&N.warn("Undefined 'from' passed to readField with arguments ".concat(vf(Array.from(t)))),o.variables===void 0&&(o.variables=r),o}function Ed(t){return function(r,n){if(ye(r)||ye(n))throw __DEV__?new H("Cannot automatically merge arrays"):new H(4);if(ue(r)&&ue(n)){var i=t.getFieldValue(r,"__typename"),a=t.getFieldValue(n,"__typename"),o=i&&a&&i!==a;if(o)return n;if(ie(r)&&Mr(n))return t.merge(r.__ref,n),r;if(Mr(r)&&ie(n))return t.merge(r,n.__ref),n;if(Mr(r)&&Mr(n))return S(S({},r),n)}return n}}function qu(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:S(S({},t),{clientOnly:e,deferred:r})),i}var Td=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=Xt(i),l=cd();s=S(S({},_n(c)),s);var d=S(S({store:e,written:Object.create(null),merge:function(p,h){return l.merge(p,h)},variables:s,varString:xt(s)},ts(i,this.fragments)),{overwrite:!!u,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),f=this.processSelectionSet({result:a||Object.create(null),dataId:o,selectionSet:c.selectionSet,mergeTree:{map:new Map},context:d});if(!ie(f))throw __DEV__?new H("Could not identify object ".concat(JSON.stringify(a))):new H(7);return d.incomingById.forEach(function(p,h){var g=p.storeObject,b=p.mergeTree,C=p.fieldNodeSet,w=Yt(h);if(b&&b.map.size){var _=n.applyMerges(b,w,g,d);if(ie(_))return;g=_}if(__DEV__&&!d.overwrite){var y=Object.create(null);C.forEach(function(k){k.selectionSet&&(y[k.name.value]=!0)});var T=function(k){return y[zt(k)]===!0},R=function(k){var P=b&&b.map.get(k);return Boolean(P&&P.info&&P.info.merge)};Object.keys(g).forEach(function(k){T(k)&&!R(k)&&ty(w,g,k,d.store)})}e.merge(h,g)}),e.retain(f.__ref),f},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]||sa(i,a,o.fragmentMap)||n&&o.store.get(n,"__typename");typeof l=="string"&&(c.__typename=l);var d=function(){var _=as(arguments,c,o.variables);if(ie(_.from)){var y=o.incomingById.get(_.from.__ref);if(y){var T=u.readField(S(S({},_),{from:y.storeObject}),o);if(T!==void 0)return T}}return u.readField(_,o)},f=new Set;this.flattenFields(a,i,o,l).forEach(function(_,y){var T,R=Pt(y),k=i[R];if(f.add(y),k!==void 0){var P=u.getStoreFieldName({typename:l,fieldName:y.name.value,field:y,variables:_.variables}),M=kd(s,P),$=r.processFieldValue(k,y,y.selectionSet?qu(_,!1,!1):_,M),V=void 0;y.selectionSet&&(ie($)||Mr($))&&(V=d("__typename",$));var Je=u.getMergeFunction(l,y.name.value,V);Je?M.info={field:y,typename:l,merge:Je}:Ad(s,P),c=_.merge(c,(T={},T[P]=$,T))}else __DEV__&&!_.clientOnly&&!_.deferred&&!wn.added(y)&&!u.getReadFunction(l,y.name.value)&&__DEV__&&N.error("Missing field '".concat(Pt(y),"' while writing result ").concat(JSON.stringify(i,null,2)).substring(0,1e3))});try{var p=u.identify(i,{typename:l,selectionSet:a,fragmentMap:o.fragmentMap,storeObject:c,readField:d}),h=p[0],g=p[1];n=n||h,g&&(c=o.merge(c,g))}catch(_){if(!n)throw _}if(typeof n=="string"){var b=Yt(n),C=o.written[n]||(o.written[n]=[]);if(C.indexOf(a)>=0||(C.push(a),this.reader&&this.reader.isFresh(i,b,a,o)))return b;var w=o.incomingById.get(n);return w?(w.storeObject=o.merge(w.storeObject,c),w.mergeTree=Vu(w.mergeTree,s),f.forEach(function(_){return w.fieldNodeSet.add(_)})):o.incomingById.set(n,{storeObject:c,mergeTree:os(s)?void 0:s,fieldNodeSet:f}),b}return c},t.prototype.processFieldValue=function(e,r,n,i){var a=this;return!r.selectionSet||e===null?__DEV__?jo(e):e:ye(e)?e.map(function(o,s){var u=a.processFieldValue(o,r,n,kd(i,s));return Ad(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=sa(r,e,n.fragmentMap));var a=new Map,o=this.cache.policies,s=new er(!1);return function u(c,l){var d=s.lookup(c,l.clientOnly,l.deferred);d.visited||(d.visited=!0,c.selections.forEach(function(f){if(!!dr(f,n.variables)){var p=l.clientOnly,h=l.deferred;if(!(p&&h)&&Be(f.directives)&&f.directives.forEach(function(C){var w=C.name.value;if(w==="client"&&(p=!0),w==="defer"){var _=hr(C,n.variables);(!_||_.if!==!1)&&(h=!0)}}),Ct(f)){var g=a.get(f);g&&(p=p&&g.clientOnly,h=h&&g.deferred),a.set(f,qu(n,p,h))}else{var b=yn(f,n.lookupFragment);if(!b&&f.kind===Le.FRAGMENT_SPREAD)throw __DEV__?new H("No fragment named ".concat(f.name.value)):new H(8);b&&o.fragmentMatches(b,i,r,n.variables)&&u(b.selectionSet,qu(n,p,h))}}}))}(e,n),a},t.prototype.applyMerges=function(e,r,n,i,a){var o,s=this;if(e.map.size&&!ie(n)){var u=!ye(n)&&(ie(r)||Mr(r))?r:void 0,c=n;u&&!a&&(a=[ie(u)?u.__ref:u]);var l,d=function(f,p){return ye(f)?typeof p=="number"?f[p]:void 0:i.store.getFieldValue(f,String(p))};e.map.forEach(function(f,p){var h=d(u,p),g=d(c,p);if(g!==void 0){a&&a.push(p);var b=s.applyMerges(f,h,g,i,a);b!==g&&(l=l||new Map,l.set(p,b)),a&&N(a.pop()===p)}}),l&&(n=ye(c)?c.slice(0):S({},c),l.forEach(function(f,p){n[p]=f}))}return e.info?this.cache.policies.runMergeFunction(r,n,e.info,i,a&&(o=i.store).getStorage.apply(o,a)):n},t}();var Od=[];function kd(t,e){var r=t.map;return r.has(e)||r.set(e,Od.pop()||{map:new Map}),r.get(e)}function Vu(t,e){if(t===e||!e||os(e))return t;if(!t||os(t))return e;var r=t.info&&e.info?S(S({},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,Vu(s,e.map.get(u))),o.delete(u)}),o.forEach(function(s){a.map.set(s,Vu(e.map.get(s),t.map.get(s)))})}return a}function os(t){return!t||!(t.info||t.map.size)}function Ad(t,e){var r=t.map,n=r.get(e);n&&os(n)&&(Od.push(n),r.delete(e))}var Id=new Set;function ty(t,e,r,n){var i=function(d){var f=n.getFieldValue(d,r);return typeof f=="object"&&f},a=i(t);if(!!a){var o=i(e);if(!!o&&!ie(a)&&!Ee(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=zt(r),c="".concat(s,".").concat(u);if(!Id.has(c)){Id.add(c);var l=[];!ye(a)&&!ye(o)&&[a,o].forEach(function(d){var f=n.getFieldValue(d,"__typename");typeof f=="string"&&!l.includes(f)&&l.push(f)}),__DEV__&&N.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
 
@@ -46,27 +46,27 @@ For more information about these options, please refer to the documentation:
46
46
 
47
47
  * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers
48
48
  * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects
49
- `))}}}}var ts=function(t){Oe(e,t);function e(r){r===void 0&&(r={});var n=t.call(this)||this;return n.watches=new Set,n.typenameDocumentCache=new Map,n.makeVar=Yo,n.txCount=0,n.config=ed(r),n.addTypename=!!n.config.addTypename,n.policies=new vd({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return e.prototype.init=function(){var r=this.data=new gi.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=r.stump,this.resetResultCache()},e.prototype.resetResultCache=function(r){var n=this,i=this.storeReader,a=this.config.fragments;this.storeWriter=new Cd(this,this.storeReader=new sd({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:Wo(this.config),canon:r?void 0:i&&i.canon,fragments:a}),a),this.maybeBroadcastWatch=Cn(function(o,s){return n.broadcastWatch(o,s)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(o){var s=o.optimistic?n.optimisticData:n.data;if(xn(s)){var u=o.optimistic,c=o.id,l=o.variables;return s.makeCacheKey(o.query,o.callback,xt({optimistic:u,id:c,variables:l}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(o){return o.resetCaching()})},e.prototype.restore=function(r){return this.init(),r&&this.data.replace(r),this},e.prototype.extract=function(r){return r===void 0&&(r=!1),(r?this.optimisticData:this.data).extract()},e.prototype.read=function(r){var n=r.returnPartialData,i=n===void 0?!1:n;try{return this.storeReader.diffQueryAgainstStore(w(w({},r),{store:r.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:i})).result||null}catch(a){if(a instanceof ga)return null;throw a}},e.prototype.write=function(r){try{return++this.txCount,this.storeWriter.writeToStore(this.data,r)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.modify=function(r){if(De.call(r,"id")&&!r.id)return!1;var n=r.optimistic?this.optimisticData:this.data;try{return++this.txCount,n.modify(r.id||"ROOT_QUERY",r.fields)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.diff=function(r){return this.storeReader.diffQueryAgainstStore(w(w({},r),{store:r.optimistic?this.optimisticData:this.data,rootId:r.id||"ROOT_QUERY",config:this.config}))},e.prototype.watch=function(r){var n=this;return this.watches.size||ud(this),this.watches.add(r),r.immediate&&this.maybeBroadcastWatch(r),function(){n.watches.delete(r)&&!n.watches.size&&Pu(n),n.maybeBroadcastWatch.forget(r)}},e.prototype.gc=function(r){xt.reset();var n=this.optimisticData.gc();return r&&!this.txCount&&(r.resetResultCache?this.resetResultCache(r.resetResultIdentities):r.resetResultIdentities&&this.storeReader.resetCanon()),n},e.prototype.retain=function(r,n){return(n?this.optimisticData:this.data).retain(r)},e.prototype.release=function(r,n){return(n?this.optimisticData:this.data).release(r)},e.prototype.identify=function(r){if(ee(r))return r.__ref;try{return this.policies.identify(r)[0]}catch(n){__DEV__&&D.warn(n)}},e.prototype.evict=function(r){if(!r.id){if(De.call(r,"id"))return!1;r=w(w({},r),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(r,this.data)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.reset=function(r){var n=this;return this.init(),xt.reset(),r&&r.discardWatches?(this.watches.forEach(function(i){return n.maybeBroadcastWatch.forget(i)}),this.watches.clear(),Pu(this)):this.broadcastWatches(),Promise.resolve()},e.prototype.removeOptimistic=function(r){var n=this.optimisticData.removeLayer(r);n!==this.optimisticData&&(this.optimisticData=n,this.broadcastWatches())},e.prototype.batch=function(r){var n=this,i=r.update,a=r.optimistic,o=a===void 0?!0:a,s=r.removeOptimistic,u=r.onWatchUpdated,c,l=function(f){var p=n,h=p.data,g=p.optimisticData;++n.txCount,f&&(n.data=n.optimisticData=f);try{return c=i(n)}finally{--n.txCount,n.data=h,n.optimisticData=g}},d=new Set;return u&&!this.txCount&&this.broadcastWatches(w(w({},r),{onWatchUpdated:function(f){return d.add(f),!1}})),typeof o=="string"?this.optimisticData=this.optimisticData.addLayer(o,l):o===!1?l(this.data):l(),typeof s=="string"&&(this.optimisticData=this.optimisticData.removeLayer(s)),u&&d.size?(this.broadcastWatches(w(w({},r),{onWatchUpdated:function(f,p){var h=u.call(this,f,p);return h!==!1&&d.delete(f),h}})),d.size&&d.forEach(function(f){return n.maybeBroadcastWatch.dirty(f)})):this.broadcastWatches(r),c},e.prototype.performTransaction=function(r,n){return this.batch({update:r,optimistic:n||n!==null})},e.prototype.transformDocument=function(r){if(this.addTypename){var n=this.typenameDocumentCache.get(r);return n||(n=wn(r),this.typenameDocumentCache.set(r,n),this.typenameDocumentCache.set(n,n)),n}return r},e.prototype.transformForLink=function(r){var n=this.config.fragments;return n?n.transform(r):r},e.prototype.broadcastWatches=function(r){var n=this;this.txCount||this.watches.forEach(function(i){return n.maybeBroadcastWatch(i,r)})},e.prototype.broadcastWatch=function(r,n){var i=r.lastDiff,a=this.diff(r);n&&(r.optimistic&&typeof n.optimistic=="string"&&(a.fromOptimisticTransaction=!0),n.onWatchUpdated&&n.onWatchUpdated.call(this,r,a,i)===!1)||(!i||!xe(i.result,a.result))&&r.callback(r.lastDiff=a,i)},e}(ku);function Ed(t){return t.hasOwnProperty("graphQLErrors")}var Jg=function(t){var e="";if(Ue(t.graphQLErrors)||Ue(t.clientErrors)){var r=(t.graphQLErrors||[]).concat(t.clientErrors||[]);r.forEach(function(n){var i=n?n.message:"Error message not found.";e+="".concat(i,`
49
+ `))}}}}var wa=function(t){De(e,t);function e(r){r===void 0&&(r={});var n=t.call(this)||this;return n.watches=new Set,n.typenameDocumentCache=new Map,n.makeVar=is,n.txCount=0,n.config=od(r),n.addTypename=!!n.config.addTypename,n.policies=new xd({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return e.prototype.init=function(){var r=this.data=new yi.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=r.stump,this.resetResultCache()},e.prototype.resetResultCache=function(r){var n=this,i=this.storeReader,a=this.config.fragments;this.storeWriter=new Td(this,this.storeReader=new dd({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:es(this.config),canon:r?void 0:i&&i.canon,fragments:a}),a),this.maybeBroadcastWatch=Cn(function(o,s){return n.broadcastWatch(o,s)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(o){var s=o.optimistic?n.optimisticData:n.data;if(xn(s)){var u=o.optimistic,c=o.id,l=o.variables;return s.makeCacheKey(o.query,o.callback,xt({optimistic:u,id:c,variables:l}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(o){return o.resetCaching()})},e.prototype.restore=function(r){return this.init(),r&&this.data.replace(r),this},e.prototype.extract=function(r){return r===void 0&&(r=!1),(r?this.optimisticData:this.data).extract()},e.prototype.read=function(r){var n=r.returnPartialData,i=n===void 0?!1:n;try{return this.storeReader.diffQueryAgainstStore(S(S({},r),{store:r.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:i})).result||null}catch(a){if(a instanceof va)return null;throw a}},e.prototype.write=function(r){try{return++this.txCount,this.storeWriter.writeToStore(this.data,r)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.modify=function(r){if(Ne.call(r,"id")&&!r.id)return!1;var n=r.optimistic?this.optimisticData:this.data;try{return++this.txCount,n.modify(r.id||"ROOT_QUERY",r.fields)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.diff=function(r){return this.storeReader.diffQueryAgainstStore(S(S({},r),{store:r.optimistic?this.optimisticData:this.data,rootId:r.id||"ROOT_QUERY",config:this.config}))},e.prototype.watch=function(r){var n=this;return this.watches.size||md(this),this.watches.add(r),r.immediate&&this.maybeBroadcastWatch(r),function(){n.watches.delete(r)&&!n.watches.size&&Lu(n),n.maybeBroadcastWatch.forget(r)}},e.prototype.gc=function(r){xt.reset();var n=this.optimisticData.gc();return r&&!this.txCount&&(r.resetResultCache?this.resetResultCache(r.resetResultIdentities):r.resetResultIdentities&&this.storeReader.resetCanon()),n},e.prototype.retain=function(r,n){return(n?this.optimisticData:this.data).retain(r)},e.prototype.release=function(r,n){return(n?this.optimisticData:this.data).release(r)},e.prototype.identify=function(r){if(ie(r))return r.__ref;try{return this.policies.identify(r)[0]}catch(n){__DEV__&&N.warn(n)}},e.prototype.evict=function(r){if(!r.id){if(Ne.call(r,"id"))return!1;r=S(S({},r),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(r,this.data)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.reset=function(r){var n=this;return this.init(),xt.reset(),r&&r.discardWatches?(this.watches.forEach(function(i){return n.maybeBroadcastWatch.forget(i)}),this.watches.clear(),Lu(this)):this.broadcastWatches(),Promise.resolve()},e.prototype.removeOptimistic=function(r){var n=this.optimisticData.removeLayer(r);n!==this.optimisticData&&(this.optimisticData=n,this.broadcastWatches())},e.prototype.batch=function(r){var n=this,i=r.update,a=r.optimistic,o=a===void 0?!0:a,s=r.removeOptimistic,u=r.onWatchUpdated,c,l=function(f){var p=n,h=p.data,g=p.optimisticData;++n.txCount,f&&(n.data=n.optimisticData=f);try{return c=i(n)}finally{--n.txCount,n.data=h,n.optimisticData=g}},d=new Set;return u&&!this.txCount&&this.broadcastWatches(S(S({},r),{onWatchUpdated:function(f){return d.add(f),!1}})),typeof o=="string"?this.optimisticData=this.optimisticData.addLayer(o,l):o===!1?l(this.data):l(),typeof s=="string"&&(this.optimisticData=this.optimisticData.removeLayer(s)),u&&d.size?(this.broadcastWatches(S(S({},r),{onWatchUpdated:function(f,p){var h=u.call(this,f,p);return h!==!1&&d.delete(f),h}})),d.size&&d.forEach(function(f){return n.maybeBroadcastWatch.dirty(f)})):this.broadcastWatches(r),c},e.prototype.performTransaction=function(r,n){return this.batch({update:r,optimistic:n||n!==null})},e.prototype.transformDocument=function(r){if(this.addTypename){var n=this.typenameDocumentCache.get(r);return n||(n=wn(r),this.typenameDocumentCache.set(r,n),this.typenameDocumentCache.set(n,n)),n}return r},e.prototype.transformForLink=function(r){var n=this.config.fragments;return n?n.transform(r):r},e.prototype.broadcastWatches=function(r){var n=this;this.txCount||this.watches.forEach(function(i){return n.maybeBroadcastWatch(i,r)})},e.prototype.broadcastWatch=function(r,n){var i=r.lastDiff,a=this.diff(r);n&&(r.optimistic&&typeof n.optimistic=="string"&&(a.fromOptimisticTransaction=!0),n.onWatchUpdated&&n.onWatchUpdated.call(this,r,a,i)===!1)||(!i||!Ee(i.result,a.result))&&r.callback(r.lastDiff=a,i)},e}(Tu);function Dd(t){return t.hasOwnProperty("graphQLErrors")}var ry=function(t){var e="";if(Be(t.graphQLErrors)||Be(t.clientErrors)){var r=(t.graphQLErrors||[]).concat(t.clientErrors||[]);r.forEach(function(n){var i=n?n.message:"Error message not found.";e+="".concat(i,`
50
50
  `)})}return t.networkError&&(e+="".concat(t.networkError.message,`
51
- `)),e=e.replace(/\n$/,""),e},mr=function(t){Oe(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||Jg(u),u.extraInfo=s,u.__proto__=e.prototype,u}return e}(Error);var ue;(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"})(ue||(ue={}));function jr(t){return t?t<7:!1}var Yg=Object.assign,Xg=Object.hasOwnProperty,rs=function(t){Oe(e,t);function e(r){var n=r.queryManager,i=r.queryInfo,a=r.options,o=t.call(this,function(v){try{var C=v._subscription._observer;C&&!C.error&&(C.error=ey)}catch{}var _=!o.observers.size;o.observers.add(v);var b=o.last;return b&&b.error?v.error&&v.error(b.error):b&&b.result&&v.next&&v.next(b.result),_&&o.reobserve().catch(function(){}),function(){o.observers.delete(v)&&!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,f=d===void 0?l:d,p=a.initialFetchPolicy,h=p===void 0?f==="standby"?l:f:p;o.options=w(w({},a),{initialFetchPolicy:h,fetchPolicy:f}),o.queryId=i.queryId||n.generateQueryId();var g=Yt(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||ue.ready,a=w(w({},n),{loading:jr(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),xe(a.data,{})&&(a.data=void 0),u.complete?(delete a.partial,u.complete&&a.networkStatus===ue.loading&&(s==="cache-first"||s==="cache-only")&&(a.networkStatus=ue.ready,a.loading=!1)):a.partial=!0,__DEV__&&!u.complete&&!this.options.partialRefetch&&!a.loading&&!a.data&&!a.error&&qu(u.missing)}return r&&this.updateLastResult(a),a},e.prototype.isDifferentFromLastResult=function(r,n){return!this.last||!xe(this.last.result,r)||n&&!xe(this.last.variables,n)},e.prototype.getLast=function(r,n){var i=this.last;if(i&&i[r]&&(!n||xe(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&&Xg.call(r,"variables")){var o=oa(this.query),s=o.variableDefinitions;(!s||!s.some(function(u){return u.variable.name.value==="variables"}))&&__DEV__&&D.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
- Did you mean to call refetch(variables) instead of refetch({ variables })?`))}return r&&!xe(this.options.variables,r)&&(i.variables=this.options.variables=w(w({},this.options.variables),r)),this.queryInfo.resetLastWrite(),this.reobserve(i,ue.refetch)},e.prototype.fetchMore=function(r){var n=this,i=w(w({},r.query?r:w(w(w(w({},this.options),{query:this.query}),r),{variables:w(w({},this.options.variables),r.variables)})),{fetchPolicy:"no-cache"}),a=this.queryManager.generateQueryId(),o=this.queryInfo,s=o.networkStatus;o.networkStatus=ue.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var u=new Set;return this.queryManager.fetchQuery(a,i,ue.fetchMore).then(function(c){return n.queryManager.removeQuery(a),o.networkStatus===ue.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(f){return d(f,{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)||Bu(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__&&D.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 xe(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},ue.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__?D(a,"Attempted to start a polling query without a polling interval."):D(a,13);var o=i||(this.pollingInfo={});o.interval=a;var s=function(){r.pollingInfo&&(jr(r.queryInfo.networkStatus)?u():r.reobserve({fetchPolicy:r.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},ue.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=w(w({},this.last),{result:this.queryManager.assumeImmutableResults?r:Ro(r),variables:n}),Ue(r.errors)||delete this.last.error,this.last},e.prototype.reobserve=function(r,n){var i=this;this.isTornDown=!1;var a=n===ue.refetch||n===ue.fetchMore||n===ue.poll,o=this.options.variables,s=this.options.fetchPolicy,u=Lr(this.options,r||{}),c=a?u:Yg(this.options,u);a||(this.updatePolling(),r&&r.variables&&!xe(r.variables,o)&&c.fetchPolicy!=="standby"&&c.fetchPolicy===s&&(this.applyNextFetchPolicy("variables-changed",c),n===void 0&&(n=ue.setVariables)));var l=c.variables&&w({},c.variables),d=this.fetch(c,n),f={next:function(p){i.reportResult(p,l)},error:function(p){i.reportError(p,l)}};return a||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=d,this.observer=f),d.addObserver(f),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),Sn(this.observers,"next",r))},e.prototype.reportError=function(r,n){var i=w(w({},this.getLastResult()),{error:r,errors:r.graphQLErrors,networkStatus:ue.error,loading:!1});this.updateLastResult(i,n),Sn(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}(Y);Lo(rs);function Bu(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 ey(t){__DEV__&&D.error("Unhandled error",t.message,t.stack)}function qu(t){__DEV__&&t&&__DEV__&&D.debug("Missing cache result fields: ".concat(JSON.stringify(t)),t)}var ns=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=tu(r.resolvers,n)}):this.resolvers=tu(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 jt(this,void 0,void 0,function(){return Bt(this,function(u){return r?[2,this.resolveDocument(r,n.data,i,a,this.fragmentMatcher,s).then(function(c){return w(w({},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 oi(["client"],e)&&this.resolvers?e:null},t.prototype.serverQuery=function(e){return eu(e)},t.prototype.prepareContext=function(e){var r=this.cache;return w(w({},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={}),jt(this,void 0,void 0,function(){return Bt(this,function(i){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,r)||{},this.prepareContext(n),r).then(function(a){return w(w({},r),a.exportedVariables)})]:[2,w({},r)]})})},t.prototype.shouldForceResolvers=function(e){var r=!1;return nt(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 mn}}}),r},t.prototype.buildRootValueFromCache=function(e,r){return this.cache.diff({query:Xc(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),jt(this,void 0,void 0,function(){var s,u,c,l,d,f,p,h,g,v,C;return Bt(this,function(_){return s=bn(e),u=vn(e),c=gn(u),l=this.collectSelectionsToResolve(s,c),d=s.operation,f=d?d.charAt(0).toUpperCase()+d.slice(1):"Query",p=this,h=p.cache,g=p.client,v={fragmentMap:c,context:w(w({},n),{cache:h,client:g}),variables:i,fragmentMatcher:a,defaultOperationType:f,exportedVariables:{},selectionsToResolve:l,onlyRunForcedResolvers:o},C=!1,[2,this.resolveSelectionSet(s.selectionSet,C,r,v).then(function(b){return{result:b,exportedVariables:v.exportedVariables}})]})})},t.prototype.resolveSelectionSet=function(e,r,n,i){return jt(this,void 0,void 0,function(){var a,o,s,u,c,l=this;return Bt(this,function(d){return a=i.fragmentMap,o=i.context,s=i.variables,u=[n],c=function(f){return jt(l,void 0,void 0,function(){var p,h;return Bt(this,function(g){return!r&&!i.selectionsToResolve.has(f)?[2]:dr(f,s)?Ct(f)?[2,this.resolveField(f,r,n,i).then(function(v){var C;typeof v<"u"&&u.push((C={},C[Nt(f)]=v,C))})]:(Kc(f)?p=f:(p=a[f.name.value],__DEV__?D(p,"No fragment named ".concat(f.name.value)):D(p,11)),p&&p.typeCondition&&(h=p.typeCondition.name.value,i.fragmentMatcher(n,h,o))?[2,this.resolveSelectionSet(p.selectionSet,r,n,i).then(function(v){u.push(v)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(c)).then(function(){return sa(u)})]})})},t.prototype.resolveField=function(e,r,n,i){return jt(this,void 0,void 0,function(){var a,o,s,u,c,l,d,f,p,h=this;return Bt(this,function(g){return n?(a=i.variables,o=e.name.value,s=Nt(e),u=o!==s,c=n[s]||n[o],l=Promise.resolve(c),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(d=n.__typename||i.defaultOperationType,f=this.resolvers&&this.resolvers[d],f&&(p=f[u?o:s],p&&(l=Promise.resolve(yi.withValue(this.cache,p,[n,hr(e,a),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,l.then(function(v){var C,_;if(v===void 0&&(v=c),e.directives&&e.directives.forEach(function(y){y.name.value==="export"&&y.arguments&&y.arguments.forEach(function(T){T.name.value==="as"&&T.value.kind==="StringValue"&&(i.exportedVariables[T.value.value]=v)})}),!e.selectionSet||v==null)return v;var b=(_=(C=e.directives)===null||C===void 0?void 0:C.some(function(y){return y.name.value==="client"}))!==null&&_!==void 0?_:!1;if(Array.isArray(v))return h.resolveSubSelectedArray(e,r||b,v,i);if(e.selectionSet)return h.resolveSelectionSet(e.selectionSet,r||b,v,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),nt(o,{Directive:function(u,c,l,d,f){u.name.value==="client"&&f.forEach(function(p){n(p)&&ra(p)&&s.add(p)})},FragmentSpread:function(u,c,l,d,f){var p=r[u.name.value];__DEV__?D(p,"No fragment named ".concat(u.name.value)):D(p,12);var h=a(p);h.size>0&&(f.forEach(function(g){n(g)&&ra(g)&&s.add(g)}),s.add(u),h.forEach(function(g){s.add(g)}))}})}return i.get(o)}return a(e)},t}();var bi=new(Pt?WeakMap:Map);function Vu(t,e){var r=t[e];typeof r=="function"&&(t[e]=function(){return bi.set(t,(bi.get(t)+1)%1e15),r.apply(this,arguments)})}function kd(t){t.notifyTimeout&&(clearTimeout(t.notifyTimeout),t.notifyTimeout=void 0)}var is=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;bi.has(n)||(bi.set(n,0),Vu(n,"evict"),Vu(n,"modify"),Vu(n,"reset"))}return t.prototype.init=function(e){var r=e.networkStatus||ue.loading;return this.variables&&this.networkStatus!==ue.loading&&!xe(this.variables,e.variables)&&(r=ue.setVariables),xe(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(){kd(this),this.dirty=!1},t.prototype.getDiff=function(e){e===void 0&&(e=this.variables);var r=this.getDiffOptions(e);if(this.lastDiff&&xe(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&&!xe(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():Bu(e)})):delete this.oqListener)},t.prototype.notify=function(){var e=this;kd(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(jr(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=w(w({},this.getDiffOptions(e)),{watcher:this,callback:function(a){return r.setDiff(a)}});(!this.lastWatch||!xe(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===bi.get(this.cache)&&xe(r,n.variables)&&xe(e.data,n.result.data))},t.prototype.markResult=function(e,r,n,i){var a=this,o=new ht,s=Ue(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Ue(e.incremental)){var u=Fo(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&&(as(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:bi.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){e.data=a.lastDiff.diff.result;return}var d=a.getDiffOptions(n.variables),f=l.diff(d);a.stopped||a.updateWatch(n.variables),a.updateLastDiff(f,d),f.complete&&(e.data=f.result)}):this.lastWrite=void 0)},t.prototype.markReady=function(){return this.networkError=null,this.networkStatus=ue.ready},t.prototype.markError=function(e){return this.networkStatus=ue.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},t}();function as(t,e){e===void 0&&(e="none");var r=e==="ignore"||e==="all",n=!fi(t);return!n&&r&&t.data&&(n=!0),n}var ty=Object.prototype.hasOwnProperty,Id=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,f=e.localState,p=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(Pt?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=f||new ns({cache:r}),this.ssrMode=c,this.assumeImmutableResults=!!p,(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 z("QueryManager stopped while query was in flight"):new z(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,f=e.update,p=e.onQueryUpdated,h=e.fetchPolicy,g=h===void 0?((r=this.defaultOptions.mutate)===null||r===void 0?void 0:r.fetchPolicy)||"network-only":h,v=e.errorPolicy,C=v===void 0?((n=this.defaultOptions.mutate)===null||n===void 0?void 0:n.errorPolicy)||"none":v,_=e.keepRootFields,b=e.context;return jt(this,void 0,void 0,function(){var y,T,R,k,P,F;return Bt(this,function($){switch($.label){case 0:return __DEV__?D(i,"mutation option is required. You must specify your GraphQL document in the mutation option."):D(i,15),__DEV__?D(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."):D(g==="network-only"||g==="no-cache",16),y=this.generateMutationId(),T=this.transform(i),R=T.document,k=T.hasClientExports,i=this.cache.transformForLink(R),a=this.getVariables(i,a),k?[4,this.localState.addExportedVariables(i,a,b)]:[3,2];case 1:a=$.sent(),$.label=2;case 2:return P=this.mutationStore&&(this.mutationStore[y]={mutation:i,variables:a,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:y,document:i,variables:a,fetchPolicy:g,errorPolicy:C,context:b,updateQueries:s,update:f,keepRootFields:_}),this.broadcastQueries(),F=this,[2,new Promise(function(q,Ze){return $o(F.getObservableFromLink(i,w(w({},b),{optimisticResponse:o}),a,!1),function(Me){if(fi(Me)&&C==="none")throw new mr({graphQLErrors:Mo(Me)});P&&(P.loading=!1,P.error=null);var V=w({},Me);return typeof c=="function"&&(c=c(V)),C==="ignore"&&fi(V)&&delete V.errors,F.markMutationResult({mutationId:y,result:V,document:i,variables:a,fetchPolicy:g,errorPolicy:C,context:b,update:f,updateQueries:s,awaitRefetchQueries:d,refetchQueries:c,removeOptimistic:o?y:void 0,onQueryUpdated:p,keepRootFields:_})}).subscribe({next:function(Me){F.broadcastQueries(),(!("hasNext"in Me)||Me.hasNext===!1)&&q(Me)},error:function(Me){P&&(P.loading=!1,P.error=Me),o&&F.cache.removeOptimistic(y),F.broadcastQueries(),Ze(Me instanceof mr?Me:new mr({networkError:Me}))}})})]}})})},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&&as(i,e.errorPolicy)){if($r(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),$r(i)&&Ue(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=Fo(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,f){var p=d.observableQuery,h=p&&p.queryName;if(!(!h||!ty.call(c,h))){var g=c[h],v=n.queries.get(f),C=v.document,_=v.variables,b=r.diff({query:C,variables:_,returnPartialData:!0,optimistic:!1}),y=b.result,T=b.complete;if(T&&y){var R=g(y,{mutationResult:i,queryName:C&&ci(C)||void 0,queryVariables:_});R&&a.push({result:R,dataId:"ROOT_QUERY",query:C,variables:_})}}})}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 f=e.update,p=!lf(i)||$r(i)&&!i.hasNext;if(f){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=w(w({},i),{data:h.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}p&&f(d,i,{context:e.context,variables:e.variables})}!o&&!e.keepRootFields&&p&&d.modify({id:"ROOT_MUTATION",fields:function(g,v){var C=v.fieldName,_=v.DELETE;return C==="__typename"?g:_}})},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(w(w({},r),{result:{data:i}}),a)}catch(o){__DEV__&&D.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:zc(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:a,serverQuery:o,defaultVars:_n(Yt(n)),asQuery:w(w({},n),{definitions:n.definitions.map(function(c){return c.kind==="OperationDefinition"&&c.operation!=="query"?w(w({},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 w(w({},this.transform(e).defaultVars),r)},t.prototype.watchQuery=function(e){e=w(w({},e),{variables:this.getVariables(e.query,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var r=new is(this),n=new rs({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__?D(e.query,"query option is required. You must specify your GraphQL document in the query option."):D(e.query,17),__DEV__?D(e.query.kind==="Document",'You must wrap the query string in a "gql" tag.'):D(e.query.kind==="Document",18),__DEV__?D(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):D(!e.returnPartialData,19),__DEV__?D(!e.pollInterval,"pollInterval option only supported on watchQuery."):D(!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 z("Store reset while query was in flight (not completed in link chain)"):new z(21)),this.queries.forEach(function(r){r.observableQuery?r.networkStatus=ue.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):Hc(o)?i.set(r.transform(o).document,!1):oe(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=la("legacyOneTimeQuery"),u=r.getQuery(s).init({document:o.query,variables:o.variables}),c=new rs({queryManager:r,queryInfo:u,options:w(w({},o),{fetchPolicy:"network-only"})});D(c.queryId===s),u.setObservableQuery(c),n.set(s,c)}),__DEV__&&i.size&&i.forEach(function(o,s){o||__DEV__&&D.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(f){if(i!=="no-cache"&&(as(f,a)&&r.cache.write({query:n,result:f.data,dataId:"ROOT_SUBSCRIPTION",variables:d}),r.broadcastQueries()),fi(f))throw new mr({graphQLErrors:f.errors});return f})};if(this.transform(n).hasClientExports){var l=this.localState.addExportedVariables(n,o,u).then(c);return new Y(function(d){var f=null;return l.then(function(p){return f=p.subscribe(d)},d.error),function(){return f&&f.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,f={query:u,variables:n,operationName:ci(u)||void 0,context:this.prepareContext(w(w({},r),{forceFetch:!i}))};if(r=f.context,i){var p=l.get(u)||new Map;l.set(u,p);var h=xt(n);if(s=p.get(h),!s){var g=new pi([di(d,f)]);p.set(h,s=g),g.beforeNext(function(){p.delete(h)&&p.size<1&&l.delete(u)})}}else s=new pi([di(d,f)])}else s=new pi([Y.of({data:{}})]),r=this.prepareContext(r);var v=this.transform(e).clientQuery;return v&&(s=$o(s,function(C){return a.localState.runResolvers({document:v,remoteResult:C,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 $o(this.getObservableFromLink(a,n.context,n.variables),function(o){var s=Mo(o),u=s.length>0;if(i>=e.lastRequestId){if(u&&n.errorPolicy==="none")throw e.markError(new mr({graphQLErrors:s}));e.markResult(o,a,n,r),e.markReady()}var c={data:o.data,loading:!1,networkStatus:ue.ready};return u&&n.errorPolicy!=="ignore"&&(c.errors=s,c.networkStatus=ue.error),c},function(o){var s=Ed(o)?o:new mr({networkError:o});throw i>=e.lastRequestId&&e.markError(s),s})},t.prototype.fetchQueryObservable=function(e,r,n){var i=this;n===void 0&&(n=ue.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,f=d===void 0?u&&u.errorPolicy||"none":d,p=r.returnPartialData,h=p===void 0?!1:p,g=r.notifyOnNetworkStatusChange,v=g===void 0?!1:g,C=r.context,_=C===void 0?{}:C,b=Object.assign({},r,{query:a,variables:o,fetchPolicy:l,errorPolicy:f,returnPartialData:h,notifyOnNetworkStatusChange:v,context:_}),y=function(k){b.variables=k;var P=i.fetchQueryByPolicy(s,b,n);return b.fetchPolicy!=="standby"&&P.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",r),P},T=function(){return i.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,function(k){T(),setTimeout(function(){return R.cancel(k)})});var R=new pi(this.transform(b.query).hasClientExports?this.localState.addExportedVariables(b.query,b.variables,b.context).then(y):y(b.variables));return R.promise.then(T,T),R},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?la("refetchQueries"):void 0:s,c=e.onQueryUpdated,l=new Map;i&&this.getObservableQueries(i).forEach(function(f,p){l.set(p,{oq:f,lastDiff:r.getQuery(p).getDiff()})});var d=new Map;return n&&this.cache.batch({update:n,optimistic:o&&u||!1,removeOptimistic:u,onWatchUpdated:function(f,p,h){var g=f.watcher instanceof is&&f.watcher.observableQuery;if(g){if(c){l.delete(g.queryId);var v=c(g,p,h);return v===!0&&(v=g.refetch()),v!==!1&&d.set(g,v),v}c!==null&&l.set(g.queryId,{oq:g,lastDiff:h,diff:p})}}}),l.size&&l.forEach(function(f,p){var h=f.oq,g=f.lastDiff,v=f.diff,C;if(c){if(!v){var _=h.queryInfo;_.reset(),v=_.getDiff()}C=c(h,v,g)}(!c||C===!0)&&(C=h.refetch()),C!==!1&&d.set(h,C),p.indexOf("legacyOneTimeQuery")>=0&&r.stopQueryNoBroadcast(p)}),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,f=r.notifyOnNetworkStatusChange,p=e.networkStatus;e.init({document:this.transform(a).document,variables:o,networkStatus:n});var h=function(){return e.getDiff(o)},g=function(y,T){T===void 0&&(T=e.networkStatus||ue.loading);var R=y.result;__DEV__&&!l&&!xe(R,{})&&qu(y.missing);var k=function(P){return Y.of(w({data:P,loading:jr(T),networkStatus:T},y.complete?null:{partial:!0}))};return R&&i.transform(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:R},context:d,variables:o,onlyRunForcedResolvers:!0}).then(function(P){return k(P.data||void 0)}):c==="none"&&T===ue.refetch&&Array.isArray(y.missing)?k(void 0):k(R)},v=s==="no-cache"?0:n===ue.refetch&&u!=="merge"?1:2,C=function(){return i.getResultsFromLink(e,v,{variables:o,context:d,fetchPolicy:s,errorPolicy:c})},_=f&&typeof p=="number"&&p!==n&&jr(n);switch(s){default:case"cache-first":{var b=h();return b.complete?[g(b,e.markReady())]:l||_?[g(b),C()]:[C()]}case"cache-and-network":{var b=h();return b.complete||l||_?[g(b),C()]:[C()]}case"cache-only":return[g(h(),e.markReady())];case"network-only":return _?[g(h()),C()]:[C()];case"no-cache":return _?[g(e.getDiff()),C()]:[C()];case"standby":return[]}},t.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new is(this,e)),this.queries.get(e)},t.prototype.prepareContext=function(e){e===void 0&&(e={});var r=this.localState.prepareContext(e);return w(w({},r),{clientAwareness:this.clientAwareness})},t}();var Ad=!1;var Qu=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,f=d===void 0?typeof window=="object"&&!window.__APOLLO_CLIENT__&&__DEV__:d,p=e.queryDeduplication,h=p===void 0?!0:p,g=e.defaultOptions,v=e.assumeImmutableResults,C=v===void 0?!1:v,_=e.resolvers,b=e.typeDefs,y=e.fragmentMatcher,T=e.name,R=e.version,k=e.link;if(k||(k=n?new vu({uri:n,credentials:i,headers:a}):Rt.empty()),!o)throw __DEV__?new z(`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 z(9);if(this.link=k,this.cache=o,this.disableNetworkFetches=u||l>0,this.queryDeduplication=h,this.defaultOptions=g||Object.create(null),this.typeDefs=b,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),f&&typeof window=="object"&&(window.__APOLLO_CLIENT__=this),!Ad&&f&&__DEV__&&(Ad=!0,typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var P=window.navigator,F=P&&P.userAgent,$=void 0;typeof F=="string"&&(F.indexOf("Chrome/")>-1?$="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":F.indexOf("Firefox/")>-1&&($="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),$&&__DEV__&&D.log("Download the Apollo DevTools for a better development experience: "+$)}this.version=hf,this.localState=new ns({cache:o,client:this,resolvers:_,fragmentMatcher:y}),this.queryManager=new Id({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:h,ssrMode:u,clientAwareness:{name:T,version:R},localState:this.localState,assumeImmutableResults:C,onBroadcast:f?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=pa(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=w(w({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},t.prototype.query=function(e){return this.defaultOptions.query&&(e=pa(this.defaultOptions.query,e)),__DEV__?D(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."):D(e.fetchPolicy!=="cache-and-network",10),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=w(w({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},t.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=pa(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 di(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__&&D.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}();Up(hn?"log":"silent");function st(t){return t===null?"null":Array.isArray(t)?"array":typeof t}function gr(t){return st(t)==="object"}function Td(t){return Array.isArray(t)&&t.length>0&&t.every(e=>"message"in e)}function zu(t,e){return t.length<124?t:e}var Od="graphql-transport-ws";var mt;(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"})(mt||(mt={}));var Ne;(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"})(Ne||(Ne={}));function Dd(t){if(!gr(t))throw new Error(`Message is expected to be an object, but got ${st(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 ${st(t.type)}`);switch(t.type){case Ne.ConnectionInit:case Ne.ConnectionAck:case Ne.Ping:case Ne.Pong:{if(t.payload!=null&&!gr(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 Ne.Subscribe:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${st(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!gr(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${st(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 ${st(t.payload.query)}`);if(t.payload.variables!=null&&!gr(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 ${st(t.payload.variables)}`);if(t.payload.operationName!=null&&st(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 ${st(t.payload.operationName)}`);if(t.payload.extensions!=null&&!gr(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 ${st(t.payload.extensions)}`);break}case Ne.Next:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${st(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!gr(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${st(t.payload)}`);break}case Ne.Error:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${st(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!Td(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 Ne.Complete:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${st(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 Nd(t,e){return Dd(typeof t=="string"?JSON.parse(t,e):t)}function _i(t,e){return Dd(t),JSON.stringify(t,e)}function Pd(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(be){let _e=1e3;for(let ie=0;ie<be;ie++)_e*=2;await new Promise(ie=>setTimeout(ie,_e+Math.floor(Math.random()*(3e3-300)+300)))},shouldRetry:d=os,isFatalConnectionProblem:f,on:p,webSocketImpl:h,generateID:g=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,be=>{let _e=Math.random()*16|0;return(be=="x"?_e:_e&3|8).toString(16)})},jsonMessageReplacer:v,jsonMessageReviver:C}=t,_;if(h){if(!ny(h))throw new Error("Invalid WebSocket implementation provided");_=h}else typeof WebSocket<"u"?_=WebSocket:typeof global<"u"?_=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(_=window.WebSocket||window.MozWebSocket);if(!_)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let b=_,y=(()=>{let V=(()=>{let _e={};return{on(ie,ae){return _e[ie]=ae,()=>{delete _e[ie]}},emit(ie){var ae;"id"in ie&&((ae=_e[ie.id])===null||ae===void 0||ae.call(_e,ie))}}})(),be={connecting:p?.connecting?[p.connecting]:[],opened:p?.opened?[p.opened]:[],connected:p?.connected?[p.connected]:[],ping:p?.ping?[p.ping]:[],pong:p?.pong?[p.pong]:[],message:p?.message?[V.emit,p.message]:[V.emit],closed:p?.closed?[p.closed]:[],error:p?.error?[p.error]:[]};return{onMessage:V.on,on(_e,ie){let ae=be[_e];return ae.push(ie),()=>{ae.splice(ae.indexOf(ie),1)}},emit(_e,...ie){for(let ae of[...be[_e]])ae(...ie)}}})();function T(V){let be=[y.on("error",_e=>{be.forEach(ie=>ie()),V(_e)}),y.on("closed",_e=>{be.forEach(ie=>ie()),V(_e)})]}let R,k=0,P,F=!1,$=0,q=!1;async function Ze(){clearTimeout(P);let[V,be]=await(R??(R=new Promise((ae,Wt)=>(async()=>{if(F){if(await l($),!k)return R=void 0,Wt({code:1e3,reason:"All Subscriptions Gone"});$++}y.emit("connecting");let J=new b(typeof e=="function"?await e():e,Od),Kt,Ir;function vo(){isFinite(o)&&o>0&&(clearTimeout(Ir),Ir=setTimeout(()=>{J.readyState===b.OPEN&&(J.send(_i({type:Ne.Ping})),y.emit("ping",!1,void 0))},o))}T(Je=>{R=void 0,clearTimeout(Kt),clearTimeout(Ir),Wt(Je),os(Je)&&Je.code===4499&&(J.close(4499,"Terminated"),J.onerror=null,J.onclose=null)}),J.onerror=Je=>y.emit("error",Je),J.onclose=Je=>y.emit("closed",Je),J.onopen=async()=>{try{y.emit("opened",J);let Je=typeof r=="function"?await r():r;if(J.readyState!==b.OPEN)return;J.send(_i(Je?{type:Ne.ConnectionInit,payload:Je}:{type:Ne.ConnectionInit},v)),isFinite(u)&&u>0&&(Kt=setTimeout(()=>{J.close(mt.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},u)),vo()}catch(Je){y.emit("error",Je),J.close(mt.InternalClientError,zu(Je instanceof Error?Je.message:new Error(Je).message,"Internal client error"))}};let ti=!1;J.onmessage=({data:Je})=>{try{let Ye=Nd(Je,C);if(y.emit("message",Ye),Ye.type==="ping"||Ye.type==="pong"){y.emit(Ye.type,!0,Ye.payload),Ye.type==="pong"?vo():s||(J.send(_i(Ye.payload?{type:Ne.Pong,payload:Ye.payload}:{type:Ne.Pong})),y.emit("pong",!1,Ye.payload));return}if(ti)return;if(Ye.type!==Ne.ConnectionAck)throw new Error(`First message cannot be of type ${Ye.type}`);clearTimeout(Kt),ti=!0,y.emit("connected",J,Ye.payload),F=!1,$=0,ae([J,new Promise((T3,Y1)=>T(Y1))])}catch(Ye){J.onmessage=null,y.emit("error",Ye),J.close(mt.BadResponse,zu(Ye instanceof Error?Ye.message:new Error(Ye).message,"Bad response"))}}})())));V.readyState===b.CLOSING&&await be;let _e=()=>{},ie=new Promise(ae=>_e=ae);return[V,_e,Promise.race([ie.then(()=>{if(!k){let ae=()=>V.close(1e3,"Normal Closure");isFinite(a)&&a>0?P=setTimeout(()=>{V.readyState===b.OPEN&&ae()},a):ae()}}),be])]}function Me(V){if(os(V)&&(ry(V.code)||[mt.InternalServerError,mt.InternalClientError,mt.BadRequest,mt.BadResponse,mt.Unauthorized,mt.SubprotocolNotAcceptable,mt.SubscriberAlreadyExists,mt.TooManyInitialisationRequests].includes(V.code)))throw V;if(q)return!1;if(os(V)&&V.code===1e3)return k>0;if(!c||$>=c||!d(V)||f?.(V))throw V;return F=!0}return n||(async()=>{for(k++;;)try{let[,,V]=await Ze();await V}catch(V){try{if(!Me(V))return}catch(be){return i?.(be)}}})(),{on:y.on,subscribe(V,be){let _e=g(V),ie=!1,ae=!1,Wt=()=>{k--,ie=!0};return(async()=>{for(k++;;)try{let[J,Kt,Ir]=await Ze();if(ie)return Kt();let vo=y.onMessage(_e,ti=>{switch(ti.type){case Ne.Next:{be.next(ti.payload);return}case Ne.Error:{ae=!0,ie=!0,be.error(ti.payload),Wt();return}case Ne.Complete:{ie=!0,Wt();return}}});J.send(_i({id:_e,type:Ne.Subscribe,payload:V},v)),Wt=()=>{!ie&&J.readyState===b.OPEN&&J.send(_i({id:_e,type:Ne.Complete},v)),k--,ie=!0,Kt()},await Ir.finally(vo);return}catch(J){if(!Me(J))return}})().then(()=>{ae||be.complete()}).catch(J=>{be.error(J)}),()=>{ie||Wt()}},async dispose(){if(q=!0,R){let[V]=await R;V.close(1e3,"Normal Closure")}},terminate(){R&&y.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}function os(t){return gr(t)&&"code"in t&&"reason"in t}function ry(t){return[1e3,1001,1006,1005,1012,1013,1013].includes(t)?!1:t>=1e3&&t<=1999}function ny(t){return typeof t=="function"&&"constructor"in t&&"CLOSED"in t&&"CLOSING"in t&&"CONNECTING"in t&&"OPEN"in t}function iy(t){return oe(t)&&"code"in t&&"reason"in t}var Rd=function(t){Oe(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 Y(function(i){return n.client.subscribe(w(w({},r),{query:ai(r.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(a){return a instanceof Error?i.error(a):iy(a)?i.error(new Error("Socket closed with event ".concat(a.code," ").concat(a.reason||""))):i.error(new mr({graphQLErrors:Array.isArray(a)?a:[a]}))}})})},e}(Rt);var Fs=function(){return Fs=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},Fs.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function _s(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_s=function(r){return typeof r}:_s=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},_s(t)}function ay(t){return _s(t)=="object"&&t!==null}var Zh=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function fl(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 oy(t){return Jh(t.source,fl(t.source,t.start))}function Jh(t,e){var r=t.locationOffset.column-1,n=ws(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
- `),l=n.split(/\r\n|[\n\r]/g),d=l[i];if(d.length>120){for(var f=Math.floor(u/80),p=u%80,h=[],g=0;g<d.length;g+=80)h.push(d.slice(g,g+80));return c+$d([["".concat(o),h[0]]].concat(h.slice(1,f+1).map(function(v){return["",v]}),[[" ",ws(p-1)+"^"],["",h[f+1]]]))}return c+$d([["".concat(o-1),l[i-1]],["".concat(o),d],["",ws(u-1)+"^"],["".concat(o+1),l[i+1]]])}function $d(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 sy(r,i)+(a?" | "+a:" |")}).join(`
55
- `)}function ws(t){return Array(t+1).join(" ")}function sy(t,e){return ws(t-e.length)+e}function Ss(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ss=function(r){return typeof r}:Ss=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ss(t)}function Ld(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 cy(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ld(Object(r),!0).forEach(function(n){uy(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ld(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function uy(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ly(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Fd(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 py(t,e,r){return e&&Fd(t.prototype,e),r&&Fd(t,r),t}function fy(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&&Wa(t,e)}function dy(t){var e=Xh();return function(){var n=Ka(t),i;if(e){var a=Ka(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return Yh(this,i)}}function Yh(t,e){return e&&(Ss(e)==="object"||typeof e=="function")?e:Ca(t)}function Ca(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function dl(t){var e=typeof Map=="function"?new Map:void 0;return dl=function(n){if(n===null||!hy(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 Cs(n,arguments,Ka(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Wa(i,n)},dl(t)}function Cs(t,e,r){return Xh()?Cs=Reflect.construct:Cs=function(i,a,o){var s=[null];s.push.apply(s,a);var u=Function.bind.apply(i,s),c=new u;return o&&Wa(c,o.prototype),c},Cs.apply(null,arguments)}function Xh(){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 hy(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function Wa(t,e){return Wa=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Wa(t,e)}function Ka(t){return Ka=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Ka(t)}var my=function(t){fy(r,t);var e=dy(r);function r(n,i,a,o,s,u,c){var l,d,f,p;ly(this,r),p=e.call(this,n),p.name="GraphQLError",p.originalError=u??void 0,p.nodes=Md(Array.isArray(i)?i:i?[i]:void 0);for(var h=[],g=0,v=(C=p.nodes)!==null&&C!==void 0?C:[];g<v.length;g++){var C,_=v[g],b=_.loc;b!=null&&h.push(b)}h=Md(h),p.source=a??((l=h)===null||l===void 0?void 0:l[0].source),p.positions=o??((d=h)===null||d===void 0?void 0:d.map(function(T){return T.start})),p.locations=o&&a?o.map(function(T){return fl(a,T)}):(f=h)===null||f===void 0?void 0:f.map(function(T){return fl(T.source,T.start)}),p.path=s??void 0;var y=u?.extensions;return c==null&&ay(y)?p.extensions=cy({},y):p.extensions=c??{},Object.defineProperties(Ca(p),{message:{enumerable:!0},locations:{enumerable:p.locations!=null},path:{enumerable:p.path!=null},extensions:{enumerable:p.extensions!=null&&Object.keys(p.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),u!=null&&u.stack?(Object.defineProperty(Ca(p),"stack",{value:u.stack,writable:!0,configurable:!0}),Yh(p)):(Error.captureStackTrace?Error.captureStackTrace(Ca(p),r):Object.defineProperty(Ca(p),"stack",{value:Error().stack,writable:!0,configurable:!0}),p)}return py(r,[{key:"toString",value:function(){return gy(this)}},{key:Zh,get:function(){return"Object"}}]),r}(dl(Error));function Md(t){return t===void 0||t.length===0?void 0:t}function gy(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+=`
51
+ `)),e=e.replace(/\n$/,""),e},mr=function(t){De(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||ry(u),u.extraInfo=s,u.__proto__=e.prototype,u}return e}(Error);var fe;(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"})(fe||(fe={}));function jr(t){return t?t<7:!1}var ny=Object.assign,iy=Object.hasOwnProperty,ss=function(t){De(e,t);function e(r){var n=r.queryManager,i=r.queryInfo,a=r.options,o=t.call(this,function(b){try{var C=b._subscription._observer;C&&!C.error&&(C.error=ay)}catch{}var w=!o.observers.size;o.observers.add(b);var _=o.last;return _&&_.error?b.error&&b.error(_.error):_&&_.result&&b.next&&b.next(_.result),w&&o.reobserve().catch(function(){}),function(){o.observers.delete(b)&&!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,f=d===void 0?l:d,p=a.initialFetchPolicy,h=p===void 0?f==="standby"?l:f:p;o.options=S(S({},a),{initialFetchPolicy:h,fetchPolicy:f}),o.queryId=i.queryId||n.generateQueryId();var g=Xt(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||fe.ready,a=S(S({},n),{loading:jr(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),Ee(a.data,{})&&(a.data=void 0),u.complete?(delete a.partial,u.complete&&a.networkStatus===fe.loading&&(s==="cache-first"||s==="cache-only")&&(a.networkStatus=fe.ready,a.loading=!1)):a.partial=!0,__DEV__&&!u.complete&&!this.options.partialRefetch&&!a.loading&&!a.data&&!a.error&&zu(u.missing)}return r&&this.updateLastResult(a),a},e.prototype.isDifferentFromLastResult=function(r,n){return!this.last||!Ee(this.last.result,r)||n&&!Ee(this.last.variables,n)},e.prototype.getLast=function(r,n){var i=this.last;if(i&&i[r]&&(!n||Ee(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&&iy.call(r,"variables")){var o=ca(this.query),s=o.variableDefinitions;(!s||!s.some(function(u){return u.variable.name.value==="variables"}))&&__DEV__&&N.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
+ Did you mean to call refetch(variables) instead of refetch({ variables })?`))}return r&&!Ee(this.options.variables,r)&&(i.variables=this.options.variables=S(S({},this.options.variables),r)),this.queryInfo.resetLastWrite(),this.reobserve(i,fe.refetch)},e.prototype.fetchMore=function(r){var n=this,i=S(S({},r.query?r:S(S(S(S({},this.options),{query:this.query}),r),{variables:S(S({},this.options.variables),r.variables)})),{fetchPolicy:"no-cache"}),a=this.queryManager.generateQueryId(),o=this.queryInfo,s=o.networkStatus;o.networkStatus=fe.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var u=new Set;return this.queryManager.fetchQuery(a,i,fe.fetchMore).then(function(c){return n.queryManager.removeQuery(a),o.networkStatus===fe.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(f){return d(f,{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)||Qu(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__&&N.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 Ee(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},fe.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__?N(a,"Attempted to start a polling query without a polling interval."):N(a,13);var o=i||(this.pollingInfo={});o.interval=a;var s=function(){r.pollingInfo&&(jr(r.queryInfo.networkStatus)?u():r.reobserve({fetchPolicy:r.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},fe.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=S(S({},this.last),{result:this.queryManager.assumeImmutableResults?r:jo(r),variables:n}),Be(r.errors)||delete this.last.error,this.last},e.prototype.reobserve=function(r,n){var i=this;this.isTornDown=!1;var a=n===fe.refetch||n===fe.fetchMore||n===fe.poll,o=this.options.variables,s=this.options.fetchPolicy,u=Lr(this.options,r||{}),c=a?u:ny(this.options,u);a||(this.updatePolling(),r&&r.variables&&!Ee(r.variables,o)&&c.fetchPolicy!=="standby"&&c.fetchPolicy===s&&(this.applyNextFetchPolicy("variables-changed",c),n===void 0&&(n=fe.setVariables)));var l=c.variables&&S({},c.variables),d=this.fetch(c,n),f={next:function(p){i.reportResult(p,l)},error:function(p){i.reportError(p,l)}};return a||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=d,this.observer=f),d.addObserver(f),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),Sn(this.observers,"next",r))},e.prototype.reportError=function(r,n){var i=S(S({},this.getLastResult()),{error:r,errors:r.graphQLErrors,networkStatus:fe.error,loading:!1});this.updateLastResult(i,n),Sn(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}(ne);qo(ss);function Qu(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 ay(t){__DEV__&&N.error("Unhandled error",t.message,t.stack)}function zu(t){__DEV__&&t&&__DEV__&&N.debug("Missing cache result fields: ".concat(JSON.stringify(t)),t)}var cs=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=iu(r.resolvers,n)}):this.resolvers=iu(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 Bt(this,void 0,void 0,function(){return qt(this,function(u){return r?[2,this.resolveDocument(r,n.data,i,a,this.fragmentMatcher,s).then(function(c){return S(S({},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 si(["client"],e)&&this.resolvers?e:null},t.prototype.serverQuery=function(e){return nu(e)},t.prototype.prepareContext=function(e){var r=this.cache;return S(S({},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={}),Bt(this,void 0,void 0,function(){return qt(this,function(i){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,r)||{},this.prepareContext(n),r).then(function(a){return S(S({},r),a.exportedVariables)})]:[2,S({},r)]})})},t.prototype.shouldForceResolvers=function(e){var r=!1;return it(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 mn}}}),r},t.prototype.buildRootValueFromCache=function(e,r){return this.cache.diff({query:ru(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),Bt(this,void 0,void 0,function(){var s,u,c,l,d,f,p,h,g,b,C;return qt(this,function(w){return s=bn(e),u=vn(e),c=gn(u),l=this.collectSelectionsToResolve(s,c),d=s.operation,f=d?d.charAt(0).toUpperCase()+d.slice(1):"Query",p=this,h=p.cache,g=p.client,b={fragmentMap:c,context:S(S({},n),{cache:h,client:g}),variables:i,fragmentMatcher:a,defaultOperationType:f,exportedVariables:{},selectionsToResolve:l,onlyRunForcedResolvers:o},C=!1,[2,this.resolveSelectionSet(s.selectionSet,C,r,b).then(function(_){return{result:_,exportedVariables:b.exportedVariables}})]})})},t.prototype.resolveSelectionSet=function(e,r,n,i){return Bt(this,void 0,void 0,function(){var a,o,s,u,c,l=this;return qt(this,function(d){return a=i.fragmentMap,o=i.context,s=i.variables,u=[n],c=function(f){return Bt(l,void 0,void 0,function(){var p,h;return qt(this,function(g){return!r&&!i.selectionsToResolve.has(f)?[2]:dr(f,s)?Ct(f)?[2,this.resolveField(f,r,n,i).then(function(b){var C;typeof b<"u"&&u.push((C={},C[Pt(f)]=b,C))})]:(Yc(f)?p=f:(p=a[f.name.value],__DEV__?N(p,"No fragment named ".concat(f.name.value)):N(p,11)),p&&p.typeCondition&&(h=p.typeCondition.name.value,i.fragmentMatcher(n,h,o))?[2,this.resolveSelectionSet(p.selectionSet,r,n,i).then(function(b){u.push(b)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(c)).then(function(){return ua(u)})]})})},t.prototype.resolveField=function(e,r,n,i){return Bt(this,void 0,void 0,function(){var a,o,s,u,c,l,d,f,p,h=this;return qt(this,function(g){return n?(a=i.variables,o=e.name.value,s=Pt(e),u=o!==s,c=n[s]||n[o],l=Promise.resolve(c),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(d=n.__typename||i.defaultOperationType,f=this.resolvers&&this.resolvers[d],f&&(p=f[u?o:s],p&&(l=Promise.resolve(vi.withValue(this.cache,p,[n,hr(e,a),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,l.then(function(b){var C,w;if(b===void 0&&(b=c),e.directives&&e.directives.forEach(function(y){y.name.value==="export"&&y.arguments&&y.arguments.forEach(function(T){T.name.value==="as"&&T.value.kind==="StringValue"&&(i.exportedVariables[T.value.value]=b)})}),!e.selectionSet||b==null)return b;var _=(w=(C=e.directives)===null||C===void 0?void 0:C.some(function(y){return y.name.value==="client"}))!==null&&w!==void 0?w:!1;if(Array.isArray(b))return h.resolveSubSelectedArray(e,r||_,b,i);if(e.selectionSet)return h.resolveSelectionSet(e.selectionSet,r||_,b,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),it(o,{Directive:function(u,c,l,d,f){u.name.value==="client"&&f.forEach(function(p){n(p)&&ia(p)&&s.add(p)})},FragmentSpread:function(u,c,l,d,f){var p=r[u.name.value];__DEV__?N(p,"No fragment named ".concat(u.name.value)):N(p,12);var h=a(p);h.size>0&&(f.forEach(function(g){n(g)&&ia(g)&&s.add(g)}),s.add(u),h.forEach(function(g){s.add(g)}))}})}return i.get(o)}return a(e)},t}();var _i=new(Rt?WeakMap:Map);function Hu(t,e){var r=t[e];typeof r=="function"&&(t[e]=function(){return _i.set(t,(_i.get(t)+1)%1e15),r.apply(this,arguments)})}function Nd(t){t.notifyTimeout&&(clearTimeout(t.notifyTimeout),t.notifyTimeout=void 0)}var us=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;_i.has(n)||(_i.set(n,0),Hu(n,"evict"),Hu(n,"modify"),Hu(n,"reset"))}return t.prototype.init=function(e){var r=e.networkStatus||fe.loading;return this.variables&&this.networkStatus!==fe.loading&&!Ee(this.variables,e.variables)&&(r=fe.setVariables),Ee(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(){Nd(this),this.dirty=!1},t.prototype.getDiff=function(e){e===void 0&&(e=this.variables);var r=this.getDiffOptions(e);if(this.lastDiff&&Ee(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&&!Ee(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():Qu(e)})):delete this.oqListener)},t.prototype.notify=function(){var e=this;Nd(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(jr(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=S(S({},this.getDiffOptions(e)),{watcher:this,callback:function(a){return r.setDiff(a)}});(!this.lastWatch||!Ee(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===_i.get(this.cache)&&Ee(r,n.variables)&&Ee(e.data,n.result.data))},t.prototype.markResult=function(e,r,n,i){var a=this,o=new mt,s=Be(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Be(e.incremental)){var u=Vo(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&&(ls(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:_i.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){e.data=a.lastDiff.diff.result;return}var d=a.getDiffOptions(n.variables),f=l.diff(d);a.stopped||a.updateWatch(n.variables),a.updateLastDiff(f,d),f.complete&&(e.data=f.result)}):this.lastWrite=void 0)},t.prototype.markReady=function(){return this.networkError=null,this.networkStatus=fe.ready},t.prototype.markError=function(e){return this.networkStatus=fe.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},t}();function ls(t,e){e===void 0&&(e="none");var r=e==="ignore"||e==="all",n=!di(t);return!n&&r&&t.data&&(n=!0),n}var oy=Object.prototype.hasOwnProperty,Pd=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,f=e.localState,p=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(Rt?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=f||new cs({cache:r}),this.ssrMode=c,this.assumeImmutableResults=!!p,(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 H("QueryManager stopped while query was in flight"):new H(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,f=e.update,p=e.onQueryUpdated,h=e.fetchPolicy,g=h===void 0?((r=this.defaultOptions.mutate)===null||r===void 0?void 0:r.fetchPolicy)||"network-only":h,b=e.errorPolicy,C=b===void 0?((n=this.defaultOptions.mutate)===null||n===void 0?void 0:n.errorPolicy)||"none":b,w=e.keepRootFields,_=e.context;return Bt(this,void 0,void 0,function(){var y,T,R,k,P,M;return qt(this,function($){switch($.label){case 0:return __DEV__?N(i,"mutation option is required. You must specify your GraphQL document in the mutation option."):N(i,15),__DEV__?N(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."):N(g==="network-only"||g==="no-cache",16),y=this.generateMutationId(),T=this.transform(i),R=T.document,k=T.hasClientExports,i=this.cache.transformForLink(R),a=this.getVariables(i,a),k?[4,this.localState.addExportedVariables(i,a,_)]:[3,2];case 1:a=$.sent(),$.label=2;case 2:return P=this.mutationStore&&(this.mutationStore[y]={mutation:i,variables:a,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:y,document:i,variables:a,fetchPolicy:g,errorPolicy:C,context:_,updateQueries:s,update:f,keepRootFields:w}),this.broadcastQueries(),M=this,[2,new Promise(function(V,Je){return Bo(M.getObservableFromLink(i,S(S({},_),{optimisticResponse:o}),a,!1),function(je){if(di(je)&&C==="none")throw new mr({graphQLErrors:Qo(je)});P&&(P.loading=!1,P.error=null);var Q=S({},je);return typeof c=="function"&&(c=c(Q)),C==="ignore"&&di(Q)&&delete Q.errors,M.markMutationResult({mutationId:y,result:Q,document:i,variables:a,fetchPolicy:g,errorPolicy:C,context:_,update:f,updateQueries:s,awaitRefetchQueries:d,refetchQueries:c,removeOptimistic:o?y:void 0,onQueryUpdated:p,keepRootFields:w})}).subscribe({next:function(je){M.broadcastQueries(),(!("hasNext"in je)||je.hasNext===!1)&&V(je)},error:function(je){P&&(P.loading=!1,P.error=je),o&&M.cache.removeOptimistic(y),M.broadcastQueries(),Je(je instanceof mr?je:new mr({networkError:je}))}})})]}})})},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&&ls(i,e.errorPolicy)){if($r(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),$r(i)&&Be(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=Vo(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,f){var p=d.observableQuery,h=p&&p.queryName;if(!(!h||!oy.call(c,h))){var g=c[h],b=n.queries.get(f),C=b.document,w=b.variables,_=r.diff({query:C,variables:w,returnPartialData:!0,optimistic:!1}),y=_.result,T=_.complete;if(T&&y){var R=g(y,{mutationResult:i,queryName:C&&ui(C)||void 0,queryVariables:w});R&&a.push({result:R,dataId:"ROOT_QUERY",query:C,variables:w})}}})}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 f=e.update,p=!gf(i)||$r(i)&&!i.hasNext;if(f){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=S(S({},i),{data:h.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}p&&f(d,i,{context:e.context,variables:e.variables})}!o&&!e.keepRootFields&&p&&d.modify({id:"ROOT_MUTATION",fields:function(g,b){var C=b.fieldName,w=b.DELETE;return C==="__typename"?g:w}})},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(S(S({},r),{result:{data:i}}),a)}catch(o){__DEV__&&N.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=tu(n),a=this.localState.clientQuery(n),o=i&&this.localState.serverQuery(i),s={document:n,hasClientExports:Wc(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:a,serverQuery:o,defaultVars:_n(Xt(n)),asQuery:S(S({},n),{definitions:n.definitions.map(function(c){return c.kind==="OperationDefinition"&&c.operation!=="query"?S(S({},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 S(S({},this.transform(e).defaultVars),r)},t.prototype.watchQuery=function(e){e=S(S({},e),{variables:this.getVariables(e.query,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var r=new us(this),n=new ss({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__?N(e.query,"query option is required. You must specify your GraphQL document in the query option."):N(e.query,17),__DEV__?N(e.query.kind==="Document",'You must wrap the query string in a "gql" tag.'):N(e.query.kind==="Document",18),__DEV__?N(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):N(!e.returnPartialData,19),__DEV__?N(!e.pollInterval,"pollInterval option only supported on watchQuery."):N(!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 H("Store reset while query was in flight (not completed in link chain)"):new H(21)),this.queries.forEach(function(r){r.observableQuery?r.networkStatus=fe.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):Zc(o)?i.set(r.transform(o).document,!1):ue(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=fa("legacyOneTimeQuery"),u=r.getQuery(s).init({document:o.query,variables:o.variables}),c=new ss({queryManager:r,queryInfo:u,options:S(S({},o),{fetchPolicy:"network-only"})});N(c.queryId===s),u.setObservableQuery(c),n.set(s,c)}),__DEV__&&i.size&&i.forEach(function(o,s){o||__DEV__&&N.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(f){if(i!=="no-cache"&&(ls(f,a)&&r.cache.write({query:n,result:f.data,dataId:"ROOT_SUBSCRIPTION",variables:d}),r.broadcastQueries()),di(f))throw new mr({graphQLErrors:f.errors});return f})};if(this.transform(n).hasClientExports){var l=this.localState.addExportedVariables(n,o,u).then(c);return new ne(function(d){var f=null;return l.then(function(p){return f=p.subscribe(d)},d.error),function(){return f&&f.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,f={query:u,variables:n,operationName:ui(u)||void 0,context:this.prepareContext(S(S({},r),{forceFetch:!i}))};if(r=f.context,i){var p=l.get(u)||new Map;l.set(u,p);var h=xt(n);if(s=p.get(h),!s){var g=new fi([hi(d,f)]);p.set(h,s=g),g.beforeNext(function(){p.delete(h)&&p.size<1&&l.delete(u)})}}else s=new fi([hi(d,f)])}else s=new fi([ne.of({data:{}})]),r=this.prepareContext(r);var b=this.transform(e).clientQuery;return b&&(s=Bo(s,function(C){return a.localState.runResolvers({document:b,remoteResult:C,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 Bo(this.getObservableFromLink(a,n.context,n.variables),function(o){var s=Qo(o),u=s.length>0;if(i>=e.lastRequestId){if(u&&n.errorPolicy==="none")throw e.markError(new mr({graphQLErrors:s}));e.markResult(o,a,n,r),e.markReady()}var c={data:o.data,loading:!1,networkStatus:fe.ready};return u&&n.errorPolicy!=="ignore"&&(c.errors=s,c.networkStatus=fe.error),c},function(o){var s=Dd(o)?o:new mr({networkError:o});throw i>=e.lastRequestId&&e.markError(s),s})},t.prototype.fetchQueryObservable=function(e,r,n){var i=this;n===void 0&&(n=fe.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,f=d===void 0?u&&u.errorPolicy||"none":d,p=r.returnPartialData,h=p===void 0?!1:p,g=r.notifyOnNetworkStatusChange,b=g===void 0?!1:g,C=r.context,w=C===void 0?{}:C,_=Object.assign({},r,{query:a,variables:o,fetchPolicy:l,errorPolicy:f,returnPartialData:h,notifyOnNetworkStatusChange:b,context:w}),y=function(k){_.variables=k;var P=i.fetchQueryByPolicy(s,_,n);return _.fetchPolicy!=="standby"&&P.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",r),P},T=function(){return i.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,function(k){T(),setTimeout(function(){return R.cancel(k)})});var R=new fi(this.transform(_.query).hasClientExports?this.localState.addExportedVariables(_.query,_.variables,_.context).then(y):y(_.variables));return R.promise.then(T,T),R},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?fa("refetchQueries"):void 0:s,c=e.onQueryUpdated,l=new Map;i&&this.getObservableQueries(i).forEach(function(f,p){l.set(p,{oq:f,lastDiff:r.getQuery(p).getDiff()})});var d=new Map;return n&&this.cache.batch({update:n,optimistic:o&&u||!1,removeOptimistic:u,onWatchUpdated:function(f,p,h){var g=f.watcher instanceof us&&f.watcher.observableQuery;if(g){if(c){l.delete(g.queryId);var b=c(g,p,h);return b===!0&&(b=g.refetch()),b!==!1&&d.set(g,b),b}c!==null&&l.set(g.queryId,{oq:g,lastDiff:h,diff:p})}}}),l.size&&l.forEach(function(f,p){var h=f.oq,g=f.lastDiff,b=f.diff,C;if(c){if(!b){var w=h.queryInfo;w.reset(),b=w.getDiff()}C=c(h,b,g)}(!c||C===!0)&&(C=h.refetch()),C!==!1&&d.set(h,C),p.indexOf("legacyOneTimeQuery")>=0&&r.stopQueryNoBroadcast(p)}),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,f=r.notifyOnNetworkStatusChange,p=e.networkStatus;e.init({document:this.transform(a).document,variables:o,networkStatus:n});var h=function(){return e.getDiff(o)},g=function(y,T){T===void 0&&(T=e.networkStatus||fe.loading);var R=y.result;__DEV__&&!l&&!Ee(R,{})&&zu(y.missing);var k=function(P){return ne.of(S({data:P,loading:jr(T),networkStatus:T},y.complete?null:{partial:!0}))};return R&&i.transform(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:R},context:d,variables:o,onlyRunForcedResolvers:!0}).then(function(P){return k(P.data||void 0)}):c==="none"&&T===fe.refetch&&Array.isArray(y.missing)?k(void 0):k(R)},b=s==="no-cache"?0:n===fe.refetch&&u!=="merge"?1:2,C=function(){return i.getResultsFromLink(e,b,{variables:o,context:d,fetchPolicy:s,errorPolicy:c})},w=f&&typeof p=="number"&&p!==n&&jr(n);switch(s){default:case"cache-first":{var _=h();return _.complete?[g(_,e.markReady())]:l||w?[g(_),C()]:[C()]}case"cache-and-network":{var _=h();return _.complete||l||w?[g(_),C()]:[C()]}case"cache-only":return[g(h(),e.markReady())];case"network-only":return w?[g(h()),C()]:[C()];case"no-cache":return w?[g(e.getDiff()),C()]:[C()];case"standby":return[]}},t.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new us(this,e)),this.queries.get(e)},t.prototype.prepareContext=function(e){e===void 0&&(e={});var r=this.localState.prepareContext(e);return S(S({},r),{clientAwareness:this.clientAwareness})},t}();var Rd=!1;var ps=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,f=d===void 0?typeof window=="object"&&!window.__APOLLO_CLIENT__&&__DEV__:d,p=e.queryDeduplication,h=p===void 0?!0:p,g=e.defaultOptions,b=e.assumeImmutableResults,C=b===void 0?!1:b,w=e.resolvers,_=e.typeDefs,y=e.fragmentMatcher,T=e.name,R=e.version,k=e.link;if(k||(k=n?new wu({uri:n,credentials:i,headers:a}):$t.empty()),!o)throw __DEV__?new H(`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 H(9);if(this.link=k,this.cache=o,this.disableNetworkFetches=u||l>0,this.queryDeduplication=h,this.defaultOptions=g||Object.create(null),this.typeDefs=_,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),f&&typeof window=="object"&&(window.__APOLLO_CLIENT__=this),!Rd&&f&&__DEV__&&(Rd=!0,typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var P=window.navigator,M=P&&P.userAgent,$=void 0;typeof M=="string"&&(M.indexOf("Chrome/")>-1?$="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":M.indexOf("Firefox/")>-1&&($="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),$&&__DEV__&&N.log("Download the Apollo DevTools for a better development experience: "+$)}this.version=_f,this.localState=new cs({cache:o,client:this,resolvers:w,fragmentMatcher:y}),this.queryManager=new Pd({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:h,ssrMode:u,clientAwareness:{name:T,version:R},localState:this.localState,assumeImmutableResults:C,onBroadcast:f?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=da(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=S(S({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},t.prototype.query=function(e){return this.defaultOptions.query&&(e=da(this.defaultOptions.query,e)),__DEV__?N(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."):N(e.fetchPolicy!=="cache-and-network",10),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=S(S({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},t.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=da(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 hi(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__&&N.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}();zp(hn?"log":"silent");function ct(t){return t===null?"null":Array.isArray(t)?"array":typeof t}function gr(t){return ct(t)==="object"}function $d(t){return Array.isArray(t)&&t.length>0&&t.every(e=>"message"in e)}function Gu(t,e){return t.length<124?t:e}var Ld="graphql-transport-ws";var gt;(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"})(gt||(gt={}));var Pe;(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"})(Pe||(Pe={}));function Fd(t){if(!gr(t))throw new Error(`Message is expected to be an object, but got ${ct(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 ${ct(t.type)}`);switch(t.type){case Pe.ConnectionInit:case Pe.ConnectionAck:case Pe.Ping:case Pe.Pong:{if(t.payload!=null&&!gr(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 Pe.Subscribe:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${ct(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!gr(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${ct(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 ${ct(t.payload.query)}`);if(t.payload.variables!=null&&!gr(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 ${ct(t.payload.variables)}`);if(t.payload.operationName!=null&&ct(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 ${ct(t.payload.operationName)}`);if(t.payload.extensions!=null&&!gr(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 ${ct(t.payload.extensions)}`);break}case Pe.Next:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${ct(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!gr(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${ct(t.payload)}`);break}case Pe.Error:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${ct(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!$d(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 Pe.Complete:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${ct(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 Md(t,e){return Fd(typeof t=="string"?JSON.parse(t,e):t)}function wi(t,e){return Fd(t),JSON.stringify(t,e)}function Wu(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(_e){let we=1e3;for(let se=0;se<_e;se++)we*=2;await new Promise(se=>setTimeout(se,we+Math.floor(Math.random()*(3e3-300)+300)))},shouldRetry:d=fs,isFatalConnectionProblem:f,on:p,webSocketImpl:h,generateID:g=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,_e=>{let we=Math.random()*16|0;return(_e=="x"?we:we&3|8).toString(16)})},jsonMessageReplacer:b,jsonMessageReviver:C}=t,w;if(h){if(!cy(h))throw new Error("Invalid WebSocket implementation provided");w=h}else typeof WebSocket<"u"?w=WebSocket:typeof global<"u"?w=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(w=window.WebSocket||window.MozWebSocket);if(!w)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let _=w,y=(()=>{let Q=(()=>{let we={};return{on(se,ce){return we[se]=ce,()=>{delete we[se]}},emit(se){var ce;"id"in se&&((ce=we[se.id])===null||ce===void 0||ce.call(we,se))}}})(),_e={connecting:p?.connecting?[p.connecting]:[],opened:p?.opened?[p.opened]:[],connected:p?.connected?[p.connected]:[],ping:p?.ping?[p.ping]:[],pong:p?.pong?[p.pong]:[],message:p?.message?[Q.emit,p.message]:[Q.emit],closed:p?.closed?[p.closed]:[],error:p?.error?[p.error]:[]};return{onMessage:Q.on,on(we,se){let ce=_e[we];return ce.push(se),()=>{ce.splice(ce.indexOf(se),1)}},emit(we,...se){for(let ce of[..._e[we]])ce(...se)}}})();function T(Q){let _e=[y.on("error",we=>{_e.forEach(se=>se()),Q(we)}),y.on("closed",we=>{_e.forEach(se=>se()),Q(we)})]}let R,k=0,P,M=!1,$=0,V=!1;async function Je(){clearTimeout(P);let[Q,_e]=await(R??(R=new Promise((ce,Kt)=>(async()=>{if(M){if(await l($),!k)return R=void 0,Kt({code:1e3,reason:"All Subscriptions Gone"});$++}y.emit("connecting");let re=new _(typeof e=="function"?await e():e,Ld),Zt,Ar;function xo(){isFinite(o)&&o>0&&(clearTimeout(Ar),Ar=setTimeout(()=>{re.readyState===_.OPEN&&(re.send(wi({type:Pe.Ping})),y.emit("ping",!1,void 0))},o))}T(Ye=>{R=void 0,clearTimeout(Zt),clearTimeout(Ar),Kt(Ye),fs(Ye)&&Ye.code===4499&&(re.close(4499,"Terminated"),re.onerror=null,re.onclose=null)}),re.onerror=Ye=>y.emit("error",Ye),re.onclose=Ye=>y.emit("closed",Ye),re.onopen=async()=>{try{y.emit("opened",re);let Ye=typeof r=="function"?await r():r;if(re.readyState!==_.OPEN)return;re.send(wi(Ye?{type:Pe.ConnectionInit,payload:Ye}:{type:Pe.ConnectionInit},b)),isFinite(u)&&u>0&&(Zt=setTimeout(()=>{re.close(gt.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},u)),xo()}catch(Ye){y.emit("error",Ye),re.close(gt.InternalClientError,Gu(Ye instanceof Error?Ye.message:new Error(Ye).message,"Internal client error"))}};let ri=!1;re.onmessage=({data:Ye})=>{try{let Xe=Md(Ye,C);if(y.emit("message",Xe),Xe.type==="ping"||Xe.type==="pong"){y.emit(Xe.type,!0,Xe.payload),Xe.type==="pong"?xo():s||(re.send(wi(Xe.payload?{type:Pe.Pong,payload:Xe.payload}:{type:Pe.Pong})),y.emit("pong",!1,Xe.payload));return}if(ri)return;if(Xe.type!==Pe.ConnectionAck)throw new Error(`First message cannot be of type ${Xe.type}`);clearTimeout(Zt),ri=!0,y.emit("connected",re,Xe.payload),M=!1,$=0,ce([re,new Promise((R3,nm)=>T(nm))])}catch(Xe){re.onmessage=null,y.emit("error",Xe),re.close(gt.BadResponse,Gu(Xe instanceof Error?Xe.message:new Error(Xe).message,"Bad response"))}}})())));Q.readyState===_.CLOSING&&await _e;let we=()=>{},se=new Promise(ce=>we=ce);return[Q,we,Promise.race([se.then(()=>{if(!k){let ce=()=>Q.close(1e3,"Normal Closure");isFinite(a)&&a>0?P=setTimeout(()=>{Q.readyState===_.OPEN&&ce()},a):ce()}}),_e])]}function je(Q){if(fs(Q)&&(sy(Q.code)||[gt.InternalServerError,gt.InternalClientError,gt.BadRequest,gt.BadResponse,gt.Unauthorized,gt.SubprotocolNotAcceptable,gt.SubscriberAlreadyExists,gt.TooManyInitialisationRequests].includes(Q.code)))throw Q;if(V)return!1;if(fs(Q)&&Q.code===1e3)return k>0;if(!c||$>=c||!d(Q)||f?.(Q))throw Q;return M=!0}return n||(async()=>{for(k++;;)try{let[,,Q]=await Je();await Q}catch(Q){try{if(!je(Q))return}catch(_e){return i?.(_e)}}})(),{on:y.on,subscribe(Q,_e){let we=g(Q),se=!1,ce=!1,Kt=()=>{k--,se=!0};return(async()=>{for(k++;;)try{let[re,Zt,Ar]=await Je();if(se)return Zt();let xo=y.onMessage(we,ri=>{switch(ri.type){case Pe.Next:{_e.next(ri.payload);return}case Pe.Error:{ce=!0,se=!0,_e.error(ri.payload),Kt();return}case Pe.Complete:{se=!0,Kt();return}}});re.send(wi({id:we,type:Pe.Subscribe,payload:Q},b)),Kt=()=>{!se&&re.readyState===_.OPEN&&re.send(wi({id:we,type:Pe.Complete},b)),k--,se=!0,Zt()},await Ar.finally(xo);return}catch(re){if(!je(re))return}})().then(()=>{ce||_e.complete()}).catch(re=>{_e.error(re)}),()=>{se||Kt()}},async dispose(){if(V=!0,R){let[Q]=await R;Q.close(1e3,"Normal Closure")}},terminate(){R&&y.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}function fs(t){return gr(t)&&"code"in t&&"reason"in t}function sy(t){return[1e3,1001,1006,1005,1012,1013,1013].includes(t)?!1:t>=1e3&&t<=1999}function cy(t){return typeof t=="function"&&"constructor"in t&&"CLOSED"in t&&"CLOSING"in t&&"CONNECTING"in t&&"OPEN"in t}function uy(t){return ue(t)&&"code"in t&&"reason"in t}var Ku=function(t){De(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 ne(function(i){return n.client.subscribe(S(S({},r),{query:oi(r.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(a){return a instanceof Error?i.error(a):uy(a)?i.error(new Error("Socket closed with event ".concat(a.code," ").concat(a.reason||""))):i.error(new mr({graphQLErrors:Array.isArray(a)?a:[a]}))}})})},e}($t);var qs=function(){return qs=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},qs.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function ks(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ks=function(r){return typeof r}:ks=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ks(t)}function ly(t){return ks(t)=="object"&&t!==null}var e1=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function gl(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 py(t){return t1(t.source,gl(t.source,t.start))}function t1(t,e){var r=t.locationOffset.column-1,n=As(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
+ `),l=n.split(/\r\n|[\n\r]/g),d=l[i];if(d.length>120){for(var f=Math.floor(u/80),p=u%80,h=[],g=0;g<d.length;g+=80)h.push(d.slice(g,g+80));return c+Ud([["".concat(o),h[0]]].concat(h.slice(1,f+1).map(function(b){return["",b]}),[[" ",As(p-1)+"^"],["",h[f+1]]]))}return c+Ud([["".concat(o-1),l[i-1]],["".concat(o),d],["",As(u-1)+"^"],["".concat(o+1),l[i+1]]])}function Ud(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 fy(r,i)+(a?" | "+a:" |")}).join(`
55
+ `)}function As(t){return Array(t+1).join(" ")}function fy(t,e){return As(t-e.length)+e}function Is(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Is=function(r){return typeof r}:Is=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Is(t)}function jd(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 dy(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?jd(Object(r),!0).forEach(function(n){hy(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):jd(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function hy(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function my(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Bd(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 gy(t,e,r){return e&&Bd(t.prototype,e),r&&Bd(t,r),t}function yy(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&&Ja(t,e)}function vy(t){var e=n1();return function(){var n=Ya(t),i;if(e){var a=Ya(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return r1(this,i)}}function r1(t,e){return e&&(Is(e)==="object"||typeof e=="function")?e:ka(t)}function ka(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function yl(t){var e=typeof Map=="function"?new Map:void 0;return yl=function(n){if(n===null||!by(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 Ts(n,arguments,Ya(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Ja(i,n)},yl(t)}function Ts(t,e,r){return n1()?Ts=Reflect.construct:Ts=function(i,a,o){var s=[null];s.push.apply(s,a);var u=Function.bind.apply(i,s),c=new u;return o&&Ja(c,o.prototype),c},Ts.apply(null,arguments)}function n1(){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 by(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function Ja(t,e){return Ja=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Ja(t,e)}function Ya(t){return Ya=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Ya(t)}var _y=function(t){yy(r,t);var e=vy(r);function r(n,i,a,o,s,u,c){var l,d,f,p;my(this,r),p=e.call(this,n),p.name="GraphQLError",p.originalError=u??void 0,p.nodes=qd(Array.isArray(i)?i:i?[i]:void 0);for(var h=[],g=0,b=(C=p.nodes)!==null&&C!==void 0?C:[];g<b.length;g++){var C,w=b[g],_=w.loc;_!=null&&h.push(_)}h=qd(h),p.source=a??((l=h)===null||l===void 0?void 0:l[0].source),p.positions=o??((d=h)===null||d===void 0?void 0:d.map(function(T){return T.start})),p.locations=o&&a?o.map(function(T){return gl(a,T)}):(f=h)===null||f===void 0?void 0:f.map(function(T){return gl(T.source,T.start)}),p.path=s??void 0;var y=u?.extensions;return c==null&&ly(y)?p.extensions=dy({},y):p.extensions=c??{},Object.defineProperties(ka(p),{message:{enumerable:!0},locations:{enumerable:p.locations!=null},path:{enumerable:p.path!=null},extensions:{enumerable:p.extensions!=null&&Object.keys(p.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),u!=null&&u.stack?(Object.defineProperty(ka(p),"stack",{value:u.stack,writable:!0,configurable:!0}),r1(p)):(Error.captureStackTrace?Error.captureStackTrace(ka(p),r):Object.defineProperty(ka(p),"stack",{value:Error().stack,writable:!0,configurable:!0}),p)}return gy(r,[{key:"toString",value:function(){return wy(this)}},{key:e1,get:function(){return"Object"}}]),r}(yl(Error));function qd(t){return t===void 0||t.length===0?void 0:t}function wy(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
 
57
- `+oy(i.loc))}else if(t.source&&t.locations)for(var a=0,o=t.locations;a<o.length;a++){var s=o[a];e+=`
57
+ `+py(i.loc))}else if(t.source&&t.locations)for(var a=0,o=t.locations;a<o.length;a++){var s=o[a];e+=`
58
58
 
59
- `+Jh(t.source,s)}return e}function kt(t,e,r){return new my("Syntax Error: ".concat(r),void 0,t,[e])}var B=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 yy(t,e){var r=Boolean(t);if(!r)throw new Error(e??"Unexpected invariant triggered.")}var vy=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,hl=vy;function e1(t){var e=t.prototype.toJSON;typeof e=="function"||yy(0),t.prototype.inspect=e,hl&&(t.prototype[hl]=e)}var t1=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}();e1(t1);var Re=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}();e1(Re);var A=Object.freeze({SOF:"<SOF>",EOF:"<EOF>",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"});function xs(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?xs=function(r){return typeof r}:xs=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},xs(t)}var by=10,r1=2;function _y(t){return sc(t,[])}function sc(t,e){switch(xs(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return t===null?"null":wy(t,e);default:return String(t)}}function wy(t,e){if(e.indexOf(t)!==-1)return"[Circular]";var r=[].concat(e,[t]),n=xy(t);if(n!==void 0){var i=n.call(t);if(i!==t)return typeof i=="string"?i:sc(i,r)}else if(Array.isArray(t))return Cy(t,r);return Sy(t,r)}function Sy(t,e){var r=Object.keys(t);if(r.length===0)return"{}";if(e.length>r1)return"["+Ey(t)+"]";var n=r.map(function(i){var a=sc(t[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function Cy(t,e){if(t.length===0)return"[]";if(e.length>r1)return"[Array]";for(var r=Math.min(by,t.length),n=t.length-r,i=[],a=0;a<r;++a)i.push(sc(t[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function xy(t){var e=t[String(hl)];if(typeof e=="function")return e;if(typeof t.inspect=="function")return t.inspect}function Ey(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 Gu(t,e){var r=Boolean(t);if(!r)throw new Error(e)}var ky=function(e,r){return e instanceof r};function Ud(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 Iy(t,e,r){return e&&Ud(t.prototype,e),r&&Ud(t,r),t}var n1=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"||Gu(0,"Body must be a string. Received: ".concat(_y(e),".")),this.body=e,this.name=r,this.locationOffset=n,this.locationOffset.line>0||Gu(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Gu(0,"column in locationOffset is 1-indexed and must be positive.")}return Iy(t,[{key:Zh,get:function(){return"Source"}}]),t}();function Ay(t){return ky(t,n1)}var Ty=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});function Oy(t){var e=t.split(/\r\n|[\n\r]/g),r=Dy(t);if(r!==0)for(var n=1;n<e.length;n++)e[n]=e[n].slice(r);for(var i=0;i<e.length&&jd(e[i]);)++i;for(var a=e.length;a>i&&jd(e[a-1]);)--a;return e.slice(i,a).join(`
60
- `)}function jd(t){for(var e=0;e<t.length;++e)if(t[e]!==" "&&t[e]!==" ")return!1;return!0}function Dy(t){for(var e,r=!0,n=!0,i=0,a=null,o=0;o<t.length;++o)switch(t.charCodeAt(o)){case 13:t.charCodeAt(o+1)===10&&++o;case 10:r=!1,n=!0,i=0;break;case 9:case 32:++i;break;default:n&&!r&&(a===null||i<a)&&(a=i),n=!1}return(e=a)!==null&&e!==void 0?e:0}var Ny=function(){function t(r){var n=new Re(A.SOF,0,0,0,0,null);this.source=r,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}var e=t.prototype;return e.advance=function(){this.lastToken=this.token;var n=this.token=this.lookahead();return n},e.lookahead=function(){var n=this.token;if(n.kind!==A.EOF)do{var i;n=(i=n.next)!==null&&i!==void 0?i:n.next=Ry(this,n)}while(n.kind===A.COMMENT);return n},t}();function Py(t){return t===A.BANG||t===A.DOLLAR||t===A.AMP||t===A.PAREN_L||t===A.PAREN_R||t===A.SPREAD||t===A.COLON||t===A.EQUALS||t===A.AT||t===A.BRACKET_L||t===A.BRACKET_R||t===A.BRACE_L||t===A.PIPE||t===A.BRACE_R}function Mn(t){return isNaN(t)?A.EOF:t<127?JSON.stringify(String.fromCharCode(t)):'"\\u'.concat(("00"+t.toString(16).toUpperCase()).slice(-4),'"')}function Ry(t,e){for(var r=t.source,n=r.body,i=n.length,a=e.end;a<i;){var o=n.charCodeAt(a),s=t.line,u=1+a-t.lineStart;switch(o){case 65279:case 9:case 32:case 44:++a;continue;case 10:++a,++t.line,t.lineStart=a;continue;case 13:n.charCodeAt(a+1)===10?a+=2:++a,++t.line,t.lineStart=a;continue;case 33:return new Re(A.BANG,a,a+1,s,u,e);case 35:return Ly(r,a,s,u,e);case 36:return new Re(A.DOLLAR,a,a+1,s,u,e);case 38:return new Re(A.AMP,a,a+1,s,u,e);case 40:return new Re(A.PAREN_L,a,a+1,s,u,e);case 41:return new Re(A.PAREN_R,a,a+1,s,u,e);case 46:if(n.charCodeAt(a+1)===46&&n.charCodeAt(a+2)===46)return new Re(A.SPREAD,a,a+3,s,u,e);break;case 58:return new Re(A.COLON,a,a+1,s,u,e);case 61:return new Re(A.EQUALS,a,a+1,s,u,e);case 64:return new Re(A.AT,a,a+1,s,u,e);case 91:return new Re(A.BRACKET_L,a,a+1,s,u,e);case 93:return new Re(A.BRACKET_R,a,a+1,s,u,e);case 123:return new Re(A.BRACE_L,a,a+1,s,u,e);case 124:return new Re(A.PIPE,a,a+1,s,u,e);case 125:return new Re(A.BRACE_R,a,a+1,s,u,e);case 34:return n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34?Uy(r,a,s,u,e,t):My(r,a,s,u,e);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return Fy(r,a,o,s,u,e);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return By(r,a,s,u,e)}throw kt(r,a,$y(o))}var c=t.line,l=1+a-t.lineStart;return new Re(A.EOF,i,i,c,l,e)}function $y(t){return t<32&&t!==9&&t!==10&&t!==13?"Cannot contain the invalid character ".concat(Mn(t),"."):t===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:"Cannot parse the unexpected character ".concat(Mn(t),".")}function Ly(t,e,r,n,i){var a=t.body,o,s=e;do o=a.charCodeAt(++s);while(!isNaN(o)&&(o>31||o===9));return new Re(A.COMMENT,e,s,r,n,i,a.slice(e+1,s))}function Fy(t,e,r,n,i,a){var o=t.body,s=r,u=e,c=!1;if(s===45&&(s=o.charCodeAt(++u)),s===48){if(s=o.charCodeAt(++u),s>=48&&s<=57)throw kt(t,u,"Invalid number, unexpected digit after 0: ".concat(Mn(s),"."))}else u=Hu(t,u,s),s=o.charCodeAt(u);if(s===46&&(c=!0,s=o.charCodeAt(++u),u=Hu(t,u,s),s=o.charCodeAt(u)),(s===69||s===101)&&(c=!0,s=o.charCodeAt(++u),(s===43||s===45)&&(s=o.charCodeAt(++u)),u=Hu(t,u,s),s=o.charCodeAt(u)),s===46||qy(s))throw kt(t,u,"Invalid number, expected digit but got: ".concat(Mn(s),"."));return new Re(c?A.FLOAT:A.INT,e,u,n,i,a,o.slice(e,u))}function Hu(t,e,r){var n=t.body,i=e,a=r;if(a>=48&&a<=57){do a=n.charCodeAt(++i);while(a>=48&&a<=57);return i}throw kt(t,i,"Invalid number, expected digit but got: ".concat(Mn(a),"."))}function My(t,e,r,n,i){for(var a=t.body,o=e+1,s=o,u=0,c="";o<a.length&&!isNaN(u=a.charCodeAt(o))&&u!==10&&u!==13;){if(u===34)return c+=a.slice(s,o),new Re(A.STRING,e,o+1,r,n,i,c);if(u<32&&u!==9)throw kt(t,o,"Invalid character within String: ".concat(Mn(u),"."));if(++o,u===92){switch(c+=a.slice(s,o-1),u=a.charCodeAt(o),u){case 34:c+='"';break;case 47:c+="/";break;case 92:c+="\\";break;case 98:c+="\b";break;case 102:c+="\f";break;case 110:c+=`
61
- `;break;case 114:c+="\r";break;case 116:c+=" ";break;case 117:{var l=jy(a.charCodeAt(o+1),a.charCodeAt(o+2),a.charCodeAt(o+3),a.charCodeAt(o+4));if(l<0){var d=a.slice(o+1,o+5);throw kt(t,o,"Invalid character escape sequence: \\u".concat(d,"."))}c+=String.fromCharCode(l),o+=4;break}default:throw kt(t,o,"Invalid character escape sequence: \\".concat(String.fromCharCode(u),"."))}++o,s=o}}throw kt(t,o,"Unterminated string.")}function Uy(t,e,r,n,i,a){for(var o=t.body,s=e+3,u=s,c=0,l="";s<o.length&&!isNaN(c=o.charCodeAt(s));){if(c===34&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34)return l+=o.slice(u,s),new Re(A.BLOCK_STRING,e,s+3,r,n,i,Oy(l));if(c<32&&c!==9&&c!==10&&c!==13)throw kt(t,s,"Invalid character within String: ".concat(Mn(c),"."));c===10?(++s,++a.line,a.lineStart=s):c===13?(o.charCodeAt(s+1)===10?s+=2:++s,++a.line,a.lineStart=s):c===92&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34&&o.charCodeAt(s+3)===34?(l+=o.slice(u,s)+'"""',s+=4,u=s):++s}throw kt(t,s,"Unterminated string.")}function jy(t,e,r,n){return ss(t)<<12|ss(e)<<8|ss(r)<<4|ss(n)}function ss(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function By(t,e,r,n,i){for(var a=t.body,o=a.length,s=e+1,u=0;s!==o&&!isNaN(u=a.charCodeAt(s))&&(u===95||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new Re(A.NAME,e,s,r,n,i,a.slice(e,s))}function qy(t){return t===95||t>=65&&t<=90||t>=97&&t<=122}function Vy(t,e){var r=new Qy(t,e);return r.parseDocument()}var Qy=function(){function t(r,n){var i=Ay(r)?r:new n1(r);this._lexer=new Ny(i),this._options=n}var e=t.prototype;return e.parseName=function(){var n=this.expectToken(A.NAME);return{kind:B.NAME,value:n.value,loc:this.loc(n)}},e.parseDocument=function(){var n=this._lexer.token;return{kind:B.DOCUMENT,definitions:this.many(A.SOF,this.parseDefinition,A.EOF),loc:this.loc(n)}},e.parseDefinition=function(){if(this.peek(A.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(A.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},e.parseOperationDefinition=function(){var n=this._lexer.token;if(this.peek(A.BRACE_L))return{kind:B.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(n)};var i=this.parseOperationType(),a;return this.peek(A.NAME)&&(a=this.parseName()),{kind:B.OPERATION_DEFINITION,operation:i,name:a,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},e.parseOperationType=function(){var n=this.expectToken(A.NAME);switch(n.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(n)},e.parseVariableDefinitions=function(){return this.optionalMany(A.PAREN_L,this.parseVariableDefinition,A.PAREN_R)},e.parseVariableDefinition=function(){var n=this._lexer.token;return{kind:B.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(A.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(A.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(n)}},e.parseVariable=function(){var n=this._lexer.token;return this.expectToken(A.DOLLAR),{kind:B.VARIABLE,name:this.parseName(),loc:this.loc(n)}},e.parseSelectionSet=function(){var n=this._lexer.token;return{kind:B.SELECTION_SET,selections:this.many(A.BRACE_L,this.parseSelection,A.BRACE_R),loc:this.loc(n)}},e.parseSelection=function(){return this.peek(A.SPREAD)?this.parseFragment():this.parseField()},e.parseField=function(){var n=this._lexer.token,i=this.parseName(),a,o;return this.expectOptionalToken(A.COLON)?(a=i,o=this.parseName()):o=i,{kind:B.FIELD,alias:a,name:o,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(A.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},e.parseArguments=function(n){var i=n?this.parseConstArgument:this.parseArgument;return this.optionalMany(A.PAREN_L,i,A.PAREN_R)},e.parseArgument=function(){var n=this._lexer.token,i=this.parseName();return this.expectToken(A.COLON),{kind:B.ARGUMENT,name:i,value:this.parseValueLiteral(!1),loc:this.loc(n)}},e.parseConstArgument=function(){var n=this._lexer.token;return{kind:B.ARGUMENT,name:this.parseName(),value:(this.expectToken(A.COLON),this.parseValueLiteral(!0)),loc:this.loc(n)}},e.parseFragment=function(){var n=this._lexer.token;this.expectToken(A.SPREAD);var i=this.expectOptionalKeyword("on");return!i&&this.peek(A.NAME)?{kind:B.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(n)}:{kind:B.INLINE_FRAGMENT,typeCondition:i?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},e.parseFragmentDefinition=function(){var n,i=this._lexer.token;return this.expectKeyword("fragment"),((n=this._options)===null||n===void 0?void 0:n.experimentalFragmentVariables)===!0?{kind:B.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}:{kind:B.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}},e.parseFragmentName=function(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()},e.parseValueLiteral=function(n){var i=this._lexer.token;switch(i.kind){case A.BRACKET_L:return this.parseList(n);case A.BRACE_L:return this.parseObject(n);case A.INT:return this._lexer.advance(),{kind:B.INT,value:i.value,loc:this.loc(i)};case A.FLOAT:return this._lexer.advance(),{kind:B.FLOAT,value:i.value,loc:this.loc(i)};case A.STRING:case A.BLOCK_STRING:return this.parseStringLiteral();case A.NAME:switch(this._lexer.advance(),i.value){case"true":return{kind:B.BOOLEAN,value:!0,loc:this.loc(i)};case"false":return{kind:B.BOOLEAN,value:!1,loc:this.loc(i)};case"null":return{kind:B.NULL,loc:this.loc(i)};default:return{kind:B.ENUM,value:i.value,loc:this.loc(i)}}case A.DOLLAR:if(!n)return this.parseVariable();break}throw this.unexpected()},e.parseStringLiteral=function(){var n=this._lexer.token;return this._lexer.advance(),{kind:B.STRING,value:n.value,block:n.kind===A.BLOCK_STRING,loc:this.loc(n)}},e.parseList=function(n){var i=this,a=this._lexer.token,o=function(){return i.parseValueLiteral(n)};return{kind:B.LIST,values:this.any(A.BRACKET_L,o,A.BRACKET_R),loc:this.loc(a)}},e.parseObject=function(n){var i=this,a=this._lexer.token,o=function(){return i.parseObjectField(n)};return{kind:B.OBJECT,fields:this.any(A.BRACE_L,o,A.BRACE_R),loc:this.loc(a)}},e.parseObjectField=function(n){var i=this._lexer.token,a=this.parseName();return this.expectToken(A.COLON),{kind:B.OBJECT_FIELD,name:a,value:this.parseValueLiteral(n),loc:this.loc(i)}},e.parseDirectives=function(n){for(var i=[];this.peek(A.AT);)i.push(this.parseDirective(n));return i},e.parseDirective=function(n){var i=this._lexer.token;return this.expectToken(A.AT),{kind:B.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(n),loc:this.loc(i)}},e.parseTypeReference=function(){var n=this._lexer.token,i;return this.expectOptionalToken(A.BRACKET_L)?(i=this.parseTypeReference(),this.expectToken(A.BRACKET_R),i={kind:B.LIST_TYPE,type:i,loc:this.loc(n)}):i=this.parseNamedType(),this.expectOptionalToken(A.BANG)?{kind:B.NON_NULL_TYPE,type:i,loc:this.loc(n)}:i},e.parseNamedType=function(){var n=this._lexer.token;return{kind:B.NAMED_TYPE,name:this.parseName(),loc:this.loc(n)}},e.parseTypeSystemDefinition=function(){var n=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(n.kind===A.NAME)switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(n)},e.peekDescription=function(){return this.peek(A.STRING)||this.peek(A.BLOCK_STRING)},e.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},e.parseSchemaDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("schema");var a=this.parseDirectives(!0),o=this.many(A.BRACE_L,this.parseOperationTypeDefinition,A.BRACE_R);return{kind:B.SCHEMA_DEFINITION,description:i,directives:a,operationTypes:o,loc:this.loc(n)}},e.parseOperationTypeDefinition=function(){var n=this._lexer.token,i=this.parseOperationType();this.expectToken(A.COLON);var a=this.parseNamedType();return{kind:B.OPERATION_TYPE_DEFINITION,operation:i,type:a,loc:this.loc(n)}},e.parseScalarTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("scalar");var a=this.parseName(),o=this.parseDirectives(!0);return{kind:B.SCALAR_TYPE_DEFINITION,description:i,name:a,directives:o,loc:this.loc(n)}},e.parseObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("type");var a=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:B.OBJECT_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:u,loc:this.loc(n)}},e.parseImplementsInterfaces=function(){var n;if(!this.expectOptionalKeyword("implements"))return[];if(((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLImplementsInterfaces)===!0){var i=[];this.expectOptionalToken(A.AMP);do i.push(this.parseNamedType());while(this.expectOptionalToken(A.AMP)||this.peek(A.NAME));return i}return this.delimitedMany(A.AMP,this.parseNamedType)},e.parseFieldsDefinition=function(){var n;return((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLEmptyFields)===!0&&this.peek(A.BRACE_L)&&this._lexer.lookahead().kind===A.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(A.BRACE_L,this.parseFieldDefinition,A.BRACE_R)},e.parseFieldDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseArgumentDefs();this.expectToken(A.COLON);var s=this.parseTypeReference(),u=this.parseDirectives(!0);return{kind:B.FIELD_DEFINITION,description:i,name:a,arguments:o,type:s,directives:u,loc:this.loc(n)}},e.parseArgumentDefs=function(){return this.optionalMany(A.PAREN_L,this.parseInputValueDef,A.PAREN_R)},e.parseInputValueDef=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName();this.expectToken(A.COLON);var o=this.parseTypeReference(),s;this.expectOptionalToken(A.EQUALS)&&(s=this.parseValueLiteral(!0));var u=this.parseDirectives(!0);return{kind:B.INPUT_VALUE_DEFINITION,description:i,name:a,type:o,defaultValue:s,directives:u,loc:this.loc(n)}},e.parseInterfaceTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("interface");var a=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:B.INTERFACE_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:u,loc:this.loc(n)}},e.parseUnionTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("union");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseUnionMemberTypes();return{kind:B.UNION_TYPE_DEFINITION,description:i,name:a,directives:o,types:s,loc:this.loc(n)}},e.parseUnionMemberTypes=function(){return this.expectOptionalToken(A.EQUALS)?this.delimitedMany(A.PIPE,this.parseNamedType):[]},e.parseEnumTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("enum");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseEnumValuesDefinition();return{kind:B.ENUM_TYPE_DEFINITION,description:i,name:a,directives:o,values:s,loc:this.loc(n)}},e.parseEnumValuesDefinition=function(){return this.optionalMany(A.BRACE_L,this.parseEnumValueDefinition,A.BRACE_R)},e.parseEnumValueDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseDirectives(!0);return{kind:B.ENUM_VALUE_DEFINITION,description:i,name:a,directives:o,loc:this.loc(n)}},e.parseInputObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("input");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseInputFieldsDefinition();return{kind:B.INPUT_OBJECT_TYPE_DEFINITION,description:i,name:a,directives:o,fields:s,loc:this.loc(n)}},e.parseInputFieldsDefinition=function(){return this.optionalMany(A.BRACE_L,this.parseInputValueDef,A.BRACE_R)},e.parseTypeSystemExtension=function(){var n=this._lexer.lookahead();if(n.kind===A.NAME)switch(n.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(n)},e.parseSchemaExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var i=this.parseDirectives(!0),a=this.optionalMany(A.BRACE_L,this.parseOperationTypeDefinition,A.BRACE_R);if(i.length===0&&a.length===0)throw this.unexpected();return{kind:B.SCHEMA_EXTENSION,directives:i,operationTypes:a,loc:this.loc(n)}},e.parseScalarTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var i=this.parseName(),a=this.parseDirectives(!0);if(a.length===0)throw this.unexpected();return{kind:B.SCALAR_TYPE_EXTENSION,name:i,directives:a,loc:this.loc(n)}},e.parseObjectTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var i=this.parseName(),a=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),s=this.parseFieldsDefinition();if(a.length===0&&o.length===0&&s.length===0)throw this.unexpected();return{kind:B.OBJECT_TYPE_EXTENSION,name:i,interfaces:a,directives:o,fields:s,loc:this.loc(n)}},e.parseInterfaceTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var i=this.parseName(),a=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),s=this.parseFieldsDefinition();if(a.length===0&&o.length===0&&s.length===0)throw this.unexpected();return{kind:B.INTERFACE_TYPE_EXTENSION,name:i,interfaces:a,directives:o,fields:s,loc:this.loc(n)}},e.parseUnionTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseUnionMemberTypes();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:B.UNION_TYPE_EXTENSION,name:i,directives:a,types:o,loc:this.loc(n)}},e.parseEnumTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseEnumValuesDefinition();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:B.ENUM_TYPE_EXTENSION,name:i,directives:a,values:o,loc:this.loc(n)}},e.parseInputObjectTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseInputFieldsDefinition();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:B.INPUT_OBJECT_TYPE_EXTENSION,name:i,directives:a,fields:o,loc:this.loc(n)}},e.parseDirectiveDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("directive"),this.expectToken(A.AT);var a=this.parseName(),o=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var u=this.parseDirectiveLocations();return{kind:B.DIRECTIVE_DEFINITION,description:i,name:a,arguments:o,repeatable:s,locations:u,loc:this.loc(n)}},e.parseDirectiveLocations=function(){return this.delimitedMany(A.PIPE,this.parseDirectiveLocation)},e.parseDirectiveLocation=function(){var n=this._lexer.token,i=this.parseName();if(Ty[i.value]!==void 0)return i;throw this.unexpected(n)},e.loc=function(n){var i;if(((i=this._options)===null||i===void 0?void 0:i.noLocation)!==!0)return new t1(n,this._lexer.lastToken,this._lexer.source)},e.peek=function(n){return this._lexer.token.kind===n},e.expectToken=function(n){var i=this._lexer.token;if(i.kind===n)return this._lexer.advance(),i;throw kt(this._lexer.source,i.start,"Expected ".concat(i1(n),", found ").concat(Wu(i),"."))},e.expectOptionalToken=function(n){var i=this._lexer.token;if(i.kind===n)return this._lexer.advance(),i},e.expectKeyword=function(n){var i=this._lexer.token;if(i.kind===A.NAME&&i.value===n)this._lexer.advance();else throw kt(this._lexer.source,i.start,'Expected "'.concat(n,'", found ').concat(Wu(i),"."))},e.expectOptionalKeyword=function(n){var i=this._lexer.token;return i.kind===A.NAME&&i.value===n?(this._lexer.advance(),!0):!1},e.unexpected=function(n){var i=n??this._lexer.token;return kt(this._lexer.source,i.start,"Unexpected ".concat(Wu(i),"."))},e.any=function(n,i,a){this.expectToken(n);for(var o=[];!this.expectOptionalToken(a);)o.push(i.call(this));return o},e.optionalMany=function(n,i,a){if(this.expectOptionalToken(n)){var o=[];do o.push(i.call(this));while(!this.expectOptionalToken(a));return o}return[]},e.many=function(n,i,a){this.expectToken(n);var o=[];do o.push(i.call(this));while(!this.expectOptionalToken(a));return o},e.delimitedMany=function(n,i){this.expectOptionalToken(n);var a=[];do a.push(i.call(this));while(this.expectOptionalToken(n));return a},t}();function Wu(t){var e=t.value;return i1(t.kind)+(e!=null?' "'.concat(e,'"'):"")}function i1(t){return Py(t)?'"'.concat(t,'"'):t}var Es=new Map,ml=new Map,a1=!0,Ms=!1;function o1(t){return t.replace(/[\s,]+/g," ").trim()}function zy(t){return o1(t.source.body.substring(t.start,t.end))}function Gy(t){var e=new Set,r=[];return t.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,a=zy(n.loc),o=ml.get(i);o&&!o.has(a)?a1&&console.warn("Warning: fragment with name "+i+` already exists.
59
+ `+t1(t.source,s)}return e}function kt(t,e,r){return new _y("Syntax Error: ".concat(r),void 0,t,[e])}var q=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 Sy(t,e){var r=Boolean(t);if(!r)throw new Error(e??"Unexpected invariant triggered.")}var Cy=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,vl=Cy;function i1(t){var e=t.prototype.toJSON;typeof e=="function"||Sy(0),t.prototype.inspect=e,vl&&(t.prototype[vl]=e)}var a1=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}();i1(a1);var $e=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}();i1($e);var I=Object.freeze({SOF:"<SOF>",EOF:"<EOF>",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"});function Os(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Os=function(r){return typeof r}:Os=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Os(t)}var xy=10,o1=2;function Ey(t){return pc(t,[])}function pc(t,e){switch(Os(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return t===null?"null":ky(t,e);default:return String(t)}}function ky(t,e){if(e.indexOf(t)!==-1)return"[Circular]";var r=[].concat(e,[t]),n=Ty(t);if(n!==void 0){var i=n.call(t);if(i!==t)return typeof i=="string"?i:pc(i,r)}else if(Array.isArray(t))return Iy(t,r);return Ay(t,r)}function Ay(t,e){var r=Object.keys(t);if(r.length===0)return"{}";if(e.length>o1)return"["+Oy(t)+"]";var n=r.map(function(i){var a=pc(t[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function Iy(t,e){if(t.length===0)return"[]";if(e.length>o1)return"[Array]";for(var r=Math.min(xy,t.length),n=t.length-r,i=[],a=0;a<r;++a)i.push(pc(t[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function Ty(t){var e=t[String(vl)];if(typeof e=="function")return e;if(typeof t.inspect=="function")return t.inspect}function Oy(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 Zu(t,e){var r=Boolean(t);if(!r)throw new Error(e)}var Dy=function(e,r){return e instanceof r};function Vd(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 Ny(t,e,r){return e&&Vd(t.prototype,e),r&&Vd(t,r),t}var s1=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"||Zu(0,"Body must be a string. Received: ".concat(Ey(e),".")),this.body=e,this.name=r,this.locationOffset=n,this.locationOffset.line>0||Zu(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Zu(0,"column in locationOffset is 1-indexed and must be positive.")}return Ny(t,[{key:e1,get:function(){return"Source"}}]),t}();function Py(t){return Dy(t,s1)}var Ry=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});function $y(t){var e=t.split(/\r\n|[\n\r]/g),r=Ly(t);if(r!==0)for(var n=1;n<e.length;n++)e[n]=e[n].slice(r);for(var i=0;i<e.length&&Qd(e[i]);)++i;for(var a=e.length;a>i&&Qd(e[a-1]);)--a;return e.slice(i,a).join(`
60
+ `)}function Qd(t){for(var e=0;e<t.length;++e)if(t[e]!==" "&&t[e]!==" ")return!1;return!0}function Ly(t){for(var e,r=!0,n=!0,i=0,a=null,o=0;o<t.length;++o)switch(t.charCodeAt(o)){case 13:t.charCodeAt(o+1)===10&&++o;case 10:r=!1,n=!0,i=0;break;case 9:case 32:++i;break;default:n&&!r&&(a===null||i<a)&&(a=i),n=!1}return(e=a)!==null&&e!==void 0?e:0}var Fy=function(){function t(r){var n=new $e(I.SOF,0,0,0,0,null);this.source=r,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}var e=t.prototype;return e.advance=function(){this.lastToken=this.token;var n=this.token=this.lookahead();return n},e.lookahead=function(){var n=this.token;if(n.kind!==I.EOF)do{var i;n=(i=n.next)!==null&&i!==void 0?i:n.next=Uy(this,n)}while(n.kind===I.COMMENT);return n},t}();function My(t){return t===I.BANG||t===I.DOLLAR||t===I.AMP||t===I.PAREN_L||t===I.PAREN_R||t===I.SPREAD||t===I.COLON||t===I.EQUALS||t===I.AT||t===I.BRACKET_L||t===I.BRACKET_R||t===I.BRACE_L||t===I.PIPE||t===I.BRACE_R}function Mn(t){return isNaN(t)?I.EOF:t<127?JSON.stringify(String.fromCharCode(t)):'"\\u'.concat(("00"+t.toString(16).toUpperCase()).slice(-4),'"')}function Uy(t,e){for(var r=t.source,n=r.body,i=n.length,a=e.end;a<i;){var o=n.charCodeAt(a),s=t.line,u=1+a-t.lineStart;switch(o){case 65279:case 9:case 32:case 44:++a;continue;case 10:++a,++t.line,t.lineStart=a;continue;case 13:n.charCodeAt(a+1)===10?a+=2:++a,++t.line,t.lineStart=a;continue;case 33:return new $e(I.BANG,a,a+1,s,u,e);case 35:return By(r,a,s,u,e);case 36:return new $e(I.DOLLAR,a,a+1,s,u,e);case 38:return new $e(I.AMP,a,a+1,s,u,e);case 40:return new $e(I.PAREN_L,a,a+1,s,u,e);case 41:return new $e(I.PAREN_R,a,a+1,s,u,e);case 46:if(n.charCodeAt(a+1)===46&&n.charCodeAt(a+2)===46)return new $e(I.SPREAD,a,a+3,s,u,e);break;case 58:return new $e(I.COLON,a,a+1,s,u,e);case 61:return new $e(I.EQUALS,a,a+1,s,u,e);case 64:return new $e(I.AT,a,a+1,s,u,e);case 91:return new $e(I.BRACKET_L,a,a+1,s,u,e);case 93:return new $e(I.BRACKET_R,a,a+1,s,u,e);case 123:return new $e(I.BRACE_L,a,a+1,s,u,e);case 124:return new $e(I.PIPE,a,a+1,s,u,e);case 125:return new $e(I.BRACE_R,a,a+1,s,u,e);case 34:return n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34?Qy(r,a,s,u,e,t):Vy(r,a,s,u,e);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return qy(r,a,o,s,u,e);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return Hy(r,a,s,u,e)}throw kt(r,a,jy(o))}var c=t.line,l=1+a-t.lineStart;return new $e(I.EOF,i,i,c,l,e)}function jy(t){return t<32&&t!==9&&t!==10&&t!==13?"Cannot contain the invalid character ".concat(Mn(t),"."):t===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:"Cannot parse the unexpected character ".concat(Mn(t),".")}function By(t,e,r,n,i){var a=t.body,o,s=e;do o=a.charCodeAt(++s);while(!isNaN(o)&&(o>31||o===9));return new $e(I.COMMENT,e,s,r,n,i,a.slice(e+1,s))}function qy(t,e,r,n,i,a){var o=t.body,s=r,u=e,c=!1;if(s===45&&(s=o.charCodeAt(++u)),s===48){if(s=o.charCodeAt(++u),s>=48&&s<=57)throw kt(t,u,"Invalid number, unexpected digit after 0: ".concat(Mn(s),"."))}else u=Ju(t,u,s),s=o.charCodeAt(u);if(s===46&&(c=!0,s=o.charCodeAt(++u),u=Ju(t,u,s),s=o.charCodeAt(u)),(s===69||s===101)&&(c=!0,s=o.charCodeAt(++u),(s===43||s===45)&&(s=o.charCodeAt(++u)),u=Ju(t,u,s),s=o.charCodeAt(u)),s===46||Gy(s))throw kt(t,u,"Invalid number, expected digit but got: ".concat(Mn(s),"."));return new $e(c?I.FLOAT:I.INT,e,u,n,i,a,o.slice(e,u))}function Ju(t,e,r){var n=t.body,i=e,a=r;if(a>=48&&a<=57){do a=n.charCodeAt(++i);while(a>=48&&a<=57);return i}throw kt(t,i,"Invalid number, expected digit but got: ".concat(Mn(a),"."))}function Vy(t,e,r,n,i){for(var a=t.body,o=e+1,s=o,u=0,c="";o<a.length&&!isNaN(u=a.charCodeAt(o))&&u!==10&&u!==13;){if(u===34)return c+=a.slice(s,o),new $e(I.STRING,e,o+1,r,n,i,c);if(u<32&&u!==9)throw kt(t,o,"Invalid character within String: ".concat(Mn(u),"."));if(++o,u===92){switch(c+=a.slice(s,o-1),u=a.charCodeAt(o),u){case 34:c+='"';break;case 47:c+="/";break;case 92:c+="\\";break;case 98:c+="\b";break;case 102:c+="\f";break;case 110:c+=`
61
+ `;break;case 114:c+="\r";break;case 116:c+=" ";break;case 117:{var l=zy(a.charCodeAt(o+1),a.charCodeAt(o+2),a.charCodeAt(o+3),a.charCodeAt(o+4));if(l<0){var d=a.slice(o+1,o+5);throw kt(t,o,"Invalid character escape sequence: \\u".concat(d,"."))}c+=String.fromCharCode(l),o+=4;break}default:throw kt(t,o,"Invalid character escape sequence: \\".concat(String.fromCharCode(u),"."))}++o,s=o}}throw kt(t,o,"Unterminated string.")}function Qy(t,e,r,n,i,a){for(var o=t.body,s=e+3,u=s,c=0,l="";s<o.length&&!isNaN(c=o.charCodeAt(s));){if(c===34&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34)return l+=o.slice(u,s),new $e(I.BLOCK_STRING,e,s+3,r,n,i,$y(l));if(c<32&&c!==9&&c!==10&&c!==13)throw kt(t,s,"Invalid character within String: ".concat(Mn(c),"."));c===10?(++s,++a.line,a.lineStart=s):c===13?(o.charCodeAt(s+1)===10?s+=2:++s,++a.line,a.lineStart=s):c===92&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34&&o.charCodeAt(s+3)===34?(l+=o.slice(u,s)+'"""',s+=4,u=s):++s}throw kt(t,s,"Unterminated string.")}function zy(t,e,r,n){return ds(t)<<12|ds(e)<<8|ds(r)<<4|ds(n)}function ds(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function Hy(t,e,r,n,i){for(var a=t.body,o=a.length,s=e+1,u=0;s!==o&&!isNaN(u=a.charCodeAt(s))&&(u===95||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new $e(I.NAME,e,s,r,n,i,a.slice(e,s))}function Gy(t){return t===95||t>=65&&t<=90||t>=97&&t<=122}function Wy(t,e){var r=new Ky(t,e);return r.parseDocument()}var Ky=function(){function t(r,n){var i=Py(r)?r:new s1(r);this._lexer=new Fy(i),this._options=n}var e=t.prototype;return e.parseName=function(){var n=this.expectToken(I.NAME);return{kind:q.NAME,value:n.value,loc:this.loc(n)}},e.parseDocument=function(){var n=this._lexer.token;return{kind:q.DOCUMENT,definitions:this.many(I.SOF,this.parseDefinition,I.EOF),loc:this.loc(n)}},e.parseDefinition=function(){if(this.peek(I.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(I.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},e.parseOperationDefinition=function(){var n=this._lexer.token;if(this.peek(I.BRACE_L))return{kind:q.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(n)};var i=this.parseOperationType(),a;return this.peek(I.NAME)&&(a=this.parseName()),{kind:q.OPERATION_DEFINITION,operation:i,name:a,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},e.parseOperationType=function(){var n=this.expectToken(I.NAME);switch(n.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(n)},e.parseVariableDefinitions=function(){return this.optionalMany(I.PAREN_L,this.parseVariableDefinition,I.PAREN_R)},e.parseVariableDefinition=function(){var n=this._lexer.token;return{kind:q.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(I.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(I.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(n)}},e.parseVariable=function(){var n=this._lexer.token;return this.expectToken(I.DOLLAR),{kind:q.VARIABLE,name:this.parseName(),loc:this.loc(n)}},e.parseSelectionSet=function(){var n=this._lexer.token;return{kind:q.SELECTION_SET,selections:this.many(I.BRACE_L,this.parseSelection,I.BRACE_R),loc:this.loc(n)}},e.parseSelection=function(){return this.peek(I.SPREAD)?this.parseFragment():this.parseField()},e.parseField=function(){var n=this._lexer.token,i=this.parseName(),a,o;return this.expectOptionalToken(I.COLON)?(a=i,o=this.parseName()):o=i,{kind:q.FIELD,alias:a,name:o,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(I.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},e.parseArguments=function(n){var i=n?this.parseConstArgument:this.parseArgument;return this.optionalMany(I.PAREN_L,i,I.PAREN_R)},e.parseArgument=function(){var n=this._lexer.token,i=this.parseName();return this.expectToken(I.COLON),{kind:q.ARGUMENT,name:i,value:this.parseValueLiteral(!1),loc:this.loc(n)}},e.parseConstArgument=function(){var n=this._lexer.token;return{kind:q.ARGUMENT,name:this.parseName(),value:(this.expectToken(I.COLON),this.parseValueLiteral(!0)),loc:this.loc(n)}},e.parseFragment=function(){var n=this._lexer.token;this.expectToken(I.SPREAD);var i=this.expectOptionalKeyword("on");return!i&&this.peek(I.NAME)?{kind:q.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(n)}:{kind:q.INLINE_FRAGMENT,typeCondition:i?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},e.parseFragmentDefinition=function(){var n,i=this._lexer.token;return this.expectKeyword("fragment"),((n=this._options)===null||n===void 0?void 0:n.experimentalFragmentVariables)===!0?{kind:q.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}:{kind:q.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}},e.parseFragmentName=function(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()},e.parseValueLiteral=function(n){var i=this._lexer.token;switch(i.kind){case I.BRACKET_L:return this.parseList(n);case I.BRACE_L:return this.parseObject(n);case I.INT:return this._lexer.advance(),{kind:q.INT,value:i.value,loc:this.loc(i)};case I.FLOAT:return this._lexer.advance(),{kind:q.FLOAT,value:i.value,loc:this.loc(i)};case I.STRING:case I.BLOCK_STRING:return this.parseStringLiteral();case I.NAME:switch(this._lexer.advance(),i.value){case"true":return{kind:q.BOOLEAN,value:!0,loc:this.loc(i)};case"false":return{kind:q.BOOLEAN,value:!1,loc:this.loc(i)};case"null":return{kind:q.NULL,loc:this.loc(i)};default:return{kind:q.ENUM,value:i.value,loc:this.loc(i)}}case I.DOLLAR:if(!n)return this.parseVariable();break}throw this.unexpected()},e.parseStringLiteral=function(){var n=this._lexer.token;return this._lexer.advance(),{kind:q.STRING,value:n.value,block:n.kind===I.BLOCK_STRING,loc:this.loc(n)}},e.parseList=function(n){var i=this,a=this._lexer.token,o=function(){return i.parseValueLiteral(n)};return{kind:q.LIST,values:this.any(I.BRACKET_L,o,I.BRACKET_R),loc:this.loc(a)}},e.parseObject=function(n){var i=this,a=this._lexer.token,o=function(){return i.parseObjectField(n)};return{kind:q.OBJECT,fields:this.any(I.BRACE_L,o,I.BRACE_R),loc:this.loc(a)}},e.parseObjectField=function(n){var i=this._lexer.token,a=this.parseName();return this.expectToken(I.COLON),{kind:q.OBJECT_FIELD,name:a,value:this.parseValueLiteral(n),loc:this.loc(i)}},e.parseDirectives=function(n){for(var i=[];this.peek(I.AT);)i.push(this.parseDirective(n));return i},e.parseDirective=function(n){var i=this._lexer.token;return this.expectToken(I.AT),{kind:q.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(n),loc:this.loc(i)}},e.parseTypeReference=function(){var n=this._lexer.token,i;return this.expectOptionalToken(I.BRACKET_L)?(i=this.parseTypeReference(),this.expectToken(I.BRACKET_R),i={kind:q.LIST_TYPE,type:i,loc:this.loc(n)}):i=this.parseNamedType(),this.expectOptionalToken(I.BANG)?{kind:q.NON_NULL_TYPE,type:i,loc:this.loc(n)}:i},e.parseNamedType=function(){var n=this._lexer.token;return{kind:q.NAMED_TYPE,name:this.parseName(),loc:this.loc(n)}},e.parseTypeSystemDefinition=function(){var n=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(n.kind===I.NAME)switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(n)},e.peekDescription=function(){return this.peek(I.STRING)||this.peek(I.BLOCK_STRING)},e.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},e.parseSchemaDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("schema");var a=this.parseDirectives(!0),o=this.many(I.BRACE_L,this.parseOperationTypeDefinition,I.BRACE_R);return{kind:q.SCHEMA_DEFINITION,description:i,directives:a,operationTypes:o,loc:this.loc(n)}},e.parseOperationTypeDefinition=function(){var n=this._lexer.token,i=this.parseOperationType();this.expectToken(I.COLON);var a=this.parseNamedType();return{kind:q.OPERATION_TYPE_DEFINITION,operation:i,type:a,loc:this.loc(n)}},e.parseScalarTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("scalar");var a=this.parseName(),o=this.parseDirectives(!0);return{kind:q.SCALAR_TYPE_DEFINITION,description:i,name:a,directives:o,loc:this.loc(n)}},e.parseObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("type");var a=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:q.OBJECT_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:u,loc:this.loc(n)}},e.parseImplementsInterfaces=function(){var n;if(!this.expectOptionalKeyword("implements"))return[];if(((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLImplementsInterfaces)===!0){var i=[];this.expectOptionalToken(I.AMP);do i.push(this.parseNamedType());while(this.expectOptionalToken(I.AMP)||this.peek(I.NAME));return i}return this.delimitedMany(I.AMP,this.parseNamedType)},e.parseFieldsDefinition=function(){var n;return((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLEmptyFields)===!0&&this.peek(I.BRACE_L)&&this._lexer.lookahead().kind===I.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(I.BRACE_L,this.parseFieldDefinition,I.BRACE_R)},e.parseFieldDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseArgumentDefs();this.expectToken(I.COLON);var s=this.parseTypeReference(),u=this.parseDirectives(!0);return{kind:q.FIELD_DEFINITION,description:i,name:a,arguments:o,type:s,directives:u,loc:this.loc(n)}},e.parseArgumentDefs=function(){return this.optionalMany(I.PAREN_L,this.parseInputValueDef,I.PAREN_R)},e.parseInputValueDef=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName();this.expectToken(I.COLON);var o=this.parseTypeReference(),s;this.expectOptionalToken(I.EQUALS)&&(s=this.parseValueLiteral(!0));var u=this.parseDirectives(!0);return{kind:q.INPUT_VALUE_DEFINITION,description:i,name:a,type:o,defaultValue:s,directives:u,loc:this.loc(n)}},e.parseInterfaceTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("interface");var a=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:q.INTERFACE_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:u,loc:this.loc(n)}},e.parseUnionTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("union");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseUnionMemberTypes();return{kind:q.UNION_TYPE_DEFINITION,description:i,name:a,directives:o,types:s,loc:this.loc(n)}},e.parseUnionMemberTypes=function(){return this.expectOptionalToken(I.EQUALS)?this.delimitedMany(I.PIPE,this.parseNamedType):[]},e.parseEnumTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("enum");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseEnumValuesDefinition();return{kind:q.ENUM_TYPE_DEFINITION,description:i,name:a,directives:o,values:s,loc:this.loc(n)}},e.parseEnumValuesDefinition=function(){return this.optionalMany(I.BRACE_L,this.parseEnumValueDefinition,I.BRACE_R)},e.parseEnumValueDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseDirectives(!0);return{kind:q.ENUM_VALUE_DEFINITION,description:i,name:a,directives:o,loc:this.loc(n)}},e.parseInputObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("input");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseInputFieldsDefinition();return{kind:q.INPUT_OBJECT_TYPE_DEFINITION,description:i,name:a,directives:o,fields:s,loc:this.loc(n)}},e.parseInputFieldsDefinition=function(){return this.optionalMany(I.BRACE_L,this.parseInputValueDef,I.BRACE_R)},e.parseTypeSystemExtension=function(){var n=this._lexer.lookahead();if(n.kind===I.NAME)switch(n.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(n)},e.parseSchemaExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var i=this.parseDirectives(!0),a=this.optionalMany(I.BRACE_L,this.parseOperationTypeDefinition,I.BRACE_R);if(i.length===0&&a.length===0)throw this.unexpected();return{kind:q.SCHEMA_EXTENSION,directives:i,operationTypes:a,loc:this.loc(n)}},e.parseScalarTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var i=this.parseName(),a=this.parseDirectives(!0);if(a.length===0)throw this.unexpected();return{kind:q.SCALAR_TYPE_EXTENSION,name:i,directives:a,loc:this.loc(n)}},e.parseObjectTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var i=this.parseName(),a=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),s=this.parseFieldsDefinition();if(a.length===0&&o.length===0&&s.length===0)throw this.unexpected();return{kind:q.OBJECT_TYPE_EXTENSION,name:i,interfaces:a,directives:o,fields:s,loc:this.loc(n)}},e.parseInterfaceTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var i=this.parseName(),a=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),s=this.parseFieldsDefinition();if(a.length===0&&o.length===0&&s.length===0)throw this.unexpected();return{kind:q.INTERFACE_TYPE_EXTENSION,name:i,interfaces:a,directives:o,fields:s,loc:this.loc(n)}},e.parseUnionTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseUnionMemberTypes();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:q.UNION_TYPE_EXTENSION,name:i,directives:a,types:o,loc:this.loc(n)}},e.parseEnumTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseEnumValuesDefinition();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:q.ENUM_TYPE_EXTENSION,name:i,directives:a,values:o,loc:this.loc(n)}},e.parseInputObjectTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseInputFieldsDefinition();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:q.INPUT_OBJECT_TYPE_EXTENSION,name:i,directives:a,fields:o,loc:this.loc(n)}},e.parseDirectiveDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("directive"),this.expectToken(I.AT);var a=this.parseName(),o=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var u=this.parseDirectiveLocations();return{kind:q.DIRECTIVE_DEFINITION,description:i,name:a,arguments:o,repeatable:s,locations:u,loc:this.loc(n)}},e.parseDirectiveLocations=function(){return this.delimitedMany(I.PIPE,this.parseDirectiveLocation)},e.parseDirectiveLocation=function(){var n=this._lexer.token,i=this.parseName();if(Ry[i.value]!==void 0)return i;throw this.unexpected(n)},e.loc=function(n){var i;if(((i=this._options)===null||i===void 0?void 0:i.noLocation)!==!0)return new a1(n,this._lexer.lastToken,this._lexer.source)},e.peek=function(n){return this._lexer.token.kind===n},e.expectToken=function(n){var i=this._lexer.token;if(i.kind===n)return this._lexer.advance(),i;throw kt(this._lexer.source,i.start,"Expected ".concat(c1(n),", found ").concat(Yu(i),"."))},e.expectOptionalToken=function(n){var i=this._lexer.token;if(i.kind===n)return this._lexer.advance(),i},e.expectKeyword=function(n){var i=this._lexer.token;if(i.kind===I.NAME&&i.value===n)this._lexer.advance();else throw kt(this._lexer.source,i.start,'Expected "'.concat(n,'", found ').concat(Yu(i),"."))},e.expectOptionalKeyword=function(n){var i=this._lexer.token;return i.kind===I.NAME&&i.value===n?(this._lexer.advance(),!0):!1},e.unexpected=function(n){var i=n??this._lexer.token;return kt(this._lexer.source,i.start,"Unexpected ".concat(Yu(i),"."))},e.any=function(n,i,a){this.expectToken(n);for(var o=[];!this.expectOptionalToken(a);)o.push(i.call(this));return o},e.optionalMany=function(n,i,a){if(this.expectOptionalToken(n)){var o=[];do o.push(i.call(this));while(!this.expectOptionalToken(a));return o}return[]},e.many=function(n,i,a){this.expectToken(n);var o=[];do o.push(i.call(this));while(!this.expectOptionalToken(a));return o},e.delimitedMany=function(n,i){this.expectOptionalToken(n);var a=[];do a.push(i.call(this));while(this.expectOptionalToken(n));return a},t}();function Yu(t){var e=t.value;return c1(t.kind)+(e!=null?' "'.concat(e,'"'):"")}function c1(t){return My(t)?'"'.concat(t,'"'):t}var Ds=new Map,bl=new Map,u1=!0,Vs=!1;function l1(t){return t.replace(/[\s,]+/g," ").trim()}function Zy(t){return l1(t.source.body.substring(t.start,t.end))}function Jy(t){var e=new Set,r=[];return t.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,a=Zy(n.loc),o=bl.get(i);o&&!o.has(a)?u1&&console.warn("Warning: fragment with name "+i+` already exists.
62
62
  graphql-tag enforces all fragment names across your application to be unique; read more about
63
- this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||ml.set(i,o=new Set),o.add(a),e.has(a)||(e.add(a),r.push(n))}else r.push(n)}),Fs(Fs({},t),{definitions:r})}function Hy(t){var e=new Set(t.definitions);e.forEach(function(n){n.loc&&delete n.loc,Object.keys(n).forEach(function(i){var a=n[i];a&&typeof a=="object"&&e.add(a)})});var r=t.loc;return r&&(delete r.startToken,delete r.endToken),t}function Wy(t){var e=o1(t);if(!Es.has(e)){var r=Vy(t,{experimentalFragmentVariables:Ms,allowLegacyFragmentVariables:Ms});if(!r||r.kind!=="Document")throw new Error("Not a valid GraphQL document.");Es.set(e,Hy(Gy(r)))}return Es.get(e)}function E(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];typeof t=="string"&&(t=[t]);var n=t[0];return e.forEach(function(i,a){i&&i.kind==="Document"?n+=i.loc.source.body:n+=i,n+=t[a+1]}),Wy(n)}function Ky(){Es.clear(),ml.clear()}function Zy(){a1=!1}function Jy(){Ms=!0}function Yy(){Ms=!1}var ba={gql:E,resetCaches:Ky,disableFragmentWarnings:Zy,enableExperimentalFragmentVariables:Jy,disableExperimentalFragmentVariables:Yy};(function(t){t.gql=ba.gql,t.resetCaches=ba.resetCaches,t.disableFragmentWarnings=ba.disableFragmentWarnings,t.enableExperimentalFragmentVariables=ba.enableExperimentalFragmentVariables,t.disableExperimentalFragmentVariables=ba.disableExperimentalFragmentVariables})(E||(E={}));E.default=E;function I(t){if(!t)throw"Got no result from Apollo";if(t.error)throw t.error;if(t.errors)throw t.errors;return t.data}function Xy(){}function on(){return Xy}var ye=on,m=on,Ke=on,Ve=on,W=on,Ht=on,e0=on,jl=on,s1=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},c1=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Un=class{constructor(e){this.code=e}};s1([m(),c1("design:type",String)],Un.prototype,"code",void 0);Un=s1([W(),c1("design:paramtypes",[String])],Un);var Bl=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},ql=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ar=class{constructor(e,r){this.address=e,this.name=r}};Bl([m(),ql("design:type",String)],ar.prototype,"address",void 0);Bl([m(),ql("design:type",String)],ar.prototype,"name",void 0);ar=Bl([W(),ql("design:paramtypes",[String,String])],ar);var ke=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},qe=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},xr=class{constructor(e,r){this.key=r,this.signature=e}};ke([m(),qe("design:type",String)],xr.prototype,"signature",void 0);ke([m(),qe("design:type",String)],xr.prototype,"key",void 0);ke([m(),qe("design:type",Boolean)],xr.prototype,"valid",void 0);ke([m(),qe("design:type",Boolean)],xr.prototype,"invalid",void 0);xr=ke([W(),Ke(),qe("design:paramtypes",[String,String])],xr);var jn=class{};ke([m(),qe("design:type",String)],jn.prototype,"signature",void 0);ke([m(),qe("design:type",String)],jn.prototype,"key",void 0);ke([m(),qe("design:type",Boolean)],jn.prototype,"valid",void 0);ke([m(),qe("design:type",Boolean)],jn.prototype,"invalid",void 0);jn=ke([Ke()],jn);function sn(t){let e=class{constructor(n,i,a,o){this.author=n,this.timestamp=i,this.data=a,this.proof=o}};return ke([m(),qe("design:type",String)],e.prototype,"author",void 0),ke([m(),qe("design:type",String)],e.prototype,"timestamp",void 0),ke([m(),qe("design:type",Object)],e.prototype,"data",void 0),ke([m(),qe("design:type",xr)],e.prototype,"proof",void 0),e=ke([W(),qe("design:paramtypes",[String,String,Object,xr])],e),e}function t0(t){let e=class{};return ke([m(),qe("design:type",String)],e.prototype,"author",void 0),ke([m(),qe("design:type",String)],e.prototype,"timestamp",void 0),ke([m(),qe("design:type",Object)],e.prototype,"data",void 0),ke([m(),qe("design:type",jn)],e.prototype,"proof",void 0),e=ke([Ke()],e),e}var Bd=class extends sn(){};Bd=ke([W()],Bd);var Us=class extends sn(){};ke([m(),qe("design:type",ar)],Us.prototype,"language",void 0);ke([m(),qe("design:type",Un)],Us.prototype,"icon",void 0);Us=ke([W()],Us);function iw(t){return t&&t.author&&t.timestamp&&t.data}var Fe=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},rt=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Bn=class{constructor(e){this.source=e.source?e.source:"",this.target=e.target?e.target:"",this.predicate=e.predicate?e.predicate:""}};Fe([m(),rt("design:type",String)],Bn.prototype,"source",void 0);Fe([m(),rt("design:type",String)],Bn.prototype,"target",void 0);Fe([m(),rt("design:type",String)],Bn.prototype,"predicate",void 0);Bn=Fe([W(),rt("design:paramtypes",[Object])],Bn);var js=class{};Fe([m(),rt("design:type",Array)],js.prototype,"additions",void 0);Fe([m(),rt("design:type",Array)],js.prototype,"removals",void 0);js=Fe([Ke()],js);var Bs=class{constructor(e,r){this.additions=e,this.removals=r}};Fe([m(),rt("design:type",Array)],Bs.prototype,"additions",void 0);Fe([m(),rt("design:type",Array)],Bs.prototype,"removals",void 0);Bs=Fe([W(),rt("design:paramtypes",[Array,Array])],Bs);var Za=class{};Fe([m(),rt("design:type",String)],Za.prototype,"source",void 0);Fe([m(),rt("design:type",String)],Za.prototype,"target",void 0);Fe([m(),rt("design:type",String)],Za.prototype,"predicate",void 0);Za=Fe([Ke()],Za);var Xr=class extends sn(){hash(){let e=JSON.stringify(this.data,Object.keys(this.data).sort())+JSON.stringify(this.author)+this.timestamp,r=0,n,i;for(n=0;n<e.length;n++)i=e.charCodeAt(n),r=(r<<5)-r+i,r|=0;return r}};Fe([m(),rt("design:type",String)],Xr.prototype,"status",void 0);Xr=Fe([W()],Xr);var gl=class extends t0(){};Fe([m(),rt("design:type",String)],gl.prototype,"status",void 0);gl=Fe([Ke()],gl);function pw(t,e){return t.author==e.author&&t.timestamp==e.timestamp&&t.data.source==e.data.source&&t.data.predicate==e.data.predicate&&t.data.target==e.data.target}function fw(t){return t&&t.source&&t.target}var qs=class{constructor(e,r){this.oldLink=e,this.newLink=r}};Fe([m(),rt("design:type",Xr)],qs.prototype,"oldLink",void 0);Fe([m(),rt("design:type",Xr)],qs.prototype,"newLink",void 0);qs=Fe([W(),rt("design:paramtypes",[Xr,Xr])],qs);var Kn=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},co=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},yl,cr=class{constructor(e){e?this.links=e:this.links=[]}get(e){if(!e||!e.source&&!e.predicate&&!e.target)return this.links;if(e.source){let n=JSON.parse(JSON.stringify(this.links));return e.target&&(n=n.filter(i=>i.data.target===e.target)),e.predicate&&(n=n.filter(i=>i.data.predicate===e.predicate)),e.fromDate&&(n=n.filter(i=>new Date(i.timestamp)>=e.fromDate)),e.untilDate&&(n=n.filter(i=>new Date(i.timestamp)<=e.untilDate)),e.limit&&(n=n.slice(0,e.limit)),n}if(e.target){let n=JSON.parse(JSON.stringify(this.links));return e.predicate&&(n=n.filter(i=>i.data.predicate===e.predicate)),e.fromDate&&(n=n.filter(i=>new Date(i.timestamp)>=e.fromDate)),e.untilDate&&(n=n.filter(i=>new Date(i.timestamp)<=e.untilDate)),e.limit&&(n=n.slice(0,e.limit)),n}let r=JSON.parse(JSON.stringify(this.links));return r=r.filter(n=>n.data.predicate===e.predicate),e.limit&&(r=r.slice(0,e.limit)),r}getSingleTarget(e){delete e.target;let r=this.get(e);return r.length?r[0].data.target:null}};Kn([m(),co("design:type",Array)],cr.prototype,"links",void 0);cr=Kn([W(),co("design:paramtypes",[Array])],cr);var Vs=class{};Kn([m(),co("design:type",Array)],Vs.prototype,"links",void 0);Vs=Kn([Ke()],Vs);var vl=yl=class{constructor(e){e?this.links=e:this.links=[]}static fromLink(e){let r=new yl;return r.links.push(e),r}};Kn([m(),co("design:type",Array)],vl.prototype,"links",void 0);vl=yl=Kn([Ke(),co("design:paramtypes",[Array])],vl);var qn=class extends sn(){};qn=Kn([W()],qn);var U=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},j=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Wr=class{constructor(e,r){this.did=e,r?this.perspective=r:this.perspective=new cr}};U([m(),j("design:type",String)],Wr.prototype,"did",void 0);U([m(),j("design:type",cr)],Wr.prototype,"perspective",void 0);U([m(),j("design:type",String)],Wr.prototype,"directMessageLanguage",void 0);Wr=U([W(),j("design:paramtypes",[String,cr])],Wr);var qd=class extends sn(){};qd=U([W()],qd);var en=class{constructor(e,r,n,i,a,o){this.did=e,this.didSigningKeyId=r,this.deviceKeyType=n,this.deviceKey=i,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};U([m(),j("design:type",String)],en.prototype,"did",void 0);U([m(),j("design:type",String)],en.prototype,"didSigningKeyId",void 0);U([m(),j("design:type",String)],en.prototype,"deviceKeyType",void 0);U([m(),j("design:type",String)],en.prototype,"deviceKey",void 0);U([m(),j("design:type",String)],en.prototype,"deviceKeySignedByDid",void 0);U([m(),j("design:type",String)],en.prototype,"didSignedByDeviceKey",void 0);en=U([W(),j("design:paramtypes",[String,String,String,String,String,String])],en);var tn=class{constructor(e,r,n,i,a,o){this.did=e,this.didSigningKeyId=r,this.deviceKeyType=n,this.deviceKey=i,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};U([m(),j("design:type",String)],tn.prototype,"did",void 0);U([m(),j("design:type",String)],tn.prototype,"didSigningKeyId",void 0);U([m(),j("design:type",String)],tn.prototype,"deviceKeyType",void 0);U([m(),j("design:type",String)],tn.prototype,"deviceKey",void 0);U([m(),j("design:type",String)],tn.prototype,"deviceKeySignedByDid",void 0);U([m(),j("design:type",String)],tn.prototype,"didSignedByDeviceKey",void 0);tn=U([Ke(),j("design:paramtypes",[String,String,String,String,String,String])],tn);var Qs=class{constructor(e,r){this.signature=e,this.publicKey=r}};U([m(),j("design:type",String)],Qs.prototype,"signature",void 0);U([m(),j("design:type",String)],Qs.prototype,"publicKey",void 0);Qs=U([W(),j("design:paramtypes",[String,String])],Qs);var Ni=class{constructor(e,r){this.domain=e,this.pointers=r}};U([m(),j("design:type",String)],Ni.prototype,"domain",void 0);U([m(),j("design:type",Array)],Ni.prototype,"pointers",void 0);Ni=U([W(),j("design:paramtypes",[String,Array])],Ni);var zs=class{constructor(e,r){this.with=e,this.can=r}};U([m(),j("design:type",Ni)],zs.prototype,"with",void 0);U([m(),j("design:type",Array)],zs.prototype,"can",void 0);zs=U([W(),j("design:paramtypes",[Ni,Array])],zs);var Er=class{constructor(e,r,n,i,a){this.appName=e,this.appDesc=r,this.appIconPath=a,this.appUrl=n,this.capabilities=i}};U([m(),j("design:type",String)],Er.prototype,"appName",void 0);U([m(),j("design:type",String)],Er.prototype,"appDesc",void 0);U([m(),j("design:type",String)],Er.prototype,"appUrl",void 0);U([m(),j("design:type",String)],Er.prototype,"appIconPath",void 0);U([m(),j("design:type",Array)],Er.prototype,"capabilities",void 0);Er=U([W(),j("design:paramtypes",[String,String,String,Array,String])],Er);var Pi=class{constructor(e,r,n,i){this.requestId=e,this.auth=r,this.token=n,this.revoked=i}};U([m(),j("design:type",String)],Pi.prototype,"requestId",void 0);U([m(),j("design:type",String)],Pi.prototype,"token",void 0);U([m(),j("design:type",Boolean)],Pi.prototype,"revoked",void 0);U([m(),j("design:type",Er)],Pi.prototype,"auth",void 0);Pi=U([W(),j("design:paramtypes",[String,Er,String,Boolean])],Pi);var Ri=class{constructor(e,r){this.domain=e,this.pointers=r}};U([m(),j("design:type",String)],Ri.prototype,"domain",void 0);U([m(),j("design:type",Array)],Ri.prototype,"pointers",void 0);Ri=U([Ke(),j("design:paramtypes",[String,Array])],Ri);var Gs=class{constructor(e,r){this.with=e,this.can=r}};U([m(),j("design:type",Ri)],Gs.prototype,"with",void 0);U([m(),j("design:type",Array)],Gs.prototype,"can",void 0);Gs=U([Ke(),j("design:paramtypes",[Ri,Array])],Gs);var rn=class{constructor(e,r,n,i,a,o){this.appName=e,this.appDesc=r,this.appUrl=i,this.appDomain=n,this.capabilities=o,this.appIconPath=a}};U([m(),j("design:type",String)],rn.prototype,"appName",void 0);U([m(),j("design:type",String)],rn.prototype,"appDesc",void 0);U([m(),j("design:type",String)],rn.prototype,"appDomain",void 0);U([m(),j("design:type",String)],rn.prototype,"appUrl",void 0);U([m(),j("design:type",String)],rn.prototype,"appIconPath",void 0);U([m(),j("design:type",Array)],rn.prototype,"capabilities",void 0);rn=U([Ke(),j("design:paramtypes",[String,String,String,String,String,Array])],rn);var ji=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},Bi=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Lt=class{constructor(e){e?(this.isInitialized=e.isInitialized,this.isInitialized||(this.isInitialized=!1),this.isUnlocked=e.isUnlocked,this.isUnlocked||(this.isUnlocked=!1),this.did=e.did,this.didDocument=e.didDocument,this.error=e.error):(this.isInitialized=!1,this.isUnlocked=!1)}};ji([m(),Bi("design:type",Boolean)],Lt.prototype,"isInitialized",void 0);ji([m(),Bi("design:type",Boolean)],Lt.prototype,"isUnlocked",void 0);ji([m(),Bi("design:type",String)],Lt.prototype,"did",void 0);ji([m(),Bi("design:type",String)],Lt.prototype,"didDocument",void 0);ji([m(),Bi("design:type",String)],Lt.prototype,"error",void 0);Lt=ji([W(),Bi("design:paramtypes",[Object])],Lt);var Vd=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)},gt,yt,bl=class{constructor(e,r){gt.set(this,void 0),yt.set(this,void 0),Vd(this,gt,e,"f"),Vd(this,yt,r,"f")}async otherAgents(){return await Pe(this,gt,"f").otherAgents(Pe(this,yt,"f"))}async hasTelepresenceAdapter(){return await Pe(this,gt,"f").hasTelepresenceAdapter(Pe(this,yt,"f"))}async onlineAgents(){return await Pe(this,gt,"f").onlineAgents(Pe(this,yt,"f"))}async setOnlineStatus(e){return await Pe(this,gt,"f").setOnlineStatus(Pe(this,yt,"f"),e)}async setOnlineStatusU(e){return await Pe(this,gt,"f").setOnlineStatusU(Pe(this,yt,"f"),e)}async sendSignal(e,r){return await Pe(this,gt,"f").sendSignal(Pe(this,yt,"f"),e,r)}async sendSignalU(e,r){return await Pe(this,gt,"f").sendSignalU(Pe(this,yt,"f"),e,r)}async sendBroadcast(e,r=!1){return await Pe(this,gt,"f").sendBroadcast(Pe(this,yt,"f"),e,r)}async sendBroadcastU(e,r=!1){return await Pe(this,gt,"f").sendBroadcastU(Pe(this,yt,"f"),e,r)}async addSignalHandler(e){await Pe(this,gt,"f").addSignalHandler(Pe(this,yt,"f"),e)}removeSignalHandler(e){Pe(this,gt,"f").removeSignalHandler(Pe(this,yt,"f"),e)}};gt=new WeakMap,yt=new WeakMap;var Zn=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},Jn=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},at=class{constructor(e){e&&(this.source=e.source,this.predicate=e.predicate,this.target=e.target,e.fromDate&&(this.fromDate=e.fromDate),e.untilDate&&(this.untilDate=e.untilDate),e.limit&&(this.limit=e.limit))}isMatch(e){return!(this.source&&this.source!==e.source||this.predicate&&this.predicate!==e.predicate||this.target&&this.target!==e.target)}};Zn([m(),Jn("design:type",String)],at.prototype,"source",void 0);Zn([m(),Jn("design:type",String)],at.prototype,"target",void 0);Zn([m(),Jn("design:type",String)],at.prototype,"predicate",void 0);Zn([m(),Jn("design:type",Date)],at.prototype,"fromDate",void 0);Zn([m(),Jn("design:type",Date)],at.prototype,"untilDate",void 0);Zn([m(),Jn("design:type",Number)],at.prototype,"limit",void 0);at=Zn([W(),Ke(),Jn("design:paramtypes",[Object])],at);var Qd=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},et=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)},vt,vr;function cs(t){return encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}var At=class{constructor(){vt.set(this,void 0),vr.set(this,void 0)}static fromUrl(e){if(!e||!e.startsWith("literal://"))throw new Error("Can't create Literal from non-literal URL");let r=new At;return Qd(r,vr,e,"f"),r}static from(e){let r=new At;return Qd(r,vt,e,"f"),r}toUrl(){if(et(this,vr,"f")&&!et(this,vt,"f"))return et(this,vr,"f");if(!et(this,vr,"f")&&(et(this,vt,"f")===void 0||et(this,vt,"f")===""||et(this,vt,"f")===null))throw new Error("Can't turn empty Literal into URL");let e;switch(typeof et(this,vt,"f")){case"string":e=`string:${cs(et(this,vt,"f"))}`;break;case"number":e=`number:${cs(et(this,vt,"f"))}`;break;case"boolean":e=`boolean:${cs(et(this,vt,"f"))}`;break;case"object":e=`json:${cs(JSON.stringify(et(this,vt,"f")))}`;break}return`literal://${e}`}get(){if(et(this,vt,"f"))return et(this,vt,"f");if(!et(this,vr,"f"))throw new Error("Can't render empty Literal");if(!et(this,vr,"f").startsWith("literal://"))throw new Error("Can't render Literal from non-literal URL");let e=et(this,vr,"f").substring(10);if(e.startsWith("string:"))return decodeURIComponent(e.substring(7));if(e.startsWith("number:")){let r=e.substring(7);return parseFloat(r)}if(e.startsWith("json:")){let r=e.substring(5);return JSON.parse(decodeURIComponent(r))}throw new Error(`Can't parse unknown literal: ${e}`)}};vt=new WeakMap,vr=new WeakMap;function Kr(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Vl(t){return`set${Kr(t)}`}function Cr(t){return t.endsWith("y")?t.slice(0,-1)+"ies":t+"s"}function Ql(t){return t.endsWith("ies")?t.slice(0,-3)+"y":t.endsWith("s")?t.slice(0,-1):t}function r0(t){return`add${Kr(Ql(t))}`}function n0(t){let e=t.substring(3),r=Cr(e);return r.charAt(0).toLowerCase()+r.slice(1)}function i0(t){return`remove${Kr(Ql(t))}`}function a0(t){let e=t.substring(6),r=Cr(e);return r.charAt(0).toLowerCase()+r.slice(1)}function o0(t){let e=t.substring(13),r=Cr(e);return r.charAt(0).toLowerCase()+r.slice(1)}function s0(t){return`setCollection${Kr(Ql(t))}`}function kn(t){if(Array.isArray(t))return`[${t.map(kn).join(", ")}]`;let e=Object.keys(t),r=[];for(let n of e){let i=JSON.stringify(t[n]),a=`${n}: ${i}`;r.push(a)}return`{${r.join(", ")}}`}var Ku=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},G=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)},ut,lt,Ae,Hs=class{constructor(t,e,r){ut.set(this,void 0),lt.set(this,void 0),Ae.set(this,void 0),Ku(this,ut,e,"f"),Ku(this,lt,r,"f"),Ku(this,Ae,t,"f")}get baseExpression(){return G(this,ut,"f")}async init(){let isInstance=await G(this,Ae,"f").isSubjectInstance(G(this,ut,"f"),G(this,lt,"f"));if(!isInstance)throw`Not a valid subject instance of ${G(this,lt,"f")} for ${G(this,ut,"f")}`;let results=await G(this,Ae,"f").infer(`subject_class("${G(this,lt,"f")}", C), property(C, Property)`),properties=results.map(t=>t.Property);for(let t of properties){let e=await G(this,Ae,"f").infer(`subject_class("${G(this,lt,"f")}", C), property_resolve(C, "${t}")`);Object.defineProperty(this,t,{configurable:!0,get:async()=>{let r=await G(this,Ae,"f").infer(`subject_class("${G(this,lt,"f")}", C), property_getter(C, "${G(this,ut,"f")}", "${t}", Value)`);if(r&&r.length>0){let n=r[0].Value;if(e)try{if(n){let i=await G(this,Ae,"f").getExpression(n);try{return JSON.parse(i.data)}catch{return i.data}}else return n}catch{return n}else return n}else return r||void 0}})}let setters=await G(this,Ae,"f").infer(`subject_class("${G(this,lt,"f")}", C), property_setter(C, Property, Setter)`);for(let setter of setters||[])if(setter){let property=setter.Property,actions=eval(setter.Setter),resolveLanguageResults=await G(this,Ae,"f").infer(`subject_class("${G(this,lt,"f")}", C), property_resolve_language(C, "${property}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),this[Vl(property)]=async t=>{resolveLanguage&&(t=await G(this,Ae,"f").createExpression(t,resolveLanguage)),await G(this,Ae,"f").executeAction(actions,G(this,ut,"f"),[{name:"value",value:t}])}}let results2=await G(this,Ae,"f").infer(`subject_class("${G(this,lt,"f")}", C), collection(C, Collection)`);results2||(results2=[]);let collections=results2.map(t=>t.Collection);for(let t of collections)Object.defineProperty(this,t,{configurable:!0,get:async()=>{let e=await G(this,Ae,"f").infer(`subject_class("${G(this,lt,"f")}", C), collection_getter(C, "${G(this,ut,"f")}", "${t}", Value)`);return e&&e.length>0&&e[0].Value?e[0].Value.filter(n=>n!==""&&n!==""):[]}});let adders=await G(this,Ae,"f").infer(`subject_class("${G(this,lt,"f")}", C), collection_adder(C, Collection, Adder)`);adders||(adders=[]);for(let adder of adders)if(adder){let collection=adder.Collection,actions=eval(adder.Adder);this[r0(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>G(this,Ae,"f").executeAction(actions,G(this,ut,"f"),[{name:"value",value:e}]))):await G(this,Ae,"f").executeAction(actions,G(this,ut,"f"),[{name:"value",value:t}])}}let removers=await G(this,Ae,"f").infer(`subject_class("${G(this,lt,"f")}", C), collection_remover(C, Collection, Remover)`);removers||(removers=[]);for(let remover of removers)if(remover){let collection=remover.Collection,actions=eval(remover.Remover);this[i0(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>G(this,Ae,"f").executeAction(actions,G(this,ut,"f"),[{name:"value",value:e}]))):await G(this,Ae,"f").executeAction(actions,G(this,ut,"f"),[{name:"value",value:t}])}}let collectionSetters=await G(this,Ae,"f").infer(`subject_class("${G(this,lt,"f")}", C), collection_setter(C, Collection, Setter)`);collectionSetters||(collectionSetters=[]);for(let collectionSetter of collectionSetters)if(collectionSetter){let collection=collectionSetter.Collection,actions=eval(collectionSetter.Setter);this[s0(collection)]=async t=>{Array.isArray(t)?await G(this,Ae,"f").executeAction(actions,G(this,ut,"f"),t.map(e=>({name:"value",value:e}))):await G(this,Ae,"f").executeAction(actions,G(this,ut,"f"),[{name:"value",value:t}])}}}};ut=new WeakMap,lt=new WeakMap,Ae=new WeakMap;var Le=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},O=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)},_l,Ii,Qr,In,Pn,xa,Ea,Ai,ka,ks,br,Ia,u1,pe,fe,An,Tn,On,Aa,wl=class{constructor(e,r,n){_l.add(this),Ii.set(this,void 0),Qr.set(this,void 0),In.set(this,void 0),Pn.set(this,void 0),xa.set(this,void 0),Ea.set(this,void 0),Ai.set(this,void 0),ka.set(this,!1),ks.set(this,void 0),br.set(this,void 0),Ia.set(this,void 0),Le(this,Ii,e,"f"),Le(this,Ia,r,"f"),Le(this,In,n,"f"),Le(this,Pn,new Set,"f"),Le(this,Ai,null,"f")}async subscribe(){let e=await O(this,In,"f").subscribeQuery(O(this,Ii,"f"),O(this,Ia,"f"));Le(this,Qr,e.subscriptionId,"f"),Le(this,ks,new Promise((n,i)=>{Le(this,br,setTimeout(()=>{i(new Error("Subscription initialization timed out after 30 seconds. Resubscribing...")),this.subscribe()},3e4),"f"),Le(this,Ea,O(this,In,"f").subscribeToQueryUpdates(O(this,Qr,"f"),a=>{O(this,br,"f")&&(clearTimeout(O(this,br,"f")),Le(this,br,void 0,"f")),n(!0),!(a.isInit&&O(this,Ai,"f"))&&(Le(this,Ai,a,"f"),O(this,_l,"m",u1).call(this,a))}),"f")}),"f");let r=async()=>{if(!O(this,ka,"f")){try{await O(this,In,"f").keepAliveQuery(O(this,Ii,"f"),O(this,Qr,"f"))}catch(n){console.error("Error in keepalive:",n),console.log("Reinitializing subscription for query:",O(this,Ia,"f")),await this.subscribe(),console.log("Subscription reinitialized")}O(this,ka,"f")||Le(this,xa,setTimeout(r,3e4),"f")}};Le(this,xa,setTimeout(r,3e4),"f")}get id(){return O(this,Qr,"f")}get initialized(){return O(this,ks,"f")}get result(){return O(this,Ai,"f")}onResult(e){return O(this,Pn,"f").add(e),()=>O(this,Pn,"f").delete(e)}dispose(){Le(this,ka,!0,"f"),clearTimeout(O(this,xa,"f")),O(this,Ea,"f")&&O(this,Ea,"f").call(this),O(this,Pn,"f").clear(),O(this,br,"f")&&(clearTimeout(O(this,br,"f")),Le(this,br,void 0,"f")),O(this,Qr,"f")&&O(this,In,"f").disposeQuerySubscription(O(this,Ii,"f"),O(this,Qr,"f")).catch(e=>console.error("Error disposing query subscription:",e))}};Ii=new WeakMap,Qr=new WeakMap,In=new WeakMap,Pn=new WeakMap,xa=new WeakMap,Ea=new WeakMap,Ai=new WeakMap,ka=new WeakMap,ks=new WeakMap,br=new WeakMap,Ia=new WeakMap,_l=new WeakSet,u1=function t(e){for(let r of O(this,Pn,"f"))try{r(e)}catch(n){console.error("Error in query subscription callback:",n)}};var Oi=class{constructor(t,e){pe.set(this,void 0),fe.set(this,void 0),An.set(this,void 0),Tn.set(this,void 0),On.set(this,void 0),Aa.set(this,void 0),Le(this,An,[],"f"),Le(this,Tn,[],"f"),Le(this,On,[],"f"),Le(this,Aa,[],"f"),Le(this,pe,t,"f"),Le(this,fe,e,"f"),this.uuid=O(this,pe,"f").uuid,this.name=O(this,pe,"f").name,this.sharedUrl=O(this,pe,"f").sharedUrl,this.neighbourhood=O(this,pe,"f").neighbourhood,this.state=O(this,pe,"f").state,O(this,fe,"f").addPerspectiveLinkAddedListener(O(this,pe,"f").uuid,O(this,An,"f")),O(this,fe,"f").addPerspectiveLinkRemovedListener(O(this,pe,"f").uuid,O(this,Tn,"f")),O(this,fe,"f").addPerspectiveLinkUpdatedListener(O(this,pe,"f").uuid,O(this,On,"f")),O(this,fe,"f").addPerspectiveSyncStateChangeListener(O(this,pe,"f").uuid,O(this,Aa,"f"))}async executeAction(t,e,r,n){return await O(this,fe,"f").executeCommands(O(this,pe,"f").uuid,JSON.stringify(t),e,JSON.stringify(r),n)}async get(t){return await O(this,fe,"f").queryLinks(O(this,pe,"f").uuid,t)}async infer(t){return await O(this,fe,"f").queryProlog(O(this,pe,"f").uuid,t)}async add(t,e="shared",r){return await O(this,fe,"f").addLink(O(this,pe,"f").uuid,t,e,r)}async addLinks(t,e="shared",r){return await O(this,fe,"f").addLinks(O(this,pe,"f").uuid,t,e,r)}async removeLinks(t,e){return await O(this,fe,"f").removeLinks(O(this,pe,"f").uuid,t,e)}async linkMutations(t,e="shared"){return await O(this,fe,"f").linkMutations(O(this,pe,"f").uuid,t,e)}async addLinkExpression(t,e="shared",r){return await O(this,fe,"f").addLinkExpression(O(this,pe,"f").uuid,t,e,r)}async update(t,e,r){return await O(this,fe,"f").updateLink(O(this,pe,"f").uuid,t,e,r)}async remove(t,e){return await O(this,fe,"f").removeLink(O(this,pe,"f").uuid,t,e)}async createBatch(){return await O(this,fe,"f").createBatch(O(this,pe,"f").uuid)}async commitBatch(t){return await O(this,fe,"f").commitBatch(O(this,pe,"f").uuid,t)}async getExpression(t){return await O(this,fe,"f").getExpression(t)}async createExpression(t,e){return await O(this,fe,"f").createExpression(t,e)}async addListener(t,e){t==="link-added"?O(this,An,"f").push(e):t==="link-removed"?O(this,Tn,"f").push(e):t==="link-updated"&&O(this,On,"f").push(e)}async addSyncStateChangeListener(t){O(this,Aa,"f").push(t)}async removeListener(t,e){if(t==="link-added"){let r=O(this,An,"f").indexOf(e);O(this,An,"f").splice(r,1)}else if(t==="link-removed"){let r=O(this,Tn,"f").indexOf(e);O(this,Tn,"f").splice(r,1)}else if(t==="link-updated"){let r=O(this,On,"f").indexOf(e);O(this,On,"f").splice(r,1)}}async snapshot(){return O(this,fe,"f").snapshotByUUID(O(this,pe,"f").uuid)}async loadSnapshot(t){let e=JSON.parse(JSON.stringify(t));delete e.__typename,e.links.forEach(r=>{delete r.data.__typename});for(let r of e.links)await this.addLinkExpression(r)}async getSingleTarget(t){delete t.target;let e=await this.get(t);return e.length?e[0].data.target:null}async setSingleTarget(t,e="shared"){let r=new at({source:t.source,predicate:t.predicate}),n=await this.get(r),i=[];for(let o of n)delete o.__typename,delete o.data.__typename,delete o.proof.__typename,i.push(o);let a=[t];await this.linkMutations({additions:a,removals:i},e)}async sdnaFlows(){return(await this.infer("register_sdna_flow(X, _)")).map(e=>e.X)}async availableFlows(t){return(await this.infer(`flowable("${t}", F), register_sdna_flow(X, F)`)).map(r=>r.X)}async startFlow(flowName,exprAddr){let startAction=await this.infer(`start_action(Action, F), register_sdna_flow("${flowName}", F)`);startAction=eval(startAction[0].Action),await this.executeAction(startAction,exprAddr,void 0)}async expressionsInFlowState(t,e){return(await this.infer(`register_sdna_flow("${t}", F), flow_state(X, ${e}, F)`)).map(n=>n.X)}async flowState(t,e){return(await this.infer(`register_sdna_flow("${t}", F), flow_state("${e}", X, F)`))[0].X}async flowActions(t,e){return(await this.infer(`register_sdna_flow("${t}", Flow), flow_state("${e}", State, Flow), action(State, Name, _, _)`)).map(n=>n.Name)}async runFlowAction(flowName,exprAddr,actionName){let action=await this.infer(`register_sdna_flow("${flowName}", Flow), flow_state("${exprAddr}", State, Flow), action(State, "${actionName}", _, Action)`);action=eval(action[0].Action),await this.executeAction(action,exprAddr,void 0)}async getSdna(){let t=["ad4m://has_subject_class","ad4m://has_flow","ad4m://has_custom_sdna"],e=[];for(let r of t){let n=await this.get(new at({source:"ad4m://self",predicate:r}));for(let i of n){let a=i.data.target,o=await this.get(new at({source:a,predicate:"ad4m://sdna"}));for(let s of o){let u=At.fromUrl(s.data.target).get();typeof u=="string"&&e.push(u)}}}return e}async getSdnaForClass(t){let e=At.from(t);if((await this.get(new at({source:"ad4m://self",target:e.toUrl(),predicate:"ad4m://has_subject_class"}))).length===0)return null;let n=await this.get(new at({source:e.toUrl(),predicate:"ad4m://sdna"}));if(n.length===0)return null;let i=At.fromUrl(n[0].data.target).get();return typeof i=="string"?i:null}async addSdna(t,e,r){return O(this,fe,"f").addSdna(O(this,pe,"f").uuid,t,e,r)}async subjectClasses(){try{return(await this.infer("subject_class(X, _)")).map(t=>t.X)}catch{return[]}}async stringOrTemplateObjectToSubjectClassName(t){if(typeof t=="string")return t;{let e=await this.subjectClassesByTemplate(t);return e[0]?e[0]:t.className}}async createSubject(t,e,r,n){let i;if(typeof t=="string")i=t,await O(this,fe,"f").createSubject(O(this,pe,"f").uuid,JSON.stringify({className:i,initialValues:r}),e,r?JSON.stringify(r):void 0,n);else{let a=this.buildQueryFromTemplate(t);await O(this,fe,"f").createSubject(O(this,pe,"f").uuid,JSON.stringify({query:a,initialValues:r}),e,r?JSON.stringify(r):void 0,n)}return n?e:this.getSubjectProxy(e,t)}async getSubjectData(t,e){if(typeof t=="string")return JSON.parse(await O(this,fe,"f").getSubjectData(O(this,pe,"f").uuid,JSON.stringify({className:t}),e));let r=this.buildQueryFromTemplate(t);return JSON.parse(await O(this,fe,"f").getSubjectData(O(this,pe,"f").uuid,JSON.stringify({query:r}),e))}async removeSubject(subjectClass,exprAddr,batchId){let className=await this.stringOrTemplateObjectToSubjectClassName(subjectClass),result=await this.infer(`subject_class("${className}", C), destructor(C, Actions)`);if(!result.length)throw"No destructor found for given subject class: "+className;let actions=result.map(x=>eval(x.Actions));await this.executeAction(actions[0],exprAddr,void 0,batchId)}async isSubjectInstance(t,e){let r=await this.stringOrTemplateObjectToSubjectClassName(e),n=!1,i=5,a=0;for(;a<i&&!n;)n=await this.infer(`subject_class("${r}", C), instance(C, "${t}")`),a++;return n}async getSubjectProxy(t,e){if(!await this.isSubjectInstance(t,e))throw`Expression ${t} is not a subject instance of given class: ${JSON.stringify(e)}`;let r=await this.stringOrTemplateObjectToSubjectClassName(e),n=new Hs(this,t,r);return await n.init(),n}async getAllSubjectInstances(t){let e=[];typeof t=="string"?e=[t]:e=await this.subjectClassesByTemplate(t);let r=[];for(let n of e){let i=await this.infer(`subject_class("${n}", C), instance(C, X)`),a=await Promise.all(i.map(async o=>await this.getSubjectProxy(o.X,n)));r=r.concat(a)}return r}async getAllSubjectProxies(t){let e=[];typeof t=="string"?e=[t]:e=await this.subjectClassesByTemplate(t);let r=[];for(let n of e)r=await this.infer(`subject_class("${n}", C), instance(C, X)`);return r}buildQueryFromTemplate(t){let e;return function(r){let n=[],i=[];Object.getPrototypeOf(r).__properties?Object.keys(Object.getPrototypeOf(r).__properties).forEach(l=>n.push(l)):n.push(...Object.keys(r).filter(l=>!Array.isArray(r[l]))),Object.getPrototypeOf(r).__collections?Object.keys(Object.getPrototypeOf(r).__collections).filter(l=>l!=="isSubjectInstance").forEach(l=>{i.includes(l)||i.push(l)}):i.push(...Object.keys(r).filter(l=>Array.isArray(r[l])).filter(l=>l!=="isSubjectInstance"));let a=Object.getOwnPropertyNames(r).filter(l=>typeof r[l]=="function"&&l.startsWith("set")&&!l.startsWith("setCollection"));a=a.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("set")&&!l.startsWith("setCollection")}));let o=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("add"));o=o.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("add")}));let s=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("remove"));s=s.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("remove")}));let u=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("setCollection"));u=u.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("setCollection")}));let c="subject_class(Class, C)";for(let l of n)c+=`, property(C, "${l}")`;for(let l of i)c+=`, collection(C, "${l}")`;for(let l of a){let d=l.substring(3);d=d.charAt(0).toLowerCase()+d.slice(1),c+=`, property_setter(C, "${d}", _)`}for(let l of o)c+=`, collection_adder(C, "${n0(l)}", _)`;for(let l of s)c+=`, collection_remover(C, "${a0(l)}", _)`;for(let l of u)c+=`, collection_setter(C, "${o0(l)}", _)`;c+=".",e=c}(t),e}async subjectClassesByTemplate(t){let e=this.buildQueryFromTemplate(t),r=await this.infer(e);return r?r.map(n=>n.Class):[]}async ensureSDNASubjectClass(t){if((await this.subjectClassesByTemplate(new t)).length>0)return;let{name:r,sdna:n}=t.generateSDNA();await this.addSdna(r,n,"subject_class")}getNeighbourhoodProxy(){return O(this,fe,"f").getNeighbourhoodProxy(O(this,pe,"f").uuid)}get ai(){return O(this,fe,"f").aiClient}async subscribeInfer(t){let e=new wl(this.uuid,t,O(this,fe,"f"));return await e.subscribe(),await e.initialized,e}};pe=new WeakMap,fe=new WeakMap,An=new WeakMap,Tn=new WeakMap,On=new WeakMap,Aa=new WeakMap;var Br=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},H=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)},te,Ta,Oa,Da,Is,Na,As,Ts,ct=`
63
+ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||bl.set(i,o=new Set),o.add(a),e.has(a)||(e.add(a),r.push(n))}else r.push(n)}),qs(qs({},t),{definitions:r})}function Yy(t){var e=new Set(t.definitions);e.forEach(function(n){n.loc&&delete n.loc,Object.keys(n).forEach(function(i){var a=n[i];a&&typeof a=="object"&&e.add(a)})});var r=t.loc;return r&&(delete r.startToken,delete r.endToken),t}function Xy(t){var e=l1(t);if(!Ds.has(e)){var r=Wy(t,{experimentalFragmentVariables:Vs,allowLegacyFragmentVariables:Vs});if(!r||r.kind!=="Document")throw new Error("Not a valid GraphQL document.");Ds.set(e,Yy(Jy(r)))}return Ds.get(e)}function E(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];typeof t=="string"&&(t=[t]);var n=t[0];return e.forEach(function(i,a){i&&i.kind==="Document"?n+=i.loc.source.body:n+=i,n+=t[a+1]}),Xy(n)}function e0(){Ds.clear(),bl.clear()}function t0(){u1=!1}function r0(){Vs=!0}function n0(){Vs=!1}var Sa={gql:E,resetCaches:e0,disableFragmentWarnings:t0,enableExperimentalFragmentVariables:r0,disableExperimentalFragmentVariables:n0};(function(t){t.gql=Sa.gql,t.resetCaches=Sa.resetCaches,t.disableFragmentWarnings=Sa.disableFragmentWarnings,t.enableExperimentalFragmentVariables=Sa.enableExperimentalFragmentVariables,t.disableExperimentalFragmentVariables=Sa.disableExperimentalFragmentVariables})(E||(E={}));E.default=E;function A(t){if(!t)throw"Got no result from Apollo";if(t.error)throw t.error;if(t.errors)throw t.errors;return t.data}function i0(){}function on(){return i0}var ve=on,m=on,Ze=on,Me=on,z=on,Dt=on,a0=on,Ql=on,p1=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},f1=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Un=class{constructor(e){this.code=e}};p1([m(),f1("design:type",String)],Un.prototype,"code",void 0);Un=p1([z(),f1("design:paramtypes",[String])],Un);var zl=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},Hl=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},or=class{constructor(e,r){this.address=e,this.name=r}};zl([m(),Hl("design:type",String)],or.prototype,"address",void 0);zl([m(),Hl("design:type",String)],or.prototype,"name",void 0);or=zl([z(),Hl("design:paramtypes",[String,String])],or);var Ae=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},Qe=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},xr=class{constructor(e,r){this.key=r,this.signature=e}};Ae([m(),Qe("design:type",String)],xr.prototype,"signature",void 0);Ae([m(),Qe("design:type",String)],xr.prototype,"key",void 0);Ae([m(),Qe("design:type",Boolean)],xr.prototype,"valid",void 0);Ae([m(),Qe("design:type",Boolean)],xr.prototype,"invalid",void 0);xr=Ae([z(),Ze(),Qe("design:paramtypes",[String,String])],xr);var jn=class{};Ae([m(),Qe("design:type",String)],jn.prototype,"signature",void 0);Ae([m(),Qe("design:type",String)],jn.prototype,"key",void 0);Ae([m(),Qe("design:type",Boolean)],jn.prototype,"valid",void 0);Ae([m(),Qe("design:type",Boolean)],jn.prototype,"invalid",void 0);jn=Ae([Ze()],jn);function sn(t){let e=class{constructor(n,i,a,o){this.author=n,this.timestamp=i,this.data=a,this.proof=o}};return Ae([m(),Qe("design:type",String)],e.prototype,"author",void 0),Ae([m(),Qe("design:type",String)],e.prototype,"timestamp",void 0),Ae([m(),Qe("design:type",Object)],e.prototype,"data",void 0),Ae([m(),Qe("design:type",xr)],e.prototype,"proof",void 0),e=Ae([z(),Qe("design:paramtypes",[String,String,Object,xr])],e),e}function o0(t){let e=class{};return Ae([m(),Qe("design:type",String)],e.prototype,"author",void 0),Ae([m(),Qe("design:type",String)],e.prototype,"timestamp",void 0),Ae([m(),Qe("design:type",Object)],e.prototype,"data",void 0),Ae([m(),Qe("design:type",jn)],e.prototype,"proof",void 0),e=Ae([Ze()],e),e}var zd=class extends sn(){};zd=Ae([z()],zd);var Qs=class extends sn(){};Ae([m(),Qe("design:type",or)],Qs.prototype,"language",void 0);Ae([m(),Qe("design:type",Un)],Qs.prototype,"icon",void 0);Qs=Ae([z()],Qs);function uw(t){return t&&t.author&&t.timestamp&&t.data}var Ue=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},nt=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Bn=class{constructor(e){this.source=e.source?e.source:"",this.target=e.target?e.target:"",this.predicate=e.predicate?e.predicate:""}};Ue([m(),nt("design:type",String)],Bn.prototype,"source",void 0);Ue([m(),nt("design:type",String)],Bn.prototype,"target",void 0);Ue([m(),nt("design:type",String)],Bn.prototype,"predicate",void 0);Bn=Ue([z(),nt("design:paramtypes",[Object])],Bn);var zs=class{};Ue([m(),nt("design:type",Array)],zs.prototype,"additions",void 0);Ue([m(),nt("design:type",Array)],zs.prototype,"removals",void 0);zs=Ue([Ze()],zs);var Hs=class{constructor(e,r){this.additions=e,this.removals=r}};Ue([m(),nt("design:type",Array)],Hs.prototype,"additions",void 0);Ue([m(),nt("design:type",Array)],Hs.prototype,"removals",void 0);Hs=Ue([z(),nt("design:paramtypes",[Array,Array])],Hs);var Xa=class{};Ue([m(),nt("design:type",String)],Xa.prototype,"source",void 0);Ue([m(),nt("design:type",String)],Xa.prototype,"target",void 0);Ue([m(),nt("design:type",String)],Xa.prototype,"predicate",void 0);Xa=Ue([Ze()],Xa);var Xr=class extends sn(){hash(){let e=JSON.stringify(this.data,Object.keys(this.data).sort())+JSON.stringify(this.author)+this.timestamp,r=0,n,i;for(n=0;n<e.length;n++)i=e.charCodeAt(n),r=(r<<5)-r+i,r|=0;return r}};Ue([m(),nt("design:type",String)],Xr.prototype,"status",void 0);Xr=Ue([z()],Xr);var _l=class extends o0(){};Ue([m(),nt("design:type",String)],_l.prototype,"status",void 0);_l=Ue([Ze()],_l);function gw(t,e){return t.author==e.author&&t.timestamp==e.timestamp&&t.data.source==e.data.source&&t.data.predicate==e.data.predicate&&t.data.target==e.data.target}function yw(t){return t&&t.source&&t.target}var Gs=class{constructor(e,r){this.oldLink=e,this.newLink=r}};Ue([m(),nt("design:type",Xr)],Gs.prototype,"oldLink",void 0);Ue([m(),nt("design:type",Xr)],Gs.prototype,"newLink",void 0);Gs=Ue([z(),nt("design:paramtypes",[Xr,Xr])],Gs);var Kn=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},mo=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},wl,ur=class{constructor(e){e?this.links=e:this.links=[]}get(e){if(!e||!e.source&&!e.predicate&&!e.target)return this.links;if(e.source){let n=JSON.parse(JSON.stringify(this.links));return e.target&&(n=n.filter(i=>i.data.target===e.target)),e.predicate&&(n=n.filter(i=>i.data.predicate===e.predicate)),e.fromDate&&(n=n.filter(i=>new Date(i.timestamp)>=e.fromDate)),e.untilDate&&(n=n.filter(i=>new Date(i.timestamp)<=e.untilDate)),e.limit&&(n=n.slice(0,e.limit)),n}if(e.target){let n=JSON.parse(JSON.stringify(this.links));return e.predicate&&(n=n.filter(i=>i.data.predicate===e.predicate)),e.fromDate&&(n=n.filter(i=>new Date(i.timestamp)>=e.fromDate)),e.untilDate&&(n=n.filter(i=>new Date(i.timestamp)<=e.untilDate)),e.limit&&(n=n.slice(0,e.limit)),n}let r=JSON.parse(JSON.stringify(this.links));return r=r.filter(n=>n.data.predicate===e.predicate),e.limit&&(r=r.slice(0,e.limit)),r}getSingleTarget(e){delete e.target;let r=this.get(e);return r.length?r[0].data.target:null}};Kn([m(),mo("design:type",Array)],ur.prototype,"links",void 0);ur=Kn([z(),mo("design:paramtypes",[Array])],ur);var Ws=class{};Kn([m(),mo("design:type",Array)],Ws.prototype,"links",void 0);Ws=Kn([Ze()],Ws);var Sl=wl=class{constructor(e){e?this.links=e:this.links=[]}static fromLink(e){let r=new wl;return r.links.push(e),r}};Kn([m(),mo("design:type",Array)],Sl.prototype,"links",void 0);Sl=wl=Kn([Ze(),mo("design:paramtypes",[Array])],Sl);var qn=class extends sn(){};qn=Kn([z()],qn);var j=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},B=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Wr=class{constructor(e,r){this.did=e,r?this.perspective=r:this.perspective=new ur}};j([m(),B("design:type",String)],Wr.prototype,"did",void 0);j([m(),B("design:type",ur)],Wr.prototype,"perspective",void 0);j([m(),B("design:type",String)],Wr.prototype,"directMessageLanguage",void 0);Wr=j([z(),B("design:paramtypes",[String,ur])],Wr);var Hd=class extends sn(){};Hd=j([z()],Hd);var en=class{constructor(e,r,n,i,a,o){this.did=e,this.didSigningKeyId=r,this.deviceKeyType=n,this.deviceKey=i,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};j([m(),B("design:type",String)],en.prototype,"did",void 0);j([m(),B("design:type",String)],en.prototype,"didSigningKeyId",void 0);j([m(),B("design:type",String)],en.prototype,"deviceKeyType",void 0);j([m(),B("design:type",String)],en.prototype,"deviceKey",void 0);j([m(),B("design:type",String)],en.prototype,"deviceKeySignedByDid",void 0);j([m(),B("design:type",String)],en.prototype,"didSignedByDeviceKey",void 0);en=j([z(),B("design:paramtypes",[String,String,String,String,String,String])],en);var tn=class{constructor(e,r,n,i,a,o){this.did=e,this.didSigningKeyId=r,this.deviceKeyType=n,this.deviceKey=i,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};j([m(),B("design:type",String)],tn.prototype,"did",void 0);j([m(),B("design:type",String)],tn.prototype,"didSigningKeyId",void 0);j([m(),B("design:type",String)],tn.prototype,"deviceKeyType",void 0);j([m(),B("design:type",String)],tn.prototype,"deviceKey",void 0);j([m(),B("design:type",String)],tn.prototype,"deviceKeySignedByDid",void 0);j([m(),B("design:type",String)],tn.prototype,"didSignedByDeviceKey",void 0);tn=j([Ze(),B("design:paramtypes",[String,String,String,String,String,String])],tn);var Ks=class{constructor(e,r){this.signature=e,this.publicKey=r}};j([m(),B("design:type",String)],Ks.prototype,"signature",void 0);j([m(),B("design:type",String)],Ks.prototype,"publicKey",void 0);Ks=j([z(),B("design:paramtypes",[String,String])],Ks);var Pi=class{constructor(e,r){this.domain=e,this.pointers=r}};j([m(),B("design:type",String)],Pi.prototype,"domain",void 0);j([m(),B("design:type",Array)],Pi.prototype,"pointers",void 0);Pi=j([z(),B("design:paramtypes",[String,Array])],Pi);var Zs=class{constructor(e,r){this.with=e,this.can=r}};j([m(),B("design:type",Pi)],Zs.prototype,"with",void 0);j([m(),B("design:type",Array)],Zs.prototype,"can",void 0);Zs=j([z(),B("design:paramtypes",[Pi,Array])],Zs);var Er=class{constructor(e,r,n,i,a){this.appName=e,this.appDesc=r,this.appIconPath=a,this.appUrl=n,this.capabilities=i}};j([m(),B("design:type",String)],Er.prototype,"appName",void 0);j([m(),B("design:type",String)],Er.prototype,"appDesc",void 0);j([m(),B("design:type",String)],Er.prototype,"appUrl",void 0);j([m(),B("design:type",String)],Er.prototype,"appIconPath",void 0);j([m(),B("design:type",Array)],Er.prototype,"capabilities",void 0);Er=j([z(),B("design:paramtypes",[String,String,String,Array,String])],Er);var Ri=class{constructor(e,r,n,i){this.requestId=e,this.auth=r,this.token=n,this.revoked=i}};j([m(),B("design:type",String)],Ri.prototype,"requestId",void 0);j([m(),B("design:type",String)],Ri.prototype,"token",void 0);j([m(),B("design:type",Boolean)],Ri.prototype,"revoked",void 0);j([m(),B("design:type",Er)],Ri.prototype,"auth",void 0);Ri=j([z(),B("design:paramtypes",[String,Er,String,Boolean])],Ri);var $i=class{constructor(e,r){this.domain=e,this.pointers=r}};j([m(),B("design:type",String)],$i.prototype,"domain",void 0);j([m(),B("design:type",Array)],$i.prototype,"pointers",void 0);$i=j([Ze(),B("design:paramtypes",[String,Array])],$i);var Js=class{constructor(e,r){this.with=e,this.can=r}};j([m(),B("design:type",$i)],Js.prototype,"with",void 0);j([m(),B("design:type",Array)],Js.prototype,"can",void 0);Js=j([Ze(),B("design:paramtypes",[$i,Array])],Js);var rn=class{constructor(e,r,n,i,a,o){this.appName=e,this.appDesc=r,this.appUrl=i,this.appDomain=n,this.capabilities=o,this.appIconPath=a}};j([m(),B("design:type",String)],rn.prototype,"appName",void 0);j([m(),B("design:type",String)],rn.prototype,"appDesc",void 0);j([m(),B("design:type",String)],rn.prototype,"appDomain",void 0);j([m(),B("design:type",String)],rn.prototype,"appUrl",void 0);j([m(),B("design:type",String)],rn.prototype,"appIconPath",void 0);j([m(),B("design:type",Array)],rn.prototype,"capabilities",void 0);rn=j([Ze(),B("design:paramtypes",[String,String,String,String,String,Array])],rn);var eo=class{constructor(e,r,n){this.username=e,this.did=r,this.password=n}};j([m(),B("design:type",String)],eo.prototype,"username",void 0);j([m(),B("design:type",String)],eo.prototype,"did",void 0);j([m(),B("design:type",String)],eo.prototype,"password",void 0);eo=j([z(),B("design:paramtypes",[String,String,String])],eo);var to=class{constructor(e,r,n){this.did=e,this.success=r,this.error=n}};j([m(),B("design:type",String)],to.prototype,"did",void 0);j([m(),B("design:type",Boolean)],to.prototype,"success",void 0);j([m(),B("design:type",String)],to.prototype,"error",void 0);to=j([z(),B("design:paramtypes",[String,Boolean,String])],to);var qi=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},Vi=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Ft=class{constructor(e){e?(this.isInitialized=e.isInitialized,this.isInitialized||(this.isInitialized=!1),this.isUnlocked=e.isUnlocked,this.isUnlocked||(this.isUnlocked=!1),this.did=e.did,this.didDocument=e.didDocument,this.error=e.error):(this.isInitialized=!1,this.isUnlocked=!1)}};qi([m(),Vi("design:type",Boolean)],Ft.prototype,"isInitialized",void 0);qi([m(),Vi("design:type",Boolean)],Ft.prototype,"isUnlocked",void 0);qi([m(),Vi("design:type",String)],Ft.prototype,"did",void 0);qi([m(),Vi("design:type",String)],Ft.prototype,"didDocument",void 0);qi([m(),Vi("design:type",String)],Ft.prototype,"error",void 0);Ft=qi([z(),Vi("design:paramtypes",[Object])],Ft);var Gd=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},Re=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)},yt,vt,Cl=class{constructor(e,r){yt.set(this,void 0),vt.set(this,void 0),Gd(this,yt,e,"f"),Gd(this,vt,r,"f")}async otherAgents(){return await Re(this,yt,"f").otherAgents(Re(this,vt,"f"))}async hasTelepresenceAdapter(){return await Re(this,yt,"f").hasTelepresenceAdapter(Re(this,vt,"f"))}async onlineAgents(){return await Re(this,yt,"f").onlineAgents(Re(this,vt,"f"))}async setOnlineStatus(e){return await Re(this,yt,"f").setOnlineStatus(Re(this,vt,"f"),e)}async setOnlineStatusU(e){return await Re(this,yt,"f").setOnlineStatusU(Re(this,vt,"f"),e)}async sendSignal(e,r){return await Re(this,yt,"f").sendSignal(Re(this,vt,"f"),e,r)}async sendSignalU(e,r){return await Re(this,yt,"f").sendSignalU(Re(this,vt,"f"),e,r)}async sendBroadcast(e,r=!1){return await Re(this,yt,"f").sendBroadcast(Re(this,vt,"f"),e,r)}async sendBroadcastU(e,r=!1){return await Re(this,yt,"f").sendBroadcastU(Re(this,vt,"f"),e,r)}async addSignalHandler(e){await Re(this,yt,"f").addSignalHandler(Re(this,vt,"f"),e)}removeSignalHandler(e){Re(this,yt,"f").removeSignalHandler(Re(this,vt,"f"),e)}};yt=new WeakMap,vt=new WeakMap;var Zn=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},Jn=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ot=class{constructor(e){e&&(this.source=e.source,this.predicate=e.predicate,this.target=e.target,e.fromDate&&(this.fromDate=e.fromDate),e.untilDate&&(this.untilDate=e.untilDate),e.limit&&(this.limit=e.limit))}isMatch(e){return!(this.source&&this.source!==e.source||this.predicate&&this.predicate!==e.predicate||this.target&&this.target!==e.target)}};Zn([m(),Jn("design:type",String)],ot.prototype,"source",void 0);Zn([m(),Jn("design:type",String)],ot.prototype,"target",void 0);Zn([m(),Jn("design:type",String)],ot.prototype,"predicate",void 0);Zn([m(),Jn("design:type",Date)],ot.prototype,"fromDate",void 0);Zn([m(),Jn("design:type",Date)],ot.prototype,"untilDate",void 0);Zn([m(),Jn("design:type",Number)],ot.prototype,"limit",void 0);ot=Zn([z(),Ze(),Jn("design:paramtypes",[Object])],ot);var Wd=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},tt=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)},bt,vr;function hs(t){return encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}var It=class{constructor(){bt.set(this,void 0),vr.set(this,void 0)}static fromUrl(e){if(!e||!e.startsWith("literal://"))throw new Error("Can't create Literal from non-literal URL");let r=new It;return Wd(r,vr,e,"f"),r}static from(e){let r=new It;return Wd(r,bt,e,"f"),r}toUrl(){if(tt(this,vr,"f")&&!tt(this,bt,"f"))return tt(this,vr,"f");if(!tt(this,vr,"f")&&(tt(this,bt,"f")===void 0||tt(this,bt,"f")===""||tt(this,bt,"f")===null))throw new Error("Can't turn empty Literal into URL");let e;switch(typeof tt(this,bt,"f")){case"string":e=`string:${hs(tt(this,bt,"f"))}`;break;case"number":e=`number:${hs(tt(this,bt,"f"))}`;break;case"boolean":e=`boolean:${hs(tt(this,bt,"f"))}`;break;case"object":e=`json:${hs(JSON.stringify(tt(this,bt,"f")))}`;break}return`literal://${e}`}get(){if(tt(this,bt,"f"))return tt(this,bt,"f");if(!tt(this,vr,"f"))throw new Error("Can't render empty Literal");if(!tt(this,vr,"f").startsWith("literal://"))throw new Error("Can't render Literal from non-literal URL");let e=tt(this,vr,"f").substring(10);if(e.startsWith("string:"))return decodeURIComponent(e.substring(7));if(e.startsWith("number:")){let r=e.substring(7);return parseFloat(r)}if(e.startsWith("json:")){let r=e.substring(5);return JSON.parse(decodeURIComponent(r))}throw new Error(`Can't parse unknown literal: ${e}`)}};bt=new WeakMap,vr=new WeakMap;function Kr(t){return t.charAt(0).toUpperCase()+t.slice(1)}function d1(t){return`set${Kr(t)}`}function Cr(t){return t.endsWith("y")?t.slice(0,-1)+"ies":t+"s"}function Gl(t){return t.endsWith("ies")?t.slice(0,-3)+"y":t.endsWith("s")?t.slice(0,-1):t}function s0(t){return`add${Kr(Gl(t))}`}function c0(t){let e=t.substring(3),r=Cr(e);return r.charAt(0).toLowerCase()+r.slice(1)}function u0(t){return`remove${Kr(Gl(t))}`}function l0(t){let e=t.substring(6),r=Cr(e);return r.charAt(0).toLowerCase()+r.slice(1)}function p0(t){let e=t.substring(13),r=Cr(e);return r.charAt(0).toLowerCase()+r.slice(1)}function f0(t){return`setCollection${Kr(Gl(t))}`}function kn(t){if(Array.isArray(t))return`[${t.map(kn).join(", ")}]`;let e=Object.keys(t),r=[];for(let n of e){let i=JSON.stringify(t[n]),a=`${n}: ${i}`;r.push(a)}return`{${r.join(", ")}}`}var Xu=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},G=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)},lt,pt,Te,Ys=class{constructor(t,e,r){lt.set(this,void 0),pt.set(this,void 0),Te.set(this,void 0),Xu(this,lt,e,"f"),Xu(this,pt,r,"f"),Xu(this,Te,t,"f")}get baseExpression(){return G(this,lt,"f")}async init(){let isInstance=await G(this,Te,"f").isSubjectInstance(G(this,lt,"f"),G(this,pt,"f"));if(!isInstance)throw`Not a valid subject instance of ${G(this,pt,"f")} for ${G(this,lt,"f")}`;let results=await G(this,Te,"f").infer(`subject_class("${G(this,pt,"f")}", C), property(C, Property)`),properties=results.map(t=>t.Property);for(let t of properties){let e=await G(this,Te,"f").infer(`subject_class("${G(this,pt,"f")}", C), property_resolve(C, "${t}")`);Object.defineProperty(this,t,{configurable:!0,get:async()=>{let r=await G(this,Te,"f").infer(`subject_class("${G(this,pt,"f")}", C), property_getter(C, "${G(this,lt,"f")}", "${t}", Value)`);if(r&&r.length>0){let n=r[0].Value;if(e)try{if(n){let i=await G(this,Te,"f").getExpression(n);try{return JSON.parse(i.data)}catch{return i.data}}else return n}catch{return n}else return n}else return r||void 0}})}let setters=await G(this,Te,"f").infer(`subject_class("${G(this,pt,"f")}", C), property_setter(C, Property, Setter)`);for(let setter of setters||[])if(setter){let property=setter.Property,actions=eval(setter.Setter),resolveLanguageResults=await G(this,Te,"f").infer(`subject_class("${G(this,pt,"f")}", C), property_resolve_language(C, "${property}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),this[d1(property)]=async t=>{resolveLanguage&&(t=await G(this,Te,"f").createExpression(t,resolveLanguage)),await G(this,Te,"f").executeAction(actions,G(this,lt,"f"),[{name:"value",value:t}])}}let results2=await G(this,Te,"f").infer(`subject_class("${G(this,pt,"f")}", C), collection(C, Collection)`);results2||(results2=[]);let collections=results2.map(t=>t.Collection);for(let t of collections)Object.defineProperty(this,t,{configurable:!0,get:async()=>{let e=await G(this,Te,"f").infer(`subject_class("${G(this,pt,"f")}", C), collection_getter(C, "${G(this,lt,"f")}", "${t}", Value)`);return e&&e.length>0&&e[0].Value?e[0].Value.filter(n=>n!==""&&n!==""):[]}});let adders=await G(this,Te,"f").infer(`subject_class("${G(this,pt,"f")}", C), collection_adder(C, Collection, Adder)`);adders||(adders=[]);for(let adder of adders)if(adder){let collection=adder.Collection,actions=eval(adder.Adder);this[s0(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>G(this,Te,"f").executeAction(actions,G(this,lt,"f"),[{name:"value",value:e}]))):await G(this,Te,"f").executeAction(actions,G(this,lt,"f"),[{name:"value",value:t}])}}let removers=await G(this,Te,"f").infer(`subject_class("${G(this,pt,"f")}", C), collection_remover(C, Collection, Remover)`);removers||(removers=[]);for(let remover of removers)if(remover){let collection=remover.Collection,actions=eval(remover.Remover);this[u0(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>G(this,Te,"f").executeAction(actions,G(this,lt,"f"),[{name:"value",value:e}]))):await G(this,Te,"f").executeAction(actions,G(this,lt,"f"),[{name:"value",value:t}])}}let collectionSetters=await G(this,Te,"f").infer(`subject_class("${G(this,pt,"f")}", C), collection_setter(C, Collection, Setter)`);collectionSetters||(collectionSetters=[]);for(let collectionSetter of collectionSetters)if(collectionSetter){let collection=collectionSetter.Collection,actions=eval(collectionSetter.Setter);this[f0(collection)]=async t=>{Array.isArray(t)?await G(this,Te,"f").executeAction(actions,G(this,lt,"f"),t.map(e=>({name:"value",value:e}))):await G(this,Te,"f").executeAction(actions,G(this,lt,"f"),[{name:"value",value:t}])}}}};lt=new WeakMap,pt=new WeakMap,Te=new WeakMap;var Fe=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},O=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)},xl,Ii,Qr,An,Pn,Aa,Ia,Ti,Ta,Ns,br,Oa,h1,he,ge,In,Tn,On,Da,El=class{constructor(e,r,n){xl.add(this),Ii.set(this,void 0),Qr.set(this,void 0),An.set(this,void 0),Pn.set(this,void 0),Aa.set(this,void 0),Ia.set(this,void 0),Ti.set(this,void 0),Ta.set(this,!1),Ns.set(this,void 0),br.set(this,void 0),Oa.set(this,void 0),Fe(this,Ii,e,"f"),Fe(this,Oa,r,"f"),Fe(this,An,n,"f"),Fe(this,Pn,new Set,"f"),Fe(this,Ti,null,"f")}async subscribe(){let e=await O(this,An,"f").subscribeQuery(O(this,Ii,"f"),O(this,Oa,"f"));Fe(this,Qr,e.subscriptionId,"f"),Fe(this,Ns,new Promise((n,i)=>{Fe(this,br,setTimeout(()=>{i(new Error("Subscription initialization timed out after 30 seconds. Resubscribing...")),this.subscribe()},3e4),"f"),Fe(this,Ia,O(this,An,"f").subscribeToQueryUpdates(O(this,Qr,"f"),a=>{O(this,br,"f")&&(clearTimeout(O(this,br,"f")),Fe(this,br,void 0,"f")),n(!0),!(a.isInit&&O(this,Ti,"f"))&&(Fe(this,Ti,a,"f"),O(this,xl,"m",h1).call(this,a))}),"f")}),"f");let r=async()=>{if(!O(this,Ta,"f")){try{await O(this,An,"f").keepAliveQuery(O(this,Ii,"f"),O(this,Qr,"f"))}catch(n){console.error("Error in keepalive:",n),console.log("Reinitializing subscription for query:",O(this,Oa,"f")),await this.subscribe(),console.log("Subscription reinitialized")}O(this,Ta,"f")||Fe(this,Aa,setTimeout(r,3e4),"f")}};Fe(this,Aa,setTimeout(r,3e4),"f")}get id(){return O(this,Qr,"f")}get initialized(){return O(this,Ns,"f")}get result(){return O(this,Ti,"f")}onResult(e){return O(this,Pn,"f").add(e),()=>O(this,Pn,"f").delete(e)}dispose(){Fe(this,Ta,!0,"f"),clearTimeout(O(this,Aa,"f")),O(this,Ia,"f")&&O(this,Ia,"f").call(this),O(this,Pn,"f").clear(),O(this,br,"f")&&(clearTimeout(O(this,br,"f")),Fe(this,br,void 0,"f")),O(this,Qr,"f")&&O(this,An,"f").disposeQuerySubscription(O(this,Ii,"f"),O(this,Qr,"f")).catch(e=>console.error("Error disposing query subscription:",e))}};Ii=new WeakMap,Qr=new WeakMap,An=new WeakMap,Pn=new WeakMap,Aa=new WeakMap,Ia=new WeakMap,Ti=new WeakMap,Ta=new WeakMap,Ns=new WeakMap,br=new WeakMap,Oa=new WeakMap,xl=new WeakSet,h1=function t(e){for(let r of O(this,Pn,"f"))try{r(e)}catch(n){console.error("Error in query subscription callback:",n)}};var Di=class{constructor(t,e){he.set(this,void 0),ge.set(this,void 0),In.set(this,void 0),Tn.set(this,void 0),On.set(this,void 0),Da.set(this,void 0),Fe(this,In,[],"f"),Fe(this,Tn,[],"f"),Fe(this,On,[],"f"),Fe(this,Da,[],"f"),Fe(this,he,t,"f"),Fe(this,ge,e,"f"),this.uuid=O(this,he,"f").uuid,this.name=O(this,he,"f").name,this.sharedUrl=O(this,he,"f").sharedUrl,this.neighbourhood=O(this,he,"f").neighbourhood,this.state=O(this,he,"f").state,O(this,ge,"f").addPerspectiveLinkAddedListener(O(this,he,"f").uuid,O(this,In,"f")),O(this,ge,"f").addPerspectiveLinkRemovedListener(O(this,he,"f").uuid,O(this,Tn,"f")),O(this,ge,"f").addPerspectiveLinkUpdatedListener(O(this,he,"f").uuid,O(this,On,"f")),O(this,ge,"f").addPerspectiveSyncStateChangeListener(O(this,he,"f").uuid,O(this,Da,"f"))}async executeAction(t,e,r,n){return await O(this,ge,"f").executeCommands(O(this,he,"f").uuid,JSON.stringify(t),e,JSON.stringify(r),n)}async get(t){return await O(this,ge,"f").queryLinks(O(this,he,"f").uuid,t)}async infer(t){return await O(this,ge,"f").queryProlog(O(this,he,"f").uuid,t)}async add(t,e="shared",r){return await O(this,ge,"f").addLink(O(this,he,"f").uuid,t,e,r)}async addLinks(t,e="shared",r){return await O(this,ge,"f").addLinks(O(this,he,"f").uuid,t,e,r)}async removeLinks(t,e){return await O(this,ge,"f").removeLinks(O(this,he,"f").uuid,t,e)}async linkMutations(t,e="shared"){return await O(this,ge,"f").linkMutations(O(this,he,"f").uuid,t,e)}async addLinkExpression(t,e="shared",r){return await O(this,ge,"f").addLinkExpression(O(this,he,"f").uuid,t,e,r)}async update(t,e,r){return await O(this,ge,"f").updateLink(O(this,he,"f").uuid,t,e,r)}async remove(t,e){return await O(this,ge,"f").removeLink(O(this,he,"f").uuid,t,e)}async createBatch(){return await O(this,ge,"f").createBatch(O(this,he,"f").uuid)}async commitBatch(t){return await O(this,ge,"f").commitBatch(O(this,he,"f").uuid,t)}async getExpression(t){return await O(this,ge,"f").getExpression(t)}async createExpression(t,e){return await O(this,ge,"f").createExpression(t,e)}async addListener(t,e){t==="link-added"?O(this,In,"f").push(e):t==="link-removed"?O(this,Tn,"f").push(e):t==="link-updated"&&O(this,On,"f").push(e)}async addSyncStateChangeListener(t){O(this,Da,"f").push(t)}async removeListener(t,e){if(t==="link-added"){let r=O(this,In,"f").indexOf(e);O(this,In,"f").splice(r,1)}else if(t==="link-removed"){let r=O(this,Tn,"f").indexOf(e);O(this,Tn,"f").splice(r,1)}else if(t==="link-updated"){let r=O(this,On,"f").indexOf(e);O(this,On,"f").splice(r,1)}}async snapshot(){return O(this,ge,"f").snapshotByUUID(O(this,he,"f").uuid)}async loadSnapshot(t){let e=JSON.parse(JSON.stringify(t));delete e.__typename,e.links.forEach(r=>{delete r.data.__typename});for(let r of e.links)await this.addLinkExpression(r)}async getSingleTarget(t){delete t.target;let e=await this.get(t);return e.length?e[0].data.target:null}async setSingleTarget(t,e="shared"){let r=new ot({source:t.source,predicate:t.predicate}),n=await this.get(r),i=[];for(let o of n)delete o.__typename,delete o.data.__typename,delete o.proof.__typename,i.push(o);let a=[t];await this.linkMutations({additions:a,removals:i},e)}async sdnaFlows(){return(await this.infer("register_sdna_flow(X, _)")).map(e=>e.X)}async availableFlows(t){return(await this.infer(`flowable("${t}", F), register_sdna_flow(X, F)`)).map(r=>r.X)}async startFlow(flowName,exprAddr){let startAction=await this.infer(`start_action(Action, F), register_sdna_flow("${flowName}", F)`);startAction=eval(startAction[0].Action),await this.executeAction(startAction,exprAddr,void 0)}async expressionsInFlowState(t,e){return(await this.infer(`register_sdna_flow("${t}", F), flow_state(X, ${e}, F)`)).map(n=>n.X)}async flowState(t,e){return(await this.infer(`register_sdna_flow("${t}", F), flow_state("${e}", X, F)`))[0].X}async flowActions(t,e){return(await this.infer(`register_sdna_flow("${t}", Flow), flow_state("${e}", State, Flow), action(State, Name, _, _)`)).map(n=>n.Name)}async runFlowAction(flowName,exprAddr,actionName){let action=await this.infer(`register_sdna_flow("${flowName}", Flow), flow_state("${exprAddr}", State, Flow), action(State, "${actionName}", _, Action)`);action=eval(action[0].Action),await this.executeAction(action,exprAddr,void 0)}async getSdna(){let t=["ad4m://has_subject_class","ad4m://has_flow","ad4m://has_custom_sdna"],e=[];for(let r of t){let n=await this.get(new ot({source:"ad4m://self",predicate:r}));for(let i of n){let a=i.data.target,o=await this.get(new ot({source:a,predicate:"ad4m://sdna"}));for(let s of o){let u=It.fromUrl(s.data.target).get();typeof u=="string"&&e.push(u)}}}return e}async getSdnaForClass(t){let e=It.from(t);if((await this.get(new ot({source:"ad4m://self",target:e.toUrl(),predicate:"ad4m://has_subject_class"}))).length===0)return null;let n=await this.get(new ot({source:e.toUrl(),predicate:"ad4m://sdna"}));if(n.length===0)return null;let i=It.fromUrl(n[0].data.target).get();return typeof i=="string"?i:null}async addSdna(t,e,r){return O(this,ge,"f").addSdna(O(this,he,"f").uuid,t,e,r)}async subjectClasses(){try{return(await this.infer("subject_class(X, _)")).map(t=>t.X)}catch{return[]}}async stringOrTemplateObjectToSubjectClassName(t){if(typeof t=="string")return t;{let e=await this.subjectClassesByTemplate(t);return e[0]?e[0]:t.className}}async createSubject(t,e,r,n){let i;if(typeof t=="string")i=t,await O(this,ge,"f").createSubject(O(this,he,"f").uuid,JSON.stringify({className:i,initialValues:r}),e,r?JSON.stringify(r):void 0,n);else{let a=this.buildQueryFromTemplate(t);await O(this,ge,"f").createSubject(O(this,he,"f").uuid,JSON.stringify({query:a,initialValues:r}),e,r?JSON.stringify(r):void 0,n)}return n?e:this.getSubjectProxy(e,t)}async getSubjectData(t,e){if(typeof t=="string")return JSON.parse(await O(this,ge,"f").getSubjectData(O(this,he,"f").uuid,JSON.stringify({className:t}),e));let r=this.buildQueryFromTemplate(t);return JSON.parse(await O(this,ge,"f").getSubjectData(O(this,he,"f").uuid,JSON.stringify({query:r}),e))}async removeSubject(subjectClass,exprAddr,batchId){let className=await this.stringOrTemplateObjectToSubjectClassName(subjectClass),result=await this.infer(`subject_class("${className}", C), destructor(C, Actions)`);if(!result.length)throw"No destructor found for given subject class: "+className;let actions=result.map(x=>eval(x.Actions));await this.executeAction(actions[0],exprAddr,void 0,batchId)}async isSubjectInstance(t,e){let r=await this.stringOrTemplateObjectToSubjectClassName(e),n=!1,i=5,a=0;for(;a<i&&!n;)n=await this.infer(`subject_class("${r}", C), instance(C, "${t}")`),a++;return n}async getSubjectProxy(t,e){if(!await this.isSubjectInstance(t,e))throw`Expression ${t} is not a subject instance of given class: ${JSON.stringify(e)}`;let r=await this.stringOrTemplateObjectToSubjectClassName(e),n=new Ys(this,t,r);return await n.init(),n}async getAllSubjectInstances(t){let e=[];typeof t=="string"?e=[t]:e=await this.subjectClassesByTemplate(t);let r=[];for(let n of e){let i=await this.infer(`subject_class("${n}", C), instance(C, X)`),a=await Promise.all(i.map(async o=>await this.getSubjectProxy(o.X,n)));r=r.concat(a)}return r}async getAllSubjectProxies(t){let e=[];typeof t=="string"?e=[t]:e=await this.subjectClassesByTemplate(t);let r=[];for(let n of e)r=await this.infer(`subject_class("${n}", C), instance(C, X)`);return r}buildQueryFromTemplate(t){let e;return function(r){let n=[],i=[];Object.getPrototypeOf(r).__properties?Object.keys(Object.getPrototypeOf(r).__properties).forEach(l=>n.push(l)):n.push(...Object.keys(r).filter(l=>!Array.isArray(r[l]))),Object.getPrototypeOf(r).__collections?Object.keys(Object.getPrototypeOf(r).__collections).filter(l=>l!=="isSubjectInstance").forEach(l=>{i.includes(l)||i.push(l)}):i.push(...Object.keys(r).filter(l=>Array.isArray(r[l])).filter(l=>l!=="isSubjectInstance"));let a=Object.getOwnPropertyNames(r).filter(l=>typeof r[l]=="function"&&l.startsWith("set")&&!l.startsWith("setCollection"));a=a.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("set")&&!l.startsWith("setCollection")}));let o=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("add"));o=o.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("add")}));let s=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("remove"));s=s.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("remove")}));let u=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("setCollection"));u=u.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("setCollection")}));let c="subject_class(Class, C)";for(let l of n)c+=`, property(C, "${l}")`;for(let l of i)c+=`, collection(C, "${l}")`;for(let l of a){let d=l.substring(3);d=d.charAt(0).toLowerCase()+d.slice(1),c+=`, property_setter(C, "${d}", _)`}for(let l of o)c+=`, collection_adder(C, "${c0(l)}", _)`;for(let l of s)c+=`, collection_remover(C, "${l0(l)}", _)`;for(let l of u)c+=`, collection_setter(C, "${p0(l)}", _)`;c+=".",e=c}(t),e}async subjectClassesByTemplate(t){let e=this.buildQueryFromTemplate(t),r=await this.infer(e);return r?r.map(n=>n.Class):[]}async ensureSDNASubjectClass(t){if((await this.subjectClassesByTemplate(new t)).length>0)return;let{name:r,sdna:n}=t.generateSDNA();await this.addSdna(r,n,"subject_class")}getNeighbourhoodProxy(){return O(this,ge,"f").getNeighbourhoodProxy(O(this,he,"f").uuid)}get ai(){return O(this,ge,"f").aiClient}async subscribeInfer(t){let e=new El(this.uuid,t,O(this,ge,"f"));return await e.subscribe(),await e.initialized,e}};he=new WeakMap,ge=new WeakMap,In=new WeakMap,Tn=new WeakMap,On=new WeakMap,Da=new WeakMap;var Br=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},W=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)},ae,Na,Pa,Ra,Ps,$a,Rs,$s,ut=`
64
64
  author
65
65
  timestamp
66
66
  status
67
67
  data { source, predicate, target }
68
68
  proof { valid, invalid, signature, key }
69
- `,wi=`
69
+ `,Si=`
70
70
  uuid
71
71
  name
72
72
  sharedUrl
@@ -86,128 +86,128 @@ neighbourhood {
86
86
  }
87
87
  author
88
88
  }
89
- `,Ws=class{constructor(e,r=!0){te.set(this,void 0),Ta.set(this,void 0),Oa.set(this,void 0),Da.set(this,void 0),Is.set(this,void 0),Na.set(this,void 0),As.set(this,void 0),Ts.set(this,void 0),Br(this,te,e,"f"),Br(this,Ta,[],"f"),Br(this,Oa,[],"f"),Br(this,Da,[],"f"),Br(this,Is,[],"f"),r&&(this.subscribePerspectiveAdded(),this.subscribePerspectiveUpdated(),this.subscribePerspectiveRemoved())}setExpressionClient(e){Br(this,Na,e,"f")}setNeighbourhoodClient(e){Br(this,As,e,"f")}setAIClient(e){Br(this,Ts,e,"f")}get aiClient(){return H(this,Ts,"f")}async all(){let{perspectives:e}=I(await H(this,te,"f").query({query:E`query perspectives {
89
+ `,Xs=class{constructor(e,r=!0){ae.set(this,void 0),Na.set(this,void 0),Pa.set(this,void 0),Ra.set(this,void 0),Ps.set(this,void 0),$a.set(this,void 0),Rs.set(this,void 0),$s.set(this,void 0),Br(this,ae,e,"f"),Br(this,Na,[],"f"),Br(this,Pa,[],"f"),Br(this,Ra,[],"f"),Br(this,Ps,[],"f"),r&&(this.subscribePerspectiveAdded(),this.subscribePerspectiveUpdated(),this.subscribePerspectiveRemoved())}setExpressionClient(e){Br(this,$a,e,"f")}setNeighbourhoodClient(e){Br(this,Rs,e,"f")}setAIClient(e){Br(this,$s,e,"f")}get aiClient(){return W(this,$s,"f")}async all(){let{perspectives:e}=A(await W(this,ae,"f").query({query:E`query perspectives {
90
90
  perspectives {
91
- ${wi}
91
+ ${Si}
92
92
  }
93
- }`}));return e.map(r=>new Oi(r,this))}async byUUID(e){let{perspective:r}=I(await H(this,te,"f").query({query:E`query perspective($uuid: String!) {
93
+ }`}));return e.map(r=>new Di(r,this))}async byUUID(e){let{perspective:r}=A(await W(this,ae,"f").query({query:E`query perspective($uuid: String!) {
94
94
  perspective(uuid: $uuid) {
95
- ${wi}
95
+ ${Si}
96
96
  }
97
- }`,variables:{uuid:e}}));return r?new Oi(r,this):null}async snapshotByUUID(e){let{perspectiveSnapshot:r}=I(await H(this,te,"f").query({query:E`query perspectiveSnapshot($uuid: String!) {
97
+ }`,variables:{uuid:e}}));return r?new Di(r,this):null}async snapshotByUUID(e){let{perspectiveSnapshot:r}=A(await W(this,ae,"f").query({query:E`query perspectiveSnapshot($uuid: String!) {
98
98
  perspectiveSnapshot(uuid: $uuid) {
99
- links { ${ct} }
99
+ links { ${ut} }
100
100
  }
101
- }`,variables:{uuid:e}}));return r}async publishSnapshotByUUID(e){let{perspectivePublishSnapshot:r}=I(await H(this,te,"f").mutate({mutation:E`mutation perspectivePublishSnapshot($uuid: String!) {
101
+ }`,variables:{uuid:e}}));return r}async publishSnapshotByUUID(e){let{perspectivePublishSnapshot:r}=A(await W(this,ae,"f").mutate({mutation:E`mutation perspectivePublishSnapshot($uuid: String!) {
102
102
  perspectivePublishSnapshot(uuid: $uuid)
103
- }`,variables:{uuid:e}}));return r}async queryLinks(e,r){let{perspectiveQueryLinks:n}=I(await H(this,te,"f").query({query:E`query perspectiveQueryLinks($uuid: String!, $query: LinkQuery!) {
103
+ }`,variables:{uuid:e}}));return r}async queryLinks(e,r){let{perspectiveQueryLinks:n}=A(await W(this,ae,"f").query({query:E`query perspectiveQueryLinks($uuid: String!, $query: LinkQuery!) {
104
104
  perspectiveQueryLinks(query: $query, uuid: $uuid) {
105
- ${ct}
105
+ ${ut}
106
106
  }
107
- }`,variables:{uuid:e,query:r}}));return n}async queryProlog(e,r){let{perspectiveQueryProlog:n}=I(await H(this,te,"f").query({query:E`query perspectiveQueryProlog($uuid: String!, $query: String!) {
107
+ }`,variables:{uuid:e,query:r}}));return n}async queryProlog(e,r){let{perspectiveQueryProlog:n}=A(await W(this,ae,"f").query({query:E`query perspectiveQueryProlog($uuid: String!, $query: String!) {
108
108
  perspectiveQueryProlog(uuid: $uuid, query: $query)
109
- }`,variables:{uuid:e,query:r}}));return JSON.parse(n)}async subscribeQuery(e,r){let{perspectiveSubscribeQuery:n}=I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveSubscribeQuery($uuid: String!, $query: String!) {
109
+ }`,variables:{uuid:e,query:r}}));return JSON.parse(n)}async subscribeQuery(e,r){let{perspectiveSubscribeQuery:n}=A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveSubscribeQuery($uuid: String!, $query: String!) {
110
110
  perspectiveSubscribeQuery(uuid: $uuid, query: $query) {
111
111
  subscriptionId
112
112
  result
113
113
  }
114
- }`,variables:{uuid:e,query:r}})),{subscriptionId:i,result:a}=n,o=a,s=!1;o.startsWith("#init#")&&(o=o.substring(6),s=!0);try{o=JSON.parse(o)}catch(u){console.error("Error parsing perspectiveSubscribeQuery result:",u)}return{subscriptionId:i,result:o,isInit:s}}subscribeToQueryUpdates(e,r){let n=H(this,te,"f").subscribe({query:E`
114
+ }`,variables:{uuid:e,query:r}})),{subscriptionId:i,result:a}=n,o=a,s=!1;o.startsWith("#init#")&&(o=o.substring(6),s=!0);try{o=JSON.parse(o)}catch(u){console.error("Error parsing perspectiveSubscribeQuery result:",u)}return{subscriptionId:i,result:o,isInit:s}}subscribeToQueryUpdates(e,r){let n=W(this,ae,"f").subscribe({query:E`
115
115
  subscription perspectiveQuerySubscription($subscriptionId: String!) {
116
116
  perspectiveQuerySubscription(subscriptionId: $subscriptionId)
117
117
  }
118
- `,variables:{subscriptionId:e}}).subscribe({next:i=>{if(i.data&&i.data.perspectiveQuerySubscription){let a=i.data.perspectiveQuerySubscription,o=!1;a.startsWith("#init#")&&(a=a.substring(6),o=!0);try{a=JSON.parse(a),o&&typeof a=="object"&&(a.isInit=!0)}catch(s){console.error("Error parsing perspectiveQuerySubscription:",s)}r(a)}},error:i=>console.error("Error in query subscription:",i)});return()=>n.unsubscribe()}async keepAliveQuery(e,r){let{perspectiveKeepAliveQuery:n}=I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveKeepAliveQuery($uuid: String!, $subscriptionId: String!) {
118
+ `,variables:{subscriptionId:e}}).subscribe({next:i=>{if(i.data&&i.data.perspectiveQuerySubscription){let a=i.data.perspectiveQuerySubscription,o=!1;a.startsWith("#init#")&&(a=a.substring(6),o=!0);try{a=JSON.parse(a),o&&typeof a=="object"&&(a.isInit=!0)}catch(s){console.error("Error parsing perspectiveQuerySubscription:",s)}r(a)}},error:i=>console.error("Error in query subscription:",i)});return()=>n.unsubscribe()}async keepAliveQuery(e,r){let{perspectiveKeepAliveQuery:n}=A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveKeepAliveQuery($uuid: String!, $subscriptionId: String!) {
119
119
  perspectiveKeepAliveQuery(uuid: $uuid, subscriptionId: $subscriptionId)
120
- }`,variables:{uuid:e,subscriptionId:r}}));return n}async disposeQuerySubscription(e,r){let{perspectiveDisposeQuerySubscription:n}=I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveDisposeQuerySubscription($uuid: String!, $subscriptionId: String!) {
120
+ }`,variables:{uuid:e,subscriptionId:r}}));return n}async disposeQuerySubscription(e,r){let{perspectiveDisposeQuerySubscription:n}=A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveDisposeQuerySubscription($uuid: String!, $subscriptionId: String!) {
121
121
  perspectiveDisposeQuerySubscription(uuid: $uuid, subscriptionId: $subscriptionId)
122
- }`,variables:{uuid:e,subscriptionId:r}}));return n}async add(e){let{perspectiveAdd:r}=I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveAdd($name: String!) {
122
+ }`,variables:{uuid:e,subscriptionId:r}}));return n}async add(e){let{perspectiveAdd:r}=A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveAdd($name: String!) {
123
123
  perspectiveAdd(name: $name) {
124
- ${wi}
124
+ ${Si}
125
125
  }
126
- }`,variables:{name:e}}));return new Oi(r,this)}async update(e,r){let{perspectiveUpdate:n}=I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveUpdate($uuid: String!, $name: String!) {
126
+ }`,variables:{name:e}}));return new Di(r,this)}async update(e,r){let{perspectiveUpdate:n}=A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveUpdate($uuid: String!, $name: String!) {
127
127
  perspectiveUpdate(uuid: $uuid, name: $name) {
128
- ${wi}
128
+ ${Si}
129
129
  }
130
- }`,variables:{uuid:e,name:r}}));return new Oi(n,this)}async remove(e){return I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveRemove($uuid: String!) {
130
+ }`,variables:{uuid:e,name:r}}));return new Di(n,this)}async remove(e){return A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveRemove($uuid: String!) {
131
131
  perspectiveRemove(uuid: $uuid)
132
- }`,variables:{uuid:e}}))}async addLink(e,r,n="shared",i){let{perspectiveAddLink:a}=I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveAddLink($uuid: String!, $link: LinkInput!, $status: String!, $batchId: String) {
132
+ }`,variables:{uuid:e}}))}async addLink(e,r,n="shared",i){let{perspectiveAddLink:a}=A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveAddLink($uuid: String!, $link: LinkInput!, $status: String!, $batchId: String) {
133
133
  perspectiveAddLink(uuid: $uuid, link: $link, status: $status, batchId: $batchId) {
134
- ${ct}
134
+ ${ut}
135
135
  }
136
- }`,variables:{uuid:e,link:r,status:n,batchId:i}}));return a}async addLinks(e,r,n="shared",i){let{perspectiveAddLinks:a}=I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveAddLinks($uuid: String!, $links: [LinkInput!]!, $status: String!, $batchId: String) {
136
+ }`,variables:{uuid:e,link:r,status:n,batchId:i}}));return a}async addLinks(e,r,n="shared",i){let{perspectiveAddLinks:a}=A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveAddLinks($uuid: String!, $links: [LinkInput!]!, $status: String!, $batchId: String) {
137
137
  perspectiveAddLinks(uuid: $uuid, links: $links, status: $status, batchId: $batchId) {
138
- ${ct}
138
+ ${ut}
139
139
  }
140
- }`,variables:{uuid:e,links:r,status:n,batchId:i}}));return a}async removeLinks(e,r,n){let{perspectiveRemoveLinks:i}=I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveRemoveLinks($uuid: String!, $links: [LinkExpressionInput!]!, $batchId: String) {
140
+ }`,variables:{uuid:e,links:r,status:n,batchId:i}}));return a}async removeLinks(e,r,n){let{perspectiveRemoveLinks:i}=A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveRemoveLinks($uuid: String!, $links: [LinkExpressionInput!]!, $batchId: String) {
141
141
  perspectiveRemoveLinks(uuid: $uuid, links: $links, batchId: $batchId) {
142
- ${ct}
142
+ ${ut}
143
143
  }
144
- }`,variables:{uuid:e,links:r,batchId:n}}));return i}async linkMutations(e,r,n){let{perspectiveLinkMutations:i}=I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveLinkMutations($uuid: String!, $mutations: LinkMutations!, $status: String){
144
+ }`,variables:{uuid:e,links:r,batchId:n}}));return i}async linkMutations(e,r,n){let{perspectiveLinkMutations:i}=A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveLinkMutations($uuid: String!, $mutations: LinkMutations!, $status: String){
145
145
  perspectiveLinkMutations(mutations: $mutations, uuid: $uuid, status: $status) {
146
146
  additions {
147
- ${ct}
147
+ ${ut}
148
148
  }
149
149
  removals {
150
- ${ct}
150
+ ${ut}
151
151
  }
152
152
  }
153
- }`,variables:{uuid:e,mutations:r,status:n}}));return i}async addLinkExpression(e,r,n="shared",i){let{perspectiveAddLinkExpression:a}=I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveAddLinkExpression($uuid: String!, $link: LinkExpressionInput!, $status: String!, $batchId: String) {
153
+ }`,variables:{uuid:e,mutations:r,status:n}}));return i}async addLinkExpression(e,r,n="shared",i){let{perspectiveAddLinkExpression:a}=A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveAddLinkExpression($uuid: String!, $link: LinkExpressionInput!, $status: String!, $batchId: String) {
154
154
  perspectiveAddLinkExpression(uuid: $uuid, link: $link, status: $status, batchId: $batchId) {
155
- ${ct}
155
+ ${ut}
156
156
  }
157
- }`,variables:{uuid:e,link:r,status:n,batchId:i}}));return a}async updateLink(e,r,n,i){let{perspectiveUpdateLink:a}=I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveUpdateLink($uuid: String!, $oldLink: LinkExpressionInput!, $newLink: LinkInput!, $batchId: String) {
157
+ }`,variables:{uuid:e,link:r,status:n,batchId:i}}));return a}async updateLink(e,r,n,i){let{perspectiveUpdateLink:a}=A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveUpdateLink($uuid: String!, $oldLink: LinkExpressionInput!, $newLink: LinkInput!, $batchId: String) {
158
158
  perspectiveUpdateLink(uuid: $uuid, oldLink: $oldLink, newLink: $newLink, batchId: $batchId) {
159
- ${ct}
159
+ ${ut}
160
160
  }
161
- }`,variables:{uuid:e,oldLink:r,newLink:n,batchId:i}}));return a}async removeLink(e,r,n){delete r.__typename,delete r.data.__typename,delete r.proof.__typename,delete r.status;let{perspectiveRemoveLink:i}=I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveRemoveLink($link: LinkExpressionInput!, $uuid: String!, $batchId: String) {
161
+ }`,variables:{uuid:e,oldLink:r,newLink:n,batchId:i}}));return a}async removeLink(e,r,n){delete r.__typename,delete r.data.__typename,delete r.proof.__typename,delete r.status;let{perspectiveRemoveLink:i}=A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveRemoveLink($link: LinkExpressionInput!, $uuid: String!, $batchId: String) {
162
162
  perspectiveRemoveLink(link: $link, uuid: $uuid, batchId: $batchId)
163
- }`,variables:{uuid:e,link:r,batchId:n}}));return i}async addSdna(e,r,n,i){return I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveAddSdna($uuid: String!, $name: String!, $sdnaCode: String!, $sdnaType: String!) {
163
+ }`,variables:{uuid:e,link:r,batchId:n}}));return i}async addSdna(e,r,n,i){return A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveAddSdna($uuid: String!, $name: String!, $sdnaCode: String!, $sdnaType: String!) {
164
164
  perspectiveAddSdna(uuid: $uuid, name: $name, sdnaCode: $sdnaCode, sdnaType: $sdnaType)
165
- }`,variables:{uuid:e,name:r,sdnaCode:n,sdnaType:i}})).perspectiveAddSdna}async executeCommands(e,r,n,i,a){return I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveExecuteCommands($uuid: String!, $commands: String!, $expression: String!, $parameters: String, $batchId: String) {
165
+ }`,variables:{uuid:e,name:r,sdnaCode:n,sdnaType:i}})).perspectiveAddSdna}async executeCommands(e,r,n,i,a){return A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveExecuteCommands($uuid: String!, $commands: String!, $expression: String!, $parameters: String, $batchId: String) {
166
166
  perspectiveExecuteCommands(uuid: $uuid, commands: $commands, expression: $expression, parameters: $parameters, batchId: $batchId)
167
- }`,variables:{uuid:e,commands:r,expression:n,parameters:i,batchId:a}})).perspectiveExecuteCommands}async createSubject(e,r,n,i,a){return I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveCreateSubject($uuid: String!, $subjectClass: String!, $expressionAddress: String!, $initialValues: String, $batchId: String) {
167
+ }`,variables:{uuid:e,commands:r,expression:n,parameters:i,batchId:a}})).perspectiveExecuteCommands}async createSubject(e,r,n,i,a){return A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveCreateSubject($uuid: String!, $subjectClass: String!, $expressionAddress: String!, $initialValues: String, $batchId: String) {
168
168
  perspectiveCreateSubject(uuid: $uuid, subjectClass: $subjectClass, expressionAddress: $expressionAddress, initialValues: $initialValues, batchId: $batchId)
169
- }`,variables:{uuid:e,subjectClass:r,expressionAddress:n,initialValues:i,batchId:a}})).perspectiveCreateSubject}async getSubjectData(e,r,n){return I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveGetSubjectData($uuid: String!, $subjectClass: String!, $expressionAddress: String!) {
169
+ }`,variables:{uuid:e,subjectClass:r,expressionAddress:n,initialValues:i,batchId:a}})).perspectiveCreateSubject}async getSubjectData(e,r,n){return A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveGetSubjectData($uuid: String!, $subjectClass: String!, $expressionAddress: String!) {
170
170
  perspectiveGetSubjectData(uuid: $uuid, subjectClass: $subjectClass, expressionAddress: $expressionAddress)
171
- }`,variables:{uuid:e,subjectClass:r,expressionAddress:n}})).perspectiveGetSubjectData}async getExpression(e){return await H(this,Na,"f").get(e)}async createExpression(e,r){return await H(this,Na,"f").create(e,r)}addPerspectiveAddedListener(e){H(this,Ta,"f").push(e)}subscribePerspectiveAdded(){H(this,te,"f").subscribe({query:E` subscription {
172
- perspectiveAdded { ${wi} }
171
+ }`,variables:{uuid:e,subjectClass:r,expressionAddress:n}})).perspectiveGetSubjectData}async getExpression(e){return await W(this,$a,"f").get(e)}async createExpression(e,r){return await W(this,$a,"f").create(e,r)}addPerspectiveAddedListener(e){W(this,Na,"f").push(e)}subscribePerspectiveAdded(){W(this,ae,"f").subscribe({query:E` subscription {
172
+ perspectiveAdded { ${Si} }
173
173
  }
174
- `}).subscribe({next:e=>{H(this,Ta,"f").forEach(r=>{r(e.data.perspectiveAdded)})},error:e=>console.error(e)})}addPerspectiveUpdatedListener(e){H(this,Oa,"f").push(e)}subscribePerspectiveUpdated(){H(this,te,"f").subscribe({query:E` subscription {
175
- perspectiveUpdated { ${wi} }
174
+ `}).subscribe({next:e=>{W(this,Na,"f").forEach(r=>{r(e.data.perspectiveAdded)})},error:e=>console.error(e)})}addPerspectiveUpdatedListener(e){W(this,Pa,"f").push(e)}subscribePerspectiveUpdated(){W(this,ae,"f").subscribe({query:E` subscription {
175
+ perspectiveUpdated { ${Si} }
176
176
  }
177
- `}).subscribe({next:e=>{H(this,Oa,"f").forEach(r=>{r(e.data.perspectiveUpdated)})},error:e=>console.error(e)})}addPerspectiveSyncedListener(e){H(this,Is,"f").push(e)}async addPerspectiveSyncStateChangeListener(e,r){H(this,te,"f").subscribe({query:E` subscription {
177
+ `}).subscribe({next:e=>{W(this,Pa,"f").forEach(r=>{r(e.data.perspectiveUpdated)})},error:e=>console.error(e)})}addPerspectiveSyncedListener(e){W(this,Ps,"f").push(e)}async addPerspectiveSyncStateChangeListener(e,r){W(this,ae,"f").subscribe({query:E` subscription {
178
178
  perspectiveSyncStateChange(uuid: "${e}")
179
179
  }
180
- `}).subscribe({next:n=>{r.forEach(i=>{i(n.data.perspectiveSyncStateChange)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}addPerspectiveRemovedListener(e){H(this,Da,"f").push(e)}subscribePerspectiveRemoved(){H(this,te,"f").subscribe({query:E` subscription {
180
+ `}).subscribe({next:n=>{r.forEach(i=>{i(n.data.perspectiveSyncStateChange)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}addPerspectiveRemovedListener(e){W(this,Ra,"f").push(e)}subscribePerspectiveRemoved(){W(this,ae,"f").subscribe({query:E` subscription {
181
181
  perspectiveRemoved
182
182
  }
183
- `}).subscribe({next:e=>{H(this,Da,"f").forEach(r=>{r(e.data.perspectiveRemoved)})},error:e=>console.error(e)})}async addPerspectiveLinkAddedListener(e,r){H(this,te,"f").subscribe({query:E` subscription {
184
- perspectiveLinkAdded(uuid: "${e}") { ${ct} }
183
+ `}).subscribe({next:e=>{W(this,Ra,"f").forEach(r=>{r(e.data.perspectiveRemoved)})},error:e=>console.error(e)})}async addPerspectiveLinkAddedListener(e,r){W(this,ae,"f").subscribe({query:E` subscription {
184
+ perspectiveLinkAdded(uuid: "${e}") { ${ut} }
185
185
  }
186
- `}).subscribe({next:n=>{r.forEach(i=>{i(n.data.perspectiveLinkAdded)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}async addPerspectiveLinkRemovedListener(e,r){H(this,te,"f").subscribe({query:E` subscription {
187
- perspectiveLinkRemoved(uuid: "${e}") { ${ct} }
186
+ `}).subscribe({next:n=>{r.forEach(i=>{i(n.data.perspectiveLinkAdded)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}async addPerspectiveLinkRemovedListener(e,r){W(this,ae,"f").subscribe({query:E` subscription {
187
+ perspectiveLinkRemoved(uuid: "${e}") { ${ut} }
188
188
  }
189
- `}).subscribe({next:n=>{r.forEach(i=>{n.data.perspectiveLinkRemoved.status||delete n.data.perspectiveLinkRemoved.status,i(n.data.perspectiveLinkRemoved)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}async addPerspectiveLinkUpdatedListener(e,r){H(this,te,"f").subscribe({query:E` subscription {
189
+ `}).subscribe({next:n=>{r.forEach(i=>{n.data.perspectiveLinkRemoved.status||delete n.data.perspectiveLinkRemoved.status,i(n.data.perspectiveLinkRemoved)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}async addPerspectiveLinkUpdatedListener(e,r){W(this,ae,"f").subscribe({query:E` subscription {
190
190
  perspectiveLinkUpdated(uuid: "${e}") {
191
191
  oldLink {
192
- ${ct}
192
+ ${ut}
193
193
  }
194
194
  newLink {
195
- ${ct}
195
+ ${ut}
196
196
  }
197
197
  }
198
198
  }
199
- `}).subscribe({next:n=>{r.forEach(i=>{n.data.perspectiveLinkUpdated.newLink.status||delete n.data.perspectiveLinkUpdated.newLink.status,n.data.perspectiveLinkUpdated.oldLink.status||delete n.data.perspectiveLinkUpdated.oldLink.status,i(n.data.perspectiveLinkUpdated)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}getNeighbourhoodProxy(e){return new bl(H(this,As,"f"),e)}async createBatch(e){let{perspectiveCreateBatch:r}=I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveCreateBatch($uuid: String!) {
199
+ `}).subscribe({next:n=>{r.forEach(i=>{n.data.perspectiveLinkUpdated.newLink.status||delete n.data.perspectiveLinkUpdated.newLink.status,n.data.perspectiveLinkUpdated.oldLink.status||delete n.data.perspectiveLinkUpdated.oldLink.status,i(n.data.perspectiveLinkUpdated)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}getNeighbourhoodProxy(e){return new Cl(W(this,Rs,"f"),e)}async createBatch(e){let{perspectiveCreateBatch:r}=A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveCreateBatch($uuid: String!) {
200
200
  perspectiveCreateBatch(uuid: $uuid)
201
- }`,variables:{uuid:e}}));return r}async commitBatch(e,r){let{perspectiveCommitBatch:n}=I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveCommitBatch($uuid: String!, $batchId: String!) {
201
+ }`,variables:{uuid:e}}));return r}async commitBatch(e,r){let{perspectiveCommitBatch:n}=A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveCommitBatch($uuid: String!, $batchId: String!) {
202
202
  perspectiveCommitBatch(uuid: $uuid, batchId: $batchId) {
203
203
  additions {
204
- ${ct}
204
+ ${ut}
205
205
  }
206
206
  removals {
207
- ${ct}
207
+ ${ut}
208
208
  }
209
209
  }
210
- }`,variables:{uuid:e,batchId:r}}));return n}};te=new WeakMap,Ta=new WeakMap,Oa=new WeakMap,Da=new WeakMap,Is=new WeakMap,Na=new WeakMap,As=new WeakMap,Ts=new WeakMap;var us=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},ce=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)},me,Pa,Ra,$a,_a=`
210
+ }`,variables:{uuid:e,batchId:r}}));return n}};ae=new WeakMap,Na=new WeakMap,Pa=new WeakMap,Ra=new WeakMap,Ps=new WeakMap,$a=new WeakMap,Rs=new WeakMap,$s=new WeakMap;var ms=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},le=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)},me,La,Fa,Ma,Ca=`
211
211
  did
212
212
  directMessageLanguage
213
213
  perspective {
@@ -221,7 +221,7 @@ neighbourhood {
221
221
  }
222
222
  }
223
223
  }
224
- `,ls=`
224
+ `,gs=`
225
225
  requestId
226
226
  revoked
227
227
  auth {
@@ -237,128 +237,136 @@ neighbourhood {
237
237
  can
238
238
  }
239
239
  }
240
- `,Si=`
240
+ `,Ci=`
241
241
  isInitialized
242
242
  isUnlocked
243
243
  did
244
244
  didDocument
245
245
  error
246
- `,ps=`
246
+ `,ys=`
247
247
  did
248
248
  didSigningKeyId
249
249
  deviceKeyType
250
250
  deviceKey
251
251
  deviceKeySignedByDid
252
252
  didSignedByDeviceKey
253
- `,c0=`
253
+ `,d0=`
254
254
  signature
255
255
  publicKey
256
- `,Ja=class{constructor(e,r=!0){me.set(this,void 0),Pa.set(this,void 0),Ra.set(this,void 0),$a.set(this,void 0),us(this,me,e,"f"),us(this,Ra,[],"f"),us(this,$a,[],"f"),us(this,Pa,[],"f"),r&&(this.subscribeAgentUpdated(),this.subscribeAgentStatusChanged(),this.subscribeAppsChanged())}async me(){let{agent:e}=I(await ce(this,me,"f").query({query:E`query agent { agent { ${_a} } }`})),r=new Wr(e.did,e.perspective);return r.directMessageLanguage=e.directMessageLanguage,r}async status(){let{agentStatus:e}=I(await ce(this,me,"f").query({query:E`query agentStatus {
256
+ `,ro=class{constructor(e,r=!0){me.set(this,void 0),La.set(this,void 0),Fa.set(this,void 0),Ma.set(this,void 0),ms(this,me,e,"f"),ms(this,Fa,[],"f"),ms(this,Ma,[],"f"),ms(this,La,[],"f"),r&&(this.subscribeAgentUpdated(),this.subscribeAgentStatusChanged(),this.subscribeAppsChanged())}async me(){let{agent:e}=A(await le(this,me,"f").query({query:E`query agent { agent { ${Ca} } }`})),r=new Wr(e.did,e.perspective);return r.directMessageLanguage=e.directMessageLanguage,r}async status(){let{agentStatus:e}=A(await le(this,me,"f").query({query:E`query agentStatus {
257
257
  agentStatus {
258
- ${Si}
258
+ ${Ci}
259
259
  }
260
- }`}));return new Lt(e)}async generate(e){let{agentGenerate:r}=I(await ce(this,me,"f").mutate({mutation:E`mutation agentGenerate(
260
+ }`}));return new Ft(e)}async generate(e){let{agentGenerate:r}=A(await le(this,me,"f").mutate({mutation:E`mutation agentGenerate(
261
261
  $passphrase: String!
262
262
  ) {
263
263
  agentGenerate(passphrase: $passphrase) {
264
- ${Si}
264
+ ${Ci}
265
265
  }
266
- }`,variables:{passphrase:e}}));return new Lt(r)}async import(e){let{did:r,didDocument:n,keystore:i,passphrase:a}=e,{agentImport:o}=I(await ce(this,me,"f").mutate({mutation:E`mutation agentImport(
266
+ }`,variables:{passphrase:e}}));return new Ft(r)}async import(e){let{did:r,didDocument:n,keystore:i,passphrase:a}=e,{agentImport:o}=A(await le(this,me,"f").mutate({mutation:E`mutation agentImport(
267
267
  $did: String!,
268
268
  $didDocument: String!,
269
269
  $keystore: String!,
270
270
  $passphrase: String!
271
271
  ) {
272
272
  agentImport(did: $did, didDocument: $didDocument, keystore: $keystore, passphrase: $passphrase) {
273
- ${Si}
273
+ ${Ci}
274
274
  }
275
- }`,variables:{did:r,didDocument:n,keystore:i,passphrase:a}}));return new Lt(o)}async lock(e){let{agentLock:r}=I(await ce(this,me,"f").mutate({mutation:E`mutation agentLock($passphrase: String!) {
275
+ }`,variables:{did:r,didDocument:n,keystore:i,passphrase:a}}));return new Ft(o)}async lock(e){let{agentLock:r}=A(await le(this,me,"f").mutate({mutation:E`mutation agentLock($passphrase: String!) {
276
276
  agentLock(passphrase: $passphrase) {
277
- ${Si}
277
+ ${Ci}
278
278
  }
279
- }`,variables:{passphrase:e}}));return new Lt(r)}async unlock(e,r=!0){let{agentUnlock:n}=I(await ce(this,me,"f").mutate({mutation:E`mutation agentUnlock($passphrase: String!, $holochain: Boolean!) {
279
+ }`,variables:{passphrase:e}}));return new Ft(r)}async unlock(e,r=!0){let{agentUnlock:n}=A(await le(this,me,"f").mutate({mutation:E`mutation agentUnlock($passphrase: String!, $holochain: Boolean!) {
280
280
  agentUnlock(passphrase: $passphrase, holochain: $holochain) {
281
- ${Si}
281
+ ${Ci}
282
282
  }
283
- }`,variables:{passphrase:e,holochain:r}}));return new Lt(n)}async byDID(e){let{agentByDID:r}=I(await ce(this,me,"f").query({query:E`query agentByDID($did: String!) {
283
+ }`,variables:{passphrase:e,holochain:r}}));return new Ft(n)}async byDID(e){let{agentByDID:r}=A(await le(this,me,"f").query({query:E`query agentByDID($did: String!) {
284
284
  agentByDID(did: $did) {
285
- ${_a}
285
+ ${Ca}
286
286
  }
287
- }`,variables:{did:e}}));return r}async updatePublicPerspective(e){let r=JSON.parse(JSON.stringify(e));delete r.__typename,r.links.forEach(o=>{delete o.__typename,delete o.data.__typename,delete o.proof.__typename,delete o.status});let{agentUpdatePublicPerspective:n}=I(await ce(this,me,"f").mutate({mutation:E`mutation agentUpdatePublicPerspective($perspective: PerspectiveInput!) {
287
+ }`,variables:{did:e}}));return r}async updatePublicPerspective(e){let r=JSON.parse(JSON.stringify(e));delete r.__typename,r.links.forEach(o=>{delete o.__typename,delete o.data.__typename,delete o.proof.__typename,delete o.status});let{agentUpdatePublicPerspective:n}=A(await le(this,me,"f").mutate({mutation:E`mutation agentUpdatePublicPerspective($perspective: PerspectiveInput!) {
288
288
  agentUpdatePublicPerspective(perspective: $perspective) {
289
- ${_a}
289
+ ${Ca}
290
290
  }
291
- }`,variables:{perspective:r}})),i=n,a=new Wr(i.did,i.perspective);return a.directMessageLanguage=i.directMessageLanguage,a}async mutatePublicPerspective(e){let r=new Ws(ce(this,me,"f")),n=new Ja(ce(this,me,"f")),i=await r.add("Agent Perspective Proxy"),a=await n.me();a.perspective&&await i.loadSnapshot(a.perspective);for(let u of e.additions)await i.add(u);for(let u of e.removals)await i.remove(u);let o=await i.snapshot(),s=await this.updatePublicPerspective(o);return await r.remove(i.uuid),s}async updateDirectMessageLanguage(e){let{agentUpdateDirectMessageLanguage:r}=I(await ce(this,me,"f").mutate({mutation:E`mutation agentUpdateDirectMessageLanguage($directMessageLanguage: String!) {
291
+ }`,variables:{perspective:r}})),i=n,a=new Wr(i.did,i.perspective);return a.directMessageLanguage=i.directMessageLanguage,a}async mutatePublicPerspective(e){let r=new Xs(le(this,me,"f")),n=new ro(le(this,me,"f")),i=await r.add("Agent Perspective Proxy"),a=await n.me();a.perspective&&await i.loadSnapshot(a.perspective);for(let u of e.additions)await i.add(u);for(let u of e.removals)await i.remove(u);let o=await i.snapshot(),s=await this.updatePublicPerspective(o);return await r.remove(i.uuid),s}async updateDirectMessageLanguage(e){let{agentUpdateDirectMessageLanguage:r}=A(await le(this,me,"f").mutate({mutation:E`mutation agentUpdateDirectMessageLanguage($directMessageLanguage: String!) {
292
292
  agentUpdateDirectMessageLanguage(directMessageLanguage: $directMessageLanguage) {
293
- ${_a}
293
+ ${Ca}
294
294
  }
295
- }`,variables:{directMessageLanguage:e}})),n=r,i=new Wr(n.did,n.perspective);return i.directMessageLanguage=n.directMessageLanguage,i}async addEntanglementProofs(e){let{agentAddEntanglementProofs:r}=I(await ce(this,me,"f").mutate({mutation:E`mutation agentAddEntanglementProofs($proofs: [EntanglementProofInput!]!) {
295
+ }`,variables:{directMessageLanguage:e}})),n=r,i=new Wr(n.did,n.perspective);return i.directMessageLanguage=n.directMessageLanguage,i}async addEntanglementProofs(e){let{agentAddEntanglementProofs:r}=A(await le(this,me,"f").mutate({mutation:E`mutation agentAddEntanglementProofs($proofs: [EntanglementProofInput!]!) {
296
296
  agentAddEntanglementProofs(proofs: $proofs) {
297
- ${ps}
297
+ ${ys}
298
298
  }
299
- }`,variables:{proofs:e}}));return r}async deleteEntanglementProofs(e){let{agentDeleteEntanglementProofs:r}=I(await ce(this,me,"f").mutate({mutation:E`mutation agentDeleteEntanglementProofs($proofs: [EntanglementProofInput!]!) {
299
+ }`,variables:{proofs:e}}));return r}async deleteEntanglementProofs(e){let{agentDeleteEntanglementProofs:r}=A(await le(this,me,"f").mutate({mutation:E`mutation agentDeleteEntanglementProofs($proofs: [EntanglementProofInput!]!) {
300
300
  agentDeleteEntanglementProofs(proofs: $proofs) {
301
- ${ps}
301
+ ${ys}
302
302
  }
303
- }`,variables:{proofs:e}}));return r}async getEntanglementProofs(){let{agentGetEntanglementProofs:e}=I(await ce(this,me,"f").query({query:E`query agentGetEntanglementProofs {
303
+ }`,variables:{proofs:e}}));return r}async getEntanglementProofs(){let{agentGetEntanglementProofs:e}=A(await le(this,me,"f").query({query:E`query agentGetEntanglementProofs {
304
304
  agentGetEntanglementProofs {
305
- ${ps}
305
+ ${ys}
306
306
  }
307
- }`}));return e}async entanglementProofPreFlight(e,r){let{agentEntanglementProofPreFlight:n}=I(await ce(this,me,"f").mutate({mutation:E`mutation agentEntanglementProofPreFlight($deviceKey: String!, $deviceKeyType: String!) {
307
+ }`}));return e}async entanglementProofPreFlight(e,r){let{agentEntanglementProofPreFlight:n}=A(await le(this,me,"f").mutate({mutation:E`mutation agentEntanglementProofPreFlight($deviceKey: String!, $deviceKeyType: String!) {
308
308
  agentEntanglementProofPreFlight(deviceKey: $deviceKey, deviceKeyType: $deviceKeyType) {
309
- ${ps}
309
+ ${ys}
310
310
  }
311
- }`,variables:{deviceKey:e,deviceKeyType:r}}));return n}addUpdatedListener(e){ce(this,Ra,"f").push(e)}addAppChangedListener(e){ce(this,Pa,"f").push(e)}subscribeAgentUpdated(){ce(this,me,"f").subscribe({query:E` subscription {
312
- agentUpdated { ${_a} }
311
+ }`,variables:{deviceKey:e,deviceKeyType:r}}));return n}addUpdatedListener(e){le(this,Fa,"f").push(e)}addAppChangedListener(e){le(this,La,"f").push(e)}subscribeAgentUpdated(){le(this,me,"f").subscribe({query:E` subscription {
312
+ agentUpdated { ${Ca} }
313
313
  }
314
- `}).subscribe({next:e=>{let r=e.data.agentUpdated;ce(this,Ra,"f").forEach(n=>{n(r)})},error:e=>console.error(e)})}subscribeAppsChanged(){ce(this,me,"f").subscribe({query:E` subscription {
314
+ `}).subscribe({next:e=>{let r=e.data.agentUpdated;le(this,Fa,"f").forEach(n=>{n(r)})},error:e=>console.error(e)})}subscribeAppsChanged(){le(this,me,"f").subscribe({query:E` subscription {
315
315
  agentAppsChanged {
316
- ${ls}
316
+ ${gs}
317
317
  }
318
318
  }
319
- `}).subscribe({next:e=>{ce(this,Pa,"f").forEach(r=>{r()})},error:e=>console.error(e)})}addAgentStatusChangedListener(e){ce(this,$a,"f").push(e)}subscribeAgentStatusChanged(){ce(this,me,"f").subscribe({query:E` subscription {
320
- agentStatusChanged { ${Si} }
319
+ `}).subscribe({next:e=>{le(this,La,"f").forEach(r=>{r()})},error:e=>console.error(e)})}addAgentStatusChangedListener(e){le(this,Ma,"f").push(e)}subscribeAgentStatusChanged(){le(this,me,"f").subscribe({query:E` subscription {
320
+ agentStatusChanged { ${Ci} }
321
321
  }
322
- `}).subscribe({next:e=>{let r=e.data.agentStatusChanged;ce(this,$a,"f").forEach(n=>{n(r)})},error:e=>console.error(e)})}async requestCapability(e){let{agentRequestCapability:r}=I(await ce(this,me,"f").mutate({mutation:E`
322
+ `}).subscribe({next:e=>{let r=e.data.agentStatusChanged;le(this,Ma,"f").forEach(n=>{n(r)})},error:e=>console.error(e)})}async requestCapability(e){let{agentRequestCapability:r}=A(await le(this,me,"f").mutate({mutation:E`
323
323
  mutation agentRequestCapability($authInfo: AuthInfoInput!) {
324
324
  agentRequestCapability(authInfo: $authInfo)
325
325
  }
326
- `,variables:{authInfo:e}}));return r}async permitCapability(e){let{agentPermitCapability:r}=I(await ce(this,me,"f").mutate({mutation:E`
326
+ `,variables:{authInfo:e}}));return r}async permitCapability(e){let{agentPermitCapability:r}=A(await le(this,me,"f").mutate({mutation:E`
327
327
  mutation agentPermitCapability($auth: String!) {
328
328
  agentPermitCapability(auth: $auth)
329
329
  }
330
- `,variables:{auth:e}}));return r}async generateJwt(e,r){let{agentGenerateJwt:n}=I(await ce(this,me,"f").mutate({mutation:E`
330
+ `,variables:{auth:e}}));return r}async generateJwt(e,r){let{agentGenerateJwt:n}=A(await le(this,me,"f").mutate({mutation:E`
331
331
  mutation agentGenerateJwt($requestId: String!, $rand: String!) {
332
332
  agentGenerateJwt(requestId: $requestId, rand: $rand)
333
333
  }
334
- `,variables:{requestId:e,rand:r}}));return n}async getApps(){let{agentGetApps:e}=I(await ce(this,me,"f").mutate({mutation:E`query agentGetApps {
334
+ `,variables:{requestId:e,rand:r}}));return n}async getApps(){let{agentGetApps:e}=A(await le(this,me,"f").mutate({mutation:E`query agentGetApps {
335
335
  agentGetApps {
336
- ${ls}
336
+ ${gs}
337
337
  }
338
- }`}));return e}async removeApp(e){let{agentRemoveApp:r}=I(await ce(this,me,"f").mutate({mutation:E`mutation agentRemoveApp($requestId: String!) {
338
+ }`}));return e}async removeApp(e){let{agentRemoveApp:r}=A(await le(this,me,"f").mutate({mutation:E`mutation agentRemoveApp($requestId: String!) {
339
339
  agentRemoveApp(requestId: $requestId) {
340
- ${ls}
340
+ ${gs}
341
341
  }
342
- }`,variables:{requestId:e}}));return r}async revokeToken(e){let{agentRevokeToken:r}=I(await ce(this,me,"f").mutate({mutation:E`mutation agentRevokeToken($requestId: String!) {
342
+ }`,variables:{requestId:e}}));return r}async revokeToken(e){let{agentRevokeToken:r}=A(await le(this,me,"f").mutate({mutation:E`mutation agentRevokeToken($requestId: String!) {
343
343
  agentRevokeToken(requestId: $requestId) {
344
- ${ls}
344
+ ${gs}
345
345
  }
346
- }`,variables:{requestId:e}}));return r}async isLocked(){let{agentIsLocked:e}=I(await ce(this,me,"f").mutate({mutation:E`
346
+ }`,variables:{requestId:e}}));return r}async isLocked(){let{agentIsLocked:e}=A(await le(this,me,"f").mutate({mutation:E`
347
347
  query agentIsLocked {
348
348
  agentIsLocked
349
349
  }
350
- `}));return e}async signMessage(e){let{agentSignMessage:r}=I(await ce(this,me,"f").mutate({mutation:E`mutation agentSignMessage($message: String!) {
350
+ `}));return e}async signMessage(e){let{agentSignMessage:r}=A(await le(this,me,"f").mutate({mutation:E`mutation agentSignMessage($message: String!) {
351
351
  agentSignMessage(message: $message) {
352
- ${c0}
352
+ ${d0}
353
+ }
354
+ }`,variables:{message:e}}));return r}async createUser(e,r){let{runtimeCreateUser:n}=A(await le(this,me,"f").mutate({mutation:E`mutation runtimeCreateUser($email: String!, $password: String!) {
355
+ runtimeCreateUser(email: $email, password: $password) {
356
+ did
357
+ success
358
+ error
353
359
  }
354
- }`,variables:{message:e}}));return r}};me=new WeakMap,Pa=new WeakMap,Ra=new WeakMap,$a=new WeakMap;var u0=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},qr=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,zd=`
360
+ }`,variables:{email:e,password:r}}));return n}async loginUser(e,r){let{runtimeLoginUser:n}=A(await le(this,me,"f").mutate({mutation:E`mutation runtimeLoginUser($email: String!, $password: String!) {
361
+ runtimeLoginUser(email: $email, password: $password)
362
+ }`,variables:{email:e,password:r}}));return n}};me=new WeakMap,La=new WeakMap,Fa=new WeakMap,Ma=new WeakMap;var h0=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},qr=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)},Ht,Kd=`
355
363
  name
356
364
  address
357
365
  settings
358
366
  icon { code }
359
367
  constructorIcon { code }
360
368
  settingsIcon { code }
361
- `,Gd=`
369
+ `,Zd=`
362
370
  name
363
371
  address
364
372
  description
@@ -368,45 +376,45 @@ neighbourhood {
368
376
  templateAppliedParams
369
377
  possibleTemplateParams
370
378
  sourceCodeLink
371
- `,Sl=class{constructor(e){zt.set(this,void 0),u0(this,zt,e,"f")}async byAddress(e){let{language:r}=I(await qr(this,zt,"f").query({query:E`query byAddress($address: String!) {
379
+ `,kl=class{constructor(e){Ht.set(this,void 0),h0(this,Ht,e,"f")}async byAddress(e){let{language:r}=A(await qr(this,Ht,"f").query({query:E`query byAddress($address: String!) {
372
380
  language(address: $address) {
373
- ${zd}
381
+ ${Kd}
374
382
  }
375
- }`,variables:{address:e}}));return r}async byFilter(e){let{languages:r}=I(await qr(this,zt,"f").query({query:E`query byFilter($filter: String!) {
383
+ }`,variables:{address:e}}));return r}async byFilter(e){let{languages:r}=A(await qr(this,Ht,"f").query({query:E`query byFilter($filter: String!) {
376
384
  languages(filter: $filter) {
377
- ${zd}
385
+ ${Kd}
378
386
  }
379
- }`,variables:{filter:e}}));return r}async all(){return this.byFilter("")}async writeSettings(e,r){let{languageWriteSettings:n}=I(await qr(this,zt,"f").mutate({mutation:E`mutation writeSettings($languageAddress: String!, $settings: String!) {
387
+ }`,variables:{filter:e}}));return r}async all(){return this.byFilter("")}async writeSettings(e,r){let{languageWriteSettings:n}=A(await qr(this,Ht,"f").mutate({mutation:E`mutation writeSettings($languageAddress: String!, $settings: String!) {
380
388
  languageWriteSettings(languageAddress: $languageAddress, settings: $settings)
381
- }`,variables:{languageAddress:e,settings:r}}));return n}async applyTemplateAndPublish(e,r){let{languageApplyTemplateAndPublish:n}=I(await qr(this,zt,"f").mutate({mutation:E`mutation languageApplyTemplateAndPublish(
389
+ }`,variables:{languageAddress:e,settings:r}}));return n}async applyTemplateAndPublish(e,r){let{languageApplyTemplateAndPublish:n}=A(await qr(this,Ht,"f").mutate({mutation:E`mutation languageApplyTemplateAndPublish(
382
390
  $sourceLanguageHash: String!,
383
391
  $templateData: String!,
384
392
  ) {
385
393
  languageApplyTemplateAndPublish(sourceLanguageHash: $sourceLanguageHash, templateData: $templateData) {
386
394
  name, address
387
395
  }
388
- }`,variables:{sourceLanguageHash:e,templateData:r}}));return n}async publish(e,r){let{languagePublish:n}=I(await qr(this,zt,"f").mutate({mutation:E`mutation languagePublish(
396
+ }`,variables:{sourceLanguageHash:e,templateData:r}}));return n}async publish(e,r){let{languagePublish:n}=A(await qr(this,Ht,"f").mutate({mutation:E`mutation languagePublish(
389
397
  $languagePath: String!,
390
398
  $languageMeta: LanguageMetaInput!,
391
399
  ) {
392
400
  languagePublish(languagePath: $languagePath, languageMeta: $languageMeta) {
393
- ${Gd}
401
+ ${Zd}
394
402
  }
395
- }`,variables:{languagePath:e,languageMeta:r}}));return n}async meta(e){let{languageMeta:r}=I(await qr(this,zt,"f").query({query:E`query languageMeta(
403
+ }`,variables:{languagePath:e,languageMeta:r}}));return n}async meta(e){let{languageMeta:r}=A(await qr(this,Ht,"f").query({query:E`query languageMeta(
396
404
  $address: String!,
397
405
  ) {
398
406
  languageMeta(address: $address) {
399
- ${Gd}
407
+ ${Zd}
400
408
  }
401
- }`,variables:{address:e}}));return r}async source(e){let{languageSource:r}=I(await qr(this,zt,"f").query({query:E`query languageSource(
409
+ }`,variables:{address:e}}));return r}async source(e){let{languageSource:r}=A(await qr(this,Ht,"f").query({query:E`query languageSource(
402
410
  $address: String!,
403
411
  ) {
404
412
  languageSource(address: $address)
405
- }`,variables:{address:e}}));return r}async remove(e){let{languageRemove:r}=I(await qr(this,zt,"f").mutate({mutation:E`mutation languageRemove(
413
+ }`,variables:{address:e}}));return r}async remove(e){let{languageRemove:r}=A(await qr(this,Ht,"f").mutate({mutation:E`mutation languageRemove(
406
414
  $address: String!,
407
415
  ) {
408
416
  languageRemove(address: $address)
409
- }`,variables:{address:e}}));return r}};zt=new WeakMap;var l0=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},it=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)},pt,Ti,Cl=class{constructor(e){pt.set(this,void 0),Ti.set(this,new Map),l0(this,pt,e,"f")}async publishFromPerspective(e,r,n){let{neighbourhoodPublishFromPerspective:i}=I(await it(this,pt,"f").mutate({mutation:E`mutation neighbourhoodPublishFromPerspective(
417
+ }`,variables:{address:e}}));return r}};Ht=new WeakMap;var m0=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},at=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)},ft,Oi,Al=class{constructor(e){ft.set(this,void 0),Oi.set(this,new Map),m0(this,ft,e,"f")}async publishFromPerspective(e,r,n){let{neighbourhoodPublishFromPerspective:i}=A(await at(this,ft,"f").mutate({mutation:E`mutation neighbourhoodPublishFromPerspective(
410
418
  $linkLanguage: String!,
411
419
  $meta: PerspectiveInput!,
412
420
  $perspectiveUUID: String!
@@ -416,7 +424,7 @@ neighbourhood {
416
424
  meta: $meta,
417
425
  perspectiveUUID: $perspectiveUUID
418
426
  )
419
- }`,variables:{perspectiveUUID:e,linkLanguage:r,meta:n}}));return i}async joinFromUrl(e){let{neighbourhoodJoinFromUrl:r}=I(await it(this,pt,"f").mutate({mutation:E`mutation neighbourhoodJoinFromUrl($url: String!) {
427
+ }`,variables:{perspectiveUUID:e,linkLanguage:r,meta:n}}));return i}async joinFromUrl(e){let{neighbourhoodJoinFromUrl:r}=A(await at(this,ft,"f").mutate({mutation:E`mutation neighbourhoodJoinFromUrl($url: String!) {
420
428
  neighbourhoodJoinFromUrl(url: $url) {
421
429
  uuid
422
430
  name
@@ -438,11 +446,11 @@ neighbourhood {
438
446
  author
439
447
  }
440
448
  }
441
- }`,variables:{url:e}}));return r}async otherAgents(e){let{neighbourhoodOtherAgents:r}=I(await it(this,pt,"f").query({query:E`query neighbourhoodOtherAgents($perspectiveUUID: String!) {
449
+ }`,variables:{url:e}}));return r}async otherAgents(e){let{neighbourhoodOtherAgents:r}=A(await at(this,ft,"f").query({query:E`query neighbourhoodOtherAgents($perspectiveUUID: String!) {
442
450
  neighbourhoodOtherAgents(perspectiveUUID: $perspectiveUUID)
443
- }`,variables:{perspectiveUUID:e}}));return r}async hasTelepresenceAdapter(e){let{neighbourhoodHasTelepresenceAdapter:r}=I(await it(this,pt,"f").query({query:E`query neighbourhoodHasTelepresenceAdapter($perspectiveUUID: String!) {
451
+ }`,variables:{perspectiveUUID:e}}));return r}async hasTelepresenceAdapter(e){let{neighbourhoodHasTelepresenceAdapter:r}=A(await at(this,ft,"f").query({query:E`query neighbourhoodHasTelepresenceAdapter($perspectiveUUID: String!) {
444
452
  neighbourhoodHasTelepresenceAdapter(perspectiveUUID: $perspectiveUUID)
445
- }`,variables:{perspectiveUUID:e}}));return r}async onlineAgents(e){let{neighbourhoodOnlineAgents:r}=I(await it(this,pt,"f").query({query:E`query neighbourhoodOnlineAgents($perspectiveUUID: String!) {
453
+ }`,variables:{perspectiveUUID:e}}));return r}async onlineAgents(e){let{neighbourhoodOnlineAgents:r}=A(await at(this,ft,"f").query({query:E`query neighbourhoodOnlineAgents($perspectiveUUID: String!) {
446
454
  neighbourhoodOnlineAgents(perspectiveUUID: $perspectiveUUID) {
447
455
  did
448
456
  status {
@@ -459,7 +467,7 @@ neighbourhood {
459
467
  proof { valid, invalid, signature, key }
460
468
  }
461
469
  }
462
- }`,variables:{perspectiveUUID:e}}));return r}async setOnlineStatus(e,r){let{neighbourhoodSetOnlineStatus:n}=I(await it(this,pt,"f").mutate({mutation:E`mutation neighbourhoodSetOnlineStatus(
470
+ }`,variables:{perspectiveUUID:e}}));return r}async setOnlineStatus(e,r){let{neighbourhoodSetOnlineStatus:n}=A(await at(this,ft,"f").mutate({mutation:E`mutation neighbourhoodSetOnlineStatus(
463
471
  $perspectiveUUID: String!,
464
472
  $status: PerspectiveInput!
465
473
  ) {
@@ -467,7 +475,7 @@ neighbourhood {
467
475
  perspectiveUUID: $perspectiveUUID,
468
476
  status: $status
469
477
  )
470
- }`,variables:{perspectiveUUID:e,status:r}}));return n}async setOnlineStatusU(e,r){let{neighbourhoodSetOnlineStatusU:n}=I(await it(this,pt,"f").mutate({mutation:E`mutation neighbourhoodSetOnlineStatusU(
478
+ }`,variables:{perspectiveUUID:e,status:r}}));return n}async setOnlineStatusU(e,r){let{neighbourhoodSetOnlineStatusU:n}=A(await at(this,ft,"f").mutate({mutation:E`mutation neighbourhoodSetOnlineStatusU(
471
479
  $perspectiveUUID: String!,
472
480
  $status: PerspectiveUnsignedInput!
473
481
  ) {
@@ -475,7 +483,7 @@ neighbourhood {
475
483
  perspectiveUUID: $perspectiveUUID,
476
484
  status: $status
477
485
  )
478
- }`,variables:{perspectiveUUID:e,status:r}}));return n}async sendSignal(e,r,n){let{neighbourhoodSendSignal:i}=I(await it(this,pt,"f").mutate({mutation:E`mutation neighbourhoodSendSignal(
486
+ }`,variables:{perspectiveUUID:e,status:r}}));return n}async sendSignal(e,r,n){let{neighbourhoodSendSignal:i}=A(await at(this,ft,"f").mutate({mutation:E`mutation neighbourhoodSendSignal(
479
487
  $perspectiveUUID: String!,
480
488
  $remoteAgentDid: String!,
481
489
  $payload: PerspectiveInput!
@@ -485,7 +493,7 @@ neighbourhood {
485
493
  remoteAgentDid: $remoteAgentDid,
486
494
  payload: $payload
487
495
  )
488
- }`,variables:{perspectiveUUID:e,remoteAgentDid:r,payload:n}}));return i}async sendSignalU(e,r,n){let{neighbourhoodSendSignalU:i}=I(await it(this,pt,"f").mutate({mutation:E`mutation neighbourhoodSendSignalU(
496
+ }`,variables:{perspectiveUUID:e,remoteAgentDid:r,payload:n}}));return i}async sendSignalU(e,r,n){let{neighbourhoodSendSignalU:i}=A(await at(this,ft,"f").mutate({mutation:E`mutation neighbourhoodSendSignalU(
489
497
  $perspectiveUUID: String!,
490
498
  $remoteAgentDid: String!,
491
499
  $payload: PerspectiveUnsignedInput!
@@ -495,7 +503,7 @@ neighbourhood {
495
503
  remoteAgentDid: $remoteAgentDid,
496
504
  payload: $payload
497
505
  )
498
- }`,variables:{perspectiveUUID:e,remoteAgentDid:r,payload:n}}));return i}async sendBroadcast(e,r,n=!1){let{neighbourhoodSendBroadcast:i}=I(await it(this,pt,"f").mutate({mutation:E`mutation neighbourhoodSendBroadcast(
506
+ }`,variables:{perspectiveUUID:e,remoteAgentDid:r,payload:n}}));return i}async sendBroadcast(e,r,n=!1){let{neighbourhoodSendBroadcast:i}=A(await at(this,ft,"f").mutate({mutation:E`mutation neighbourhoodSendBroadcast(
499
507
  $perspectiveUUID: String!,
500
508
  $payload: PerspectiveInput!,
501
509
  $loopback: Boolean
@@ -505,7 +513,7 @@ neighbourhood {
505
513
  payload: $payload,
506
514
  loopback: $loopback
507
515
  )
508
- }`,variables:{perspectiveUUID:e,payload:r,loopback:n}}));return i}async sendBroadcastU(e,r,n=!1){let{neighbourhoodSendBroadcastU:i}=I(await it(this,pt,"f").mutate({mutation:E`mutation neighbourhoodSendBroadcastU(
516
+ }`,variables:{perspectiveUUID:e,payload:r,loopback:n}}));return i}async sendBroadcastU(e,r,n=!1){let{neighbourhoodSendBroadcastU:i}=A(await at(this,ft,"f").mutate({mutation:E`mutation neighbourhoodSendBroadcastU(
509
517
  $perspectiveUUID: String!,
510
518
  $payload: PerspectiveUnsignedInput!,
511
519
  $loopback: Boolean
@@ -515,7 +523,7 @@ neighbourhood {
515
523
  payload: $payload,
516
524
  loopback: $loopback
517
525
  )
518
- }`,variables:{perspectiveUUID:e,payload:r,loopback:n}}));return i}dispatchSignal(e,r){let n=it(this,Ti,"f").get(e);n&&n.forEach(i=>i(r))}async subscribeToSignals(e){let r=this;await it(this,pt,"f").subscribe({query:E`subscription neighbourhoodSignal($perspectiveUUID: String!) {
526
+ }`,variables:{perspectiveUUID:e,payload:r,loopback:n}}));return i}dispatchSignal(e,r){let n=at(this,Oi,"f").get(e);n&&n.forEach(i=>i(r))}async subscribeToSignals(e){let r=this;await at(this,ft,"f").subscribe({query:E`subscription neighbourhoodSignal($perspectiveUUID: String!) {
519
527
  neighbourhoodSignal(perspectiveUUID: $perspectiveUUID) {
520
528
  author
521
529
  timestamp
@@ -530,7 +538,7 @@ neighbourhood {
530
538
  }
531
539
  proof { valid, invalid, signature, key }
532
540
  }
533
- }`,variables:{perspectiveUUID:e}}).subscribe({next:n=>{let{neighbourhoodSignal:i}=I(n);r.dispatchSignal(e,i)}})}async addSignalHandler(e,r){let n=it(this,Ti,"f").get(e);n||(n=[],it(this,Ti,"f").set(e,n),await this.subscribeToSignals(e)),n.push(r)}removeSignalHandler(e,r){let n=it(this,Ti,"f").get(e);if(n){let i=n.indexOf(r);i>-1&&n.splice(i,1)}}};pt=new WeakMap,Ti=new WeakMap;var fs=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},K=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)},X,La,Fa,Ma,l1,ds=`
541
+ }`,variables:{perspectiveUUID:e}}).subscribe({next:n=>{let{neighbourhoodSignal:i}=A(n);r.dispatchSignal(e,i)}})}async addSignalHandler(e,r){let n=at(this,Oi,"f").get(e);n||(n=[],at(this,Oi,"f").set(e,n),await this.subscribeToSignals(e)),n.push(r)}removeSignalHandler(e,r){let n=at(this,Oi,"f").get(e);if(n){let i=n.indexOf(r);i>-1&&n.splice(i,1)}}};ft=new WeakMap,Oi=new WeakMap;var vs=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},K=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)},J,Ua,ja,Ba,m1,bs=`
534
542
  author
535
543
  timestamp
536
544
  data {
@@ -542,7 +550,7 @@ data {
542
550
  }
543
551
  }
544
552
  proof { valid, invalid, signature, key }
545
- `,p0=`
553
+ `,g0=`
546
554
  description
547
555
  appName
548
556
  appUrl
@@ -551,72 +559,72 @@ trigger
551
559
  perspectiveIds
552
560
  webhookUrl
553
561
  webhookAuth
554
- `,p1=`
562
+ `,g1=`
555
563
  id
556
564
  granted
557
- ${p0}
558
- `,f0=`
559
- notification { ${p1} }
565
+ ${g0}
566
+ `,y0=`
567
+ notification { ${g1} }
560
568
  perspectiveId
561
569
  triggerMatch
562
- `,xl=class{constructor(e,r=!0){X.set(this,void 0),La.set(this,void 0),Fa.set(this,void 0),Ma.set(this,void 0),l1.set(this,void 0),fs(this,X,e,"f"),fs(this,La,[],"f"),fs(this,Fa,[],"f"),fs(this,Ma,[],"f"),r&&(this.subscribeMessageReceived(),this.subscribeExceptionOccurred(),this.subscribeNotificationTriggered())}async info(){let{runtimeInfo:e}=I(await K(this,X,"f").query({query:E`query runtimeInfo {
570
+ `,Il=class{constructor(e,r=!0){J.set(this,void 0),Ua.set(this,void 0),ja.set(this,void 0),Ba.set(this,void 0),m1.set(this,void 0),vs(this,J,e,"f"),vs(this,Ua,[],"f"),vs(this,ja,[],"f"),vs(this,Ba,[],"f"),r&&(this.subscribeMessageReceived(),this.subscribeExceptionOccurred(),this.subscribeNotificationTriggered())}async info(){let{runtimeInfo:e}=A(await K(this,J,"f").query({query:E`query runtimeInfo {
563
571
  runtimeInfo {
564
572
  ad4mExecutorVersion,
565
573
  isInitialized,
566
574
  isUnlocked
567
575
  }
568
- }`}));return e}async quit(){return I(await K(this,X,"f").mutate({mutation:E`mutation runtimeQuit { runtimeQuit }`})).runtimeQuit}async openLink(e){let{runtimeOpenLink:r}=I(await K(this,X,"f").mutate({mutation:E`mutation runtimeOpenLink($url: String!) {
576
+ }`}));return e}async quit(){return A(await K(this,J,"f").mutate({mutation:E`mutation runtimeQuit { runtimeQuit }`})).runtimeQuit}async openLink(e){let{runtimeOpenLink:r}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeOpenLink($url: String!) {
569
577
  runtimeOpenLink(url: $url)
570
- }`,variables:{url:e}}));return r}async addTrustedAgents(e){let{addTrustedAgents:r}=I(await K(this,X,"f").mutate({mutation:E`mutation addTrustedAgents($agents: [String!]!) {
578
+ }`,variables:{url:e}}));return r}async addTrustedAgents(e){let{addTrustedAgents:r}=A(await K(this,J,"f").mutate({mutation:E`mutation addTrustedAgents($agents: [String!]!) {
571
579
  addTrustedAgents(agents: $agents)
572
- }`,variables:{agents:e}}));return r}async deleteTrustedAgents(e){let{deleteTrustedAgents:r}=I(await K(this,X,"f").mutate({mutation:E`mutation deleteTrustedAgents($agents: [String!]!) {
580
+ }`,variables:{agents:e}}));return r}async deleteTrustedAgents(e){let{deleteTrustedAgents:r}=A(await K(this,J,"f").mutate({mutation:E`mutation deleteTrustedAgents($agents: [String!]!) {
573
581
  deleteTrustedAgents(agents: $agents)
574
- }`,variables:{agents:e}}));return r}async getTrustedAgents(){let{getTrustedAgents:e}=I(await K(this,X,"f").query({query:E`query getTrustedAgents {
582
+ }`,variables:{agents:e}}));return r}async getTrustedAgents(){let{getTrustedAgents:e}=A(await K(this,J,"f").query({query:E`query getTrustedAgents {
575
583
  getTrustedAgents
576
- }`}));return e}async addKnownLinkLanguageTemplates(e){let{runtimeAddKnownLinkLanguageTemplates:r}=I(await K(this,X,"f").mutate({mutation:E`mutation runtimeAddKnownLinkLanguageTemplates($addresses: [String!]!) {
584
+ }`}));return e}async addKnownLinkLanguageTemplates(e){let{runtimeAddKnownLinkLanguageTemplates:r}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeAddKnownLinkLanguageTemplates($addresses: [String!]!) {
577
585
  runtimeAddKnownLinkLanguageTemplates(addresses: $addresses)
578
- }`,variables:{addresses:e}}));return r}async removeKnownLinkLanguageTemplates(e){let{runtimeRemoveKnownLinkLanguageTemplates:r}=I(await K(this,X,"f").mutate({mutation:E`mutation runtimeRemoveKnownLinkLanguageTemplates($addresses: [String!]!) {
586
+ }`,variables:{addresses:e}}));return r}async removeKnownLinkLanguageTemplates(e){let{runtimeRemoveKnownLinkLanguageTemplates:r}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeRemoveKnownLinkLanguageTemplates($addresses: [String!]!) {
579
587
  runtimeRemoveKnownLinkLanguageTemplates(addresses: $addresses)
580
- }`,variables:{addresses:e}}));return r}async knownLinkLanguageTemplates(){let{runtimeKnownLinkLanguageTemplates:e}=I(await K(this,X,"f").query({query:E`query runtimeKnownLinkLanguageTemplates {
588
+ }`,variables:{addresses:e}}));return r}async knownLinkLanguageTemplates(){let{runtimeKnownLinkLanguageTemplates:e}=A(await K(this,J,"f").query({query:E`query runtimeKnownLinkLanguageTemplates {
581
589
  runtimeKnownLinkLanguageTemplates
582
- }`}));return e}async addFriends(e){let{runtimeAddFriends:r}=I(await K(this,X,"f").mutate({mutation:E`mutation runtimeAddFriends($dids: [String!]!) {
590
+ }`}));return e}async addFriends(e){let{runtimeAddFriends:r}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeAddFriends($dids: [String!]!) {
583
591
  runtimeAddFriends(dids: $dids)
584
- }`,variables:{dids:e}}));return r}async removeFriends(e){let{runtimeRemoveFriends:r}=I(await K(this,X,"f").mutate({mutation:E`mutation runtimeRemoveFriends($dids: [String!]!) {
592
+ }`,variables:{dids:e}}));return r}async removeFriends(e){let{runtimeRemoveFriends:r}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeRemoveFriends($dids: [String!]!) {
585
593
  runtimeRemoveFriends(dids: $dids)
586
- }`,variables:{dids:e}}));return r}async friends(){let{runtimeFriends:e}=I(await K(this,X,"f").query({query:E`query runtimeFriends {
594
+ }`,variables:{dids:e}}));return r}async friends(){let{runtimeFriends:e}=A(await K(this,J,"f").query({query:E`query runtimeFriends {
587
595
  runtimeFriends
588
- }`}));return e}async hcAgentInfos(){let{runtimeHcAgentInfos:e}=I(await K(this,X,"f").query({query:E`query runtimeHcAgentInfos {
596
+ }`}));return e}async hcAgentInfos(){let{runtimeHcAgentInfos:e}=A(await K(this,J,"f").query({query:E`query runtimeHcAgentInfos {
589
597
  runtimeHcAgentInfos
590
- }`}));return e}async getNetworkMetrics(){let{runtimeGetNetworkMetrics:e}=I(await K(this,X,"f").query({query:E`query runtimeGetNetworkMetrics {
598
+ }`}));return e}async getNetworkMetrics(){let{runtimeGetNetworkMetrics:e}=A(await K(this,J,"f").query({query:E`query runtimeGetNetworkMetrics {
591
599
  runtimeGetNetworkMetrics
592
- }`}));return e}async restartHolochain(){let{runtimeRestartHolochain:e}=I(await K(this,X,"f").mutate({mutation:E`mutation runtimeRestartHolochain {
600
+ }`}));return e}async restartHolochain(){let{runtimeRestartHolochain:e}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeRestartHolochain {
593
601
  runtimeRestartHolochain
594
- }`}));return e}async hcAddAgentInfos(e){let{runtimeHcAddAgentInfos:r}=I(await K(this,X,"f").mutate({mutation:E`mutation runtimeHcAddAgentInfos($agentInfos: String!) {
602
+ }`}));return e}async hcAddAgentInfos(e){let{runtimeHcAddAgentInfos:r}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeHcAddAgentInfos($agentInfos: String!) {
595
603
  runtimeHcAddAgentInfos(agentInfos: $agentInfos)
596
- }`,variables:{agentInfos:e}}));return r}async verifyStringSignedByDid(e,r,n,i){let{runtimeVerifyStringSignedByDid:a}=I(await K(this,X,"f").mutate({mutation:E`query runtimeVerifyStringSignedByDid($did: String!, $didSigningKeyId: String!, $data: String!, $signedData: String!) {
604
+ }`,variables:{agentInfos:e}}));return r}async verifyStringSignedByDid(e,r,n,i){let{runtimeVerifyStringSignedByDid:a}=A(await K(this,J,"f").mutate({mutation:E`query runtimeVerifyStringSignedByDid($did: String!, $didSigningKeyId: String!, $data: String!, $signedData: String!) {
597
605
  runtimeVerifyStringSignedByDid(did: $did, didSigningKeyId: $didSigningKeyId, data: $data, signedData: $signedData)
598
- }`,variables:{did:e,didSigningKeyId:r,data:n,signedData:i}}));return a}async setStatus(e){let{runtimeSetStatus:r}=I(await K(this,X,"f").mutate({mutation:E`mutation runtimeSetStatus($status: PerspectiveInput!) {
606
+ }`,variables:{did:e,didSigningKeyId:r,data:n,signedData:i}}));return a}async setStatus(e){let{runtimeSetStatus:r}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeSetStatus($status: PerspectiveInput!) {
599
607
  runtimeSetStatus(status: $status)
600
- }`,variables:{status:e}}));return r}async friendStatus(e){let{runtimeFriendStatus:r}=I(await K(this,X,"f").query({query:E`query runtimeFriendStatus($did: String!) {
601
- runtimeFriendStatus(did: $did) { ${ds} }
602
- }`,variables:{did:e}}));return r}async friendSendMessage(e,r){let{runtimeFriendSendMessage:n}=I(await K(this,X,"f").mutate({mutation:E`mutation runtimeFriendSendMessage($did: String!, $message: PerspectiveInput!) {
608
+ }`,variables:{status:e}}));return r}async friendStatus(e){let{runtimeFriendStatus:r}=A(await K(this,J,"f").query({query:E`query runtimeFriendStatus($did: String!) {
609
+ runtimeFriendStatus(did: $did) { ${bs} }
610
+ }`,variables:{did:e}}));return r}async friendSendMessage(e,r){let{runtimeFriendSendMessage:n}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeFriendSendMessage($did: String!, $message: PerspectiveInput!) {
603
611
  runtimeFriendSendMessage(did: $did, message: $message)
604
- }`,variables:{did:e,message:r}}));return n}async messageInbox(e){let{runtimeMessageInbox:r}=I(await K(this,X,"f").query({query:E`query runtimeMessageInbox($filter: String) {
605
- runtimeMessageInbox(filter: $filter) { ${ds} }
606
- }`,variables:{filter:e}}));return r}async messageOutbox(e){let{runtimeMessageOutbox:r}=I(await K(this,X,"f").query({query:E`query runtimeMessageOutbox($filter: String) {
612
+ }`,variables:{did:e,message:r}}));return n}async messageInbox(e){let{runtimeMessageInbox:r}=A(await K(this,J,"f").query({query:E`query runtimeMessageInbox($filter: String) {
613
+ runtimeMessageInbox(filter: $filter) { ${bs} }
614
+ }`,variables:{filter:e}}));return r}async messageOutbox(e){let{runtimeMessageOutbox:r}=A(await K(this,J,"f").query({query:E`query runtimeMessageOutbox($filter: String) {
607
615
  runtimeMessageOutbox(filter: $filter) {
608
616
  recipient,
609
617
  message {
610
- ${ds}
618
+ ${bs}
611
619
  }
612
620
  }
613
- }`,variables:{filter:e}}));return r}async requestInstallNotification(e){let{runtimeRequestInstallNotification:r}=I(await K(this,X,"f").mutate({mutation:E`mutation runtimeRequestInstallNotification($notification: NotificationInput!) {
621
+ }`,variables:{filter:e}}));return r}async requestInstallNotification(e){let{runtimeRequestInstallNotification:r}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeRequestInstallNotification($notification: NotificationInput!) {
614
622
  runtimeRequestInstallNotification(notification: $notification)
615
- }`,variables:{notification:e}}));return r}async grantNotification(e){let{runtimeGrantNotification:r}=I(await K(this,X,"f").mutate({mutation:E`mutation runtimeGrantNotification($id: String!) {
623
+ }`,variables:{notification:e}}));return r}async grantNotification(e){let{runtimeGrantNotification:r}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeGrantNotification($id: String!) {
616
624
  runtimeGrantNotification(id: $id)
617
- }`,variables:{id:e}}));return r}async exportDb(e){let{runtimeExportDb:r}=I(await K(this,X,"f").mutate({mutation:E`mutation runtimeExportDb($filePath: String!) {
625
+ }`,variables:{id:e}}));return r}async exportDb(e){let{runtimeExportDb:r}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeExportDb($filePath: String!) {
618
626
  runtimeExportDb(filePath: $filePath)
619
- }`,variables:{filePath:e}}));return r}async importDb(e){let{runtimeImportDb:r}=I(await K(this,X,"f").mutate({mutation:E`mutation runtimeImportDb($filePath: String!) {
627
+ }`,variables:{filePath:e}}));return r}async importDb(e){let{runtimeImportDb:r}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeImportDb($filePath: String!) {
620
628
  runtimeImportDb(filePath: $filePath) {
621
629
  perspectives { total imported failed omitted errors }
622
630
  links { total imported failed omitted errors }
@@ -630,30 +638,41 @@ triggerMatch
630
638
  trustedAgents { total imported failed omitted errors }
631
639
  knownLinkLanguages { total imported failed omitted errors }
632
640
  }
633
- }`,variables:{filePath:e}}));return r}async notifications(){let{runtimeNotifications:e}=I(await K(this,X,"f").query({query:E`query runtimeNotifications {
634
- runtimeNotifications { ${p1} }
635
- }`}));return e}async updateNotification(e,r){let{runtimeUpdateNotification:n}=I(await K(this,X,"f").mutate({mutation:E`mutation runtimeUpdateNotification($id: String!, $notification: NotificationInput!) {
641
+ }`,variables:{filePath:e}}));return r}async notifications(){let{runtimeNotifications:e}=A(await K(this,J,"f").query({query:E`query runtimeNotifications {
642
+ runtimeNotifications { ${g1} }
643
+ }`}));return e}async updateNotification(e,r){let{runtimeUpdateNotification:n}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeUpdateNotification($id: String!, $notification: NotificationInput!) {
636
644
  runtimeUpdateNotification(id: $id, notification: $notification)
637
- }`,variables:{id:e,notification:r}}));return n}async removeNotification(e){let{runtimeRemoveNotification:r}=I(await K(this,X,"f").mutate({mutation:E`mutation runtimeRemoveNotification($id: String!) {
645
+ }`,variables:{id:e,notification:r}}));return n}async removeNotification(e){let{runtimeRemoveNotification:r}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeRemoveNotification($id: String!) {
638
646
  runtimeRemoveNotification(id: $id)
639
- }`,variables:{id:e}}));return r}async exportPerspective(e,r){let{runtimeExportPerspective:n}=I(await K(this,X,"f").mutate({mutation:E`mutation runtimeExportPerspective($perspectiveUuid: String!, $filePath: String!) {
647
+ }`,variables:{id:e}}));return r}async exportPerspective(e,r){let{runtimeExportPerspective:n}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeExportPerspective($perspectiveUuid: String!, $filePath: String!) {
640
648
  runtimeExportPerspective(perspectiveUuid: $perspectiveUuid, filePath: $filePath)
641
- }`,variables:{perspectiveUuid:e,filePath:r}}));return n}async importPerspective(e){let{runtimeImportPerspective:r}=I(await K(this,X,"f").mutate({mutation:E`mutation runtimeImportPerspective($filePath: String!) {
649
+ }`,variables:{perspectiveUuid:e,filePath:r}}));return n}async importPerspective(e){let{runtimeImportPerspective:r}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeImportPerspective($filePath: String!) {
642
650
  runtimeImportPerspective(filePath: $filePath)
643
- }`,variables:{filePath:e}}));return r}addNotificationTriggeredCallback(e){K(this,Ma,"f").push(e)}subscribeNotificationTriggered(){K(this,X,"f").subscribe({query:E` subscription {
644
- runtimeNotificationTriggered { ${f0} }
651
+ }`,variables:{filePath:e}}));return r}async multiUserEnabled(){let{runtimeMultiUserEnabled:e}=A(await K(this,J,"f").query({query:E`query runtimeMultiUserEnabled {
652
+ runtimeMultiUserEnabled
653
+ }`}));return e}async setMultiUserEnabled(e){let{runtimeSetMultiUserEnabled:r}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeSetMultiUserEnabled($enabled: Boolean!) {
654
+ runtimeSetMultiUserEnabled(enabled: $enabled)
655
+ }`,variables:{enabled:e}}));return r}async listUsers(){let{runtimeListUsers:e}=A(await K(this,J,"f").query({query:E`query runtimeListUsers {
656
+ runtimeListUsers {
657
+ email
658
+ did
659
+ lastSeen
660
+ perspectiveCount
661
+ }
662
+ }`}));return e}addNotificationTriggeredCallback(e){K(this,Ba,"f").push(e)}subscribeNotificationTriggered(){K(this,J,"f").subscribe({query:E` subscription {
663
+ runtimeNotificationTriggered { ${y0} }
645
664
  }
646
- `}).subscribe({next:e=>{K(this,Ma,"f").forEach(r=>{r(e.data.runtimeNotificationTriggered)})},error:e=>console.error(e)})}addMessageCallback(e){K(this,La,"f").push(e)}subscribeMessageReceived(){K(this,X,"f").subscribe({query:E` subscription {
647
- runtimeMessageReceived { ${ds} }
665
+ `}).subscribe({next:e=>{K(this,Ba,"f").forEach(r=>{r(e.data.runtimeNotificationTriggered)})},error:e=>console.error(e)})}addMessageCallback(e){K(this,Ua,"f").push(e)}subscribeMessageReceived(){K(this,J,"f").subscribe({query:E` subscription {
666
+ runtimeMessageReceived { ${bs} }
648
667
  }
649
- `}).subscribe({next:e=>{K(this,La,"f").forEach(r=>{r(e.data.runtimeMessageReceived)})},error:e=>console.error(e)})}addExceptionCallback(e){K(this,Fa,"f").push(e)}subscribeExceptionOccurred(){K(this,X,"f").subscribe({query:E` subscription {
668
+ `}).subscribe({next:e=>{K(this,Ua,"f").forEach(r=>{r(e.data.runtimeMessageReceived)})},error:e=>console.error(e)})}addExceptionCallback(e){K(this,ja,"f").push(e)}subscribeExceptionOccurred(){K(this,J,"f").subscribe({query:E` subscription {
650
669
  exceptionOccurred {
651
670
  title
652
671
  message
653
672
  type
654
673
  addon
655
674
  }
656
- }`}).subscribe({next:e=>{K(this,Fa,"f").forEach(r=>{r(e.data.exceptionOccurred)})},error:e=>console.error(e)})}};X=new WeakMap,La=new WeakMap,Fa=new WeakMap,Ma=new WeakMap,l1=new WeakMap;var d0=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)},_r,El=class{constructor(e){_r.set(this,void 0),d0(this,_r,e,"f")}async get(e,r=!1){if(!r)try{let i=At.fromUrl(e).get();if(typeof i=="object"&&i!==null&&"author"in i&&"timestamp"in i&&"data"in i&&"proof"in i)return i}catch{}let{expression:n}=I(await Ci(this,_r,"f").query({query:E`query expression($url: String!) {
675
+ }`}).subscribe({next:e=>{K(this,ja,"f").forEach(r=>{r(e.data.exceptionOccurred)})},error:e=>console.error(e)})}};J=new WeakMap,Ua=new WeakMap,ja=new WeakMap,Ba=new WeakMap,m1=new WeakMap;var v0=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},xi=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)},_r,Tl=class{constructor(e){_r.set(this,void 0),v0(this,_r,e,"f")}async get(e,r=!1){if(!r)try{let i=It.fromUrl(e).get();if(typeof i=="object"&&i!==null&&"author"in i&&"timestamp"in i&&"data"in i&&"proof"in i)return i}catch{}let{expression:n}=A(await xi(this,_r,"f").query({query:E`query expression($url: String!) {
657
676
  expression(url: $url) {
658
677
  author
659
678
  timestamp
@@ -666,7 +685,7 @@ triggerMatch
666
685
  invalid
667
686
  }
668
687
  }
669
- }`,variables:{url:e}}));return n}async getMany(e){let{expressionMany:r}=I(await Ci(this,_r,"f").query({query:E`query expressionMany($urls: [String!]!) {
688
+ }`,variables:{url:e}}));return n}async getMany(e){let{expressionMany:r}=A(await xi(this,_r,"f").query({query:E`query expressionMany($urls: [String!]!) {
670
689
  expressionMany(urls: $urls) {
671
690
  author
672
691
  timestamp
@@ -679,19 +698,19 @@ triggerMatch
679
698
  invalid
680
699
  }
681
700
  }
682
- }`,variables:{urls:e}}));return r}async getRaw(e){let{expressionRaw:r}=I(await Ci(this,_r,"f").query({query:E`query expressionRaw($url: String!) {
701
+ }`,variables:{urls:e}}));return r}async getRaw(e){let{expressionRaw:r}=A(await xi(this,_r,"f").query({query:E`query expressionRaw($url: String!) {
683
702
  expressionRaw(url: $url)
684
- }`,variables:{url:e}}));return r}async create(e,r){e=JSON.stringify(e);let{expressionCreate:n}=I(await Ci(this,_r,"f").mutate({mutation:E`mutation expressionCreate($content: String!, $languageAddress: String!){
703
+ }`,variables:{url:e}}));return r}async create(e,r){e=JSON.stringify(e);let{expressionCreate:n}=A(await xi(this,_r,"f").mutate({mutation:E`mutation expressionCreate($content: String!, $languageAddress: String!){
685
704
  expressionCreate(content: $content, languageAddress: $languageAddress)
686
- }`,variables:{content:e,languageAddress:r}}));return n}async interactions(e){let{expressionInteractions:r}=I(await Ci(this,_r,"f").query({query:E`query expressionInteractions($url: String!) {
705
+ }`,variables:{content:e,languageAddress:r}}));return n}async interactions(e){let{expressionInteractions:r}=A(await xi(this,_r,"f").query({query:E`query expressionInteractions($url: String!) {
687
706
  expressionInteractions(url: $url) {
688
707
  label
689
708
  name
690
709
  parameters { name, type }
691
710
  }
692
- }`,variables:{url:e}}));return r}async interact(e,r){let{expressionInteract:n}=I(await Ci(this,_r,"f").mutate({mutation:E`mutation expressionInteract($url: String!, $interactionCall: InteractionCall!){
711
+ }`,variables:{url:e}}));return r}async interact(e,r){let{expressionInteract:n}=A(await xi(this,_r,"f").mutate({mutation:E`mutation expressionInteract($url: String!, $interactionCall: InteractionCall!){
693
712
  expressionInteract(url: $url, interactionCall: $interactionCall)
694
- }`,variables:{url:e,interactionCall:r}}));return n}};_r=new WeakMap;var cc={};cc.byteLength=m0;cc.toByteArray=y0;cc.fromByteArray=_0;var nr=[],$t=[],h0=typeof Uint8Array<"u"?Uint8Array:Array,Zu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(En=0,Hd=Zu.length;En<Hd;++En)nr[En]=Zu[En],$t[Zu.charCodeAt(En)]=En;var En,Hd;$t["-".charCodeAt(0)]=62;$t["_".charCodeAt(0)]=63;function f1(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 m0(t){var e=f1(t),r=e[0],n=e[1];return(r+n)*3/4-n}function g0(t,e,r){return(e+r)*3/4-r}function y0(t){var e,r=f1(t),n=r[0],i=r[1],a=new h0(g0(t,n,i)),o=0,s=i>0?n-4:n,u;for(u=0;u<s;u+=4)e=$t[t.charCodeAt(u)]<<18|$t[t.charCodeAt(u+1)]<<12|$t[t.charCodeAt(u+2)]<<6|$t[t.charCodeAt(u+3)],a[o++]=e>>16&255,a[o++]=e>>8&255,a[o++]=e&255;return i===2&&(e=$t[t.charCodeAt(u)]<<2|$t[t.charCodeAt(u+1)]>>4,a[o++]=e&255),i===1&&(e=$t[t.charCodeAt(u)]<<10|$t[t.charCodeAt(u+1)]<<4|$t[t.charCodeAt(u+2)]>>2,a[o++]=e>>8&255,a[o++]=e&255),a}function v0(t){return nr[t>>18&63]+nr[t>>12&63]+nr[t>>6&63]+nr[t&63]}function b0(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(v0(n));return i.join("")}function _0(t){for(var e,r=t.length,n=r%3,i=[],a=16383,o=0,s=r-n;o<s;o+=a)i.push(b0(t,o,o+a>s?s:o+a));return n===1?(e=t[r-1],i.push(nr[e>>2]+nr[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(nr[e>>10]+nr[e>>4&63]+nr[e<<2&63]+"=")),i.join("")}var w0=4,Wd=0,Kd=1,S0=2;function qi(t){let e=t.length;for(;--e>=0;)t[e]=0}var C0=0,d1=1,x0=2,E0=3,k0=258,zl=29,uo=256,Ya=uo+1+zl,Di=30,Gl=19,h1=2*Ya+1,Rn=15,Ju=16,I0=7,Hl=256,m1=16,g1=17,y1=18,kl=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]),Os=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]),A0=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),v1=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),T0=512,wr=new Array((Ya+2)*2);qi(wr);var za=new Array(Di*2);qi(za);var Xa=new Array(T0);qi(Xa);var eo=new Array(k0-E0+1);qi(eo);var Wl=new Array(zl);qi(Wl);var Ks=new Array(Di);qi(Ks);function Yu(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 b1,_1,w1;function Xu(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}var S1=t=>t<256?Xa[t]:Xa[256+(t>>>7)],to=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},_t=(t,e,r)=>{t.bi_valid>Ju-r?(t.bi_buf|=e<<t.bi_valid&65535,to(t,t.bi_buf),t.bi_buf=e>>Ju-t.bi_valid,t.bi_valid+=r-Ju):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)},ir=(t,e,r)=>{_t(t,r[e*2],r[e*2+1])},C1=(t,e)=>{let r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1},O0=t=>{t.bi_valid===16?(to(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)},D0=(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,f,p,h,g=0;for(f=0;f<=Rn;f++)t.bl_count[f]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<h1;c++)l=t.heap[c],f=r[r[l*2+1]*2+1]+1,f>u&&(f=u,g++),r[l*2+1]=f,!(l>n)&&(t.bl_count[f]++,p=0,l>=s&&(p=o[l-s]),h=r[l*2],t.opt_len+=h*(f+p),a&&(t.static_len+=h*(i[l*2+1]+p)));if(g!==0){do{for(f=u-1;t.bl_count[f]===0;)f--;t.bl_count[f]--,t.bl_count[f+1]+=2,t.bl_count[u]--,g-=2}while(g>0);for(f=u;f!==0;f--)for(l=t.bl_count[f];l!==0;)d=t.heap[--c],!(d>n)&&(r[d*2+1]!==f&&(t.opt_len+=(f-r[d*2+1])*r[d*2],r[d*2+1]=f),l--)}},x1=(t,e,r)=>{let n=new Array(Rn+1),i=0,a,o;for(a=1;a<=Rn;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]=C1(n[s]++,s))}},N0=()=>{let t,e,r,n,i,a=new Array(Rn+1);for(r=0,n=0;n<zl-1;n++)for(Wl[n]=r,t=0;t<1<<kl[n];t++)eo[r++]=n;for(eo[r-1]=n,i=0,n=0;n<16;n++)for(Ks[n]=i,t=0;t<1<<Os[n];t++)Xa[i++]=n;for(i>>=7;n<Di;n++)for(Ks[n]=i<<7,t=0;t<1<<Os[n]-7;t++)Xa[256+i++]=n;for(e=0;e<=Rn;e++)a[e]=0;for(t=0;t<=143;)wr[t*2+1]=8,t++,a[8]++;for(;t<=255;)wr[t*2+1]=9,t++,a[9]++;for(;t<=279;)wr[t*2+1]=7,t++,a[7]++;for(;t<=287;)wr[t*2+1]=8,t++,a[8]++;for(x1(wr,Ya+1,a),t=0;t<Di;t++)za[t*2+1]=5,za[t*2]=C1(t,5);b1=new Yu(wr,kl,uo+1,Ya,Rn),_1=new Yu(za,Os,0,Di,Rn),w1=new Yu(new Array(0),A0,0,Gl,I0)},E1=t=>{let e;for(e=0;e<Ya;e++)t.dyn_ltree[e*2]=0;for(e=0;e<Di;e++)t.dyn_dtree[e*2]=0;for(e=0;e<Gl;e++)t.bl_tree[e*2]=0;t.dyn_ltree[Hl*2]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},k1=t=>{t.bi_valid>8?to(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},Zd=(t,e,r,n)=>{let i=e*2,a=r*2;return t[i]<t[a]||t[i]===t[a]&&n[e]<=n[r]},el=(t,e,r)=>{let n=t.heap[r],i=r<<1;for(;i<=t.heap_len&&(i<t.heap_len&&Zd(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!Zd(e,n,t.heap[i],t.depth));)t.heap[r]=t.heap[i],r=i,i<<=1;t.heap[r]=n},Jd=(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?ir(t,i,e):(o=eo[i],ir(t,o+uo+1,e),s=kl[o],s!==0&&(i-=Wl[o],_t(t,i,s)),n--,o=S1(n),ir(t,o,r),s=Os[o],s!==0&&(n-=Ks[o],_t(t,n,s)));while(a<t.sym_next);ir(t,Hl,e)},Il=(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=h1,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--)el(t,r,o);c=a;do o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],el(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++,el(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],D0(t,e),x1(r,u,t.bl_count)},Yd=(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[m1*2]++):s<=10?t.bl_tree[g1*2]++:t.bl_tree[y1*2]++,s=0,i=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4))},Xd=(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 ir(t,a,t.bl_tree);while(--s!==0);else a!==0?(a!==i&&(ir(t,a,t.bl_tree),s--),ir(t,m1,t.bl_tree),_t(t,s-3,2)):s<=10?(ir(t,g1,t.bl_tree),_t(t,s-3,3)):(ir(t,y1,t.bl_tree),_t(t,s-11,7));s=0,i=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4)}},P0=t=>{let e;for(Yd(t,t.dyn_ltree,t.l_desc.max_code),Yd(t,t.dyn_dtree,t.d_desc.max_code),Il(t,t.bl_desc),e=Gl-1;e>=3&&t.bl_tree[v1[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},R0=(t,e,r,n)=>{let i;for(_t(t,e-257,5),_t(t,r-1,5),_t(t,n-4,4),i=0;i<n;i++)_t(t,t.bl_tree[v1[i]*2+1],3);Xd(t,t.dyn_ltree,e-1),Xd(t,t.dyn_dtree,r-1)},$0=t=>{let e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return Wd;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return Kd;for(r=32;r<uo;r++)if(t.dyn_ltree[r*2]!==0)return Kd;return Wd},eh=!1,L0=t=>{eh||(N0(),eh=!0),t.l_desc=new Xu(t.dyn_ltree,b1),t.d_desc=new Xu(t.dyn_dtree,_1),t.bl_desc=new Xu(t.bl_tree,w1),t.bi_buf=0,t.bi_valid=0,E1(t)},I1=(t,e,r,n)=>{_t(t,(C0<<1)+(n?1:0),3),k1(t),to(t,r),to(t,~r),r&&t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r},F0=t=>{_t(t,d1<<1,3),ir(t,Hl,wr),O0(t)},M0=(t,e,r,n)=>{let i,a,o=0;t.level>0?(t.strm.data_type===S0&&(t.strm.data_type=$0(t)),Il(t,t.l_desc),Il(t,t.d_desc),o=P0(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?I1(t,e,r,n):t.strategy===w0||a===i?(_t(t,(d1<<1)+(n?1:0),3),Jd(t,wr,za)):(_t(t,(x0<<1)+(n?1:0),3),R0(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),Jd(t,t.dyn_ltree,t.dyn_dtree)),E1(t),n&&k1(t)},U0=(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[(eo[r]+uo+1)*2]++,t.dyn_dtree[S1(e)*2]++),t.sym_next===t.sym_end),j0=L0,B0=I1,q0=M0,V0=U0,Q0=F0,z0={_tr_init:j0,_tr_stored_block:B0,_tr_flush_block:q0,_tr_tally:V0,_tr_align:Q0},G0=(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},ro=G0,H0=()=>{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},W0=new Uint32Array(H0()),K0=(t,e,r,n)=>{let i=W0,a=n+r;t^=-1;for(let o=n;o<a;o++)t=t>>>8^i[(t^e[o])&255];return t^-1},He=K0,Vn={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"},Yn={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:Z0,_tr_stored_block:Al,_tr_flush_block:J0,_tr_tally:Zr,_tr_align:Y0}=z0,{Z_NO_FLUSH:Jr,Z_PARTIAL_FLUSH:X0,Z_FULL_FLUSH:e2,Z_FINISH:Ft,Z_BLOCK:th,Z_OK:tt,Z_STREAM_END:rh,Z_STREAM_ERROR:or,Z_DATA_ERROR:t2,Z_BUF_ERROR:tl,Z_DEFAULT_COMPRESSION:r2,Z_FILTERED:n2,Z_HUFFMAN_ONLY:hs,Z_RLE:i2,Z_FIXED:a2,Z_DEFAULT_STRATEGY:o2,Z_UNKNOWN:s2,Z_DEFLATED:uc}=Yn,c2=9,u2=15,l2=8,p2=29,f2=256,Tl=f2+1+p2,d2=30,h2=19,m2=2*Tl+1,g2=15,ne=3,Gr=258,sr=Gr+ne+1,y2=32,$i=42,Kl=57,Ol=69,Dl=73,Nl=91,Pl=103,$n=113,Ua=666,ft=1,Vi=2,Qn=3,Qi=4,v2=3,Ln=(t,e)=>(t.msg=Vn[e],e),nh=t=>t*2-(t>4?9:0),zr=t=>{let e=t.length;for(;--e>=0;)t[e]=0},b2=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)},_2=(t,e,r)=>(e<<t.hash_shift^r)&t.hash_mask,Yr=_2,Et=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))},It=(t,e)=>{J0(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,Et(t.strm)},le=(t,e)=>{t.pending_buf[t.pending++]=e},wa=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},Rl=(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=ro(t.adler,e,i,r):t.state.wrap===2&&(t.adler=He(t.adler,e,i,r)),t.next_in+=i,t.total_in+=i,i)},A1=(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-sr?t.strstart-(t.w_size-sr):0,c=t.window,l=t.w_mask,d=t.prev,f=t.strstart+Gr,p=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]!==p||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<f);if(a=Gr-(f-n),n=f-Gr,a>o){if(t.match_start=e,o=a,a>=s)break;p=c[n+o-1],h=c[n+o]}}while((e=d[e&l])>u&&--r!==0);return o<=t.lookahead?o:t.lookahead},Li=t=>{let e=t.w_size,r,n,i;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-sr)&&(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),b2(t),n+=e),t.strm.avail_in===0)break;if(r=Rl(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=r,t.lookahead+t.insert>=ne)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=Yr(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=Yr(t,t.ins_h,t.window[i+ne-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<ne)););}while(t.lookahead<sr&&t.strm.avail_in!==0)},T1=(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!==Ft||e===Jr||n!==i+t.strm.avail_in)))break;o=e===Ft&&n===i+t.strm.avail_in?1:0,Al(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,Et(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&&(Rl(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?Qi:e!==Jr&&e!==Ft&&t.strm.avail_in===0&&t.strstart===t.block_start?Vi:(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&&(Rl(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===Ft)&&e!==Jr&&t.strm.avail_in===0&&i<=a)&&(n=i>a?a:i,o=e===Ft&&t.strm.avail_in===0&&n===i?1:0,Al(t,t.block_start,n,o),t.block_start+=n,Et(t.strm)),o?Qn:ft)},rl=(t,e)=>{let r,n;for(;;){if(t.lookahead<sr){if(Li(t),t.lookahead<sr&&e===Jr)return ft;if(t.lookahead===0)break}if(r=0,t.lookahead>=ne&&(t.ins_h=Yr(t,t.ins_h,t.window[t.strstart+ne-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-sr&&(t.match_length=A1(t,r)),t.match_length>=ne)if(n=Zr(t,t.strstart-t.match_start,t.match_length-ne),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=ne){t.match_length--;do t.strstart++,t.ins_h=Yr(t,t.ins_h,t.window[t.strstart+ne-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=Yr(t,t.ins_h,t.window[t.strstart+1]);else n=Zr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(It(t,!1),t.strm.avail_out===0))return ft}return t.insert=t.strstart<ne-1?t.strstart:ne-1,e===Ft?(It(t,!0),t.strm.avail_out===0?Qn:Qi):t.sym_next&&(It(t,!1),t.strm.avail_out===0)?ft:Vi},xi=(t,e)=>{let r,n,i;for(;;){if(t.lookahead<sr){if(Li(t),t.lookahead<sr&&e===Jr)return ft;if(t.lookahead===0)break}if(r=0,t.lookahead>=ne&&(t.ins_h=Yr(t,t.ins_h,t.window[t.strstart+ne-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=ne-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-sr&&(t.match_length=A1(t,r),t.match_length<=5&&(t.strategy===n2||t.match_length===ne&&t.strstart-t.match_start>4096)&&(t.match_length=ne-1)),t.prev_length>=ne&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-ne,n=Zr(t,t.strstart-1-t.prev_match,t.prev_length-ne),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=Yr(t,t.ins_h,t.window[t.strstart+ne-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=ne-1,t.strstart++,n&&(It(t,!1),t.strm.avail_out===0))return ft}else if(t.match_available){if(n=Zr(t,0,t.window[t.strstart-1]),n&&It(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return ft}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=Zr(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<ne-1?t.strstart:ne-1,e===Ft?(It(t,!0),t.strm.avail_out===0?Qn:Qi):t.sym_next&&(It(t,!1),t.strm.avail_out===0)?ft:Vi},w2=(t,e)=>{let r,n,i,a,o=t.window;for(;;){if(t.lookahead<=Gr){if(Li(t),t.lookahead<=Gr&&e===Jr)return ft;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=ne&&t.strstart>0&&(i=t.strstart-1,n=o[i],n===o[++i]&&n===o[++i]&&n===o[++i])){a=t.strstart+Gr;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=Gr-(a-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=ne?(r=Zr(t,1,t.match_length-ne),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=Zr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(It(t,!1),t.strm.avail_out===0))return ft}return t.insert=0,e===Ft?(It(t,!0),t.strm.avail_out===0?Qn:Qi):t.sym_next&&(It(t,!1),t.strm.avail_out===0)?ft:Vi},S2=(t,e)=>{let r;for(;;){if(t.lookahead===0&&(Li(t),t.lookahead===0)){if(e===Jr)return ft;break}if(t.match_length=0,r=Zr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(It(t,!1),t.strm.avail_out===0))return ft}return t.insert=0,e===Ft?(It(t,!0),t.strm.avail_out===0?Qn:Qi):t.sym_next&&(It(t,!1),t.strm.avail_out===0)?ft:Vi};function er(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 ja=[new er(0,0,0,0,T1),new er(4,4,8,4,rl),new er(4,5,16,8,rl),new er(4,6,32,32,rl),new er(4,4,16,16,xi),new er(8,16,32,32,xi),new er(8,16,128,128,xi),new er(8,32,128,256,xi),new er(32,128,258,1024,xi),new er(32,258,258,4096,xi)],C2=t=>{t.window_size=2*t.w_size,zr(t.head),t.max_lazy_match=ja[t.level].max_lazy,t.good_match=ja[t.level].good_length,t.nice_match=ja[t.level].nice_length,t.max_chain_length=ja[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=ne-1,t.match_available=0,t.ins_h=0};function x2(){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=uc,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(m2*2),this.dyn_dtree=new Uint16Array((2*d2+1)*2),this.bl_tree=new Uint16Array((2*h2+1)*2),zr(this.dyn_ltree),zr(this.dyn_dtree),zr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(g2+1),this.heap=new Uint16Array(2*Tl+1),zr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Tl+1),zr(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 lo=t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.status!==$i&&e.status!==Kl&&e.status!==Ol&&e.status!==Dl&&e.status!==Nl&&e.status!==Pl&&e.status!==$n&&e.status!==Ua?1:0},O1=t=>{if(lo(t))return Ln(t,or);t.total_in=t.total_out=0,t.data_type=s2;let e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?Kl:e.wrap?$i:$n,t.adler=e.wrap===2?0:1,e.last_flush=-2,Z0(e),tt},D1=t=>{let e=O1(t);return e===tt&&C2(t.state),e},E2=(t,e)=>lo(t)||t.state.wrap!==2?or:(t.state.gzhead=e,tt),N1=(t,e,r,n,i,a)=>{if(!t)return or;let o=1;if(e===r2&&(e=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>c2||r!==uc||n<8||n>15||e<0||e>9||a<0||a>a2||n===8&&o!==1)return Ln(t,or);n===8&&(n=9);let s=new x2;return t.state=s,s.strm=t,s.status=$i,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+ne-1)/ne),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,D1(t)},k2=(t,e)=>N1(t,e,uc,u2,l2,o2),I2=(t,e)=>{if(lo(t)||e>th||e<0)return t?Ln(t,or):or;let r=t.state;if(!t.output||t.avail_in!==0&&!t.input||r.status===Ua&&e!==Ft)return Ln(t,t.avail_out===0?tl:or);let n=r.last_flush;if(r.last_flush=e,r.pending!==0){if(Et(t),t.avail_out===0)return r.last_flush=-1,tt}else if(t.avail_in===0&&nh(e)<=nh(n)&&e!==Ft)return Ln(t,tl);if(r.status===Ua&&t.avail_in!==0)return Ln(t,tl);if(r.status===$i&&r.wrap===0&&(r.status=$n),r.status===$i){let i=uc+(r.w_bits-8<<4)<<8,a=-1;if(r.strategy>=hs||r.level<2?a=0:r.level<6?a=1:r.level===6?a=2:a=3,i|=a<<6,r.strstart!==0&&(i|=y2),i+=31-i%31,wa(r,i),r.strstart!==0&&(wa(r,t.adler>>>16),wa(r,t.adler&65535)),t.adler=1,r.status=$n,Et(t),r.pending!==0)return r.last_flush=-1,tt}if(r.status===Kl){if(t.adler=0,le(r,31),le(r,139),le(r,8),r.gzhead)le(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)),le(r,r.gzhead.time&255),le(r,r.gzhead.time>>8&255),le(r,r.gzhead.time>>16&255),le(r,r.gzhead.time>>24&255),le(r,r.level===9?2:r.strategy>=hs||r.level<2?4:0),le(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(le(r,r.gzhead.extra.length&255),le(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=He(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Ol;else if(le(r,0),le(r,0),le(r,0),le(r,0),le(r,0),le(r,r.level===9?2:r.strategy>=hs||r.level<2?4:0),le(r,v2),r.status=$n,Et(t),r.pending!==0)return r.last_flush=-1,tt}if(r.status===Ol){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=He(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex+=s,Et(t),r.pending!==0)return r.last_flush=-1,tt;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=He(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=Dl}if(r.status===Dl){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=He(t.adler,r.pending_buf,r.pending-i,i)),Et(t),r.pending!==0)return r.last_flush=-1,tt;i=0}r.gzindex<r.gzhead.name.length?a=r.gzhead.name.charCodeAt(r.gzindex++)&255:a=0,le(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(t.adler=He(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=Nl}if(r.status===Nl){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=He(t.adler,r.pending_buf,r.pending-i,i)),Et(t),r.pending!==0)return r.last_flush=-1,tt;i=0}r.gzindex<r.gzhead.comment.length?a=r.gzhead.comment.charCodeAt(r.gzindex++)&255:a=0,le(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(t.adler=He(t.adler,r.pending_buf,r.pending-i,i))}r.status=Pl}if(r.status===Pl){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(Et(t),r.pending!==0))return r.last_flush=-1,tt;le(r,t.adler&255),le(r,t.adler>>8&255),t.adler=0}if(r.status=$n,Et(t),r.pending!==0)return r.last_flush=-1,tt}if(t.avail_in!==0||r.lookahead!==0||e!==Jr&&r.status!==Ua){let i=r.level===0?T1(r,e):r.strategy===hs?S2(r,e):r.strategy===i2?w2(r,e):ja[r.level].func(r,e);if((i===Qn||i===Qi)&&(r.status=Ua),i===ft||i===Qn)return t.avail_out===0&&(r.last_flush=-1),tt;if(i===Vi&&(e===X0?Y0(r):e!==th&&(Al(r,0,0,!1),e===e2&&(zr(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),Et(t),t.avail_out===0))return r.last_flush=-1,tt}return e!==Ft?tt:r.wrap<=0?rh:(r.wrap===2?(le(r,t.adler&255),le(r,t.adler>>8&255),le(r,t.adler>>16&255),le(r,t.adler>>24&255),le(r,t.total_in&255),le(r,t.total_in>>8&255),le(r,t.total_in>>16&255),le(r,t.total_in>>24&255)):(wa(r,t.adler>>>16),wa(r,t.adler&65535)),Et(t),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?tt:rh)},A2=t=>{if(lo(t))return or;let e=t.state.status;return t.state=null,e===$n?Ln(t,t2):tt},T2=(t,e)=>{let r=e.length;if(lo(t))return or;let n=t.state,i=n.wrap;if(i===2||i===1&&n.status!==$i||n.lookahead)return or;if(i===1&&(t.adler=ro(t.adler,e,r,0)),n.wrap=0,r>=n.w_size){i===0&&(zr(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,Li(n);n.lookahead>=ne;){let u=n.strstart,c=n.lookahead-(ne-1);do n.ins_h=Yr(n,n.ins_h,n.window[u+ne-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=ne-1,Li(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=ne-1,n.match_available=0,t.next_in=o,t.input=s,t.avail_in=a,n.wrap=i,tt},O2=k2,D2=N1,N2=D1,P2=O1,R2=E2,$2=I2,L2=A2,F2=T2,M2="pako deflate (from Nodeca project)",Ga={deflateInit:O2,deflateInit2:D2,deflateReset:N2,deflateResetKeep:P2,deflateSetHeader:R2,deflate:$2,deflateEnd:L2,deflateSetDictionary:F2,deflateInfo:M2},U2=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),j2=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)U2(r,n)&&(t[n]=r[n])}}return t},B2=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},lc={assign:j2,flattenChunks:B2},P1=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){P1=!1}var no=new Uint8Array(256);for(let t=0;t<256;t++)no[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;no[254]=no[254]=1;var q2=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},V2=(t,e)=>{if(e<65534&&t.subarray&&P1)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},Q2=(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=no[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 V2(a,i)},z2=(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+no[t[r]]>e?r:e},io={string2buf:q2,buf2string:Q2,utf8border:z2};function G2(){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 R1=G2,$1=Object.prototype.toString,{Z_NO_FLUSH:H2,Z_SYNC_FLUSH:W2,Z_FULL_FLUSH:K2,Z_FINISH:Z2,Z_OK:Zs,Z_STREAM_END:J2,Z_DEFAULT_COMPRESSION:Y2,Z_DEFAULT_STRATEGY:X2,Z_DEFLATED:ev}=Yn;function po(t){this.options=lc.assign({level:Y2,method:ev,chunkSize:16384,windowBits:15,memLevel:8,strategy:X2},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 R1,this.strm.avail_out=0;let r=Ga.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==Zs)throw new Error(Vn[r]);if(e.header&&Ga.deflateSetHeader(this.strm,e.header),e.dictionary){let n;if(typeof e.dictionary=="string"?n=io.string2buf(e.dictionary):$1.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,r=Ga.deflateSetDictionary(this.strm,n),r!==Zs)throw new Error(Vn[r]);this._dict_set=!0}}po.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?Z2:H2,typeof t=="string"?r.input=io.string2buf(t):$1.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===W2||a===K2)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(i=Ga.deflate(r,a),i===J2)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=Ga.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Zs;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};po.prototype.onData=function(t){this.chunks.push(t)};po.prototype.onEnd=function(t){t===Zs&&(this.result=lc.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Zl(t,e){let r=new po(e);if(r.push(t,!0),r.err)throw r.msg||Vn[r.err];return r.result}function tv(t,e){return e=e||{},e.raw=!0,Zl(t,e)}function rv(t,e){return e=e||{},e.gzip=!0,Zl(t,e)}var nv=po,iv=Zl,av=tv,ov=rv,sv=Yn,cv={Deflate:nv,deflate:iv,deflateRaw:av,gzip:ov,constants:sv},ms=16209,uv=16191,lv=function t(e,r){let n,i,a,o,s,u,c,l,d,f,p,h,g,v,C,_,b,y,T,R,k,P,F,$,q=e.state;n=e.next_in,F=e.input,i=n+(e.avail_in-5),a=e.next_out,$=e.output,o=a-(r-e.avail_out),s=a+(e.avail_out-257),u=q.dmax,c=q.wsize,l=q.whave,d=q.wnext,f=q.window,p=q.hold,h=q.bits,g=q.lencode,v=q.distcode,C=(1<<q.lenbits)-1,_=(1<<q.distbits)-1;e:do{h<15&&(p+=F[n++]<<h,h+=8,p+=F[n++]<<h,h+=8),b=g[p&C];t:for(;;){if(y=b>>>24,p>>>=y,h-=y,y=b>>>16&255,y===0)$[a++]=b&65535;else if(y&16){T=b&65535,y&=15,y&&(h<y&&(p+=F[n++]<<h,h+=8),T+=p&(1<<y)-1,p>>>=y,h-=y),h<15&&(p+=F[n++]<<h,h+=8,p+=F[n++]<<h,h+=8),b=v[p&_];r:for(;;){if(y=b>>>24,p>>>=y,h-=y,y=b>>>16&255,y&16){if(R=b&65535,y&=15,h<y&&(p+=F[n++]<<h,h+=8,h<y&&(p+=F[n++]<<h,h+=8)),R+=p&(1<<y)-1,R>u){e.msg="invalid distance too far back",q.mode=ms;break e}if(p>>>=y,h-=y,y=a-o,R>y){if(y=R-y,y>l&&q.sane){e.msg="invalid distance too far back",q.mode=ms;break e}if(k=0,P=f,d===0){if(k+=c-y,y<T){T-=y;do $[a++]=f[k++];while(--y);k=a-R,P=$}}else if(d<y){if(k+=c+d-y,y-=d,y<T){T-=y;do $[a++]=f[k++];while(--y);if(k=0,d<T){y=d,T-=y;do $[a++]=f[k++];while(--y);k=a-R,P=$}}}else if(k+=d-y,y<T){T-=y;do $[a++]=f[k++];while(--y);k=a-R,P=$}for(;T>2;)$[a++]=P[k++],$[a++]=P[k++],$[a++]=P[k++],T-=3;T&&($[a++]=P[k++],T>1&&($[a++]=P[k++]))}else{k=a-R;do $[a++]=$[k++],$[a++]=$[k++],$[a++]=$[k++],T-=3;while(T>2);T&&($[a++]=$[k++],T>1&&($[a++]=$[k++]))}}else if((y&64)===0){b=v[(b&65535)+(p&(1<<y)-1)];continue r}else{e.msg="invalid distance code",q.mode=ms;break e}break}}else if((y&64)===0){b=g[(b&65535)+(p&(1<<y)-1)];continue t}else if(y&32){q.mode=uv;break e}else{e.msg="invalid literal/length code",q.mode=ms;break e}break}}while(n<i&&a<s);T=h>>3,n-=T,h-=T<<3,p&=(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),q.hold=p,q.bits=h},Ei=15,ih=852,ah=592,oh=0,nl=1,sh=2,pv=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]),fv=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]),dv=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]),hv=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]),mv=(t,e,r,n,i,a,o,s)=>{let u=s.bits,c=0,l=0,d=0,f=0,p=0,h=0,g=0,v=0,C=0,_=0,b,y,T,R,k,P=null,F,$=new Uint16Array(Ei+1),q=new Uint16Array(Ei+1),Ze=null,Me,V,be;for(c=0;c<=Ei;c++)$[c]=0;for(l=0;l<n;l++)$[e[r+l]]++;for(p=u,f=Ei;f>=1&&$[f]===0;f--);if(p>f&&(p=f),f===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,s.bits=1,0;for(d=1;d<f&&$[d]===0;d++);for(p<d&&(p=d),v=1,c=1;c<=Ei;c++)if(v<<=1,v-=$[c],v<0)return-1;if(v>0&&(t===oh||f!==1))return-1;for(q[1]=0,c=1;c<Ei;c++)q[c+1]=q[c]+$[c];for(l=0;l<n;l++)e[r+l]!==0&&(o[q[e[r+l]]++]=l);if(t===oh?(P=Ze=o,F=20):t===nl?(P=pv,Ze=fv,F=257):(P=dv,Ze=hv,F=0),_=0,l=0,c=d,k=a,h=p,g=0,T=-1,C=1<<p,R=C-1,t===nl&&C>ih||t===sh&&C>ah)return 1;for(;;){Me=c-g,o[l]+1<F?(V=0,be=o[l]):o[l]>=F?(V=Ze[o[l]-F],be=P[o[l]-F]):(V=32+64,be=0),b=1<<c-g,y=1<<h,d=y;do y-=b,i[k+(_>>g)+y]=Me<<24|V<<16|be|0;while(y!==0);for(b=1<<c-1;_&b;)b>>=1;if(b!==0?(_&=b-1,_+=b):_=0,l++,--$[c]===0){if(c===f)break;c=e[r+o[l]]}if(c>p&&(_&R)!==T){for(g===0&&(g=p),k+=d,h=c-g,v=1<<h;h+g<f&&(v-=$[h+g],!(v<=0));)h++,v<<=1;if(C+=1<<h,t===nl&&C>ih||t===sh&&C>ah)return 1;T=_&R,i[T]=p<<24|h<<16|k-a|0}}return _!==0&&(i[k+_]=c-g<<24|64<<16|0),s.bits=p,0},Ha=mv,gv=0,L1=1,F1=2,{Z_FINISH:ch,Z_BLOCK:yv,Z_TREES:gs,Z_OK:zn,Z_STREAM_END:vv,Z_NEED_DICT:bv,Z_STREAM_ERROR:Mt,Z_DATA_ERROR:M1,Z_MEM_ERROR:U1,Z_BUF_ERROR:_v,Z_DEFLATED:uh}=Yn,pc=16180,lh=16181,ph=16182,fh=16183,dh=16184,hh=16185,mh=16186,gh=16187,yh=16188,vh=16189,Js=16190,yr=16191,il=16192,bh=16193,al=16194,_h=16195,wh=16196,Sh=16197,Ch=16198,ys=16199,vs=16200,xh=16201,Eh=16202,kh=16203,Ih=16204,Ah=16205,ol=16206,Th=16207,Oh=16208,Ee=16209,j1=16210,B1=16211,wv=852,Sv=592,Cv=15,xv=Cv,Dh=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function Ev(){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 Xn=t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.mode<pc||e.mode>B1?1:0},q1=t=>{if(Xn(t))return Mt;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=pc,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(wv),e.distcode=e.distdyn=new Int32Array(Sv),e.sane=1,e.back=-1,zn},V1=t=>{if(Xn(t))return Mt;let e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,q1(t)},Q1=(t,e)=>{let r;if(Xn(t))return Mt;let n=t.state;return e<0?(r=0,e=-e):(r=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?Mt:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,V1(t))},z1=(t,e)=>{if(!t)return Mt;let r=new Ev;t.state=r,r.strm=t,r.window=null,r.mode=pc;let n=Q1(t,e);return n!==zn&&(t.state=null),n},kv=t=>z1(t,xv),Nh=!0,sl,cl,Iv=t=>{if(Nh){sl=new Int32Array(512),cl=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(Ha(L1,t.lens,0,288,sl,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Ha(F1,t.lens,0,32,cl,0,t.work,{bits:5}),Nh=!1}t.lencode=sl,t.lenbits=9,t.distcode=cl,t.distbits=5},G1=(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},Av=(t,e)=>{let r,n,i,a,o,s,u,c,l,d,f,p,h,g,v=0,C,_,b,y,T,R,k,P,F=new Uint8Array(4),$,q,Ze=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Xn(t)||!t.output||!t.input&&t.avail_in!==0)return Mt;r=t.state,r.mode===yr&&(r.mode=il),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,f=u,P=zn;e:for(;;)switch(r.mode){case pc:if(r.wrap===0){r.mode=il;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,F[0]=c&255,F[1]=c>>>8&255,r.check=He(r.check,F,2,0),c=0,l=0,r.mode=lh;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=Ee;break}if((c&15)!==uh){t.msg="unknown compression method",r.mode=Ee;break}if(c>>>=4,l-=4,k=(c&15)+8,r.wbits===0&&(r.wbits=k),k>15||k>r.wbits){t.msg="invalid window size",r.mode=Ee;break}r.dmax=1<<r.wbits,r.flags=0,t.adler=r.check=1,r.mode=c&512?vh:yr,c=0,l=0;break;case lh:for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.flags=c,(r.flags&255)!==uh){t.msg="unknown compression method",r.mode=Ee;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=Ee;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&r.wrap&4&&(F[0]=c&255,F[1]=c>>>8&255,r.check=He(r.check,F,2,0)),c=0,l=0,r.mode=ph;case ph: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&&(F[0]=c&255,F[1]=c>>>8&255,F[2]=c>>>16&255,F[3]=c>>>24&255,r.check=He(r.check,F,4,0)),c=0,l=0,r.mode=fh;case fh: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&&(F[0]=c&255,F[1]=c>>>8&255,r.check=He(r.check,F,2,0)),c=0,l=0,r.mode=dh;case dh: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&&(F[0]=c&255,F[1]=c>>>8&255,r.check=He(r.check,F,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=hh;case hh:if(r.flags&1024&&(p=r.length,p>s&&(p=s),p&&(r.head&&(k=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+p),k)),r.flags&512&&r.wrap&4&&(r.check=He(r.check,n,p,a)),s-=p,a+=p,r.length-=p),r.length))break e;r.length=0,r.mode=mh;case mh:if(r.flags&2048){if(s===0)break e;p=0;do k=n[a+p++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k));while(k&&p<s);if(r.flags&512&&r.wrap&4&&(r.check=He(r.check,n,p,a)),s-=p,a+=p,k)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=gh;case gh:if(r.flags&4096){if(s===0)break e;p=0;do k=n[a+p++],r.head&&k&&r.length<65536&&(r.head.comment+=String.fromCharCode(k));while(k&&p<s);if(r.flags&512&&r.wrap&4&&(r.check=He(r.check,n,p,a)),s-=p,a+=p,k)break e}else r.head&&(r.head.comment=null);r.mode=yh;case yh: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=Ee;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=yr;break;case vh:for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}t.adler=r.check=Dh(c),c=0,l=0,r.mode=Js;case Js: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,bv;t.adler=r.check=1,r.mode=yr;case yr:if(e===yv||e===gs)break e;case il:if(r.last){c>>>=l&7,l-=l&7,r.mode=ol;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=bh;break;case 1:if(Iv(r),r.mode=ys,e===gs){c>>>=2,l-=2;break e}break;case 2:r.mode=wh;break;case 3:t.msg="invalid block type",r.mode=Ee}c>>>=2,l-=2;break;case bh: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=Ee;break}if(r.length=c&65535,c=0,l=0,r.mode=al,e===gs)break e;case al:r.mode=_h;case _h:if(p=r.length,p){if(p>s&&(p=s),p>u&&(p=u),p===0)break e;i.set(n.subarray(a,a+p),o),s-=p,a+=p,u-=p,o+=p,r.length-=p;break}r.mode=yr;break;case wh: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=Ee;break}r.have=0,r.mode=Sh;case Sh:for(;r.have<r.ncode;){for(;l<3;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.lens[Ze[r.have++]]=c&7,c>>>=3,l-=3}for(;r.have<19;)r.lens[Ze[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,$={bits:r.lenbits},P=Ha(gv,r.lens,0,19,r.lencode,0,r.work,$),r.lenbits=$.bits,P){t.msg="invalid code lengths set",r.mode=Ee;break}r.have=0,r.mode=Ch;case Ch:for(;r.have<r.nlen+r.ndist;){for(;v=r.lencode[c&(1<<r.lenbits)-1],C=v>>>24,_=v>>>16&255,b=v&65535,!(C<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(b<16)c>>>=C,l-=C,r.lens[r.have++]=b;else{if(b===16){for(q=C+2;l<q;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(c>>>=C,l-=C,r.have===0){t.msg="invalid bit length repeat",r.mode=Ee;break}k=r.lens[r.have-1],p=3+(c&3),c>>>=2,l-=2}else if(b===17){for(q=C+3;l<q;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=C,l-=C,k=0,p=3+(c&7),c>>>=3,l-=3}else{for(q=C+7;l<q;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=C,l-=C,k=0,p=11+(c&127),c>>>=7,l-=7}if(r.have+p>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=Ee;break}for(;p--;)r.lens[r.have++]=k}}if(r.mode===Ee)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=Ee;break}if(r.lenbits=9,$={bits:r.lenbits},P=Ha(L1,r.lens,0,r.nlen,r.lencode,0,r.work,$),r.lenbits=$.bits,P){t.msg="invalid literal/lengths set",r.mode=Ee;break}if(r.distbits=6,r.distcode=r.distdyn,$={bits:r.distbits},P=Ha(F1,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,$),r.distbits=$.bits,P){t.msg="invalid distances set",r.mode=Ee;break}if(r.mode=ys,e===gs)break e;case ys:r.mode=vs;case vs: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,lv(t,f),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===yr&&(r.back=-1);break}for(r.back=0;v=r.lencode[c&(1<<r.lenbits)-1],C=v>>>24,_=v>>>16&255,b=v&65535,!(C<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(_&&(_&240)===0){for(y=C,T=_,R=b;v=r.lencode[R+((c&(1<<y+T)-1)>>y)],C=v>>>24,_=v>>>16&255,b=v&65535,!(y+C<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=y,l-=y,r.back+=y}if(c>>>=C,l-=C,r.back+=C,r.length=b,_===0){r.mode=Ah;break}if(_&32){r.back=-1,r.mode=yr;break}if(_&64){t.msg="invalid literal/length code",r.mode=Ee;break}r.extra=_&15,r.mode=xh;case xh:if(r.extra){for(q=r.extra;l<q;){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=Eh;case Eh:for(;v=r.distcode[c&(1<<r.distbits)-1],C=v>>>24,_=v>>>16&255,b=v&65535,!(C<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if((_&240)===0){for(y=C,T=_,R=b;v=r.distcode[R+((c&(1<<y+T)-1)>>y)],C=v>>>24,_=v>>>16&255,b=v&65535,!(y+C<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=y,l-=y,r.back+=y}if(c>>>=C,l-=C,r.back+=C,_&64){t.msg="invalid distance code",r.mode=Ee;break}r.offset=b,r.extra=_&15,r.mode=kh;case kh:if(r.extra){for(q=r.extra;l<q;){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=Ee;break}r.mode=Ih;case Ih:if(u===0)break e;if(p=f-u,r.offset>p){if(p=r.offset-p,p>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=Ee;break}p>r.wnext?(p-=r.wnext,h=r.wsize-p):h=r.wnext-p,p>r.length&&(p=r.length),g=r.window}else g=i,h=o-r.offset,p=r.length;p>u&&(p=u),u-=p,r.length-=p;do i[o++]=g[h++];while(--p);r.length===0&&(r.mode=vs);break;case Ah:if(u===0)break e;i[o++]=r.length,u--,r.mode=vs;break;case ol:if(r.wrap){for(;l<32;){if(s===0)break e;s--,c|=n[a++]<<l,l+=8}if(f-=u,t.total_out+=f,r.total+=f,r.wrap&4&&f&&(t.adler=r.check=r.flags?He(r.check,i,f,o-f):ro(r.check,i,f,o-f)),f=u,r.wrap&4&&(r.flags?c:Dh(c))!==r.check){t.msg="incorrect data check",r.mode=Ee;break}c=0,l=0}r.mode=Th;case Th: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=Ee;break}c=0,l=0}r.mode=Oh;case Oh:P=vv;break e;case Ee:P=M1;break e;case j1:return U1;case B1:default:return Mt}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||f!==t.avail_out&&r.mode<Ee&&(r.mode<ol||e!==ch))&&G1(t,t.output,t.next_out,f-t.avail_out),d-=t.avail_in,f-=t.avail_out,t.total_in+=d,t.total_out+=f,r.total+=f,r.wrap&4&&f&&(t.adler=r.check=r.flags?He(r.check,i,f,t.next_out-f):ro(r.check,i,f,t.next_out-f)),t.data_type=r.bits+(r.last?64:0)+(r.mode===yr?128:0)+(r.mode===ys||r.mode===al?256:0),(d===0&&f===0||e===ch)&&P===zn&&(P=_v),P},Tv=t=>{if(Xn(t))return Mt;let e=t.state;return e.window&&(e.window=null),t.state=null,zn},Ov=(t,e)=>{if(Xn(t))return Mt;let r=t.state;return(r.wrap&2)===0?Mt:(r.head=e,e.done=!1,zn)},Dv=(t,e)=>{let r=e.length,n,i,a;return Xn(t)||(n=t.state,n.wrap!==0&&n.mode!==Js)?Mt:n.mode===Js&&(i=1,i=ro(i,e,r,0),i!==n.check)?M1:(a=G1(t,e,r,r),a?(n.mode=j1,U1):(n.havedict=1,zn))},Nv=V1,Pv=Q1,Rv=q1,$v=kv,Lv=z1,Fv=Av,Mv=Tv,Uv=Ov,jv=Dv,Bv="pako inflate (from Nodeca project)",Sr={inflateReset:Nv,inflateReset2:Pv,inflateResetKeep:Rv,inflateInit:$v,inflateInit2:Lv,inflate:Fv,inflateEnd:Mv,inflateGetHeader:Uv,inflateSetDictionary:jv,inflateInfo:Bv};function qv(){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 Vv=qv,H1=Object.prototype.toString,{Z_NO_FLUSH:Qv,Z_FINISH:zv,Z_OK:ao,Z_STREAM_END:ul,Z_NEED_DICT:ll,Z_STREAM_ERROR:Gv,Z_DATA_ERROR:Ph,Z_MEM_ERROR:Hv}=Yn;function fo(t){this.options=lc.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 R1,this.strm.avail_out=0;let r=Sr.inflateInit2(this.strm,e.windowBits);if(r!==ao)throw new Error(Vn[r]);if(this.header=new Vv,Sr.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=io.string2buf(e.dictionary):H1.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=Sr.inflateSetDictionary(this.strm,e.dictionary),r!==ao)))throw new Error(Vn[r])}fo.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?zv:Qv,H1.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=Sr.inflate(r,o),a===ll&&i&&(a=Sr.inflateSetDictionary(r,i),a===ao?a=Sr.inflate(r,o):a===Ph&&(a=ll));r.avail_in>0&&a===ul&&r.state.wrap>0&&t[r.next_in]!==0;)Sr.inflateReset(r),a=Sr.inflate(r,o);switch(a){case Gv:case Ph:case ll:case Hv:return this.onEnd(a),this.ended=!0,!1}if(s=r.avail_out,r.next_out&&(r.avail_out===0||a===ul))if(this.options.to==="string"){let u=io.utf8border(r.output,r.next_out),c=r.next_out-u,l=io.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===ao&&s===0)){if(a===ul)return a=Sr.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};fo.prototype.onData=function(t){this.chunks.push(t)};fo.prototype.onEnd=function(t){t===ao&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=lc.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Jl(t,e){let r=new fo(e);if(r.push(t),r.err)throw r.msg||Vn[r.err];return r.result}function Wv(t,e){return e=e||{},e.raw=!0,Jl(t,e)}var Kv=fo,Zv=Jl,Jv=Wv,Yv=Jl,Xv=Yn,e3={Inflate:Kv,inflate:Zv,inflateRaw:Jv,ungzip:Yv,constants:Xv},{Deflate:t3,deflate:r3,deflateRaw:n3,gzip:i3}=cv,{Inflate:a3,inflate:o3,inflateRaw:s3,ungzip:c3}=e3,u3=t3,l3=r3,p3=n3,f3=i3,d3=a3,h3=o3,m3=s3,g3=c3,y3=Yn,v3={Deflate:u3,deflate:l3,deflateRaw:p3,gzip:f3,Inflate:d3,inflate:h3,inflateRaw:m3,ungzip:g3,constants:y3},we=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},Se=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Ys=class{constructor(e,r){this.input=e,this.output=r}};we([m(),Se("design:type",String)],Ys.prototype,"input",void 0);we([m(),Se("design:type",String)],Ys.prototype,"output",void 0);Ys=we([Ke(),Se("design:paramtypes",[String,String])],Ys);var Xs=class{constructor(e,r){this.input=e,this.output=r}};we([m(),Se("design:type",String)],Xs.prototype,"input",void 0);we([m(),Se("design:type",String)],Xs.prototype,"output",void 0);Xs=we([W(),Se("design:paramtypes",[String,String])],Xs);var nn=class{constructor(e,r,n,i,a){this.name=e,this.modelId=r,this.systemPrompt=n,this.promptExamples=i,this.metaData=a}};we([m(),Se("design:type",String)],nn.prototype,"name",void 0);we([m(),Se("design:type",String)],nn.prototype,"modelId",void 0);we([m(),Se("design:type",String)],nn.prototype,"systemPrompt",void 0);we([m(),Se("design:type",Array)],nn.prototype,"promptExamples",void 0);we([m(),Se("design:type",String)],nn.prototype,"metaData",void 0);nn=we([Ke(),Se("design:paramtypes",[String,String,String,Array,String])],nn);var ur=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}};we([m(),Se("design:type",String)],ur.prototype,"name",void 0);we([m(),Se("design:type",String)],ur.prototype,"modelId",void 0);we([m(),Se("design:type",String)],ur.prototype,"taskId",void 0);we([m(),Se("design:type",String)],ur.prototype,"systemPrompt",void 0);we([m(),Se("design:type",Array)],ur.prototype,"promptExamples",void 0);we([m(),Se("design:type",String)],ur.prototype,"metaData",void 0);we([m(),Se("design:type",String)],ur.prototype,"createdAt",void 0);we([m(),Se("design:type",String)],ur.prototype,"updatedAt",void 0);ur=we([W(),Se("design:paramtypes",[String,String,String,String,Array,String,String,String])],ur);var Gn=class{constructor(e,r,n,i,a){this.model=e,this.status=r,this.progress=n,this.downloaded=i,this.loaded=a}};we([m(),Se("design:type",String)],Gn.prototype,"model",void 0);we([m(),Se("design:type",String)],Gn.prototype,"status",void 0);we([m(),Se("design:type",Number)],Gn.prototype,"progress",void 0);we([m(),Se("design:type",Boolean)],Gn.prototype,"downloaded",void 0);we([m(),Se("design:type",Boolean)],Gn.prototype,"loaded",void 0);Gn=we([W(),Se("design:paramtypes",[String,String,Number,Boolean,Boolean])],Gn);var b3=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},Qe=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)},Be,Ds,$l=class{constructor(e,r=!0){Be.set(this,void 0),Ds.set(this,new Map),b3(this,Be,e,"f")}async getModels(){let e=await Qe(this,Be,"f").query({query:E`
713
+ }`,variables:{url:e,interactionCall:r}}));return n}};_r=new WeakMap;var fc={};fc.byteLength=_0;fc.toByteArray=S0;fc.fromByteArray=E0;var ir=[],Lt=[],b0=typeof Uint8Array<"u"?Uint8Array:Array,el="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(En=0,Jd=el.length;En<Jd;++En)ir[En]=el[En],Lt[el.charCodeAt(En)]=En;var En,Jd;Lt["-".charCodeAt(0)]=62;Lt["_".charCodeAt(0)]=63;function y1(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 _0(t){var e=y1(t),r=e[0],n=e[1];return(r+n)*3/4-n}function w0(t,e,r){return(e+r)*3/4-r}function S0(t){var e,r=y1(t),n=r[0],i=r[1],a=new b0(w0(t,n,i)),o=0,s=i>0?n-4:n,u;for(u=0;u<s;u+=4)e=Lt[t.charCodeAt(u)]<<18|Lt[t.charCodeAt(u+1)]<<12|Lt[t.charCodeAt(u+2)]<<6|Lt[t.charCodeAt(u+3)],a[o++]=e>>16&255,a[o++]=e>>8&255,a[o++]=e&255;return i===2&&(e=Lt[t.charCodeAt(u)]<<2|Lt[t.charCodeAt(u+1)]>>4,a[o++]=e&255),i===1&&(e=Lt[t.charCodeAt(u)]<<10|Lt[t.charCodeAt(u+1)]<<4|Lt[t.charCodeAt(u+2)]>>2,a[o++]=e>>8&255,a[o++]=e&255),a}function C0(t){return ir[t>>18&63]+ir[t>>12&63]+ir[t>>6&63]+ir[t&63]}function x0(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(C0(n));return i.join("")}function E0(t){for(var e,r=t.length,n=r%3,i=[],a=16383,o=0,s=r-n;o<s;o+=a)i.push(x0(t,o,o+a>s?s:o+a));return n===1?(e=t[r-1],i.push(ir[e>>2]+ir[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(ir[e>>10]+ir[e>>4&63]+ir[e<<2&63]+"=")),i.join("")}var k0=4,Yd=0,Xd=1,A0=2;function Qi(t){let e=t.length;for(;--e>=0;)t[e]=0}var I0=0,v1=1,T0=2,O0=3,D0=258,Wl=29,go=256,no=go+1+Wl,Ni=30,Kl=19,b1=2*no+1,Rn=15,tl=16,N0=7,Zl=256,_1=16,w1=17,S1=18,Ol=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]),Ls=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]),P0=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),C1=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),R0=512,wr=new Array((no+2)*2);Qi(wr);var Wa=new Array(Ni*2);Qi(Wa);var io=new Array(R0);Qi(io);var ao=new Array(D0-O0+1);Qi(ao);var Jl=new Array(Wl);Qi(Jl);var ec=new Array(Ni);Qi(ec);function rl(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 x1,E1,k1;function nl(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}var A1=t=>t<256?io[t]:io[256+(t>>>7)],oo=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},wt=(t,e,r)=>{t.bi_valid>tl-r?(t.bi_buf|=e<<t.bi_valid&65535,oo(t,t.bi_buf),t.bi_buf=e>>tl-t.bi_valid,t.bi_valid+=r-tl):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)},ar=(t,e,r)=>{wt(t,r[e*2],r[e*2+1])},I1=(t,e)=>{let r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1},$0=t=>{t.bi_valid===16?(oo(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)},L0=(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,f,p,h,g=0;for(f=0;f<=Rn;f++)t.bl_count[f]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<b1;c++)l=t.heap[c],f=r[r[l*2+1]*2+1]+1,f>u&&(f=u,g++),r[l*2+1]=f,!(l>n)&&(t.bl_count[f]++,p=0,l>=s&&(p=o[l-s]),h=r[l*2],t.opt_len+=h*(f+p),a&&(t.static_len+=h*(i[l*2+1]+p)));if(g!==0){do{for(f=u-1;t.bl_count[f]===0;)f--;t.bl_count[f]--,t.bl_count[f+1]+=2,t.bl_count[u]--,g-=2}while(g>0);for(f=u;f!==0;f--)for(l=t.bl_count[f];l!==0;)d=t.heap[--c],!(d>n)&&(r[d*2+1]!==f&&(t.opt_len+=(f-r[d*2+1])*r[d*2],r[d*2+1]=f),l--)}},T1=(t,e,r)=>{let n=new Array(Rn+1),i=0,a,o;for(a=1;a<=Rn;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]=I1(n[s]++,s))}},F0=()=>{let t,e,r,n,i,a=new Array(Rn+1);for(r=0,n=0;n<Wl-1;n++)for(Jl[n]=r,t=0;t<1<<Ol[n];t++)ao[r++]=n;for(ao[r-1]=n,i=0,n=0;n<16;n++)for(ec[n]=i,t=0;t<1<<Ls[n];t++)io[i++]=n;for(i>>=7;n<Ni;n++)for(ec[n]=i<<7,t=0;t<1<<Ls[n]-7;t++)io[256+i++]=n;for(e=0;e<=Rn;e++)a[e]=0;for(t=0;t<=143;)wr[t*2+1]=8,t++,a[8]++;for(;t<=255;)wr[t*2+1]=9,t++,a[9]++;for(;t<=279;)wr[t*2+1]=7,t++,a[7]++;for(;t<=287;)wr[t*2+1]=8,t++,a[8]++;for(T1(wr,no+1,a),t=0;t<Ni;t++)Wa[t*2+1]=5,Wa[t*2]=I1(t,5);x1=new rl(wr,Ol,go+1,no,Rn),E1=new rl(Wa,Ls,0,Ni,Rn),k1=new rl(new Array(0),P0,0,Kl,N0)},O1=t=>{let e;for(e=0;e<no;e++)t.dyn_ltree[e*2]=0;for(e=0;e<Ni;e++)t.dyn_dtree[e*2]=0;for(e=0;e<Kl;e++)t.bl_tree[e*2]=0;t.dyn_ltree[Zl*2]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},D1=t=>{t.bi_valid>8?oo(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},eh=(t,e,r,n)=>{let i=e*2,a=r*2;return t[i]<t[a]||t[i]===t[a]&&n[e]<=n[r]},il=(t,e,r)=>{let n=t.heap[r],i=r<<1;for(;i<=t.heap_len&&(i<t.heap_len&&eh(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!eh(e,n,t.heap[i],t.depth));)t.heap[r]=t.heap[i],r=i,i<<=1;t.heap[r]=n},th=(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?ar(t,i,e):(o=ao[i],ar(t,o+go+1,e),s=Ol[o],s!==0&&(i-=Jl[o],wt(t,i,s)),n--,o=A1(n),ar(t,o,r),s=Ls[o],s!==0&&(n-=ec[o],wt(t,n,s)));while(a<t.sym_next);ar(t,Zl,e)},Dl=(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=b1,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--)il(t,r,o);c=a;do o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],il(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++,il(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],L0(t,e),T1(r,u,t.bl_count)},rh=(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[_1*2]++):s<=10?t.bl_tree[w1*2]++:t.bl_tree[S1*2]++,s=0,i=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4))},nh=(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 ar(t,a,t.bl_tree);while(--s!==0);else a!==0?(a!==i&&(ar(t,a,t.bl_tree),s--),ar(t,_1,t.bl_tree),wt(t,s-3,2)):s<=10?(ar(t,w1,t.bl_tree),wt(t,s-3,3)):(ar(t,S1,t.bl_tree),wt(t,s-11,7));s=0,i=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4)}},M0=t=>{let e;for(rh(t,t.dyn_ltree,t.l_desc.max_code),rh(t,t.dyn_dtree,t.d_desc.max_code),Dl(t,t.bl_desc),e=Kl-1;e>=3&&t.bl_tree[C1[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},U0=(t,e,r,n)=>{let i;for(wt(t,e-257,5),wt(t,r-1,5),wt(t,n-4,4),i=0;i<n;i++)wt(t,t.bl_tree[C1[i]*2+1],3);nh(t,t.dyn_ltree,e-1),nh(t,t.dyn_dtree,r-1)},j0=t=>{let e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return Yd;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return Xd;for(r=32;r<go;r++)if(t.dyn_ltree[r*2]!==0)return Xd;return Yd},ih=!1,B0=t=>{ih||(F0(),ih=!0),t.l_desc=new nl(t.dyn_ltree,x1),t.d_desc=new nl(t.dyn_dtree,E1),t.bl_desc=new nl(t.bl_tree,k1),t.bi_buf=0,t.bi_valid=0,O1(t)},N1=(t,e,r,n)=>{wt(t,(I0<<1)+(n?1:0),3),D1(t),oo(t,r),oo(t,~r),r&&t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r},q0=t=>{wt(t,v1<<1,3),ar(t,Zl,wr),$0(t)},V0=(t,e,r,n)=>{let i,a,o=0;t.level>0?(t.strm.data_type===A0&&(t.strm.data_type=j0(t)),Dl(t,t.l_desc),Dl(t,t.d_desc),o=M0(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?N1(t,e,r,n):t.strategy===k0||a===i?(wt(t,(v1<<1)+(n?1:0),3),th(t,wr,Wa)):(wt(t,(T0<<1)+(n?1:0),3),U0(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),th(t,t.dyn_ltree,t.dyn_dtree)),O1(t),n&&D1(t)},Q0=(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[(ao[r]+go+1)*2]++,t.dyn_dtree[A1(e)*2]++),t.sym_next===t.sym_end),z0=B0,H0=N1,G0=V0,W0=Q0,K0=q0,Z0={_tr_init:z0,_tr_stored_block:H0,_tr_flush_block:G0,_tr_tally:W0,_tr_align:K0},J0=(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},so=J0,Y0=()=>{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},X0=new Uint32Array(Y0()),ev=(t,e,r,n)=>{let i=X0,a=n+r;t^=-1;for(let o=n;o<a;o++)t=t>>>8^i[(t^e[o])&255];return t^-1},We=ev,Vn={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"},Yn={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:tv,_tr_stored_block:Nl,_tr_flush_block:rv,_tr_tally:Zr,_tr_align:nv}=Z0,{Z_NO_FLUSH:Jr,Z_PARTIAL_FLUSH:iv,Z_FULL_FLUSH:av,Z_FINISH:Mt,Z_BLOCK:ah,Z_OK:rt,Z_STREAM_END:oh,Z_STREAM_ERROR:sr,Z_DATA_ERROR:ov,Z_BUF_ERROR:al,Z_DEFAULT_COMPRESSION:sv,Z_FILTERED:cv,Z_HUFFMAN_ONLY:_s,Z_RLE:uv,Z_FIXED:lv,Z_DEFAULT_STRATEGY:pv,Z_UNKNOWN:fv,Z_DEFLATED:dc}=Yn,dv=9,hv=15,mv=8,gv=29,yv=256,Pl=yv+1+gv,vv=30,bv=19,_v=2*Pl+1,wv=15,oe=3,Hr=258,cr=Hr+oe+1,Sv=32,Li=42,Yl=57,Rl=69,$l=73,Ll=91,Fl=103,$n=113,qa=666,dt=1,zi=2,Qn=3,Hi=4,Cv=3,Ln=(t,e)=>(t.msg=Vn[e],e),sh=t=>t*2-(t>4?9:0),zr=t=>{let e=t.length;for(;--e>=0;)t[e]=0},xv=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)},Ev=(t,e,r)=>(e<<t.hash_shift^r)&t.hash_mask,Yr=Ev,Et=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))},At=(t,e)=>{rv(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,Et(t.strm)},de=(t,e)=>{t.pending_buf[t.pending++]=e},xa=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},Ml=(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=so(t.adler,e,i,r):t.state.wrap===2&&(t.adler=We(t.adler,e,i,r)),t.next_in+=i,t.total_in+=i,i)},P1=(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-cr?t.strstart-(t.w_size-cr):0,c=t.window,l=t.w_mask,d=t.prev,f=t.strstart+Hr,p=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]!==p||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<f);if(a=Hr-(f-n),n=f-Hr,a>o){if(t.match_start=e,o=a,a>=s)break;p=c[n+o-1],h=c[n+o]}}while((e=d[e&l])>u&&--r!==0);return o<=t.lookahead?o:t.lookahead},Fi=t=>{let e=t.w_size,r,n,i;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-cr)&&(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),xv(t),n+=e),t.strm.avail_in===0)break;if(r=Ml(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=r,t.lookahead+t.insert>=oe)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=Yr(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=Yr(t,t.ins_h,t.window[i+oe-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<oe)););}while(t.lookahead<cr&&t.strm.avail_in!==0)},R1=(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!==Mt||e===Jr||n!==i+t.strm.avail_in)))break;o=e===Mt&&n===i+t.strm.avail_in?1:0,Nl(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,Et(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&&(Ml(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?Hi:e!==Jr&&e!==Mt&&t.strm.avail_in===0&&t.strstart===t.block_start?zi:(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&&(Ml(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===Mt)&&e!==Jr&&t.strm.avail_in===0&&i<=a)&&(n=i>a?a:i,o=e===Mt&&t.strm.avail_in===0&&n===i?1:0,Nl(t,t.block_start,n,o),t.block_start+=n,Et(t.strm)),o?Qn:dt)},ol=(t,e)=>{let r,n;for(;;){if(t.lookahead<cr){if(Fi(t),t.lookahead<cr&&e===Jr)return dt;if(t.lookahead===0)break}if(r=0,t.lookahead>=oe&&(t.ins_h=Yr(t,t.ins_h,t.window[t.strstart+oe-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-cr&&(t.match_length=P1(t,r)),t.match_length>=oe)if(n=Zr(t,t.strstart-t.match_start,t.match_length-oe),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=oe){t.match_length--;do t.strstart++,t.ins_h=Yr(t,t.ins_h,t.window[t.strstart+oe-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=Yr(t,t.ins_h,t.window[t.strstart+1]);else n=Zr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(At(t,!1),t.strm.avail_out===0))return dt}return t.insert=t.strstart<oe-1?t.strstart:oe-1,e===Mt?(At(t,!0),t.strm.avail_out===0?Qn:Hi):t.sym_next&&(At(t,!1),t.strm.avail_out===0)?dt:zi},Ei=(t,e)=>{let r,n,i;for(;;){if(t.lookahead<cr){if(Fi(t),t.lookahead<cr&&e===Jr)return dt;if(t.lookahead===0)break}if(r=0,t.lookahead>=oe&&(t.ins_h=Yr(t,t.ins_h,t.window[t.strstart+oe-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=oe-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-cr&&(t.match_length=P1(t,r),t.match_length<=5&&(t.strategy===cv||t.match_length===oe&&t.strstart-t.match_start>4096)&&(t.match_length=oe-1)),t.prev_length>=oe&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-oe,n=Zr(t,t.strstart-1-t.prev_match,t.prev_length-oe),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=Yr(t,t.ins_h,t.window[t.strstart+oe-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=oe-1,t.strstart++,n&&(At(t,!1),t.strm.avail_out===0))return dt}else if(t.match_available){if(n=Zr(t,0,t.window[t.strstart-1]),n&&At(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return dt}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=Zr(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<oe-1?t.strstart:oe-1,e===Mt?(At(t,!0),t.strm.avail_out===0?Qn:Hi):t.sym_next&&(At(t,!1),t.strm.avail_out===0)?dt:zi},kv=(t,e)=>{let r,n,i,a,o=t.window;for(;;){if(t.lookahead<=Hr){if(Fi(t),t.lookahead<=Hr&&e===Jr)return dt;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=oe&&t.strstart>0&&(i=t.strstart-1,n=o[i],n===o[++i]&&n===o[++i]&&n===o[++i])){a=t.strstart+Hr;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=Hr-(a-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=oe?(r=Zr(t,1,t.match_length-oe),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=Zr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(At(t,!1),t.strm.avail_out===0))return dt}return t.insert=0,e===Mt?(At(t,!0),t.strm.avail_out===0?Qn:Hi):t.sym_next&&(At(t,!1),t.strm.avail_out===0)?dt:zi},Av=(t,e)=>{let r;for(;;){if(t.lookahead===0&&(Fi(t),t.lookahead===0)){if(e===Jr)return dt;break}if(t.match_length=0,r=Zr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(At(t,!1),t.strm.avail_out===0))return dt}return t.insert=0,e===Mt?(At(t,!0),t.strm.avail_out===0?Qn:Hi):t.sym_next&&(At(t,!1),t.strm.avail_out===0)?dt:zi};function tr(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 Va=[new tr(0,0,0,0,R1),new tr(4,4,8,4,ol),new tr(4,5,16,8,ol),new tr(4,6,32,32,ol),new tr(4,4,16,16,Ei),new tr(8,16,32,32,Ei),new tr(8,16,128,128,Ei),new tr(8,32,128,256,Ei),new tr(32,128,258,1024,Ei),new tr(32,258,258,4096,Ei)],Iv=t=>{t.window_size=2*t.w_size,zr(t.head),t.max_lazy_match=Va[t.level].max_lazy,t.good_match=Va[t.level].good_length,t.nice_match=Va[t.level].nice_length,t.max_chain_length=Va[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=oe-1,t.match_available=0,t.ins_h=0};function Tv(){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=dc,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(_v*2),this.dyn_dtree=new Uint16Array((2*vv+1)*2),this.bl_tree=new Uint16Array((2*bv+1)*2),zr(this.dyn_ltree),zr(this.dyn_dtree),zr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(wv+1),this.heap=new Uint16Array(2*Pl+1),zr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Pl+1),zr(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 yo=t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.status!==Li&&e.status!==Yl&&e.status!==Rl&&e.status!==$l&&e.status!==Ll&&e.status!==Fl&&e.status!==$n&&e.status!==qa?1:0},$1=t=>{if(yo(t))return Ln(t,sr);t.total_in=t.total_out=0,t.data_type=fv;let e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?Yl:e.wrap?Li:$n,t.adler=e.wrap===2?0:1,e.last_flush=-2,tv(e),rt},L1=t=>{let e=$1(t);return e===rt&&Iv(t.state),e},Ov=(t,e)=>yo(t)||t.state.wrap!==2?sr:(t.state.gzhead=e,rt),F1=(t,e,r,n,i,a)=>{if(!t)return sr;let o=1;if(e===sv&&(e=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>dv||r!==dc||n<8||n>15||e<0||e>9||a<0||a>lv||n===8&&o!==1)return Ln(t,sr);n===8&&(n=9);let s=new Tv;return t.state=s,s.strm=t,s.status=Li,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+oe-1)/oe),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,L1(t)},Dv=(t,e)=>F1(t,e,dc,hv,mv,pv),Nv=(t,e)=>{if(yo(t)||e>ah||e<0)return t?Ln(t,sr):sr;let r=t.state;if(!t.output||t.avail_in!==0&&!t.input||r.status===qa&&e!==Mt)return Ln(t,t.avail_out===0?al:sr);let n=r.last_flush;if(r.last_flush=e,r.pending!==0){if(Et(t),t.avail_out===0)return r.last_flush=-1,rt}else if(t.avail_in===0&&sh(e)<=sh(n)&&e!==Mt)return Ln(t,al);if(r.status===qa&&t.avail_in!==0)return Ln(t,al);if(r.status===Li&&r.wrap===0&&(r.status=$n),r.status===Li){let i=dc+(r.w_bits-8<<4)<<8,a=-1;if(r.strategy>=_s||r.level<2?a=0:r.level<6?a=1:r.level===6?a=2:a=3,i|=a<<6,r.strstart!==0&&(i|=Sv),i+=31-i%31,xa(r,i),r.strstart!==0&&(xa(r,t.adler>>>16),xa(r,t.adler&65535)),t.adler=1,r.status=$n,Et(t),r.pending!==0)return r.last_flush=-1,rt}if(r.status===Yl){if(t.adler=0,de(r,31),de(r,139),de(r,8),r.gzhead)de(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)),de(r,r.gzhead.time&255),de(r,r.gzhead.time>>8&255),de(r,r.gzhead.time>>16&255),de(r,r.gzhead.time>>24&255),de(r,r.level===9?2:r.strategy>=_s||r.level<2?4:0),de(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(de(r,r.gzhead.extra.length&255),de(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=We(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Rl;else if(de(r,0),de(r,0),de(r,0),de(r,0),de(r,0),de(r,r.level===9?2:r.strategy>=_s||r.level<2?4:0),de(r,Cv),r.status=$n,Et(t),r.pending!==0)return r.last_flush=-1,rt}if(r.status===Rl){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=We(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex+=s,Et(t),r.pending!==0)return r.last_flush=-1,rt;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=We(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=$l}if(r.status===$l){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=We(t.adler,r.pending_buf,r.pending-i,i)),Et(t),r.pending!==0)return r.last_flush=-1,rt;i=0}r.gzindex<r.gzhead.name.length?a=r.gzhead.name.charCodeAt(r.gzindex++)&255:a=0,de(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(t.adler=We(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=Ll}if(r.status===Ll){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=We(t.adler,r.pending_buf,r.pending-i,i)),Et(t),r.pending!==0)return r.last_flush=-1,rt;i=0}r.gzindex<r.gzhead.comment.length?a=r.gzhead.comment.charCodeAt(r.gzindex++)&255:a=0,de(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(t.adler=We(t.adler,r.pending_buf,r.pending-i,i))}r.status=Fl}if(r.status===Fl){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(Et(t),r.pending!==0))return r.last_flush=-1,rt;de(r,t.adler&255),de(r,t.adler>>8&255),t.adler=0}if(r.status=$n,Et(t),r.pending!==0)return r.last_flush=-1,rt}if(t.avail_in!==0||r.lookahead!==0||e!==Jr&&r.status!==qa){let i=r.level===0?R1(r,e):r.strategy===_s?Av(r,e):r.strategy===uv?kv(r,e):Va[r.level].func(r,e);if((i===Qn||i===Hi)&&(r.status=qa),i===dt||i===Qn)return t.avail_out===0&&(r.last_flush=-1),rt;if(i===zi&&(e===iv?nv(r):e!==ah&&(Nl(r,0,0,!1),e===av&&(zr(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),Et(t),t.avail_out===0))return r.last_flush=-1,rt}return e!==Mt?rt:r.wrap<=0?oh:(r.wrap===2?(de(r,t.adler&255),de(r,t.adler>>8&255),de(r,t.adler>>16&255),de(r,t.adler>>24&255),de(r,t.total_in&255),de(r,t.total_in>>8&255),de(r,t.total_in>>16&255),de(r,t.total_in>>24&255)):(xa(r,t.adler>>>16),xa(r,t.adler&65535)),Et(t),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?rt:oh)},Pv=t=>{if(yo(t))return sr;let e=t.state.status;return t.state=null,e===$n?Ln(t,ov):rt},Rv=(t,e)=>{let r=e.length;if(yo(t))return sr;let n=t.state,i=n.wrap;if(i===2||i===1&&n.status!==Li||n.lookahead)return sr;if(i===1&&(t.adler=so(t.adler,e,r,0)),n.wrap=0,r>=n.w_size){i===0&&(zr(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,Fi(n);n.lookahead>=oe;){let u=n.strstart,c=n.lookahead-(oe-1);do n.ins_h=Yr(n,n.ins_h,n.window[u+oe-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=oe-1,Fi(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=oe-1,n.match_available=0,t.next_in=o,t.input=s,t.avail_in=a,n.wrap=i,rt},$v=Dv,Lv=F1,Fv=L1,Mv=$1,Uv=Ov,jv=Nv,Bv=Pv,qv=Rv,Vv="pako deflate (from Nodeca project)",Ka={deflateInit:$v,deflateInit2:Lv,deflateReset:Fv,deflateResetKeep:Mv,deflateSetHeader:Uv,deflate:jv,deflateEnd:Bv,deflateSetDictionary:qv,deflateInfo:Vv},Qv=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),zv=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)Qv(r,n)&&(t[n]=r[n])}}return t},Hv=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},hc={assign:zv,flattenChunks:Hv},M1=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){M1=!1}var co=new Uint8Array(256);for(let t=0;t<256;t++)co[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;co[254]=co[254]=1;var Gv=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},Wv=(t,e)=>{if(e<65534&&t.subarray&&M1)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},Kv=(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=co[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 Wv(a,i)},Zv=(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+co[t[r]]>e?r:e},uo={string2buf:Gv,buf2string:Kv,utf8border:Zv};function Jv(){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 U1=Jv,j1=Object.prototype.toString,{Z_NO_FLUSH:Yv,Z_SYNC_FLUSH:Xv,Z_FULL_FLUSH:e2,Z_FINISH:t2,Z_OK:tc,Z_STREAM_END:r2,Z_DEFAULT_COMPRESSION:n2,Z_DEFAULT_STRATEGY:i2,Z_DEFLATED:a2}=Yn;function vo(t){this.options=hc.assign({level:n2,method:a2,chunkSize:16384,windowBits:15,memLevel:8,strategy:i2},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 U1,this.strm.avail_out=0;let r=Ka.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==tc)throw new Error(Vn[r]);if(e.header&&Ka.deflateSetHeader(this.strm,e.header),e.dictionary){let n;if(typeof e.dictionary=="string"?n=uo.string2buf(e.dictionary):j1.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,r=Ka.deflateSetDictionary(this.strm,n),r!==tc)throw new Error(Vn[r]);this._dict_set=!0}}vo.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?t2:Yv,typeof t=="string"?r.input=uo.string2buf(t):j1.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===Xv||a===e2)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(i=Ka.deflate(r,a),i===r2)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=Ka.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===tc;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};vo.prototype.onData=function(t){this.chunks.push(t)};vo.prototype.onEnd=function(t){t===tc&&(this.result=hc.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Xl(t,e){let r=new vo(e);if(r.push(t,!0),r.err)throw r.msg||Vn[r.err];return r.result}function o2(t,e){return e=e||{},e.raw=!0,Xl(t,e)}function s2(t,e){return e=e||{},e.gzip=!0,Xl(t,e)}var c2=vo,u2=Xl,l2=o2,p2=s2,f2=Yn,d2={Deflate:c2,deflate:u2,deflateRaw:l2,gzip:p2,constants:f2},ws=16209,h2=16191,m2=function t(e,r){let n,i,a,o,s,u,c,l,d,f,p,h,g,b,C,w,_,y,T,R,k,P,M,$,V=e.state;n=e.next_in,M=e.input,i=n+(e.avail_in-5),a=e.next_out,$=e.output,o=a-(r-e.avail_out),s=a+(e.avail_out-257),u=V.dmax,c=V.wsize,l=V.whave,d=V.wnext,f=V.window,p=V.hold,h=V.bits,g=V.lencode,b=V.distcode,C=(1<<V.lenbits)-1,w=(1<<V.distbits)-1;e:do{h<15&&(p+=M[n++]<<h,h+=8,p+=M[n++]<<h,h+=8),_=g[p&C];t:for(;;){if(y=_>>>24,p>>>=y,h-=y,y=_>>>16&255,y===0)$[a++]=_&65535;else if(y&16){T=_&65535,y&=15,y&&(h<y&&(p+=M[n++]<<h,h+=8),T+=p&(1<<y)-1,p>>>=y,h-=y),h<15&&(p+=M[n++]<<h,h+=8,p+=M[n++]<<h,h+=8),_=b[p&w];r:for(;;){if(y=_>>>24,p>>>=y,h-=y,y=_>>>16&255,y&16){if(R=_&65535,y&=15,h<y&&(p+=M[n++]<<h,h+=8,h<y&&(p+=M[n++]<<h,h+=8)),R+=p&(1<<y)-1,R>u){e.msg="invalid distance too far back",V.mode=ws;break e}if(p>>>=y,h-=y,y=a-o,R>y){if(y=R-y,y>l&&V.sane){e.msg="invalid distance too far back",V.mode=ws;break e}if(k=0,P=f,d===0){if(k+=c-y,y<T){T-=y;do $[a++]=f[k++];while(--y);k=a-R,P=$}}else if(d<y){if(k+=c+d-y,y-=d,y<T){T-=y;do $[a++]=f[k++];while(--y);if(k=0,d<T){y=d,T-=y;do $[a++]=f[k++];while(--y);k=a-R,P=$}}}else if(k+=d-y,y<T){T-=y;do $[a++]=f[k++];while(--y);k=a-R,P=$}for(;T>2;)$[a++]=P[k++],$[a++]=P[k++],$[a++]=P[k++],T-=3;T&&($[a++]=P[k++],T>1&&($[a++]=P[k++]))}else{k=a-R;do $[a++]=$[k++],$[a++]=$[k++],$[a++]=$[k++],T-=3;while(T>2);T&&($[a++]=$[k++],T>1&&($[a++]=$[k++]))}}else if((y&64)===0){_=b[(_&65535)+(p&(1<<y)-1)];continue r}else{e.msg="invalid distance code",V.mode=ws;break e}break}}else if((y&64)===0){_=g[(_&65535)+(p&(1<<y)-1)];continue t}else if(y&32){V.mode=h2;break e}else{e.msg="invalid literal/length code",V.mode=ws;break e}break}}while(n<i&&a<s);T=h>>3,n-=T,h-=T<<3,p&=(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),V.hold=p,V.bits=h},ki=15,ch=852,uh=592,lh=0,sl=1,ph=2,g2=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]),y2=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]),v2=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]),b2=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]),_2=(t,e,r,n,i,a,o,s)=>{let u=s.bits,c=0,l=0,d=0,f=0,p=0,h=0,g=0,b=0,C=0,w=0,_,y,T,R,k,P=null,M,$=new Uint16Array(ki+1),V=new Uint16Array(ki+1),Je=null,je,Q,_e;for(c=0;c<=ki;c++)$[c]=0;for(l=0;l<n;l++)$[e[r+l]]++;for(p=u,f=ki;f>=1&&$[f]===0;f--);if(p>f&&(p=f),f===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,s.bits=1,0;for(d=1;d<f&&$[d]===0;d++);for(p<d&&(p=d),b=1,c=1;c<=ki;c++)if(b<<=1,b-=$[c],b<0)return-1;if(b>0&&(t===lh||f!==1))return-1;for(V[1]=0,c=1;c<ki;c++)V[c+1]=V[c]+$[c];for(l=0;l<n;l++)e[r+l]!==0&&(o[V[e[r+l]]++]=l);if(t===lh?(P=Je=o,M=20):t===sl?(P=g2,Je=y2,M=257):(P=v2,Je=b2,M=0),w=0,l=0,c=d,k=a,h=p,g=0,T=-1,C=1<<p,R=C-1,t===sl&&C>ch||t===ph&&C>uh)return 1;for(;;){je=c-g,o[l]+1<M?(Q=0,_e=o[l]):o[l]>=M?(Q=Je[o[l]-M],_e=P[o[l]-M]):(Q=32+64,_e=0),_=1<<c-g,y=1<<h,d=y;do y-=_,i[k+(w>>g)+y]=je<<24|Q<<16|_e|0;while(y!==0);for(_=1<<c-1;w&_;)_>>=1;if(_!==0?(w&=_-1,w+=_):w=0,l++,--$[c]===0){if(c===f)break;c=e[r+o[l]]}if(c>p&&(w&R)!==T){for(g===0&&(g=p),k+=d,h=c-g,b=1<<h;h+g<f&&(b-=$[h+g],!(b<=0));)h++,b<<=1;if(C+=1<<h,t===sl&&C>ch||t===ph&&C>uh)return 1;T=w&R,i[T]=p<<24|h<<16|k-a|0}}return w!==0&&(i[k+w]=c-g<<24|64<<16|0),s.bits=p,0},Za=_2,w2=0,B1=1,q1=2,{Z_FINISH:fh,Z_BLOCK:S2,Z_TREES:Ss,Z_OK:zn,Z_STREAM_END:C2,Z_NEED_DICT:x2,Z_STREAM_ERROR:Ut,Z_DATA_ERROR:V1,Z_MEM_ERROR:Q1,Z_BUF_ERROR:E2,Z_DEFLATED:dh}=Yn,mc=16180,hh=16181,mh=16182,gh=16183,yh=16184,vh=16185,bh=16186,_h=16187,wh=16188,Sh=16189,rc=16190,yr=16191,cl=16192,Ch=16193,ul=16194,xh=16195,Eh=16196,kh=16197,Ah=16198,Cs=16199,xs=16200,Ih=16201,Th=16202,Oh=16203,Dh=16204,Nh=16205,ll=16206,Ph=16207,Rh=16208,ke=16209,z1=16210,H1=16211,k2=852,A2=592,I2=15,T2=I2,$h=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function O2(){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 Xn=t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.mode<mc||e.mode>H1?1:0},G1=t=>{if(Xn(t))return Ut;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=mc,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(k2),e.distcode=e.distdyn=new Int32Array(A2),e.sane=1,e.back=-1,zn},W1=t=>{if(Xn(t))return Ut;let e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,G1(t)},K1=(t,e)=>{let r;if(Xn(t))return Ut;let n=t.state;return e<0?(r=0,e=-e):(r=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?Ut:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,W1(t))},Z1=(t,e)=>{if(!t)return Ut;let r=new O2;t.state=r,r.strm=t,r.window=null,r.mode=mc;let n=K1(t,e);return n!==zn&&(t.state=null),n},D2=t=>Z1(t,T2),Lh=!0,pl,fl,N2=t=>{if(Lh){pl=new Int32Array(512),fl=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(Za(B1,t.lens,0,288,pl,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Za(q1,t.lens,0,32,fl,0,t.work,{bits:5}),Lh=!1}t.lencode=pl,t.lenbits=9,t.distcode=fl,t.distbits=5},J1=(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},P2=(t,e)=>{let r,n,i,a,o,s,u,c,l,d,f,p,h,g,b=0,C,w,_,y,T,R,k,P,M=new Uint8Array(4),$,V,Je=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Xn(t)||!t.output||!t.input&&t.avail_in!==0)return Ut;r=t.state,r.mode===yr&&(r.mode=cl),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,f=u,P=zn;e:for(;;)switch(r.mode){case mc:if(r.wrap===0){r.mode=cl;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,M[0]=c&255,M[1]=c>>>8&255,r.check=We(r.check,M,2,0),c=0,l=0,r.mode=hh;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=ke;break}if((c&15)!==dh){t.msg="unknown compression method",r.mode=ke;break}if(c>>>=4,l-=4,k=(c&15)+8,r.wbits===0&&(r.wbits=k),k>15||k>r.wbits){t.msg="invalid window size",r.mode=ke;break}r.dmax=1<<r.wbits,r.flags=0,t.adler=r.check=1,r.mode=c&512?Sh:yr,c=0,l=0;break;case hh:for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.flags=c,(r.flags&255)!==dh){t.msg="unknown compression method",r.mode=ke;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=ke;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&r.wrap&4&&(M[0]=c&255,M[1]=c>>>8&255,r.check=We(r.check,M,2,0)),c=0,l=0,r.mode=mh;case mh: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&&(M[0]=c&255,M[1]=c>>>8&255,M[2]=c>>>16&255,M[3]=c>>>24&255,r.check=We(r.check,M,4,0)),c=0,l=0,r.mode=gh;case gh: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&&(M[0]=c&255,M[1]=c>>>8&255,r.check=We(r.check,M,2,0)),c=0,l=0,r.mode=yh;case yh: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&&(M[0]=c&255,M[1]=c>>>8&255,r.check=We(r.check,M,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=vh;case vh:if(r.flags&1024&&(p=r.length,p>s&&(p=s),p&&(r.head&&(k=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+p),k)),r.flags&512&&r.wrap&4&&(r.check=We(r.check,n,p,a)),s-=p,a+=p,r.length-=p),r.length))break e;r.length=0,r.mode=bh;case bh:if(r.flags&2048){if(s===0)break e;p=0;do k=n[a+p++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k));while(k&&p<s);if(r.flags&512&&r.wrap&4&&(r.check=We(r.check,n,p,a)),s-=p,a+=p,k)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=_h;case _h:if(r.flags&4096){if(s===0)break e;p=0;do k=n[a+p++],r.head&&k&&r.length<65536&&(r.head.comment+=String.fromCharCode(k));while(k&&p<s);if(r.flags&512&&r.wrap&4&&(r.check=We(r.check,n,p,a)),s-=p,a+=p,k)break e}else r.head&&(r.head.comment=null);r.mode=wh;case wh: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=ke;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=yr;break;case Sh:for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}t.adler=r.check=$h(c),c=0,l=0,r.mode=rc;case rc: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,x2;t.adler=r.check=1,r.mode=yr;case yr:if(e===S2||e===Ss)break e;case cl:if(r.last){c>>>=l&7,l-=l&7,r.mode=ll;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=Ch;break;case 1:if(N2(r),r.mode=Cs,e===Ss){c>>>=2,l-=2;break e}break;case 2:r.mode=Eh;break;case 3:t.msg="invalid block type",r.mode=ke}c>>>=2,l-=2;break;case Ch: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=ke;break}if(r.length=c&65535,c=0,l=0,r.mode=ul,e===Ss)break e;case ul:r.mode=xh;case xh:if(p=r.length,p){if(p>s&&(p=s),p>u&&(p=u),p===0)break e;i.set(n.subarray(a,a+p),o),s-=p,a+=p,u-=p,o+=p,r.length-=p;break}r.mode=yr;break;case Eh: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=ke;break}r.have=0,r.mode=kh;case kh:for(;r.have<r.ncode;){for(;l<3;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.lens[Je[r.have++]]=c&7,c>>>=3,l-=3}for(;r.have<19;)r.lens[Je[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,$={bits:r.lenbits},P=Za(w2,r.lens,0,19,r.lencode,0,r.work,$),r.lenbits=$.bits,P){t.msg="invalid code lengths set",r.mode=ke;break}r.have=0,r.mode=Ah;case Ah:for(;r.have<r.nlen+r.ndist;){for(;b=r.lencode[c&(1<<r.lenbits)-1],C=b>>>24,w=b>>>16&255,_=b&65535,!(C<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(_<16)c>>>=C,l-=C,r.lens[r.have++]=_;else{if(_===16){for(V=C+2;l<V;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(c>>>=C,l-=C,r.have===0){t.msg="invalid bit length repeat",r.mode=ke;break}k=r.lens[r.have-1],p=3+(c&3),c>>>=2,l-=2}else if(_===17){for(V=C+3;l<V;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=C,l-=C,k=0,p=3+(c&7),c>>>=3,l-=3}else{for(V=C+7;l<V;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=C,l-=C,k=0,p=11+(c&127),c>>>=7,l-=7}if(r.have+p>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=ke;break}for(;p--;)r.lens[r.have++]=k}}if(r.mode===ke)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=ke;break}if(r.lenbits=9,$={bits:r.lenbits},P=Za(B1,r.lens,0,r.nlen,r.lencode,0,r.work,$),r.lenbits=$.bits,P){t.msg="invalid literal/lengths set",r.mode=ke;break}if(r.distbits=6,r.distcode=r.distdyn,$={bits:r.distbits},P=Za(q1,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,$),r.distbits=$.bits,P){t.msg="invalid distances set",r.mode=ke;break}if(r.mode=Cs,e===Ss)break e;case Cs:r.mode=xs;case xs: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,m2(t,f),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===yr&&(r.back=-1);break}for(r.back=0;b=r.lencode[c&(1<<r.lenbits)-1],C=b>>>24,w=b>>>16&255,_=b&65535,!(C<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(w&&(w&240)===0){for(y=C,T=w,R=_;b=r.lencode[R+((c&(1<<y+T)-1)>>y)],C=b>>>24,w=b>>>16&255,_=b&65535,!(y+C<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=y,l-=y,r.back+=y}if(c>>>=C,l-=C,r.back+=C,r.length=_,w===0){r.mode=Nh;break}if(w&32){r.back=-1,r.mode=yr;break}if(w&64){t.msg="invalid literal/length code",r.mode=ke;break}r.extra=w&15,r.mode=Ih;case Ih:if(r.extra){for(V=r.extra;l<V;){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=Th;case Th:for(;b=r.distcode[c&(1<<r.distbits)-1],C=b>>>24,w=b>>>16&255,_=b&65535,!(C<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if((w&240)===0){for(y=C,T=w,R=_;b=r.distcode[R+((c&(1<<y+T)-1)>>y)],C=b>>>24,w=b>>>16&255,_=b&65535,!(y+C<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=y,l-=y,r.back+=y}if(c>>>=C,l-=C,r.back+=C,w&64){t.msg="invalid distance code",r.mode=ke;break}r.offset=_,r.extra=w&15,r.mode=Oh;case Oh:if(r.extra){for(V=r.extra;l<V;){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=ke;break}r.mode=Dh;case Dh:if(u===0)break e;if(p=f-u,r.offset>p){if(p=r.offset-p,p>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=ke;break}p>r.wnext?(p-=r.wnext,h=r.wsize-p):h=r.wnext-p,p>r.length&&(p=r.length),g=r.window}else g=i,h=o-r.offset,p=r.length;p>u&&(p=u),u-=p,r.length-=p;do i[o++]=g[h++];while(--p);r.length===0&&(r.mode=xs);break;case Nh:if(u===0)break e;i[o++]=r.length,u--,r.mode=xs;break;case ll:if(r.wrap){for(;l<32;){if(s===0)break e;s--,c|=n[a++]<<l,l+=8}if(f-=u,t.total_out+=f,r.total+=f,r.wrap&4&&f&&(t.adler=r.check=r.flags?We(r.check,i,f,o-f):so(r.check,i,f,o-f)),f=u,r.wrap&4&&(r.flags?c:$h(c))!==r.check){t.msg="incorrect data check",r.mode=ke;break}c=0,l=0}r.mode=Ph;case Ph: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=ke;break}c=0,l=0}r.mode=Rh;case Rh:P=C2;break e;case ke:P=V1;break e;case z1:return Q1;case H1:default:return Ut}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||f!==t.avail_out&&r.mode<ke&&(r.mode<ll||e!==fh))&&J1(t,t.output,t.next_out,f-t.avail_out),d-=t.avail_in,f-=t.avail_out,t.total_in+=d,t.total_out+=f,r.total+=f,r.wrap&4&&f&&(t.adler=r.check=r.flags?We(r.check,i,f,t.next_out-f):so(r.check,i,f,t.next_out-f)),t.data_type=r.bits+(r.last?64:0)+(r.mode===yr?128:0)+(r.mode===Cs||r.mode===ul?256:0),(d===0&&f===0||e===fh)&&P===zn&&(P=E2),P},R2=t=>{if(Xn(t))return Ut;let e=t.state;return e.window&&(e.window=null),t.state=null,zn},$2=(t,e)=>{if(Xn(t))return Ut;let r=t.state;return(r.wrap&2)===0?Ut:(r.head=e,e.done=!1,zn)},L2=(t,e)=>{let r=e.length,n,i,a;return Xn(t)||(n=t.state,n.wrap!==0&&n.mode!==rc)?Ut:n.mode===rc&&(i=1,i=so(i,e,r,0),i!==n.check)?V1:(a=J1(t,e,r,r),a?(n.mode=z1,Q1):(n.havedict=1,zn))},F2=W1,M2=K1,U2=G1,j2=D2,B2=Z1,q2=P2,V2=R2,Q2=$2,z2=L2,H2="pako inflate (from Nodeca project)",Sr={inflateReset:F2,inflateReset2:M2,inflateResetKeep:U2,inflateInit:j2,inflateInit2:B2,inflate:q2,inflateEnd:V2,inflateGetHeader:Q2,inflateSetDictionary:z2,inflateInfo:H2};function G2(){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 W2=G2,Y1=Object.prototype.toString,{Z_NO_FLUSH:K2,Z_FINISH:Z2,Z_OK:lo,Z_STREAM_END:dl,Z_NEED_DICT:hl,Z_STREAM_ERROR:J2,Z_DATA_ERROR:Fh,Z_MEM_ERROR:Y2}=Yn;function bo(t){this.options=hc.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 U1,this.strm.avail_out=0;let r=Sr.inflateInit2(this.strm,e.windowBits);if(r!==lo)throw new Error(Vn[r]);if(this.header=new W2,Sr.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=uo.string2buf(e.dictionary):Y1.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=Sr.inflateSetDictionary(this.strm,e.dictionary),r!==lo)))throw new Error(Vn[r])}bo.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?Z2:K2,Y1.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=Sr.inflate(r,o),a===hl&&i&&(a=Sr.inflateSetDictionary(r,i),a===lo?a=Sr.inflate(r,o):a===Fh&&(a=hl));r.avail_in>0&&a===dl&&r.state.wrap>0&&t[r.next_in]!==0;)Sr.inflateReset(r),a=Sr.inflate(r,o);switch(a){case J2:case Fh:case hl:case Y2:return this.onEnd(a),this.ended=!0,!1}if(s=r.avail_out,r.next_out&&(r.avail_out===0||a===dl))if(this.options.to==="string"){let u=uo.utf8border(r.output,r.next_out),c=r.next_out-u,l=uo.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===lo&&s===0)){if(a===dl)return a=Sr.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};bo.prototype.onData=function(t){this.chunks.push(t)};bo.prototype.onEnd=function(t){t===lo&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=hc.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function ep(t,e){let r=new bo(e);if(r.push(t),r.err)throw r.msg||Vn[r.err];return r.result}function X2(t,e){return e=e||{},e.raw=!0,ep(t,e)}var e3=bo,t3=ep,r3=X2,n3=ep,i3=Yn,a3={Inflate:e3,inflate:t3,inflateRaw:r3,ungzip:n3,constants:i3},{Deflate:o3,deflate:s3,deflateRaw:c3,gzip:u3}=d2,{Inflate:l3,inflate:p3,inflateRaw:f3,ungzip:d3}=a3,h3=o3,m3=s3,g3=c3,y3=u3,v3=l3,b3=p3,_3=f3,w3=d3,S3=Yn,C3={Deflate:h3,deflate:m3,deflateRaw:g3,gzip:y3,Inflate:v3,inflate:b3,inflateRaw:_3,ungzip:w3,constants:S3},Se=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},Ce=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},nc=class{constructor(e,r){this.input=e,this.output=r}};Se([m(),Ce("design:type",String)],nc.prototype,"input",void 0);Se([m(),Ce("design:type",String)],nc.prototype,"output",void 0);nc=Se([Ze(),Ce("design:paramtypes",[String,String])],nc);var ic=class{constructor(e,r){this.input=e,this.output=r}};Se([m(),Ce("design:type",String)],ic.prototype,"input",void 0);Se([m(),Ce("design:type",String)],ic.prototype,"output",void 0);ic=Se([z(),Ce("design:paramtypes",[String,String])],ic);var nn=class{constructor(e,r,n,i,a){this.name=e,this.modelId=r,this.systemPrompt=n,this.promptExamples=i,this.metaData=a}};Se([m(),Ce("design:type",String)],nn.prototype,"name",void 0);Se([m(),Ce("design:type",String)],nn.prototype,"modelId",void 0);Se([m(),Ce("design:type",String)],nn.prototype,"systemPrompt",void 0);Se([m(),Ce("design:type",Array)],nn.prototype,"promptExamples",void 0);Se([m(),Ce("design:type",String)],nn.prototype,"metaData",void 0);nn=Se([Ze(),Ce("design:paramtypes",[String,String,String,Array,String])],nn);var lr=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}};Se([m(),Ce("design:type",String)],lr.prototype,"name",void 0);Se([m(),Ce("design:type",String)],lr.prototype,"modelId",void 0);Se([m(),Ce("design:type",String)],lr.prototype,"taskId",void 0);Se([m(),Ce("design:type",String)],lr.prototype,"systemPrompt",void 0);Se([m(),Ce("design:type",Array)],lr.prototype,"promptExamples",void 0);Se([m(),Ce("design:type",String)],lr.prototype,"metaData",void 0);Se([m(),Ce("design:type",String)],lr.prototype,"createdAt",void 0);Se([m(),Ce("design:type",String)],lr.prototype,"updatedAt",void 0);lr=Se([z(),Ce("design:paramtypes",[String,String,String,String,Array,String,String,String])],lr);var Hn=class{constructor(e,r,n,i,a){this.model=e,this.status=r,this.progress=n,this.downloaded=i,this.loaded=a}};Se([m(),Ce("design:type",String)],Hn.prototype,"model",void 0);Se([m(),Ce("design:type",String)],Hn.prototype,"status",void 0);Se([m(),Ce("design:type",Number)],Hn.prototype,"progress",void 0);Se([m(),Ce("design:type",Boolean)],Hn.prototype,"downloaded",void 0);Se([m(),Ce("design:type",Boolean)],Hn.prototype,"loaded",void 0);Hn=Se([z(),Ce("design:paramtypes",[String,String,Number,Boolean,Boolean])],Hn);var x3=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},ze=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)},Ve,Fs,Ul=class{constructor(e,r=!0){Ve.set(this,void 0),Fs.set(this,new Map),x3(this,Ve,e,"f")}async getModels(){let e=await ze(this,Ve,"f").query({query:E`
695
714
  query {
696
715
  aiGetModels {
697
716
  id
@@ -715,23 +734,23 @@ triggerMatch
715
734
  modelType
716
735
  }
717
736
  }
718
- `});return I(e).aiGetModels}async addModel(e){let r=await Qe(this,Be,"f").mutate({mutation:E`
737
+ `});return A(e).aiGetModels}async addModel(e){let r=await ze(this,Ve,"f").mutate({mutation:E`
719
738
  mutation($model: ModelInput!) {
720
739
  aiAddModel(model: $model)
721
740
  }
722
- `,variables:{model:e}});return I(r).aiAddModel}async updateModel(e,r){let n=await Qe(this,Be,"f").mutate({mutation:E`
741
+ `,variables:{model:e}});return A(r).aiAddModel}async updateModel(e,r){let n=await ze(this,Ve,"f").mutate({mutation:E`
723
742
  mutation($modelId: String!, $model: ModelInput!) {
724
743
  aiUpdateModel(modelId: $modelId, model: $model)
725
744
  }
726
- `,variables:{modelId:e,model:r}});return I(n).aiUpdateModel}async removeModel(e){let r=await Qe(this,Be,"f").mutate({mutation:E`
745
+ `,variables:{modelId:e,model:r}});return A(n).aiUpdateModel}async removeModel(e){let r=await ze(this,Ve,"f").mutate({mutation:E`
727
746
  mutation($modelId: String!) {
728
747
  aiRemoveModel(modelId: $modelId)
729
748
  }
730
- `,variables:{modelId:e}});return I(r).aiRemoveModel}async setDefaultModel(e,r){let n=await Qe(this,Be,"f").mutate({mutation:E`
749
+ `,variables:{modelId:e}});return A(r).aiRemoveModel}async setDefaultModel(e,r){let n=await ze(this,Ve,"f").mutate({mutation:E`
731
750
  mutation($modelType: ModelType!, $modelId: String!) {
732
751
  aiSetDefaultModel(modelType: $modelType modelId: $modelId)
733
752
  }
734
- `,variables:{modelId:r,modelType:e}});return I(n).aiSetDefaultModel}async getDefaultModel(e){let r=await Qe(this,Be,"f").query({query:E`
753
+ `,variables:{modelId:r,modelType:e}});return A(n).aiSetDefaultModel}async getDefaultModel(e){let r=await ze(this,Ve,"f").query({query:E`
735
754
  query($modelType: ModelType!) {
736
755
  aiGetDefaultModel(modelType: $modelType) {
737
756
  id
@@ -755,7 +774,7 @@ triggerMatch
755
774
  modelType
756
775
  }
757
776
  }
758
- `,variables:{modelType:e}});return I(r).aiGetDefaultModel}async tasks(){let{aiTasks:e}=I(await Qe(this,Be,"f").query({query:E`
777
+ `,variables:{modelType:e}});return A(r).aiGetDefaultModel}async tasks(){let{aiTasks:e}=A(await ze(this,Ve,"f").query({query:E`
759
778
  query {
760
779
  aiTasks {
761
780
  name
@@ -771,7 +790,7 @@ triggerMatch
771
790
  updatedAt
772
791
  }
773
792
  }
774
- `}));return e}async addTask(e,r,n,i,a){let o=new nn(e,r,n,i,a),{aiAddTask:s}=I(await Qe(this,Be,"f").mutate({mutation:E`
793
+ `}));return e}async addTask(e,r,n,i,a){let o=new nn(e,r,n,i,a),{aiAddTask:s}=A(await ze(this,Ve,"f").mutate({mutation:E`
775
794
  mutation AiAddTask($task: AITaskInput!) {
776
795
  aiAddTask(task: $task) {
777
796
  name
@@ -787,7 +806,7 @@ triggerMatch
787
806
  updatedAt
788
807
  }
789
808
  }
790
- `,variables:{task:o}}));return s}async removeTask(e){let{aiRemoveTask:r}=I(await Qe(this,Be,"f").mutate({mutation:E`
809
+ `,variables:{task:o}}));return s}async removeTask(e){let{aiRemoveTask:r}=A(await ze(this,Ve,"f").mutate({mutation:E`
791
810
  mutation AiRemoveTask($taskId: String!) {
792
811
  aiRemoveTask(taskId: $taskId) {
793
812
  name
@@ -803,7 +822,7 @@ triggerMatch
803
822
  updatedAt
804
823
  }
805
824
  }
806
- `,variables:{taskId:e}}));return r}async updateTask(e,r){let{aiUpdateTask:n}=I(await Qe(this,Be,"f").mutate({mutation:E`
825
+ `,variables:{taskId:e}}));return r}async updateTask(e,r){let{aiUpdateTask:n}=A(await ze(this,Ve,"f").mutate({mutation:E`
807
826
  mutation AiUpdateTask($taskId: String!, $task: AITaskInput!) {
808
827
  aiUpdateTask(taskId: $taskId, task: $task) {
809
828
  name
@@ -819,7 +838,7 @@ triggerMatch
819
838
  updatedAt
820
839
  }
821
840
  }
822
- `,variables:{taskId:e,task:{name:r.name,modelId:r.modelId,systemPrompt:r.systemPrompt,promptExamples:r.promptExamples}}}));return n}async modelLoadingStatus(e){let{aiModelLoadingStatus:r}=I(await Qe(this,Be,"f").query({query:E`
841
+ `,variables:{taskId:e,task:{name:r.name,modelId:r.modelId,systemPrompt:r.systemPrompt,promptExamples:r.promptExamples}}}));return n}async modelLoadingStatus(e){let{aiModelLoadingStatus:r}=A(await ze(this,Ve,"f").query({query:E`
823
842
  query AiModelLoadingStatus($model: String!) {
824
843
  aiModelLoadingStatus(model: $model) {
825
844
  model
@@ -829,40 +848,40 @@ triggerMatch
829
848
  downloaded
830
849
  }
831
850
  }
832
- `,variables:{model:e}}));return r}async prompt(e,r){let{aiPrompt:n}=I(await Qe(this,Be,"f").mutate({mutation:E`
851
+ `,variables:{model:e}}));return r}async prompt(e,r){let{aiPrompt:n}=A(await ze(this,Ve,"f").mutate({mutation:E`
833
852
  mutation AiPrompt($taskId: String!, $prompt: String!) {
834
853
  aiPrompt(taskId: $taskId, prompt: $prompt)
835
854
  }
836
- `,variables:{taskId:e,prompt:r}}));return n}async embed(e,r){let{aiEmbed:n}=I(await Qe(this,Be,"f").mutate({mutation:E`
855
+ `,variables:{taskId:e,prompt:r}}));return n}async embed(e,r){let{aiEmbed:n}=A(await ze(this,Ve,"f").mutate({mutation:E`
837
856
  mutation aiEmbed($modelId: String!, $text: String!) {
838
857
  aiEmbed(modelId: $modelId, text: $text)
839
858
  }
840
- `,variables:{modelId:e,text:r}})),i=cc.toByteArray(n);return JSON.parse(v3.inflate(i,{to:"string"}))}async openTranscriptionStream(e,r,n){let{aiOpenTranscriptionStream:i}=I(await Qe(this,Be,"f").mutate({mutation:E`
859
+ `,variables:{modelId:e,text:r}})),i=fc.toByteArray(n);return JSON.parse(C3.inflate(i,{to:"string"}))}async openTranscriptionStream(e,r,n){let{aiOpenTranscriptionStream:i}=A(await ze(this,Ve,"f").mutate({mutation:E`
841
860
  mutation AiOpenTranscriptionStream($modelId: String!, $params: VoiceActivityParamsInput) {
842
861
  aiOpenTranscriptionStream(modelId: $modelId, params: $params)
843
862
  }
844
- `,variables:{modelId:e,params:n}})),a=Qe(this,Be,"f").subscribe({query:E` subscription {
863
+ `,variables:{modelId:e,params:n}})),a=ze(this,Ve,"f").subscribe({query:E` subscription {
845
864
  aiTranscriptionText(streamId: "${i}")
846
- }`}).subscribe({next(o){return r(o.data.aiTranscriptionText),o.data.aiTranscriptionText},error(o){console.error(o)}});return Qe(this,Ds,"f").set(i,a),i}async closeTranscriptionStream(e){let{aiCloseTranscriptionStream:r}=I(await Qe(this,Be,"f").mutate({mutation:E`
865
+ }`}).subscribe({next(o){return r(o.data.aiTranscriptionText),o.data.aiTranscriptionText},error(o){console.error(o)}});return ze(this,Fs,"f").set(i,a),i}async closeTranscriptionStream(e){let{aiCloseTranscriptionStream:r}=A(await ze(this,Ve,"f").mutate({mutation:E`
847
866
  mutation aiCloseTranscriptionStream($streamId: String!) {
848
867
  aiCloseTranscriptionStream(streamId: $streamId)
849
868
  }
850
- `,variables:{streamId:e}})),n=Qe(this,Ds,"f").get(e);return n.closed||n.unsubscribe(),r}async feedTranscriptionStream(e,r){let{aiFeedTranscriptionStream:n}=I(await Qe(this,Be,"f").mutate({mutation:E`
869
+ `,variables:{streamId:e}})),n=ze(this,Fs,"f").get(e);return n.closed||n.unsubscribe(),r}async feedTranscriptionStream(e,r){let{aiFeedTranscriptionStream:n}=A(await ze(this,Ve,"f").mutate({mutation:E`
851
870
  mutation AiFeedTranscriptionStream($streamIds: [String!]!, $audio: [Float!]!) {
852
871
  aiFeedTranscriptionStream(streamIds: $streamIds, audio: $audio)
853
872
  }
854
- `,variables:{streamIds:Array.isArray(e)?e:[e],audio:r}}));return n}};Be=new WeakMap,Ds=new WeakMap;var Vr=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},je=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)},tr,Ns,Ba,Ps,qa,Dn,Rs,Va,ec=class{constructor(e,r=!0){tr.set(this,void 0),Ns.set(this,void 0),Ba.set(this,void 0),Ps.set(this,void 0),qa.set(this,void 0),Dn.set(this,void 0),Rs.set(this,void 0),Va.set(this,void 0),Vr(this,tr,e,"f"),Vr(this,Ns,new Ja(je(this,tr,"f"),r),"f"),Vr(this,Ba,new El(je(this,tr,"f")),"f"),Vr(this,Ps,new Sl(je(this,tr,"f")),"f"),Vr(this,qa,new Cl(je(this,tr,"f")),"f"),Vr(this,Va,new $l(je(this,tr,"f"),r),"f"),Vr(this,Dn,new Ws(je(this,tr,"f"),r),"f"),je(this,Dn,"f").setExpressionClient(je(this,Ba,"f")),je(this,Dn,"f").setNeighbourhoodClient(je(this,qa,"f")),je(this,Dn,"f").setAIClient(je(this,Va,"f")),Vr(this,Rs,new xl(je(this,tr,"f"),r),"f")}get agent(){return je(this,Ns,"f")}get expression(){return je(this,Ba,"f")}get languages(){return je(this,Ps,"f")}get neighbourhood(){return je(this,qa,"f")}get perspective(){return je(this,Dn,"f")}get runtime(){return je(this,Rs,"f")}get ai(){return je(this,Va,"f")}};tr=new WeakMap,Ns=new WeakMap,Ba=new WeakMap,Ps=new WeakMap,qa=new WeakMap,Dn=new WeakMap,Rs=new WeakMap,Va=new WeakMap;var Ll;(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"})(Ll||(Ll={}));var Yl=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},Xl=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Fn=class{constructor(e,r){this.language=e,this.expression=r}};Yl([m(),Xl("design:type",ar)],Fn.prototype,"language",void 0);Yl([m(),Xl("design:type",String)],Fn.prototype,"expression",void 0);Fn=Yl([W(),Xl("design:paramtypes",[ar,String])],Fn);function Mw(t){return t.language.address==="did"?t.expression.toString():`${t.language.address}://${t.expression}`}function Uw(t){if(t.startsWith("literal://")){let a=new ar;a.address="literal",a.name="literal";let o=t.substring(10);return new Fn(a,o)}let r=/^([^:^\s]+):\/\/([\s\S]+)$/.exec(t);if(r&&r.length==3){let a=r[1],o=r[2],s=new ar;return s.address=a,new Fn(s,o)}let i=/^did:([^\s]+)$/.exec(t);if(i&&i.length==2){let a=new ar;return a.address="did",new Fn(a,t)}throw new Error("Couldn't parse string as expression URL or DID: "+t)}var Dt=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},lr=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},tc=class{};Dt([m(),lr("design:type",String)],tc.prototype,"name",void 0);Dt([m(),lr("design:type",String)],tc.prototype,"type",void 0);tc=Dt([W()],tc);var oo=class{};Dt([m(),lr("design:type",String)],oo.prototype,"label",void 0);Dt([m(),lr("design:type",String)],oo.prototype,"name",void 0);Dt([m(),lr("design:type",Array)],oo.prototype,"parameters",void 0);oo=Dt([W()],oo);var rc=class{get parameters(){return JSON.parse(this.parametersStringified)}constructor(e,r){this.name=e,this.parametersStringified=JSON.stringify(r)}};Dt([m(),lr("design:type",String)],rc.prototype,"name",void 0);Dt([m(),lr("design:type",String)],rc.prototype,"parametersStringified",void 0);rc=Dt([Ke(),lr("design:paramtypes",[String,Object])],rc);var nc=class{};Dt([m(),lr("design:type",String)],nc.prototype,"did",void 0);Dt([m(),lr("design:type",qn)],nc.prototype,"status",void 0);nc=Dt([W()],nc);var Rh=class{},ei=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},zi=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},an=class{};ei([m(),zi("design:type",String)],an.prototype,"name",void 0);ei([m(),zi("design:type",String)],an.prototype,"address",void 0);ei([m(),zi("design:type",String)],an.prototype,"settings",void 0);ei([m(),zi("design:type",Un)],an.prototype,"icon",void 0);ei([m(),zi("design:type",Un)],an.prototype,"constructorIcon",void 0);ei([m(),zi("design:type",Un)],an.prototype,"settingsIcon",void 0);an=ei([W()],an);var dt=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},wt=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Gt=class{};dt([m(),wt("design:type",String)],Gt.prototype,"name",void 0);dt([m(),wt("design:type",String)],Gt.prototype,"address",void 0);dt([m(),wt("design:type",String)],Gt.prototype,"description",void 0);dt([m(),wt("design:type",String)],Gt.prototype,"author",void 0);dt([m(),wt("design:type",Boolean)],Gt.prototype,"templated",void 0);dt([m(),wt("design:type",String)],Gt.prototype,"templateSourceLanguageAddress",void 0);dt([m(),wt("design:type",String)],Gt.prototype,"templateAppliedParams",void 0);dt([m(),wt("design:type",Array)],Gt.prototype,"possibleTemplateParams",void 0);dt([m(),wt("design:type",String)],Gt.prototype,"sourceCodeLink",void 0);Gt=dt([W()],Gt);var Fi=class{constructor(e,r){this.name=e,this.description=r,this.description||(this.description="")}};dt([m(),wt("design:type",String)],Fi.prototype,"name",void 0);dt([m(),wt("design:type",String)],Fi.prototype,"description",void 0);dt([m(),wt("design:type",Array)],Fi.prototype,"possibleTemplateParams",void 0);dt([m(),wt("design:type",String)],Fi.prototype,"sourceCodeLink",void 0);Fi=dt([Ke(),wt("design:paramtypes",[String,String])],Fi);var $h=class{},Lh=class extends sn(){},Fh=class{},fc=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},ep=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ic=class{constructor(e,r){this.linkLanguage=e,this.meta=r}};fc([m(),ep("design:type",String)],ic.prototype,"linkLanguage",void 0);fc([m(),ep("design:type",cr)],ic.prototype,"meta",void 0);ic=fc([W(),ep("design:paramtypes",[String,cr])],ic);var Fl=class extends sn(){};Fl=fc([W()],Fl);var Gi=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},Hi=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Ml;(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"})(Ml||(Ml={}));var Hn=class{constructor(e,r,n){this.uuid=e,this.name=r,n?this.state=n:this.state=Ml.Private}};Gi([m(),Hi("design:type",String)],Hn.prototype,"uuid",void 0);Gi([m(),Hi("design:type",String)],Hn.prototype,"name",void 0);Gi([m(),Hi("design:type",String)],Hn.prototype,"state",void 0);Gi([m(),Hi("design:type",String)],Hn.prototype,"sharedUrl",void 0);Gi([m(),Hi("design:type",Fl)],Hn.prototype,"neighbourhood",void 0);Hn=Gi([W(),Hi("design:paramtypes",[String,String,String])],Hn);var dc=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},W1=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ac=class{};dc([m(),W1("design:type",Array)],ac.prototype,"additions",void 0);dc([m(),W1("design:type",Array)],ac.prototype,"removals",void 0);ac=dc([W()],ac);var Mh=class extends sn(){};Mh=dc([W()],Mh);var Uh=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},ki=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)},Qa,Nn,bs="smart_literal://content";function _3(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 so=class{constructor(e,r){Qa.set(this,void 0),Nn.set(this,void 0),Uh(this,Qa,e,"f"),Uh(this,Nn,r,"f")}get base(){return ki(this,Nn,"f")}static async create(e,r){let n=At.from(_3(10)).toUrl(),i=new so(e,n);return await i.set(r),i}static async isSmartLiteralBase(e,r){return(await e.get(new at({source:r,predicate:bs}))).length>0}static async getAllSmartLiterals(e){return(await e.get(new at({predicate:bs}))).map(n=>new so(e,n.data.source))}async get(){let e=await ki(this,Qa,"f").getSingleTarget(new at({source:ki(this,Nn,"f"),predicate:bs}));if(!e)throw`No content for smart literal ${ki(this,Nn,"f")}`;return At.fromUrl(e).get()}async set(e){let r=At.from(e);await ki(this,Qa,"f").setSingleTarget(new Bn({source:ki(this,Nn,"f"),predicate:bs,target:r.toUrl()}))}};Qa=new WeakMap,Nn=new WeakMap;var jh=class{};function Yw(t,e,r){return{action:"addLink",source:t,predicate:e,target:r}}function Xw(t){return`triple(this, "${t}", _)`}function eS(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,f=new Hs(a,d,s);await f.init(),o.push(f)}return o}}}function K1(t){return function(e,r){if(typeof t.writable>"u"&&t.through&&(t.writable=!0),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${Kr(n)}`]=()=>{}}Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function tS(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 rS(t){return function(e,r){e.__collections=e.__collections||{},e.__collections[r]=t;let n=r;e[`add${Kr(n)}`]=()=>{},e[`remove${Kr(n)}`]=()=>{},e[`setCollection${Kr(n)}`]=()=>{},Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function Z1(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 w3(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=Z1(8);r+=`subject_class("${n}", ${a}).
873
+ `,variables:{streamIds:Array.isArray(e)?e:[e],audio:r}}));return n}};Ve=new WeakMap,Fs=new WeakMap;var Vr=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},qe=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)},rr,Ms,Qa,Us,za,Dn,js,Ha,po=class{constructor(e,r=!0){rr.set(this,void 0),Ms.set(this,void 0),Qa.set(this,void 0),Us.set(this,void 0),za.set(this,void 0),Dn.set(this,void 0),js.set(this,void 0),Ha.set(this,void 0),Vr(this,rr,e,"f"),Vr(this,Ms,new ro(qe(this,rr,"f"),r),"f"),Vr(this,Qa,new Tl(qe(this,rr,"f")),"f"),Vr(this,Us,new kl(qe(this,rr,"f")),"f"),Vr(this,za,new Al(qe(this,rr,"f")),"f"),Vr(this,Ha,new Ul(qe(this,rr,"f"),r),"f"),Vr(this,Dn,new Xs(qe(this,rr,"f"),r),"f"),qe(this,Dn,"f").setExpressionClient(qe(this,Qa,"f")),qe(this,Dn,"f").setNeighbourhoodClient(qe(this,za,"f")),qe(this,Dn,"f").setAIClient(qe(this,Ha,"f")),Vr(this,js,new Il(qe(this,rr,"f"),r),"f")}get agent(){return qe(this,Ms,"f")}get expression(){return qe(this,Qa,"f")}get languages(){return qe(this,Us,"f")}get neighbourhood(){return qe(this,za,"f")}get perspective(){return qe(this,Dn,"f")}get runtime(){return qe(this,js,"f")}get ai(){return qe(this,Ha,"f")}};rr=new WeakMap,Ms=new WeakMap,Qa=new WeakMap,Us=new WeakMap,za=new WeakMap,Dn=new WeakMap,js=new WeakMap,Ha=new WeakMap;var jl;(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"})(jl||(jl={}));var tp=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},rp=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Fn=class{constructor(e,r){this.language=e,this.expression=r}};tp([m(),rp("design:type",or)],Fn.prototype,"language",void 0);tp([m(),rp("design:type",String)],Fn.prototype,"expression",void 0);Fn=tp([z(),rp("design:paramtypes",[or,String])],Fn);function zw(t){return t.language.address==="did"?t.expression.toString():`${t.language.address}://${t.expression}`}function Hw(t){if(t.startsWith("literal://")){let a=new or;a.address="literal",a.name="literal";let o=t.substring(10);return new Fn(a,o)}let r=/^([^:^\s]+):\/\/([\s\S]+)$/.exec(t);if(r&&r.length==3){let a=r[1],o=r[2],s=new or;return s.address=a,new Fn(s,o)}let i=/^did:([^\s]+)$/.exec(t);if(i&&i.length==2){let a=new or;return a.address="did",new Fn(a,t)}throw new Error("Couldn't parse string as expression URL or DID: "+t)}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},pr=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ac=class{};Nt([m(),pr("design:type",String)],ac.prototype,"name",void 0);Nt([m(),pr("design:type",String)],ac.prototype,"type",void 0);ac=Nt([z()],ac);var fo=class{};Nt([m(),pr("design:type",String)],fo.prototype,"label",void 0);Nt([m(),pr("design:type",String)],fo.prototype,"name",void 0);Nt([m(),pr("design:type",Array)],fo.prototype,"parameters",void 0);fo=Nt([z()],fo);var oc=class{get parameters(){return JSON.parse(this.parametersStringified)}constructor(e,r){this.name=e,this.parametersStringified=JSON.stringify(r)}};Nt([m(),pr("design:type",String)],oc.prototype,"name",void 0);Nt([m(),pr("design:type",String)],oc.prototype,"parametersStringified",void 0);oc=Nt([Ze(),pr("design:paramtypes",[String,Object])],oc);var sc=class{};Nt([m(),pr("design:type",String)],sc.prototype,"did",void 0);Nt([m(),pr("design:type",qn)],sc.prototype,"status",void 0);sc=Nt([z()],sc);var Mh=class{},ei=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},Gi=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},an=class{};ei([m(),Gi("design:type",String)],an.prototype,"name",void 0);ei([m(),Gi("design:type",String)],an.prototype,"address",void 0);ei([m(),Gi("design:type",String)],an.prototype,"settings",void 0);ei([m(),Gi("design:type",Un)],an.prototype,"icon",void 0);ei([m(),Gi("design:type",Un)],an.prototype,"constructorIcon",void 0);ei([m(),Gi("design:type",Un)],an.prototype,"settingsIcon",void 0);an=ei([z()],an);var ht=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},St=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Gt=class{};ht([m(),St("design:type",String)],Gt.prototype,"name",void 0);ht([m(),St("design:type",String)],Gt.prototype,"address",void 0);ht([m(),St("design:type",String)],Gt.prototype,"description",void 0);ht([m(),St("design:type",String)],Gt.prototype,"author",void 0);ht([m(),St("design:type",Boolean)],Gt.prototype,"templated",void 0);ht([m(),St("design:type",String)],Gt.prototype,"templateSourceLanguageAddress",void 0);ht([m(),St("design:type",String)],Gt.prototype,"templateAppliedParams",void 0);ht([m(),St("design:type",Array)],Gt.prototype,"possibleTemplateParams",void 0);ht([m(),St("design:type",String)],Gt.prototype,"sourceCodeLink",void 0);Gt=ht([z()],Gt);var Mi=class{constructor(e,r){this.name=e,this.description=r,this.description||(this.description="")}};ht([m(),St("design:type",String)],Mi.prototype,"name",void 0);ht([m(),St("design:type",String)],Mi.prototype,"description",void 0);ht([m(),St("design:type",Array)],Mi.prototype,"possibleTemplateParams",void 0);ht([m(),St("design:type",String)],Mi.prototype,"sourceCodeLink",void 0);Mi=ht([Ze(),St("design:paramtypes",[String,String])],Mi);var Uh=class{},jh=class extends sn(){},Bh=class{},gc=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},np=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},cc=class{constructor(e,r){this.linkLanguage=e,this.meta=r}};gc([m(),np("design:type",String)],cc.prototype,"linkLanguage",void 0);gc([m(),np("design:type",ur)],cc.prototype,"meta",void 0);cc=gc([z(),np("design:paramtypes",[String,ur])],cc);var Bl=class extends sn(){};Bl=gc([z()],Bl);var Wi=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},Ki=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ql;(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"})(ql||(ql={}));var Gn=class{constructor(e,r,n){this.uuid=e,this.name=r,n?this.state=n:this.state=ql.Private}};Wi([m(),Ki("design:type",String)],Gn.prototype,"uuid",void 0);Wi([m(),Ki("design:type",String)],Gn.prototype,"name",void 0);Wi([m(),Ki("design:type",String)],Gn.prototype,"state",void 0);Wi([m(),Ki("design:type",String)],Gn.prototype,"sharedUrl",void 0);Wi([m(),Ki("design:type",Bl)],Gn.prototype,"neighbourhood",void 0);Gn=Wi([z(),Ki("design:paramtypes",[String,String,String])],Gn);var yc=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},X1=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},uc=class{};yc([m(),X1("design:type",Array)],uc.prototype,"additions",void 0);yc([m(),X1("design:type",Array)],uc.prototype,"removals",void 0);uc=yc([z()],uc);var qh=class extends sn(){};qh=yc([z()],qh);var Vh=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},Ai=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,Nn,Es="smart_literal://content";function E3(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 ho=class{constructor(e,r){Ga.set(this,void 0),Nn.set(this,void 0),Vh(this,Ga,e,"f"),Vh(this,Nn,r,"f")}get base(){return Ai(this,Nn,"f")}static async create(e,r){let n=It.from(E3(10)).toUrl(),i=new ho(e,n);return await i.set(r),i}static async isSmartLiteralBase(e,r){return(await e.get(new ot({source:r,predicate:Es}))).length>0}static async getAllSmartLiterals(e){return(await e.get(new ot({predicate:Es}))).map(n=>new ho(e,n.data.source))}async get(){let e=await Ai(this,Ga,"f").getSingleTarget(new ot({source:Ai(this,Nn,"f"),predicate:Es}));if(!e)throw`No content for smart literal ${Ai(this,Nn,"f")}`;return It.fromUrl(e).get()}async set(e){let r=It.from(e);await Ai(this,Ga,"f").setSingleTarget(new Bn({source:Ai(this,Nn,"f"),predicate:Es,target:r.toUrl()}))}};Ga=new WeakMap,Nn=new WeakMap;var Qh=class{};function aS(t,e,r){return{action:"addLink",source:t,predicate:e,target:r}}function oS(t){return`triple(this, "${t}", _)`}function sS(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,f=new Ys(a,d,s);await f.init(),o.push(f)}return o}}}function em(t){return function(e,r){if(typeof t.writable>"u"&&t.through&&(t.writable=!0),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${Kr(n)}`]=()=>{}}Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function cS(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 uS(t){return function(e,r){e.__collections=e.__collections||{},e.__collections[r]=t;let n=r;e[`add${Kr(n)}`]=()=>{},e[`remove${Kr(n)}`]=()=>{},e[`setCollection${Kr(n)}`]=()=>{},Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function tm(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 lS(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=tm(8);r+=`subject_class("${n}", ${a}).
855
874
  `;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}").
856
- `,{through:v,initial:C,required:_,resolveLanguage:b,writable:y,flag:T,getter:R,setter:k,local:P}=l[h];if(b&&(g+=`property_resolve(${a}, "${h}").
857
- `,g+=`property_resolve_language(${a}, "${h}", "${b}").
875
+ `,{through:b,initial:C,required:w,resolveLanguage:_,writable:y,flag:T,getter:R,setter:k,local:P}=l[h];if(_&&(g+=`property_resolve(${a}, "${h}").
876
+ `,g+=`property_resolve_language(${a}, "${h}", "${_}").
858
877
  `),R?g+=`property_getter(${a}, Base, "${h}", Value) :- ${R}.
859
- `:v&&(g+=`property_getter(${a}, Base, "${h}", Value) :- triple(Base, "${v}", Value).
860
- `,_&&(T?u.push(`triple(Base, "${v}", "${C}")`):u.push(`triple(Base, "${v}", _)`))),k)g+=`property_setter(${a}, "${h}", Actions) :- ${k}.
861
- `;else if(y&&v&&typeof i[Vl(h)]=="function"){let $=[{action:"setSingleTarget",source:"this",predicate:v,target:"value",...P&&{local:!0}}];g+=`property_setter(${a}, "${h}", '${kn($)}').
862
- `}c.push(g),C&&(s.push({action:"addLink",source:"this",predicate:v,target:C}),o.push({action:"removeLink",source:"this",predicate:v,target:"*"}))}let d=[],f=i.__collections||{};for(let h in f){let g=`collection(${a}, "${h}").
863
- `,{through:v,where:C,local:_}=f[h];if(v){if(C){if(!C.isInstance&&!C.condition)throw"'where' needs one of 'isInstance' or 'condition'";let R=[];if(C.isInstance){let P;C.isInstance.name?P=C.isInstance.name:P=C.isInstance,R.push(`instance(OtherClass, Target), subject_class("${P}", OtherClass)`)}C.condition&&R.push(C.condition);let k=R.join(", ");g+=`collection_getter(${a}, Base, "${h}", List) :- setof(Target, (triple(Base, "${v}", Target), ${k}), List).
864
- `}else g+=`collection_getter(${a}, Base, "${h}", List) :- findall(C, triple(Base, "${v}", C), List).
865
- `;let b=[{action:"addLink",source:"this",predicate:v,target:"value",..._&&{local:!0}}],y=[{action:"removeLink",source:"this",predicate:v,target:"value"}],T=[{action:"collectionSetter",source:"this",predicate:v,target:"value",..._&&{local:!0}}];g+=`collection_adder(${a}, "${Cr(h)}", '${kn(b)}').
878
+ `:b&&(g+=`property_getter(${a}, Base, "${h}", Value) :- triple(Base, "${b}", Value).
879
+ `,w&&(T?u.push(`triple(Base, "${b}", "${C}")`):u.push(`triple(Base, "${b}", _)`))),k)g+=`property_setter(${a}, "${h}", Actions) :- ${k}.
880
+ `;else if(y&&b&&typeof i[d1(h)]=="function"){let $=[{action:"setSingleTarget",source:"this",predicate:b,target:"value",...P&&{local:!0}}];g+=`property_setter(${a}, "${h}", '${kn($)}').
881
+ `}c.push(g),C&&(s.push({action:"addLink",source:"this",predicate:b,target:C}),o.push({action:"removeLink",source:"this",predicate:b,target:"*"}))}let d=[],f=i.__collections||{};for(let h in f){let g=`collection(${a}, "${h}").
882
+ `,{through:b,where:C,local:w}=f[h];if(b){if(C){if(!C.isInstance&&!C.condition)throw"'where' needs one of 'isInstance' or 'condition'";let R=[];if(C.isInstance){let P;C.isInstance.name?P=C.isInstance.name:P=C.isInstance,R.push(`instance(OtherClass, Target), subject_class("${P}", OtherClass)`)}C.condition&&R.push(C.condition);let k=R.join(", ");g+=`collection_getter(${a}, Base, "${h}", List) :- setof(Target, (triple(Base, "${b}", Target), ${k}), List).
883
+ `}else g+=`collection_getter(${a}, Base, "${h}", List) :- findall(C, triple(Base, "${b}", C), List).
884
+ `;let _=[{action:"addLink",source:"this",predicate:b,target:"value",...w&&{local:!0}}],y=[{action:"removeLink",source:"this",predicate:b,target:"value"}],T=[{action:"collectionSetter",source:"this",predicate:b,target:"value",...w&&{local:!0}}];g+=`collection_adder(${a}, "${Cr(h)}", '${kn(_)}').
866
885
  `,g+=`collection_remover(${a}, "${Cr(h)}", '${kn(y)}').
867
886
  `,g+=`collection_setter(${a}, "${Cr(h)}", '${kn(T)}').
868
887
  `}d.push(g)}let p=kn(s);if(r+=`constructor(${a}, '${p}').
@@ -873,7 +892,7 @@ triggerMatch
873
892
  `,r+=c.join(`
874
893
  `),r+=`
875
894
  `,r+=d.join(`
876
- `),{sdna:r,name:n}},Object.defineProperty(e,"type",{configurable:!0})}}function nS(t){return K1({...t,required:!0,writable:!0,initial:t.initial||"literal://string:uninitialized"})}function iS(t){return K1({...t,writable:!1})}var aS=`
895
+ `),{sdna:r,name:n}},Object.defineProperty(e,"type",{configurable:!0})}}function pS(t){return em({...t,required:!0,writable:!0,initial:t.initial||"literal://string:uninitialized"})}function fS(t){return em({...t,writable:!1})}var dS=`
877
896
  type AIModelLoadingStatus {
878
897
  downloaded: Boolean!
879
898
  loaded: Boolean!
@@ -1242,6 +1261,7 @@ type Mutation {
1242
1261
  runtimeRemoveNotification(id: String!): Boolean!
1243
1262
  runtimeRequestInstallNotification(notification: NotificationInput!): String!
1244
1263
  runtimeRestartHolochain: Boolean!
1264
+ runtimeSetMultiUserEnabled(enabled: Boolean!): Boolean!
1245
1265
  runtimeSetStatus(status: PerspectiveInput!): Boolean!
1246
1266
  runtimeUpdateNotification(id: String!, notification: NotificationInput!): Boolean!
1247
1267
  }
@@ -1348,8 +1368,10 @@ type Query {
1348
1368
  runtimeHcAgentInfos: String!
1349
1369
  runtimeInfo: RuntimeInfo!
1350
1370
  runtimeKnownLinkLanguageTemplates: [String!]!
1371
+ runtimeListUsers: [UserStatistics!]!
1351
1372
  runtimeMessageInbox(filter: String): [PerspectiveExpression!]!
1352
1373
  runtimeMessageOutbox(filter: String): [SentMessage!]!
1374
+ runtimeMultiUserEnabled: Boolean!
1353
1375
  runtimeNotifications: [Notification!]!
1354
1376
  runtimeVerifyStringSignedByDid(data: String!, did: String!, didSigningKeyId: String!, signedData: String!): Boolean!
1355
1377
  }
@@ -1417,6 +1439,13 @@ type TriggeredNotification {
1417
1439
  triggerMatch: String!
1418
1440
  }
1419
1441
 
1442
+ type UserStatistics {
1443
+ did: String!
1444
+ email: String!
1445
+ lastSeen: String
1446
+ perspectiveCount: Int!
1447
+ }
1448
+
1420
1449
  input VoiceActivityParamsInput {
1421
1450
  endThreshold: Float
1422
1451
  endWindow: Float
@@ -1424,7 +1453,7 @@ input VoiceActivityParamsInput {
1424
1453
  startWindow: Float
1425
1454
  timeBeforeSpeech: Float
1426
1455
  }
1427
- `;function Bh(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 J1(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`${Bh(e)} your ${r} actions, with access to ${Bh(n)}`}var N=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},S=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ve=function(t,e){return function(r,n){e(r,n,t)}},ho=new Xr;ho.author="did:ad4m:test";ho.timestamp=Date.now();ho.data={source:"root",target:"neighbourhood://Qm12345"};ho.proof={signature:"",key:"",valid:!0};var Hr=new qn;Hr.author="did:ad4m:test";Hr.timestamp=Date.now().toString();Hr.proof=new xr("","");Hr.data=new cr([ho]);var oc=class{};N([m(),S("design:type",String)],oc.prototype,"recipient",void 0);N([m(),S("design:type",qn)],oc.prototype,"message",void 0);oc=N([W()],oc);var Mi=class{};N([m(),S("design:type",String)],Mi.prototype,"ad4mExecutorVersion",void 0);N([m(),S("design:type",Boolean)],Mi.prototype,"isInitialized",void 0);N([m(),S("design:type",Boolean)],Mi.prototype,"isUnlocked",void 0);Mi=N([W()],Mi);var Wn=class{};N([m(),S("design:type",String)],Wn.prototype,"title",void 0);N([m(),S("design:type",String)],Wn.prototype,"message",void 0);N([m(),S("design:type",String)],Wn.prototype,"type",void 0);N([m(),S("design:type",String)],Wn.prototype,"addon",void 0);Wn=N([W()],Wn);var Ut=class{};N([m(),S("design:type",String)],Ut.prototype,"description",void 0);N([m(),S("design:type",String)],Ut.prototype,"appName",void 0);N([m(),S("design:type",String)],Ut.prototype,"appUrl",void 0);N([m(),S("design:type",String)],Ut.prototype,"appIconPath",void 0);N([m(),S("design:type",String)],Ut.prototype,"trigger",void 0);N([m(),S("design:type",Array)],Ut.prototype,"perspectiveIds",void 0);N([m(),S("design:type",String)],Ut.prototype,"webhookUrl",void 0);N([m(),S("design:type",String)],Ut.prototype,"webhookAuth",void 0);Ut=N([Ke()],Ut);var Tt=class{};N([m(),S("design:type",String)],Tt.prototype,"id",void 0);N([m(),S("design:type",Boolean)],Tt.prototype,"granted",void 0);N([m(),S("design:type",String)],Tt.prototype,"description",void 0);N([m(),S("design:type",String)],Tt.prototype,"appName",void 0);N([m(),S("design:type",String)],Tt.prototype,"appUrl",void 0);N([m(),S("design:type",String)],Tt.prototype,"appIconPath",void 0);N([m(),S("design:type",String)],Tt.prototype,"trigger",void 0);N([m(),S("design:type",Array)],Tt.prototype,"perspectiveIds",void 0);N([m(),S("design:type",String)],Tt.prototype,"webhookUrl",void 0);N([m(),S("design:type",String)],Tt.prototype,"webhookAuth",void 0);Tt=N([W()],Tt);var Ui=class{};N([m(),S("design:type",Tt)],Ui.prototype,"notification",void 0);N([m(),S("design:type",String)],Ui.prototype,"perspectiveId",void 0);N([m(),S("design:type",String)],Ui.prototype,"triggerMatch",void 0);Ui=N([W()],Ui);var We=class{};N([m(),S("design:type",Number)],We.prototype,"total",void 0);N([m(),S("design:type",Number)],We.prototype,"imported",void 0);N([m(),S("design:type",Number)],We.prototype,"failed",void 0);N([m(),S("design:type",Number)],We.prototype,"omitted",void 0);N([m(),S("design:type",Array)],We.prototype,"errors",void 0);We=N([W()],We);var Ot=class{};N([m(),S("design:type",We)],Ot.prototype,"perspectives",void 0);N([m(),S("design:type",We)],Ot.prototype,"links",void 0);N([m(),S("design:type",We)],Ot.prototype,"expressions",void 0);N([m(),S("design:type",We)],Ot.prototype,"perspectiveDiffs",void 0);N([m(),S("design:type",We)],Ot.prototype,"notifications",void 0);N([m(),S("design:type",We)],Ot.prototype,"models",void 0);N([m(),S("design:type",We)],Ot.prototype,"defaultModels",void 0);N([m(),S("design:type",We)],Ot.prototype,"tasks",void 0);N([m(),S("design:type",We)],Ot.prototype,"friends",void 0);N([m(),S("design:type",We)],Ot.prototype,"trustedAgents",void 0);N([m(),S("design:type",We)],Ot.prototype,"knownLinkLanguages",void 0);Ot=N([W()],Ot);var re=class{runtimeQuit(){return!0}runtimeOpenLink(e){return!0}runtimeInfo(){return{ad4mExecutorVersion:"x.x.x",isInitialized:!0,isUnlocked:!0}}addTrustedAgents(e){return e}deleteTrustedAgents(e){return[]}getTrustedAgents(){return["agentPubKey"]}runtimeKnownLinkLanguageTemplates(){return["Qm12345abcdef"]}runtimeAddKnownLinkLanguageTemplates(e){return e}runtimeRemoveKnownLinkLanguageTemplates(e){return[]}runtimeFriends(){return["did:test:friend"]}runtimeAddFriends(e){return e}runtimeRemoveFriends(e){return[]}runtimeHcAgentInfos(){return JSON.stringify([{agent:{type:"Buffer",data:[9,191,231,58,255,107,202,55,206,57,9,103,17,34,206,195,207,114,5,73,77,198,56,136,17,227,242,231,194,135,128,48,170,189,119,186]},signature:{type:"Buffer",data:[195,143,170,36,234,123,255,85,188,138,124,2,91,18,53,231,44,41,240,8,80,131,100,150,165,125,146,90,17,200,190,129,114,211,11,146,150,128,198,199,79,118,157,101,194,68,58,245,98,182,79,139,140,41,143,129,8,136,87,77,180,231,218,11]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,9,191,231,58,255,107,202,55,206,57,9,103,17,34,206,195,207,114,5,73,77,198,56,136,17,227,242,231,194,135,128,48,170,189,119,186,164,117,114,108,115,145,217,99,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,101,83,52,86,112,54,109,118,80,48,122,116,85,101,104,114,117,113,89,52,102,66,53,101,69,98,121,48,69,66,100,89,84,50,95,67,48,69,112,77,111,76,111,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,57,50,46,49,54,56,46,49,55,56,46,54,48,47,112,47,55,55,52,52,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,104,189,50,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}},{agent:{type:"Buffer",data:[98,187,145,48,115,209,94,143,31,153,102,69,138,29,133,213,34,52,39,164,157,139,178,111,23,33,118,250,28,155,78,246,128,49,179,38]},signature:{type:"Buffer",data:[233,192,38,3,59,248,124,231,57,255,40,154,50,60,119,252,68,198,154,109,175,155,106,217,211,155,109,223,249,91,221,210,17,132,72,230,11,230,247,119,72,244,145,91,75,7,67,5,130,151,44,231,52,220,28,154,212,82,58,90,203,211,236,4]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,98,187,145,48,115,209,94,143,31,153,102,69,138,29,133,213,34,52,39,164,157,139,178,111,23,33,118,250,28,155,78,246,128,49,179,38,164,117,114,108,115,145,217,99,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,55,101,77,106,48,73,83,72,56,56,81,56,45,89,51,74,89,70,53,76,72,57,83,54,68,119,71,73,49,88,45,115,87,53,68,104,66,87,121,71,119,78,115,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,57,50,46,49,54,56,46,49,55,56,46,54,48,47,112,47,55,55,52,52,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,103,45,197,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}},{agent:{type:"Buffer",data:[181,101,115,45,214,127,198,153,159,184,30,87,67,224,208,184,203,176,130,158,236,127,153,125,243,183,188,167,154,25,118,254,101,145,210,109]},signature:{type:"Buffer",data:[88,189,229,122,44,171,194,156,90,79,148,49,207,224,34,199,219,88,24,243,103,127,123,41,87,171,127,92,6,216,198,171,26,226,237,217,122,78,98,146,55,255,68,240,202,83,58,140,147,185,3,66,15,216,210,22,99,197,73,234,120,17,74,1]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,181,101,115,45,214,127,198,153,159,184,30,87,67,224,208,184,203,176,130,158,236,127,153,125,243,183,188,167,154,25,118,254,101,145,210,109,164,117,114,108,115,145,217,99,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,114,70,71,83,100,113,104,101,68,107,70,70,56,69,102,109,45,69,116,55,119,81,101,120,83,88,55,65,112,69,51,89,86,99,45,120,102,52,104,106,77,115,77,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,57,50,46,49,54,56,46,49,55,56,46,54,48,47,112,47,55,55,52,52,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,113,23,220,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}},{agent:{type:"Buffer",data:[3,171,237,107,186,245,165,47,237,235,211,49,245,62,113,53,255,252,223,226,75,118,148,187,23,53,70,174,160,184,64,63,94,210,227,56]},signature:{type:"Buffer",data:[129,12,55,104,239,121,138,2,86,106,136,51,219,79,170,8,195,69,81,188,225,192,247,196,54,39,164,110,75,39,240,56,245,189,154,77,72,11,97,250,202,149,242,97,128,28,47,164,236,104,136,82,212,246,44,143,132,119,255,135,112,11,20,13]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,3,171,237,107,186,245,165,47,237,235,211,49,245,62,113,53,255,252,223,226,75,118,148,187,23,53,70,174,160,184,64,63,94,210,227,56,164,117,114,108,115,145,217,97,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,104,121,112,115,86,121,103,117,80,84,115,53,118,73,80,65,102,97,112,90,88,113,117,84,115,79,80,100,67,81,79,79,117,103,57,51,82,103,106,95,114,85,73,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,54,53,46,50,50,46,51,50,46,49,49,47,112,47,53,55,55,57,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,113,188,123,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}}])}runtimeGetNetworkMetrics(){return JSON.stringify({metrics:{},stats:{}})}runtimeRestartHolochain(){return!0}runtimeHcAddAgentInfos(e){return!0}runtimeVerifyStringSignedByDid(e,r,n,i){return!0}runtimeSetStatus(e){return!0}runtimeFriendStatus(e){return Hr}runtimeFriendSendMessage(e,r){return!0}runtimeMessageInbox(e){return[Hr]}runtimeMessageOutbox(e){return[{recipient:"did:test:recipient",message:Hr}]}runtimeMessageReceived(){return Hr}exceptionOccurred(){return{title:"Test title",message:"Test message",type:Ll.LanguageIsNotLoaded}}runtimeRequestInstallNotification(e){return"new-notification-id"}runtimeNotifications(){return[{id:"test-id",granted:!1,description:"Test description",appName:"Test app name",appUrl:"https://example.com",appIconPath:"https://fluxsocial.io/favicon",trigger:"triple(X, ad4m://has_type, flux://message)",perspectiveIds:["u983ud-jdhh38d"],webhookUrl:"https://example.com/webhook",webhookAuth:"test-auth"}]}runtimeUpdateNotification(e,r){return!0}runtimeRemoveNotification(e){return!0}runtimeGrantNotification(e){return!0}runtimeNotificationTriggered(){return{perspectiveId:"test-perspective-id",triggerMatch:"test-trigger-match",notification:{id:"test-id",granted:!1,description:"Test description",appName:"Test app name",appUrl:"https://example.com",appIconPath:"https://fluxsocial.io/favicon",trigger:"triple(X, ad4m://has_type, flux://message)",perspectiveIds:["u983ud-jdhh38d"],webhookUrl:"https://example.com/webhook",webhookAuth:"test-auth"}}}runtimeExportDb(e){return!0}runtimeImportDb(e){return!0}runtimeExportPerspective(e,r){return!0}runtimeImportPerspective(e){return!0}};N([Ve(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Boolean)],re.prototype,"runtimeQuit",null);N([Ve(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",Boolean)],re.prototype,"runtimeOpenLink",null);N([Ht(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Mi)],re.prototype,"runtimeInfo",null);N([Ve(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[Array]),S("design:returntype",Array)],re.prototype,"addTrustedAgents",null);N([Ve(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[Array]),S("design:returntype",Array)],re.prototype,"deleteTrustedAgents",null);N([Ht(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Array)],re.prototype,"getTrustedAgents",null);N([Ht(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Array)],re.prototype,"runtimeKnownLinkLanguageTemplates",null);N([Ve(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[Array]),S("design:returntype",Array)],re.prototype,"runtimeAddKnownLinkLanguageTemplates",null);N([Ve(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[Array]),S("design:returntype",Array)],re.prototype,"runtimeRemoveKnownLinkLanguageTemplates",null);N([Ht(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Array)],re.prototype,"runtimeFriends",null);N([Ve(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[Array]),S("design:returntype",Array)],re.prototype,"runtimeAddFriends",null);N([Ve(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[Array]),S("design:returntype",Array)],re.prototype,"runtimeRemoveFriends",null);N([Ht(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",String)],re.prototype,"runtimeHcAgentInfos",null);N([Ht(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",String)],re.prototype,"runtimeGetNetworkMetrics",null);N([Ve(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Boolean)],re.prototype,"runtimeRestartHolochain",null);N([Ve(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[Object]),S("design:returntype",Boolean)],re.prototype,"runtimeHcAddAgentInfos",null);N([Ht(),ve(0,ye()),ve(1,ye()),ve(2,ye()),ve(3,ye()),S("design:type",Function),S("design:paramtypes",[String,String,String,String]),S("design:returntype",void 0)],re.prototype,"runtimeVerifyStringSignedByDid",null);N([Ve(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[cr]),S("design:returntype",Boolean)],re.prototype,"runtimeSetStatus",null);N([Ht(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",qn)],re.prototype,"runtimeFriendStatus",null);N([Ve(),ve(0,ye()),ve(1,ye()),S("design:type",Function),S("design:paramtypes",[String,Vs]),S("design:returntype",Boolean)],re.prototype,"runtimeFriendSendMessage",null);N([Ht(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",Array)],re.prototype,"runtimeMessageInbox",null);N([Ht(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",Array)],re.prototype,"runtimeMessageOutbox",null);N([jl(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",qn)],re.prototype,"runtimeMessageReceived",null);N([jl(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Wn)],re.prototype,"exceptionOccurred",null);N([Ve(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[Ut]),S("design:returntype",String)],re.prototype,"runtimeRequestInstallNotification",null);N([Ht(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Array)],re.prototype,"runtimeNotifications",null);N([Ve(),ve(0,ye()),ve(1,ye()),S("design:type",Function),S("design:paramtypes",[String,Ut]),S("design:returntype",Boolean)],re.prototype,"runtimeUpdateNotification",null);N([Ve(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",Boolean)],re.prototype,"runtimeRemoveNotification",null);N([Ve(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",Boolean)],re.prototype,"runtimeGrantNotification",null);N([jl(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Ui)],re.prototype,"runtimeNotificationTriggered",null);N([Ve(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",Boolean)],re.prototype,"runtimeExportDb",null);N([Ve(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",Boolean)],re.prototype,"runtimeImportDb",null);N([Ve(),ve(0,ye()),ve(1,ye()),S("design:type",Function),S("design:paramtypes",[String,String]),S("design:returntype",Boolean)],re.prototype,"runtimeExportPerspective",null);N([Ve(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",Boolean)],re.prototype,"runtimeImportPerspective",null);re=N([e0()],re);var Sa=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},Z=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)},bt,rr,$s,Te;function Ls(t){return t.charAt(0).toUpperCase()+t.slice(1)}function qh(t){return t?`triple("${t}", "ad4m://has_child", Base)`:""}function pl(){return`
1456
+ `;function zh(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 rm(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`${zh(e)} your ${r} actions, with access to ${zh(n)}`}var D=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},v=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},be=function(t,e){return function(r,n){e(r,n,t)}},_o=new Xr;_o.author="did:ad4m:test";_o.timestamp=Date.now();_o.data={source:"root",target:"neighbourhood://Qm12345"};_o.proof={signature:"",key:"",valid:!0};var Gr=new qn;Gr.author="did:ad4m:test";Gr.timestamp=Date.now().toString();Gr.proof=new xr("","");Gr.data=new ur([_o]);var lc=class{};D([m(),v("design:type",String)],lc.prototype,"recipient",void 0);D([m(),v("design:type",qn)],lc.prototype,"message",void 0);lc=D([z()],lc);var Ui=class{};D([m(),v("design:type",String)],Ui.prototype,"ad4mExecutorVersion",void 0);D([m(),v("design:type",Boolean)],Ui.prototype,"isInitialized",void 0);D([m(),v("design:type",Boolean)],Ui.prototype,"isUnlocked",void 0);Ui=D([z()],Ui);var Wn=class{};D([m(),v("design:type",String)],Wn.prototype,"title",void 0);D([m(),v("design:type",String)],Wn.prototype,"message",void 0);D([m(),v("design:type",String)],Wn.prototype,"type",void 0);D([m(),v("design:type",String)],Wn.prototype,"addon",void 0);Wn=D([z()],Wn);var jt=class{};D([m(),v("design:type",String)],jt.prototype,"description",void 0);D([m(),v("design:type",String)],jt.prototype,"appName",void 0);D([m(),v("design:type",String)],jt.prototype,"appUrl",void 0);D([m(),v("design:type",String)],jt.prototype,"appIconPath",void 0);D([m(),v("design:type",String)],jt.prototype,"trigger",void 0);D([m(),v("design:type",Array)],jt.prototype,"perspectiveIds",void 0);D([m(),v("design:type",String)],jt.prototype,"webhookUrl",void 0);D([m(),v("design:type",String)],jt.prototype,"webhookAuth",void 0);jt=D([Ze()],jt);var Tt=class{};D([m(),v("design:type",String)],Tt.prototype,"id",void 0);D([m(),v("design:type",Boolean)],Tt.prototype,"granted",void 0);D([m(),v("design:type",String)],Tt.prototype,"description",void 0);D([m(),v("design:type",String)],Tt.prototype,"appName",void 0);D([m(),v("design:type",String)],Tt.prototype,"appUrl",void 0);D([m(),v("design:type",String)],Tt.prototype,"appIconPath",void 0);D([m(),v("design:type",String)],Tt.prototype,"trigger",void 0);D([m(),v("design:type",Array)],Tt.prototype,"perspectiveIds",void 0);D([m(),v("design:type",String)],Tt.prototype,"webhookUrl",void 0);D([m(),v("design:type",String)],Tt.prototype,"webhookAuth",void 0);Tt=D([z()],Tt);var ji=class{};D([m(),v("design:type",Tt)],ji.prototype,"notification",void 0);D([m(),v("design:type",String)],ji.prototype,"perspectiveId",void 0);D([m(),v("design:type",String)],ji.prototype,"triggerMatch",void 0);ji=D([z()],ji);var Ke=class{};D([m(),v("design:type",Number)],Ke.prototype,"total",void 0);D([m(),v("design:type",Number)],Ke.prototype,"imported",void 0);D([m(),v("design:type",Number)],Ke.prototype,"failed",void 0);D([m(),v("design:type",Number)],Ke.prototype,"omitted",void 0);D([m(),v("design:type",Array)],Ke.prototype,"errors",void 0);Ke=D([z()],Ke);var Ot=class{};D([m(),v("design:type",Ke)],Ot.prototype,"perspectives",void 0);D([m(),v("design:type",Ke)],Ot.prototype,"links",void 0);D([m(),v("design:type",Ke)],Ot.prototype,"expressions",void 0);D([m(),v("design:type",Ke)],Ot.prototype,"perspectiveDiffs",void 0);D([m(),v("design:type",Ke)],Ot.prototype,"notifications",void 0);D([m(),v("design:type",Ke)],Ot.prototype,"models",void 0);D([m(),v("design:type",Ke)],Ot.prototype,"defaultModels",void 0);D([m(),v("design:type",Ke)],Ot.prototype,"tasks",void 0);D([m(),v("design:type",Ke)],Ot.prototype,"friends",void 0);D([m(),v("design:type",Ke)],Ot.prototype,"trustedAgents",void 0);D([m(),v("design:type",Ke)],Ot.prototype,"knownLinkLanguages",void 0);Ot=D([z()],Ot);var Bi=class{};D([m(),v("design:type",String)],Bi.prototype,"email",void 0);D([m(),v("design:type",String)],Bi.prototype,"did",void 0);D([m(),v("design:type",String)],Bi.prototype,"lastSeen",void 0);D([m(),v("design:type",Number)],Bi.prototype,"perspectiveCount",void 0);Bi=D([z()],Bi);var Y=class{runtimeQuit(){return!0}runtimeOpenLink(e){return!0}runtimeInfo(){return{ad4mExecutorVersion:"x.x.x",isInitialized:!0,isUnlocked:!0}}addTrustedAgents(e){return e}deleteTrustedAgents(e){return[]}getTrustedAgents(){return["agentPubKey"]}runtimeKnownLinkLanguageTemplates(){return["Qm12345abcdef"]}runtimeAddKnownLinkLanguageTemplates(e){return e}runtimeRemoveKnownLinkLanguageTemplates(e){return[]}runtimeFriends(){return["did:test:friend"]}runtimeAddFriends(e){return e}runtimeRemoveFriends(e){return[]}runtimeHcAgentInfos(){return JSON.stringify([{agent:{type:"Buffer",data:[9,191,231,58,255,107,202,55,206,57,9,103,17,34,206,195,207,114,5,73,77,198,56,136,17,227,242,231,194,135,128,48,170,189,119,186]},signature:{type:"Buffer",data:[195,143,170,36,234,123,255,85,188,138,124,2,91,18,53,231,44,41,240,8,80,131,100,150,165,125,146,90,17,200,190,129,114,211,11,146,150,128,198,199,79,118,157,101,194,68,58,245,98,182,79,139,140,41,143,129,8,136,87,77,180,231,218,11]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,9,191,231,58,255,107,202,55,206,57,9,103,17,34,206,195,207,114,5,73,77,198,56,136,17,227,242,231,194,135,128,48,170,189,119,186,164,117,114,108,115,145,217,99,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,101,83,52,86,112,54,109,118,80,48,122,116,85,101,104,114,117,113,89,52,102,66,53,101,69,98,121,48,69,66,100,89,84,50,95,67,48,69,112,77,111,76,111,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,57,50,46,49,54,56,46,49,55,56,46,54,48,47,112,47,55,55,52,52,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,104,189,50,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}},{agent:{type:"Buffer",data:[98,187,145,48,115,209,94,143,31,153,102,69,138,29,133,213,34,52,39,164,157,139,178,111,23,33,118,250,28,155,78,246,128,49,179,38]},signature:{type:"Buffer",data:[233,192,38,3,59,248,124,231,57,255,40,154,50,60,119,252,68,198,154,109,175,155,106,217,211,155,109,223,249,91,221,210,17,132,72,230,11,230,247,119,72,244,145,91,75,7,67,5,130,151,44,231,52,220,28,154,212,82,58,90,203,211,236,4]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,98,187,145,48,115,209,94,143,31,153,102,69,138,29,133,213,34,52,39,164,157,139,178,111,23,33,118,250,28,155,78,246,128,49,179,38,164,117,114,108,115,145,217,99,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,55,101,77,106,48,73,83,72,56,56,81,56,45,89,51,74,89,70,53,76,72,57,83,54,68,119,71,73,49,88,45,115,87,53,68,104,66,87,121,71,119,78,115,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,57,50,46,49,54,56,46,49,55,56,46,54,48,47,112,47,55,55,52,52,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,103,45,197,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}},{agent:{type:"Buffer",data:[181,101,115,45,214,127,198,153,159,184,30,87,67,224,208,184,203,176,130,158,236,127,153,125,243,183,188,167,154,25,118,254,101,145,210,109]},signature:{type:"Buffer",data:[88,189,229,122,44,171,194,156,90,79,148,49,207,224,34,199,219,88,24,243,103,127,123,41,87,171,127,92,6,216,198,171,26,226,237,217,122,78,98,146,55,255,68,240,202,83,58,140,147,185,3,66,15,216,210,22,99,197,73,234,120,17,74,1]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,181,101,115,45,214,127,198,153,159,184,30,87,67,224,208,184,203,176,130,158,236,127,153,125,243,183,188,167,154,25,118,254,101,145,210,109,164,117,114,108,115,145,217,99,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,114,70,71,83,100,113,104,101,68,107,70,70,56,69,102,109,45,69,116,55,119,81,101,120,83,88,55,65,112,69,51,89,86,99,45,120,102,52,104,106,77,115,77,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,57,50,46,49,54,56,46,49,55,56,46,54,48,47,112,47,55,55,52,52,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,113,23,220,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}},{agent:{type:"Buffer",data:[3,171,237,107,186,245,165,47,237,235,211,49,245,62,113,53,255,252,223,226,75,118,148,187,23,53,70,174,160,184,64,63,94,210,227,56]},signature:{type:"Buffer",data:[129,12,55,104,239,121,138,2,86,106,136,51,219,79,170,8,195,69,81,188,225,192,247,196,54,39,164,110,75,39,240,56,245,189,154,77,72,11,97,250,202,149,242,97,128,28,47,164,236,104,136,82,212,246,44,143,132,119,255,135,112,11,20,13]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,3,171,237,107,186,245,165,47,237,235,211,49,245,62,113,53,255,252,223,226,75,118,148,187,23,53,70,174,160,184,64,63,94,210,227,56,164,117,114,108,115,145,217,97,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,104,121,112,115,86,121,103,117,80,84,115,53,118,73,80,65,102,97,112,90,88,113,117,84,115,79,80,100,67,81,79,79,117,103,57,51,82,103,106,95,114,85,73,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,54,53,46,50,50,46,51,50,46,49,49,47,112,47,53,55,55,57,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,113,188,123,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}}])}runtimeGetNetworkMetrics(){return JSON.stringify({metrics:{},stats:{}})}runtimeRestartHolochain(){return!0}runtimeHcAddAgentInfos(e){return!0}runtimeVerifyStringSignedByDid(e,r,n,i){return!0}runtimeSetStatus(e){return!0}runtimeFriendStatus(e){return Gr}runtimeFriendSendMessage(e,r){return!0}runtimeMessageInbox(e){return[Gr]}runtimeMessageOutbox(e){return[{recipient:"did:test:recipient",message:Gr}]}runtimeMessageReceived(){return Gr}exceptionOccurred(){return{title:"Test title",message:"Test message",type:jl.LanguageIsNotLoaded}}runtimeRequestInstallNotification(e){return"new-notification-id"}runtimeNotifications(){return[{id:"test-id",granted:!1,description:"Test description",appName:"Test app name",appUrl:"https://example.com",appIconPath:"https://fluxsocial.io/favicon",trigger:"triple(X, ad4m://has_type, flux://message)",perspectiveIds:["u983ud-jdhh38d"],webhookUrl:"https://example.com/webhook",webhookAuth:"test-auth"}]}runtimeUpdateNotification(e,r){return!0}runtimeRemoveNotification(e){return!0}runtimeGrantNotification(e){return!0}runtimeNotificationTriggered(){return{perspectiveId:"test-perspective-id",triggerMatch:"test-trigger-match",notification:{id:"test-id",granted:!1,description:"Test description",appName:"Test app name",appUrl:"https://example.com",appIconPath:"https://fluxsocial.io/favicon",trigger:"triple(X, ad4m://has_type, flux://message)",perspectiveIds:["u983ud-jdhh38d"],webhookUrl:"https://example.com/webhook",webhookAuth:"test-auth"}}}runtimeExportDb(e){return!0}runtimeImportDb(e){return!0}runtimeExportPerspective(e,r){return!0}runtimeImportPerspective(e){return!0}runtimeMultiUserEnabled(){return!1}runtimeSetMultiUserEnabled(e){return e}runtimeListUsers(){return[{email:"test@example.com",did:"did:key:test123",lastSeen:new Date().toISOString(),perspectiveCount:5}]}};D([Me(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",Boolean)],Y.prototype,"runtimeQuit",null);D([Me(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[String]),v("design:returntype",Boolean)],Y.prototype,"runtimeOpenLink",null);D([Dt(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",Ui)],Y.prototype,"runtimeInfo",null);D([Me(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[Array]),v("design:returntype",Array)],Y.prototype,"addTrustedAgents",null);D([Me(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[Array]),v("design:returntype",Array)],Y.prototype,"deleteTrustedAgents",null);D([Dt(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",Array)],Y.prototype,"getTrustedAgents",null);D([Dt(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",Array)],Y.prototype,"runtimeKnownLinkLanguageTemplates",null);D([Me(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[Array]),v("design:returntype",Array)],Y.prototype,"runtimeAddKnownLinkLanguageTemplates",null);D([Me(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[Array]),v("design:returntype",Array)],Y.prototype,"runtimeRemoveKnownLinkLanguageTemplates",null);D([Dt(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",Array)],Y.prototype,"runtimeFriends",null);D([Me(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[Array]),v("design:returntype",Array)],Y.prototype,"runtimeAddFriends",null);D([Me(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[Array]),v("design:returntype",Array)],Y.prototype,"runtimeRemoveFriends",null);D([Dt(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",String)],Y.prototype,"runtimeHcAgentInfos",null);D([Dt(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",String)],Y.prototype,"runtimeGetNetworkMetrics",null);D([Me(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",Boolean)],Y.prototype,"runtimeRestartHolochain",null);D([Me(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[Object]),v("design:returntype",Boolean)],Y.prototype,"runtimeHcAddAgentInfos",null);D([Dt(),be(0,ve()),be(1,ve()),be(2,ve()),be(3,ve()),v("design:type",Function),v("design:paramtypes",[String,String,String,String]),v("design:returntype",void 0)],Y.prototype,"runtimeVerifyStringSignedByDid",null);D([Me(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[ur]),v("design:returntype",Boolean)],Y.prototype,"runtimeSetStatus",null);D([Dt(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[String]),v("design:returntype",qn)],Y.prototype,"runtimeFriendStatus",null);D([Me(),be(0,ve()),be(1,ve()),v("design:type",Function),v("design:paramtypes",[String,Ws]),v("design:returntype",Boolean)],Y.prototype,"runtimeFriendSendMessage",null);D([Dt(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[String]),v("design:returntype",Array)],Y.prototype,"runtimeMessageInbox",null);D([Dt(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[String]),v("design:returntype",Array)],Y.prototype,"runtimeMessageOutbox",null);D([Ql(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",qn)],Y.prototype,"runtimeMessageReceived",null);D([Ql(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",Wn)],Y.prototype,"exceptionOccurred",null);D([Me(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[jt]),v("design:returntype",String)],Y.prototype,"runtimeRequestInstallNotification",null);D([Dt(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",Array)],Y.prototype,"runtimeNotifications",null);D([Me(),be(0,ve()),be(1,ve()),v("design:type",Function),v("design:paramtypes",[String,jt]),v("design:returntype",Boolean)],Y.prototype,"runtimeUpdateNotification",null);D([Me(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[String]),v("design:returntype",Boolean)],Y.prototype,"runtimeRemoveNotification",null);D([Me(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[String]),v("design:returntype",Boolean)],Y.prototype,"runtimeGrantNotification",null);D([Ql(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",ji)],Y.prototype,"runtimeNotificationTriggered",null);D([Me(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[String]),v("design:returntype",Boolean)],Y.prototype,"runtimeExportDb",null);D([Me(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[String]),v("design:returntype",Boolean)],Y.prototype,"runtimeImportDb",null);D([Me(),be(0,ve()),be(1,ve()),v("design:type",Function),v("design:paramtypes",[String,String]),v("design:returntype",Boolean)],Y.prototype,"runtimeExportPerspective",null);D([Me(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[String]),v("design:returntype",Boolean)],Y.prototype,"runtimeImportPerspective",null);D([Dt(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",Boolean)],Y.prototype,"runtimeMultiUserEnabled",null);D([Me(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[Boolean]),v("design:returntype",Boolean)],Y.prototype,"runtimeSetMultiUserEnabled",null);D([Dt(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",Array)],Y.prototype,"runtimeListUsers",null);Y=D([a0()],Y);var Ea=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},te=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)},_t,nr,Bs,Oe;function k3(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Hh(t){return t?`triple("${t}", "ad4m://has_child", Base)`:""}function ml(){return`
1428
1457
  findall(
1429
1458
  [T, A],
1430
1459
  link(Base, _, _, T, A),
@@ -1432,13 +1461,13 @@ input VoiceActivityParamsInput {
1432
1461
  ),
1433
1462
  sort(AllLinks, SortedLinks),
1434
1463
  SortedLinks = [[Timestamp, Author]|_]
1435
- `}function Vh(t){return`
1464
+ `}function Gh(t){return`
1436
1465
  findall([PropertyName, PropertyValue, Resolve], (
1437
1466
  % Constrain to specified properties if provided
1438
1467
  ${t?`member(PropertyName, [${t.map(e=>`"${e}"`).join(", ")}]),`:""}
1439
1468
  resolve_property(SubjectClass, Base, PropertyName, PropertyValue, Resolve)
1440
1469
  ), Properties)
1441
- `}function Qh(t){return`
1470
+ `}function Wh(t){return`
1442
1471
  findall([CollectionName, CollectionValues], (
1443
1472
  % Constrain to specified collections if provided
1444
1473
  ${t?`member(CollectionName, [${t.map(e=>`"${e}"`).join(", ")}]),`:""}
@@ -1446,29 +1475,25 @@ input VoiceActivityParamsInput {
1446
1475
  collection(SubjectClass, CollectionName),
1447
1476
  collection_getter(SubjectClass, Base, CollectionName, CollectionValues)
1448
1477
  ), Collections)
1449
- `}function zh(t={}){function e(r){return typeof r=="string"?`"${r}"`:r}return Object.entries(t).map(([r,n])=>{let i=["base","author","timestamp"].includes(r),a=`resolve_property(SubjectClass, Base, "${r}", Value${r}, _)`,o=Ls(r);if(Array.isArray(n)){let s=n.map(u=>e(u)).join(", ");return i?`member(${o}, [${s}])`:`${a}, member(Value${r}, [${s}])`}if(typeof n=="object"&&n!==null){let{not:s,between:u,lt:c,lte:l,gt:d,gte:f}=n;if(s!==void 0)if(Array.isArray(s)){let h=s.map(g=>e(g)).join(", ");return i?`\\+ member(${o}, [${h}])`:`${a}, \\+ member(Value${r}, [${h}])`}else return i?`${o} \\= ${e(s)}`:`${a}, Value${r} \\= ${e(s)}`;if(u!==void 0&&Array.isArray(u)&&u.length===2)return i?`${o} >= ${u[0]}, ${o} =< ${u[1]}`:`${a}, Value${r} >= ${u[0]}, Value${r} =< ${u[1]}`;let p=[{value:c,symbol:"<"},{value:l,symbol:"=<"},{value:d,symbol:">"},{value:f,symbol:">="}];for(let{value:h,symbol:g}of p)if(h!==void 0)return i?`${o} ${g} ${h}`:`${a}, Value${r} ${g} ${h}`}return i?`${o} = ${e(n)}`:`${a}, Value${r} = ${e(n)}`}).join(", ")}function Gh(t){return t?"length(UnsortedInstances, TotalCount)":""}function Hh(t){if(!t)return"SortedInstances = UnsortedInstances";let[e,r]=Object.entries(t)[0];return`sort_instances(UnsortedInstances, "${e}", "${r}", SortedInstances)`}function Wh(t){return!t||t<0?"InstancesWithOffset = SortedInstances":`skipN(SortedInstances, ${t}, InstancesWithOffset)`}function Kh(t){return!t||t<0?"AllInstances = InstancesWithOffset":`takeN(InstancesWithOffset, ${t}, AllInstances)`}var _Ad4mModel=class{static async getClassName(t){if(this===_Ad4mModel)return await t.stringOrTemplateObjectToSubjectClassName(this);let r=this.classNamesByClass.get(this);r||(r={},this.classNamesByClass.set(this,r));let n=t.uuid;return r[n]||(r[n]=await t.stringOrTemplateObjectToSubjectClassName(this)),r[n]}constructor(t,e,r){bt.set(this,void 0),rr.set(this,void 0),$s.set(this,void 0),Te.set(this,void 0),Sa(this,bt,e||At.from(Z1(24)).toUrl(),"f"),Sa(this,Te,t,"f"),Sa(this,$s,r||"ad4m://self","f")}get baseExpression(){return Z(this,bt,"f")}get perspective(){return Z(this,Te,"f")}static async assignValuesToInstance(t,e,r){let n=Object.fromEntries(await Promise.all(r.map(async([i,a,o])=>{let s=a;if(!o&&typeof a=="string"){let c=Array.from(a,f=>f.codePointAt(0)),l=c.every(f=>f<=255),d=c.some(f=>f>=128);if(l&&d)try{let f=Uint8Array.from(c),p=new TextDecoder("utf-8",{fatal:!0}).decode(f);p!==a&&(s=p)}catch(f){console.warn(`UTF-8 byte reconstruction failed for property "${i}"`,{value:a,error:f})}}if(o){let c=await t.getExpression(a);if(c)try{s=JSON.parse(c.data)}catch{s=c.data}}let u=e.__properties?.[i]?.transform;return u&&typeof u=="function"&&(s=u(s)),[i,s]})));Object.assign(e,n)}async getData(){let t=[pl(),Vh(),Qh()],e=`
1450
- Base = "${Z(this,bt,"f")}",
1451
- subject_class("${Z(this,rr,"f")}", SubjectClass),
1478
+ `}function Kh(t={}){function e(r){return typeof r=="string"?`"${r}"`:r}return Object.entries(t).map(([r,n])=>{let i=["base","author","timestamp"].includes(r),a=`resolve_property(SubjectClass, Base, "${r}", Value${r}, _)`,o=k3(r);if(Array.isArray(n)){let s=n.map(u=>e(u)).join(", ");return i?`member(${o}, [${s}])`:`${a}, member(Value${r}, [${s}])`}if(typeof n=="object"&&n!==null){let{not:s,between:u,lt:c,lte:l,gt:d,gte:f}=n;if(s!==void 0)if(Array.isArray(s)){let h=s.map(g=>e(g)).join(", ");return i?`\\+ member(${o}, [${h}])`:`${a}, \\+ member(Value${r}, [${h}])`}else return i?`${o} \\= ${e(s)}`:`${a}, Value${r} \\= ${e(s)}`;if(u!==void 0&&Array.isArray(u)&&u.length===2)return i?`${o} >= ${u[0]}, ${o} =< ${u[1]}`:`${a}, Value${r} >= ${u[0]}, Value${r} =< ${u[1]}`;let p=[{value:c,symbol:"<"},{value:l,symbol:"=<"},{value:d,symbol:">"},{value:f,symbol:">="}];for(let{value:h,symbol:g}of p)if(h!==void 0)return i?`${o} ${g} ${h}`:`${a}, Value${r} ${g} ${h}`}return i?`${o} = ${e(n)}`:`${a}, Value${r} = ${e(n)}`}).join(", ")}function Zh(t){return t?"length(UnsortedInstances, TotalCount)":""}function Jh(t){if(!t)return"SortedInstances = UnsortedInstances";let[e,r]=Object.entries(t)[0];return`sort_instances(UnsortedInstances, "${e}", "${r}", SortedInstances)`}function Yh(t){return!t||t<0?"InstancesWithOffset = SortedInstances":`skipN(SortedInstances, ${t}, InstancesWithOffset)`}function Xh(t){return!t||t<0?"AllInstances = InstancesWithOffset":`takeN(InstancesWithOffset, ${t}, AllInstances)`}var _Ad4mModel=class{static async getClassName(t){if(this===_Ad4mModel)return await t.stringOrTemplateObjectToSubjectClassName(this);let r=this.classNamesByClass.get(this);r||(r={},this.classNamesByClass.set(this,r));let n=t.uuid;return r[n]||(r[n]=await t.stringOrTemplateObjectToSubjectClassName(this)),r[n]}constructor(t,e,r){_t.set(this,void 0),nr.set(this,void 0),Bs.set(this,void 0),Oe.set(this,void 0),Ea(this,_t,e||It.from(tm(24)).toUrl(),"f"),Ea(this,Oe,t,"f"),Ea(this,Bs,r||"ad4m://self","f")}get baseExpression(){return te(this,_t,"f")}get perspective(){return te(this,Oe,"f")}static async assignValuesToInstance(t,e,r){let n=Object.fromEntries(await Promise.all(r.map(async([i,a,o])=>{let s=a;if(!o&&typeof a=="string"){let c=Array.from(a,f=>f.codePointAt(0)),l=c.every(f=>f<=255),d=c.some(f=>f>=128);if(l&&d)try{let f=Uint8Array.from(c),p=new TextDecoder("utf-8",{fatal:!0}).decode(f);p!==a&&(s=p)}catch(f){console.warn(`UTF-8 byte reconstruction failed for property "${i}"`,{value:a,error:f})}}if(o){let c=await t.getExpression(a);if(c)try{s=JSON.parse(c.data)}catch{s=c.data}}let u=e.__properties?.[i]?.transform;return u&&typeof u=="function"&&(s=u(s)),[i,s]})));Object.assign(e,n)}async getData(){let t=[ml(),Gh(),Wh()],e=`
1479
+ Base = "${te(this,_t,"f")}",
1480
+ subject_class("${te(this,nr,"f")}", SubjectClass),
1452
1481
  ${t.join(", ")}
1453
- `,r=await Z(this,Te,"f").infer(e);if(r?.[0]){let{Properties:n,Collections:i,Timestamp:a,Author:o}=r?.[0],s=[...n,...i,["timestamp",a],["author",o]];await _Ad4mModel.assignValuesToInstance(Z(this,Te,"f"),this,s)}return this}static async queryToProlog(t,e,r){let{source:n,properties:i,collections:a,where:o,order:s,offset:u,limit:c,count:l}=e,d=r||await this.getClassName(t),f=[pl(),qh(n),Vh(i),Qh(a),zh(o)],p=[Gh(l),Hh(s),Wh(u),Kh(c)];return`
1482
+ `,r=await te(this,Oe,"f").infer(e);if(r?.[0]){let{Properties:n,Collections:i,Timestamp:a,Author:o}=r?.[0],s=[...n,...i,["timestamp",a],["author",o]];await _Ad4mModel.assignValuesToInstance(te(this,Oe,"f"),this,s)}return this}static async queryToProlog(t,e,r){let{source:n,properties:i,collections:a,where:o,order:s,offset:u,limit:c,count:l}=e,d=r||await this.getClassName(t),f=[ml(),Hh(n),Gh(i),Wh(a),Kh(o)],p=[Zh(l),Jh(s),Yh(u),Xh(c)];return`
1454
1483
  findall([Base, Properties, Collections, Timestamp, Author], (
1455
1484
  subject_class("${d}", SubjectClass),
1456
1485
  instance(SubjectClass, Base),
1457
1486
  ${f.filter(g=>g).join(", ")}
1458
1487
  ), UnsortedInstances),
1459
1488
  ${p.filter(g=>g).join(", ")}
1460
- `}static async instancesFromPrologResult(t,e,r){if(!r?.[0]?.AllInstances)return{results:[],totalCount:0};let n=[...e?.properties||[],...e?.collections||[]];return{results:(await Promise.all(r[0].AllInstances.map(async([a,o,s,u,c])=>{try{let l=new this(t,a);n.length&&Object.keys(l).forEach(f=>{n.includes(f)||delete l[f]});let d=[...o,...s,["timestamp",u],["author",c]];return await _Ad4mModel.assignValuesToInstance(t,l,d),l}catch(l){return console.error(`Failed to process instance ${a}:`,l),null}}))).filter(a=>a!==null),totalCount:r[0].TotalCount}}static async findAll(t,e={}){let r=await this.queryToProlog(t,e),n=await t.infer(r),{results:i}=await this.instancesFromPrologResult(t,e,n);return i}static async findAllAndCount(t,e={}){let r=await this.queryToProlog(t,e),n=await t.infer(r);return await this.instancesFromPrologResult(t,e,n)}static async paginate(t,e,r,n){let i={...n||{},limit:e,offset:e*(r-1),count:!0},a=await this.queryToProlog(t,i),o=await t.infer(a),{results:s,totalCount:u}=await this.instancesFromPrologResult(t,i,o);return{results:s,totalCount:u,pageSize:e,pageNumber:r}}static async countQueryToProlog(t,e={},r){let{source:n,where:i}=e,a=r||await this.getClassName(t),o=[pl(),qh(n),zh(i)],s=[Gh(!0),Hh(),Wh(),Kh()];return`
1489
+ `}static async instancesFromPrologResult(t,e,r){if(!r?.[0]?.AllInstances)return{results:[],totalCount:0};let n=[...e?.properties||[],...e?.collections||[]];return{results:(await Promise.all(r[0].AllInstances.map(async([a,o,s,u,c])=>{try{let l=new this(t,a);n.length&&Object.keys(l).forEach(f=>{n.includes(f)||delete l[f]});let d=[...o,...s,["timestamp",u],["author",c]];return await _Ad4mModel.assignValuesToInstance(t,l,d),l}catch(l){return console.error(`Failed to process instance ${a}:`,l),null}}))).filter(a=>a!==null),totalCount:r[0].TotalCount}}static async findAll(t,e={}){let r=await this.queryToProlog(t,e),n=await t.infer(r),{results:i}=await this.instancesFromPrologResult(t,e,n);return i}static async findAllAndCount(t,e={}){let r=await this.queryToProlog(t,e),n=await t.infer(r);return await this.instancesFromPrologResult(t,e,n)}static async paginate(t,e,r,n){let i={...n||{},limit:e,offset:e*(r-1),count:!0},a=await this.queryToProlog(t,i),o=await t.infer(a),{results:s,totalCount:u}=await this.instancesFromPrologResult(t,i,o);return{results:s,totalCount:u,pageSize:e,pageNumber:r}}static async countQueryToProlog(t,e={},r){let{source:n,where:i}=e,a=r||await this.getClassName(t),o=[ml(),Hh(n),Kh(i)],s=[Zh(!0),Jh(),Yh(),Xh()];return`
1461
1490
  findall([Base, Properties, Collections, Timestamp, Author], (
1462
1491
  subject_class("${a}", SubjectClass),
1463
1492
  instance(SubjectClass, Base),
1464
1493
  ${o.filter(c=>c).join(", ")}
1465
1494
  ), UnsortedInstances),
1466
1495
  ${s.filter(c=>c).join(", ")}
1467
- `}static async count(t,e={}){return(await t.infer(await this.countQueryToProlog(t,e)))?.[0]?.TotalCount||0}async setProperty(key,value,batchId){let setters=await Z(this,Te,"f").infer(`subject_class("${Z(this,rr,"f")}", C), property_setter(C, "${key}", Setter)`);if(setters&&setters.length>0){let actions=eval(setters[0].Setter),resolveLanguageResults=await Z(this,Te,"f").infer(`subject_class("${Z(this,rr,"f")}", C), property_resolve_language(C, "${key}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),resolveLanguage&&(value=await Z(this,Te,"f").createExpression(value,resolveLanguage)),await Z(this,Te,"f").executeAction(actions,Z(this,bt,"f"),[{name:"value",value}],batchId)}}async setCollectionSetter(key,value,batchId){let collectionSetters=await Z(this,Te,"f").infer(`subject_class("${Z(this,rr,"f")}", C), collection_setter(C, "${Cr(key)}", Setter)`);if(collectionSetters||(collectionSetters=[]),collectionSetters.length>0){let actions=eval(collectionSetters[0].Setter);value&&(Array.isArray(value)?await Z(this,Te,"f").executeAction(actions,Z(this,bt,"f"),value.map(t=>({name:"value",value:t})),batchId):await Z(this,Te,"f").executeAction(actions,Z(this,bt,"f"),[{name:"value",value}],batchId))}}async setCollectionAdder(key,value,batchId){let adders=await Z(this,Te,"f").infer(`subject_class("${Z(this,rr,"f")}", C), collection_adder(C, "${Cr(key)}", Adder)`);if(adders||(adders=[]),adders.length>0){let actions=eval(adders[0].Adder);value&&(Array.isArray(value)?await Promise.all(value.map(t=>Z(this,Te,"f").executeAction(actions,Z(this,bt,"f"),[{name:"value",value:t}],batchId))):await Z(this,Te,"f").executeAction(actions,Z(this,bt,"f"),[{name:"value",value}],batchId))}}async setCollectionRemover(key,value,batchId){let removers=await Z(this,Te,"f").infer(`subject_class("${Z(this,rr,"f")}", C), collection_remover(C, "${Cr(key)}", Remover)`);if(removers||(removers=[]),removers.length>0){let actions=eval(removers[0].Remover);value&&(Array.isArray(value)?await Promise.all(value.map(t=>Z(this,Te,"f").executeAction(actions,Z(this,bt,"f"),[{name:"value",value:t}],batchId))):await Z(this,Te,"f").executeAction(actions,Z(this,bt,"f"),[{name:"value",value}],batchId))}}async save(t){let e=!1;t||(t=await this.perspective.createBatch(),e=!0);let r={};for(let[n,i]of Object.entries(this))i!=null&&!(Array.isArray(i)&&i.length>0)&&!i?.action&&(r[n]=i);await this.perspective.createSubject(this,Z(this,bt,"f"),r,t),await Z(this,Te,"f").add(new Bn({source:Z(this,$s,"f"),predicate:"ad4m://has_child",target:this.baseExpression}),"shared",t),await this.innerUpdate(!1,t),e&&(await this.perspective.commitBatch(t),await this.getData())}cleanCopy(){let t={},e=Object.entries(this);for(let[r,n]of e)n!=null&&r!=="author"&&r!=="timestamp"&&(t[r]=n);return t}async innerUpdate(t=!0,e){Sa(this,rr,await Z(this,Te,"f").stringOrTemplateObjectToSubjectClassName(this.cleanCopy()),"f");let r=Object.entries(this);for(let[n,i]of r)if(i!=null)if(i?.action)switch(i.action){case"setter":await this.setCollectionSetter(n,i.value,e);break;case"adder":await this.setCollectionAdder(n,i.value,e);break;case"remover":await this.setCollectionRemover(n,i.value,e);break;default:await this.setCollectionSetter(n,i.value,e);break}else Array.isArray(i)&&i.length>0?await this.setCollectionSetter(n,i,e):i!=null&&i!==""&&t&&await this.setProperty(n,i,e)}async update(t){await this.innerUpdate(!0,t),await this.getData()}async get(){return Sa(this,rr,await Z(this,Te,"f").stringOrTemplateObjectToSubjectClassName(this.cleanCopy()),"f"),await this.getData()}async delete(t){await Z(this,Te,"f").removeSubject(this,Z(this,bt,"f"),t)}static query(t,e){return new Ul(t,this,e)}static fromJSONSchema(t,e){if(t?.properties&&Object.prototype.hasOwnProperty.call(t.properties,"author"))throw new Error('JSON Schema must not define a top-level "author" property because Ad4mModel already exposes it. Please rename the property (e.g., "writer").');let r=this.determineNamespace(t,e),n=class extends _Ad4mModel{};Object.defineProperty(n,"name",{value:e.name}),n.className=e.name,n.prototype.className=e.name;let i={},a={};if(t.properties)for(let[u,c]of Object.entries(t.properties)){let l=this.determinePredicate(t,u,c,r,e),d=t.required?.includes(u)||!1;if(c.type==="array"){a[u]={through:l,local:this.getPropertyOption(u,c,e,"local")},Object.defineProperty(n.prototype,u,{configurable:!0,writable:!0,value:[]});let p=`add${Ls(u)}`,h=`remove${Ls(u)}`,g=`setCollection${Ls(u)}`;n.prototype[p]=function(){},n.prototype[h]=function(){},n.prototype[g]=function(){}}else{let p=this.getPropertyOption(u,c,e,"resolveLanguage");!p&&e.resolveLanguage&&(p=e.resolveLanguage);let h=this.getPropertyOption(u,c,e,"local"),g=this.getPropertyOption(u,c,e,"writable",!0),v=this.getPropertyOption(u,c,e,"initial");if(c.type==="object"&&!p&&(p="literal",console.warn(`Property "${u}" is an object type. It will be stored as JSON. Consider flattening complex objects for better semantic querying.`)),p==null&&(c.type==="number"||c.type==="integer")&&(p="literal"),d&&!v&&(c.type==="object"?v="literal://json:{}":v="ad4m://undefined"),i[u]={through:l,required:d,writable:g,...p&&{resolveLanguage:p},...h!==void 0&&{local:h},...v&&{initial:v}},Object.defineProperty(n.prototype,u,{configurable:!0,writable:!0,value:this.getDefaultValueForType(c.type)}),g){let C=Vl(u);n.prototype[C]=function(){}}}}if(!Object.values(i).some(u=>u.initial)){let u="ad4m://type",c=`${r.replace("://","")}://instance`;i.__ad4m_type={through:u,required:!0,writable:!1,initial:c,flag:!0},Object.defineProperty(n.prototype,"__ad4m_type",{configurable:!0,writable:!1,value:c}),console.warn(`No properties with initial values found. Added automatic type flag: ${u} = ${c}`)}return n.prototype.__properties=i,n.prototype.__collections=a,w3({name:e.name})(n),n}static determineNamespace(t,e){if(e.namespace)return e.namespace;if(t["x-ad4m"]?.namespace)return t["x-ad4m"].namespace;if(t.title)return`${t.title.toLowerCase()}://`;if(t.$id)try{let n=new URL(t.$id).pathname.split("/").filter(i=>i);if(n.length>0)return`${n[n.length-1].replace(/\.schema\.json$/,"").replace(/\.json$/,"").toLowerCase()}://`}catch{}throw new Error(`Cannot infer namespace for JSON Schema. Please provide one of:
1468
- - options.namespace
1469
- - schema["x-ad4m"].namespace
1470
- - schema.title
1471
- - valid schema.$id`)}static determinePredicate(t,e,r,n,i){return i.propertyMapping?.[e]?i.propertyMapping[e]:r["x-ad4m"]?.through?r["x-ad4m"].through:i.predicateTemplate?i.predicateTemplate.replace("${namespace}",n.replace("://","")).replace("${title}",t.title||"").replace("${property}",e):i.predicateGenerator?i.predicateGenerator(t.title||"",e):`${n.endsWith("://")?n.slice(0,-3):n}://${e}`}static getPropertyOption(t,e,r,n,i){return r.propertyOptions?.[t]?.[n]!==void 0?r.propertyOptions[t][n]:e["x-ad4m"]?.[n]!==void 0?e["x-ad4m"][n]:r[n]!==void 0?r[n]:i}static getDefaultValueForType(t){switch(t){case"string":return"";case"number":return 0;case"integer":return 0;case"boolean":return!1;case"array":return[];case"object":return{};default:return""}}};bt=new WeakMap,rr=new WeakMap,$s=new WeakMap,Te=new WeakMap;_Ad4mModel.classNamesByClass=new WeakMap;var Ul=class{constructor(e,r,n){this.queryParams={},this.modelClassName=null,this.perspective=e,this.ctor=r,n&&(this.queryParams=n)}dispose(){this.currentSubscription&&(this.currentSubscription.dispose(),this.currentSubscription=void 0)}where(e){return this.queryParams.where=e,this}order(e){return this.queryParams.order=e,this}limit(e){return this.queryParams.limit=e,this}offset(e){return this.queryParams.offset=e,this}source(e){return this.queryParams.source=e,this}properties(e){return this.queryParams.properties=e,this}collections(e){return this.queryParams.collections=e,this}overrideModelClassName(e){return this.modelClassName=e,this}async get(){let e=await this.ctor.queryToProlog(this.perspective,this.queryParams),r=await this.perspective.infer(e),{results:n}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,r);return n}async subscribe(e){this.dispose();let r=await this.ctor.queryToProlog(this.perspective,this.queryParams,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(r);let n=async a=>{let{results:o}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,a);e(o)};this.currentSubscription.onResult(n);let{results:i}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,this.currentSubscription.result);return i}async count(){let e=await this.ctor.countQueryToProlog(this.perspective,this.queryParams,this.modelClassName);return(await this.perspective.infer(e))?.[0]?.TotalCount||0}async countSubscribe(e){this.dispose();let r=await this.ctor.countQueryToProlog(this.perspective,this.queryParams,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(r);let n=async i=>{let a=i?.[0]?.TotalCount||0;e(a)};return this.currentSubscription.onResult(n),this.currentSubscription.result?.[0]?.TotalCount||0}async paginate(e,r){let n={...this.queryParams||{},limit:e,offset:e*(r-1),count:!0},i=await this.ctor.queryToProlog(this.perspective,n,this.modelClassName),a=await this.perspective.infer(i),{results:o,totalCount:s}=await this.ctor.instancesFromPrologResult(this.perspective,n,a);return{results:o,totalCount:s,pageSize:e,pageNumber:r}}async paginateSubscribe(e,r,n){this.dispose();let i={...this.queryParams||{},limit:e,offset:e*(r-1),count:!0},a=await this.ctor.queryToProlog(this.perspective,i,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(a);let o=async c=>{let{results:l,totalCount:d}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,c);n({results:l,totalCount:d,pageSize:e,pageNumber:r})};this.currentSubscription.onResult(o);let{results:s,totalCount:u}=await this.ctor.instancesFromPrologResult(this.perspective,i,this.currentSubscription.result);return{results:s,totalCount:u,pageSize:e,pageNumber:r}}};var hc="0.10.1-dev-1";var kr=12e3;function C3(){let t=new AbortController;return setTimeout(()=>t.abort(),20),t}function mc(t,e=1e4){return ge(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 tp(t){return ge(this,null,function*(){try{let e=yield fetch(`http://localhost:${t}/graphql/`,{signal:C3().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 x3(){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 rp(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(t){return!1}return!0}function gc(t,e){rp()&&localStorage.setItem(`${hc}/${t}`,e)}function pr(t){return rp()?localStorage.getItem(`${hc}/${t}`):null}function np(t){rp()&&localStorage.removeItem(`${hc}/${t}`)}var E3=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 mo(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 E3(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 go=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=kr;this.capabilities=[];this.isHosting=!1;this.listeners={authstatechange:[],configstatechange:[],connectionstatechange:[]};mo(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 ge(this,null,function*(){try{if(e){yield mc(e),this.setUrl(e);let r=this.buildClient();return yield this.checkAuth(),r}else{this.notifyConnectionChange("checking_local");try{yield mc(`ws://localhost:${this.port}/graphql`,2e3);let r=this.buildClient();return yield this.checkAuth(),r}catch(r){let n=yield this.ensureConnection();return yield this.checkAuth(),n}}}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}loginToHosting(e,r){return ge(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,gc("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 ge(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 ge(this,null,function*(){try{if(e){let r=yield tp(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 ge(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 mc(this.url),this.buildClient()}catch(i){return this.notifyConnectionChange("not_connected"),this.connectToPort()}})}findPort(){return ge(this,null,function*(){let e=[...Array(10).keys()].map((i,a)=>tp(kr+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=Pd({url:this.url,connectionParams:()=>ge(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:e=>ge(this,null,function*(){if(!e.wasClean&&!this.requestedRestart)if(!this.token)this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1;else{let r=yield this.connect();r?this.ad4mClient=r:(this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1)}})}}),this.apolloClient=new Qu({link:new Rd(this.wsClient),cache:new ts({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"},mutate:{fetchPolicy:"no-cache"}}}),this.ad4mClient=new ec(this.apolloClient),this.ad4mClient}checkAuth(){return ge(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 ge(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 ge(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(kr),this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}};function ip({unlockAgent:t,reconnect:e}){return Q`
1496
+ `}static async count(t,e={}){return(await t.infer(await this.countQueryToProlog(t,e)))?.[0]?.TotalCount||0}async setProperty(key,value,batchId){let setters=await te(this,Oe,"f").infer(`subject_class("${te(this,nr,"f")}", C), property_setter(C, "${key}", Setter)`);if(setters&&setters.length>0){let actions=eval(setters[0].Setter),resolveLanguageResults=await te(this,Oe,"f").infer(`subject_class("${te(this,nr,"f")}", C), property_resolve_language(C, "${key}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),resolveLanguage&&(value=await te(this,Oe,"f").createExpression(value,resolveLanguage)),await te(this,Oe,"f").executeAction(actions,te(this,_t,"f"),[{name:"value",value}],batchId)}}async setCollectionSetter(key,value,batchId){let collectionSetters=await te(this,Oe,"f").infer(`subject_class("${te(this,nr,"f")}", C), collection_setter(C, "${Cr(key)}", Setter)`);if(collectionSetters||(collectionSetters=[]),collectionSetters.length>0){let actions=eval(collectionSetters[0].Setter);value&&(Array.isArray(value)?await te(this,Oe,"f").executeAction(actions,te(this,_t,"f"),value.map(t=>({name:"value",value:t})),batchId):await te(this,Oe,"f").executeAction(actions,te(this,_t,"f"),[{name:"value",value}],batchId))}}async setCollectionAdder(key,value,batchId){let adders=await te(this,Oe,"f").infer(`subject_class("${te(this,nr,"f")}", C), collection_adder(C, "${Cr(key)}", Adder)`);if(adders||(adders=[]),adders.length>0){let actions=eval(adders[0].Adder);value&&(Array.isArray(value)?await Promise.all(value.map(t=>te(this,Oe,"f").executeAction(actions,te(this,_t,"f"),[{name:"value",value:t}],batchId))):await te(this,Oe,"f").executeAction(actions,te(this,_t,"f"),[{name:"value",value}],batchId))}}async setCollectionRemover(key,value,batchId){let removers=await te(this,Oe,"f").infer(`subject_class("${te(this,nr,"f")}", C), collection_remover(C, "${Cr(key)}", Remover)`);if(removers||(removers=[]),removers.length>0){let actions=eval(removers[0].Remover);value&&(Array.isArray(value)?await Promise.all(value.map(t=>te(this,Oe,"f").executeAction(actions,te(this,_t,"f"),[{name:"value",value:t}],batchId))):await te(this,Oe,"f").executeAction(actions,te(this,_t,"f"),[{name:"value",value}],batchId))}}async save(t){let e=!1;t||(t=await this.perspective.createBatch(),e=!0);let r={};for(let[n,i]of Object.entries(this))i!=null&&!(Array.isArray(i)&&i.length>0)&&!i?.action&&(r[n]=i);await this.perspective.createSubject(this,te(this,_t,"f"),r,t),await te(this,Oe,"f").add(new Bn({source:te(this,Bs,"f"),predicate:"ad4m://has_child",target:this.baseExpression}),"shared",t),await this.innerUpdate(!1,t),e&&(await this.perspective.commitBatch(t),await this.getData())}cleanCopy(){let t={},e=Object.entries(this);for(let[r,n]of e)n!=null&&r!=="author"&&r!=="timestamp"&&(t[r]=n);return t}async innerUpdate(t=!0,e){Ea(this,nr,await te(this,Oe,"f").stringOrTemplateObjectToSubjectClassName(this.cleanCopy()),"f");let r=Object.entries(this);for(let[n,i]of r)if(i!=null)if(i?.action)switch(i.action){case"setter":await this.setCollectionSetter(n,i.value,e);break;case"adder":await this.setCollectionAdder(n,i.value,e);break;case"remover":await this.setCollectionRemover(n,i.value,e);break;default:await this.setCollectionSetter(n,i.value,e);break}else Array.isArray(i)&&i.length>0?await this.setCollectionSetter(n,i,e):i!=null&&i!==""&&t&&await this.setProperty(n,i,e)}async update(t){await this.innerUpdate(!0,t),await this.getData()}async get(){return Ea(this,nr,await te(this,Oe,"f").stringOrTemplateObjectToSubjectClassName(this.cleanCopy()),"f"),await this.getData()}async delete(t){await te(this,Oe,"f").removeSubject(this,te(this,_t,"f"),t)}static query(t,e){return new Vl(t,this,e)}};_t=new WeakMap,nr=new WeakMap,Bs=new WeakMap,Oe=new WeakMap;_Ad4mModel.classNamesByClass=new WeakMap;var Vl=class{constructor(e,r,n){this.queryParams={},this.modelClassName=null,this.perspective=e,this.ctor=r,n&&(this.queryParams=n)}dispose(){this.currentSubscription&&(this.currentSubscription.dispose(),this.currentSubscription=void 0)}where(e){return this.queryParams.where=e,this}order(e){return this.queryParams.order=e,this}limit(e){return this.queryParams.limit=e,this}offset(e){return this.queryParams.offset=e,this}source(e){return this.queryParams.source=e,this}properties(e){return this.queryParams.properties=e,this}collections(e){return this.queryParams.collections=e,this}overrideModelClassName(e){return this.modelClassName=e,this}async get(){let e=await this.ctor.queryToProlog(this.perspective,this.queryParams),r=await this.perspective.infer(e),{results:n}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,r);return n}async subscribe(e){this.dispose();let r=await this.ctor.queryToProlog(this.perspective,this.queryParams,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(r);let n=async a=>{let{results:o}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,a);e(o)};this.currentSubscription.onResult(n);let{results:i}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,this.currentSubscription.result);return i}async count(){let e=await this.ctor.countQueryToProlog(this.perspective,this.queryParams,this.modelClassName);return(await this.perspective.infer(e))?.[0]?.TotalCount||0}async countSubscribe(e){this.dispose();let r=await this.ctor.countQueryToProlog(this.perspective,this.queryParams,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(r);let n=async i=>{let a=i?.[0]?.TotalCount||0;e(a)};return this.currentSubscription.onResult(n),this.currentSubscription.result?.[0]?.TotalCount||0}async paginate(e,r){let n={...this.queryParams||{},limit:e,offset:e*(r-1),count:!0},i=await this.ctor.queryToProlog(this.perspective,n,this.modelClassName),a=await this.perspective.infer(i),{results:o,totalCount:s}=await this.ctor.instancesFromPrologResult(this.perspective,n,a);return{results:o,totalCount:s,pageSize:e,pageNumber:r}}async paginateSubscribe(e,r,n){this.dispose();let i={...this.queryParams||{},limit:e,offset:e*(r-1),count:!0},a=await this.ctor.queryToProlog(this.perspective,i,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(a);let o=async c=>{let{results:l,totalCount:d}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,c);n({results:l,totalCount:d,pageSize:e,pageNumber:r})};this.currentSubscription.onResult(o);let{results:s,totalCount:u}=await this.ctor.instancesFromPrologResult(this.perspective,i,this.currentSubscription.result);return{results:s,totalCount:u,pageSize:e,pageNumber:r}}};var vc="0.10.1-multi-user-1";var kr=12e3;function I3(){let t=new AbortController;return setTimeout(()=>t.abort(),20),t}function ti(t,e=1e4){return ee(this,null,function*(){return Promise.race([new Promise((r,n)=>{let i;try{i=new WebSocket(t,"graphql-transport-ws"),i.onopen=()=>{i.close(),r(i)},i.onerror=a=>{n(a)},i.onclose=a=>{a.code!==1e3&&n(new Error(`WebSocket closed with code ${a.code}: ${a.reason}`))}}catch(a){i&&i.close(),n(a)}}),new Promise((r,n)=>{setTimeout(()=>{n(new Error("WebSocket connection timed out"))},e)})])})}function ip(t){return ee(this,null,function*(){try{let e=yield fetch(`http://localhost:${t}/graphql/`,{signal:I3().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 T3(){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 ap(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(t){return!1}return!0}function bc(t,e){ap()&&localStorage.setItem(`${vc}/${t}`,e)}function Wt(t){return ap()?localStorage.getItem(`${vc}/${t}`):null}function op(t){ap()&&localStorage.removeItem(`${vc}/${t}`)}var O3=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 wo(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 O3(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 So=class{constructor(e){this.activeSocket=null;this.requestedRestart=!1;this.authState="unauthenticated";this.connectionState="not_connected";this.port=kr;this.capabilities=[];this.isHosting=!1;this.listeners={authstatechange:[],configstatechange:[],connectionstatechange:[]};wo(this);this.options=e,this.appName=e.appName,this.appDesc=e.appDesc,this.appDomain=e.appDomain,this.appUrl=e.appUrl,this.appIconPath=e.appIconPath,this.capabilities=e.capabilities,this.port=e.port||this.port,this.url=e.url||`ws://localhost:${this.port}/graphql`,this.token=e.token||this.token,this.isHosting=e.hosting||!1}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)}buildTempClient(e){let r=Wu({url:e,connectionParams:()=>ee(this,null,function*(){return{headers:{authorization:""}}})}),n=new ps({link:new Ku(r),cache:new wa({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"}}});return new po(n)}connect(e){return ee(this,null,function*(){try{if(e){yield ti(e),this.setUrl(e);let r=this.buildClient();return yield this.checkAuth(),r}else{let r=`ws://localhost:${this.port}/graphql`;yield ti(r),this.setUrl(r);let n=this.buildClient();return yield this.checkAuth(),n}}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}connectMultiUser(){return ee(this,null,function*(){try{let e=this.options.backendUrl;console.debug("[Ad4m Connect] Connecting to backend:",e),yield ti(e),this.setUrl(e);let r=this.buildClient();console.debug("[Ad4m Connect] Built client:",r);let n;try{console.debug("[Ad4m Connect] Logging in user:",this.options.userEmail),n=yield r.agent.loginUser(this.options.userEmail,this.options.userPassword),console.debug("[Ad4m Connect] Login successful")}catch(a){console.debug("[Ad4m Connect] Login error:",a),console.debug("[Ad4m Connect] User does not exist, trying to create user:",this.options.userEmail);try{console.debug("[Ad4m Connect] Creating user:",this.options.userEmail);try{let o=yield r.agent.createUser(this.options.userEmail,this.options.userPassword);if(console.debug("[Ad4m Connect] Create result:",o),!o.success)throw new Error(o.error||"Failed to create user")}catch(o){console.log("[Ad4m Connect] Failed to create user:",o)}console.debug("[Ad4m Connect] Logging in user after creation:",this.options.userEmail),n=yield r.agent.loginUser(this.options.userEmail,this.options.userPassword),console.log("[Ad4m Connect] Successfully created and logged in user")}catch(o){throw new Error(`Failed to create/login user: ${o.message}`)}}this.setToken(n);let i=this.buildClient();return yield i.agent.status(),this.notifyAuthChange("authenticated"),this.notifyConnectionChange("connected"),i}catch(e){throw this.notifyConnectionChange("error"),this.notifyAuthChange("unauthenticated"),e}})}loginToHosting(e,r){return ee(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,bc("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 ee(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 ee(this,null,function*(){try{if(e){let r=yield ip(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 ee(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 ti(this.url),this.buildClient()}catch(i){return this.notifyConnectionChange("not_connected"),this.connectToPort()}})}findPort(){return ee(this,null,function*(){let e=[...Array(10).keys()].map((i,a)=>ip(kr+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=Wu({url:this.url,connectionParams:()=>ee(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:e=>ee(this,null,function*(){if(!e.wasClean&&!this.requestedRestart)if(!this.token)this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1;else{let r=yield this.connect();r?this.ad4mClient=r:(this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1)}})}}),this.apolloClient=new ps({link:new Ku(this.wsClient),cache:new wa({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"},mutate:{fetchPolicy:"no-cache"}}}),this.ad4mClient=new po(this.apolloClient),this.ad4mClient}checkAuth(){return ee(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 ee(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 ee(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(kr),this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}};function sp({unlockAgent:t,reconnect:e}){return L`
1472
1497
  <div class="text-center">
1473
1498
  <div class="items">
1474
1499
  <div>
@@ -1480,7 +1505,205 @@ input VoiceActivityParamsInput {
1480
1505
  <button class="button" @click=${e}>Reconnect</button>
1481
1506
  </div>
1482
1507
  </div>
1483
- `}function ap(){return Q`
1508
+ `}function cp({localDetected:t,multiUserConfigured:e,backendUrl:r,configuredUrl:n,isMobile:i,onConnectLocal:a,onConnectRemote:o,onScanQR:s,onDownloadAd4m:u}){let c=!i&&t,l=!0,d=i,f=!t&&!e,p=r||n;return L`
1509
+ <div class="items">
1510
+ <div class="text-center">
1511
+ <h3 class="heading">Connect to AD4M</h3>
1512
+ ${t?L`
1513
+ <p class="body">Choose how you want to connect:</p>
1514
+ `:L`
1515
+ <p class="body" style="color: var(--body-color); opacity: 0.8;">
1516
+ No local AD4M detected.
1517
+ ${i?L`Connect to a remote executor or scan a QR code.`:L`Download AD4M or connect to a remote executor.`}
1518
+ </p>
1519
+ `}
1520
+ </div>
1521
+
1522
+ <div class="items items--small">
1523
+ ${c?L`
1524
+ <div class="connection-option connection-option--primary">
1525
+ <div class="connection-option__header">
1526
+ <svg
1527
+ width="24"
1528
+ height="24"
1529
+ viewBox="0 0 24 24"
1530
+ fill="none"
1531
+ stroke="currentColor"
1532
+ >
1533
+ <circle cx="12" cy="12" r="10"></circle>
1534
+ <circle cx="12" cy="12" r="3" fill="currentColor"></circle>
1535
+ </svg>
1536
+ <h4 class="heading nomargin">Local AD4M</h4>
1537
+ </div>
1538
+ <p class="body" style="margin: 10px 0 15px 0; font-size: 13px;">
1539
+ Connect to your local executor on port 12000
1540
+ </p>
1541
+ <button
1542
+ class="button button--full"
1543
+ @click=${a}
1544
+ >
1545
+ Connect to Local AD4M
1546
+ </button>
1547
+ </div>
1548
+ `:""}
1549
+
1550
+ ${l?L`
1551
+ <div
1552
+ class="connection-option ${c?"":"connection-option--primary"}"
1553
+ >
1554
+ <div class="connection-option__header">
1555
+ <svg
1556
+ width="24"
1557
+ height="24"
1558
+ viewBox="0 0 24 24"
1559
+ fill="none"
1560
+ stroke="currentColor"
1561
+ >
1562
+ <circle cx="12" cy="12" r="10"></circle>
1563
+ <path d="M2 12h20"></path>
1564
+ <path
1565
+ d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"
1566
+ ></path>
1567
+ </svg>
1568
+ <h4 class="heading nomargin">
1569
+ ${p?"Configured AD4M Node":"Remote AD4M"}
1570
+ </h4>
1571
+ </div>
1572
+ ${p?L`
1573
+ <p
1574
+ class="body"
1575
+ style="margin: 10px 0 5px 0; font-size: 13px;"
1576
+ >
1577
+ ${e?"Multi-user backend configured":"Connect to AD4M node at URL"}
1578
+ </p>
1579
+ <p
1580
+ class="body"
1581
+ style="margin: 0 0 15px 0; font-size: 12px; opacity: 0.7; font-family: monospace;"
1582
+ >
1583
+ ${p}
1584
+ </p>
1585
+ `:L`
1586
+ <p
1587
+ class="body"
1588
+ style="margin: 10px 0 15px 0; font-size: 13px;"
1589
+ >
1590
+ Connect to a remote executor or multi-user backend
1591
+ </p>
1592
+ `}
1593
+ <button
1594
+ class="button ${c?"button--secondary":""} button--full"
1595
+ @click=${o}
1596
+ >
1597
+ ${p?"Connect to Configured Node":"Enter Remote URL"}
1598
+ </button>
1599
+ </div>
1600
+ `:""}
1601
+
1602
+ ${d?L`
1603
+ <div class="connection-option">
1604
+ <div class="connection-option__header">
1605
+ <svg
1606
+ width="24"
1607
+ height="24"
1608
+ viewBox="0 0 24 24"
1609
+ fill="none"
1610
+ stroke="currentColor"
1611
+ >
1612
+ <rect x="3" y="3" width="7" height="7"></rect>
1613
+ <rect x="14" y="3" width="7" height="7"></rect>
1614
+ <rect x="14" y="14" width="7" height="7"></rect>
1615
+ <rect x="3" y="14" width="7" height="7"></rect>
1616
+ </svg>
1617
+ <h4 class="heading nomargin">Scan QR Code</h4>
1618
+ </div>
1619
+ <p class="body" style="margin: 10px 0 15px 0; font-size: 13px;">
1620
+ Scan a QR code from another device
1621
+ </p>
1622
+ <button
1623
+ class="button button--secondary button--full"
1624
+ @click=${s}
1625
+ >
1626
+ Scan QR Code
1627
+ </button>
1628
+ </div>
1629
+ `:""}
1630
+
1631
+ ${f?L`
1632
+ <div class="connection-option connection-option--download">
1633
+ <div class="connection-option__header">
1634
+ <svg
1635
+ width="24"
1636
+ height="24"
1637
+ viewBox="0 0 24 24"
1638
+ fill="none"
1639
+ stroke="currentColor"
1640
+ >
1641
+ <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
1642
+ <polyline points="7 10 12 15 17 10"></polyline>
1643
+ <line x1="12" y1="15" x2="12" y2="3"></line>
1644
+ </svg>
1645
+ <h4 class="heading nomargin">Get AD4M</h4>
1646
+ </div>
1647
+ <p class="body" style="margin: 10px 0 15px 0; font-size: 13px;">
1648
+ Download and install AD4M on your device
1649
+ </p>
1650
+ <button
1651
+ class="button button--full"
1652
+ @click=${u}
1653
+ >
1654
+ Download AD4M
1655
+ </button>
1656
+ </div>
1657
+ `:""}
1658
+ </div>
1659
+ </div>
1660
+
1661
+ <style>
1662
+ .connection-option {
1663
+ background: rgba(145, 227, 253, 0.05);
1664
+ border: 1px solid rgba(145, 227, 253, 0.2);
1665
+ border-radius: 8px;
1666
+ padding: 20px;
1667
+ transition: all 0.3s ease;
1668
+ }
1669
+
1670
+ .connection-option:hover {
1671
+ border-color: rgba(145, 227, 253, 0.4);
1672
+ background: rgba(145, 227, 253, 0.08);
1673
+ }
1674
+
1675
+ .connection-option--primary {
1676
+ border: 2px solid var(--gradient);
1677
+ background: rgba(145, 227, 253, 0.1);
1678
+ }
1679
+
1680
+ .connection-option--primary:hover {
1681
+ background: rgba(145, 227, 253, 0.15);
1682
+ }
1683
+
1684
+ .connection-option--download {
1685
+ border-style: dashed;
1686
+ opacity: 0.9;
1687
+ }
1688
+
1689
+ .connection-option__header {
1690
+ display: flex;
1691
+ align-items: center;
1692
+ gap: 10px;
1693
+ margin-bottom: 5px;
1694
+ }
1695
+
1696
+ .connection-option__header svg {
1697
+ flex-shrink: 0;
1698
+ opacity: 0.8;
1699
+ }
1700
+
1701
+ .connection-option--primary .connection-option__header svg {
1702
+ color: var(--gradient);
1703
+ opacity: 1;
1704
+ }
1705
+ </style>
1706
+ `}function up(){return L`
1484
1707
  <div class="items">
1485
1708
  <div class="text-center">
1486
1709
  <h1 class="heading">Request to AD4M blocked</h1>
@@ -1501,7 +1724,7 @@ input VoiceActivityParamsInput {
1501
1724
  </button>
1502
1725
  </div>
1503
1726
  </div>
1504
- `}function op({reconnect:t}){return Q`
1727
+ `}function lp({reconnect:t}){return L`
1505
1728
  <div class="items items--small">
1506
1729
  <div class="text-center">
1507
1730
  <h1 class="heading">Could not connect to AD4M</h1>
@@ -1510,7 +1733,7 @@ input VoiceActivityParamsInput {
1510
1733
  <button class="button" @click=${()=>t()}>Try again</button>
1511
1734
  </div>
1512
1735
  </div>
1513
- `}function sp(){return Q`<header class="dialog__header">
1736
+ `}function pp(){return L`<header class="dialog__header">
1514
1737
  <div class="dialog__logo">
1515
1738
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 37" fill="none">
1516
1739
  <path
@@ -1519,7 +1742,7 @@ input VoiceActivityParamsInput {
1519
1742
  />
1520
1743
  </svg>
1521
1744
  </div>
1522
- </header>`}function cp({step:t,email:e,changeEmail:r,changeState:n,password:i,changePassword:a,login:o,checkEmail:s,passwordError:u,setHostingStep:c,isHostingRunning:l,setIsHostingRunning:d}){if(l)return Q`
1745
+ </header>`}function fp({step:t,email:e,changeEmail:r,changeState:n,password:i,changePassword:a,login:o,checkEmail:s,passwordError:u,setHostingStep:c,isHostingRunning:l,setIsHostingRunning:d}){if(l)return L`
1523
1746
  <div class="text-center">
1524
1747
  <p>
1525
1748
  Hosted executor does not seem to be running. Please check the logs in your <a href="https://hosting.ad4m.dev/dashboard">ADAM hosting dashboard</a> and potentially restart your executor there.
@@ -1531,7 +1754,7 @@ input VoiceActivityParamsInput {
1531
1754
  Back
1532
1755
  </button>
1533
1756
  </div>
1534
- `;if(t===0)return Q`
1757
+ `;if(t===0)return L`
1535
1758
  <div class="input">
1536
1759
  <label class="input__label">EMAIL</label>
1537
1760
  <input
@@ -1554,7 +1777,7 @@ input VoiceActivityParamsInput {
1554
1777
  </button>
1555
1778
  </div>
1556
1779
  </div>
1557
- `;if(t===1)return Q`
1780
+ `;if(t===1)return L`
1558
1781
  <div class="input">
1559
1782
  <label class="input__label">PASSWORD</label>
1560
1783
  <input
@@ -1565,7 +1788,7 @@ input VoiceActivityParamsInput {
1565
1788
  errortext={passwordError}
1566
1789
  error={passwordError}
1567
1790
  />
1568
- ${u?Q`<p class="error">${u}</p>`:""}
1791
+ ${u?L`<p class="error">${u}</p>`:""}
1569
1792
  <div class="buttons">
1570
1793
  <button
1571
1794
  class="button button--full button-secondary"
@@ -1582,7 +1805,7 @@ input VoiceActivityParamsInput {
1582
1805
  </button>
1583
1806
  </div>
1584
1807
  </div>
1585
- `;if(t===2)return Q`
1808
+ `;if(t===2)return L`
1586
1809
  <div class="text-center">
1587
1810
  <p>
1588
1811
  Email is not registered. Please follow the <a target="_blank" href="https://hosting.ad4m.dev/">link</a> to register.
@@ -1594,7 +1817,7 @@ input VoiceActivityParamsInput {
1594
1817
  Back
1595
1818
  </button>
1596
1819
  </div>
1597
- `}function up(){return Q`
1820
+ `}function dp(){return L`
1598
1821
  <div>
1599
1822
  <div class="lds-ring">
1600
1823
  <div></div>
@@ -1603,30 +1826,431 @@ input VoiceActivityParamsInput {
1603
1826
  <div></div>
1604
1827
  </div>
1605
1828
  </div>
1606
- `}function yo(){return Q`
1829
+ `}function Co(){return L`
1607
1830
  <svg width="44" height="40" viewBox="0 0 70 60" fill="none" xmlns="http://www.w3.org/2000/svg">
1608
1831
  <path d="M63.2781 52.9928C62.4038 47.0393 59.8345 41.4763 55.9242 36.935C55.9403 36.5766 55.951 36.2182 55.951 35.8545C55.951 26.6328 50.7373 18.6039 43.0937 14.5333C41.093 9.35009 37.7352 4.72854 33.2402 1.14469L31.7705 0L30.2793 1.10725L30.2096 1.16074C25.7253 4.74458 22.3729 9.36079 20.3775 14.5386C12.7339 18.6039 7.52021 26.6328 7.52021 35.8599C7.52021 36.2236 7.53094 36.582 7.54703 36.9404C3.6421 41.471 1.06742 47.034 0.198465 52.9874L0 54.9131L1.70036 55.5817C5.40683 57.0313 9.32249 57.7695 13.3401 57.7695C15.668 57.7695 17.9369 57.5127 20.1254 57.0366C23.5744 58.9248 27.533 60 31.7383 60C35.9436 60 39.9022 58.9248 43.3512 57.0366C45.5397 57.5127 47.8086 57.7695 50.1365 57.7695C54.1541 57.7695 58.0698 57.0366 61.7762 55.5817L63.5624 54.881L63.2835 52.9874L63.2781 52.9928ZM42.5734 51.8802C40.0792 51.1581 37.7352 50.0829 35.595 48.7189C39.752 44.675 42.8041 39.5079 44.263 33.7202C46.1297 34.6938 47.8891 35.8866 49.4982 37.288C49.9917 37.716 50.4637 38.1653 50.9197 38.6253C50.1258 44.1294 46.9986 48.8954 42.568 51.8855L42.5734 51.8802ZM12.5516 38.62C13.0075 38.1599 13.4849 37.716 13.973 37.288C15.5822 35.8866 17.3415 34.6938 19.2082 33.7202C20.6672 39.5079 23.7192 44.675 27.8763 48.7189C25.7361 50.0829 23.392 51.1527 20.8978 51.8802C16.4672 48.8901 13.3401 44.1241 12.5462 38.62H12.5516ZM40.3957 25.9802C40.3957 26.3332 40.3903 26.6809 40.3742 27.0286C37.585 26.2477 34.6831 25.8411 31.7383 25.8411C28.7935 25.8411 25.8916 26.2477 23.1024 27.0286C23.0917 26.6809 23.0809 26.3279 23.0809 25.9802C23.0809 23.2362 23.494 20.5563 24.2825 18.0102C26.5782 17.0527 29.0993 16.5231 31.7383 16.5231C34.3773 16.5231 36.8984 17.0527 39.1941 18.0102C39.9826 20.5563 40.3957 23.2362 40.3957 25.9802ZM23.73 31.8641C26.3047 31.0671 29.0027 30.6553 31.7383 30.6553C34.4739 30.6553 37.1719 31.0671 39.7466 31.8641C38.5344 37.2827 35.6808 42.0915 31.7383 45.7395C27.7958 42.0861 24.9422 37.2773 23.73 31.8641ZM50.7641 32.1262C48.9887 30.8104 47.0898 29.6817 45.0998 28.7671C45.1803 27.847 45.2232 26.9163 45.2232 25.9802C45.2232 24.536 45.1266 23.1131 44.9335 21.7063C47.8676 24.4343 49.9595 28.0503 50.7641 32.1262ZM31.7383 6.19417C33.6639 7.97005 35.2946 9.99198 36.6087 12.1904C35.0371 11.8695 33.4065 11.6983 31.7383 11.6983C30.0701 11.6983 28.4395 11.8695 26.8679 12.1904C28.182 9.99198 29.8127 7.97005 31.7383 6.19417ZM18.5431 21.701C18.3553 23.1078 18.2534 24.5306 18.2534 25.9749C18.2534 26.9163 18.2963 27.8417 18.3768 28.7617C16.3868 29.6764 14.4879 30.805 12.7125 32.1209C13.5171 28.0449 15.6036 24.429 18.5377 21.701H18.5431ZM5.33173 51.7518C5.9915 48.7938 7.15547 45.9802 8.74855 43.418C9.95007 47.034 11.9776 50.2808 14.622 52.9179C14.1983 52.9393 13.7692 52.95 13.3401 52.95C10.5991 52.95 7.91178 52.5488 5.32637 51.7465L5.33173 51.7518ZM31.7383 55.1859C30.1506 55.1859 28.6058 54.988 27.1307 54.6296C28.7452 53.854 30.29 52.95 31.7383 51.923C33.1866 52.95 34.7314 53.854 36.3459 54.6296C34.8655 54.988 33.326 55.1859 31.7383 55.1859ZM50.1365 52.95C49.7074 52.95 49.2783 52.9339 48.8546 52.9179C51.499 50.2808 53.5265 47.0393 54.728 43.4234C56.3211 45.9802 57.4851 48.7938 58.1449 51.7518C55.5648 52.5488 52.8775 52.95 50.1365 52.95Z" fill="#91E3FD"/>
1609
1832
  </svg>
1610
- `}function lp({openModal:t}){return Q`
1833
+ `}function hp({openModal:t}){return L`
1611
1834
  <div class="mainlogo" @click=${t}>
1612
- ${yo()}
1835
+ ${Co()}
1613
1836
  </div>
1614
- `}function pp({capabilities:t,appname:e,appiconpath:r,changeState:n,setOpen:i,requestCapability:a}){return Q`
1837
+ `}function mp({email:t,password:e,error:r,isLoading:n,backendUrl:i,changeEmail:a,changePassword:o,onLogin:s,onSignup:u,activeTab:c,setActiveTab:l}){return L`
1838
+ <div class="items">
1839
+ <div class="text-center">
1840
+ <h3 class="heading">Multi-User Authentication</h3>
1841
+ <p class="body">Please sign in or create an account to continue</p>
1842
+ ${i?L`
1843
+ <p
1844
+ class="body"
1845
+ style="margin-top: 10px; font-size: 12px; opacity: 0.7; font-family: monospace;"
1846
+ >
1847
+ ${i}
1848
+ </p>
1849
+ `:""}
1850
+ </div>
1851
+
1852
+ <!-- Tab Switcher -->
1853
+ <div class="tab-switcher">
1854
+ <button
1855
+ class="tab-button ${c==="login"?"active":""}"
1856
+ @click=${()=>l("login")}
1857
+ >
1858
+ Login
1859
+ </button>
1860
+ <button
1861
+ class="tab-button ${c==="signup"?"active":""}"
1862
+ @click=${()=>l("signup")}
1863
+ >
1864
+ Sign Up
1865
+ </button>
1866
+ </div>
1867
+
1868
+ ${r?L`
1869
+ <div class="error-message">
1870
+ <p>${r}</p>
1871
+ </div>
1872
+ `:""}
1873
+
1874
+ <!-- Login/Signup Form -->
1875
+ <div class="items items--small">
1876
+ <div class="input">
1877
+ <label class="input__label" for="email">Email</label>
1878
+ <input
1879
+ id="email"
1880
+ type="email"
1881
+ class="input__field"
1882
+ placeholder="your@email.com"
1883
+ .value=${t}
1884
+ @input=${d=>a(d.target.value)}
1885
+ ?disabled=${n}
1886
+ />
1887
+ </div>
1888
+
1889
+ <div class="input">
1890
+ <label class="input__label" for="password">Password</label>
1891
+ <input
1892
+ id="password"
1893
+ type="password"
1894
+ class="input__field"
1895
+ placeholder="Enter password"
1896
+ .value=${e}
1897
+ @input=${d=>o(d.target.value)}
1898
+ @keypress=${d=>{d.key==="Enter"&&(c==="login"?s():u())}}
1899
+ ?disabled=${n}
1900
+ />
1901
+ </div>
1902
+ </div>
1903
+
1904
+ <div class="buttons">
1905
+ ${c==="login"?L`
1906
+ <button
1907
+ class="button button--full"
1908
+ @click=${s}
1909
+ ?disabled=${n||!t||!e}
1910
+ >
1911
+ ${n?"Logging in...":"Login"}
1912
+ </button>
1913
+ `:L`
1914
+ <button
1915
+ class="button button--full"
1916
+ @click=${u}
1917
+ ?disabled=${n||!t||!e}
1918
+ >
1919
+ ${n?"Creating account...":"Sign Up"}
1920
+ </button>
1921
+ `}
1922
+ </div>
1923
+
1924
+ ${c==="login"?L`
1925
+ <div class="text-center">
1926
+ <p class="body">
1927
+ Don't have an account?
1928
+ <button
1929
+ class="button button--link"
1930
+ @click=${()=>l("signup")}
1931
+ >
1932
+ Sign up
1933
+ </button>
1934
+ </p>
1935
+ </div>
1936
+ `:L`
1937
+ <div class="text-center">
1938
+ <p class="body">
1939
+ Already have an account?
1940
+ <button
1941
+ class="button button--link"
1942
+ @click=${()=>l("login")}
1943
+ >
1944
+ Log in
1945
+ </button>
1946
+ </p>
1947
+ </div>
1948
+ `}
1949
+ </div>
1950
+
1951
+ <style>
1952
+ .tab-switcher {
1953
+ display: flex;
1954
+ gap: 10px;
1955
+ justify-content: center;
1956
+ border-bottom: 1px solid var(--body-color);
1957
+ padding-bottom: 10px;
1958
+ }
1959
+
1960
+ .tab-button {
1961
+ background: none;
1962
+ border: none;
1963
+ color: var(--body-color);
1964
+ padding: 10px 20px;
1965
+ cursor: pointer;
1966
+ font-size: 16px;
1967
+ font-weight: 500;
1968
+ border-bottom: 2px solid transparent;
1969
+ transition: all 0.3s ease;
1970
+ }
1971
+
1972
+ .tab-button.active {
1973
+ color: var(--gradient);
1974
+ border-bottom-color: var(--gradient);
1975
+ }
1976
+
1977
+ .tab-button:hover {
1978
+ color: var(--primary-color);
1979
+ }
1980
+
1981
+ .error-message {
1982
+ background-color: rgba(255, 0, 0, 0.1);
1983
+ border: 1px solid rgba(255, 0, 0, 0.3);
1984
+ border-radius: 8px;
1985
+ padding: 15px;
1986
+ color: #ff6b6b;
1987
+ text-align: center;
1988
+ }
1989
+
1990
+ .error-message p {
1991
+ margin: 0;
1992
+ }
1993
+ </style>
1994
+ `}function gp({initialUrl:t,detecting:e,multiUserDetected:r,error:n,onBack:i,onUrlChange:a,onConnect:o,onMultiUserAuth:s,onRequestCapability:u}){let c=r!==null&&!e,l=t||"";return L`
1995
+ <div class="items">
1996
+ <div class="text-center">
1997
+ <h3 class="heading">Connect to Remote AD4M</h3>
1998
+ <p class="body">Enter the URL of a remote AD4M executor</p>
1999
+ </div>
2000
+
2001
+ ${c?L`
2002
+ <div class="items items--small">
2003
+ <div class="remote-info">
2004
+ <p class="body" style="margin: 0 0 5px 0; font-size: 13px;">
2005
+ Connected to:
2006
+ </p>
2007
+ <p
2008
+ class="body"
2009
+ style="margin: 0; font-family: monospace; font-size: 12px; opacity: 0.8;"
2010
+ >
2011
+ ${l}
2012
+ </p>
2013
+ </div>
2014
+
2015
+ ${r?L`
2016
+ <div class="auth-option auth-option--primary">
2017
+ <div class="auth-option__header">
2018
+ <svg
2019
+ width="20"
2020
+ height="20"
2021
+ viewBox="0 0 24 24"
2022
+ fill="none"
2023
+ stroke="currentColor"
2024
+ >
2025
+ <path
2026
+ d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"
2027
+ ></path>
2028
+ <circle cx="9" cy="7" r="4"></circle>
2029
+ <path d="M23 21v-2a4 4 0 0 0-3-3.87"></path>
2030
+ <path d="M16 3.13a4 4 0 0 1 0 7.75"></path>
2031
+ </svg>
2032
+ <h4 class="heading nomargin" style="font-size: 16px;">
2033
+ Multi-User Login
2034
+ </h4>
2035
+ </div>
2036
+ <p
2037
+ class="body"
2038
+ style="margin: 10px 0 15px 0; font-size: 13px;"
2039
+ >
2040
+ This executor supports multi-user authentication. Sign
2041
+ in or create an account.
2042
+ </p>
2043
+ <button class="button button--full" @click=${s}>
2044
+ Login / Sign Up
2045
+ </button>
2046
+ </div>
2047
+
2048
+ <div class="auth-option">
2049
+ <div class="auth-option__header">
2050
+ <svg
2051
+ width="20"
2052
+ height="20"
2053
+ viewBox="0 0 24 24"
2054
+ fill="none"
2055
+ stroke="currentColor"
2056
+ >
2057
+ <rect
2058
+ x="3"
2059
+ y="11"
2060
+ width="18"
2061
+ height="11"
2062
+ rx="2"
2063
+ ry="2"
2064
+ ></rect>
2065
+ <path d="M7 11V7a5 5 0 0 1 10 0v4"></path>
2066
+ </svg>
2067
+ <h4 class="heading nomargin" style="font-size: 16px;">
2068
+ Capability Request
2069
+ </h4>
2070
+ </div>
2071
+ <p
2072
+ class="body"
2073
+ style="margin: 10px 0 15px 0; font-size: 13px;"
2074
+ >
2075
+ Request access to the main agent with a verification
2076
+ code.
2077
+ </p>
2078
+ <button
2079
+ class="button button--secondary button--full"
2080
+ @click=${u}
2081
+ >
2082
+ Request Capability
2083
+ </button>
2084
+ </div>
2085
+ `:L`
2086
+ <div class="auth-option auth-option--primary">
2087
+ <div class="auth-option__header">
2088
+ <svg
2089
+ width="20"
2090
+ height="20"
2091
+ viewBox="0 0 24 24"
2092
+ fill="none"
2093
+ stroke="currentColor"
2094
+ >
2095
+ <rect
2096
+ x="3"
2097
+ y="11"
2098
+ width="18"
2099
+ height="11"
2100
+ rx="2"
2101
+ ry="2"
2102
+ ></rect>
2103
+ <path d="M7 11V7a5 5 0 0 1 10 0v4"></path>
2104
+ </svg>
2105
+ <h4 class="heading nomargin" style="font-size: 16px;">
2106
+ Single-User Executor
2107
+ </h4>
2108
+ </div>
2109
+ <p
2110
+ class="body"
2111
+ style="margin: 10px 0 15px 0; font-size: 13px;"
2112
+ >
2113
+ This executor uses capability-based authentication.
2114
+ Request access with a verification code.
2115
+ </p>
2116
+ <button
2117
+ class="button button--full"
2118
+ @click=${u}
2119
+ >
2120
+ Request Capability
2121
+ </button>
2122
+ </div>
2123
+ `}
2124
+
2125
+ <div class="buttons">
2126
+ <button
2127
+ class="button button--link"
2128
+ @click=${i}
2129
+ style="margin: 0 auto;"
2130
+ >
2131
+ ← Back to connection options
2132
+ </button>
2133
+ </div>
2134
+ </div>
2135
+ `:L`
2136
+ <div class="items items--small">
2137
+ <div class="input">
2138
+ <label class="input__label" for="remote-url">
2139
+ Executor URL
2140
+ </label>
2141
+ <input
2142
+ id="remote-url"
2143
+ type="text"
2144
+ class="input__field"
2145
+ placeholder="wss://your-server.com/graphql"
2146
+ .value=${l}
2147
+ @input=${d=>a(d.target.value)}
2148
+ ?disabled=${e}
2149
+ />
2150
+ </div>
2151
+
2152
+ ${n?L`
2153
+ <div class="error-message">
2154
+ <p>${n}</p>
2155
+ </div>
2156
+ `:""}
2157
+
2158
+ <div class="buttons">
2159
+ <button
2160
+ class="button button--secondary"
2161
+ @click=${i}
2162
+ ?disabled=${e}
2163
+ >
2164
+ Back
2165
+ </button>
2166
+ <button
2167
+ class="button"
2168
+ @click=${o}
2169
+ ?disabled=${e||!l}
2170
+ >
2171
+ ${e?"Detecting...":"Connect"}
2172
+ </button>
2173
+ </div>
2174
+ </div>
2175
+ `}
2176
+ </div>
2177
+
2178
+ <style>
2179
+ .remote-info {
2180
+ background: rgba(145, 227, 253, 0.05);
2181
+ border: 1px solid rgba(145, 227, 253, 0.2);
2182
+ border-radius: 8px;
2183
+ padding: 15px;
2184
+ }
2185
+
2186
+ .auth-option {
2187
+ background: rgba(145, 227, 253, 0.05);
2188
+ border: 1px solid rgba(145, 227, 253, 0.2);
2189
+ border-radius: 8px;
2190
+ padding: 20px;
2191
+ transition: all 0.3s ease;
2192
+ }
2193
+
2194
+ .auth-option:hover {
2195
+ border-color: rgba(145, 227, 253, 0.4);
2196
+ background: rgba(145, 227, 253, 0.08);
2197
+ }
2198
+
2199
+ .auth-option--primary {
2200
+ border: 2px solid var(--gradient);
2201
+ background: rgba(145, 227, 253, 0.1);
2202
+ }
2203
+
2204
+ .auth-option--primary:hover {
2205
+ background: rgba(145, 227, 253, 0.15);
2206
+ }
2207
+
2208
+ .auth-option__header {
2209
+ display: flex;
2210
+ align-items: center;
2211
+ gap: 10px;
2212
+ margin-bottom: 5px;
2213
+ }
2214
+
2215
+ .auth-option__header svg {
2216
+ flex-shrink: 0;
2217
+ opacity: 0.8;
2218
+ }
2219
+
2220
+ .auth-option--primary .auth-option__header svg {
2221
+ color: var(--gradient);
2222
+ opacity: 1;
2223
+ }
2224
+
2225
+ .error-message {
2226
+ background-color: rgba(255, 0, 0, 0.1);
2227
+ border: 1px solid rgba(255, 0, 0, 0.3);
2228
+ border-radius: 8px;
2229
+ padding: 15px;
2230
+ color: #ff6b6b;
2231
+ text-align: center;
2232
+ }
2233
+
2234
+ .error-message p {
2235
+ margin: 0;
2236
+ }
2237
+ </style>
2238
+ `}function yp({capabilities:t,appname:e,appiconpath:r,changeState:n,setOpen:i,requestCapability:a}){return L`
1615
2239
  <div class="items">
1616
2240
  <div class="text-center">
1617
2241
  <p class="body">An external application</p>
1618
2242
  <h1 class="heading nomargin">${e}</h1>
1619
2243
  <p class="body">wants to access your AD4M data</p>
1620
2244
  </div>
1621
- ${r&&Q`<div class="dialog__connect">
2245
+ ${r&&L`<div class="dialog__connect">
1622
2246
  <img class="dialog__connect-app" src=${r} alt="Logo" />
1623
2247
  <div class="dialog__connect-check"></div>
1624
- <div class="dialog__connect-ad4m">${yo()}</div>
2248
+ <div class="dialog__connect-ad4m">${Co()}</div>
1625
2249
  </div>`}
1626
2250
  <div>
1627
2251
  <p class="text-center"><b>This will allow the developer to:</b></p>
1628
2252
  <ul class="check-list">
1629
- ${t.map(o=>Q`<li>
2253
+ ${t.map(o=>L`<li>
1630
2254
  <span>
1631
2255
  <svg
1632
2256
  xmlns="http://www.w3.org/2000/svg"
@@ -1640,7 +2264,7 @@ input VoiceActivityParamsInput {
1640
2264
  />
1641
2265
  </svg>
1642
2266
  </span>
1643
- <span>${J1(o)}</span>
2267
+ <span>${rm(o)}</span>
1644
2268
  </li>`)}
1645
2269
  </ul>
1646
2270
  </div>
@@ -1665,7 +2289,7 @@ input VoiceActivityParamsInput {
1665
2289
  Connection settings
1666
2290
  </button>
1667
2291
  </div>
1668
- `}function fp({changeState:t,onSuccess:e,uiState:r}){function n(i){let a=new BarcodeDetector,o=i.currentTarget,s=()=>ge(this,null,function*(){try{if(r!=="qr")return;let c=(yield a.detect(o)).find(l=>l.format==="qr_code");if(c!=null&&c.rawValue){t("requestcap"),e(c.rawValue);return}else requestAnimationFrame(s)}catch(u){console.error(u)}});s()}return Q`
2292
+ `}function vp({changeState:t,onSuccess:e,uiState:r}){function n(i){let a=new BarcodeDetector,o=i.currentTarget,s=()=>ee(this,null,function*(){try{if(r!=="qr")return;let c=(yield a.detect(o)).find(l=>l.format==="qr_code");if(c!=null&&c.rawValue){t("requestcap"),e(c.rawValue);return}else requestAnimationFrame(s)}catch(u){console.error(u)}});s()}return L`
1669
2293
  <div class="qr-scanner">
1670
2294
  <div class="qr-content">
1671
2295
  <button
@@ -1684,7 +2308,7 @@ input VoiceActivityParamsInput {
1684
2308
  ></video>
1685
2309
  </div>
1686
2310
  </div>
1687
- `}function dp({port:t,url:e,isRemote:r,connectToPort:n,changeIsRemote:i,connectRemote:a,changeState:o,changeUrl:s,changePort:u,clearState:c}){return Q`
2311
+ `}function bp({port:t,url:e,isRemote:r,connectToPort:n,changeIsRemote:i,connectRemote:a,changeState:o,changeUrl:s,changePort:u,clearState:c}){return L`
1688
2312
  <div class="items items--small">
1689
2313
  <div class="text-center">
1690
2314
  <h1 class="heading">Connection Settings</h1>
@@ -1698,7 +2322,7 @@ input VoiceActivityParamsInput {
1698
2322
  Remotely
1699
2323
  </button>
1700
2324
  </div>
1701
- ${r?Q`
2325
+ ${r?L`
1702
2326
  <div class="input">
1703
2327
  <label class="input__label">URL</label>
1704
2328
  <input
@@ -1715,7 +2339,7 @@ input VoiceActivityParamsInput {
1715
2339
  Connect
1716
2340
  </button>
1717
2341
  </div>
1718
- `:Q`
2342
+ `:L`
1719
2343
  <div class="input">
1720
2344
  <label class="input__label">PORT</label>
1721
2345
  <input
@@ -1751,9 +2375,9 @@ input VoiceActivityParamsInput {
1751
2375
  </button>
1752
2376
  </div
1753
2377
  </div>
1754
- `}function hp({connect:t,isMobile:e,hasClickedDownload:r,changeState:n,onDownloaded:i,scanQrcode:a,hosting:o}){let u=(pr("ad4murl")||`http://localhost:${kr}`).includes("localhost");function c(l){l.preventDefault();let d=l.currentTarget;window.open(d.href,"_blank"),this.onDownloaded()}return Q`
2378
+ `}function _p({connect:t,isMobile:e,hasClickedDownload:r,changeState:n,onDownloaded:i,scanQrcode:a,hosting:o}){let u=(Wt("ad4murl")||`http://localhost:${kr}`).includes("localhost");function c(l){l.preventDefault();let d=l.currentTarget;window.open(d.href,"_blank"),this.onDownloaded()}return L`
1755
2379
  <div class="items">
1756
- ${r?Q`
2380
+ ${r?L`
1757
2381
  <div class="text-center">
1758
2382
  <a class="button" target="_blank" @click=${()=>t()}>
1759
2383
  Connect to ADAM
@@ -1763,17 +2387,17 @@ input VoiceActivityParamsInput {
1763
2387
  ADAM agent
1764
2388
  </p>
1765
2389
  </div>
1766
- `:Q`
2390
+ `:L`
1767
2391
  <div class="text-center">
1768
2392
  <h1 class="heading">Could not connect to AD4M</h1>
1769
- ${u?Q`
2393
+ ${u?L`
1770
2394
  <p style="color: #b9b9b9; font-size: 15px; text-align: center; margin: 30px 0;">
1771
2395
  Please make sure you have the ADAM Launcher running on your computer and there are no browser restrictions ("Shields") blocking your connection to ADAM on localhost.
1772
2396
  <br/>
1773
2397
  <br/>
1774
2398
  (Safari users: please use a different browser for now. Safari is very strict about this and we are working on a solution.)
1775
2399
  </p>
1776
- `:Q`
2400
+ `:L`
1777
2401
  <p style="color: #b9b9b9; font-size: 15px; text-align: center; margin: 30px 0;">
1778
2402
  Looks like the remote executor you are trying to connect to is not reachable.
1779
2403
  <br/>
@@ -1781,9 +2405,9 @@ input VoiceActivityParamsInput {
1781
2405
  Please try connecting to a different remote executor or check your connection settings.
1782
2406
  </p>
1783
2407
  `}
1784
- ${e?Q`<button class="button" @click=${()=>a()}>
2408
+ ${e?L`<button class="button" @click=${()=>a()}>
1785
2409
  Connect with QR
1786
- </button>`:Q`<a
2410
+ </button>`:L`<a
1787
2411
  class="button"
1788
2412
  target="_blank"
1789
2413
  @click=${c}
@@ -1792,8 +2416,8 @@ input VoiceActivityParamsInput {
1792
2416
  Download AD4M
1793
2417
  </a>
1794
2418
  `}
1795
- ${o?Q`<p>Or</p>`:""}
1796
- ${o?Q`<button class="button" @click=${()=>n("hosting")}>Use hosted AD4M (alpha)</button>`:""}
2419
+ ${o?L`<p>Or</p>`:""}
2420
+ ${o?L`<button class="button" @click=${()=>n("hosting")}>Use hosted AD4M (alpha)</button>`:""}
1797
2421
  </div>
1798
2422
 
1799
2423
  <div style="display: flex; flex-direction: column; align-items: center; gap: 20px; margin-top: -30px">
@@ -1817,7 +2441,7 @@ input VoiceActivityParamsInput {
1817
2441
  </a>
1818
2442
  </div>
1819
2443
  </div>
1820
- `}function mp({code:t,changeState:e,verifyCode:r,changeCode:n,isHosting:i,verifyCodeError:a}){return Q`
2444
+ `}function wp({code:t,changeState:e,verifyCode:r,changeCode:n,isHosting:i,verifyCodeError:a}){return L`
1821
2445
  <div class="items">
1822
2446
  <div class="text-center">
1823
2447
  <div class="heading">${i?"Please check your emails for the 2FA security code that was sent from the ADAM hosting service":"Please check your ADAM Launcher"}</div>
@@ -1835,7 +2459,7 @@ input VoiceActivityParamsInput {
1835
2459
  value=${t}
1836
2460
  @change=${o=>n(o.target.value)}
1837
2461
  />
1838
- ${a?Q`<p class="error">${a}</p>`:""}
2462
+ ${a?L`<p class="error">${a}</p>`:""}
1839
2463
  </div>
1840
2464
  <div class="buttons">
1841
2465
  <button
@@ -1849,7 +2473,7 @@ input VoiceActivityParamsInput {
1849
2473
  </button>
1850
2474
  </div>
1851
2475
  </div>
1852
- `}function k3(){return[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i].some(e=>navigator.userAgent.match(e))}var I3=bc`
2476
+ `}function D3(){return[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i].some(e=>navigator.userAgent.match(e))}var N3=Sc`
1853
2477
  :host {
1854
2478
  --primary-color: #fff;
1855
2479
  --heading-color: #fff;
@@ -2250,16 +2874,16 @@ input VoiceActivityParamsInput {
2250
2874
  width: 100vw;
2251
2875
  object-fit: cover;
2252
2876
  }
2253
- `,de=class extends Or{constructor(){super(...arguments);this._code=null;this._isMobile=null;this._hasClickedDownload=null;this._isRemote=!1;this._isOpen=!1;this._hostingStep=0;this._email="";this._passowrd="";this._passwordError=null;this._hostingNotRunningError=null;this._verifyCodeError=null;this._isHostingLoading=!1;this.uiState="start";this.appName=null;this.appDesc=null;this.appDomain=null;this.appIconPath=null;this.mobile=null;this.capabilities=[];this.hosting=pr("ad4mhosting")==="true"||!1;this.token=pr("ad4mToken")||"";this.port=parseInt(pr("ad4mport"))||kr;this.url=pr("ad4murl")||""}get authState(){return this._client.authState}get connectionState(){return this._client.connectionState}injectFont(){let r=document.createElement("link");r.setAttribute("rel","stylesheet"),r.setAttribute("href","https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200..800&display=swap"),document.head.appendChild(r)}connectedCallback(){super.connectedCallback(),mo(this),this.injectFont(),this._isMobile=k3(),this._client=new go({appName:this.appName,appDesc:this.appDesc,appDomain:this.appDomain,appUrl:window.location.origin,appIconPath:this.appIconPath,capabilities:Array.isArray(this.capabilities)?this.capabilities:JSON.parse(this.capabilities),port:this.port||parseInt(pr("ad4mport"))||kr,token:this.token||pr("ad4mtoken"),url:this.url||pr("ad4murl"),hosting:this.hosting}),this._client.on("configstatechange",this.handleConfigChange),this._client.on("authstatechange",this.handleAuthChange),this._client.on("connectionstatechange",this.handleConnectionChange),this.loadFont(),this._client.connect()}checkEmail(){return ge(this,null,function*(){try{(yield this._client.checkEmail(this._email))?this._hostingStep=1:this._hostingStep=2}catch(r){console.log(r)}})}loginToHosting(){return ge(this,null,function*(){try{yield this._client.loginToHosting(this._email,this._passowrd),this.changeUIState("connected")}catch(r){r.message.includes("Passwords did not match")?this._passwordError="Passwords did not match":this._hostingNotRunningError="Hosting is not running"}})}changeEmail(r){this._email=r}changePassword(r){this._passowrd=r}unlockAgent(r,n=!0){return ge(this,null,function*(){yield this._client.ad4mClient.agent.unlock(r,n)})}verifyCode(r){return ge(this,null,function*(){try{yield this._client.verifyCode(r)}catch(n){this._verifyCodeError="Invalid code"}})}changeUrl(r){r!==this._client.url&&(np("ad4mtoken"),this._client.setToken(null)),this._client.setUrl(r)}changePort(r){this._client.setPort(r)}changeUIState(r){this.uiState=r}setIsHostingRunning(r){this._hostingNotRunningError=r}changeIsRemote(r){this._isRemote=r}changeCode(r){this._code=r}onDownloaded(){this._hasClickedDownload=!0}handleAuthChange(r){let n=new CustomEvent("authstatechange",{detail:r});r==="locked"&&(this._isOpen=!0),r==="authenticated"&&(this._isOpen=!1),this.dispatchEvent(n),this.requestUpdate()}handleConfigChange(r,n){this[r]=n,n?gc("ad4m"+r,n):np("ad4m"+r),this.requestUpdate()}handleConnectionChange(r){if(r==="checking_local"){this._isOpen=!1;return}r==="connected"&&(this.authState!=="authenticated"?(this.changeUIState("requestcap"),this._isOpen=!0):(this.changeUIState("connected"),this._isOpen=!1)),r==="disconnected"&&(this._isOpen=!0),r==="not_connected"&&(this._isOpen=!0,this.changeUIState("start"));let n=new CustomEvent("connectionstatechange",{detail:r});this.dispatchEvent(n),this.requestUpdate()}loadFont(){let r=document.createElement("link");r.rel="stylesheet",r.type="text/css",r.crossOrigin="anonymous",r.href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap",document.head.appendChild(r)}startCamera(r){return ge(this,null,function*(){try{window.BarcodeDetector.getSupportedFormats()}catch(n){window.BarcodeDetector=Ar}yield this.changeUIState("qr"),setTimeout(()=>ge(this,null,function*(){let n=this.shadowRoot.querySelector("video");if(!n)return;let i=yield navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:"environment"}});n.srcObject=i,n.autoplay=!0}),100)})}connect(){return ge(this,null,function*(){this._isOpen=!0,this.requestUpdate();let r=yield this._client.connect();try{let n=yield r.agent.status();n.isUnlocked&&n.isInitialized&&window.location.reload()}catch(n){console.warn(n)}return r})}getAd4mClient(){return this._client.ad4mClient}connectRemote(r){return ge(this,null,function*(){try{this.changeUrl(r);let n=yield this._client.connect(r),i=yield n.agent.status();return i.isUnlocked&&i.isInitialized||this.changeUIState("requestcap"),n}catch(n){this.changeUIState("requestcap"),this._isOpen=!0}})}requestCapability(r){return ge(this,null,function*(){try{yield this._client.requestCapability(r),this.changeUIState("verifycode")}catch(n){console.warn(n)}})}isAuthenticated(){return ge(this,null,function*(){return this._client.checkAuth()})}setOpen(r){this._isOpen=r}setHostingStep(r){this._hostingStep=r}clearState(){this.handleConfigChange("port",null),this.handleConfigChange("url",null),this.handleConfigChange("token",null),this.handleConnectionChange("not_connected"),this.handleAuthChange("unauthenticated"),this.changeUIState("start"),this._client.clearState()}renderViews(){if(this.connectionState==="connecting")return up();if(this.uiState==="hosting")return cp({email:this._email,password:this._passowrd,changeEmail:this.changeEmail,changePassword:this.changePassword,changeState:this.changeUIState,step:this._hostingStep,setHostingStep:this.setHostingStep,login:this.loginToHosting,checkEmail:this.checkEmail,passwordError:this._passwordError,isHostingRunning:this._hostingNotRunningError,setIsHostingRunning:this.setIsHostingRunning});if(this.uiState==="qr")return fp({changeState:this.changeUIState,onSuccess:r=>{this.changeUrl(r),this._client.connect(r)},uiState:this.uiState});if(this.authState==="locked")return ip({unlockAgent:this.unlockAgent,reconnect:this.connect});if(this.uiState==="settings")return dp({port:this.port,changePort:this.changePort,isRemote:this._isRemote,changeIsRemote:this.changeIsRemote,url:this.url,changeState:this.changeUIState,changeUrl:this.changeUrl,connectToPort:this._client.connectToPort,connectRemote:this.connectRemote,clearState:this.clearState});if(this.connectionState==="not_connected")return hp({scanQrcode:this.startCamera,connect:this.connect,isMobile:this._isMobile,hasClickedDownload:this._hasClickedDownload,onDownloaded:this.onDownloaded,changeState:this.changeUIState,hosting:this.hosting});if(this.connectionState==="connected")return this.uiState==="verifycode"?mp({code:this._code,changeCode:this.changeCode,changeState:this.changeUIState,verifyCode:this.verifyCode,isHosting:this._client.isHosting,verifyCodeError:this._verifyCodeError}):pp({changeState:this.changeUIState,requestCapability:this.requestCapability,capabilities:this.capabilities,appname:this.appName,setOpen:this.setOpen,appiconpath:this.appIconPath});if(this.connectionState==="disconnected")return op({reconnect:this.connect});if(this.connectionState==="port_not_found")return ap()}mobileView(){return this.mobile?lp({openModal:()=>{this.changeUIState("settings"),this._isOpen=!this._isOpen}}):null}render(){return console.log(this.authState,this.connectionState,this.uiState,this._isOpen),this._isOpen===!1?this.authState==="authenticated"?this.mobileView():null:Q`
2877
+ `,Z=class extends Or{constructor(){super(...arguments);this._code=null;this._isMobile=null;this._hasClickedDownload=null;this._isRemote=!1;this._isOpen=!1;this._hostingStep=0;this._email="";this._passowrd="";this._passwordError=null;this._hostingNotRunningError=null;this._verifyCodeError=null;this._isHostingLoading=!1;this._multiUserEmail="";this._multiUserPassword="";this._multiUserError=null;this._multiUserLoading=!1;this._multiUserTab="login";this._localDetected=!1;this._remoteUrl="";this._remoteMultiUserDetected=null;this._remoteDetecting=!1;this._remoteError=null;this.uiState="connection_overview";this.appName=null;this.appDesc=null;this.appDomain=null;this.appIconPath=null;this.mobile=null;this.capabilities=[];this.hosting=Wt("ad4mhosting")==="true"||!1;this.token=Wt("ad4mToken")||"";this.port=parseInt(Wt("ad4mport"))||kr;this.url=Wt("ad4murl")||"";this.multiUser=!1;this.backendUrl=""}get authState(){return this._client.authState}get connectionState(){return this._client.connectionState}injectFont(){let r=document.createElement("link");r.setAttribute("rel","stylesheet"),r.setAttribute("href","https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200..800&display=swap"),document.head.appendChild(r)}connectedCallback(){super.connectedCallback(),wo(this),this.injectFont(),this._isMobile=D3(),this._client=new So({appName:this.appName,appDesc:this.appDesc,appDomain:this.appDomain,appUrl:window.location.origin,appIconPath:this.appIconPath,capabilities:Array.isArray(this.capabilities)?this.capabilities:JSON.parse(this.capabilities),port:this.port||parseInt(Wt("ad4mport"))||kr,token:this.token||Wt("ad4mtoken"),url:this.url||Wt("ad4murl"),hosting:this.hosting}),this._client.on("configstatechange",this.handleConfigChange),this._client.on("authstatechange",this.handleAuthChange),this._client.on("connectionstatechange",this.handleConnectionChange),this.loadFont(),this.token||Wt("ad4mtoken")?this._client.connect():(this.detectLocal(),this.changeUIState("connection_overview"),this._isOpen=!0)}checkEmail(){return ee(this,null,function*(){try{(yield this._client.checkEmail(this._email))?this._hostingStep=1:this._hostingStep=2}catch(r){console.log(r)}})}handleMultiUserSignup(){return ee(this,null,function*(){try{this._multiUserLoading=!0,this._multiUserError=null,this._client.options.userEmail=this._multiUserEmail,this._client.options.userPassword=this._multiUserPassword,this._client.options.backendUrl=this.backendUrl;let r=yield this._client.connectMultiUser();this._multiUserEmail="",this._multiUserPassword="",this._isOpen=!1,this.changeUIState("connected")}catch(r){this._multiUserError=r.message||"Failed to create account. Please try again."}finally{this._multiUserLoading=!1}})}handleMultiUserLogin(){return ee(this,null,function*(){try{this._multiUserLoading=!0,this._multiUserError=null,this._client.options.userEmail=this._multiUserEmail,this._client.options.userPassword=this._multiUserPassword,this._client.options.backendUrl=this.backendUrl;let r=yield this._client.connectMultiUser();this._multiUserEmail="",this._multiUserPassword="",this._isOpen=!1,this.changeUIState("connected")}catch(r){this._multiUserError=r.message||"Failed to log in. Please check your credentials."}finally{this._multiUserLoading=!1}})}changeMultiUserEmail(r){this._multiUserEmail=r,this._multiUserError=null}changeMultiUserPassword(r){this._multiUserPassword=r,this._multiUserError=null}setMultiUserTab(r){this._multiUserTab=r,this._multiUserError=null}detectLocal(){return ee(this,null,function*(){try{yield ti(`ws://localhost:${this.port}/graphql`,3e3),this._localDetected=!0}catch(r){console.log("[Ad4m Connect] Local detection failed:",r),this._localDetected=!1}})}detectRemoteMultiUser(r){return ee(this,null,function*(){try{console.log("[Ad4m Connect] Detecting multi-user mode for URL:",r);let n=this._client.buildTempClient(r);console.log("[Ad4m Connect] Temp client:",n);let i=yield n.runtime.multiUserEnabled();return console.log("[Ad4m Connect] Multi-user detection result:",i),i}catch(n){return console.error("[Ad4m Connect] Failed to detect multi-user mode:",n),console.error("[Ad4m Connect] Error details:",n.message,n.stack),!1}})}handleConnectLocal(){return ee(this,null,function*(){try{this.changeUIState("requestcap"),yield this._client.connect()}catch(r){console.error("Failed to connect to local AD4M:",r),this.changeUIState("connection_overview")}})}handleShowRemoteConnection(){this._remoteUrl=this.backendUrl||this.url||"",this._remoteMultiUserDetected=null,this._remoteError=null,this.changeUIState("remote_connection")}handleRemoteUrlChange(r){this._remoteUrl=r,this._remoteError=null}handleRemoteConnect(){return ee(this,null,function*(){if(!this._remoteUrl){this._remoteError="Please enter a URL";return}this._remoteDetecting=!0,this._remoteError=null;try{let r=yield this.detectRemoteMultiUser(this._remoteUrl);this._remoteMultiUserDetected=r,this._remoteDetecting=!1}catch(r){this._remoteError=r.message||"Failed to connect to remote executor",this._remoteDetecting=!1}})}handleRemoteMultiUserAuth(){return ee(this,null,function*(){this.backendUrl=this._remoteUrl,this.changeUIState("multiuser_auth")})}handleRemoteRequestCapability(){return ee(this,null,function*(){try{this.changeUIState("requestcap"),yield this._client.connect(this._remoteUrl)}catch(r){this._remoteError=r.message||"Failed to connect",this.changeUIState("remote_connection")}})}loginToHosting(){return ee(this,null,function*(){try{yield this._client.loginToHosting(this._email,this._passowrd),this.changeUIState("connected")}catch(r){r.message.includes("Passwords did not match")?this._passwordError="Passwords did not match":this._hostingNotRunningError="Hosting is not running"}})}changeEmail(r){this._email=r}changePassword(r){this._passowrd=r}unlockAgent(r,n=!0){return ee(this,null,function*(){yield this._client.ad4mClient.agent.unlock(r,n)})}verifyCode(r){return ee(this,null,function*(){try{yield this._client.verifyCode(r)}catch(n){this._verifyCodeError="Invalid code"}})}changeUrl(r){r!==this._client.url&&(op("ad4mtoken"),this._client.setToken(null)),this._client.setUrl(r)}changePort(r){this._client.setPort(r)}changeUIState(r){this.uiState=r}setIsHostingRunning(r){this._hostingNotRunningError=r}changeIsRemote(r){this._isRemote=r}changeCode(r){this._code=r}onDownloaded(){this._hasClickedDownload=!0}handleAuthChange(r){let n=new CustomEvent("authstatechange",{detail:r});r==="locked"&&(this._isOpen=!0),r==="authenticated"&&(this._isOpen=!1),this.dispatchEvent(n),this.requestUpdate()}handleConfigChange(r,n){this[r]=n,n?bc("ad4m"+r,n):op("ad4m"+r),this.requestUpdate()}handleConnectionChange(r){if(r==="checking_local"){this._isOpen=!1;return}r==="connected"&&(this.authState!=="authenticated"?(this.changeUIState("requestcap"),this._isOpen=!0):(this.changeUIState("connected"),this._isOpen=!1)),r==="disconnected"&&(this._isOpen=!0),r==="not_connected"&&(this._isOpen=!0,this.multiUser&&this.backendUrl?this.changeUIState("multiuser_auth"):this.changeUIState("start"));let n=new CustomEvent("connectionstatechange",{detail:r});this.dispatchEvent(n),this.requestUpdate()}loadFont(){let r=document.createElement("link");r.rel="stylesheet",r.type="text/css",r.crossOrigin="anonymous",r.href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap",document.head.appendChild(r)}startCamera(r){return ee(this,null,function*(){try{window.BarcodeDetector.getSupportedFormats()}catch(n){window.BarcodeDetector=Ir}yield this.changeUIState("qr"),setTimeout(()=>ee(this,null,function*(){let n=this.shadowRoot.querySelector("video");if(!n)return;let i=yield navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:"environment"}});n.srcObject=i,n.autoplay=!0}),100)})}connect(){return ee(this,null,function*(){this._isOpen=!0,this.requestUpdate();let r=yield this._client.connect();try{let n=yield r.agent.status();n.isUnlocked&&n.isInitialized&&window.location.reload()}catch(n){console.warn(n)}return r})}getAd4mClient(){return this._client.ad4mClient}connectRemote(r){return ee(this,null,function*(){try{this.changeUrl(r);let n=yield this._client.connect(r),i=yield n.agent.status();return i.isUnlocked&&i.isInitialized||this.changeUIState("requestcap"),n}catch(n){this.changeUIState("requestcap"),this._isOpen=!0}})}requestCapability(r){return ee(this,null,function*(){try{yield this._client.requestCapability(r),this.changeUIState("verifycode")}catch(n){console.warn(n)}})}isAuthenticated(){return ee(this,null,function*(){return this._client.checkAuth()})}setOpen(r){this._isOpen=r}setHostingStep(r){this._hostingStep=r}clearState(){this.handleConfigChange("port",null),this.handleConfigChange("url",null),this.handleConfigChange("token",null),this.handleConnectionChange("not_connected"),this.handleAuthChange("unauthenticated"),this.changeUIState("start"),this._client.clearState()}renderViews(){if(this.connectionState==="connecting")return dp();if(this.uiState==="connection_overview")return cp({localDetected:this._localDetected,multiUserConfigured:this.multiUser&&!!this.backendUrl,backendUrl:this.backendUrl,configuredUrl:this.url,isMobile:this._isMobile,onConnectLocal:this.handleConnectLocal,onConnectRemote:this.handleShowRemoteConnection,onScanQR:()=>{this.startCamera(null)},onDownloadAd4m:()=>{window.open("https://github.com/coasys/ad4m/releases")}});if(this.uiState==="remote_connection")return gp({initialUrl:this._remoteUrl,detecting:this._remoteDetecting,multiUserDetected:this._remoteMultiUserDetected,error:this._remoteError,onBack:()=>this.changeUIState("connection_overview"),onUrlChange:this.handleRemoteUrlChange,onConnect:this.handleRemoteConnect,onMultiUserAuth:this.handleRemoteMultiUserAuth,onRequestCapability:this.handleRemoteRequestCapability});if(this.uiState==="multiuser_auth")return mp({email:this._multiUserEmail,password:this._multiUserPassword,error:this._multiUserError,isLoading:this._multiUserLoading,backendUrl:this.backendUrl,changeEmail:this.changeMultiUserEmail,changePassword:this.changeMultiUserPassword,onLogin:this.handleMultiUserLogin,onSignup:this.handleMultiUserSignup,activeTab:this._multiUserTab,setActiveTab:this.setMultiUserTab});if(this.uiState==="hosting")return fp({email:this._email,password:this._passowrd,changeEmail:this.changeEmail,changePassword:this.changePassword,changeState:this.changeUIState,step:this._hostingStep,setHostingStep:this.setHostingStep,login:this.loginToHosting,checkEmail:this.checkEmail,passwordError:this._passwordError,isHostingRunning:this._hostingNotRunningError,setIsHostingRunning:this.setIsHostingRunning});if(this.uiState==="qr")return vp({changeState:this.changeUIState,onSuccess:r=>{this.changeUrl(r),this._client.connect(r)},uiState:this.uiState});if(this.authState==="locked")return sp({unlockAgent:this.unlockAgent,reconnect:this.connect});if(this.uiState==="settings")return bp({port:this.port,changePort:this.changePort,isRemote:this._isRemote,changeIsRemote:this.changeIsRemote,url:this.url,changeState:this.changeUIState,changeUrl:this.changeUrl,connectToPort:this._client.connectToPort,connectRemote:this.connectRemote,clearState:this.clearState});if(this.connectionState==="not_connected")return _p({scanQrcode:this.startCamera,connect:this.connect,isMobile:this._isMobile,hasClickedDownload:this._hasClickedDownload,onDownloaded:this.onDownloaded,changeState:this.changeUIState,hosting:this.hosting});if(this.connectionState==="connected")return this.uiState==="verifycode"?wp({code:this._code,changeCode:this.changeCode,changeState:this.changeUIState,verifyCode:this.verifyCode,isHosting:this._client.isHosting,verifyCodeError:this._verifyCodeError}):yp({changeState:this.changeUIState,requestCapability:this.requestCapability,capabilities:this.capabilities,appname:this.appName,setOpen:this.setOpen,appiconpath:this.appIconPath});if(this.connectionState==="disconnected")return lp({reconnect:this.connect});if(this.connectionState==="port_not_found")return up()}mobileView(){return this.mobile?hp({openModal:()=>{this.changeUIState("settings"),this._isOpen=!this._isOpen}}):null}render(){return console.log(this.authState,this.connectionState,this.uiState,this._isOpen),this._isOpen===!1?this.authState==="authenticated"?this.mobileView():null:L`
2254
2878
  <div class="wrapper">
2255
2879
  <div class="dialog">
2256
- ${sp()}
2880
+ ${pp()}
2257
2881
  <main class="dialog__content">${this.renderViews()}</main>
2258
2882
  ${this.mobileView()}
2259
2883
  </div>
2260
2884
  <div class="ad4mConnect__backdrop" />
2261
2885
  </div>
2262
- `}};de.styles=[I3],Ce([ot()],de.prototype,"_code",2),Ce([ot()],de.prototype,"_isMobile",2),Ce([ot()],de.prototype,"_hasClickedDownload",2),Ce([ot()],de.prototype,"_isRemote",2),Ce([ot()],de.prototype,"_client",2),Ce([ot()],de.prototype,"_isOpen",2),Ce([ot()],de.prototype,"_hostingStep",2),Ce([ot()],de.prototype,"_email",2),Ce([ot()],de.prototype,"_passowrd",2),Ce([ot()],de.prototype,"_passwordError",2),Ce([ot()],de.prototype,"_hostingNotRunningError",2),Ce([ot()],de.prototype,"_verifyCodeError",2),Ce([ot()],de.prototype,"_isHostingLoading",2),Ce([ot()],de.prototype,"uiState",2),Ce([St({type:String,reflect:!0})],de.prototype,"appName",2),Ce([St({type:String,reflect:!0})],de.prototype,"appDesc",2),Ce([St({type:String,reflect:!0})],de.prototype,"appDomain",2),Ce([St({type:String,reflect:!0})],de.prototype,"appIconPath",2),Ce([St({type:Boolean,reflect:!0})],de.prototype,"mobile",2),Ce([St({type:String,reflect:!0})],de.prototype,"capabilities",2),Ce([St({type:Boolean,reflect:!0})],de.prototype,"hosting",2),Ce([St({type:String})],de.prototype,"token",2),Ce([St({type:String,reflect:!0})],de.prototype,"port",2),Ce([St({type:String,reflect:!0})],de.prototype,"url",2),de=Ce([Fp("ad4m-connect")],de);function A3(t){let e=new de;return Object.entries(t).forEach(([r,n])=>{e[r]=n}),document.body.appendChild(e),e}export{de as Ad4mConnectElement,A3 as default,x3 as getAd4mClient};
2886
+ `}};Z.styles=[N3],X([xe()],Z.prototype,"_code",2),X([xe()],Z.prototype,"_isMobile",2),X([xe()],Z.prototype,"_hasClickedDownload",2),X([xe()],Z.prototype,"_isRemote",2),X([xe()],Z.prototype,"_client",2),X([xe()],Z.prototype,"_isOpen",2),X([xe()],Z.prototype,"_hostingStep",2),X([xe()],Z.prototype,"_email",2),X([xe()],Z.prototype,"_passowrd",2),X([xe()],Z.prototype,"_passwordError",2),X([xe()],Z.prototype,"_hostingNotRunningError",2),X([xe()],Z.prototype,"_verifyCodeError",2),X([xe()],Z.prototype,"_isHostingLoading",2),X([xe()],Z.prototype,"_multiUserEmail",2),X([xe()],Z.prototype,"_multiUserPassword",2),X([xe()],Z.prototype,"_multiUserError",2),X([xe()],Z.prototype,"_multiUserLoading",2),X([xe()],Z.prototype,"_multiUserTab",2),X([xe()],Z.prototype,"_localDetected",2),X([xe()],Z.prototype,"_remoteUrl",2),X([xe()],Z.prototype,"_remoteMultiUserDetected",2),X([xe()],Z.prototype,"_remoteDetecting",2),X([xe()],Z.prototype,"_remoteError",2),X([xe()],Z.prototype,"uiState",2),X([st({type:String,reflect:!0})],Z.prototype,"appName",2),X([st({type:String,reflect:!0})],Z.prototype,"appDesc",2),X([st({type:String,reflect:!0})],Z.prototype,"appDomain",2),X([st({type:String,reflect:!0})],Z.prototype,"appIconPath",2),X([st({type:Boolean,reflect:!0})],Z.prototype,"mobile",2),X([st({type:String,reflect:!0})],Z.prototype,"capabilities",2),X([st({type:Boolean,reflect:!0})],Z.prototype,"hosting",2),X([st({type:String})],Z.prototype,"token",2),X([st({type:String,reflect:!0})],Z.prototype,"port",2),X([st({type:String,reflect:!0})],Z.prototype,"url",2),X([st({type:Boolean,reflect:!0})],Z.prototype,"multiUser",2),X([st({type:String,reflect:!0})],Z.prototype,"backendUrl",2),Z=X([Vp("ad4m-connect")],Z);function P3(t){let e=new Z;return Object.entries(t).forEach(([r,n])=>{e[r]=n}),document.body.appendChild(e),e}export{Z as Ad4mConnectElement,P3 as default,T3 as getAd4mClient};
2263
2887
  /*!
2264
2888
  * @undecaf/barcode-detector-polyfill v0.9.20
2265
2889
  * A WebAssembly polyfill for the Barcode Detection API