@coasys/ad4m-connect 0.8.0-fix → 0.8.0

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 Af=Object.defineProperty;var If=Object.getOwnPropertyDescriptor;var Pe=(r,e,t,n)=>{for(var i=n>1?void 0:n?If(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&Af(e,t,i),i};var ye=(r,e,t)=>new Promise((n,i)=>{var a=u=>{try{s(t.next(u))}catch(l){i(l)}},o=u=>{try{s(t.throw(u))}catch(l){i(l)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(a,o);s((t=t.apply(r,e)).next())});var Ai=window,Ii=Ai.ShadowRoot&&(Ai.ShadyCSS===void 0||Ai.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,to=Symbol(),Sc=new WeakMap,Dn=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==to)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(Ii&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=Sc.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Sc.set(t,e))}return e}toString(){return this.cssText}},wc=r=>new Dn(typeof r=="string"?r:r+"",void 0,to),ro=(r,...e)=>{let t=r.length===1?r[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)+r[a+1],r[0]);return new Dn(t,r,to)},no=(r,e)=>{Ii?r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet):e.forEach(t=>{let n=document.createElement("style"),i=Ai.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=t.cssText,r.appendChild(n)})},ki=Ii?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(let n of e.cssRules)t+=n.cssText;return wc(t)})(r):r;var io,Di=window,_c=Di.trustedTypes,kf=_c?_c.emptyScript:"",Ec=Di.reactiveElementPolyfillSupport,oo={toAttribute(r,e){switch(e){case Boolean:r=r?kf:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},xc=(r,e)=>e!==r&&(e==e||r==r),ao={attribute:!0,type:String,converter:oo,reflect:!1,hasChanged:xc},so="finalized",kt=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var t;this.finalize(),((t=this.h)!==null&&t!==void 0?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();let e=[];return this.elementProperties.forEach((t,n)=>{let i=this._$Ep(n,t);i!==void 0&&(this._$Ev.set(i,n),e.push(i))}),e}static createProperty(e,t=ao){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){let n=typeof e=="symbol"?Symbol():"__"+e,i=this.getPropertyDescriptor(e,n,t);i!==void 0&&Object.defineProperty(this.prototype,e,i)}}static getPropertyDescriptor(e,t,n){return{get(){return this[t]},set(i){let a=this[e];this[t]=i,this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||ao}static finalize(){if(this.hasOwnProperty(so))return!1;this[so]=!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 t=this.properties,n=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(let i of n)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let i of n)t.unshift(ki(i))}else e!==void 0&&t.push(ki(e));return t}static _$Ep(e,t){let n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(t=>t(this))}addController(e){var t,n;((t=this._$ES)!==null&&t!==void 0?t:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((n=e.hostConnected)===null||n===void 0||n.call(e))}removeController(e){var t;(t=this._$ES)===null||t===void 0||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])})}createRenderRoot(){var e;let t=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return no(t,this.constructor.elementStyles),t}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(t=>{var n;return(n=t.hostConnected)===null||n===void 0?void 0:n.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(t=>{var n;return(n=t.hostDisconnected)===null||n===void 0?void 0:n.call(t)})}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$EO(e,t,n=ao){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:oo).toAttribute(t,n.type);this._$El=e,o==null?this.removeAttribute(a):this.setAttribute(a,o),this._$El=null}}_$AK(e,t){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:oo;this._$El=a,this[a]=s.fromAttribute(t,o.type),this._$El=null}}requestUpdate(e,t,n){let i=!0;e!==void 0&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||xc)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),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(t){Promise.reject(t)}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 t=!1,n=this._$AL;try{t=this.shouldUpdate(n),t?(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 t=!1,this._$Ek(),i}t&&this._$AE(n)}willUpdate(e){}_$AE(e){var t;(t=this._$ES)===null||t===void 0||t.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((t,n)=>this._$EO(n,this[n],t)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};kt[so]=!0,kt.elementProperties=new Map,kt.elementStyles=[],kt.shadowRootOptions={mode:"open"},Ec?.({ReactiveElement:kt}),((io=Di.reactiveElementVersions)!==null&&io!==void 0?io:Di.reactiveElementVersions=[]).push("1.6.3");var co,Ni=window,Hr=Ni.trustedTypes,Oc=Hr?Hr.createPolicy("lit-html",{createHTML:r=>r}):void 0,lo="$lit$",qt=`lit$${(Math.random()+"").slice(9)}$`,Pc="?"+qt,Df=`<${Pc}>`,dr=document,Pn=()=>dr.createComment(""),Rn=r=>r===null||typeof r!="object"&&typeof r!="function",Rc=Array.isArray,Nf=r=>Rc(r)||typeof r?.[Symbol.iterator]=="function",uo=`[
2
- \f\r]`,Nn=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Tc=/-->/g,Ac=/>/g,fr=RegExp(`>|${uo}(?:([^\\s"'>=/]+)(${uo}*=${uo}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Ic=/'/g,kc=/"/g,Lc=/^(?:script|style|textarea|title)$/i,Fc=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),Y=Fc(1),th=Fc(2),hr=Symbol.for("lit-noChange"),Ae=Symbol.for("lit-nothing"),Dc=new WeakMap,pr=dr.createTreeWalker(dr,129,null,!1);function $c(r,e){if(!Array.isArray(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Oc!==void 0?Oc.createHTML(e):e}var Pf=(r,e)=>{let t=r.length-1,n=[],i,a=e===2?"<svg>":"",o=Nn;for(let s=0;s<t;s++){let u=r[s],l,f,p=-1,h=0;for(;h<u.length&&(o.lastIndex=h,f=o.exec(u),f!==null);)h=o.lastIndex,o===Nn?f[1]==="!--"?o=Tc:f[1]!==void 0?o=Ac:f[2]!==void 0?(Lc.test(f[2])&&(i=RegExp("</"+f[2],"g")),o=fr):f[3]!==void 0&&(o=fr):o===fr?f[0]===">"?(o=i??Nn,p=-1):f[1]===void 0?p=-2:(p=o.lastIndex-f[2].length,l=f[1],o=f[3]===void 0?fr:f[3]==='"'?kc:Ic):o===kc||o===Ic?o=fr:o===Tc||o===Ac?o=Nn:(o=fr,i=void 0);let d=o===fr&&r[s+1].startsWith("/>")?" ":"";a+=o===Nn?u+Df:p>=0?(n.push(l),u.slice(0,p)+lo+u.slice(p)+qt+d):u+qt+(p===-2?(n.push(void 0),s):d)}return[$c(r,a+(r[t]||"<?>")+(e===2?"</svg>":"")),n]},mr=class{constructor({strings:e,_$litType$:t},n){let i;this.parts=[];let a=0,o=0,s=e.length-1,u=this.parts,[l,f]=Pf(e,t);if(this.el=mr.createElement(l,n),pr.currentNode=this.el.content,t===2){let p=this.el.content,h=p.firstChild;h.remove(),p.append(...h.childNodes)}for(;(i=pr.nextNode())!==null&&u.length<s;){if(i.nodeType===1){if(i.hasAttributes()){let p=[];for(let h of i.getAttributeNames())if(h.endsWith(lo)||h.startsWith(qt)){let d=f[o++];if(p.push(h),d!==void 0){let y=i.getAttribute(d.toLowerCase()+lo).split(qt),g=/([.?@])?(.*)/.exec(d);u.push({type:1,index:a,name:g[2],strings:y,ctor:g[1]==="."?po:g[1]==="?"?ho:g[1]==="@"?mo:Yr})}else u.push({type:6,index:a})}for(let h of p)i.removeAttribute(h)}if(Lc.test(i.tagName)){let p=i.textContent.split(qt),h=p.length-1;if(h>0){i.textContent=Hr?Hr.emptyScript:"";for(let d=0;d<h;d++)i.append(p[d],Pn()),pr.nextNode(),u.push({type:2,index:++a});i.append(p[h],Pn())}}}else if(i.nodeType===8)if(i.data===Pc)u.push({type:2,index:a});else{let p=-1;for(;(p=i.data.indexOf(qt,p+1))!==-1;)u.push({type:7,index:a}),p+=qt.length-1}a++}}static createElement(e,t){let n=dr.createElement("template");return n.innerHTML=e,n}};function Jr(r,e,t=r,n){var i,a,o,s;if(e===hr)return e;let u=n!==void 0?(i=t._$Co)===null||i===void 0?void 0:i[n]:t._$Cl,l=Rn(e)?void 0:e._$litDirective$;return u?.constructor!==l&&((a=u?._$AO)===null||a===void 0||a.call(u,!1),l===void 0?u=void 0:(u=new l(r),u._$AT(r,t,n)),n!==void 0?((o=(s=t)._$Co)!==null&&o!==void 0?o:s._$Co=[])[n]=u:t._$Cl=u),u!==void 0&&(e=Jr(r,u._$AS(r,e.values),u,n)),e}var fo=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var t;let{el:{content:n},parts:i}=this._$AD,a=((t=e?.creationScope)!==null&&t!==void 0?t:dr).importNode(n,!0);pr.currentNode=a;let o=pr.nextNode(),s=0,u=0,l=i[0];for(;l!==void 0;){if(s===l.index){let f;l.type===2?f=new yr(o,o.nextSibling,this,e):l.type===1?f=new l.ctor(o,l.name,l.strings,this,e):l.type===6&&(f=new yo(o,this,e)),this._$AV.push(f),l=i[++u]}s!==l?.index&&(o=pr.nextNode(),s++)}return pr.currentNode=dr,a}v(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}},yr=class{constructor(e,t,n,i){var a;this.type=2,this._$AH=Ae,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=i,this._$Cp=(a=i?.isConnected)===null||a===void 0||a}get _$AU(){var e,t;return(t=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&t!==void 0?t:this._$Cp}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Jr(this,e,t),Rn(e)?e===Ae||e==null||e===""?(this._$AH!==Ae&&this._$AR(),this._$AH=Ae):e!==this._$AH&&e!==hr&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):Nf(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!==Ae&&Rn(this._$AH)?this._$AA.nextSibling.data=e:this.$(dr.createTextNode(e)),this._$AH=e}g(e){var t;let{values:n,_$litType$:i}=e,a=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=mr.createElement($c(i.h,i.h[0]),this.options)),i);if(((t=this._$AH)===null||t===void 0?void 0:t._$AD)===a)this._$AH.v(n);else{let o=new fo(a,this),s=o.u(this.options);o.v(n),this.$(s),this._$AH=o}}_$AC(e){let t=Dc.get(e.strings);return t===void 0&&Dc.set(e.strings,t=new mr(e)),t}T(e){Rc(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,n,i=0;for(let a of e)i===t.length?t.push(n=new yr(this.k(Pn()),this.k(Pn()),this,this.options)):n=t[i],n._$AI(a),i++;i<t.length&&(this._$AR(n&&n._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){var n;for((n=this._$AP)===null||n===void 0||n.call(this,!1,!0,t);e&&e!==this._$AB;){let i=e.nextSibling;e.remove(),e=i}}setConnected(e){var t;this._$AM===void 0&&(this._$Cp=e,(t=this._$AP)===null||t===void 0||t.call(this,e))}},Yr=class{constructor(e,t,n,i,a){this.type=1,this._$AH=Ae,this._$AN=void 0,this.element=e,this.name=t,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=Ae}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,n,i){let a=this.strings,o=!1;if(a===void 0)e=Jr(this,e,t,0),o=!Rn(e)||e!==this._$AH&&e!==hr,o&&(this._$AH=e);else{let s=e,u,l;for(e=a[0],u=0;u<a.length-1;u++)l=Jr(this,s[n+u],t,u),l===hr&&(l=this._$AH[u]),o||(o=!Rn(l)||l!==this._$AH[u]),l===Ae?e=Ae:e!==Ae&&(e+=(l??"")+a[u+1]),this._$AH[u]=l}o&&!i&&this.j(e)}j(e){e===Ae?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},po=class extends Yr{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Ae?void 0:e}},Rf=Hr?Hr.emptyScript:"",ho=class extends Yr{constructor(){super(...arguments),this.type=4}j(e){e&&e!==Ae?this.element.setAttribute(this.name,Rf):this.element.removeAttribute(this.name)}},mo=class extends Yr{constructor(e,t,n,i,a){super(e,t,n,i,a),this.type=5}_$AI(e,t=this){var n;if((e=(n=Jr(this,e,t,0))!==null&&n!==void 0?n:Ae)===hr)return;let i=this._$AH,a=e===Ae&&i!==Ae||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,o=e!==Ae&&(i===Ae||a);a&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,n;typeof this._$AH=="function"?this._$AH.call((n=(t=this.options)===null||t===void 0?void 0:t.host)!==null&&n!==void 0?n:this.element,e):this._$AH.handleEvent(e)}},yo=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){Jr(this,e)}};var Nc=Ni.litHtmlPolyfillSupport;Nc?.(mr,yr),((co=Ni.litHtmlVersions)!==null&&co!==void 0?co:Ni.litHtmlVersions=[]).push("2.8.0");var Mc=(r,e,t)=>{var n,i;let a=(n=t?.renderBefore)!==null&&n!==void 0?n:e,o=a._$litPart$;if(o===void 0){let s=(i=t?.renderBefore)!==null&&i!==void 0?i:null;a._$litPart$=o=new yr(e.insertBefore(Pn(),s),s,void 0,t??{})}return o._$AI(r),o};var go,vo;var Bt=class extends kt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;let n=super.createRenderRoot();return(e=(t=this.renderOptions).renderBefore)!==null&&e!==void 0||(t.renderBefore=n.firstChild),n}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Mc(t,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 hr}};Bt.finalized=!0,Bt._$litElement$=!0,(go=globalThis.litElementHydrateSupport)===null||go===void 0||go.call(globalThis,{LitElement:Bt});var jc=globalThis.litElementPolyfillSupport;jc?.({LitElement:Bt});((vo=globalThis.litElementVersions)!==null&&vo!==void 0?vo:globalThis.litElementVersions=[]).push("3.3.3");var Uc=r=>e=>typeof e=="function"?((t,n)=>(customElements.define(t,n),n))(r,e):((t,n)=>{let{kind:i,elements:a}=n;return{kind:i,elements:a,finisher(o){customElements.define(t,o)}}})(r,e);var Lf=(r,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(t){t.createProperty(e.key,r)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(t){t.createProperty(e.key,r)}},Ff=(r,e,t)=>{e.constructor.createProperty(t,r)};function ft(r){return(e,t)=>t!==void 0?Ff(r,e,t):Lf(r,e)}function Vt(r){return ft({...r,state:!0})}var bo,Ah=((bo=window.HTMLSlotElement)===null||bo===void 0?void 0:bo.prototype.assignedElements)!=null?(r,e)=>r.assignedElements(e):(r,e)=>r.assignedNodes(e).filter(t=>t.nodeType===Node.ELEMENT_NODE);import{ZBarSymbolType as X,ZBarConfigType as Bc,scanRGBABuffer as $f,getDefaultScanner as Mf}from"https://cdn.jsdelivr.net/npm/@undecaf/zbar-wasm@0.9.15/dist/main.js";function jf(r,e,t,n){return new(t||(t=Promise))(function(i,a){function o(l){try{u(n.next(l))}catch(f){a(f)}}function s(l){try{u(n.throw(l))}catch(f){a(f)}}function u(l){var f;l.done?i(l.value):(f=l.value,f instanceof t?f:new t(function(p){p(f)})).then(o,s)}u((n=n.apply(r,e||[])).next())})}var D=class{constructor(e,t=Bc.ZBAR_CFG_ENABLE,n=1){this.symbolType=e,this.configType=t,this.number=n,this.configSteps=[this]}static register(e,t,n=t.symbolType){return D.formatsToConfigs[e]=t,D.typesToFormats[n]=D.typesToFormats[n]||e,t}static formats(){return Object.keys(D.formatsToConfigs)}static toFormat(e){return D.typesToFormats[e]}static configure(e,t){var n;(n=D.formatsToConfigs[t])===null||n===void 0||n.configSteps.forEach(i=>e.setConfig(i.symbolType,i.configType,i.number))}add(e){return this.configSteps.push(e),this}},qc;D.formatsToConfigs={},D.typesToFormats={},D.register("codabar",new D(X.ZBAR_CODABAR)),D.register("code_39",new D(X.ZBAR_CODE39)),D.register("code_93",new D(X.ZBAR_CODE93)),D.register("code_128",new D(X.ZBAR_CODE128)),D.register("databar",new D(X.ZBAR_DATABAR)),D.register("databar_exp",new D(X.ZBAR_DATABAR_EXP)),D.register("ean_2",new D(X.ZBAR_EAN2)),D.register("ean_5",new D(X.ZBAR_EAN5)),D.register("ean_8",new D(X.ZBAR_EAN8)),D.register("ean_13",new D(X.ZBAR_EAN13)),D.register("ean_13+2",new D(X.ZBAR_EAN13)).add(new D(X.ZBAR_EAN2)),D.register("ean_13+5",new D(X.ZBAR_EAN13)).add(new D(X.ZBAR_EAN5)),D.register("isbn_10",new D(X.ZBAR_ISBN10)).add(new D(X.ZBAR_EAN13)),D.register("isbn_13",new D(X.ZBAR_ISBN13)).add(new D(X.ZBAR_EAN13)),D.register("isbn_13+2",new D(X.ZBAR_ISBN13)).add(new D(X.ZBAR_EAN13)).add(new D(X.ZBAR_EAN2)),D.register("isbn_13+5",new D(X.ZBAR_ISBN13)).add(new D(X.ZBAR_EAN13)).add(new D(X.ZBAR_EAN5)),D.register("itf",new D(X.ZBAR_I25)),D.register("qr_code",new D(X.ZBAR_QRCODE)),D.register("sq_code",new D(X.ZBAR_SQCODE)),D.register("upc_a",new D(X.ZBAR_UPCA)).add(new D(X.ZBAR_EAN13)),D.register("upc_e",new D(X.ZBAR_UPCE)).add(new D(X.ZBAR_EAN13)),function(r){r[r.UNKNOWN=-1]="UNKNOWN",r[r.UPRIGHT=0]="UPRIGHT",r[r.ROTATED_RIGHT=1]="ROTATED_RIGHT",r[r.UPSIDE_DOWN=2]="UPSIDE_DOWN",r[r.ROTATED_LEFT=3]="ROTATED_LEFT"}(qc||(qc={}));var Co=class{},Uf=(()=>{try{return new OffscreenCanvas(1,1).getContext("2d")instanceof OffscreenCanvasRenderingContext2D}catch{return!1}})(),Qt=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 t=e.formats.filter(n=>!D.formats().includes(n));if(t.length)throw new TypeError(`Unsupported barcode format(s): ${t.join(", ")}`)}this.formats=e.formats||D.formats(),this.zbarConfig=e.zbar||new Co}static getSupportedFormats(){return Promise.resolve(D.formats())}detect(e){if(!Qt.isImageBitmapSource(e))throw new TypeError("BarcodeDetector.detect() argument is not an ImageBitmapSource");let t=Qt.intrinsicDimensions(e);if(t.width===0||t.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),$f(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,t)=>jf(this,void 0,void 0,function*(){if(!this.scanner){let n=yield Mf();this.formats.length>0&&(n.setConfig(X.ZBAR_NONE,Bc.ZBAR_CFG_ENABLE,0),this.formats.forEach(i=>D.configure(n,i))),this.scanner=n}e(this.scanner)}))}toImageData(e){let t=n=>{let i=Qt.intrinsicDimensions(n);this.canvas&&this.canvas.width===i.width&&this.canvas.height===i.height||(this.canvas=function(s,u){if(Uf)return new OffscreenCanvas(s,u);{let l=document.createElement("canvas");return l.width=s,l.height=u,l}}(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(()=>t(n)).finally(()=>URL.revokeObjectURL(n.src))}return e instanceof CanvasRenderingContext2D?Promise.resolve(e.getImageData(0,0,e.canvas.width,e.canvas.height)):Promise.resolve(t(e))}toBarcodeDetectorResult(e){let t={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0};return e.points.forEach(n=>{t.minX=Math.min(t.minX,n.x),t.maxX=Math.max(t.maxX,n.x),t.minY=Math.min(t.minY,n.y),t.maxY=Math.max(t.maxY,n.y)}),{format:D.toFormat(e.type),rawValue:e.decode(this.zbarConfig.encoding),orientation:e.orientation,quality:e.quality,boundingBox:DOMRectReadOnly.fromRect({x:t.minX,y:t.minY,width:t.maxX-t.minX,height:t.maxY-t.minY}),cornerPoints:[{x:t.minX,y:t.minY},{x:t.maxX,y:t.minY},{x:t.maxX,y:t.maxY},{x:t.minX,y:t.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 So=function(r,e){return So=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},So(r,e)};function ge(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");So(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var m=function(){return m=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},m.apply(this,arguments)};function _t(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}function pt(r,e,t,n){function i(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function s(f){try{l(n.next(f))}catch(p){o(p)}}function u(f){try{l(n.throw(f))}catch(p){o(p)}}function l(f){f.done?a(f.value):i(f.value).then(s,u)}l((n=n.apply(r,e||[])).next())})}function dt(r,e){var t={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(l){return function(f){return u([l,f])}}function u(l){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(t=0)),t;)try{if(n=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,i=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){t.label=l[1];break}if(l[0]===6&&t.label<a[1]){t.label=a[1],a=l;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(l);break}a[2]&&t.ops.pop(),t.trys.pop();continue}l=e.call(r,t)}catch(f){l=[6,f],i=0}finally{n=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Wt(r,e,t){if(t||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 r.concat(a||Array.prototype.slice.call(e))}var wo="Invariant Violation",Vc=Object.setPrototypeOf,qf=Vc===void 0?function(r,e){return r.__proto__=e,r}:Vc,U=function(r){ge(e,r);function e(t){t===void 0&&(t=wo);var n=r.call(this,typeof t=="number"?wo+": "+t+" (see https://github.com/apollographql/invariant-packages)":t)||this;return n.framesToPop=1,n.name=wo,qf(n,e.prototype),n}return e}(Error);function T(r,e){if(!r)throw new U(e)}var Ri=["debug","log","warn","error","silent"],_o=Ri.indexOf("log");function Pi(r){return function(){if(Ri.indexOf(r)>=_o){var e=console[r]||console.log;return e.apply(console,arguments)}}}(function(r){r.debug=Pi("debug"),r.log=Pi("log"),r.warn=Pi("warn"),r.error=Pi("error")})(T||(T={}));function Qc(r){var e=Ri[_o];return _o=Math.max(0,Ri.indexOf(r)),e}function Ie(r){try{return r()}catch{}}var Li=Ie(function(){return globalThis})||Ie(function(){return window})||Ie(function(){return self})||Ie(function(){return global})||Ie(function(){return Ie.constructor("return this")()});var Wc="__",Gc=[Wc,Wc].join("DEV");function Bf(){try{return Boolean(__DEV__)}catch{return Object.defineProperty(Li,Gc,{value:Ie(function(){return"production"})!=="production",enumerable:!1,configurable:!0,writable:!0}),Li[Gc]}}var gr=Bf();function Gt(r){try{return r()}catch{}}var Eo=Gt(function(){return globalThis})||Gt(function(){return window})||Gt(function(){return self})||Gt(function(){return global})||Gt(function(){return Gt.constructor("return this")()}),xo=!1;function Vf(){Eo&&!Gt(function(){return"production"})&&!Gt(function(){return process})&&(Object.defineProperty(Eo,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),xo=!0)}Vf();function Oo(){xo&&(delete Eo.process,xo=!1)}var r2=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",n2=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator",Kc=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";var we=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 To(r,e){var t=Boolean(r);if(!t)throw new Error(e??"Unexpected invariant triggered.")}var Qf=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,Fn=Qf;function Fi(r){var e=r.prototype.toJSON;typeof e=="function"||To(0),r.prototype.inspect=e,Fn&&(r.prototype[Fn]=e)}var zc=function(){function r(t,n,i){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=i}var e=r.prototype;return e.toJSON=function(){return{start:this.start,end:this.end}},r}();Fi(zc);var Hc=function(){function r(t,n,i,a,o,s,u){this.kind=t,this.start=n,this.end=i,this.line=a,this.column=o,this.value=u,this.prev=s,this.next=null}var e=r.prototype;return e.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},r}();Fi(Hc);function Ao(r){return r!=null&&typeof r.kind=="string"}function $i(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?$i=function(t){return typeof t}:$i=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$i(r)}var Wf=10,Jc=2;function $n(r){return Mi(r,[])}function Mi(r,e){switch($i(r)){case"string":return JSON.stringify(r);case"function":return r.name?"[function ".concat(r.name,"]"):"[function]";case"object":return r===null?"null":Gf(r,e);default:return String(r)}}function Gf(r,e){if(e.indexOf(r)!==-1)return"[Circular]";var t=[].concat(e,[r]),n=Hf(r);if(n!==void 0){var i=n.call(r);if(i!==r)return typeof i=="string"?i:Mi(i,t)}else if(Array.isArray(r))return zf(r,t);return Kf(r,t)}function Kf(r,e){var t=Object.keys(r);if(t.length===0)return"{}";if(e.length>Jc)return"["+Jf(r)+"]";var n=t.map(function(i){var a=Mi(r[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function zf(r,e){if(r.length===0)return"[]";if(e.length>Jc)return"[Array]";for(var t=Math.min(Wf,r.length),n=r.length-t,i=[],a=0;a<t;++a)i.push(Mi(r[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function Hf(r){var e=r[String(Fn)];if(typeof e=="function")return e;if(typeof r.inspect=="function")return r.inspect}function Jf(r){var e=Object.prototype.toString.call(r).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof r.constructor=="function"){var t=r.constructor.name;if(typeof t=="string"&&t!=="")return t}return e}function Mn(r,e){var t=Boolean(r);if(!t)throw new Error(e)}function Yc(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function Yf(r,e,t){return e&&Yc(r.prototype,e),t&&Yc(r,t),r}var ji=function(){function r(e){var t=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"||Mn(0,"Body must be a string. Received: ".concat($n(e),".")),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||Mn(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Mn(0,"column in locationOffset is 1-indexed and must be positive.")}return Yf(r,[{key:Kc,get:function(){return"Source"}}]),r}();function Xc(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=r.indexOf(`
1
+ var Tf=Object.defineProperty;var Af=Object.getOwnPropertyDescriptor;var Ne=(r,e,t,n)=>{for(var i=n>1?void 0:n?Af(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&Tf(e,t,i),i};var ye=(r,e,t)=>new Promise((n,i)=>{var a=u=>{try{s(t.next(u))}catch(l){i(l)}},o=u=>{try{s(t.throw(u))}catch(l){i(l)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(a,o);s((t=t.apply(r,e)).next())});var Ai=window,Ii=Ai.ShadowRoot&&(Ai.ShadyCSS===void 0||Ai.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,to=Symbol(),Cc=new WeakMap,Dn=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==to)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(Ii&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=Cc.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Cc.set(t,e))}return e}toString(){return this.cssText}},Sc=r=>new Dn(typeof r=="string"?r:r+"",void 0,to),ro=(r,...e)=>{let t=r.length===1?r[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)+r[a+1],r[0]);return new Dn(t,r,to)},no=(r,e)=>{Ii?r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet):e.forEach(t=>{let n=document.createElement("style"),i=Ai.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=t.cssText,r.appendChild(n)})},ki=Ii?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(let n of e.cssRules)t+=n.cssText;return Sc(t)})(r):r;var io,Di=window,wc=Di.trustedTypes,If=wc?wc.emptyScript:"",_c=Di.reactiveElementPolyfillSupport,oo={toAttribute(r,e){switch(e){case Boolean:r=r?If:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},Ec=(r,e)=>e!==r&&(e==e||r==r),ao={attribute:!0,type:String,converter:oo,reflect:!1,hasChanged:Ec},so="finalized",kt=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var t;this.finalize(),((t=this.h)!==null&&t!==void 0?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();let e=[];return this.elementProperties.forEach((t,n)=>{let i=this._$Ep(n,t);i!==void 0&&(this._$Ev.set(i,n),e.push(i))}),e}static createProperty(e,t=ao){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){let n=typeof e=="symbol"?Symbol():"__"+e,i=this.getPropertyDescriptor(e,n,t);i!==void 0&&Object.defineProperty(this.prototype,e,i)}}static getPropertyDescriptor(e,t,n){return{get(){return this[t]},set(i){let a=this[e];this[t]=i,this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||ao}static finalize(){if(this.hasOwnProperty(so))return!1;this[so]=!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 t=this.properties,n=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(let i of n)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let i of n)t.unshift(ki(i))}else e!==void 0&&t.push(ki(e));return t}static _$Ep(e,t){let n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(t=>t(this))}addController(e){var t,n;((t=this._$ES)!==null&&t!==void 0?t:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((n=e.hostConnected)===null||n===void 0||n.call(e))}removeController(e){var t;(t=this._$ES)===null||t===void 0||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])})}createRenderRoot(){var e;let t=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return no(t,this.constructor.elementStyles),t}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(t=>{var n;return(n=t.hostConnected)===null||n===void 0?void 0:n.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(t=>{var n;return(n=t.hostDisconnected)===null||n===void 0?void 0:n.call(t)})}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$EO(e,t,n=ao){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:oo).toAttribute(t,n.type);this._$El=e,o==null?this.removeAttribute(a):this.setAttribute(a,o),this._$El=null}}_$AK(e,t){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:oo;this._$El=a,this[a]=s.fromAttribute(t,o.type),this._$El=null}}requestUpdate(e,t,n){let i=!0;e!==void 0&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||Ec)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),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(t){Promise.reject(t)}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 t=!1,n=this._$AL;try{t=this.shouldUpdate(n),t?(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 t=!1,this._$Ek(),i}t&&this._$AE(n)}willUpdate(e){}_$AE(e){var t;(t=this._$ES)===null||t===void 0||t.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((t,n)=>this._$EO(n,this[n],t)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};kt[so]=!0,kt.elementProperties=new Map,kt.elementStyles=[],kt.shadowRootOptions={mode:"open"},_c?.({ReactiveElement:kt}),((io=Di.reactiveElementVersions)!==null&&io!==void 0?io:Di.reactiveElementVersions=[]).push("1.6.3");var co,Pi=window,Hr=Pi.trustedTypes,xc=Hr?Hr.createPolicy("lit-html",{createHTML:r=>r}):void 0,lo="$lit$",qt=`lit$${(Math.random()+"").slice(9)}$`,Pc="?"+qt,kf=`<${Pc}>`,dr=document,Nn=()=>dr.createComment(""),Rn=r=>r===null||typeof r!="object"&&typeof r!="function",Nc=Array.isArray,Df=r=>Nc(r)||typeof r?.[Symbol.iterator]=="function",uo=`[
2
+ \f\r]`,Pn=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Oc=/-->/g,Tc=/>/g,fr=RegExp(`>|${uo}(?:([^\\s"'>=/]+)(${uo}*=${uo}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Ac=/'/g,Ic=/"/g,Rc=/^(?:script|style|textarea|title)$/i,Lc=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),Y=Lc(1),eh=Lc(2),hr=Symbol.for("lit-noChange"),Ae=Symbol.for("lit-nothing"),kc=new WeakMap,pr=dr.createTreeWalker(dr,129,null,!1);function Fc(r,e){if(!Array.isArray(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return xc!==void 0?xc.createHTML(e):e}var Pf=(r,e)=>{let t=r.length-1,n=[],i,a=e===2?"<svg>":"",o=Pn;for(let s=0;s<t;s++){let u=r[s],l,f,p=-1,h=0;for(;h<u.length&&(o.lastIndex=h,f=o.exec(u),f!==null);)h=o.lastIndex,o===Pn?f[1]==="!--"?o=Oc:f[1]!==void 0?o=Tc:f[2]!==void 0?(Rc.test(f[2])&&(i=RegExp("</"+f[2],"g")),o=fr):f[3]!==void 0&&(o=fr):o===fr?f[0]===">"?(o=i??Pn,p=-1):f[1]===void 0?p=-2:(p=o.lastIndex-f[2].length,l=f[1],o=f[3]===void 0?fr:f[3]==='"'?Ic:Ac):o===Ic||o===Ac?o=fr:o===Oc||o===Tc?o=Pn:(o=fr,i=void 0);let d=o===fr&&r[s+1].startsWith("/>")?" ":"";a+=o===Pn?u+kf:p>=0?(n.push(l),u.slice(0,p)+lo+u.slice(p)+qt+d):u+qt+(p===-2?(n.push(void 0),s):d)}return[Fc(r,a+(r[t]||"<?>")+(e===2?"</svg>":"")),n]},mr=class{constructor({strings:e,_$litType$:t},n){let i;this.parts=[];let a=0,o=0,s=e.length-1,u=this.parts,[l,f]=Pf(e,t);if(this.el=mr.createElement(l,n),pr.currentNode=this.el.content,t===2){let p=this.el.content,h=p.firstChild;h.remove(),p.append(...h.childNodes)}for(;(i=pr.nextNode())!==null&&u.length<s;){if(i.nodeType===1){if(i.hasAttributes()){let p=[];for(let h of i.getAttributeNames())if(h.endsWith(lo)||h.startsWith(qt)){let d=f[o++];if(p.push(h),d!==void 0){let y=i.getAttribute(d.toLowerCase()+lo).split(qt),g=/([.?@])?(.*)/.exec(d);u.push({type:1,index:a,name:g[2],strings:y,ctor:g[1]==="."?po:g[1]==="?"?ho:g[1]==="@"?mo:Yr})}else u.push({type:6,index:a})}for(let h of p)i.removeAttribute(h)}if(Rc.test(i.tagName)){let p=i.textContent.split(qt),h=p.length-1;if(h>0){i.textContent=Hr?Hr.emptyScript:"";for(let d=0;d<h;d++)i.append(p[d],Nn()),pr.nextNode(),u.push({type:2,index:++a});i.append(p[h],Nn())}}}else if(i.nodeType===8)if(i.data===Pc)u.push({type:2,index:a});else{let p=-1;for(;(p=i.data.indexOf(qt,p+1))!==-1;)u.push({type:7,index:a}),p+=qt.length-1}a++}}static createElement(e,t){let n=dr.createElement("template");return n.innerHTML=e,n}};function Jr(r,e,t=r,n){var i,a,o,s;if(e===hr)return e;let u=n!==void 0?(i=t._$Co)===null||i===void 0?void 0:i[n]:t._$Cl,l=Rn(e)?void 0:e._$litDirective$;return u?.constructor!==l&&((a=u?._$AO)===null||a===void 0||a.call(u,!1),l===void 0?u=void 0:(u=new l(r),u._$AT(r,t,n)),n!==void 0?((o=(s=t)._$Co)!==null&&o!==void 0?o:s._$Co=[])[n]=u:t._$Cl=u),u!==void 0&&(e=Jr(r,u._$AS(r,e.values),u,n)),e}var fo=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var t;let{el:{content:n},parts:i}=this._$AD,a=((t=e?.creationScope)!==null&&t!==void 0?t:dr).importNode(n,!0);pr.currentNode=a;let o=pr.nextNode(),s=0,u=0,l=i[0];for(;l!==void 0;){if(s===l.index){let f;l.type===2?f=new yr(o,o.nextSibling,this,e):l.type===1?f=new l.ctor(o,l.name,l.strings,this,e):l.type===6&&(f=new yo(o,this,e)),this._$AV.push(f),l=i[++u]}s!==l?.index&&(o=pr.nextNode(),s++)}return pr.currentNode=dr,a}v(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}},yr=class{constructor(e,t,n,i){var a;this.type=2,this._$AH=Ae,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=i,this._$Cp=(a=i?.isConnected)===null||a===void 0||a}get _$AU(){var e,t;return(t=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&t!==void 0?t:this._$Cp}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Jr(this,e,t),Rn(e)?e===Ae||e==null||e===""?(this._$AH!==Ae&&this._$AR(),this._$AH=Ae):e!==this._$AH&&e!==hr&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):Df(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!==Ae&&Rn(this._$AH)?this._$AA.nextSibling.data=e:this.$(dr.createTextNode(e)),this._$AH=e}g(e){var t;let{values:n,_$litType$:i}=e,a=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=mr.createElement(Fc(i.h,i.h[0]),this.options)),i);if(((t=this._$AH)===null||t===void 0?void 0:t._$AD)===a)this._$AH.v(n);else{let o=new fo(a,this),s=o.u(this.options);o.v(n),this.$(s),this._$AH=o}}_$AC(e){let t=kc.get(e.strings);return t===void 0&&kc.set(e.strings,t=new mr(e)),t}T(e){Nc(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,n,i=0;for(let a of e)i===t.length?t.push(n=new yr(this.k(Nn()),this.k(Nn()),this,this.options)):n=t[i],n._$AI(a),i++;i<t.length&&(this._$AR(n&&n._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){var n;for((n=this._$AP)===null||n===void 0||n.call(this,!1,!0,t);e&&e!==this._$AB;){let i=e.nextSibling;e.remove(),e=i}}setConnected(e){var t;this._$AM===void 0&&(this._$Cp=e,(t=this._$AP)===null||t===void 0||t.call(this,e))}},Yr=class{constructor(e,t,n,i,a){this.type=1,this._$AH=Ae,this._$AN=void 0,this.element=e,this.name=t,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=Ae}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,n,i){let a=this.strings,o=!1;if(a===void 0)e=Jr(this,e,t,0),o=!Rn(e)||e!==this._$AH&&e!==hr,o&&(this._$AH=e);else{let s=e,u,l;for(e=a[0],u=0;u<a.length-1;u++)l=Jr(this,s[n+u],t,u),l===hr&&(l=this._$AH[u]),o||(o=!Rn(l)||l!==this._$AH[u]),l===Ae?e=Ae:e!==Ae&&(e+=(l??"")+a[u+1]),this._$AH[u]=l}o&&!i&&this.j(e)}j(e){e===Ae?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},po=class extends Yr{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Ae?void 0:e}},Nf=Hr?Hr.emptyScript:"",ho=class extends Yr{constructor(){super(...arguments),this.type=4}j(e){e&&e!==Ae?this.element.setAttribute(this.name,Nf):this.element.removeAttribute(this.name)}},mo=class extends Yr{constructor(e,t,n,i,a){super(e,t,n,i,a),this.type=5}_$AI(e,t=this){var n;if((e=(n=Jr(this,e,t,0))!==null&&n!==void 0?n:Ae)===hr)return;let i=this._$AH,a=e===Ae&&i!==Ae||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,o=e!==Ae&&(i===Ae||a);a&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,n;typeof this._$AH=="function"?this._$AH.call((n=(t=this.options)===null||t===void 0?void 0:t.host)!==null&&n!==void 0?n:this.element,e):this._$AH.handleEvent(e)}},yo=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){Jr(this,e)}};var Dc=Pi.litHtmlPolyfillSupport;Dc?.(mr,yr),((co=Pi.litHtmlVersions)!==null&&co!==void 0?co:Pi.litHtmlVersions=[]).push("2.8.0");var $c=(r,e,t)=>{var n,i;let a=(n=t?.renderBefore)!==null&&n!==void 0?n:e,o=a._$litPart$;if(o===void 0){let s=(i=t?.renderBefore)!==null&&i!==void 0?i:null;a._$litPart$=o=new yr(e.insertBefore(Nn(),s),s,void 0,t??{})}return o._$AI(r),o};var go,vo;var Bt=class extends kt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;let n=super.createRenderRoot();return(e=(t=this.renderOptions).renderBefore)!==null&&e!==void 0||(t.renderBefore=n.firstChild),n}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=$c(t,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 hr}};Bt.finalized=!0,Bt._$litElement$=!0,(go=globalThis.litElementHydrateSupport)===null||go===void 0||go.call(globalThis,{LitElement:Bt});var Mc=globalThis.litElementPolyfillSupport;Mc?.({LitElement:Bt});((vo=globalThis.litElementVersions)!==null&&vo!==void 0?vo:globalThis.litElementVersions=[]).push("3.3.3");var jc=r=>e=>typeof e=="function"?((t,n)=>(customElements.define(t,n),n))(r,e):((t,n)=>{let{kind:i,elements:a}=n;return{kind:i,elements:a,finisher(o){customElements.define(t,o)}}})(r,e);var Rf=(r,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(t){t.createProperty(e.key,r)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(t){t.createProperty(e.key,r)}},Lf=(r,e,t)=>{e.constructor.createProperty(t,r)};function ft(r){return(e,t)=>t!==void 0?Lf(r,e,t):Rf(r,e)}function Vt(r){return ft({...r,state:!0})}var bo,Th=((bo=window.HTMLSlotElement)===null||bo===void 0?void 0:bo.prototype.assignedElements)!=null?(r,e)=>r.assignedElements(e):(r,e)=>r.assignedNodes(e).filter(t=>t.nodeType===Node.ELEMENT_NODE);import{ZBarSymbolType as X,ZBarConfigType as qc,scanRGBABuffer as Ff,getDefaultScanner as $f}from"https://cdn.jsdelivr.net/npm/@undecaf/zbar-wasm@0.9.15/dist/main.js";function Mf(r,e,t,n){return new(t||(t=Promise))(function(i,a){function o(l){try{u(n.next(l))}catch(f){a(f)}}function s(l){try{u(n.throw(l))}catch(f){a(f)}}function u(l){var f;l.done?i(l.value):(f=l.value,f instanceof t?f:new t(function(p){p(f)})).then(o,s)}u((n=n.apply(r,e||[])).next())})}var D=class{constructor(e,t=qc.ZBAR_CFG_ENABLE,n=1){this.symbolType=e,this.configType=t,this.number=n,this.configSteps=[this]}static register(e,t,n=t.symbolType){return D.formatsToConfigs[e]=t,D.typesToFormats[n]=D.typesToFormats[n]||e,t}static formats(){return Object.keys(D.formatsToConfigs)}static toFormat(e){return D.typesToFormats[e]}static configure(e,t){var n;(n=D.formatsToConfigs[t])===null||n===void 0||n.configSteps.forEach(i=>e.setConfig(i.symbolType,i.configType,i.number))}add(e){return this.configSteps.push(e),this}},Uc;D.formatsToConfigs={},D.typesToFormats={},D.register("codabar",new D(X.ZBAR_CODABAR)),D.register("code_39",new D(X.ZBAR_CODE39)),D.register("code_93",new D(X.ZBAR_CODE93)),D.register("code_128",new D(X.ZBAR_CODE128)),D.register("databar",new D(X.ZBAR_DATABAR)),D.register("databar_exp",new D(X.ZBAR_DATABAR_EXP)),D.register("ean_2",new D(X.ZBAR_EAN2)),D.register("ean_5",new D(X.ZBAR_EAN5)),D.register("ean_8",new D(X.ZBAR_EAN8)),D.register("ean_13",new D(X.ZBAR_EAN13)),D.register("ean_13+2",new D(X.ZBAR_EAN13)).add(new D(X.ZBAR_EAN2)),D.register("ean_13+5",new D(X.ZBAR_EAN13)).add(new D(X.ZBAR_EAN5)),D.register("isbn_10",new D(X.ZBAR_ISBN10)).add(new D(X.ZBAR_EAN13)),D.register("isbn_13",new D(X.ZBAR_ISBN13)).add(new D(X.ZBAR_EAN13)),D.register("isbn_13+2",new D(X.ZBAR_ISBN13)).add(new D(X.ZBAR_EAN13)).add(new D(X.ZBAR_EAN2)),D.register("isbn_13+5",new D(X.ZBAR_ISBN13)).add(new D(X.ZBAR_EAN13)).add(new D(X.ZBAR_EAN5)),D.register("itf",new D(X.ZBAR_I25)),D.register("qr_code",new D(X.ZBAR_QRCODE)),D.register("sq_code",new D(X.ZBAR_SQCODE)),D.register("upc_a",new D(X.ZBAR_UPCA)).add(new D(X.ZBAR_EAN13)),D.register("upc_e",new D(X.ZBAR_UPCE)).add(new D(X.ZBAR_EAN13)),function(r){r[r.UNKNOWN=-1]="UNKNOWN",r[r.UPRIGHT=0]="UPRIGHT",r[r.ROTATED_RIGHT=1]="ROTATED_RIGHT",r[r.UPSIDE_DOWN=2]="UPSIDE_DOWN",r[r.ROTATED_LEFT=3]="ROTATED_LEFT"}(Uc||(Uc={}));var Co=class{},jf=(()=>{try{return new OffscreenCanvas(1,1).getContext("2d")instanceof OffscreenCanvasRenderingContext2D}catch{return!1}})(),Qt=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 t=e.formats.filter(n=>!D.formats().includes(n));if(t.length)throw new TypeError(`Unsupported barcode format(s): ${t.join(", ")}`)}this.formats=e.formats||D.formats(),this.zbarConfig=e.zbar||new Co}static getSupportedFormats(){return Promise.resolve(D.formats())}detect(e){if(!Qt.isImageBitmapSource(e))throw new TypeError("BarcodeDetector.detect() argument is not an ImageBitmapSource");let t=Qt.intrinsicDimensions(e);if(t.width===0||t.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),Ff(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,t)=>Mf(this,void 0,void 0,function*(){if(!this.scanner){let n=yield $f();this.formats.length>0&&(n.setConfig(X.ZBAR_NONE,qc.ZBAR_CFG_ENABLE,0),this.formats.forEach(i=>D.configure(n,i))),this.scanner=n}e(this.scanner)}))}toImageData(e){let t=n=>{let i=Qt.intrinsicDimensions(n);this.canvas&&this.canvas.width===i.width&&this.canvas.height===i.height||(this.canvas=function(s,u){if(jf)return new OffscreenCanvas(s,u);{let l=document.createElement("canvas");return l.width=s,l.height=u,l}}(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(()=>t(n)).finally(()=>URL.revokeObjectURL(n.src))}return e instanceof CanvasRenderingContext2D?Promise.resolve(e.getImageData(0,0,e.canvas.width,e.canvas.height)):Promise.resolve(t(e))}toBarcodeDetectorResult(e){let t={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0};return e.points.forEach(n=>{t.minX=Math.min(t.minX,n.x),t.maxX=Math.max(t.maxX,n.x),t.minY=Math.min(t.minY,n.y),t.maxY=Math.max(t.maxY,n.y)}),{format:D.toFormat(e.type),rawValue:e.decode(this.zbarConfig.encoding),orientation:e.orientation,quality:e.quality,boundingBox:DOMRectReadOnly.fromRect({x:t.minX,y:t.minY,width:t.maxX-t.minX,height:t.maxY-t.minY}),cornerPoints:[{x:t.minX,y:t.minY},{x:t.maxX,y:t.minY},{x:t.maxX,y:t.maxY},{x:t.minX,y:t.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 So=function(r,e){return So=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},So(r,e)};function ge(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");So(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var m=function(){return m=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},m.apply(this,arguments)};function _t(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}function pt(r,e,t,n){function i(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function s(f){try{l(n.next(f))}catch(p){o(p)}}function u(f){try{l(n.throw(f))}catch(p){o(p)}}function l(f){f.done?a(f.value):i(f.value).then(s,u)}l((n=n.apply(r,e||[])).next())})}function dt(r,e){var t={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(l){return function(f){return u([l,f])}}function u(l){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(t=0)),t;)try{if(n=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,i=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){t.label=l[1];break}if(l[0]===6&&t.label<a[1]){t.label=a[1],a=l;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(l);break}a[2]&&t.ops.pop(),t.trys.pop();continue}l=e.call(r,t)}catch(f){l=[6,f],i=0}finally{n=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Wt(r,e,t){if(t||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 r.concat(a||Array.prototype.slice.call(e))}var wo="Invariant Violation",Bc=Object.setPrototypeOf,Uf=Bc===void 0?function(r,e){return r.__proto__=e,r}:Bc,U=function(r){ge(e,r);function e(t){t===void 0&&(t=wo);var n=r.call(this,typeof t=="number"?wo+": "+t+" (see https://github.com/apollographql/invariant-packages)":t)||this;return n.framesToPop=1,n.name=wo,Uf(n,e.prototype),n}return e}(Error);function T(r,e){if(!r)throw new U(e)}var Ri=["debug","log","warn","error","silent"],_o=Ri.indexOf("log");function Ni(r){return function(){if(Ri.indexOf(r)>=_o){var e=console[r]||console.log;return e.apply(console,arguments)}}}(function(r){r.debug=Ni("debug"),r.log=Ni("log"),r.warn=Ni("warn"),r.error=Ni("error")})(T||(T={}));function Vc(r){var e=Ri[_o];return _o=Math.max(0,Ri.indexOf(r)),e}function Ie(r){try{return r()}catch{}}var Li=Ie(function(){return globalThis})||Ie(function(){return window})||Ie(function(){return self})||Ie(function(){return global})||Ie(function(){return Ie.constructor("return this")()});var Qc="__",Wc=[Qc,Qc].join("DEV");function qf(){try{return Boolean(__DEV__)}catch{return Object.defineProperty(Li,Wc,{value:Ie(function(){return"production"})!=="production",enumerable:!1,configurable:!0,writable:!0}),Li[Wc]}}var gr=qf();function Gt(r){try{return r()}catch{}}var Eo=Gt(function(){return globalThis})||Gt(function(){return window})||Gt(function(){return self})||Gt(function(){return global})||Gt(function(){return Gt.constructor("return this")()}),xo=!1;function Bf(){Eo&&!Gt(function(){return"production"})&&!Gt(function(){return process})&&(Object.defineProperty(Eo,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),xo=!0)}Bf();function Oo(){xo&&(delete Eo.process,xo=!1)}var t2=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",r2=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator",Gc=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";var we=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 To(r,e){var t=Boolean(r);if(!t)throw new Error(e??"Unexpected invariant triggered.")}var Vf=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,Fn=Vf;function Fi(r){var e=r.prototype.toJSON;typeof e=="function"||To(0),r.prototype.inspect=e,Fn&&(r.prototype[Fn]=e)}var Kc=function(){function r(t,n,i){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=i}var e=r.prototype;return e.toJSON=function(){return{start:this.start,end:this.end}},r}();Fi(Kc);var zc=function(){function r(t,n,i,a,o,s,u){this.kind=t,this.start=n,this.end=i,this.line=a,this.column=o,this.value=u,this.prev=s,this.next=null}var e=r.prototype;return e.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},r}();Fi(zc);function Ao(r){return r!=null&&typeof r.kind=="string"}function $i(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?$i=function(t){return typeof t}:$i=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$i(r)}var Qf=10,Hc=2;function $n(r){return Mi(r,[])}function Mi(r,e){switch($i(r)){case"string":return JSON.stringify(r);case"function":return r.name?"[function ".concat(r.name,"]"):"[function]";case"object":return r===null?"null":Wf(r,e);default:return String(r)}}function Wf(r,e){if(e.indexOf(r)!==-1)return"[Circular]";var t=[].concat(e,[r]),n=zf(r);if(n!==void 0){var i=n.call(r);if(i!==r)return typeof i=="string"?i:Mi(i,t)}else if(Array.isArray(r))return Kf(r,t);return Gf(r,t)}function Gf(r,e){var t=Object.keys(r);if(t.length===0)return"{}";if(e.length>Hc)return"["+Hf(r)+"]";var n=t.map(function(i){var a=Mi(r[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function Kf(r,e){if(r.length===0)return"[]";if(e.length>Hc)return"[Array]";for(var t=Math.min(Qf,r.length),n=r.length-t,i=[],a=0;a<t;++a)i.push(Mi(r[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function zf(r){var e=r[String(Fn)];if(typeof e=="function")return e;if(typeof r.inspect=="function")return r.inspect}function Hf(r){var e=Object.prototype.toString.call(r).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof r.constructor=="function"){var t=r.constructor.name;if(typeof t=="string"&&t!=="")return t}return e}function Mn(r,e){var t=Boolean(r);if(!t)throw new Error(e)}function Jc(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function Jf(r,e,t){return e&&Jc(r.prototype,e),t&&Jc(r,t),r}var ji=function(){function r(e){var t=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"||Mn(0,"Body must be a string. Received: ".concat($n(e),".")),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||Mn(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Mn(0,"column in locationOffset is 1-indexed and must be positive.")}return Jf(r,[{key:Gc,get:function(){return"Source"}}]),r}();function Yc(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=r.indexOf(`
4
4
  `)===-1,i=r[0]===" "||r[0]===" ",a=r[r.length-1]==='"',o=r[r.length-1]==="\\",s=!n||a||o||t,u="";return s&&!(n&&i)&&(u+=`
5
5
  `+e),u+=e?r.replace(/\n/g,`
6
6
  `+e):r,s&&(u+=`
7
- `),'"""'+u.replace(/"""/g,'\\"""')+'"""'}var Xf={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"]},vr=Object.freeze({});function Me(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Xf,n=void 0,i=Array.isArray(r),a=[r],o=-1,s=[],u=void 0,l=void 0,f=void 0,p=[],h=[],d=r;do{o++;var y=o===a.length,g=y&&s.length!==0;if(y){if(l=h.length===0?void 0:p[p.length-1],u=f,f=h.pop(),g){if(i)u=u.slice();else{for(var C={},_=0,b=Object.keys(u);_<b.length;_++){var S=b[_];C[S]=u[S]}u=C}for(var O=0,k=0;k<s.length;k++){var N=s[k][0],I=s[k][1];i&&(N-=O),i&&I===null?(u.splice(N,1),O++):u[N]=I}}o=n.index,a=n.keys,s=n.edits,i=n.inArray,n=n.prev}else{if(l=f?i?o:a[o]:void 0,u=f?f[l]:d,u==null)continue;f&&p.push(l)}var R=void 0;if(!Array.isArray(u)){if(!Ao(u))throw new Error("Invalid AST Node: ".concat($n(u),"."));var re=Io(e,u.kind,y);if(re){if(R=re.call(e,u,l,f,p,h),R===vr)break;if(R===!1){if(!y){p.pop();continue}}else if(R!==void 0&&(s.push([l,R]),!y))if(Ao(R))u=R;else{p.pop();continue}}}if(R===void 0&&g&&s.push([l,u]),y)p.pop();else{var ee;n={inArray:i,index:o,keys:a,edits:s,prev:n},i=Array.isArray(u),a=i?u:(ee=t[u.kind])!==null&&ee!==void 0?ee:[],o=-1,s=[],f&&h.push(f),f=u}}while(n!==void 0);return s.length!==0&&(d=s[s.length-1][1]),d}function Io(r,e,t){var n=r[e];if(n){if(!t&&typeof n=="function")return n;var i=t?n.leave:n.enter;if(typeof i=="function")return i}else{var a=t?r.leave:r.enter;if(a){if(typeof a=="function")return a;var o=a[e];if(typeof o=="function")return o}}}function Xr(r){return Me(r,{leave:ep})}var Zf=80,ep={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return P(e.definitions,`
7
+ `),'"""'+u.replace(/"""/g,'\\"""')+'"""'}var Yf={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"]},vr=Object.freeze({});function Me(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Yf,n=void 0,i=Array.isArray(r),a=[r],o=-1,s=[],u=void 0,l=void 0,f=void 0,p=[],h=[],d=r;do{o++;var y=o===a.length,g=y&&s.length!==0;if(y){if(l=h.length===0?void 0:p[p.length-1],u=f,f=h.pop(),g){if(i)u=u.slice();else{for(var C={},_=0,b=Object.keys(u);_<b.length;_++){var S=b[_];C[S]=u[S]}u=C}for(var O=0,k=0;k<s.length;k++){var P=s[k][0],I=s[k][1];i&&(P-=O),i&&I===null?(u.splice(P,1),O++):u[P]=I}}o=n.index,a=n.keys,s=n.edits,i=n.inArray,n=n.prev}else{if(l=f?i?o:a[o]:void 0,u=f?f[l]:d,u==null)continue;f&&p.push(l)}var R=void 0;if(!Array.isArray(u)){if(!Ao(u))throw new Error("Invalid AST Node: ".concat($n(u),"."));var re=Io(e,u.kind,y);if(re){if(R=re.call(e,u,l,f,p,h),R===vr)break;if(R===!1){if(!y){p.pop();continue}}else if(R!==void 0&&(s.push([l,R]),!y))if(Ao(R))u=R;else{p.pop();continue}}}if(R===void 0&&g&&s.push([l,u]),y)p.pop();else{var ee;n={inArray:i,index:o,keys:a,edits:s,prev:n},i=Array.isArray(u),a=i?u:(ee=t[u.kind])!==null&&ee!==void 0?ee:[],o=-1,s=[],f&&h.push(f),f=u}}while(n!==void 0);return s.length!==0&&(d=s[s.length-1][1]),d}function Io(r,e,t){var n=r[e];if(n){if(!t&&typeof n=="function")return n;var i=t?n.leave:n.enter;if(typeof i=="function")return i}else{var a=t?r.leave:r.enter;if(a){if(typeof a=="function")return a;var o=a[e];if(typeof o=="function")return o}}}function Xr(r){return Me(r,{leave:Zf})}var Xf=80,Zf={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return N(e.definitions,`
8
8
 
9
9
  `)+`
10
- `},OperationDefinition:function(e){var t=e.operation,n=e.name,i=pe("(",P(e.variableDefinitions,", "),")"),a=P(e.directives," "),o=e.selectionSet;return!n&&!a&&!i&&t==="query"?o:P([t,P([n,i]),a,o]," ")},VariableDefinition:function(e){var t=e.variable,n=e.type,i=e.defaultValue,a=e.directives;return t+": "+n+pe(" = ",i)+pe(" ",P(a," "))},SelectionSet:function(e){var t=e.selections;return mt(t)},Field:function(e){var t=e.alias,n=e.name,i=e.arguments,a=e.directives,o=e.selectionSet,s=pe("",t,": ")+n,u=s+pe("(",P(i,", "),")");return u.length>Zf&&(u=s+pe(`(
11
- `,Ui(P(i,`
10
+ `},OperationDefinition:function(e){var t=e.operation,n=e.name,i=pe("(",N(e.variableDefinitions,", "),")"),a=N(e.directives," "),o=e.selectionSet;return!n&&!a&&!i&&t==="query"?o:N([t,N([n,i]),a,o]," ")},VariableDefinition:function(e){var t=e.variable,n=e.type,i=e.defaultValue,a=e.directives;return t+": "+n+pe(" = ",i)+pe(" ",N(a," "))},SelectionSet:function(e){var t=e.selections;return mt(t)},Field:function(e){var t=e.alias,n=e.name,i=e.arguments,a=e.directives,o=e.selectionSet,s=pe("",t,": ")+n,u=s+pe("(",N(i,", "),")");return u.length>Xf&&(u=s+pe(`(
11
+ `,Ui(N(i,`
12
12
  `)),`
13
- )`)),P([u,P(a," "),o]," ")},Argument:function(e){var t=e.name,n=e.value;return t+": "+n},FragmentSpread:function(e){var t=e.name,n=e.directives;return"..."+t+pe(" ",P(n," "))},InlineFragment:function(e){var t=e.typeCondition,n=e.directives,i=e.selectionSet;return P(["...",pe("on ",t),P(n," "),i]," ")},FragmentDefinition:function(e){var t=e.name,n=e.typeCondition,i=e.variableDefinitions,a=e.directives,o=e.selectionSet;return"fragment ".concat(t).concat(pe("(",P(i,", "),")")," ")+"on ".concat(n," ").concat(pe("",P(a," ")," "))+o},IntValue:function(e){var t=e.value;return t},FloatValue:function(e){var t=e.value;return t},StringValue:function(e,t){var n=e.value,i=e.block;return i?Xc(n,t==="description"?"":" "):JSON.stringify(n)},BooleanValue:function(e){var t=e.value;return t?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){var t=e.value;return t},ListValue:function(e){var t=e.values;return"["+P(t,", ")+"]"},ObjectValue:function(e){var t=e.fields;return"{"+P(t,", ")+"}"},ObjectField:function(e){var t=e.name,n=e.value;return t+": "+n},Directive:function(e){var t=e.name,n=e.arguments;return"@"+t+pe("(",P(n,", "),")")},NamedType:function(e){var t=e.name;return t},ListType:function(e){var t=e.type;return"["+t+"]"},NonNullType:function(e){var t=e.type;return t+"!"},SchemaDefinition:ht(function(r){var e=r.directives,t=r.operationTypes;return P(["schema",P(e," "),mt(t)]," ")}),OperationTypeDefinition:function(e){var t=e.operation,n=e.type;return t+": "+n},ScalarTypeDefinition:ht(function(r){var e=r.name,t=r.directives;return P(["scalar",e,P(t," ")]," ")}),ObjectTypeDefinition:ht(function(r){var e=r.name,t=r.interfaces,n=r.directives,i=r.fields;return P(["type",e,pe("implements ",P(t," & ")),P(n," "),mt(i)]," ")}),FieldDefinition:ht(function(r){var e=r.name,t=r.arguments,n=r.type,i=r.directives;return e+(Zc(t)?pe(`(
14
- `,Ui(P(t,`
13
+ )`)),N([u,N(a," "),o]," ")},Argument:function(e){var t=e.name,n=e.value;return t+": "+n},FragmentSpread:function(e){var t=e.name,n=e.directives;return"..."+t+pe(" ",N(n," "))},InlineFragment:function(e){var t=e.typeCondition,n=e.directives,i=e.selectionSet;return N(["...",pe("on ",t),N(n," "),i]," ")},FragmentDefinition:function(e){var t=e.name,n=e.typeCondition,i=e.variableDefinitions,a=e.directives,o=e.selectionSet;return"fragment ".concat(t).concat(pe("(",N(i,", "),")")," ")+"on ".concat(n," ").concat(pe("",N(a," ")," "))+o},IntValue:function(e){var t=e.value;return t},FloatValue:function(e){var t=e.value;return t},StringValue:function(e,t){var n=e.value,i=e.block;return i?Yc(n,t==="description"?"":" "):JSON.stringify(n)},BooleanValue:function(e){var t=e.value;return t?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){var t=e.value;return t},ListValue:function(e){var t=e.values;return"["+N(t,", ")+"]"},ObjectValue:function(e){var t=e.fields;return"{"+N(t,", ")+"}"},ObjectField:function(e){var t=e.name,n=e.value;return t+": "+n},Directive:function(e){var t=e.name,n=e.arguments;return"@"+t+pe("(",N(n,", "),")")},NamedType:function(e){var t=e.name;return t},ListType:function(e){var t=e.type;return"["+t+"]"},NonNullType:function(e){var t=e.type;return t+"!"},SchemaDefinition:ht(function(r){var e=r.directives,t=r.operationTypes;return N(["schema",N(e," "),mt(t)]," ")}),OperationTypeDefinition:function(e){var t=e.operation,n=e.type;return t+": "+n},ScalarTypeDefinition:ht(function(r){var e=r.name,t=r.directives;return N(["scalar",e,N(t," ")]," ")}),ObjectTypeDefinition:ht(function(r){var e=r.name,t=r.interfaces,n=r.directives,i=r.fields;return N(["type",e,pe("implements ",N(t," & ")),N(n," "),mt(i)]," ")}),FieldDefinition:ht(function(r){var e=r.name,t=r.arguments,n=r.type,i=r.directives;return e+(Xc(t)?pe(`(
14
+ `,Ui(N(t,`
15
15
  `)),`
16
- )`):pe("(",P(t,", "),")"))+": "+n+pe(" ",P(i," "))}),InputValueDefinition:ht(function(r){var e=r.name,t=r.type,n=r.defaultValue,i=r.directives;return P([e+": "+t,pe("= ",n),P(i," ")]," ")}),InterfaceTypeDefinition:ht(function(r){var e=r.name,t=r.interfaces,n=r.directives,i=r.fields;return P(["interface",e,pe("implements ",P(t," & ")),P(n," "),mt(i)]," ")}),UnionTypeDefinition:ht(function(r){var e=r.name,t=r.directives,n=r.types;return P(["union",e,P(t," "),n&&n.length!==0?"= "+P(n," | "):""]," ")}),EnumTypeDefinition:ht(function(r){var e=r.name,t=r.directives,n=r.values;return P(["enum",e,P(t," "),mt(n)]," ")}),EnumValueDefinition:ht(function(r){var e=r.name,t=r.directives;return P([e,P(t," ")]," ")}),InputObjectTypeDefinition:ht(function(r){var e=r.name,t=r.directives,n=r.fields;return P(["input",e,P(t," "),mt(n)]," ")}),DirectiveDefinition:ht(function(r){var e=r.name,t=r.arguments,n=r.repeatable,i=r.locations;return"directive @"+e+(Zc(t)?pe(`(
17
- `,Ui(P(t,`
16
+ )`):pe("(",N(t,", "),")"))+": "+n+pe(" ",N(i," "))}),InputValueDefinition:ht(function(r){var e=r.name,t=r.type,n=r.defaultValue,i=r.directives;return N([e+": "+t,pe("= ",n),N(i," ")]," ")}),InterfaceTypeDefinition:ht(function(r){var e=r.name,t=r.interfaces,n=r.directives,i=r.fields;return N(["interface",e,pe("implements ",N(t," & ")),N(n," "),mt(i)]," ")}),UnionTypeDefinition:ht(function(r){var e=r.name,t=r.directives,n=r.types;return N(["union",e,N(t," "),n&&n.length!==0?"= "+N(n," | "):""]," ")}),EnumTypeDefinition:ht(function(r){var e=r.name,t=r.directives,n=r.values;return N(["enum",e,N(t," "),mt(n)]," ")}),EnumValueDefinition:ht(function(r){var e=r.name,t=r.directives;return N([e,N(t," ")]," ")}),InputObjectTypeDefinition:ht(function(r){var e=r.name,t=r.directives,n=r.fields;return N(["input",e,N(t," "),mt(n)]," ")}),DirectiveDefinition:ht(function(r){var e=r.name,t=r.arguments,n=r.repeatable,i=r.locations;return"directive @"+e+(Xc(t)?pe(`(
17
+ `,Ui(N(t,`
18
18
  `)),`
19
- )`):pe("(",P(t,", "),")"))+(n?" repeatable":"")+" on "+P(i," | ")}),SchemaExtension:function(e){var t=e.directives,n=e.operationTypes;return P(["extend schema",P(t," "),mt(n)]," ")},ScalarTypeExtension:function(e){var t=e.name,n=e.directives;return P(["extend scalar",t,P(n," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,n=e.interfaces,i=e.directives,a=e.fields;return P(["extend type",t,pe("implements ",P(n," & ")),P(i," "),mt(a)]," ")},InterfaceTypeExtension:function(e){var t=e.name,n=e.interfaces,i=e.directives,a=e.fields;return P(["extend interface",t,pe("implements ",P(n," & ")),P(i," "),mt(a)]," ")},UnionTypeExtension:function(e){var t=e.name,n=e.directives,i=e.types;return P(["extend union",t,P(n," "),i&&i.length!==0?"= "+P(i," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,n=e.directives,i=e.values;return P(["extend enum",t,P(n," "),mt(i)]," ")},InputObjectTypeExtension:function(e){var t=e.name,n=e.directives,i=e.fields;return P(["extend input",t,P(n," "),mt(i)]," ")}};function ht(r){return function(e){return P([e.description,r(e)],`
20
- `)}}function P(r){var e,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(e=r?.filter(function(n){return n}).join(t))!==null&&e!==void 0?e:""}function mt(r){return pe(`{
21
- `,Ui(P(r,`
19
+ )`):pe("(",N(t,", "),")"))+(n?" repeatable":"")+" on "+N(i," | ")}),SchemaExtension:function(e){var t=e.directives,n=e.operationTypes;return N(["extend schema",N(t," "),mt(n)]," ")},ScalarTypeExtension:function(e){var t=e.name,n=e.directives;return N(["extend scalar",t,N(n," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,n=e.interfaces,i=e.directives,a=e.fields;return N(["extend type",t,pe("implements ",N(n," & ")),N(i," "),mt(a)]," ")},InterfaceTypeExtension:function(e){var t=e.name,n=e.interfaces,i=e.directives,a=e.fields;return N(["extend interface",t,pe("implements ",N(n," & ")),N(i," "),mt(a)]," ")},UnionTypeExtension:function(e){var t=e.name,n=e.directives,i=e.types;return N(["extend union",t,N(n," "),i&&i.length!==0?"= "+N(i," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,n=e.directives,i=e.values;return N(["extend enum",t,N(n," "),mt(i)]," ")},InputObjectTypeExtension:function(e){var t=e.name,n=e.directives,i=e.fields;return N(["extend input",t,N(n," "),mt(i)]," ")}};function ht(r){return function(e){return N([e.description,r(e)],`
20
+ `)}}function N(r){var e,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(e=r?.filter(function(n){return n}).join(t))!==null&&e!==void 0?e:""}function mt(r){return pe(`{
21
+ `,Ui(N(r,`
22
22
  `)),`
23
23
  }`)}function pe(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return e!=null&&e!==""?r+e+t:""}function Ui(r){return pe(" ",r.replace(/\n/g,`
24
- `))}function tp(r){return r.indexOf(`
25
- `)!==-1}function Zc(r){return r!=null&&r.some(tp)}function jn(r){return r.kind===we.FIELD||r.kind===we.FRAGMENT_SPREAD||r.kind===we.INLINE_FRAGMENT}function eu(){return typeof ji=="function"?Oo():Oo()}function fp(){__DEV__?T(typeof gr=="boolean",gr):T(typeof gr=="boolean",39)}eu();fp();function Dt(r,e){var t=r.directives;return!t||!t.length?!0:tu(t).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__?T(o!==void 0,"Invalid variable referenced in @".concat(i.name.value," directive.")):T(o!==void 0,40)):o=a.value.value,i.name.value==="skip"?!o:o})}function Zr(r,e,t){var n=new Set(r),i=n.size;return Me(e,{Directive:function(a){if(n.delete(a.name.value)&&(!t||!n.size))return vr}}),t?!n.size:n.size<i}function ko(r){return r&&Zr(["client","export"],r,!0)}function pp(r){var e=r.name.value;return e==="skip"||e==="include"}function tu(r){var e=[];return r&&r.length&&r.forEach(function(t){if(!!pp(t)){var n=t.arguments,i=t.name.value;__DEV__?T(n&&n.length===1,"Incorrect number of arguments for the @".concat(i," directive.")):T(n&&n.length===1,41);var a=n[0];__DEV__?T(a.name&&a.name.value==="if","Invalid argument for the @".concat(i," directive.")):T(a.name&&a.name.value==="if",42);var o=a.value;__DEV__?T(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),"Argument for the @".concat(i," directive must be a variable or a boolean value.")):T(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),43),e.push({directive:t,ifArgument:a})}}),e}function Do(r,e){var t=e,n=[];r.definitions.forEach(function(a){if(a.kind==="OperationDefinition")throw __DEV__?new U("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 U(44);a.kind==="FragmentDefinition"&&n.push(a)}),typeof t>"u"&&(__DEV__?T(n.length===1,"Found ".concat(n.length," fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")):T(n.length===1,45),t=n[0].name.value);var i=m(m({},r),{definitions:Wt([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:t}}]}}],r.definitions,!0)});return i}function br(r){r===void 0&&(r=[]);var e={};return r.forEach(function(t){e[t.name.value]=t}),e}function Cr(r,e){switch(r.kind){case"InlineFragment":return r;case"FragmentSpread":{var t=r.name.value;if(typeof e=="function")return e(t);var n=e&&e[t];return __DEV__?T(n,"No fragment named ".concat(t)):T(n,46),n||null}default:return null}}function z(r){return r!==null&&typeof r=="object"}function Et(r){return{__ref:String(r)}}function W(r){return Boolean(r&&typeof r=="object"&&typeof r.__ref=="string")}function No(r){return z(r)&&r.kind==="Document"&&Array.isArray(r.definitions)}function dp(r){return r.kind==="StringValue"}function hp(r){return r.kind==="BooleanValue"}function mp(r){return r.kind==="IntValue"}function yp(r){return r.kind==="FloatValue"}function gp(r){return r.kind==="Variable"}function vp(r){return r.kind==="ObjectValue"}function bp(r){return r.kind==="ListValue"}function Cp(r){return r.kind==="EnumValue"}function Sp(r){return r.kind==="NullValue"}function Kt(r,e,t,n){if(mp(t)||yp(t))r[e.value]=Number(t.value);else if(hp(t)||dp(t))r[e.value]=t.value;else if(vp(t)){var i={};t.fields.map(function(o){return Kt(i,o.name,o.value,n)}),r[e.value]=i}else if(gp(t)){var a=(n||{})[t.name.value];r[e.value]=a}else if(bp(t))r[e.value]=t.values.map(function(o){var s={};return Kt(s,e,o,n),s[e.value]});else if(Cp(t))r[e.value]=t.value;else if(Sp(t))r[e.value]=null;else throw __DEV__?new U('The inline argument "'.concat(e.value,'" of kind "').concat(t.kind,'"')+"is not supported. Use variables instead of inline arguments to overcome this limitation."):new U(55)}function Po(r,e){var t=null;r.directives&&(t={},r.directives.forEach(function(i){t[i.name.value]={},i.arguments&&i.arguments.forEach(function(a){var o=a.name,s=a.value;return Kt(t[i.name.value],o,s,e)})}));var n=null;return r.arguments&&r.arguments.length&&(n={},r.arguments.forEach(function(i){var a=i.name,o=i.value;return Kt(n,a,o,e)})),qn(r.name.value,n,t)}var wp=["connection","include","skip","client","rest","export"],qn=Object.assign(function(r,e,t){if(e&&t&&t.connection&&t.connection.key)if(t.connection.filter&&t.connection.filter.length>0){var n=t.connection.filter?t.connection.filter:[];n.sort();var i={};return n.forEach(function(s){i[s]=e[s]}),"".concat(t.connection.key,"(").concat(Un(i),")")}else return t.connection.key;var a=r;if(e){var o=Un(e);a+="(".concat(o,")")}return t&&Object.keys(t).forEach(function(s){wp.indexOf(s)===-1&&(t[s]&&Object.keys(t[s]).length?a+="@".concat(s,"(").concat(Un(t[s]),")"):a+="@".concat(s))}),a},{setStringify:function(r){var e=Un;return Un=r,e}}),Un=function(e){return JSON.stringify(e,_p)};function _p(r,e){return z(e)&&!Array.isArray(e)&&(e=Object.keys(e).sort().reduce(function(t,n){return t[n]=e[n],t},{})),e}function Nt(r,e){if(r.arguments&&r.arguments.length){var t={};return r.arguments.forEach(function(n){var i=n.name,a=n.value;return Kt(t,i,a,e)}),t}return null}function at(r){return r.alias?r.alias.value:r.name.value}function Bn(r,e,t){if(typeof r.__typename=="string")return r.__typename;for(var n=0,i=e.selections;n<i.length;n++){var a=i[n];if(et(a)){if(a.name.value==="__typename")return r[at(a)]}else{var o=Bn(r,Cr(a,t).selectionSet,t);if(typeof o=="string")return o}}}function et(r){return r.kind==="Field"}function Ro(r){return r.kind==="InlineFragment"}function en(r){__DEV__?T(r&&r.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'):T(r&&r.kind==="Document",47);var e=r.definitions.filter(function(t){return t.kind!=="FragmentDefinition"}).map(function(t){if(t.kind!=="OperationDefinition")throw __DEV__?new U('Schema type definitions not allowed in queries. Found: "'.concat(t.kind,'"')):new U(48);return t});return __DEV__?T(e.length<=1,"Ambiguous GraphQL document: contains ".concat(e.length," operations")):T(e.length<=1,49),r}function xt(r){return en(r),r.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function tn(r){return r.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function Sr(r){return r.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function Vn(r){var e=xt(r);return __DEV__?T(e&&e.operation==="query","Must contain a query definition."):T(e&&e.operation==="query",50),e}function Lo(r){__DEV__?T(r.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'):T(r.kind==="Document",51),__DEV__?T(r.definitions.length<=1,"Fragment must have exactly one definition."):T(r.definitions.length<=1,52);var e=r.definitions[0];return __DEV__?T(e.kind==="FragmentDefinition","Must be a fragment definition."):T(e.kind==="FragmentDefinition",53),e}function wr(r){en(r);for(var e,t=0,n=r.definitions;t<n.length;t++){var i=n[t];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 U("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new U(54)}function _r(r){var e=Object.create(null),t=r&&r.variableDefinitions;return t&&t.length&&t.forEach(function(n){n.defaultValue&&Kt(e,n.variable.name,n.defaultValue)}),e}var ne=Array.isArray;function xe(r){return Array.isArray(r)&&r.length>0}var ru={kind:we.FIELD,name:{kind:we.NAME,value:"__typename"}};function iu(r,e){return!r||r.selectionSet.selections.every(function(t){return t.kind===we.FRAGMENT_SPREAD&&iu(e[t.name.value],e)})}function Ep(r){return iu(xt(r)||Lo(r),br(Sr(r)))?null:r}function xp(r){var e=new Set,t=[];return r.forEach(function(n){n.name?e.add(n.name):n.test&&t.push(n.test)}),function(n){return e.has(n.name.value)||t.some(function(i){return i(n)})}}function nu(r){var e=new Map;return function(n){n===void 0&&(n=r);var i=e.get(n);return i||e.set(n,i={variables:new Set,fragmentSpreads:new Set}),i}}function Fo(r,e){for(var t=nu(""),n=nu(""),i=function(b){for(var S=0,O=void 0;S<b.length&&(O=b[S]);++S)if(!ne(O)){if(O.kind===we.OPERATION_DEFINITION)return t(O.name&&O.name.value);if(O.kind===we.FRAGMENT_DEFINITION)return n(O.name.value)}return __DEV__&&T.error("Could not find operation or fragment"),null},a=0,o=e.definitions.length-1;o>=0;--o)e.definitions[o].kind===we.OPERATION_DEFINITION&&++a;var s=xp(r),u=r.some(function(b){return b.remove}),l=function(b){return u&&b&&b.some(s)},f=new Map,p=!1,h={enter:function(b){if(l(b.directives))return p=!0,null}},d=Me(e,{Field:h,InlineFragment:h,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(b,S,O,k,N){var I=i(N);I&&I.variables.add(b.name.value)}},FragmentSpread:{enter:function(b,S,O,k,N){if(l(b.directives))return p=!0,null;var I=i(N);I&&I.fragmentSpreads.add(b.name.value)}},FragmentDefinition:{enter:function(b,S,O,k){f.set(JSON.stringify(k),b)},leave:function(b,S,O,k){var N=f.get(JSON.stringify(k));if(b===N)return b;if(a>0&&b.selectionSet.selections.every(function(I){return I.kind===we.FIELD&&I.name.value==="__typename"}))return n(b.name.value).removed=!0,p=!0,null}},Directive:{leave:function(b){if(s(b))return p=!0,null}}});if(!p)return e;var y=function(b){return b.transitiveVars||(b.transitiveVars=new Set(b.variables),b.removed||b.fragmentSpreads.forEach(function(S){y(n(S)).transitiveVars.forEach(function(O){b.transitiveVars.add(O)})})),b},g=new Set;d.definitions.forEach(function(b){b.kind===we.OPERATION_DEFINITION?y(t(b.name&&b.name.value)).fragmentSpreads.forEach(function(S){g.add(S)}):b.kind===we.FRAGMENT_DEFINITION&&a===0&&!n(b.name.value).removed&&g.add(b.name.value)}),g.forEach(function(b){y(n(b)).fragmentSpreads.forEach(function(S){g.add(S)})});var C=function(b){return!!(!g.has(b)||n(b).removed)},_={enter:function(b){if(C(b.name.value))return null}};return Ep(Me(d,{FragmentSpread:_,FragmentDefinition:_,OperationDefinition:{leave:function(b){if(b.variableDefinitions){var S=y(t(b.name&&b.name.value)).transitiveVars;if(S.size<b.variableDefinitions.length)return m(m({},b),{variableDefinitions:b.variableDefinitions.filter(function(O){return S.has(O.variable.name.value)})})}}}}))}var Er=Object.assign(function(r){return Me(r,{SelectionSet:{enter:function(e,t,n){if(!(n&&n.kind===we.OPERATION_DEFINITION)){var i=e.selections;if(!!i){var a=i.some(function(s){return et(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=n;if(!(et(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return m(m({},e),{selections:Wt(Wt([],i,!0),[ru],!1)})}}}}}})},{added:function(r){return r===ru}}),Op={test:function(r){var e=r.name.value==="connection";return e&&(!r.arguments||!r.arguments.some(function(t){return t.name.value==="key"}))&&__DEV__&&T.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 $o(r){return Fo([Op],en(r))}function Mo(r){var e=wr(r),t=e.operation;if(t==="query")return r;var n=Me(r,{OperationDefinition:{enter:function(i){return m(m({},i),{operation:"query"})}}});return n}function jo(r){en(r);var e=Fo([{test:function(t){return t.name.value==="client"},remove:!0}],r);return e}var Tp=Object.prototype.hasOwnProperty;function Uo(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return Qn(r)}function Qn(r){var e=r[0]||{},t=r.length;if(t>1)for(var n=new ze,i=1;i<t;++i)e=n.merge(e,r[i]);return e}var Ap=function(r,e,t){return this.merge(r[t],e[t])},ze=function(){function r(e){e===void 0&&(e=Ap),this.reconciler=e,this.isObject=z,this.pastCopies=new Set}return r.prototype.merge=function(e,t){for(var n=this,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];return z(t)&&z(e)?(Object.keys(t).forEach(function(o){if(Tp.call(e,o)){var s=e[o];if(t[o]!==s){var u=n.reconciler.apply(n,Wt([e,t,o],i,!1));u!==s&&(e=n.shallowCopyForMerge(e),e[o]=u)}}else e=n.shallowCopyForMerge(e),e[o]=t[o]}),e):t},r.prototype.shallowCopyForMerge=function(e){return z(e)&&(this.pastCopies.has(e)||(Array.isArray(e)?e=e.slice(0):e=m({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},r}();function Ip(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t)return(t=t.call(r)).next.bind(t);if(Array.isArray(r)||(t=kp(r))||e&&r&&typeof r.length=="number"){t&&(r=t);var n=0;return function(){return n>=r.length?{done:!0}:{done:!1,value:r[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 kp(r,e){if(!!r){if(typeof r=="string")return au(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return au(r,e)}}function au(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function ou(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function Qo(r,e,t){return e&&ou(r.prototype,e),t&&ou(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}var Wo=function(){return typeof Symbol=="function"},Go=function(r){return Wo()&&Boolean(Symbol[r])},Ko=function(r){return Go(r)?Symbol[r]:"@@"+r};Wo()&&!Go("observable")&&(Symbol.observable=Symbol("observable"));var Dp=Ko("iterator"),Bo=Ko("observable"),su=Ko("species");function Bi(r,e){var t=r[e];if(t!=null){if(typeof t!="function")throw new TypeError(t+" is not a function");return t}}function Wn(r){var e=r.constructor;return e!==void 0&&(e=e[su],e===null&&(e=void 0)),e!==void 0?e:Q}function Np(r){return r instanceof Q}function rn(r){rn.log?rn.log(r):setTimeout(function(){throw r})}function qi(r){Promise.resolve().then(function(){try{r()}catch(e){rn(e)}})}function cu(r){var e=r._cleanup;if(e!==void 0&&(r._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var t=Bi(e,"unsubscribe");t&&t.call(e)}}catch(n){rn(n)}}function Vo(r){r._observer=void 0,r._queue=void 0,r._state="closed"}function Pp(r){var e=r._queue;if(!!e){r._queue=void 0,r._state="ready";for(var t=0;t<e.length&&(uu(r,e[t].type,e[t].value),r._state!=="closed");++t);}}function uu(r,e,t){r._state="running";var n=r._observer;try{var i=Bi(n,e);switch(e){case"next":i&&i.call(n,t);break;case"error":if(Vo(r),i)i.call(n,t);else throw t;break;case"complete":Vo(r),i&&i.call(n);break}}catch(a){rn(a)}r._state==="closed"?cu(r):r._state==="running"&&(r._state="ready")}function qo(r,e,t){if(r._state!=="closed"){if(r._state==="buffering"){r._queue.push({type:e,value:t});return}if(r._state!=="ready"){r._state="buffering",r._queue=[{type:e,value:t}],qi(function(){return Pp(r)});return}uu(r,e,t)}}var Rp=function(){function r(t,n){this._cleanup=void 0,this._observer=t,this._queue=void 0,this._state="initializing";var i=new Lp(this);try{this._cleanup=n.call(void 0,i)}catch(a){i.error(a)}this._state==="initializing"&&(this._state="ready")}var e=r.prototype;return e.unsubscribe=function(){this._state!=="closed"&&(Vo(this),cu(this))},Qo(r,[{key:"closed",get:function(){return this._state==="closed"}}]),r}(),Lp=function(){function r(t){this._subscription=t}var e=r.prototype;return e.next=function(n){qo(this._subscription,"next",n)},e.error=function(n){qo(this._subscription,"error",n)},e.complete=function(){qo(this._subscription,"complete")},Qo(r,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),r}(),Q=function(){function r(t){if(!(this instanceof r))throw new TypeError("Observable cannot be called as a function");if(typeof t!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=t}var e=r.prototype;return e.subscribe=function(n){return(typeof n!="object"||n===null)&&(n={next:n,error:arguments[1],complete:arguments[2]}),new Rp(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(l){try{n(l,s)}catch(f){o(f),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=Wn(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=Wn(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=Wn(this),o=arguments.length>1,s=!1,u=arguments[1],l=u;return new a(function(f){return i.subscribe({next:function(p){var h=!s;if(s=!0,!h||o)try{l=n(l,p)}catch(d){return f.error(d)}else l=p},error:function(p){f.error(p)},complete:function(){if(!s&&!o)return f.error(new TypeError("Cannot reduce an empty sequence"));f.next(l),f.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=Wn(this);return new s(function(u){var l,f=0;function p(h){l=h.subscribe({next:function(d){u.next(d)},error:function(d){u.error(d)},complete:function(){f===a.length?(l=void 0,u.complete()):p(s.from(a[f++]))}})}return p(n),function(){l&&(l.unsubscribe(),l=void 0)}})},e.flatMap=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Wn(this);return new a(function(o){var s=[],u=i.subscribe({next:function(f){if(n)try{f=n(f)}catch(h){return o.error(h)}var p=a.from(f).subscribe({next:function(h){o.next(h)},error:function(h){o.error(h)},complete:function(){var h=s.indexOf(p);h>=0&&s.splice(h,1),l()}});s.push(p)},error:function(f){o.error(f)},complete:function(){l()}});function l(){u.closed&&s.length===0&&o.complete()}return function(){s.forEach(function(f){return f.unsubscribe()}),u.unsubscribe()}})},e[Bo]=function(){return this},r.from=function(n){var i=typeof this=="function"?this:r;if(n==null)throw new TypeError(n+" is not an object");var a=Bi(n,Bo);if(a){var o=a.call(n);if(Object(o)!==o)throw new TypeError(o+" is not an object");return Np(o)&&o.constructor===i?o:new i(function(s){return o.subscribe(s)})}if(Go("iterator")&&(a=Bi(n,Dp),a))return new i(function(s){qi(function(){if(!s.closed){for(var u=Ip(a.call(n)),l;!(l=u()).done;){var f=l.value;if(s.next(f),s.closed)return}s.complete()}})});if(Array.isArray(n))return new i(function(s){qi(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")},r.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:r;return new o(function(s){qi(function(){if(!s.closed){for(var u=0;u<i.length;++u)if(s.next(i[u]),s.closed)return;s.complete()}})})},Qo(r,null,[{key:su,get:function(){return this}}]),r}();Wo()&&Object.defineProperty(Q,Symbol("extensions"),{value:{symbol:Bo,hostReportError:rn},configurable:!0});function zo(r){var e,t=r.Symbol;if(typeof t=="function")if(t.observable)e=t.observable;else{typeof t.for=="function"?e=t.for("https://github.com/benlesh/symbol-observable"):e=t("https://github.com/benlesh/symbol-observable");try{t.observable=e}catch{}}else e="@@observable";return e}var nn;typeof self<"u"?nn=self:typeof window<"u"?nn=window:typeof global<"u"?nn=global:typeof module<"u"?nn=module:nn=Function("return this")();var k3=zo(nn);var lu=Q.prototype,fu="@@observable";lu[fu]||(lu[fu]=function(){return this});var Fp=Object.prototype.toString;function Vi(r){return Ho(r)}function Ho(r,e){switch(Fp.call(r)){case"[object Array]":{if(e=e||new Map,e.has(r))return e.get(r);var t=r.slice(0);return e.set(r,t),t.forEach(function(i,a){t[a]=Ho(i,e)}),t}case"[object Object]":{if(e=e||new Map,e.has(r))return e.get(r);var n=Object.create(Object.getPrototypeOf(r));return e.set(r,n),Object.keys(r).forEach(function(i){n[i]=Ho(r[i],e)}),n}default:return r}}function $p(r){var e=new Set([r]);return e.forEach(function(t){z(t)&&Mp(t)===t&&Object.getOwnPropertyNames(t).forEach(function(n){z(t[n])&&e.add(t[n])})}),r}function Mp(r){if(__DEV__&&!Object.isFrozen(r))try{Object.freeze(r)}catch(e){if(e instanceof TypeError)return null;throw e}return r}function Gn(r){return __DEV__&&$p(r),r}function xr(r,e,t){var n=[];r.forEach(function(i){return i[e]&&n.push(i)}),n.forEach(function(i){return i[e](t)})}function Qi(r,e,t){return new Q(function(n){var i=n.next,a=n.error,o=n.complete,s=0,u=!1,l={then:function(d){return new Promise(function(y){return y(d())})}};function f(d,y){return d?function(g){++s;var C=function(){return d(g)};l=l.then(C,C).then(function(_){--s,i&&i.call(n,_),u&&p.complete()},function(_){throw--s,_}).catch(function(_){a&&a.call(n,_)})}:function(g){return y&&y.call(n,g)}}var p={next:f(e,i),error:f(t,a),complete:function(){u=!0,s||o&&o.call(n)}},h=r.subscribe(p);return function(){return h.unsubscribe()}})}var ot=typeof WeakMap=="function"&&Ie(function(){return navigator.product})!=="ReactNative",pu=typeof WeakSet=="function",Jo=typeof Symbol=="function"&&typeof Symbol.for=="function",zt=Jo&&Symbol.asyncIterator,V3=typeof Ie(function(){return window.document.createElement})=="function",Q3=Ie(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1;function Wi(r){function e(t){Object.defineProperty(r,t,{value:Q})}return Jo&&Symbol.species&&e(Symbol.species),e("@@species"),r}function du(r){return r&&typeof r.then=="function"}var an=function(r){ge(e,r);function e(t){var n=r.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),xr(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),xr(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?du(u)?u.then(function(l){return n.sub=l.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"),xr(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 t=="function"&&(t=[new Q(t)]),du(t)?t.then(function(i){return n.start(i)},n.handlers.error):n.start(t),n}return e.prototype.start=function(t){this.sub===void 0&&(this.sources=Array.from(t),this.handlers.complete())},e.prototype.deliverLastMessage=function(t){if(this.latest){var n=this.latest[0],i=t[n];i&&i.call(t,this.latest[1]),this.sub===null&&n==="next"&&t.complete&&t.complete()}},e.prototype.addObserver=function(t){this.observers.has(t)||(this.deliverLastMessage(t),this.observers.add(t))},e.prototype.removeObserver=function(t){this.observers.delete(t)&&this.observers.size<1&&this.handlers.complete()},e.prototype.notify=function(t,n){var i=this.nextResultListeners;i.size&&(this.nextResultListeners=new Set,i.forEach(function(a){return a(t,n)}))},e.prototype.beforeNext=function(t){var n=!1;this.nextResultListeners.add(function(i,a){n||(n=!0,t(i,a))})},e}(Q);Wi(an);function Ht(r){return"incremental"in r}function jp(r){return"hasNext"in r&&"data"in r}function hu(r){return Ht(r)||jp(r)}function Gi(r,e){var t=r,n=new ze;return Ht(e)&&xe(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],l=!isNaN(+u),f=l?[]:{};f[u]=a,a=f}t=n.merge(t,a)}),t}function on(r){var e=Ki(r);return xe(e)}function Ki(r){var e=xe(r.errors)?r.errors.slice(0):[];return Ht(r)&&xe(r.incremental)&&r.incremental.forEach(function(t){t.errors&&e.push.apply(e,t.errors)}),e}function Jt(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=Object.create(null);return r.forEach(function(n){!n||Object.keys(n).forEach(function(i){var a=n[i];a!==void 0&&(t[i]=a)})}),t}var mu=new Map;function Kn(r){var e=mu.get(r)||1;return mu.set(r,e+1),"".concat(r,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function yu(r){var e=Kn("stringifyForDisplay");return JSON.stringify(r,function(t,n){return n===void 0?e:n}).split(JSON.stringify(e)).join("<undefined>")}function zn(r,e){return Jt(r,e,e.variables&&{variables:m(m({},r&&r.variables),e.variables)})}function zi(r){return new Q(function(e){e.error(r)})}var Hn=function(r,e,t){var n=new Error(t);throw n.name="ServerError",n.response=r,n.statusCode=r.status,n.result=e,n};function Yo(r){for(var e=["query","operationName","variables","extensions","context"],t=0,n=Object.keys(r);t<n.length;t++){var i=n[t];if(e.indexOf(i)<0)throw __DEV__?new U("illegal argument: ".concat(i)):new U(27)}return r}function Xo(r,e){var t=m({},r),n=function(a){typeof a=="function"?t=m(m({},t),a(t)):t=m(m({},t),a)},i=function(){return m({},t)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:n}),Object.defineProperty(e,"getContext",{enumerable:!1,value:i}),e}function Zo(r){var e={variables:r.variables||{},extensions:r.extensions||{},operationName:r.operationName,query:r.query};return e.operationName||(e.operationName=typeof e.query!="string"?tn(e.query)||void 0:""),e}function gu(r,e){return e?e(r):Q.of()}function Jn(r){return typeof r=="function"?new st(r):r}function Hi(r){return r.request.length<=1}var Up=function(r){ge(e,r);function e(t,n){var i=r.call(this,t)||this;return i.link=n,i}return e}(Error),st=function(){function r(e){e&&(this.request=e)}return r.empty=function(){return new r(function(){return Q.of()})},r.from=function(e){return e.length===0?r.empty():e.map(Jn).reduce(function(t,n){return t.concat(n)})},r.split=function(e,t,n){var i=Jn(t),a=Jn(n||new r(gu));return Hi(i)&&Hi(a)?new r(function(o){return e(o)?i.request(o)||Q.of():a.request(o)||Q.of()}):new r(function(o,s){return e(o)?i.request(o,s)||Q.of():a.request(o,s)||Q.of()})},r.execute=function(e,t){return e.request(Xo(t.context,Zo(Yo(t))))||Q.of()},r.concat=function(e,t){var n=Jn(e);if(Hi(n))return __DEV__&&T.warn(new Up("You are calling concat on a terminating link, which will have no effect",n)),n;var i=Jn(t);return Hi(i)?new r(function(a){return n.request(a,function(o){return i.request(o)||Q.of()})||Q.of()}):new r(function(a,o){return n.request(a,function(s){return i.request(s,o)||Q.of()})||Q.of()})},r.prototype.split=function(e,t,n){return this.concat(r.split(e,t,n||new r(gu)))},r.prototype.concat=function(e){return r.concat(this,e)},r.prototype.request=function(e,t){throw __DEV__?new U("request is not implemented"):new U(22)},r.prototype.onError=function(e,t){if(t&&t.error)return t.error(e),!1;throw e},r.prototype.setOnError=function(e){return this.onError=e,this},r}();var sn=st.execute;var vu="3.7.10";function bu(r){return!!r.body}function Cu(r){return!!r.getReader}function Su(r){return!!(zt&&r[Symbol.asyncIterator])}function wu(r){return!!r.stream}function _u(r){return!!r.arrayBuffer}function Eu(r){return!!r.pipe}function es(r){var e,t=r[Symbol.asyncIterator]();return e={next:function(){return t.next()}},e[Symbol.asyncIterator]=function(){return this},e}function ts(r){var e=null,t=null,n=!1,i=[],a=[];function o(p){if(!t){if(a.length){var h=a.shift();if(Array.isArray(h)&&h[0])return h[0]({value:p,done:!1})}i.push(p)}}function s(p){t=p;var h=a.slice();h.forEach(function(d){d[1](p)}),!e||e()}function u(){n=!0;var p=a.slice();p.forEach(function(h){h[0]({value:void 0,done:!0})}),!e||e()}e=function(){e=null,r.removeListener("data",o),r.removeListener("error",s),r.removeListener("end",u),r.removeListener("finish",u),r.removeListener("close",u)},r.on("data",o),r.on("error",s),r.on("end",u),r.on("finish",u),r.on("close",u);function l(){return new Promise(function(p,h){if(t)return h(t);if(i.length)return p({value:i.shift(),done:!1});if(n)return p({value:void 0,done:!0});a.push([p,h])})}var f={next:function(){return l()}};return zt&&(f[Symbol.asyncIterator]=function(){return this}),f}function rs(r){var e=!1,t={next:function(){return e?Promise.resolve({value:void 0,done:!0}):(e=!0,new Promise(function(n,i){r.then(function(a){n({value:a,done:!1})}).catch(i)}))}};return zt&&(t[Symbol.asyncIterator]=function(){return this}),t}function Ji(r){var e={next:function(){return r.read()}};return zt&&(e[Symbol.asyncIterator]=function(){return this}),e}function xu(r){var e=r;if(bu(r)&&(e=r.body),Su(e))return es(e);if(Cu(e))return Ji(e.getReader());if(wu(e))return Ji(e.stream().getReader());if(_u(e))return rs(e.arrayBuffer());if(Eu(e))return ts(e);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var Ou=Object.prototype.hasOwnProperty;function Tu(r,e){var t,n,i;return pt(this,void 0,void 0,function(){var a,o,s,u,l,f,p,h,d,y,g,C,_,b,S,O,k,N,I,R;return dt(this,function(re){switch(re.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=(t=r.headers)===null||t===void 0?void 0:t.get("content-type"),s="boundary=",u=o?.includes(s)?o?.substring(o?.indexOf(s)+s.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",l="--".concat(u),f="",p=xu(r),h=!0,re.label=1;case 1:return h?[4,p.next()]:[3,3];case 2:for(d=re.sent(),y=d.value,g=d.done,C=typeof y=="string"?y:a.decode(y),h=!g,f+=C,_=f.indexOf(l);_>-1;){if(b=void 0,R=[f.slice(0,_),f.slice(_+l.length)],b=R[0],f=R[1],b.trim()){if(S=b.indexOf(`\r
24
+ `))}function ep(r){return r.indexOf(`
25
+ `)!==-1}function Xc(r){return r!=null&&r.some(ep)}function jn(r){return r.kind===we.FIELD||r.kind===we.FRAGMENT_SPREAD||r.kind===we.INLINE_FRAGMENT}function Zc(){return typeof ji=="function"?Oo():Oo()}function lp(){__DEV__?T(typeof gr=="boolean",gr):T(typeof gr=="boolean",39)}Zc();lp();function Dt(r,e){var t=r.directives;return!t||!t.length?!0:eu(t).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__?T(o!==void 0,"Invalid variable referenced in @".concat(i.name.value," directive.")):T(o!==void 0,40)):o=a.value.value,i.name.value==="skip"?!o:o})}function Zr(r,e,t){var n=new Set(r),i=n.size;return Me(e,{Directive:function(a){if(n.delete(a.name.value)&&(!t||!n.size))return vr}}),t?!n.size:n.size<i}function ko(r){return r&&Zr(["client","export"],r,!0)}function fp(r){var e=r.name.value;return e==="skip"||e==="include"}function eu(r){var e=[];return r&&r.length&&r.forEach(function(t){if(!!fp(t)){var n=t.arguments,i=t.name.value;__DEV__?T(n&&n.length===1,"Incorrect number of arguments for the @".concat(i," directive.")):T(n&&n.length===1,41);var a=n[0];__DEV__?T(a.name&&a.name.value==="if","Invalid argument for the @".concat(i," directive.")):T(a.name&&a.name.value==="if",42);var o=a.value;__DEV__?T(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),"Argument for the @".concat(i," directive must be a variable or a boolean value.")):T(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),43),e.push({directive:t,ifArgument:a})}}),e}function Do(r,e){var t=e,n=[];r.definitions.forEach(function(a){if(a.kind==="OperationDefinition")throw __DEV__?new U("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 U(44);a.kind==="FragmentDefinition"&&n.push(a)}),typeof t>"u"&&(__DEV__?T(n.length===1,"Found ".concat(n.length," fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")):T(n.length===1,45),t=n[0].name.value);var i=m(m({},r),{definitions:Wt([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:t}}]}}],r.definitions,!0)});return i}function br(r){r===void 0&&(r=[]);var e={};return r.forEach(function(t){e[t.name.value]=t}),e}function Cr(r,e){switch(r.kind){case"InlineFragment":return r;case"FragmentSpread":{var t=r.name.value;if(typeof e=="function")return e(t);var n=e&&e[t];return __DEV__?T(n,"No fragment named ".concat(t)):T(n,46),n||null}default:return null}}function z(r){return r!==null&&typeof r=="object"}function Et(r){return{__ref:String(r)}}function W(r){return Boolean(r&&typeof r=="object"&&typeof r.__ref=="string")}function Po(r){return z(r)&&r.kind==="Document"&&Array.isArray(r.definitions)}function pp(r){return r.kind==="StringValue"}function dp(r){return r.kind==="BooleanValue"}function hp(r){return r.kind==="IntValue"}function mp(r){return r.kind==="FloatValue"}function yp(r){return r.kind==="Variable"}function gp(r){return r.kind==="ObjectValue"}function vp(r){return r.kind==="ListValue"}function bp(r){return r.kind==="EnumValue"}function Cp(r){return r.kind==="NullValue"}function Kt(r,e,t,n){if(hp(t)||mp(t))r[e.value]=Number(t.value);else if(dp(t)||pp(t))r[e.value]=t.value;else if(gp(t)){var i={};t.fields.map(function(o){return Kt(i,o.name,o.value,n)}),r[e.value]=i}else if(yp(t)){var a=(n||{})[t.name.value];r[e.value]=a}else if(vp(t))r[e.value]=t.values.map(function(o){var s={};return Kt(s,e,o,n),s[e.value]});else if(bp(t))r[e.value]=t.value;else if(Cp(t))r[e.value]=null;else throw __DEV__?new U('The inline argument "'.concat(e.value,'" of kind "').concat(t.kind,'"')+"is not supported. Use variables instead of inline arguments to overcome this limitation."):new U(55)}function No(r,e){var t=null;r.directives&&(t={},r.directives.forEach(function(i){t[i.name.value]={},i.arguments&&i.arguments.forEach(function(a){var o=a.name,s=a.value;return Kt(t[i.name.value],o,s,e)})}));var n=null;return r.arguments&&r.arguments.length&&(n={},r.arguments.forEach(function(i){var a=i.name,o=i.value;return Kt(n,a,o,e)})),qn(r.name.value,n,t)}var Sp=["connection","include","skip","client","rest","export"],qn=Object.assign(function(r,e,t){if(e&&t&&t.connection&&t.connection.key)if(t.connection.filter&&t.connection.filter.length>0){var n=t.connection.filter?t.connection.filter:[];n.sort();var i={};return n.forEach(function(s){i[s]=e[s]}),"".concat(t.connection.key,"(").concat(Un(i),")")}else return t.connection.key;var a=r;if(e){var o=Un(e);a+="(".concat(o,")")}return t&&Object.keys(t).forEach(function(s){Sp.indexOf(s)===-1&&(t[s]&&Object.keys(t[s]).length?a+="@".concat(s,"(").concat(Un(t[s]),")"):a+="@".concat(s))}),a},{setStringify:function(r){var e=Un;return Un=r,e}}),Un=function(e){return JSON.stringify(e,wp)};function wp(r,e){return z(e)&&!Array.isArray(e)&&(e=Object.keys(e).sort().reduce(function(t,n){return t[n]=e[n],t},{})),e}function Pt(r,e){if(r.arguments&&r.arguments.length){var t={};return r.arguments.forEach(function(n){var i=n.name,a=n.value;return Kt(t,i,a,e)}),t}return null}function at(r){return r.alias?r.alias.value:r.name.value}function Bn(r,e,t){if(typeof r.__typename=="string")return r.__typename;for(var n=0,i=e.selections;n<i.length;n++){var a=i[n];if(et(a)){if(a.name.value==="__typename")return r[at(a)]}else{var o=Bn(r,Cr(a,t).selectionSet,t);if(typeof o=="string")return o}}}function et(r){return r.kind==="Field"}function Ro(r){return r.kind==="InlineFragment"}function en(r){__DEV__?T(r&&r.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'):T(r&&r.kind==="Document",47);var e=r.definitions.filter(function(t){return t.kind!=="FragmentDefinition"}).map(function(t){if(t.kind!=="OperationDefinition")throw __DEV__?new U('Schema type definitions not allowed in queries. Found: "'.concat(t.kind,'"')):new U(48);return t});return __DEV__?T(e.length<=1,"Ambiguous GraphQL document: contains ".concat(e.length," operations")):T(e.length<=1,49),r}function xt(r){return en(r),r.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function tn(r){return r.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function Sr(r){return r.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function Vn(r){var e=xt(r);return __DEV__?T(e&&e.operation==="query","Must contain a query definition."):T(e&&e.operation==="query",50),e}function Lo(r){__DEV__?T(r.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'):T(r.kind==="Document",51),__DEV__?T(r.definitions.length<=1,"Fragment must have exactly one definition."):T(r.definitions.length<=1,52);var e=r.definitions[0];return __DEV__?T(e.kind==="FragmentDefinition","Must be a fragment definition."):T(e.kind==="FragmentDefinition",53),e}function wr(r){en(r);for(var e,t=0,n=r.definitions;t<n.length;t++){var i=n[t];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 U("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new U(54)}function _r(r){var e=Object.create(null),t=r&&r.variableDefinitions;return t&&t.length&&t.forEach(function(n){n.defaultValue&&Kt(e,n.variable.name,n.defaultValue)}),e}var ne=Array.isArray;function xe(r){return Array.isArray(r)&&r.length>0}var tu={kind:we.FIELD,name:{kind:we.NAME,value:"__typename"}};function nu(r,e){return!r||r.selectionSet.selections.every(function(t){return t.kind===we.FRAGMENT_SPREAD&&nu(e[t.name.value],e)})}function _p(r){return nu(xt(r)||Lo(r),br(Sr(r)))?null:r}function Ep(r){var e=new Set,t=[];return r.forEach(function(n){n.name?e.add(n.name):n.test&&t.push(n.test)}),function(n){return e.has(n.name.value)||t.some(function(i){return i(n)})}}function ru(r){var e=new Map;return function(n){n===void 0&&(n=r);var i=e.get(n);return i||e.set(n,i={variables:new Set,fragmentSpreads:new Set}),i}}function Fo(r,e){for(var t=ru(""),n=ru(""),i=function(b){for(var S=0,O=void 0;S<b.length&&(O=b[S]);++S)if(!ne(O)){if(O.kind===we.OPERATION_DEFINITION)return t(O.name&&O.name.value);if(O.kind===we.FRAGMENT_DEFINITION)return n(O.name.value)}return __DEV__&&T.error("Could not find operation or fragment"),null},a=0,o=e.definitions.length-1;o>=0;--o)e.definitions[o].kind===we.OPERATION_DEFINITION&&++a;var s=Ep(r),u=r.some(function(b){return b.remove}),l=function(b){return u&&b&&b.some(s)},f=new Map,p=!1,h={enter:function(b){if(l(b.directives))return p=!0,null}},d=Me(e,{Field:h,InlineFragment:h,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(b,S,O,k,P){var I=i(P);I&&I.variables.add(b.name.value)}},FragmentSpread:{enter:function(b,S,O,k,P){if(l(b.directives))return p=!0,null;var I=i(P);I&&I.fragmentSpreads.add(b.name.value)}},FragmentDefinition:{enter:function(b,S,O,k){f.set(JSON.stringify(k),b)},leave:function(b,S,O,k){var P=f.get(JSON.stringify(k));if(b===P)return b;if(a>0&&b.selectionSet.selections.every(function(I){return I.kind===we.FIELD&&I.name.value==="__typename"}))return n(b.name.value).removed=!0,p=!0,null}},Directive:{leave:function(b){if(s(b))return p=!0,null}}});if(!p)return e;var y=function(b){return b.transitiveVars||(b.transitiveVars=new Set(b.variables),b.removed||b.fragmentSpreads.forEach(function(S){y(n(S)).transitiveVars.forEach(function(O){b.transitiveVars.add(O)})})),b},g=new Set;d.definitions.forEach(function(b){b.kind===we.OPERATION_DEFINITION?y(t(b.name&&b.name.value)).fragmentSpreads.forEach(function(S){g.add(S)}):b.kind===we.FRAGMENT_DEFINITION&&a===0&&!n(b.name.value).removed&&g.add(b.name.value)}),g.forEach(function(b){y(n(b)).fragmentSpreads.forEach(function(S){g.add(S)})});var C=function(b){return!!(!g.has(b)||n(b).removed)},_={enter:function(b){if(C(b.name.value))return null}};return _p(Me(d,{FragmentSpread:_,FragmentDefinition:_,OperationDefinition:{leave:function(b){if(b.variableDefinitions){var S=y(t(b.name&&b.name.value)).transitiveVars;if(S.size<b.variableDefinitions.length)return m(m({},b),{variableDefinitions:b.variableDefinitions.filter(function(O){return S.has(O.variable.name.value)})})}}}}))}var Er=Object.assign(function(r){return Me(r,{SelectionSet:{enter:function(e,t,n){if(!(n&&n.kind===we.OPERATION_DEFINITION)){var i=e.selections;if(!!i){var a=i.some(function(s){return et(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=n;if(!(et(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return m(m({},e),{selections:Wt(Wt([],i,!0),[tu],!1)})}}}}}})},{added:function(r){return r===tu}}),xp={test:function(r){var e=r.name.value==="connection";return e&&(!r.arguments||!r.arguments.some(function(t){return t.name.value==="key"}))&&__DEV__&&T.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 $o(r){return Fo([xp],en(r))}function Mo(r){var e=wr(r),t=e.operation;if(t==="query")return r;var n=Me(r,{OperationDefinition:{enter:function(i){return m(m({},i),{operation:"query"})}}});return n}function jo(r){en(r);var e=Fo([{test:function(t){return t.name.value==="client"},remove:!0}],r);return e}var Op=Object.prototype.hasOwnProperty;function Uo(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return Qn(r)}function Qn(r){var e=r[0]||{},t=r.length;if(t>1)for(var n=new ze,i=1;i<t;++i)e=n.merge(e,r[i]);return e}var Tp=function(r,e,t){return this.merge(r[t],e[t])},ze=function(){function r(e){e===void 0&&(e=Tp),this.reconciler=e,this.isObject=z,this.pastCopies=new Set}return r.prototype.merge=function(e,t){for(var n=this,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];return z(t)&&z(e)?(Object.keys(t).forEach(function(o){if(Op.call(e,o)){var s=e[o];if(t[o]!==s){var u=n.reconciler.apply(n,Wt([e,t,o],i,!1));u!==s&&(e=n.shallowCopyForMerge(e),e[o]=u)}}else e=n.shallowCopyForMerge(e),e[o]=t[o]}),e):t},r.prototype.shallowCopyForMerge=function(e){return z(e)&&(this.pastCopies.has(e)||(Array.isArray(e)?e=e.slice(0):e=m({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},r}();function Ap(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t)return(t=t.call(r)).next.bind(t);if(Array.isArray(r)||(t=Ip(r))||e&&r&&typeof r.length=="number"){t&&(r=t);var n=0;return function(){return n>=r.length?{done:!0}:{done:!1,value:r[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 Ip(r,e){if(!!r){if(typeof r=="string")return iu(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return iu(r,e)}}function iu(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function au(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function Qo(r,e,t){return e&&au(r.prototype,e),t&&au(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}var Wo=function(){return typeof Symbol=="function"},Go=function(r){return Wo()&&Boolean(Symbol[r])},Ko=function(r){return Go(r)?Symbol[r]:"@@"+r};Wo()&&!Go("observable")&&(Symbol.observable=Symbol("observable"));var kp=Ko("iterator"),Bo=Ko("observable"),ou=Ko("species");function Bi(r,e){var t=r[e];if(t!=null){if(typeof t!="function")throw new TypeError(t+" is not a function");return t}}function Wn(r){var e=r.constructor;return e!==void 0&&(e=e[ou],e===null&&(e=void 0)),e!==void 0?e:Q}function Dp(r){return r instanceof Q}function rn(r){rn.log?rn.log(r):setTimeout(function(){throw r})}function qi(r){Promise.resolve().then(function(){try{r()}catch(e){rn(e)}})}function su(r){var e=r._cleanup;if(e!==void 0&&(r._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var t=Bi(e,"unsubscribe");t&&t.call(e)}}catch(n){rn(n)}}function Vo(r){r._observer=void 0,r._queue=void 0,r._state="closed"}function Pp(r){var e=r._queue;if(!!e){r._queue=void 0,r._state="ready";for(var t=0;t<e.length&&(cu(r,e[t].type,e[t].value),r._state!=="closed");++t);}}function cu(r,e,t){r._state="running";var n=r._observer;try{var i=Bi(n,e);switch(e){case"next":i&&i.call(n,t);break;case"error":if(Vo(r),i)i.call(n,t);else throw t;break;case"complete":Vo(r),i&&i.call(n);break}}catch(a){rn(a)}r._state==="closed"?su(r):r._state==="running"&&(r._state="ready")}function qo(r,e,t){if(r._state!=="closed"){if(r._state==="buffering"){r._queue.push({type:e,value:t});return}if(r._state!=="ready"){r._state="buffering",r._queue=[{type:e,value:t}],qi(function(){return Pp(r)});return}cu(r,e,t)}}var Np=function(){function r(t,n){this._cleanup=void 0,this._observer=t,this._queue=void 0,this._state="initializing";var i=new Rp(this);try{this._cleanup=n.call(void 0,i)}catch(a){i.error(a)}this._state==="initializing"&&(this._state="ready")}var e=r.prototype;return e.unsubscribe=function(){this._state!=="closed"&&(Vo(this),su(this))},Qo(r,[{key:"closed",get:function(){return this._state==="closed"}}]),r}(),Rp=function(){function r(t){this._subscription=t}var e=r.prototype;return e.next=function(n){qo(this._subscription,"next",n)},e.error=function(n){qo(this._subscription,"error",n)},e.complete=function(){qo(this._subscription,"complete")},Qo(r,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),r}(),Q=function(){function r(t){if(!(this instanceof r))throw new TypeError("Observable cannot be called as a function");if(typeof t!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=t}var e=r.prototype;return e.subscribe=function(n){return(typeof n!="object"||n===null)&&(n={next:n,error:arguments[1],complete:arguments[2]}),new Np(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(l){try{n(l,s)}catch(f){o(f),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=Wn(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=Wn(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=Wn(this),o=arguments.length>1,s=!1,u=arguments[1],l=u;return new a(function(f){return i.subscribe({next:function(p){var h=!s;if(s=!0,!h||o)try{l=n(l,p)}catch(d){return f.error(d)}else l=p},error:function(p){f.error(p)},complete:function(){if(!s&&!o)return f.error(new TypeError("Cannot reduce an empty sequence"));f.next(l),f.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=Wn(this);return new s(function(u){var l,f=0;function p(h){l=h.subscribe({next:function(d){u.next(d)},error:function(d){u.error(d)},complete:function(){f===a.length?(l=void 0,u.complete()):p(s.from(a[f++]))}})}return p(n),function(){l&&(l.unsubscribe(),l=void 0)}})},e.flatMap=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Wn(this);return new a(function(o){var s=[],u=i.subscribe({next:function(f){if(n)try{f=n(f)}catch(h){return o.error(h)}var p=a.from(f).subscribe({next:function(h){o.next(h)},error:function(h){o.error(h)},complete:function(){var h=s.indexOf(p);h>=0&&s.splice(h,1),l()}});s.push(p)},error:function(f){o.error(f)},complete:function(){l()}});function l(){u.closed&&s.length===0&&o.complete()}return function(){s.forEach(function(f){return f.unsubscribe()}),u.unsubscribe()}})},e[Bo]=function(){return this},r.from=function(n){var i=typeof this=="function"?this:r;if(n==null)throw new TypeError(n+" is not an object");var a=Bi(n,Bo);if(a){var o=a.call(n);if(Object(o)!==o)throw new TypeError(o+" is not an object");return Dp(o)&&o.constructor===i?o:new i(function(s){return o.subscribe(s)})}if(Go("iterator")&&(a=Bi(n,kp),a))return new i(function(s){qi(function(){if(!s.closed){for(var u=Ap(a.call(n)),l;!(l=u()).done;){var f=l.value;if(s.next(f),s.closed)return}s.complete()}})});if(Array.isArray(n))return new i(function(s){qi(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")},r.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:r;return new o(function(s){qi(function(){if(!s.closed){for(var u=0;u<i.length;++u)if(s.next(i[u]),s.closed)return;s.complete()}})})},Qo(r,null,[{key:ou,get:function(){return this}}]),r}();Wo()&&Object.defineProperty(Q,Symbol("extensions"),{value:{symbol:Bo,hostReportError:rn},configurable:!0});function zo(r){var e,t=r.Symbol;if(typeof t=="function")if(t.observable)e=t.observable;else{typeof t.for=="function"?e=t.for("https://github.com/benlesh/symbol-observable"):e=t("https://github.com/benlesh/symbol-observable");try{t.observable=e}catch{}}else e="@@observable";return e}var nn;typeof self<"u"?nn=self:typeof window<"u"?nn=window:typeof global<"u"?nn=global:typeof module<"u"?nn=module:nn=Function("return this")();var I3=zo(nn);var uu=Q.prototype,lu="@@observable";uu[lu]||(uu[lu]=function(){return this});var Lp=Object.prototype.toString;function Vi(r){return Ho(r)}function Ho(r,e){switch(Lp.call(r)){case"[object Array]":{if(e=e||new Map,e.has(r))return e.get(r);var t=r.slice(0);return e.set(r,t),t.forEach(function(i,a){t[a]=Ho(i,e)}),t}case"[object Object]":{if(e=e||new Map,e.has(r))return e.get(r);var n=Object.create(Object.getPrototypeOf(r));return e.set(r,n),Object.keys(r).forEach(function(i){n[i]=Ho(r[i],e)}),n}default:return r}}function Fp(r){var e=new Set([r]);return e.forEach(function(t){z(t)&&$p(t)===t&&Object.getOwnPropertyNames(t).forEach(function(n){z(t[n])&&e.add(t[n])})}),r}function $p(r){if(__DEV__&&!Object.isFrozen(r))try{Object.freeze(r)}catch(e){if(e instanceof TypeError)return null;throw e}return r}function Gn(r){return __DEV__&&Fp(r),r}function xr(r,e,t){var n=[];r.forEach(function(i){return i[e]&&n.push(i)}),n.forEach(function(i){return i[e](t)})}function Qi(r,e,t){return new Q(function(n){var i=n.next,a=n.error,o=n.complete,s=0,u=!1,l={then:function(d){return new Promise(function(y){return y(d())})}};function f(d,y){return d?function(g){++s;var C=function(){return d(g)};l=l.then(C,C).then(function(_){--s,i&&i.call(n,_),u&&p.complete()},function(_){throw--s,_}).catch(function(_){a&&a.call(n,_)})}:function(g){return y&&y.call(n,g)}}var p={next:f(e,i),error:f(t,a),complete:function(){u=!0,s||o&&o.call(n)}},h=r.subscribe(p);return function(){return h.unsubscribe()}})}var ot=typeof WeakMap=="function"&&Ie(function(){return navigator.product})!=="ReactNative",fu=typeof WeakSet=="function",Jo=typeof Symbol=="function"&&typeof Symbol.for=="function",zt=Jo&&Symbol.asyncIterator,B3=typeof Ie(function(){return window.document.createElement})=="function",V3=Ie(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1;function Wi(r){function e(t){Object.defineProperty(r,t,{value:Q})}return Jo&&Symbol.species&&e(Symbol.species),e("@@species"),r}function pu(r){return r&&typeof r.then=="function"}var an=function(r){ge(e,r);function e(t){var n=r.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),xr(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),xr(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?pu(u)?u.then(function(l){return n.sub=l.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"),xr(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 t=="function"&&(t=[new Q(t)]),pu(t)?t.then(function(i){return n.start(i)},n.handlers.error):n.start(t),n}return e.prototype.start=function(t){this.sub===void 0&&(this.sources=Array.from(t),this.handlers.complete())},e.prototype.deliverLastMessage=function(t){if(this.latest){var n=this.latest[0],i=t[n];i&&i.call(t,this.latest[1]),this.sub===null&&n==="next"&&t.complete&&t.complete()}},e.prototype.addObserver=function(t){this.observers.has(t)||(this.deliverLastMessage(t),this.observers.add(t))},e.prototype.removeObserver=function(t){this.observers.delete(t)&&this.observers.size<1&&this.handlers.complete()},e.prototype.notify=function(t,n){var i=this.nextResultListeners;i.size&&(this.nextResultListeners=new Set,i.forEach(function(a){return a(t,n)}))},e.prototype.beforeNext=function(t){var n=!1;this.nextResultListeners.add(function(i,a){n||(n=!0,t(i,a))})},e}(Q);Wi(an);function Ht(r){return"incremental"in r}function Mp(r){return"hasNext"in r&&"data"in r}function du(r){return Ht(r)||Mp(r)}function Gi(r,e){var t=r,n=new ze;return Ht(e)&&xe(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],l=!isNaN(+u),f=l?[]:{};f[u]=a,a=f}t=n.merge(t,a)}),t}function on(r){var e=Ki(r);return xe(e)}function Ki(r){var e=xe(r.errors)?r.errors.slice(0):[];return Ht(r)&&xe(r.incremental)&&r.incremental.forEach(function(t){t.errors&&e.push.apply(e,t.errors)}),e}function Jt(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=Object.create(null);return r.forEach(function(n){!n||Object.keys(n).forEach(function(i){var a=n[i];a!==void 0&&(t[i]=a)})}),t}var hu=new Map;function Kn(r){var e=hu.get(r)||1;return hu.set(r,e+1),"".concat(r,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function mu(r){var e=Kn("stringifyForDisplay");return JSON.stringify(r,function(t,n){return n===void 0?e:n}).split(JSON.stringify(e)).join("<undefined>")}function zn(r,e){return Jt(r,e,e.variables&&{variables:m(m({},r&&r.variables),e.variables)})}function zi(r){return new Q(function(e){e.error(r)})}var Hn=function(r,e,t){var n=new Error(t);throw n.name="ServerError",n.response=r,n.statusCode=r.status,n.result=e,n};function Yo(r){for(var e=["query","operationName","variables","extensions","context"],t=0,n=Object.keys(r);t<n.length;t++){var i=n[t];if(e.indexOf(i)<0)throw __DEV__?new U("illegal argument: ".concat(i)):new U(27)}return r}function Xo(r,e){var t=m({},r),n=function(a){typeof a=="function"?t=m(m({},t),a(t)):t=m(m({},t),a)},i=function(){return m({},t)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:n}),Object.defineProperty(e,"getContext",{enumerable:!1,value:i}),e}function Zo(r){var e={variables:r.variables||{},extensions:r.extensions||{},operationName:r.operationName,query:r.query};return e.operationName||(e.operationName=typeof e.query!="string"?tn(e.query)||void 0:""),e}function yu(r,e){return e?e(r):Q.of()}function Jn(r){return typeof r=="function"?new st(r):r}function Hi(r){return r.request.length<=1}var jp=function(r){ge(e,r);function e(t,n){var i=r.call(this,t)||this;return i.link=n,i}return e}(Error),st=function(){function r(e){e&&(this.request=e)}return r.empty=function(){return new r(function(){return Q.of()})},r.from=function(e){return e.length===0?r.empty():e.map(Jn).reduce(function(t,n){return t.concat(n)})},r.split=function(e,t,n){var i=Jn(t),a=Jn(n||new r(yu));return Hi(i)&&Hi(a)?new r(function(o){return e(o)?i.request(o)||Q.of():a.request(o)||Q.of()}):new r(function(o,s){return e(o)?i.request(o,s)||Q.of():a.request(o,s)||Q.of()})},r.execute=function(e,t){return e.request(Xo(t.context,Zo(Yo(t))))||Q.of()},r.concat=function(e,t){var n=Jn(e);if(Hi(n))return __DEV__&&T.warn(new jp("You are calling concat on a terminating link, which will have no effect",n)),n;var i=Jn(t);return Hi(i)?new r(function(a){return n.request(a,function(o){return i.request(o)||Q.of()})||Q.of()}):new r(function(a,o){return n.request(a,function(s){return i.request(s,o)||Q.of()})||Q.of()})},r.prototype.split=function(e,t,n){return this.concat(r.split(e,t,n||new r(yu)))},r.prototype.concat=function(e){return r.concat(this,e)},r.prototype.request=function(e,t){throw __DEV__?new U("request is not implemented"):new U(22)},r.prototype.onError=function(e,t){if(t&&t.error)return t.error(e),!1;throw e},r.prototype.setOnError=function(e){return this.onError=e,this},r}();var sn=st.execute;var gu="3.7.10";function vu(r){return!!r.body}function bu(r){return!!r.getReader}function Cu(r){return!!(zt&&r[Symbol.asyncIterator])}function Su(r){return!!r.stream}function wu(r){return!!r.arrayBuffer}function _u(r){return!!r.pipe}function es(r){var e,t=r[Symbol.asyncIterator]();return e={next:function(){return t.next()}},e[Symbol.asyncIterator]=function(){return this},e}function ts(r){var e=null,t=null,n=!1,i=[],a=[];function o(p){if(!t){if(a.length){var h=a.shift();if(Array.isArray(h)&&h[0])return h[0]({value:p,done:!1})}i.push(p)}}function s(p){t=p;var h=a.slice();h.forEach(function(d){d[1](p)}),!e||e()}function u(){n=!0;var p=a.slice();p.forEach(function(h){h[0]({value:void 0,done:!0})}),!e||e()}e=function(){e=null,r.removeListener("data",o),r.removeListener("error",s),r.removeListener("end",u),r.removeListener("finish",u),r.removeListener("close",u)},r.on("data",o),r.on("error",s),r.on("end",u),r.on("finish",u),r.on("close",u);function l(){return new Promise(function(p,h){if(t)return h(t);if(i.length)return p({value:i.shift(),done:!1});if(n)return p({value:void 0,done:!0});a.push([p,h])})}var f={next:function(){return l()}};return zt&&(f[Symbol.asyncIterator]=function(){return this}),f}function rs(r){var e=!1,t={next:function(){return e?Promise.resolve({value:void 0,done:!0}):(e=!0,new Promise(function(n,i){r.then(function(a){n({value:a,done:!1})}).catch(i)}))}};return zt&&(t[Symbol.asyncIterator]=function(){return this}),t}function Ji(r){var e={next:function(){return r.read()}};return zt&&(e[Symbol.asyncIterator]=function(){return this}),e}function Eu(r){var e=r;if(vu(r)&&(e=r.body),Cu(e))return es(e);if(bu(e))return Ji(e.getReader());if(Su(e))return Ji(e.stream().getReader());if(wu(e))return rs(e.arrayBuffer());if(_u(e))return ts(e);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var xu=Object.prototype.hasOwnProperty;function Ou(r,e){var t,n,i;return pt(this,void 0,void 0,function(){var a,o,s,u,l,f,p,h,d,y,g,C,_,b,S,O,k,P,I,R;return dt(this,function(re){switch(re.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=(t=r.headers)===null||t===void 0?void 0:t.get("content-type"),s="boundary=",u=o?.includes(s)?o?.substring(o?.indexOf(s)+s.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",l="--".concat(u),f="",p=Eu(r),h=!0,re.label=1;case 1:return h?[4,p.next()]:[3,3];case 2:for(d=re.sent(),y=d.value,g=d.done,C=typeof y=="string"?y:a.decode(y),h=!g,f+=C,_=f.indexOf(l);_>-1;){if(b=void 0,R=[f.slice(0,_),f.slice(_+l.length)],b=R[0],f=R[1],b.trim()){if(S=b.indexOf(`\r
27
27
  \r
28
- `),O=qp(b.slice(0,S)),k=O["content-type"],k&&k.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");N=b.slice(S);try{I=Au(r,N.replace(`\r
29
- `,"")),(Object.keys(I).length>1||"data"in I||"incremental"in I||"errors"in I)&&((n=e.next)===null||n===void 0||n.call(e,I))}catch(ee){Yi(ee,e)}}_=f.indexOf(l)}return[3,1];case 3:return(i=e.complete)===null||i===void 0||i.call(e),[2]}})})}function qp(r){var e={};return r.split(`
30
- `).forEach(function(t){var n=t.indexOf(":");if(n>-1){var i=t.slice(0,n).trim().toLowerCase(),a=t.slice(n+1).trim();e[i]=a}}),e}function Au(r,e){if(r.status>=300){var t=function(){try{return JSON.parse(e)}catch{return e}};Hn(r,t(),"Response not successful: Received status code ".concat(r.status))}try{return JSON.parse(e)}catch(i){var n=i;throw n.name="ServerParseError",n.response=r,n.statusCode=r.status,n.bodyText=e,n}}function Yi(r,e){var t,n;r.name!=="AbortError"&&(r.result&&r.result.errors&&r.result.data&&((t=e.next)===null||t===void 0||t.call(e,r.result)),(n=e.error)===null||n===void 0||n.call(e,r))}function Iu(r,e,t){Bp(e)(r).then(function(n){var i,a;(i=t.next)===null||i===void 0||i.call(t,n),(a=t.complete)===null||a===void 0||a.call(t)}).catch(function(n){return Yi(n,t)})}function Bp(r){return function(e){return e.text().then(function(t){return Au(e,t)}).then(function(t){return e.status>=300&&Hn(e,t,"Response not successful: Received status code ".concat(e.status)),!Array.isArray(t)&&!Ou.call(t,"data")&&!Ou.call(t,"errors")&&Hn(e,t,"Server response was missing for query '".concat(Array.isArray(r)?r.map(function(n){return n.operationName}):r.operationName,"'.")),t})}}var Yn=function(r,e){var t;try{t=JSON.stringify(r)}catch(i){var n=__DEV__?new U("Network request failed. ".concat(e," is not serializable: ").concat(i.message)):new U(24);throw n.parseError=i,n}return t};var Vp={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},Qp={accept:"*/*","content-type":"application/json"},Wp={method:"POST"},ku={http:Vp,headers:Qp,options:Wp},Du=function(r,e){return e(r)};function Nu(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var i={},a={};t.forEach(function(p){i=m(m(m({},i),p.options),{headers:m(m({},i.headers),p.headers)}),p.credentials&&(i.credentials=p.credentials),a=m(m({},a),p.http)}),i.headers&&(i.headers=Gp(i.headers,a.preserveHeaderCase));var o=r.operationName,s=r.extensions,u=r.variables,l=r.query,f={operationName:o,variables:u};return a.includeExtensions&&(f.extensions=s),a.includeQuery&&(f.query=e(l,Xr)),{options:i,body:f}}function Gp(r,e){if(!e){var t=Object.create(null);return Object.keys(Object(r)).forEach(function(a){t[a.toLowerCase()]=r[a]}),t}var n=Object.create(null);Object.keys(Object(r)).forEach(function(a){n[a.toLowerCase()]={originalName:a,value:r[a]}});var i=Object.create(null);return Object.keys(n).forEach(function(a){i[n[a].originalName]=n[a].value}),i}var Pu=function(r){if(!r&&typeof fetch>"u")throw __DEV__?new U(`
28
+ `),O=Up(b.slice(0,S)),k=O["content-type"],k&&k.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");P=b.slice(S);try{I=Tu(r,P.replace(`\r
29
+ `,"")),(Object.keys(I).length>1||"data"in I||"incremental"in I||"errors"in I)&&((n=e.next)===null||n===void 0||n.call(e,I))}catch(ee){Yi(ee,e)}}_=f.indexOf(l)}return[3,1];case 3:return(i=e.complete)===null||i===void 0||i.call(e),[2]}})})}function Up(r){var e={};return r.split(`
30
+ `).forEach(function(t){var n=t.indexOf(":");if(n>-1){var i=t.slice(0,n).trim().toLowerCase(),a=t.slice(n+1).trim();e[i]=a}}),e}function Tu(r,e){if(r.status>=300){var t=function(){try{return JSON.parse(e)}catch{return e}};Hn(r,t(),"Response not successful: Received status code ".concat(r.status))}try{return JSON.parse(e)}catch(i){var n=i;throw n.name="ServerParseError",n.response=r,n.statusCode=r.status,n.bodyText=e,n}}function Yi(r,e){var t,n;r.name!=="AbortError"&&(r.result&&r.result.errors&&r.result.data&&((t=e.next)===null||t===void 0||t.call(e,r.result)),(n=e.error)===null||n===void 0||n.call(e,r))}function Au(r,e,t){qp(e)(r).then(function(n){var i,a;(i=t.next)===null||i===void 0||i.call(t,n),(a=t.complete)===null||a===void 0||a.call(t)}).catch(function(n){return Yi(n,t)})}function qp(r){return function(e){return e.text().then(function(t){return Tu(e,t)}).then(function(t){return e.status>=300&&Hn(e,t,"Response not successful: Received status code ".concat(e.status)),!Array.isArray(t)&&!xu.call(t,"data")&&!xu.call(t,"errors")&&Hn(e,t,"Server response was missing for query '".concat(Array.isArray(r)?r.map(function(n){return n.operationName}):r.operationName,"'.")),t})}}var Yn=function(r,e){var t;try{t=JSON.stringify(r)}catch(i){var n=__DEV__?new U("Network request failed. ".concat(e," is not serializable: ").concat(i.message)):new U(24);throw n.parseError=i,n}return t};var Bp={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},Vp={accept:"*/*","content-type":"application/json"},Qp={method:"POST"},Iu={http:Bp,headers:Vp,options:Qp},ku=function(r,e){return e(r)};function Du(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var i={},a={};t.forEach(function(p){i=m(m(m({},i),p.options),{headers:m(m({},i.headers),p.headers)}),p.credentials&&(i.credentials=p.credentials),a=m(m({},a),p.http)}),i.headers&&(i.headers=Wp(i.headers,a.preserveHeaderCase));var o=r.operationName,s=r.extensions,u=r.variables,l=r.query,f={operationName:o,variables:u};return a.includeExtensions&&(f.extensions=s),a.includeQuery&&(f.query=e(l,Xr)),{options:i,body:f}}function Wp(r,e){if(!e){var t=Object.create(null);return Object.keys(Object(r)).forEach(function(a){t[a.toLowerCase()]=r[a]}),t}var n=Object.create(null);Object.keys(Object(r)).forEach(function(a){n[a.toLowerCase()]={originalName:a,value:r[a]}});var i=Object.create(null);return Object.keys(n).forEach(function(a){i[n[a].originalName]=n[a].value}),i}var Pu=function(r){if(!r&&typeof fetch>"u")throw __DEV__?new U(`
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 U(23)};var Ru=function(){if(typeof AbortController>"u")return{controller:!1,signal:!1};var r=new AbortController,e=r.signal;return{controller:r,signal:e}};var Lu=function(r,e){var t=r.getContext(),n=t.uri;return n||(typeof e=="function"?e(r):e||"/graphql")};function Fu(r,e){var t=[],n=function(p,h){t.push("".concat(p,"=").concat(encodeURIComponent(h)))};if("query"in e&&n("query",e.query),e.operationName&&n("operationName",e.operationName),e.variables){var i=void 0;try{i=Yn(e.variables,"Variables map")}catch(p){return{parseError:p}}n("variables",i)}if(e.extensions){var a=void 0;try{a=Yn(e.extensions,"Extensions map")}catch(p){return{parseError:p}}n("extensions",a)}var o="",s=r,u=r.indexOf("#");u!==-1&&(o=r.substr(u),s=r.substr(0,u));var l=s.indexOf("?")===-1?"?":"&",f=s+l+t.join("&")+o;return{newURI:f}}var $u=Ie(function(){return fetch}),Mu=function(r){r===void 0&&(r={});var e=r.uri,t=e===void 0?"/graphql":e,n=r.fetch,i=r.print,a=i===void 0?Du:i,o=r.includeExtensions,s=r.preserveHeaderCase,u=r.useGETForQueries,l=r.includeUnusedVariables,f=l===void 0?!1:l,p=_t(r,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);__DEV__&&Pu(n||$u);var h={http:{includeExtensions:o,preserveHeaderCase:s},options:p.fetchOptions,credentials:p.credentials,headers:p.headers};return new st(function(d){var y=Lu(d,t),g=d.getContext(),C={};if(g.clientAwareness){var _=g.clientAwareness,b=_.name,S=_.version;b&&(C["apollographql-client-name"]=b),S&&(C["apollographql-client-version"]=S)}var O=m(m({},C),g.headers),k={http:g.http,options:g.fetchOptions,credentials:g.credentials,headers:O},N=Nu(d,a,ku,h,k),I=N.options,R=N.body;if(R.variables&&!f){var re=new Set(Object.keys(R.variables));Me(d.query,{Variable:function(K,St,V){V&&V.kind!=="VariableDefinition"&&re.delete(K.name.value)}}),re.size&&(R.variables=m({},R.variables),re.forEach(function(K){delete R.variables[K]}))}var ee;if(!I.signal){var Ct=Ru(),It=Ct.controller,ke=Ct.signal;ee=It,ee&&(I.signal=ke)}var B=function(K){return K.kind==="OperationDefinition"&&K.operation==="mutation"};if(u&&!d.query.definitions.some(B)&&(I.method="GET"),Zr(["defer"],d.query)&&(I.headers=I.headers||{},I.headers.accept="multipart/mixed; deferSpec=20220824, application/json"),I.method==="GET"){var me=Fu(y,R),oe=me.newURI,G=me.parseError;if(G)return zi(G);y=oe}else try{I.body=Yn(R,"Payload")}catch(K){return zi(K)}return new Q(function(K){var St=n||Ie(function(){return fetch})||$u;return St(y,I).then(function(V){var wt;d.setContext({response:V});var Ut=(wt=V.headers)===null||wt===void 0?void 0:wt.get("content-type");return Ut!==null&&/^multipart\/mixed/i.test(Ut)?Tu(V,K):Iu(V,d,K)}).catch(function(V){return Yi(V,K)}),function(){ee&&ee.abort()}})})};var ns=function(r){ge(e,r);function e(t){t===void 0&&(t={});var n=r.call(this,Mu(t).request)||this;return n.options=t,n}return e}(st);var{toString:ju,hasOwnProperty:Kp}=Object.prototype,Uu=Function.prototype.toString,is=new Map;function ue(r,e){try{return as(r,e)}finally{is.clear()}}function as(r,e){if(r===e)return!0;let t=ju.call(r),n=ju.call(e);if(t!==n)return!1;switch(t){case"[object Array]":if(r.length!==e.length)return!1;case"[object Object]":{if(Bu(r,e))return!0;let i=qu(r),a=qu(e),o=i.length;if(o!==a.length)return!1;for(let s=0;s<o;++s)if(!Kp.call(e,i[s]))return!1;for(let s=0;s<o;++s){let u=i[s];if(!as(r[u],e[u]))return!1}return!0}case"[object Error]":return r.name===e.name&&r.message===e.message;case"[object Number]":if(r!==r)return e!==e;case"[object Boolean]":case"[object Date]":return+r==+e;case"[object RegExp]":case"[object String]":return r==`${e}`;case"[object Map]":case"[object Set]":{if(r.size!==e.size)return!1;if(Bu(r,e))return!0;let i=r.entries(),a=t==="[object Map]";for(;;){let o=i.next();if(o.done)break;let[s,u]=o.value;if(!e.has(s)||a&&!as(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]":r=new Uint8Array(r),e=new Uint8Array(e);case"[object DataView]":{let i=r.byteLength;if(i===e.byteLength)for(;i--&&r[i]===e[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{let i=Uu.call(r);return i!==Uu.call(e)?!1:!Jp(i,Hp)}}return!1}function qu(r){return Object.keys(r).filter(zp,r)}function zp(r){return this[r]!==void 0}var Hp="{ [native code] }";function Jp(r,e){let t=r.length-e.length;return t>=0&&r.indexOf(e,t)===t}function Bu(r,e){let t=is.get(r);if(t){if(t.has(e))return!0}else is.set(r,t=new Set);return t.add(e),!1}var Yp=function(){return Object.create(null)},Vu=Array.prototype,Xp=Vu.forEach,Zp=Vu.slice,Ot=function(){function r(e,t){e===void 0&&(e=!0),t===void 0&&(t=Yp),this.weakness=e,this.makeData=t}return r.prototype.lookup=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.lookupArray(e)},r.prototype.lookupArray=function(e){var t=this;return Xp.call(e,function(n){return t=t.getChildTrie(n)}),t.data||(t.data=this.makeData(Zp.call(e)))},r.prototype.getChildTrie=function(e){var t=this.weakness&&ed(e)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),n=t.get(e);return n||t.set(e,n=new r(this.weakness,this.makeData)),n},r}();function ed(r){switch(typeof r){case"object":if(r===null)break;case"function":return!0}return!1}var Re=null,Qu={},td=1,rd=()=>class{constructor(){this.id=["slot",td++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=Re;e;e=e.parent)if(this.id in e.slots){let t=e.slots[this.id];if(t===Qu)break;return e!==Re&&(Re.slots[this.id]=t),!0}return Re&&(Re.slots[this.id]=Qu),!1}getValue(){if(this.hasValue())return Re.slots[this.id]}withValue(e,t,n,i){let a={__proto__:null,[this.id]:e},o=Re;Re={parent:o,slots:a};try{return t.apply(i,n)}finally{Re=o}}static bind(e){let t=Re;return function(){let n=Re;try{return Re=t,e.apply(this,arguments)}finally{Re=n}}}static noContext(e,t,n){if(Re){let i=Re;try{return Re=null,e.apply(n,t)}finally{Re=i}}else return e.apply(n,t)}};function Wu(r){try{return r()}catch{}}var os="@wry/context:Slot",nd=Wu(()=>globalThis)||Wu(()=>global)||Object.create(null),Gu=nd,cn=Gu[os]||Array[os]||function(r){try{Object.defineProperty(Gu,os,{value:r,enumerable:!1,writable:!1,configurable:!0})}finally{return r}}(rd());var{bind:ad,noContext:od}=cn;function sd(){}var cd=function(){function r(e,t){e===void 0&&(e=1/0),t===void 0&&(t=sd),this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}return r.prototype.has=function(e){return this.map.has(e)},r.prototype.get=function(e){var t=this.getNode(e);return t&&t.value},r.prototype.getNode=function(e){var t=this.map.get(e);if(t&&t!==this.newest){var n=t.older,i=t.newer;i&&(i.older=n),n&&(n.newer=i),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=i)}return t},r.prototype.set=function(e,t){var n=this.getNode(e);return n?n.value=t:(n={key:e,value:t,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)},r.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},r.prototype.delete=function(e){var t=this.map.get(e);return t?(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0):!1},r}(),Zi=new cn,ss,ud=Object.prototype.hasOwnProperty,us=(ss=Array.from,ss===void 0?function(r){var e=[];return r.forEach(function(t){return e.push(t)}),e}:ss);function Xi(r){var e=r.unsubscribe;typeof e=="function"&&(r.unsubscribe=void 0,e())}var Xn=[],ld=100;function un(r,e){if(!r)throw new Error(e||"assertion failure")}function fd(r,e){var t=r.length;return t>0&&t===e.length&&r[t-1]===e[t-1]}function zu(r){switch(r.length){case 0:throw new Error("unknown value");case 1:return r[0];case 2:throw r[1]}}function pd(r){return r.slice(0)}var dd=function(){function r(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,++r.count}return r.prototype.peek=function(){if(this.value.length===1&&!Yt(this))return Ku(this),this.value[0]},r.prototype.recompute=function(e){return un(!this.recomputing,"already recomputing"),Ku(this),Yt(this)?hd(this,e):zu(this.value)},r.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,Hu(this),Xi(this))},r.prototype.dispose=function(){var e=this;this.setDirty(),el(this),ls(this,function(t,n){t.setDirty(),tl(t,e)})},r.prototype.forget=function(){this.dispose()},r.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=Xn.pop()||new Set),this.deps.add(e)},r.prototype.forgetDeps=function(){var e=this;this.deps&&(us(this.deps).forEach(function(t){return t.delete(e)}),this.deps.clear(),Xn.push(this.deps),this.deps=null)},r.count=0,r}();function Ku(r){var e=Zi.getValue();if(e)return r.parents.add(e),e.childValues.has(r)||e.childValues.set(r,[]),Yt(r)?Yu(e,r):Xu(e,r),e}function hd(r,e){return el(r),Zi.withValue(r,md,[r,e]),gd(r,e)&&yd(r),zu(r.value)}function md(r,e){r.recomputing=!0,r.value.length=0;try{r.value[0]=r.fn.apply(null,e)}catch(t){r.value[1]=t}r.recomputing=!1}function Yt(r){return r.dirty||!!(r.dirtyChildren&&r.dirtyChildren.size)}function yd(r){r.dirty=!1,!Yt(r)&&Ju(r)}function Hu(r){ls(r,Yu)}function Ju(r){ls(r,Xu)}function ls(r,e){var t=r.parents.size;if(t)for(var n=us(r.parents),i=0;i<t;++i)e(n[i],r)}function Yu(r,e){un(r.childValues.has(e)),un(Yt(e));var t=!Yt(r);if(!r.dirtyChildren)r.dirtyChildren=Xn.pop()||new Set;else if(r.dirtyChildren.has(e))return;r.dirtyChildren.add(e),t&&Hu(r)}function Xu(r,e){un(r.childValues.has(e)),un(!Yt(e));var t=r.childValues.get(e);t.length===0?r.childValues.set(e,pd(e.value)):fd(t,e.value)||r.setDirty(),Zu(r,e),!Yt(r)&&Ju(r)}function Zu(r,e){var t=r.dirtyChildren;t&&(t.delete(e),t.size===0&&(Xn.length<ld&&Xn.push(t),r.dirtyChildren=null))}function el(r){r.childValues.size>0&&r.childValues.forEach(function(e,t){tl(r,t)}),r.forgetDeps(),un(r.dirtyChildren===null)}function tl(r,e){e.parents.delete(r),r.childValues.delete(e),Zu(r,e)}function gd(r,e){if(typeof r.subscribe=="function")try{Xi(r),r.unsubscribe=r.subscribe.apply(null,e)}catch{return r.setDirty(),!1}return!0}var vd={setDirty:!0,dispose:!0,forget:!0};function ea(r){var e=new Map,t=r&&r.subscribe;function n(i){var a=Zi.getValue();if(a){var o=e.get(i);o||e.set(i,o=new Set),a.dependOn(o),typeof t=="function"&&(Xi(o),o.unsubscribe=t(i))}}return n.dirty=function(a,o){var s=e.get(a);if(s){var u=o&&ud.call(vd,o)?o:"setDirty";us(s).forEach(function(l){return l[u]()}),e.delete(a),Xi(s)}},n}function rl(){var r=new Ot(typeof WeakMap=="function");return function(){return r.lookupArray(arguments)}}var x4=rl(),cs=new Set;function Or(r,e){e===void 0&&(e=Object.create(null));var t=new cd(e.max||Math.pow(2,16),function(l){return l.dispose()}),n=e.keyArgs,i=e.makeCacheKey||rl(),a=function(){var l=i.apply(null,n?n.apply(null,arguments):arguments);if(l===void 0)return r.apply(null,arguments);var f=t.get(l);f||(t.set(l,f=new dd(r)),f.subscribe=e.subscribe,f.forget=function(){return t.delete(l)});var p=f.recompute(Array.prototype.slice.call(arguments));return t.set(l,f),cs.add(t),Zi.hasValue()||(cs.forEach(function(h){return h.clean()}),cs.clear()),p};Object.defineProperty(a,"size",{get:function(){return t.map.size},configurable:!1,enumerable:!1});function o(l){var f=t.get(l);f&&f.setDirty()}a.dirtyKey=o,a.dirty=function(){o(i.apply(null,arguments))};function s(l){var f=t.get(l);if(f)return f.peek()}a.peekKey=s,a.peek=function(){return s(i.apply(null,arguments))};function u(l){return t.delete(l)}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 fs=function(){function r(){this.getFragmentDoc=Or(Do)}return r.prototype.batch=function(e){var t=this,n=typeof e.optimistic=="string"?e.optimistic:e.optimistic===!1?null:void 0,i;return this.performTransaction(function(){return i=e.update(t)},n),i},r.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},r.prototype.transformDocument=function(e){return e},r.prototype.transformForLink=function(e){return e},r.prototype.identify=function(e){},r.prototype.gc=function(){return[]},r.prototype.modify=function(e){return!1},r.prototype.readQuery=function(e,t){return t===void 0&&(t=!!e.optimistic),this.read(m(m({},e),{rootId:e.id||"ROOT_QUERY",optimistic:t}))},r.prototype.readFragment=function(e,t){return t===void 0&&(t=!!e.optimistic),this.read(m(m({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:t}))},r.prototype.writeQuery=function(e){var t=e.id,n=e.data,i=_t(e,["id","data"]);return this.write(Object.assign(i,{dataId:t||"ROOT_QUERY",result:n}))},r.prototype.writeFragment=function(e){var t=e.id,n=e.data,i=e.fragment,a=e.fragmentName,o=_t(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(i,a),dataId:t,result:n}))},r.prototype.updateQuery=function(e,t){return this.batch({update:function(n){var i=n.readQuery(e),a=t(i);return a==null?i:(n.writeQuery(m(m({},e),{data:a})),a)}})},r.prototype.updateFragment=function(e,t){return this.batch({update:function(n){var i=n.readFragment(e),a=t(i);return a==null?i:(n.writeFragment(m(m({},e),{data:a})),a)}})},r}();var Zn=function(r){ge(e,r);function e(t,n,i,a){var o,s=r.call(this,t)||this;if(s.message=t,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 ve=Object.prototype.hasOwnProperty;function ei(r){return r==null}function ra(r,e){var t=r.__typename,n=r.id,i=r._id;if(typeof t=="string"&&(e&&(e.keyObject=ei(n)?ei(i)?void 0:{_id:i}:{id:n}),ei(n)&&!ei(i)&&(n=i),!ei(n)))return"".concat(t,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var nl={dataIdFromObject:ra,addTypename:!0,resultCaching:!0,canonizeResults:!1};function il(r){return Jt(nl,r)}function na(r){var e=r.canonizeResults;return e===void 0?nl.canonizeResults:e}function al(r,e){return W(e)?r.get(e.__ref,"__typename"):e&&e.__typename}var ps=/^[_a-z][_0-9a-z]*/i;function yt(r){var e=r.match(ps);return e?e[0]:r}function ta(r,e,t){return z(e)?ne(e)?e.every(function(n){return ta(r,n,t)}):r.selections.every(function(n){if(et(n)&&Dt(n,t)){var i=at(n);return ve.call(e,i)&&(!n.selectionSet||ta(n.selectionSet,e[i],t))}return!0}):!1}function Xt(r){return z(r)&&!W(r)&&!ne(r)}function ol(){return new ze}function ia(r,e){var t=br(Sr(r));return{fragmentMap:t,lookupFragment:function(n){var i=t[n];return!i&&e&&(i=e.lookup(n)),i||null}}}var aa=Object.create(null),ds=function(){return aa},sl=Object.create(null),ln=function(){function r(e,t){var n=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(i,a){return Gn(W(i)?n.get(i.__ref,a):i&&i[a])},this.canRead=function(i){return W(i)?n.has(i.__ref):typeof i=="object"},this.toReference=function(i,a){if(typeof i=="string")return Et(i);if(W(i))return i;var o=n.policies.identify(i)[0];if(o){var s=Et(o);return a&&n.merge(o,i),s}}}return r.prototype.toObject=function(){return m({},this.data)},r.prototype.has=function(e){return this.lookup(e,!0)!==void 0},r.prototype.get=function(e,t){if(this.group.depend(e,t),ve.call(this.data,e)){var n=this.data[e];if(n&&ve.call(n,t))return n[t]}if(t==="__typename"&&ve.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof Zt)return this.parent.get(e,t)},r.prototype.lookup=function(e,t){if(t&&this.group.depend(e,"__exists"),ve.call(this.data,e))return this.data[e];if(this instanceof Zt)return this.parent.lookup(e,t);if(this.policies.rootTypenamesById[e])return Object.create(null)},r.prototype.merge=function(e,t){var n=this,i;W(e)&&(e=e.__ref),W(t)&&(t=t.__ref);var a=typeof e=="string"?this.lookup(i=e):e,o=typeof t=="string"?this.lookup(i=t):t;if(!!o){__DEV__?T(typeof i=="string","store.merge expects a string ID"):T(typeof i=="string",1);var s=new ze(Cd).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(l){if(!a||a[l]!==s[l]){u[l]=1;var f=yt(l);f!==l&&!n.policies.hasKeyArgs(s.__typename,f)&&(u[f]=1),s[l]===void 0&&!(n instanceof Zt)&&delete s[l]}}),u.__typename&&!(a&&a.__typename)&&this.policies.rootTypenamesById[i]===s.__typename&&delete u.__typename,Object.keys(u).forEach(function(l){return n.group.dirty(i,l)})}}},r.prototype.modify=function(e,t){var n=this,i=this.lookup(e);if(i){var a=Object.create(null),o=!1,s=!0,u={DELETE:aa,INVALIDATE:sl,isReference:W,toReference:this.toReference,canRead:this.canRead,readField:function(l,f){return n.policies.readField(typeof l=="string"?{fieldName:l,from:f||Et(e)}:l,{store:n})}};if(Object.keys(i).forEach(function(l){var f=yt(l),p=i[l];if(p!==void 0){var h=typeof t=="function"?t:t[l]||t[f];if(h){var d=h===ds?aa:h(Gn(p),m(m({},u),{fieldName:f,storeFieldName:l,storage:n.getStorage(e,l)}));d===sl?n.group.dirty(e,l):(d===aa&&(d=void 0),d!==p&&(a[l]=d,o=!0,p=d))}p!==void 0&&(s=!1)}}),o)return this.merge(e,a),s&&(this instanceof Zt?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},r.prototype.delete=function(e,t,n){var i,a=this.lookup(e);if(a){var o=this.getFieldValue(a,"__typename"),s=t&&n?this.policies.getStoreFieldName({typename:o,fieldName:t,args:n}):t;return this.modify(e,s?(i={},i[s]=ds,i):ds)}return!1},r.prototype.evict=function(e,t){var n=!1;return e.id&&(ve.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof Zt&&this!==t&&(n=this.parent.evict(e,t)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n},r.prototype.clear=function(){this.replace(null)},r.prototype.extract=function(){var e=this,t=this.toObject(),n=[];return this.getRootIdSet().forEach(function(i){ve.call(e.policies.rootTypenamesById,i)||n.push(i)}),n.length&&(t.__META={extraRootIds:n.sort()}),t},r.prototype.replace=function(e){var t=this;if(Object.keys(this.data).forEach(function(a){e&&ve.call(e,a)||t.delete(a)}),e){var n=e.__META,i=_t(e,["__META"]);Object.keys(i).forEach(function(a){t.merge(a,i[a])}),n&&n.extraRootIds.forEach(this.retain,this)}},r.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},r.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},r.prototype.getRootIdSet=function(e){return e===void 0&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof Zt?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},r.prototype.gc=function(){var e=this,t=this.getRootIdSet(),n=this.toObject();t.forEach(function(o){ve.call(n,o)&&(Object.keys(e.findChildRefIds(o)).forEach(t.add,t),delete n[o])});var i=Object.keys(n);if(i.length){for(var a=this;a instanceof Zt;)a=a.parent;i.forEach(function(o){return a.delete(o)})}return i},r.prototype.findChildRefIds=function(e){if(!ve.call(this.refs,e)){var t=this.refs[e]=Object.create(null),n=this.data[e];if(!n)return t;var i=new Set([n]);i.forEach(function(a){W(a)&&(t[a.__ref]=!0),z(a)&&Object.keys(a).forEach(function(o){var s=a[o];z(s)&&i.add(s)})})}return this.refs[e]},r.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},r}();var cl=function(){function r(e,t){t===void 0&&(t=null),this.caching=e,this.parent=t,this.d=null,this.resetCaching()}return r.prototype.resetCaching=function(){this.d=this.caching?ea():null,this.keyMaker=new Ot(ot)},r.prototype.depend=function(e,t){if(this.d){this.d(hs(e,t));var n=yt(t);n!==t&&this.d(hs(e,n)),this.parent&&this.parent.depend(e,t)}},r.prototype.dirty=function(e,t){this.d&&this.d.dirty(hs(e,t),t==="__exists"?"forget":"setDirty")},r}();function hs(r,e){return e+"#"+r}function ms(r,e){Tr(r)&&r.group.depend(e,"__exists")}(function(r){var e=function(t){ge(n,t);function n(i){var a=i.policies,o=i.resultCaching,s=o===void 0?!0:o,u=i.seed,l=t.call(this,a,new cl(s))||this;return l.stump=new bd(l),l.storageTrie=new Ot(ot),u&&l.replace(u),l}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}(r);r.Root=e})(ln||(ln={}));var Zt=function(r){ge(e,r);function e(t,n,i,a){var o=r.call(this,n.policies,a)||this;return o.id=t,o.parent=n,o.replay=i,o.group=a,i(o),o}return e.prototype.addLayer=function(t,n){return new e(t,this,n,this.group)},e.prototype.removeLayer=function(t){var n=this,i=this.parent.removeLayer(t);return t===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){ue(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 m(m({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(t){var n=this.parent.findChildRefIds(t);return ve.call(this.data,t)?m(m({},n),r.prototype.findChildRefIds.call(this,t)):n},e.prototype.getStorage=function(){for(var t=this.parent;t.parent;)t=t.parent;return t.getStorage.apply(t,arguments)},e}(ln),bd=function(r){ge(e,r);function e(t){return r.call(this,"EntityStore.Stump",t,function(){},new cl(t.group.caching,t.group))||this}return e.prototype.removeLayer=function(){return this},e.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},e}(Zt);function Cd(r,e,t){var n=r[t],i=e[t];return ue(n,i)?n:i}function Tr(r){return!!(r instanceof ln&&r.group.caching)}function Sd(r){return z(r)?ne(r)?r.slice(0):m({__proto__:Object.getPrototypeOf(r)},r):r}var oa=function(){function r(){this.known=new(pu?WeakSet:Set),this.pool=new Ot(ot),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return r.prototype.isKnown=function(e){return z(e)&&this.known.has(e)},r.prototype.pass=function(e){if(z(e)){var t=Sd(e);return this.passes.set(t,e),t}return e},r.prototype.admit=function(e){var t=this;if(z(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],l=this.sortedKeys(e);u.push(l.json);var f=u.length;l.sorted.forEach(function(d){u.push(t.admit(e[d]))});var o=this.pool.lookupArray(u);if(!o.object){var p=o.object=Object.create(s);this.known.add(p),l.sorted.forEach(function(d,y){p[d]=u[f+y]}),__DEV__&&Object.freeze(p)}return o.object}}}return e},r.prototype.sortedKeys=function(e){var t=Object.keys(e),n=this.pool.lookupArray(t);if(!n.keys){t.sort();var i=JSON.stringify(t);(n.keys=this.keysByJSON.get(i))||this.keysByJSON.set(i,n.keys={sorted:t,json:i})}return n.keys},r}();var tt=Object.assign(function(r){if(z(r)){ys===void 0&&ul();var e=ys.admit(r),t=gs.get(e);return t===void 0&&gs.set(e,t=JSON.stringify(e)),t}return JSON.stringify(r)},{reset:ul}),ys,gs;function ul(){ys=new oa,gs=new(ot?WeakMap:Map)}function ll(r){return[r.selectionSet,r.objectOrReference,r.context,r.context.canonizeResults]}var fl=function(){function r(e){var t=this;this.knownResults=new(ot?WeakMap:Map),this.config=Jt(e,{addTypename:e.addTypename!==!1,canonizeResults:na(e)}),this.canon=e.canon||new oa,this.executeSelectionSet=Or(function(n){var i,a=n.context.canonizeResults,o=ll(n);o[3]=!a;var s=(i=t.executeSelectionSet).peek.apply(i,o);return s?a?m(m({},s),{result:t.canon.admit(s.result)}):s:(ms(n.context.store,n.enclosingRef.__ref),t.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize,keyArgs:ll,makeCacheKey:function(n,i,a,o){if(Tr(a.store))return a.store.makeCacheKey(n,W(i)?i.__ref:i,a.varString,o)}}),this.executeSubSelectedArray=Or(function(n){return ms(n.context.store,n.enclosingRef.__ref),t.execSubSelectedArrayImpl(n)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(n){var i=n.field,a=n.array,o=n.context;if(Tr(o.store))return o.store.makeCacheKey(i,a,o.varString)}})}return r.prototype.resetCanon=function(){this.canon=new oa},r.prototype.diffQueryAgainstStore=function(e){var t=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,l=e.canonizeResults,f=l===void 0?this.config.canonizeResults:l,p=this.config.cache.policies;o=m(m({},_r(Vn(n))),o);var h=Et(a),d=this.executeSelectionSet({selectionSet:wr(n).selectionSet,objectOrReference:h,enclosingRef:h,context:m({store:t,query:n,policies:p,variables:o,varString:tt(o),canonizeResults:f},ia(n,this.config.fragments))}),y;if(d.missing&&(y=[new Zn(wd(d.missing),d.missing,n,o)],!u))throw y[0];return{result:d.result,complete:!y,missing:y}},r.prototype.isFresh=function(e,t,n,i){if(Tr(i.store)&&this.knownResults.get(e)===n){var a=this.executeSelectionSet.peek(n,t,i,this.canon.isKnown(e));if(a&&e===a.result)return!0}return!1},r.prototype.execSelectionSetImpl=function(e){var t=this,n=e.selectionSet,i=e.objectOrReference,a=e.enclosingRef,o=e.context;if(W(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,l=o.store,f=l.getFieldValue(i,"__typename"),p=[],h,d=new ze;this.config.addTypename&&typeof f=="string"&&!u.rootIdsByTypename[f]&&p.push({__typename:f});function y(S,O){var k;return S.missing&&(h=d.merge(h,(k={},k[O]=S.missing,k))),S.result}var g=new Set(n.selections);g.forEach(function(S){var O,k;if(!!Dt(S,s))if(et(S)){var N=u.readField({fieldName:S.name.value,field:S,variables:o.variables,from:i},o),I=at(S);N===void 0?Er.added(S)||(h=d.merge(h,(O={},O[I]="Can't find field '".concat(S.name.value,"' on ").concat(W(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),O))):ne(N)?N=y(t.executeSubSelectedArray({field:S,array:N,enclosingRef:a,context:o}),I):S.selectionSet?N!=null&&(N=y(t.executeSelectionSet({selectionSet:S.selectionSet,objectOrReference:N,enclosingRef:W(N)?N:a,context:o}),I)):o.canonizeResults&&(N=t.canon.pass(N)),N!==void 0&&p.push((k={},k[I]=N,k))}else{var R=Cr(S,o.lookupFragment);if(!R&&S.kind===we.FRAGMENT_SPREAD)throw __DEV__?new U("No fragment named ".concat(S.name.value)):new U(5);R&&u.fragmentMatches(R,f)&&R.selectionSet.selections.forEach(g.add,g)}});var C=Qn(p),_={result:C,missing:h},b=o.canonizeResults?this.canon.admit(_):Gn(_);return b.result&&this.knownResults.set(b.result,n),b},r.prototype.execSubSelectedArrayImpl=function(e){var t=this,n=e.field,i=e.array,a=e.enclosingRef,o=e.context,s,u=new ze;function l(f,p){var h;return f.missing&&(s=u.merge(s,(h={},h[p]=f.missing,h))),f.result}return n.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(f,p){return f===null?null:ne(f)?l(t.executeSubSelectedArray({field:n,array:f,enclosingRef:a,context:o}),p):n.selectionSet?l(t.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:f,enclosingRef:W(f)?f:a,context:o}),p):(__DEV__&&_d(o.store,n,f),f)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:s}},r}();function wd(r){try{JSON.stringify(r,function(e,t){if(typeof t=="string")throw t;return t})}catch(e){return e}}function _d(r,e,t){if(!e.selectionSet){var n=new Set([t]);n.forEach(function(i){z(i)&&(__DEV__?T(!W(i),"Missing selection set for object of type ".concat(al(r,i)," returned for query field ").concat(e.name.value)):T(!W(i),6),Object.values(i).forEach(n.add,n))})}}var fn=new cn,pl=new WeakMap;function ti(r){var e=pl.get(r);return e||pl.set(r,e={vars:new Set,dep:ea()}),e}function vs(r){ti(r).vars.forEach(function(e){return e.forgetCache(r)})}function dl(r){ti(r).vars.forEach(function(e){return e.attachCache(r)})}function sa(r){var e=new Set,t=new Set,n=function(a){if(arguments.length>0){if(r!==a){r=a,e.forEach(function(u){ti(u).dep.dirty(n),Ed(u)});var o=Array.from(t);t.clear(),o.forEach(function(u){return u(r)})}}else{var s=fn.getValue();s&&(i(s),ti(s).dep(n))}return r};n.onNextChange=function(a){return t.add(a),function(){t.delete(a)}};var i=n.attachCache=function(a){return e.add(a),ti(a).vars.add(n),n};return n.forgetCache=function(a){return e.delete(a)},n}function Ed(r){r.broadcastWatches&&r.broadcastWatches()}var hl=Object.create(null);function bs(r){var e=JSON.stringify(r);return hl[e]||(hl[e]=Object.create(null))}function Cs(r){var e=bs(r);return e.keyFieldsFn||(e.keyFieldsFn=function(t,n){var i=function(o,s){return n.readField(s,o)},a=n.keyObject=ws(r,function(o){var s=pn(n.storeObject,o,i);return s===void 0&&t!==n.storeObject&&ve.call(t,o[0])&&(s=pn(t,o,yl)),__DEV__?T(s!==void 0,"Missing field '".concat(o.join("."),"' while extracting keyFields from ").concat(JSON.stringify(t))):T(s!==void 0,2),s});return"".concat(n.typename,":").concat(JSON.stringify(a))})}function Ss(r){var e=bs(r);return e.keyArgsFn||(e.keyArgsFn=function(t,n){var i=n.field,a=n.variables,o=n.fieldName,s=ws(r,function(l){var f=l[0],p=f.charAt(0);if(p==="@"){if(i&&xe(i.directives)){var h=f.slice(1),d=i.directives.find(function(_){return _.name.value===h}),y=d&&Nt(d,a);return y&&pn(y,l.slice(1))}return}if(p==="$"){var g=f.slice(1);if(a&&ve.call(a,g)){var C=l.slice(0);return C[0]=g,pn(a,C)}return}if(t)return pn(t,l)}),u=JSON.stringify(s);return(t||u!=="{}")&&(o+=":"+u),o})}function ws(r,e){var t=new ze;return ml(r).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=t.merge(n,o)}return n},Object.create(null))}function ml(r){var e=bs(r);if(!e.paths){var t=e.paths=[],n=[];r.forEach(function(i,a){ne(i)?(ml(i).forEach(function(o){return t.push(n.concat(o))}),n.length=0):(n.push(i),ne(r[a+1])||(t.push(n.slice(0)),n.length=0))})}return e.paths}function yl(r,e){return r[e]}function pn(r,e,t){return t=t||yl,gl(e.reduce(function n(i,a){return ne(i)?i.map(function(o){return n(o,a)}):i&&t(i,a)},r))}function gl(r){return z(r)?ne(r)?r.map(gl):ws(Object.keys(r).sort(),function(e){return pn(r,e)}):r}qn.setStringify(tt);function _s(r){return r.args!==void 0?r.args:r.field?Nt(r.field,r.variables):null}var xd=function(){},vl=function(r,e){return e.fieldName},bl=function(r,e,t){var n=t.mergeObjects;return n(r,e)},Cl=function(r,e){return e},wl=function(){function r(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=m({dataIdFromObject:ra},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 r.prototype.identify=function(e,t){var n,i=this,a=t&&(t.typename||((n=t.storeObject)===null||n===void 0?void 0:n.__typename))||e.__typename;if(a===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=t&&t.storeObject||e,s=m(m({},t),{typename:a,storeObject:o,readField:t&&t.readField||function(){var h=ca(arguments,o);return i.readField(h,{store:i.cache.data,variables:h.variables})}}),u,l=a&&this.getTypePolicy(a),f=l&&l.keyFn||this.config.dataIdFromObject;f;){var p=f(e,s);if(ne(p))f=Cs(p);else{u=p;break}}return u=u?String(u):void 0,s.keyObject?[u,s.keyObject]:[u]},r.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach(function(n){var i=e[n],a=i.queryType,o=i.mutationType,s=i.subscriptionType,u=_t(i,["queryType","mutationType","subscriptionType"]);a&&t.setRootTypename("Query",n),o&&t.setRootTypename("Mutation",n),s&&t.setRootTypename("Subscription",n),ve.call(t.toBeAdded,n)?t.toBeAdded[n].push(u):t.toBeAdded[n]=[u]})},r.prototype.updateTypePolicy=function(e,t){var n=this,i=this.getTypePolicy(e),a=t.keyFields,o=t.fields;function s(u,l){u.merge=typeof l=="function"?l:l===!0?bl:l===!1?Cl:u.merge}s(i,t.merge),i.keyFn=a===!1?xd:ne(a)?Cs(a):typeof a=="function"?a:i.keyFn,o&&Object.keys(o).forEach(function(u){var l=n.getFieldPolicy(e,u,!0),f=o[u];if(typeof f=="function")l.read=f;else{var p=f.keyArgs,h=f.read,d=f.merge;l.keyFn=p===!1?vl:ne(p)?Ss(p):typeof p=="function"?p:l.keyFn,typeof h=="function"&&(l.read=h),s(l,d)}l.read&&l.merge&&(l.keyFn=l.keyFn||vl)})},r.prototype.setRootTypename=function(e,t){t===void 0&&(t=e);var n="ROOT_"+e.toUpperCase(),i=this.rootTypenamesById[n];t!==i&&(__DEV__?T(!i||i===e,"Cannot change root ".concat(e," __typename more than once")):T(!i||i===e,3),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[t]=n,this.rootTypenamesById[n]=t)},r.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(n){t.getSupertypeSet(n,!0),e[n].forEach(function(i){t.getSupertypeSet(i,!0).add(n);var a=i.match(ps);(!a||a[0]!==i)&&t.fuzzySubtypes.set(i,new RegExp(i))})})},r.prototype.getTypePolicy=function(e){var t=this;if(!ve.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=t.getTypePolicy(o),u=s.fields,l=_t(s,["fields"]);Object.assign(n,l),Object.assign(n.fields,u)})}var a=this.toBeAdded[e];return a&&a.length&&a.splice(0).forEach(function(o){t.updateTypePolicy(e,o)}),this.typePolicies[e]},r.prototype.getFieldPolicy=function(e,t,n){if(e){var i=this.getTypePolicy(e).fields;return i[t]||n&&(i[t]=Object.create(null))}},r.prototype.getSupertypeSet=function(e,t){var n=this.supertypeMap.get(e);return!n&&t&&this.supertypeMap.set(e,n=new Set),n},r.prototype.fragmentMatches=function(e,t,n,i){var a=this;if(!e.typeCondition)return!0;if(!t)return!1;var o=e.typeCondition.name.value;if(t===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(t,!0),u=[s],l=function(y){var g=a.getSupertypeSet(y,!1);g&&g.size&&u.indexOf(g)<0&&u.push(g)},f=!!(n&&this.fuzzySubtypes.size),p=!1,h=0;h<u.length;++h){var d=u[h];if(d.has(o))return s.has(o)||(p&&__DEV__&&T.warn("Inferring subtype ".concat(t," of supertype ").concat(o)),s.add(o)),!0;d.forEach(l),f&&h===u.length-1&&ta(e.selectionSet,n,i)&&(f=!1,p=!0,this.fuzzySubtypes.forEach(function(y,g){var C=t.match(y);C&&C[0]===t&&l(g)}))}return!1},r.prototype.hasKeyArgs=function(e,t){var n=this.getFieldPolicy(e,t,!1);return!!(n&&n.keyFn)},r.prototype.getStoreFieldName=function(e){var t=e.typename,n=e.fieldName,i=this.getFieldPolicy(t,n,!1),a,o=i&&i.keyFn;if(o&&t)for(var s={typename:t,fieldName:n,field:e.field||null,variables:e.variables},u=_s(e);o;){var l=o(u,s);if(ne(l))o=Ss(l);else{a=l||n;break}}return a===void 0&&(a=e.field?Po(e.field,e.variables):qn(n,_s(e))),a===!1?n:n===yt(a)?a:n+":"+a},r.prototype.readField=function(e,t){var n=e.from;if(!!n){var i=e.field||e.fieldName;if(!!i){if(e.typename===void 0){var a=t.store.getFieldValue(n,"__typename");a&&(e.typename=a)}var o=this.getStoreFieldName(e),s=yt(o),u=t.store.getFieldValue(n,o),l=this.getFieldPolicy(e.typename,s,!1),f=l&&l.read;if(f){var p=Sl(this,n,e,t,t.store.getStorage(W(n)?n.__ref:n,o));return fn.withValue(this.cache,f,[u,p])}return u}}},r.prototype.getReadFunction=function(e,t){var n=this.getFieldPolicy(e,t,!1);return n&&n.read},r.prototype.getMergeFunction=function(e,t,n){var i=this.getFieldPolicy(e,t,!1),a=i&&i.merge;return!a&&n&&(i=this.getTypePolicy(n),a=i&&i.merge),a},r.prototype.runMergeFunction=function(e,t,n,i,a){var o=n.field,s=n.typename,u=n.merge;return u===bl?_l(i.store)(e,t):u===Cl?t:(i.overwrite&&(e=void 0),u(e,t,Sl(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:i.variables},i,a||Object.create(null))))},r}();function Sl(r,e,t,n,i){var a=r.getStoreFieldName(t),o=yt(a),s=t.variables||n.variables,u=n.store,l=u.toReference,f=u.canRead;return{args:_s(t),field:t.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:W,toReference:l,storage:i,cache:r.cache,canRead:f,readField:function(){return r.readField(ca(arguments,e,s),n)},mergeObjects:_l(n.store)}}function ca(r,e,t){var n=r[0],i=r[1],a=r.length,o;return typeof n=="string"?o={fieldName:n,from:a>1?i:e}:(o=m({},n),ve.call(o,"from")||(o.from=e)),__DEV__&&o.from===void 0&&__DEV__&&T.warn("Undefined 'from' passed to readField with arguments ".concat(yu(Array.from(r)))),o.variables===void 0&&(o.variables=t),o}function _l(r){return function(t,n){if(ne(t)||ne(n))throw __DEV__?new U("Cannot automatically merge arrays"):new U(4);if(z(t)&&z(n)){var i=r.getFieldValue(t,"__typename"),a=r.getFieldValue(n,"__typename"),o=i&&a&&i!==a;if(o)return n;if(W(t)&&Xt(n))return r.merge(t.__ref,n),t;if(Xt(t)&&W(n))return r.merge(t,n.__ref),n;if(Xt(t)&&Xt(n))return m(m({},t),n)}return n}}function Es(r,e,t){var n="".concat(e).concat(t),i=r.flavors.get(n);return i||r.flavors.set(n,i=r.clientOnly===e&&r.deferred===t?r:m(m({},r),{clientOnly:e,deferred:t})),i}var Tl=function(){function r(e,t,n){this.cache=e,this.reader=t,this.fragments=n}return r.prototype.writeToStore=function(e,t){var n=this,i=t.query,a=t.result,o=t.dataId,s=t.variables,u=t.overwrite,l=xt(i),f=ol();s=m(m({},_r(l)),s);var p=m(m({store:e,written:Object.create(null),merge:function(d,y){return f.merge(d,y)},variables:s,varString:tt(s)},ia(i,this.fragments)),{overwrite:!!u,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),h=this.processSelectionSet({result:a||Object.create(null),dataId:o,selectionSet:l.selectionSet,mergeTree:{map:new Map},context:p});if(!W(h))throw __DEV__?new U("Could not identify object ".concat(JSON.stringify(a))):new U(7);return p.incomingById.forEach(function(d,y){var g=d.storeObject,C=d.mergeTree,_=d.fieldNodeSet,b=Et(y);if(C&&C.map.size){var S=n.applyMerges(C,b,g,p);if(W(S))return;g=S}if(__DEV__&&!p.overwrite){var O=Object.create(null);_.forEach(function(I){I.selectionSet&&(O[I.name.value]=!0)});var k=function(I){return O[yt(I)]===!0},N=function(I){var R=C&&C.map.get(I);return Boolean(R&&R.info&&R.info.merge)};Object.keys(g).forEach(function(I){k(I)&&!N(I)&&Od(b,g,I,p.store)})}e.merge(y,g)}),e.retain(h.__ref),h},r.prototype.processSelectionSet=function(e){var t=this,n=e.dataId,i=e.result,a=e.selectionSet,o=e.context,s=e.mergeTree,u=this.cache.policies,l=Object.create(null),f=n&&u.rootTypenamesById[n]||Bn(i,a,o.fragmentMap)||n&&o.store.get(n,"__typename");typeof f=="string"&&(l.__typename=f);var p=function(){var S=ca(arguments,l,o.variables);if(W(S.from)){var O=o.incomingById.get(S.from.__ref);if(O){var k=u.readField(m(m({},S),{from:O.storeObject}),o);if(k!==void 0)return k}}return u.readField(S,o)},h=new Set;this.flattenFields(a,i,o,f).forEach(function(S,O){var k,N=at(O),I=i[N];if(h.add(O),I!==void 0){var R=u.getStoreFieldName({typename:f,fieldName:O.name.value,field:O,variables:S.variables}),re=El(s,R),ee=t.processFieldValue(I,O,O.selectionSet?Es(S,!1,!1):S,re),Ct=void 0;O.selectionSet&&(W(ee)||Xt(ee))&&(Ct=p("__typename",ee));var It=u.getMergeFunction(f,O.name.value,Ct);It?re.info={field:O,typename:f,merge:It}:xl(s,R),l=S.merge(l,(k={},k[R]=ee,k))}else __DEV__&&!S.clientOnly&&!S.deferred&&!Er.added(O)&&!u.getReadFunction(f,O.name.value)&&__DEV__&&T.error("Missing field '".concat(at(O),"' while writing result ").concat(JSON.stringify(i,null,2)).substring(0,1e3))});try{var d=u.identify(i,{typename:f,selectionSet:a,fragmentMap:o.fragmentMap,storeObject:l,readField:p}),y=d[0],g=d[1];n=n||y,g&&(l=o.merge(l,g))}catch(S){if(!n)throw S}if(typeof n=="string"){var C=Et(n),_=o.written[n]||(o.written[n]=[]);if(_.indexOf(a)>=0||(_.push(a),this.reader&&this.reader.isFresh(i,C,a,o)))return C;var b=o.incomingById.get(n);return b?(b.storeObject=o.merge(b.storeObject,l),b.mergeTree=xs(b.mergeTree,s),h.forEach(function(S){return b.fieldNodeSet.add(S)})):o.incomingById.set(n,{storeObject:l,mergeTree:ua(s)?void 0:s,fieldNodeSet:h}),C}return l},r.prototype.processFieldValue=function(e,t,n,i){var a=this;return!t.selectionSet||e===null?__DEV__?Vi(e):e:ne(e)?e.map(function(o,s){var u=a.processFieldValue(o,t,n,El(i,s));return xl(i,s),u}):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:i})},r.prototype.flattenFields=function(e,t,n,i){i===void 0&&(i=Bn(t,e,n.fragmentMap));var a=new Map,o=this.cache.policies,s=new Ot(!1);return function u(l,f){var p=s.lookup(l,f.clientOnly,f.deferred);p.visited||(p.visited=!0,l.selections.forEach(function(h){if(!!Dt(h,n.variables)){var d=f.clientOnly,y=f.deferred;if(!(d&&y)&&xe(h.directives)&&h.directives.forEach(function(_){var b=_.name.value;if(b==="client"&&(d=!0),b==="defer"){var S=Nt(_,n.variables);(!S||S.if!==!1)&&(y=!0)}}),et(h)){var g=a.get(h);g&&(d=d&&g.clientOnly,y=y&&g.deferred),a.set(h,Es(n,d,y))}else{var C=Cr(h,n.lookupFragment);if(!C&&h.kind===we.FRAGMENT_SPREAD)throw __DEV__?new U("No fragment named ".concat(h.name.value)):new U(8);C&&o.fragmentMatches(C,i,t,n.variables)&&u(C.selectionSet,Es(n,d,y))}}}))}(e,n),a},r.prototype.applyMerges=function(e,t,n,i,a){var o,s=this;if(e.map.size&&!W(n)){var u=!ne(n)&&(W(t)||Xt(t))?t:void 0,l=n;u&&!a&&(a=[W(u)?u.__ref:u]);var f,p=function(h,d){return ne(h)?typeof d=="number"?h[d]:void 0:i.store.getFieldValue(h,String(d))};e.map.forEach(function(h,d){var y=p(u,d),g=p(l,d);if(g!==void 0){a&&a.push(d);var C=s.applyMerges(h,y,g,i,a);C!==g&&(f=f||new Map,f.set(d,C)),a&&T(a.pop()===d)}}),f&&(n=ne(l)?l.slice(0):m({},l),f.forEach(function(h,d){n[d]=h}))}return e.info?this.cache.policies.runMergeFunction(t,n,e.info,i,a&&(o=i.store).getStorage.apply(o,a)):n},r}();var Al=[];function El(r,e){var t=r.map;return t.has(e)||t.set(e,Al.pop()||{map:new Map}),t.get(e)}function xs(r,e){if(r===e||!e||ua(e))return r;if(!r||ua(r))return e;var t=r.info&&e.info?m(m({},r.info),e.info):r.info||e.info,n=r.map.size&&e.map.size,i=n?new Map:r.map.size?r.map:e.map,a={info:t,map:i};if(n){var o=new Set(e.map.keys());r.map.forEach(function(s,u){a.map.set(u,xs(s,e.map.get(u))),o.delete(u)}),o.forEach(function(s){a.map.set(s,xs(e.map.get(s),r.map.get(s)))})}return a}function ua(r){return!r||!(r.info||r.map.size)}function xl(r,e){var t=r.map,n=t.get(e);n&&ua(n)&&(Al.push(n),t.delete(e))}var Ol=new Set;function Od(r,e,t,n){var i=function(p){var h=n.getFieldValue(p,t);return typeof h=="object"&&h},a=i(r);if(!!a){var o=i(e);if(!!o&&!W(a)&&!ue(a,o)&&!Object.keys(a).every(function(p){return n.getFieldValue(o,p)!==void 0})){var s=n.getFieldValue(r,"__typename")||n.getFieldValue(e,"__typename"),u=yt(t),l="".concat(s,".").concat(u);if(!Ol.has(l)){Ol.add(l);var f=[];!ne(a)&&!ne(o)&&[a,o].forEach(function(p){var h=n.getFieldValue(p,"__typename");typeof h=="string"&&!f.includes(h)&&f.push(h)}),__DEV__&&T.warn("Cache data may be lost when replacing the ".concat(u," field of a ").concat(s,` object.
38
+ `):new U(23)};var Nu=function(){if(typeof AbortController>"u")return{controller:!1,signal:!1};var r=new AbortController,e=r.signal;return{controller:r,signal:e}};var Ru=function(r,e){var t=r.getContext(),n=t.uri;return n||(typeof e=="function"?e(r):e||"/graphql")};function Lu(r,e){var t=[],n=function(p,h){t.push("".concat(p,"=").concat(encodeURIComponent(h)))};if("query"in e&&n("query",e.query),e.operationName&&n("operationName",e.operationName),e.variables){var i=void 0;try{i=Yn(e.variables,"Variables map")}catch(p){return{parseError:p}}n("variables",i)}if(e.extensions){var a=void 0;try{a=Yn(e.extensions,"Extensions map")}catch(p){return{parseError:p}}n("extensions",a)}var o="",s=r,u=r.indexOf("#");u!==-1&&(o=r.substr(u),s=r.substr(0,u));var l=s.indexOf("?")===-1?"?":"&",f=s+l+t.join("&")+o;return{newURI:f}}var Fu=Ie(function(){return fetch}),$u=function(r){r===void 0&&(r={});var e=r.uri,t=e===void 0?"/graphql":e,n=r.fetch,i=r.print,a=i===void 0?ku:i,o=r.includeExtensions,s=r.preserveHeaderCase,u=r.useGETForQueries,l=r.includeUnusedVariables,f=l===void 0?!1:l,p=_t(r,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);__DEV__&&Pu(n||Fu);var h={http:{includeExtensions:o,preserveHeaderCase:s},options:p.fetchOptions,credentials:p.credentials,headers:p.headers};return new st(function(d){var y=Ru(d,t),g=d.getContext(),C={};if(g.clientAwareness){var _=g.clientAwareness,b=_.name,S=_.version;b&&(C["apollographql-client-name"]=b),S&&(C["apollographql-client-version"]=S)}var O=m(m({},C),g.headers),k={http:g.http,options:g.fetchOptions,credentials:g.credentials,headers:O},P=Du(d,a,Iu,h,k),I=P.options,R=P.body;if(R.variables&&!f){var re=new Set(Object.keys(R.variables));Me(d.query,{Variable:function(K,St,V){V&&V.kind!=="VariableDefinition"&&re.delete(K.name.value)}}),re.size&&(R.variables=m({},R.variables),re.forEach(function(K){delete R.variables[K]}))}var ee;if(!I.signal){var Ct=Nu(),It=Ct.controller,ke=Ct.signal;ee=It,ee&&(I.signal=ke)}var B=function(K){return K.kind==="OperationDefinition"&&K.operation==="mutation"};if(u&&!d.query.definitions.some(B)&&(I.method="GET"),Zr(["defer"],d.query)&&(I.headers=I.headers||{},I.headers.accept="multipart/mixed; deferSpec=20220824, application/json"),I.method==="GET"){var me=Lu(y,R),oe=me.newURI,G=me.parseError;if(G)return zi(G);y=oe}else try{I.body=Yn(R,"Payload")}catch(K){return zi(K)}return new Q(function(K){var St=n||Ie(function(){return fetch})||Fu;return St(y,I).then(function(V){var wt;d.setContext({response:V});var Ut=(wt=V.headers)===null||wt===void 0?void 0:wt.get("content-type");return Ut!==null&&/^multipart\/mixed/i.test(Ut)?Ou(V,K):Au(V,d,K)}).catch(function(V){return Yi(V,K)}),function(){ee&&ee.abort()}})})};var ns=function(r){ge(e,r);function e(t){t===void 0&&(t={});var n=r.call(this,$u(t).request)||this;return n.options=t,n}return e}(st);var{toString:Mu,hasOwnProperty:Gp}=Object.prototype,ju=Function.prototype.toString,is=new Map;function ue(r,e){try{return as(r,e)}finally{is.clear()}}function as(r,e){if(r===e)return!0;let t=Mu.call(r),n=Mu.call(e);if(t!==n)return!1;switch(t){case"[object Array]":if(r.length!==e.length)return!1;case"[object Object]":{if(qu(r,e))return!0;let i=Uu(r),a=Uu(e),o=i.length;if(o!==a.length)return!1;for(let s=0;s<o;++s)if(!Gp.call(e,i[s]))return!1;for(let s=0;s<o;++s){let u=i[s];if(!as(r[u],e[u]))return!1}return!0}case"[object Error]":return r.name===e.name&&r.message===e.message;case"[object Number]":if(r!==r)return e!==e;case"[object Boolean]":case"[object Date]":return+r==+e;case"[object RegExp]":case"[object String]":return r==`${e}`;case"[object Map]":case"[object Set]":{if(r.size!==e.size)return!1;if(qu(r,e))return!0;let i=r.entries(),a=t==="[object Map]";for(;;){let o=i.next();if(o.done)break;let[s,u]=o.value;if(!e.has(s)||a&&!as(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]":r=new Uint8Array(r),e=new Uint8Array(e);case"[object DataView]":{let i=r.byteLength;if(i===e.byteLength)for(;i--&&r[i]===e[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{let i=ju.call(r);return i!==ju.call(e)?!1:!Hp(i,zp)}}return!1}function Uu(r){return Object.keys(r).filter(Kp,r)}function Kp(r){return this[r]!==void 0}var zp="{ [native code] }";function Hp(r,e){let t=r.length-e.length;return t>=0&&r.indexOf(e,t)===t}function qu(r,e){let t=is.get(r);if(t){if(t.has(e))return!0}else is.set(r,t=new Set);return t.add(e),!1}var Jp=function(){return Object.create(null)},Bu=Array.prototype,Yp=Bu.forEach,Xp=Bu.slice,Ot=function(){function r(e,t){e===void 0&&(e=!0),t===void 0&&(t=Jp),this.weakness=e,this.makeData=t}return r.prototype.lookup=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.lookupArray(e)},r.prototype.lookupArray=function(e){var t=this;return Yp.call(e,function(n){return t=t.getChildTrie(n)}),t.data||(t.data=this.makeData(Xp.call(e)))},r.prototype.getChildTrie=function(e){var t=this.weakness&&Zp(e)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),n=t.get(e);return n||t.set(e,n=new r(this.weakness,this.makeData)),n},r}();function Zp(r){switch(typeof r){case"object":if(r===null)break;case"function":return!0}return!1}var Re=null,Vu={},ed=1,td=()=>class{constructor(){this.id=["slot",ed++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=Re;e;e=e.parent)if(this.id in e.slots){let t=e.slots[this.id];if(t===Vu)break;return e!==Re&&(Re.slots[this.id]=t),!0}return Re&&(Re.slots[this.id]=Vu),!1}getValue(){if(this.hasValue())return Re.slots[this.id]}withValue(e,t,n,i){let a={__proto__:null,[this.id]:e},o=Re;Re={parent:o,slots:a};try{return t.apply(i,n)}finally{Re=o}}static bind(e){let t=Re;return function(){let n=Re;try{return Re=t,e.apply(this,arguments)}finally{Re=n}}}static noContext(e,t,n){if(Re){let i=Re;try{return Re=null,e.apply(n,t)}finally{Re=i}}else return e.apply(n,t)}};function Qu(r){try{return r()}catch{}}var os="@wry/context:Slot",rd=Qu(()=>globalThis)||Qu(()=>global)||Object.create(null),Wu=rd,cn=Wu[os]||Array[os]||function(r){try{Object.defineProperty(Wu,os,{value:r,enumerable:!1,writable:!1,configurable:!0})}finally{return r}}(td());var{bind:nd,noContext:ad}=cn;function od(){}var sd=function(){function r(e,t){e===void 0&&(e=1/0),t===void 0&&(t=od),this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}return r.prototype.has=function(e){return this.map.has(e)},r.prototype.get=function(e){var t=this.getNode(e);return t&&t.value},r.prototype.getNode=function(e){var t=this.map.get(e);if(t&&t!==this.newest){var n=t.older,i=t.newer;i&&(i.older=n),n&&(n.newer=i),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=i)}return t},r.prototype.set=function(e,t){var n=this.getNode(e);return n?n.value=t:(n={key:e,value:t,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)},r.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},r.prototype.delete=function(e){var t=this.map.get(e);return t?(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0):!1},r}(),Zi=new cn,ss,cd=Object.prototype.hasOwnProperty,us=(ss=Array.from,ss===void 0?function(r){var e=[];return r.forEach(function(t){return e.push(t)}),e}:ss);function Xi(r){var e=r.unsubscribe;typeof e=="function"&&(r.unsubscribe=void 0,e())}var Xn=[],ud=100;function un(r,e){if(!r)throw new Error(e||"assertion failure")}function ld(r,e){var t=r.length;return t>0&&t===e.length&&r[t-1]===e[t-1]}function Ku(r){switch(r.length){case 0:throw new Error("unknown value");case 1:return r[0];case 2:throw r[1]}}function fd(r){return r.slice(0)}var pd=function(){function r(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,++r.count}return r.prototype.peek=function(){if(this.value.length===1&&!Yt(this))return Gu(this),this.value[0]},r.prototype.recompute=function(e){return un(!this.recomputing,"already recomputing"),Gu(this),Yt(this)?dd(this,e):Ku(this.value)},r.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,zu(this),Xi(this))},r.prototype.dispose=function(){var e=this;this.setDirty(),Zu(this),ls(this,function(t,n){t.setDirty(),el(t,e)})},r.prototype.forget=function(){this.dispose()},r.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=Xn.pop()||new Set),this.deps.add(e)},r.prototype.forgetDeps=function(){var e=this;this.deps&&(us(this.deps).forEach(function(t){return t.delete(e)}),this.deps.clear(),Xn.push(this.deps),this.deps=null)},r.count=0,r}();function Gu(r){var e=Zi.getValue();if(e)return r.parents.add(e),e.childValues.has(r)||e.childValues.set(r,[]),Yt(r)?Ju(e,r):Yu(e,r),e}function dd(r,e){return Zu(r),Zi.withValue(r,hd,[r,e]),yd(r,e)&&md(r),Ku(r.value)}function hd(r,e){r.recomputing=!0,r.value.length=0;try{r.value[0]=r.fn.apply(null,e)}catch(t){r.value[1]=t}r.recomputing=!1}function Yt(r){return r.dirty||!!(r.dirtyChildren&&r.dirtyChildren.size)}function md(r){r.dirty=!1,!Yt(r)&&Hu(r)}function zu(r){ls(r,Ju)}function Hu(r){ls(r,Yu)}function ls(r,e){var t=r.parents.size;if(t)for(var n=us(r.parents),i=0;i<t;++i)e(n[i],r)}function Ju(r,e){un(r.childValues.has(e)),un(Yt(e));var t=!Yt(r);if(!r.dirtyChildren)r.dirtyChildren=Xn.pop()||new Set;else if(r.dirtyChildren.has(e))return;r.dirtyChildren.add(e),t&&zu(r)}function Yu(r,e){un(r.childValues.has(e)),un(!Yt(e));var t=r.childValues.get(e);t.length===0?r.childValues.set(e,fd(e.value)):ld(t,e.value)||r.setDirty(),Xu(r,e),!Yt(r)&&Hu(r)}function Xu(r,e){var t=r.dirtyChildren;t&&(t.delete(e),t.size===0&&(Xn.length<ud&&Xn.push(t),r.dirtyChildren=null))}function Zu(r){r.childValues.size>0&&r.childValues.forEach(function(e,t){el(r,t)}),r.forgetDeps(),un(r.dirtyChildren===null)}function el(r,e){e.parents.delete(r),r.childValues.delete(e),Xu(r,e)}function yd(r,e){if(typeof r.subscribe=="function")try{Xi(r),r.unsubscribe=r.subscribe.apply(null,e)}catch{return r.setDirty(),!1}return!0}var gd={setDirty:!0,dispose:!0,forget:!0};function ea(r){var e=new Map,t=r&&r.subscribe;function n(i){var a=Zi.getValue();if(a){var o=e.get(i);o||e.set(i,o=new Set),a.dependOn(o),typeof t=="function"&&(Xi(o),o.unsubscribe=t(i))}}return n.dirty=function(a,o){var s=e.get(a);if(s){var u=o&&cd.call(gd,o)?o:"setDirty";us(s).forEach(function(l){return l[u]()}),e.delete(a),Xi(s)}},n}function tl(){var r=new Ot(typeof WeakMap=="function");return function(){return r.lookupArray(arguments)}}var E4=tl(),cs=new Set;function Or(r,e){e===void 0&&(e=Object.create(null));var t=new sd(e.max||Math.pow(2,16),function(l){return l.dispose()}),n=e.keyArgs,i=e.makeCacheKey||tl(),a=function(){var l=i.apply(null,n?n.apply(null,arguments):arguments);if(l===void 0)return r.apply(null,arguments);var f=t.get(l);f||(t.set(l,f=new pd(r)),f.subscribe=e.subscribe,f.forget=function(){return t.delete(l)});var p=f.recompute(Array.prototype.slice.call(arguments));return t.set(l,f),cs.add(t),Zi.hasValue()||(cs.forEach(function(h){return h.clean()}),cs.clear()),p};Object.defineProperty(a,"size",{get:function(){return t.map.size},configurable:!1,enumerable:!1});function o(l){var f=t.get(l);f&&f.setDirty()}a.dirtyKey=o,a.dirty=function(){o(i.apply(null,arguments))};function s(l){var f=t.get(l);if(f)return f.peek()}a.peekKey=s,a.peek=function(){return s(i.apply(null,arguments))};function u(l){return t.delete(l)}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 fs=function(){function r(){this.getFragmentDoc=Or(Do)}return r.prototype.batch=function(e){var t=this,n=typeof e.optimistic=="string"?e.optimistic:e.optimistic===!1?null:void 0,i;return this.performTransaction(function(){return i=e.update(t)},n),i},r.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},r.prototype.transformDocument=function(e){return e},r.prototype.transformForLink=function(e){return e},r.prototype.identify=function(e){},r.prototype.gc=function(){return[]},r.prototype.modify=function(e){return!1},r.prototype.readQuery=function(e,t){return t===void 0&&(t=!!e.optimistic),this.read(m(m({},e),{rootId:e.id||"ROOT_QUERY",optimistic:t}))},r.prototype.readFragment=function(e,t){return t===void 0&&(t=!!e.optimistic),this.read(m(m({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:t}))},r.prototype.writeQuery=function(e){var t=e.id,n=e.data,i=_t(e,["id","data"]);return this.write(Object.assign(i,{dataId:t||"ROOT_QUERY",result:n}))},r.prototype.writeFragment=function(e){var t=e.id,n=e.data,i=e.fragment,a=e.fragmentName,o=_t(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(i,a),dataId:t,result:n}))},r.prototype.updateQuery=function(e,t){return this.batch({update:function(n){var i=n.readQuery(e),a=t(i);return a==null?i:(n.writeQuery(m(m({},e),{data:a})),a)}})},r.prototype.updateFragment=function(e,t){return this.batch({update:function(n){var i=n.readFragment(e),a=t(i);return a==null?i:(n.writeFragment(m(m({},e),{data:a})),a)}})},r}();var Zn=function(r){ge(e,r);function e(t,n,i,a){var o,s=r.call(this,t)||this;if(s.message=t,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 ve=Object.prototype.hasOwnProperty;function ei(r){return r==null}function ra(r,e){var t=r.__typename,n=r.id,i=r._id;if(typeof t=="string"&&(e&&(e.keyObject=ei(n)?ei(i)?void 0:{_id:i}:{id:n}),ei(n)&&!ei(i)&&(n=i),!ei(n)))return"".concat(t,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var rl={dataIdFromObject:ra,addTypename:!0,resultCaching:!0,canonizeResults:!1};function nl(r){return Jt(rl,r)}function na(r){var e=r.canonizeResults;return e===void 0?rl.canonizeResults:e}function il(r,e){return W(e)?r.get(e.__ref,"__typename"):e&&e.__typename}var ps=/^[_a-z][_0-9a-z]*/i;function yt(r){var e=r.match(ps);return e?e[0]:r}function ta(r,e,t){return z(e)?ne(e)?e.every(function(n){return ta(r,n,t)}):r.selections.every(function(n){if(et(n)&&Dt(n,t)){var i=at(n);return ve.call(e,i)&&(!n.selectionSet||ta(n.selectionSet,e[i],t))}return!0}):!1}function Xt(r){return z(r)&&!W(r)&&!ne(r)}function al(){return new ze}function ia(r,e){var t=br(Sr(r));return{fragmentMap:t,lookupFragment:function(n){var i=t[n];return!i&&e&&(i=e.lookup(n)),i||null}}}var aa=Object.create(null),ds=function(){return aa},ol=Object.create(null),ln=function(){function r(e,t){var n=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(i,a){return Gn(W(i)?n.get(i.__ref,a):i&&i[a])},this.canRead=function(i){return W(i)?n.has(i.__ref):typeof i=="object"},this.toReference=function(i,a){if(typeof i=="string")return Et(i);if(W(i))return i;var o=n.policies.identify(i)[0];if(o){var s=Et(o);return a&&n.merge(o,i),s}}}return r.prototype.toObject=function(){return m({},this.data)},r.prototype.has=function(e){return this.lookup(e,!0)!==void 0},r.prototype.get=function(e,t){if(this.group.depend(e,t),ve.call(this.data,e)){var n=this.data[e];if(n&&ve.call(n,t))return n[t]}if(t==="__typename"&&ve.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof Zt)return this.parent.get(e,t)},r.prototype.lookup=function(e,t){if(t&&this.group.depend(e,"__exists"),ve.call(this.data,e))return this.data[e];if(this instanceof Zt)return this.parent.lookup(e,t);if(this.policies.rootTypenamesById[e])return Object.create(null)},r.prototype.merge=function(e,t){var n=this,i;W(e)&&(e=e.__ref),W(t)&&(t=t.__ref);var a=typeof e=="string"?this.lookup(i=e):e,o=typeof t=="string"?this.lookup(i=t):t;if(!!o){__DEV__?T(typeof i=="string","store.merge expects a string ID"):T(typeof i=="string",1);var s=new ze(bd).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(l){if(!a||a[l]!==s[l]){u[l]=1;var f=yt(l);f!==l&&!n.policies.hasKeyArgs(s.__typename,f)&&(u[f]=1),s[l]===void 0&&!(n instanceof Zt)&&delete s[l]}}),u.__typename&&!(a&&a.__typename)&&this.policies.rootTypenamesById[i]===s.__typename&&delete u.__typename,Object.keys(u).forEach(function(l){return n.group.dirty(i,l)})}}},r.prototype.modify=function(e,t){var n=this,i=this.lookup(e);if(i){var a=Object.create(null),o=!1,s=!0,u={DELETE:aa,INVALIDATE:ol,isReference:W,toReference:this.toReference,canRead:this.canRead,readField:function(l,f){return n.policies.readField(typeof l=="string"?{fieldName:l,from:f||Et(e)}:l,{store:n})}};if(Object.keys(i).forEach(function(l){var f=yt(l),p=i[l];if(p!==void 0){var h=typeof t=="function"?t:t[l]||t[f];if(h){var d=h===ds?aa:h(Gn(p),m(m({},u),{fieldName:f,storeFieldName:l,storage:n.getStorage(e,l)}));d===ol?n.group.dirty(e,l):(d===aa&&(d=void 0),d!==p&&(a[l]=d,o=!0,p=d))}p!==void 0&&(s=!1)}}),o)return this.merge(e,a),s&&(this instanceof Zt?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},r.prototype.delete=function(e,t,n){var i,a=this.lookup(e);if(a){var o=this.getFieldValue(a,"__typename"),s=t&&n?this.policies.getStoreFieldName({typename:o,fieldName:t,args:n}):t;return this.modify(e,s?(i={},i[s]=ds,i):ds)}return!1},r.prototype.evict=function(e,t){var n=!1;return e.id&&(ve.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof Zt&&this!==t&&(n=this.parent.evict(e,t)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n},r.prototype.clear=function(){this.replace(null)},r.prototype.extract=function(){var e=this,t=this.toObject(),n=[];return this.getRootIdSet().forEach(function(i){ve.call(e.policies.rootTypenamesById,i)||n.push(i)}),n.length&&(t.__META={extraRootIds:n.sort()}),t},r.prototype.replace=function(e){var t=this;if(Object.keys(this.data).forEach(function(a){e&&ve.call(e,a)||t.delete(a)}),e){var n=e.__META,i=_t(e,["__META"]);Object.keys(i).forEach(function(a){t.merge(a,i[a])}),n&&n.extraRootIds.forEach(this.retain,this)}},r.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},r.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},r.prototype.getRootIdSet=function(e){return e===void 0&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof Zt?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},r.prototype.gc=function(){var e=this,t=this.getRootIdSet(),n=this.toObject();t.forEach(function(o){ve.call(n,o)&&(Object.keys(e.findChildRefIds(o)).forEach(t.add,t),delete n[o])});var i=Object.keys(n);if(i.length){for(var a=this;a instanceof Zt;)a=a.parent;i.forEach(function(o){return a.delete(o)})}return i},r.prototype.findChildRefIds=function(e){if(!ve.call(this.refs,e)){var t=this.refs[e]=Object.create(null),n=this.data[e];if(!n)return t;var i=new Set([n]);i.forEach(function(a){W(a)&&(t[a.__ref]=!0),z(a)&&Object.keys(a).forEach(function(o){var s=a[o];z(s)&&i.add(s)})})}return this.refs[e]},r.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},r}();var sl=function(){function r(e,t){t===void 0&&(t=null),this.caching=e,this.parent=t,this.d=null,this.resetCaching()}return r.prototype.resetCaching=function(){this.d=this.caching?ea():null,this.keyMaker=new Ot(ot)},r.prototype.depend=function(e,t){if(this.d){this.d(hs(e,t));var n=yt(t);n!==t&&this.d(hs(e,n)),this.parent&&this.parent.depend(e,t)}},r.prototype.dirty=function(e,t){this.d&&this.d.dirty(hs(e,t),t==="__exists"?"forget":"setDirty")},r}();function hs(r,e){return e+"#"+r}function ms(r,e){Tr(r)&&r.group.depend(e,"__exists")}(function(r){var e=function(t){ge(n,t);function n(i){var a=i.policies,o=i.resultCaching,s=o===void 0?!0:o,u=i.seed,l=t.call(this,a,new sl(s))||this;return l.stump=new vd(l),l.storageTrie=new Ot(ot),u&&l.replace(u),l}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}(r);r.Root=e})(ln||(ln={}));var Zt=function(r){ge(e,r);function e(t,n,i,a){var o=r.call(this,n.policies,a)||this;return o.id=t,o.parent=n,o.replay=i,o.group=a,i(o),o}return e.prototype.addLayer=function(t,n){return new e(t,this,n,this.group)},e.prototype.removeLayer=function(t){var n=this,i=this.parent.removeLayer(t);return t===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){ue(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 m(m({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(t){var n=this.parent.findChildRefIds(t);return ve.call(this.data,t)?m(m({},n),r.prototype.findChildRefIds.call(this,t)):n},e.prototype.getStorage=function(){for(var t=this.parent;t.parent;)t=t.parent;return t.getStorage.apply(t,arguments)},e}(ln),vd=function(r){ge(e,r);function e(t){return r.call(this,"EntityStore.Stump",t,function(){},new sl(t.group.caching,t.group))||this}return e.prototype.removeLayer=function(){return this},e.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},e}(Zt);function bd(r,e,t){var n=r[t],i=e[t];return ue(n,i)?n:i}function Tr(r){return!!(r instanceof ln&&r.group.caching)}function Cd(r){return z(r)?ne(r)?r.slice(0):m({__proto__:Object.getPrototypeOf(r)},r):r}var oa=function(){function r(){this.known=new(fu?WeakSet:Set),this.pool=new Ot(ot),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return r.prototype.isKnown=function(e){return z(e)&&this.known.has(e)},r.prototype.pass=function(e){if(z(e)){var t=Cd(e);return this.passes.set(t,e),t}return e},r.prototype.admit=function(e){var t=this;if(z(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],l=this.sortedKeys(e);u.push(l.json);var f=u.length;l.sorted.forEach(function(d){u.push(t.admit(e[d]))});var o=this.pool.lookupArray(u);if(!o.object){var p=o.object=Object.create(s);this.known.add(p),l.sorted.forEach(function(d,y){p[d]=u[f+y]}),__DEV__&&Object.freeze(p)}return o.object}}}return e},r.prototype.sortedKeys=function(e){var t=Object.keys(e),n=this.pool.lookupArray(t);if(!n.keys){t.sort();var i=JSON.stringify(t);(n.keys=this.keysByJSON.get(i))||this.keysByJSON.set(i,n.keys={sorted:t,json:i})}return n.keys},r}();var tt=Object.assign(function(r){if(z(r)){ys===void 0&&cl();var e=ys.admit(r),t=gs.get(e);return t===void 0&&gs.set(e,t=JSON.stringify(e)),t}return JSON.stringify(r)},{reset:cl}),ys,gs;function cl(){ys=new oa,gs=new(ot?WeakMap:Map)}function ul(r){return[r.selectionSet,r.objectOrReference,r.context,r.context.canonizeResults]}var ll=function(){function r(e){var t=this;this.knownResults=new(ot?WeakMap:Map),this.config=Jt(e,{addTypename:e.addTypename!==!1,canonizeResults:na(e)}),this.canon=e.canon||new oa,this.executeSelectionSet=Or(function(n){var i,a=n.context.canonizeResults,o=ul(n);o[3]=!a;var s=(i=t.executeSelectionSet).peek.apply(i,o);return s?a?m(m({},s),{result:t.canon.admit(s.result)}):s:(ms(n.context.store,n.enclosingRef.__ref),t.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize,keyArgs:ul,makeCacheKey:function(n,i,a,o){if(Tr(a.store))return a.store.makeCacheKey(n,W(i)?i.__ref:i,a.varString,o)}}),this.executeSubSelectedArray=Or(function(n){return ms(n.context.store,n.enclosingRef.__ref),t.execSubSelectedArrayImpl(n)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(n){var i=n.field,a=n.array,o=n.context;if(Tr(o.store))return o.store.makeCacheKey(i,a,o.varString)}})}return r.prototype.resetCanon=function(){this.canon=new oa},r.prototype.diffQueryAgainstStore=function(e){var t=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,l=e.canonizeResults,f=l===void 0?this.config.canonizeResults:l,p=this.config.cache.policies;o=m(m({},_r(Vn(n))),o);var h=Et(a),d=this.executeSelectionSet({selectionSet:wr(n).selectionSet,objectOrReference:h,enclosingRef:h,context:m({store:t,query:n,policies:p,variables:o,varString:tt(o),canonizeResults:f},ia(n,this.config.fragments))}),y;if(d.missing&&(y=[new Zn(Sd(d.missing),d.missing,n,o)],!u))throw y[0];return{result:d.result,complete:!y,missing:y}},r.prototype.isFresh=function(e,t,n,i){if(Tr(i.store)&&this.knownResults.get(e)===n){var a=this.executeSelectionSet.peek(n,t,i,this.canon.isKnown(e));if(a&&e===a.result)return!0}return!1},r.prototype.execSelectionSetImpl=function(e){var t=this,n=e.selectionSet,i=e.objectOrReference,a=e.enclosingRef,o=e.context;if(W(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,l=o.store,f=l.getFieldValue(i,"__typename"),p=[],h,d=new ze;this.config.addTypename&&typeof f=="string"&&!u.rootIdsByTypename[f]&&p.push({__typename:f});function y(S,O){var k;return S.missing&&(h=d.merge(h,(k={},k[O]=S.missing,k))),S.result}var g=new Set(n.selections);g.forEach(function(S){var O,k;if(!!Dt(S,s))if(et(S)){var P=u.readField({fieldName:S.name.value,field:S,variables:o.variables,from:i},o),I=at(S);P===void 0?Er.added(S)||(h=d.merge(h,(O={},O[I]="Can't find field '".concat(S.name.value,"' on ").concat(W(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),O))):ne(P)?P=y(t.executeSubSelectedArray({field:S,array:P,enclosingRef:a,context:o}),I):S.selectionSet?P!=null&&(P=y(t.executeSelectionSet({selectionSet:S.selectionSet,objectOrReference:P,enclosingRef:W(P)?P:a,context:o}),I)):o.canonizeResults&&(P=t.canon.pass(P)),P!==void 0&&p.push((k={},k[I]=P,k))}else{var R=Cr(S,o.lookupFragment);if(!R&&S.kind===we.FRAGMENT_SPREAD)throw __DEV__?new U("No fragment named ".concat(S.name.value)):new U(5);R&&u.fragmentMatches(R,f)&&R.selectionSet.selections.forEach(g.add,g)}});var C=Qn(p),_={result:C,missing:h},b=o.canonizeResults?this.canon.admit(_):Gn(_);return b.result&&this.knownResults.set(b.result,n),b},r.prototype.execSubSelectedArrayImpl=function(e){var t=this,n=e.field,i=e.array,a=e.enclosingRef,o=e.context,s,u=new ze;function l(f,p){var h;return f.missing&&(s=u.merge(s,(h={},h[p]=f.missing,h))),f.result}return n.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(f,p){return f===null?null:ne(f)?l(t.executeSubSelectedArray({field:n,array:f,enclosingRef:a,context:o}),p):n.selectionSet?l(t.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:f,enclosingRef:W(f)?f:a,context:o}),p):(__DEV__&&wd(o.store,n,f),f)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:s}},r}();function Sd(r){try{JSON.stringify(r,function(e,t){if(typeof t=="string")throw t;return t})}catch(e){return e}}function wd(r,e,t){if(!e.selectionSet){var n=new Set([t]);n.forEach(function(i){z(i)&&(__DEV__?T(!W(i),"Missing selection set for object of type ".concat(il(r,i)," returned for query field ").concat(e.name.value)):T(!W(i),6),Object.values(i).forEach(n.add,n))})}}var fn=new cn,fl=new WeakMap;function ti(r){var e=fl.get(r);return e||fl.set(r,e={vars:new Set,dep:ea()}),e}function vs(r){ti(r).vars.forEach(function(e){return e.forgetCache(r)})}function pl(r){ti(r).vars.forEach(function(e){return e.attachCache(r)})}function sa(r){var e=new Set,t=new Set,n=function(a){if(arguments.length>0){if(r!==a){r=a,e.forEach(function(u){ti(u).dep.dirty(n),_d(u)});var o=Array.from(t);t.clear(),o.forEach(function(u){return u(r)})}}else{var s=fn.getValue();s&&(i(s),ti(s).dep(n))}return r};n.onNextChange=function(a){return t.add(a),function(){t.delete(a)}};var i=n.attachCache=function(a){return e.add(a),ti(a).vars.add(n),n};return n.forgetCache=function(a){return e.delete(a)},n}function _d(r){r.broadcastWatches&&r.broadcastWatches()}var dl=Object.create(null);function bs(r){var e=JSON.stringify(r);return dl[e]||(dl[e]=Object.create(null))}function Cs(r){var e=bs(r);return e.keyFieldsFn||(e.keyFieldsFn=function(t,n){var i=function(o,s){return n.readField(s,o)},a=n.keyObject=ws(r,function(o){var s=pn(n.storeObject,o,i);return s===void 0&&t!==n.storeObject&&ve.call(t,o[0])&&(s=pn(t,o,ml)),__DEV__?T(s!==void 0,"Missing field '".concat(o.join("."),"' while extracting keyFields from ").concat(JSON.stringify(t))):T(s!==void 0,2),s});return"".concat(n.typename,":").concat(JSON.stringify(a))})}function Ss(r){var e=bs(r);return e.keyArgsFn||(e.keyArgsFn=function(t,n){var i=n.field,a=n.variables,o=n.fieldName,s=ws(r,function(l){var f=l[0],p=f.charAt(0);if(p==="@"){if(i&&xe(i.directives)){var h=f.slice(1),d=i.directives.find(function(_){return _.name.value===h}),y=d&&Pt(d,a);return y&&pn(y,l.slice(1))}return}if(p==="$"){var g=f.slice(1);if(a&&ve.call(a,g)){var C=l.slice(0);return C[0]=g,pn(a,C)}return}if(t)return pn(t,l)}),u=JSON.stringify(s);return(t||u!=="{}")&&(o+=":"+u),o})}function ws(r,e){var t=new ze;return hl(r).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=t.merge(n,o)}return n},Object.create(null))}function hl(r){var e=bs(r);if(!e.paths){var t=e.paths=[],n=[];r.forEach(function(i,a){ne(i)?(hl(i).forEach(function(o){return t.push(n.concat(o))}),n.length=0):(n.push(i),ne(r[a+1])||(t.push(n.slice(0)),n.length=0))})}return e.paths}function ml(r,e){return r[e]}function pn(r,e,t){return t=t||ml,yl(e.reduce(function n(i,a){return ne(i)?i.map(function(o){return n(o,a)}):i&&t(i,a)},r))}function yl(r){return z(r)?ne(r)?r.map(yl):ws(Object.keys(r).sort(),function(e){return pn(r,e)}):r}qn.setStringify(tt);function _s(r){return r.args!==void 0?r.args:r.field?Pt(r.field,r.variables):null}var Ed=function(){},gl=function(r,e){return e.fieldName},vl=function(r,e,t){var n=t.mergeObjects;return n(r,e)},bl=function(r,e){return e},Sl=function(){function r(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=m({dataIdFromObject:ra},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 r.prototype.identify=function(e,t){var n,i=this,a=t&&(t.typename||((n=t.storeObject)===null||n===void 0?void 0:n.__typename))||e.__typename;if(a===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=t&&t.storeObject||e,s=m(m({},t),{typename:a,storeObject:o,readField:t&&t.readField||function(){var h=ca(arguments,o);return i.readField(h,{store:i.cache.data,variables:h.variables})}}),u,l=a&&this.getTypePolicy(a),f=l&&l.keyFn||this.config.dataIdFromObject;f;){var p=f(e,s);if(ne(p))f=Cs(p);else{u=p;break}}return u=u?String(u):void 0,s.keyObject?[u,s.keyObject]:[u]},r.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach(function(n){var i=e[n],a=i.queryType,o=i.mutationType,s=i.subscriptionType,u=_t(i,["queryType","mutationType","subscriptionType"]);a&&t.setRootTypename("Query",n),o&&t.setRootTypename("Mutation",n),s&&t.setRootTypename("Subscription",n),ve.call(t.toBeAdded,n)?t.toBeAdded[n].push(u):t.toBeAdded[n]=[u]})},r.prototype.updateTypePolicy=function(e,t){var n=this,i=this.getTypePolicy(e),a=t.keyFields,o=t.fields;function s(u,l){u.merge=typeof l=="function"?l:l===!0?vl:l===!1?bl:u.merge}s(i,t.merge),i.keyFn=a===!1?Ed:ne(a)?Cs(a):typeof a=="function"?a:i.keyFn,o&&Object.keys(o).forEach(function(u){var l=n.getFieldPolicy(e,u,!0),f=o[u];if(typeof f=="function")l.read=f;else{var p=f.keyArgs,h=f.read,d=f.merge;l.keyFn=p===!1?gl:ne(p)?Ss(p):typeof p=="function"?p:l.keyFn,typeof h=="function"&&(l.read=h),s(l,d)}l.read&&l.merge&&(l.keyFn=l.keyFn||gl)})},r.prototype.setRootTypename=function(e,t){t===void 0&&(t=e);var n="ROOT_"+e.toUpperCase(),i=this.rootTypenamesById[n];t!==i&&(__DEV__?T(!i||i===e,"Cannot change root ".concat(e," __typename more than once")):T(!i||i===e,3),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[t]=n,this.rootTypenamesById[n]=t)},r.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(n){t.getSupertypeSet(n,!0),e[n].forEach(function(i){t.getSupertypeSet(i,!0).add(n);var a=i.match(ps);(!a||a[0]!==i)&&t.fuzzySubtypes.set(i,new RegExp(i))})})},r.prototype.getTypePolicy=function(e){var t=this;if(!ve.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=t.getTypePolicy(o),u=s.fields,l=_t(s,["fields"]);Object.assign(n,l),Object.assign(n.fields,u)})}var a=this.toBeAdded[e];return a&&a.length&&a.splice(0).forEach(function(o){t.updateTypePolicy(e,o)}),this.typePolicies[e]},r.prototype.getFieldPolicy=function(e,t,n){if(e){var i=this.getTypePolicy(e).fields;return i[t]||n&&(i[t]=Object.create(null))}},r.prototype.getSupertypeSet=function(e,t){var n=this.supertypeMap.get(e);return!n&&t&&this.supertypeMap.set(e,n=new Set),n},r.prototype.fragmentMatches=function(e,t,n,i){var a=this;if(!e.typeCondition)return!0;if(!t)return!1;var o=e.typeCondition.name.value;if(t===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(t,!0),u=[s],l=function(y){var g=a.getSupertypeSet(y,!1);g&&g.size&&u.indexOf(g)<0&&u.push(g)},f=!!(n&&this.fuzzySubtypes.size),p=!1,h=0;h<u.length;++h){var d=u[h];if(d.has(o))return s.has(o)||(p&&__DEV__&&T.warn("Inferring subtype ".concat(t," of supertype ").concat(o)),s.add(o)),!0;d.forEach(l),f&&h===u.length-1&&ta(e.selectionSet,n,i)&&(f=!1,p=!0,this.fuzzySubtypes.forEach(function(y,g){var C=t.match(y);C&&C[0]===t&&l(g)}))}return!1},r.prototype.hasKeyArgs=function(e,t){var n=this.getFieldPolicy(e,t,!1);return!!(n&&n.keyFn)},r.prototype.getStoreFieldName=function(e){var t=e.typename,n=e.fieldName,i=this.getFieldPolicy(t,n,!1),a,o=i&&i.keyFn;if(o&&t)for(var s={typename:t,fieldName:n,field:e.field||null,variables:e.variables},u=_s(e);o;){var l=o(u,s);if(ne(l))o=Ss(l);else{a=l||n;break}}return a===void 0&&(a=e.field?No(e.field,e.variables):qn(n,_s(e))),a===!1?n:n===yt(a)?a:n+":"+a},r.prototype.readField=function(e,t){var n=e.from;if(!!n){var i=e.field||e.fieldName;if(!!i){if(e.typename===void 0){var a=t.store.getFieldValue(n,"__typename");a&&(e.typename=a)}var o=this.getStoreFieldName(e),s=yt(o),u=t.store.getFieldValue(n,o),l=this.getFieldPolicy(e.typename,s,!1),f=l&&l.read;if(f){var p=Cl(this,n,e,t,t.store.getStorage(W(n)?n.__ref:n,o));return fn.withValue(this.cache,f,[u,p])}return u}}},r.prototype.getReadFunction=function(e,t){var n=this.getFieldPolicy(e,t,!1);return n&&n.read},r.prototype.getMergeFunction=function(e,t,n){var i=this.getFieldPolicy(e,t,!1),a=i&&i.merge;return!a&&n&&(i=this.getTypePolicy(n),a=i&&i.merge),a},r.prototype.runMergeFunction=function(e,t,n,i,a){var o=n.field,s=n.typename,u=n.merge;return u===vl?wl(i.store)(e,t):u===bl?t:(i.overwrite&&(e=void 0),u(e,t,Cl(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:i.variables},i,a||Object.create(null))))},r}();function Cl(r,e,t,n,i){var a=r.getStoreFieldName(t),o=yt(a),s=t.variables||n.variables,u=n.store,l=u.toReference,f=u.canRead;return{args:_s(t),field:t.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:W,toReference:l,storage:i,cache:r.cache,canRead:f,readField:function(){return r.readField(ca(arguments,e,s),n)},mergeObjects:wl(n.store)}}function ca(r,e,t){var n=r[0],i=r[1],a=r.length,o;return typeof n=="string"?o={fieldName:n,from:a>1?i:e}:(o=m({},n),ve.call(o,"from")||(o.from=e)),__DEV__&&o.from===void 0&&__DEV__&&T.warn("Undefined 'from' passed to readField with arguments ".concat(mu(Array.from(r)))),o.variables===void 0&&(o.variables=t),o}function wl(r){return function(t,n){if(ne(t)||ne(n))throw __DEV__?new U("Cannot automatically merge arrays"):new U(4);if(z(t)&&z(n)){var i=r.getFieldValue(t,"__typename"),a=r.getFieldValue(n,"__typename"),o=i&&a&&i!==a;if(o)return n;if(W(t)&&Xt(n))return r.merge(t.__ref,n),t;if(Xt(t)&&W(n))return r.merge(t,n.__ref),n;if(Xt(t)&&Xt(n))return m(m({},t),n)}return n}}function Es(r,e,t){var n="".concat(e).concat(t),i=r.flavors.get(n);return i||r.flavors.set(n,i=r.clientOnly===e&&r.deferred===t?r:m(m({},r),{clientOnly:e,deferred:t})),i}var Ol=function(){function r(e,t,n){this.cache=e,this.reader=t,this.fragments=n}return r.prototype.writeToStore=function(e,t){var n=this,i=t.query,a=t.result,o=t.dataId,s=t.variables,u=t.overwrite,l=xt(i),f=al();s=m(m({},_r(l)),s);var p=m(m({store:e,written:Object.create(null),merge:function(d,y){return f.merge(d,y)},variables:s,varString:tt(s)},ia(i,this.fragments)),{overwrite:!!u,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),h=this.processSelectionSet({result:a||Object.create(null),dataId:o,selectionSet:l.selectionSet,mergeTree:{map:new Map},context:p});if(!W(h))throw __DEV__?new U("Could not identify object ".concat(JSON.stringify(a))):new U(7);return p.incomingById.forEach(function(d,y){var g=d.storeObject,C=d.mergeTree,_=d.fieldNodeSet,b=Et(y);if(C&&C.map.size){var S=n.applyMerges(C,b,g,p);if(W(S))return;g=S}if(__DEV__&&!p.overwrite){var O=Object.create(null);_.forEach(function(I){I.selectionSet&&(O[I.name.value]=!0)});var k=function(I){return O[yt(I)]===!0},P=function(I){var R=C&&C.map.get(I);return Boolean(R&&R.info&&R.info.merge)};Object.keys(g).forEach(function(I){k(I)&&!P(I)&&xd(b,g,I,p.store)})}e.merge(y,g)}),e.retain(h.__ref),h},r.prototype.processSelectionSet=function(e){var t=this,n=e.dataId,i=e.result,a=e.selectionSet,o=e.context,s=e.mergeTree,u=this.cache.policies,l=Object.create(null),f=n&&u.rootTypenamesById[n]||Bn(i,a,o.fragmentMap)||n&&o.store.get(n,"__typename");typeof f=="string"&&(l.__typename=f);var p=function(){var S=ca(arguments,l,o.variables);if(W(S.from)){var O=o.incomingById.get(S.from.__ref);if(O){var k=u.readField(m(m({},S),{from:O.storeObject}),o);if(k!==void 0)return k}}return u.readField(S,o)},h=new Set;this.flattenFields(a,i,o,f).forEach(function(S,O){var k,P=at(O),I=i[P];if(h.add(O),I!==void 0){var R=u.getStoreFieldName({typename:f,fieldName:O.name.value,field:O,variables:S.variables}),re=_l(s,R),ee=t.processFieldValue(I,O,O.selectionSet?Es(S,!1,!1):S,re),Ct=void 0;O.selectionSet&&(W(ee)||Xt(ee))&&(Ct=p("__typename",ee));var It=u.getMergeFunction(f,O.name.value,Ct);It?re.info={field:O,typename:f,merge:It}:El(s,R),l=S.merge(l,(k={},k[R]=ee,k))}else __DEV__&&!S.clientOnly&&!S.deferred&&!Er.added(O)&&!u.getReadFunction(f,O.name.value)&&__DEV__&&T.error("Missing field '".concat(at(O),"' while writing result ").concat(JSON.stringify(i,null,2)).substring(0,1e3))});try{var d=u.identify(i,{typename:f,selectionSet:a,fragmentMap:o.fragmentMap,storeObject:l,readField:p}),y=d[0],g=d[1];n=n||y,g&&(l=o.merge(l,g))}catch(S){if(!n)throw S}if(typeof n=="string"){var C=Et(n),_=o.written[n]||(o.written[n]=[]);if(_.indexOf(a)>=0||(_.push(a),this.reader&&this.reader.isFresh(i,C,a,o)))return C;var b=o.incomingById.get(n);return b?(b.storeObject=o.merge(b.storeObject,l),b.mergeTree=xs(b.mergeTree,s),h.forEach(function(S){return b.fieldNodeSet.add(S)})):o.incomingById.set(n,{storeObject:l,mergeTree:ua(s)?void 0:s,fieldNodeSet:h}),C}return l},r.prototype.processFieldValue=function(e,t,n,i){var a=this;return!t.selectionSet||e===null?__DEV__?Vi(e):e:ne(e)?e.map(function(o,s){var u=a.processFieldValue(o,t,n,_l(i,s));return El(i,s),u}):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:i})},r.prototype.flattenFields=function(e,t,n,i){i===void 0&&(i=Bn(t,e,n.fragmentMap));var a=new Map,o=this.cache.policies,s=new Ot(!1);return function u(l,f){var p=s.lookup(l,f.clientOnly,f.deferred);p.visited||(p.visited=!0,l.selections.forEach(function(h){if(!!Dt(h,n.variables)){var d=f.clientOnly,y=f.deferred;if(!(d&&y)&&xe(h.directives)&&h.directives.forEach(function(_){var b=_.name.value;if(b==="client"&&(d=!0),b==="defer"){var S=Pt(_,n.variables);(!S||S.if!==!1)&&(y=!0)}}),et(h)){var g=a.get(h);g&&(d=d&&g.clientOnly,y=y&&g.deferred),a.set(h,Es(n,d,y))}else{var C=Cr(h,n.lookupFragment);if(!C&&h.kind===we.FRAGMENT_SPREAD)throw __DEV__?new U("No fragment named ".concat(h.name.value)):new U(8);C&&o.fragmentMatches(C,i,t,n.variables)&&u(C.selectionSet,Es(n,d,y))}}}))}(e,n),a},r.prototype.applyMerges=function(e,t,n,i,a){var o,s=this;if(e.map.size&&!W(n)){var u=!ne(n)&&(W(t)||Xt(t))?t:void 0,l=n;u&&!a&&(a=[W(u)?u.__ref:u]);var f,p=function(h,d){return ne(h)?typeof d=="number"?h[d]:void 0:i.store.getFieldValue(h,String(d))};e.map.forEach(function(h,d){var y=p(u,d),g=p(l,d);if(g!==void 0){a&&a.push(d);var C=s.applyMerges(h,y,g,i,a);C!==g&&(f=f||new Map,f.set(d,C)),a&&T(a.pop()===d)}}),f&&(n=ne(l)?l.slice(0):m({},l),f.forEach(function(h,d){n[d]=h}))}return e.info?this.cache.policies.runMergeFunction(t,n,e.info,i,a&&(o=i.store).getStorage.apply(o,a)):n},r}();var Tl=[];function _l(r,e){var t=r.map;return t.has(e)||t.set(e,Tl.pop()||{map:new Map}),t.get(e)}function xs(r,e){if(r===e||!e||ua(e))return r;if(!r||ua(r))return e;var t=r.info&&e.info?m(m({},r.info),e.info):r.info||e.info,n=r.map.size&&e.map.size,i=n?new Map:r.map.size?r.map:e.map,a={info:t,map:i};if(n){var o=new Set(e.map.keys());r.map.forEach(function(s,u){a.map.set(u,xs(s,e.map.get(u))),o.delete(u)}),o.forEach(function(s){a.map.set(s,xs(e.map.get(s),r.map.get(s)))})}return a}function ua(r){return!r||!(r.info||r.map.size)}function El(r,e){var t=r.map,n=t.get(e);n&&ua(n)&&(Tl.push(n),t.delete(e))}var xl=new Set;function xd(r,e,t,n){var i=function(p){var h=n.getFieldValue(p,t);return typeof h=="object"&&h},a=i(r);if(!!a){var o=i(e);if(!!o&&!W(a)&&!ue(a,o)&&!Object.keys(a).every(function(p){return n.getFieldValue(o,p)!==void 0})){var s=n.getFieldValue(r,"__typename")||n.getFieldValue(e,"__typename"),u=yt(t),l="".concat(s,".").concat(u);if(!xl.has(l)){xl.add(l);var f=[];!ne(a)&&!ne(o)&&[a,o].forEach(function(p){var h=n.getFieldValue(p,"__typename");typeof h=="string"&&!f.includes(h)&&f.push(h)}),__DEV__&&T.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(f.length?"either ensure all objects of type "+f.join(" and ")+" have an ID or a custom merge function, or ":"","define a custom merge function for the ").concat(l,` field, so InMemoryCache can safely merge these objects:
41
41
 
@@ -46,21 +46,21 @@ 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 la=function(r){ge(e,r);function e(t){t===void 0&&(t={});var n=r.call(this)||this;return n.watches=new Set,n.typenameDocumentCache=new Map,n.makeVar=sa,n.txCount=0,n.config=il(t),n.addTypename=!!n.config.addTypename,n.policies=new wl({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return e.prototype.init=function(){var t=this.data=new ln.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=t.stump,this.resetResultCache()},e.prototype.resetResultCache=function(t){var n=this,i=this.storeReader,a=this.config.fragments;this.storeWriter=new Tl(this,this.storeReader=new fl({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:na(this.config),canon:t?void 0:i&&i.canon,fragments:a}),a),this.maybeBroadcastWatch=Or(function(o,s){return n.broadcastWatch(o,s)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(o){var s=o.optimistic?n.optimisticData:n.data;if(Tr(s)){var u=o.optimistic,l=o.id,f=o.variables;return s.makeCacheKey(o.query,o.callback,tt({optimistic:u,id:l,variables:f}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(o){return o.resetCaching()})},e.prototype.restore=function(t){return this.init(),t&&this.data.replace(t),this},e.prototype.extract=function(t){return t===void 0&&(t=!1),(t?this.optimisticData:this.data).extract()},e.prototype.read=function(t){var n=t.returnPartialData,i=n===void 0?!1:n;try{return this.storeReader.diffQueryAgainstStore(m(m({},t),{store:t.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:i})).result||null}catch(a){if(a instanceof Zn)return null;throw a}},e.prototype.write=function(t){try{return++this.txCount,this.storeWriter.writeToStore(this.data,t)}finally{!--this.txCount&&t.broadcast!==!1&&this.broadcastWatches()}},e.prototype.modify=function(t){if(ve.call(t,"id")&&!t.id)return!1;var n=t.optimistic?this.optimisticData:this.data;try{return++this.txCount,n.modify(t.id||"ROOT_QUERY",t.fields)}finally{!--this.txCount&&t.broadcast!==!1&&this.broadcastWatches()}},e.prototype.diff=function(t){return this.storeReader.diffQueryAgainstStore(m(m({},t),{store:t.optimistic?this.optimisticData:this.data,rootId:t.id||"ROOT_QUERY",config:this.config}))},e.prototype.watch=function(t){var n=this;return this.watches.size||dl(this),this.watches.add(t),t.immediate&&this.maybeBroadcastWatch(t),function(){n.watches.delete(t)&&!n.watches.size&&vs(n),n.maybeBroadcastWatch.forget(t)}},e.prototype.gc=function(t){tt.reset();var n=this.optimisticData.gc();return t&&!this.txCount&&(t.resetResultCache?this.resetResultCache(t.resetResultIdentities):t.resetResultIdentities&&this.storeReader.resetCanon()),n},e.prototype.retain=function(t,n){return(n?this.optimisticData:this.data).retain(t)},e.prototype.release=function(t,n){return(n?this.optimisticData:this.data).release(t)},e.prototype.identify=function(t){if(W(t))return t.__ref;try{return this.policies.identify(t)[0]}catch(n){__DEV__&&T.warn(n)}},e.prototype.evict=function(t){if(!t.id){if(ve.call(t,"id"))return!1;t=m(m({},t),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(t,this.data)}finally{!--this.txCount&&t.broadcast!==!1&&this.broadcastWatches()}},e.prototype.reset=function(t){var n=this;return this.init(),tt.reset(),t&&t.discardWatches?(this.watches.forEach(function(i){return n.maybeBroadcastWatch.forget(i)}),this.watches.clear(),vs(this)):this.broadcastWatches(),Promise.resolve()},e.prototype.removeOptimistic=function(t){var n=this.optimisticData.removeLayer(t);n!==this.optimisticData&&(this.optimisticData=n,this.broadcastWatches())},e.prototype.batch=function(t){var n=this,i=t.update,a=t.optimistic,o=a===void 0?!0:a,s=t.removeOptimistic,u=t.onWatchUpdated,l,f=function(h){var d=n,y=d.data,g=d.optimisticData;++n.txCount,h&&(n.data=n.optimisticData=h);try{return l=i(n)}finally{--n.txCount,n.data=y,n.optimisticData=g}},p=new Set;return u&&!this.txCount&&this.broadcastWatches(m(m({},t),{onWatchUpdated:function(h){return p.add(h),!1}})),typeof o=="string"?this.optimisticData=this.optimisticData.addLayer(o,f):o===!1?f(this.data):f(),typeof s=="string"&&(this.optimisticData=this.optimisticData.removeLayer(s)),u&&p.size?(this.broadcastWatches(m(m({},t),{onWatchUpdated:function(h,d){var y=u.call(this,h,d);return y!==!1&&p.delete(h),y}})),p.size&&p.forEach(function(h){return n.maybeBroadcastWatch.dirty(h)})):this.broadcastWatches(t),l},e.prototype.performTransaction=function(t,n){return this.batch({update:t,optimistic:n||n!==null})},e.prototype.transformDocument=function(t){if(this.addTypename){var n=this.typenameDocumentCache.get(t);return n||(n=Er(t),this.typenameDocumentCache.set(t,n),this.typenameDocumentCache.set(n,n)),n}return t},e.prototype.transformForLink=function(t){var n=this.config.fragments;return n?n.transform(t):t},e.prototype.broadcastWatches=function(t){var n=this;this.txCount||this.watches.forEach(function(i){return n.maybeBroadcastWatch(i,t)})},e.prototype.broadcastWatch=function(t,n){var i=t.lastDiff,a=this.diff(t);n&&(t.optimistic&&typeof n.optimistic=="string"&&(a.fromOptimisticTransaction=!0),n.onWatchUpdated&&n.onWatchUpdated.call(this,t,a,i)===!1)||(!i||!ue(i.result,a.result))&&t.callback(t.lastDiff=a,i)},e}(fs);function Il(r){return r.hasOwnProperty("graphQLErrors")}var Td=function(r){var e="";if(xe(r.graphQLErrors)||xe(r.clientErrors)){var t=(r.graphQLErrors||[]).concat(r.clientErrors||[]);t.forEach(function(n){var i=n?n.message:"Error message not found.";e+="".concat(i,`
49
+ `))}}}}var la=function(r){ge(e,r);function e(t){t===void 0&&(t={});var n=r.call(this)||this;return n.watches=new Set,n.typenameDocumentCache=new Map,n.makeVar=sa,n.txCount=0,n.config=nl(t),n.addTypename=!!n.config.addTypename,n.policies=new Sl({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return e.prototype.init=function(){var t=this.data=new ln.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=t.stump,this.resetResultCache()},e.prototype.resetResultCache=function(t){var n=this,i=this.storeReader,a=this.config.fragments;this.storeWriter=new Ol(this,this.storeReader=new ll({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:na(this.config),canon:t?void 0:i&&i.canon,fragments:a}),a),this.maybeBroadcastWatch=Or(function(o,s){return n.broadcastWatch(o,s)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(o){var s=o.optimistic?n.optimisticData:n.data;if(Tr(s)){var u=o.optimistic,l=o.id,f=o.variables;return s.makeCacheKey(o.query,o.callback,tt({optimistic:u,id:l,variables:f}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(o){return o.resetCaching()})},e.prototype.restore=function(t){return this.init(),t&&this.data.replace(t),this},e.prototype.extract=function(t){return t===void 0&&(t=!1),(t?this.optimisticData:this.data).extract()},e.prototype.read=function(t){var n=t.returnPartialData,i=n===void 0?!1:n;try{return this.storeReader.diffQueryAgainstStore(m(m({},t),{store:t.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:i})).result||null}catch(a){if(a instanceof Zn)return null;throw a}},e.prototype.write=function(t){try{return++this.txCount,this.storeWriter.writeToStore(this.data,t)}finally{!--this.txCount&&t.broadcast!==!1&&this.broadcastWatches()}},e.prototype.modify=function(t){if(ve.call(t,"id")&&!t.id)return!1;var n=t.optimistic?this.optimisticData:this.data;try{return++this.txCount,n.modify(t.id||"ROOT_QUERY",t.fields)}finally{!--this.txCount&&t.broadcast!==!1&&this.broadcastWatches()}},e.prototype.diff=function(t){return this.storeReader.diffQueryAgainstStore(m(m({},t),{store:t.optimistic?this.optimisticData:this.data,rootId:t.id||"ROOT_QUERY",config:this.config}))},e.prototype.watch=function(t){var n=this;return this.watches.size||pl(this),this.watches.add(t),t.immediate&&this.maybeBroadcastWatch(t),function(){n.watches.delete(t)&&!n.watches.size&&vs(n),n.maybeBroadcastWatch.forget(t)}},e.prototype.gc=function(t){tt.reset();var n=this.optimisticData.gc();return t&&!this.txCount&&(t.resetResultCache?this.resetResultCache(t.resetResultIdentities):t.resetResultIdentities&&this.storeReader.resetCanon()),n},e.prototype.retain=function(t,n){return(n?this.optimisticData:this.data).retain(t)},e.prototype.release=function(t,n){return(n?this.optimisticData:this.data).release(t)},e.prototype.identify=function(t){if(W(t))return t.__ref;try{return this.policies.identify(t)[0]}catch(n){__DEV__&&T.warn(n)}},e.prototype.evict=function(t){if(!t.id){if(ve.call(t,"id"))return!1;t=m(m({},t),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(t,this.data)}finally{!--this.txCount&&t.broadcast!==!1&&this.broadcastWatches()}},e.prototype.reset=function(t){var n=this;return this.init(),tt.reset(),t&&t.discardWatches?(this.watches.forEach(function(i){return n.maybeBroadcastWatch.forget(i)}),this.watches.clear(),vs(this)):this.broadcastWatches(),Promise.resolve()},e.prototype.removeOptimistic=function(t){var n=this.optimisticData.removeLayer(t);n!==this.optimisticData&&(this.optimisticData=n,this.broadcastWatches())},e.prototype.batch=function(t){var n=this,i=t.update,a=t.optimistic,o=a===void 0?!0:a,s=t.removeOptimistic,u=t.onWatchUpdated,l,f=function(h){var d=n,y=d.data,g=d.optimisticData;++n.txCount,h&&(n.data=n.optimisticData=h);try{return l=i(n)}finally{--n.txCount,n.data=y,n.optimisticData=g}},p=new Set;return u&&!this.txCount&&this.broadcastWatches(m(m({},t),{onWatchUpdated:function(h){return p.add(h),!1}})),typeof o=="string"?this.optimisticData=this.optimisticData.addLayer(o,f):o===!1?f(this.data):f(),typeof s=="string"&&(this.optimisticData=this.optimisticData.removeLayer(s)),u&&p.size?(this.broadcastWatches(m(m({},t),{onWatchUpdated:function(h,d){var y=u.call(this,h,d);return y!==!1&&p.delete(h),y}})),p.size&&p.forEach(function(h){return n.maybeBroadcastWatch.dirty(h)})):this.broadcastWatches(t),l},e.prototype.performTransaction=function(t,n){return this.batch({update:t,optimistic:n||n!==null})},e.prototype.transformDocument=function(t){if(this.addTypename){var n=this.typenameDocumentCache.get(t);return n||(n=Er(t),this.typenameDocumentCache.set(t,n),this.typenameDocumentCache.set(n,n)),n}return t},e.prototype.transformForLink=function(t){var n=this.config.fragments;return n?n.transform(t):t},e.prototype.broadcastWatches=function(t){var n=this;this.txCount||this.watches.forEach(function(i){return n.maybeBroadcastWatch(i,t)})},e.prototype.broadcastWatch=function(t,n){var i=t.lastDiff,a=this.diff(t);n&&(t.optimistic&&typeof n.optimistic=="string"&&(a.fromOptimisticTransaction=!0),n.onWatchUpdated&&n.onWatchUpdated.call(this,t,a,i)===!1)||(!i||!ue(i.result,a.result))&&t.callback(t.lastDiff=a,i)},e}(fs);function Al(r){return r.hasOwnProperty("graphQLErrors")}var Od=function(r){var e="";if(xe(r.graphQLErrors)||xe(r.clientErrors)){var t=(r.graphQLErrors||[]).concat(r.clientErrors||[]);t.forEach(function(n){var i=n?n.message:"Error message not found.";e+="".concat(i,`
50
50
  `)})}return r.networkError&&(e+="".concat(r.networkError.message,`
51
- `)),e=e.replace(/\n$/,""),e},Pt=function(r){ge(e,r);function e(t){var n=t.graphQLErrors,i=t.clientErrors,a=t.networkError,o=t.errorMessage,s=t.extraInfo,u=r.call(this,o)||this;return u.name="ApolloError",u.graphQLErrors=n||[],u.clientErrors=i||[],u.networkError=a||null,u.message=o||Td(u),u.extraInfo=s,u.__proto__=e.prototype,u}return e}(Error);var te;(function(r){r[r.loading=1]="loading",r[r.setVariables=2]="setVariables",r[r.fetchMore=3]="fetchMore",r[r.refetch=4]="refetch",r[r.poll=6]="poll",r[r.ready=7]="ready",r[r.error=8]="error"})(te||(te={}));function er(r){return r?r<7:!1}var Ad=Object.assign,Id=Object.hasOwnProperty,fa=function(r){ge(e,r);function e(t){var n=t.queryManager,i=t.queryInfo,a=t.options,o=r.call(this,function(C){try{var _=C._subscription._observer;_&&!_.error&&(_.error=kd)}catch{}var b=!o.observers.size;o.observers.add(C);var S=o.last;return S&&S.error?C.error&&C.error(S.error):S&&S.result&&C.next&&C.next(S.result),b&&o.reobserve().catch(function(){}),function(){o.observers.delete(C)&&!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,l=u.fetchPolicy,f=l===void 0?"cache-first":l,p=a.fetchPolicy,h=p===void 0?f:p,d=a.initialFetchPolicy,y=d===void 0?h==="standby"?f:h:d;o.options=m(m({},a),{initialFetchPolicy:y,fetchPolicy:h}),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 t=this;return new Promise(function(n,i){var a={next:function(s){n(s),t.observers.delete(a),t.observers.size||t.queryManager.removeQuery(t.queryId),setTimeout(function(){o.unsubscribe()},0)},error:i},o=t.subscribe(a)})},e.prototype.getCurrentResult=function(t){t===void 0&&(t=!0);var n=this.getLastResult(!0),i=this.queryInfo.networkStatus||n&&n.networkStatus||te.ready,a=m(m({},n),{loading:er(i),networkStatus:i}),o=this.options.fetchPolicy,s=o===void 0?"cache-first":o;if(!(s==="network-only"||s==="no-cache"||s==="standby"||this.queryManager.transform(this.options.query).hasForcedResolvers)){var u=this.queryInfo.getDiff();(u.complete||this.options.returnPartialData)&&(a.data=u.result),ue(a.data,{})&&(a.data=void 0),u.complete?(delete a.partial,u.complete&&a.networkStatus===te.loading&&(s==="cache-first"||s==="cache-only")&&(a.networkStatus=te.ready,a.loading=!1)):a.partial=!0,__DEV__&&!u.complete&&!this.options.partialRefetch&&!a.loading&&!a.data&&!a.error&&Ts(u.missing)}return t&&this.updateLastResult(a),a},e.prototype.isDifferentFromLastResult=function(t,n){return!this.last||!ue(this.last.result,t)||n&&!ue(this.last.variables,n)},e.prototype.getLast=function(t,n){var i=this.last;if(i&&i[t]&&(!n||ue(i.variables,this.variables)))return i[t]},e.prototype.getLastResult=function(t){return this.getLast("result",t)},e.prototype.getLastError=function(t){return this.getLast("error",t)},e.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},e.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},e.prototype.refetch=function(t){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__&&t&&Id.call(t,"variables")){var o=Vn(this.query),s=o.variableDefinitions;(!s||!s.some(function(u){return u.variable.name.value==="variables"}))&&__DEV__&&T.warn("Called refetch(".concat(JSON.stringify(t),") 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 t&&!ue(this.options.variables,t)&&(i.variables=this.options.variables=m(m({},this.options.variables),t)),this.queryInfo.resetLastWrite(),this.reobserve(i,te.refetch)},e.prototype.fetchMore=function(t){var n=this,i=m(m({},t.query?t:m(m(m(m({},this.options),{query:this.query}),t),{variables:m(m({},this.options.variables),t.variables)})),{fetchPolicy:"no-cache"}),a=this.queryManager.generateQueryId(),o=this.queryInfo,s=o.networkStatus;o.networkStatus=te.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var u=new Set;return this.queryManager.fetchQuery(a,i,te.fetchMore).then(function(l){return n.queryManager.removeQuery(a),o.networkStatus===te.fetchMore&&(o.networkStatus=s),n.queryManager.cache.batch({update:function(f){var p=t.updateQuery;p?f.updateQuery({query:n.query,variables:n.variables,returnPartialData:!0,optimistic:!1},function(h){return p(h,{fetchMoreResult:l.data,variables:i.variables})}):f.writeQuery({query:i.query,variables:i.variables,data:l.data})},onWatchUpdated:function(f){u.add(f.query)}}),l}).finally(function(){u.has(n.query)||Os(n)})},e.prototype.subscribeToMore=function(t){var n=this,i=this.queryManager.startGraphQLSubscription({query:t.document,variables:t.variables,context:t.context}).subscribe({next:function(a){var o=t.updateQuery;o&&n.updateQuery(function(s,u){var l=u.variables;return o(s,{subscriptionData:a,variables:l})})},error:function(a){if(t.onError){t.onError(a);return}__DEV__&&T.error("Unhandled GraphQL subscription error",a)}});return this.subscriptions.add(i),function(){n.subscriptions.delete(i)&&i.unsubscribe()}},e.prototype.setOptions=function(t){return this.reobserve(t)},e.prototype.setVariables=function(t){return ue(this.variables,t)?this.observers.size?this.result():Promise.resolve():(this.options.variables=t,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:t},te.setVariables):Promise.resolve())},e.prototype.updateQuery=function(t){var n=this.queryManager,i=n.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,a=t(i,{variables:this.variables});a&&(n.cache.writeQuery({query:this.options.query,data:a,variables:this.variables}),n.broadcastQueries())},e.prototype.startPolling=function(t){this.options.pollInterval=t,this.updatePolling()},e.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},e.prototype.applyNextFetchPolicy=function(t,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:t,options:n,observable:this,initialFetchPolicy:s}):t==="variables-changed"?n.fetchPolicy=s:n.fetchPolicy=n.nextFetchPolicy)}return n.fetchPolicy},e.prototype.fetch=function(t,n){return this.queryManager.setObservableQuery(this),this.queryManager.fetchQueryObservable(this.queryId,t,n)},e.prototype.updatePolling=function(){var t=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__?T(a,"Attempted to start a polling query without a polling interval."):T(a,13);var o=i||(this.pollingInfo={});o.interval=a;var s=function(){t.pollingInfo&&(er(t.queryInfo.networkStatus)?u():t.reobserve({fetchPolicy:t.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},te.poll).then(u,u))},u=function(){var l=t.pollingInfo;l&&(clearTimeout(l.timeout),l.timeout=setTimeout(s,l.interval))};u()}}},e.prototype.updateLastResult=function(t,n){return n===void 0&&(n=this.variables),this.last=m(m({},this.last),{result:this.queryManager.assumeImmutableResults?t:Vi(t),variables:n}),xe(t.errors)||delete this.last.error,this.last},e.prototype.reobserve=function(t,n){var i=this;this.isTornDown=!1;var a=n===te.refetch||n===te.fetchMore||n===te.poll,o=this.options.variables,s=this.options.fetchPolicy,u=Jt(this.options,t||{}),l=a?u:Ad(this.options,u);a||(this.updatePolling(),t&&t.variables&&!ue(t.variables,o)&&l.fetchPolicy!=="standby"&&l.fetchPolicy===s&&(this.applyNextFetchPolicy("variables-changed",l),n===void 0&&(n=te.setVariables)));var f=l.variables&&m({},l.variables),p=this.fetch(l,n),h={next:function(d){i.reportResult(d,f)},error:function(d){i.reportError(d,f)}};return a||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=p,this.observer=h),p.addObserver(h),p.promise},e.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},e.prototype.reportResult=function(t,n){var i=this.getLastError();(i||this.isDifferentFromLastResult(t,n))&&((i||!t.partial||this.options.returnPartialData)&&this.updateLastResult(t,n),xr(this.observers,"next",t))},e.prototype.reportError=function(t,n){var i=m(m({},this.getLastResult()),{error:t,errors:t.graphQLErrors,networkStatus:te.error,loading:!1});this.updateLastResult(i,n),xr(this.observers,"error",this.last.error=t)},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(t){return t.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},e}(Q);Wi(fa);function Os(r){var e=r.options,t=e.fetchPolicy,n=e.nextFetchPolicy;return t==="cache-and-network"||t==="network-only"?r.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(){return this.nextFetchPolicy=n,typeof n=="function"?n.apply(this,arguments):t}}):r.reobserve()}function kd(r){__DEV__&&T.error("Unhandled error",r.message,r.stack)}function Ts(r){__DEV__&&r&&__DEV__&&T.debug("Missing cache result fields: ".concat(JSON.stringify(r)),r)}var pa=function(){function r(e){var t=e.cache,n=e.client,i=e.resolvers,a=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=t,n&&(this.client=n),i&&this.addResolvers(i),a&&this.setFragmentMatcher(a)}return r.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(n){t.resolvers=Uo(t.resolvers,n)}):this.resolvers=Uo(this.resolvers,e)},r.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},r.prototype.getResolvers=function(){return this.resolvers||{}},r.prototype.runResolvers=function(e){var t=e.document,n=e.remoteResult,i=e.context,a=e.variables,o=e.onlyRunForcedResolvers,s=o===void 0?!1:o;return pt(this,void 0,void 0,function(){return dt(this,function(u){return t?[2,this.resolveDocument(t,n.data,i,a,this.fragmentMatcher,s).then(function(l){return m(m({},n),{data:l.result})})]:[2,n]})})},r.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},r.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},r.prototype.clientQuery=function(e){return Zr(["client"],e)&&this.resolvers?e:null},r.prototype.serverQuery=function(e){return jo(e)},r.prototype.prepareContext=function(e){var t=this.cache;return m(m({},e),{cache:t,getCacheKey:function(n){return t.identify(n)}})},r.prototype.addExportedVariables=function(e,t,n){return t===void 0&&(t={}),n===void 0&&(n={}),pt(this,void 0,void 0,function(){return dt(this,function(i){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(n),t).then(function(a){return m(m({},t),a.exportedVariables)})]:[2,m({},t)]})})},r.prototype.shouldForceResolvers=function(e){var t=!1;return Me(e,{Directive:{enter:function(n){if(n.name.value==="client"&&n.arguments&&(t=n.arguments.some(function(i){return i.name.value==="always"&&i.value.kind==="BooleanValue"&&i.value.value===!0}),t))return vr}}}),t},r.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:Mo(e),variables:t,returnPartialData:!0,optimistic:!1}).result},r.prototype.resolveDocument=function(e,t,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),pt(this,void 0,void 0,function(){var s,u,l,f,p,h,d,y,g,C,_;return dt(this,function(b){return s=wr(e),u=Sr(e),l=br(u),f=this.collectSelectionsToResolve(s,l),p=s.operation,h=p?p.charAt(0).toUpperCase()+p.slice(1):"Query",d=this,y=d.cache,g=d.client,C={fragmentMap:l,context:m(m({},n),{cache:y,client:g}),variables:i,fragmentMatcher:a,defaultOperationType:h,exportedVariables:{},selectionsToResolve:f,onlyRunForcedResolvers:o},_=!1,[2,this.resolveSelectionSet(s.selectionSet,_,t,C).then(function(S){return{result:S,exportedVariables:C.exportedVariables}})]})})},r.prototype.resolveSelectionSet=function(e,t,n,i){return pt(this,void 0,void 0,function(){var a,o,s,u,l,f=this;return dt(this,function(p){return a=i.fragmentMap,o=i.context,s=i.variables,u=[n],l=function(h){return pt(f,void 0,void 0,function(){var d,y;return dt(this,function(g){return!t&&!i.selectionsToResolve.has(h)?[2]:Dt(h,s)?et(h)?[2,this.resolveField(h,t,n,i).then(function(C){var _;typeof C<"u"&&u.push((_={},_[at(h)]=C,_))})]:(Ro(h)?d=h:(d=a[h.name.value],__DEV__?T(d,"No fragment named ".concat(h.name.value)):T(d,11)),d&&d.typeCondition&&(y=d.typeCondition.name.value,i.fragmentMatcher(n,y,o))?[2,this.resolveSelectionSet(d.selectionSet,t,n,i).then(function(C){u.push(C)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(l)).then(function(){return Qn(u)})]})})},r.prototype.resolveField=function(e,t,n,i){return pt(this,void 0,void 0,function(){var a,o,s,u,l,f,p,h,d,y=this;return dt(this,function(g){return n?(a=i.variables,o=e.name.value,s=at(e),u=o!==s,l=n[s]||n[o],f=Promise.resolve(l),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(p=n.__typename||i.defaultOperationType,h=this.resolvers&&this.resolvers[p],h&&(d=h[u?o:s],d&&(f=Promise.resolve(fn.withValue(this.cache,d,[n,Nt(e,a),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,f.then(function(C){var _,b;if(C===void 0&&(C=l),e.directives&&e.directives.forEach(function(O){O.name.value==="export"&&O.arguments&&O.arguments.forEach(function(k){k.name.value==="as"&&k.value.kind==="StringValue"&&(i.exportedVariables[k.value.value]=C)})}),!e.selectionSet||C==null)return C;var S=(b=(_=e.directives)===null||_===void 0?void 0:_.some(function(O){return O.name.value==="client"}))!==null&&b!==void 0?b:!1;if(Array.isArray(C))return y.resolveSubSelectedArray(e,t||S,C,i);if(e.selectionSet)return y.resolveSelectionSet(e.selectionSet,t||S,C,i)})]):[2,null]})})},r.prototype.resolveSubSelectedArray=function(e,t,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,t,o,i);if(e.selectionSet)return a.resolveSelectionSet(e.selectionSet,t,o,i)}))},r.prototype.collectSelectionsToResolve=function(e,t){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),Me(o,{Directive:function(u,l,f,p,h){u.name.value==="client"&&h.forEach(function(d){n(d)&&jn(d)&&s.add(d)})},FragmentSpread:function(u,l,f,p,h){var d=t[u.name.value];__DEV__?T(d,"No fragment named ".concat(u.name.value)):T(d,12);var y=a(d);y.size>0&&(h.forEach(function(g){n(g)&&jn(g)&&s.add(g)}),s.add(u),y.forEach(function(g){s.add(g)}))}})}return i.get(o)}return a(e)},r}();var dn=new(ot?WeakMap:Map);function As(r,e){var t=r[e];typeof t=="function"&&(r[e]=function(){return dn.set(r,(dn.get(r)+1)%1e15),t.apply(this,arguments)})}function kl(r){r.notifyTimeout&&(clearTimeout(r.notifyTimeout),r.notifyTimeout=void 0)}var da=function(){function r(e,t){t===void 0&&(t=e.generateQueryId()),this.queryId=t,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=e.cache;dn.has(n)||(dn.set(n,0),As(n,"evict"),As(n,"modify"),As(n,"reset"))}return r.prototype.init=function(e){var t=e.networkStatus||te.loading;return this.variables&&this.networkStatus!==te.loading&&!ue(this.variables,e.variables)&&(t=te.setVariables),ue(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},r.prototype.reset=function(){kl(this),this.dirty=!1},r.prototype.getDiff=function(e){e===void 0&&(e=this.variables);var t=this.getDiffOptions(e);if(this.lastDiff&&ue(t,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(t);return this.updateLastDiff(i,t),i},r.prototype.updateLastDiff=function(e,t){this.lastDiff=e?{diff:e,options:t||this.getDiffOptions()}:void 0},r.prototype.getDiffOptions=function(e){var t;return e===void 0&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:(t=this.observableQuery)===null||t===void 0?void 0:t.options.canonizeResults}},r.prototype.setDiff=function(e){var t=this,n=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),!this.dirty&&!ue(n&&n.result,e&&e.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return t.notify()},0)))},r.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){var n=t.getDiff();n.fromOptimisticTransaction?e.observe():Os(e)})):delete this.oqListener)},r.prototype.notify=function(){var e=this;kl(this),this.shouldNotify()&&this.listeners.forEach(function(t){return t(e)}),this.dirty=!1},r.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(er(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if(e!=="cache-only"&&e!=="cache-and-network")return!1}return!0},r.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=r.prototype.cancel,this.subscriptions.forEach(function(t){return t.unsubscribe()});var e=this.observableQuery;e&&e.stopPolling()}},r.prototype.cancel=function(){},r.prototype.updateWatch=function(e){var t=this;e===void 0&&(e=this.variables);var n=this.observableQuery;if(!(n&&n.options.fetchPolicy==="no-cache")){var i=m(m({},this.getDiffOptions(e)),{watcher:this,callback:function(a){return t.setDiff(a)}});(!this.lastWatch||!ue(i,this.lastWatch))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=i))}},r.prototype.resetLastWrite=function(){this.lastWrite=void 0},r.prototype.shouldWrite=function(e,t){var n=this.lastWrite;return!(n&&n.dmCount===dn.get(this.cache)&&ue(t,n.variables)&&ue(e.data,n.result.data))},r.prototype.markResult=function(e,t,n,i){var a=this,o=new ze,s=xe(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&xe(e.incremental)){var u=Gi(this.getDiff().result,e);e.data=u}else if("hasNext"in e&&e.hasNext){var l=this.getDiff();e.data=o.merge(l.result,e.data)}this.graphQLErrors=s,n.fetchPolicy==="no-cache"?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):i!==0&&(ha(e,n.errorPolicy)?this.cache.performTransaction(function(f){if(a.shouldWrite(e,n.variables))f.writeQuery({query:t,data:e.data,variables:n.variables,overwrite:i===1}),a.lastWrite={result:e,variables:n.variables,dmCount:dn.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){e.data=a.lastDiff.diff.result;return}var p=a.getDiffOptions(n.variables),h=f.diff(p);a.stopped||a.updateWatch(n.variables),a.updateLastDiff(h,p),h.complete&&(e.data=h.result)}):this.lastWrite=void 0)},r.prototype.markReady=function(){return this.networkError=null,this.networkStatus=te.ready},r.prototype.markError=function(e){return this.networkStatus=te.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},r}();function ha(r,e){e===void 0&&(e="none");var t=e==="ignore"||e==="all",n=!on(r);return!n&&t&&r.data&&(n=!0),n}var Dd=Object.prototype.hasOwnProperty,Dl=function(){function r(e){var t=e.cache,n=e.link,i=e.defaultOptions,a=e.queryDeduplication,o=a===void 0?!1:a,s=e.onBroadcast,u=e.ssrMode,l=u===void 0?!1:u,f=e.clientAwareness,p=f===void 0?{}:f,h=e.localState,d=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(ot?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=t,this.link=n,this.defaultOptions=i||Object.create(null),this.queryDeduplication=o,this.clientAwareness=p,this.localState=h||new pa({cache:t}),this.ssrMode=l,this.assumeImmutableResults=!!d,(this.onBroadcast=s)&&(this.mutationStore=Object.create(null))}return r.prototype.stop=function(){var e=this;this.queries.forEach(function(t,n){e.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(__DEV__?new U("QueryManager stopped while query was in flight"):new U(14))},r.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(t){return t(e)}),this.fetchCancelFns.clear()},r.prototype.mutate=function(e){var t,n,i=e.mutation,a=e.variables,o=e.optimisticResponse,s=e.updateQueries,u=e.refetchQueries,l=u===void 0?[]:u,f=e.awaitRefetchQueries,p=f===void 0?!1:f,h=e.update,d=e.onQueryUpdated,y=e.fetchPolicy,g=y===void 0?((t=this.defaultOptions.mutate)===null||t===void 0?void 0:t.fetchPolicy)||"network-only":y,C=e.errorPolicy,_=C===void 0?((n=this.defaultOptions.mutate)===null||n===void 0?void 0:n.errorPolicy)||"none":C,b=e.keepRootFields,S=e.context;return pt(this,void 0,void 0,function(){var O,k,N,I,R,re;return dt(this,function(ee){switch(ee.label){case 0:return __DEV__?T(i,"mutation option is required. You must specify your GraphQL document in the mutation option."):T(i,15),__DEV__?T(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."):T(g==="network-only"||g==="no-cache",16),O=this.generateMutationId(),k=this.transform(i),N=k.document,I=k.hasClientExports,i=this.cache.transformForLink(N),a=this.getVariables(i,a),I?[4,this.localState.addExportedVariables(i,a,S)]:[3,2];case 1:a=ee.sent(),ee.label=2;case 2:return R=this.mutationStore&&(this.mutationStore[O]={mutation:i,variables:a,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:O,document:i,variables:a,fetchPolicy:g,errorPolicy:_,context:S,updateQueries:s,update:h,keepRootFields:b}),this.broadcastQueries(),re=this,[2,new Promise(function(Ct,It){return Qi(re.getObservableFromLink(i,m(m({},S),{optimisticResponse:o}),a,!1),function(ke){if(on(ke)&&_==="none")throw new Pt({graphQLErrors:Ki(ke)});R&&(R.loading=!1,R.error=null);var B=m({},ke);return typeof l=="function"&&(l=l(B)),_==="ignore"&&on(B)&&delete B.errors,re.markMutationResult({mutationId:O,result:B,document:i,variables:a,fetchPolicy:g,errorPolicy:_,context:S,update:h,updateQueries:s,awaitRefetchQueries:p,refetchQueries:l,removeOptimistic:o?O:void 0,onQueryUpdated:d,keepRootFields:b})}).subscribe({next:function(ke){re.broadcastQueries(),(!("hasNext"in ke)||ke.hasNext===!1)&&Ct(ke)},error:function(ke){R&&(R.loading=!1,R.error=ke),o&&re.cache.removeOptimistic(O),re.broadcastQueries(),It(ke instanceof Pt?ke:new Pt({networkError:ke}))}})})]}})})},r.prototype.markMutationResult=function(e,t){var n=this;t===void 0&&(t=this.cache);var i=e.result,a=[],o=e.fetchPolicy==="no-cache";if(!o&&ha(i,e.errorPolicy)){if(Ht(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),Ht(i)&&xe(i.incremental)){var s=t.diff({id:"ROOT_MUTATION",query:this.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),u=void 0;s.result&&(u=Gi(s.result,i)),typeof u<"u"&&(i.data=u,a.push({result:u,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var l=e.updateQueries;l&&this.queries.forEach(function(p,h){var d=p.observableQuery,y=d&&d.queryName;if(!(!y||!Dd.call(l,y))){var g=l[y],C=n.queries.get(h),_=C.document,b=C.variables,S=t.diff({query:_,variables:b,returnPartialData:!0,optimistic:!1}),O=S.result,k=S.complete;if(k&&O){var N=g(O,{mutationResult:i,queryName:_&&tn(_)||void 0,queryVariables:b});N&&a.push({result:N,dataId:"ROOT_QUERY",query:_,variables:b})}}})}if(a.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var f=[];if(this.refetchQueries({updateCache:function(p){o||a.forEach(function(g){return p.write(g)});var h=e.update,d=!hu(i)||Ht(i)&&!i.hasNext;if(h){if(!o){var y=p.diff({id:"ROOT_MUTATION",query:n.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});y.complete&&(i=m(m({},i),{data:y.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}d&&h(p,i,{context:e.context,variables:e.variables})}!o&&!e.keepRootFields&&d&&p.modify({id:"ROOT_MUTATION",fields:function(g,C){var _=C.fieldName,b=C.DELETE;return _==="__typename"?g:b}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(p){return f.push(p)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(f).then(function(){return i})}return Promise.resolve(i)},r.prototype.markMutationOptimistic=function(e,t){var n=this,i=typeof e=="function"?e(t.variables):e;return this.cache.recordOptimisticTransaction(function(a){try{n.markMutationResult(m(m({},t),{result:{data:i}}),a)}catch(o){__DEV__&&T.error(o)}},t.mutationId)},r.prototype.fetchQuery=function(e,t,n){return this.fetchQueryObservable(e,t,n).promise},r.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(t,n){e[n]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}}),e},r.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},r.prototype.transform=function(e){var t=this.transformCache;if(!t.has(e)){var n=this.cache.transformDocument(e),i=$o(n),a=this.localState.clientQuery(n),o=i&&this.localState.serverQuery(i),s={document:n,hasClientExports:ko(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:a,serverQuery:o,defaultVars:_r(xt(n)),asQuery:m(m({},n),{definitions:n.definitions.map(function(l){return l.kind==="OperationDefinition"&&l.operation!=="query"?m(m({},l),{operation:"query"}):l})})},u=function(l){l&&!t.has(l)&&t.set(l,s)};u(e),u(n),u(a),u(o)}return t.get(e)},r.prototype.getVariables=function(e,t){return m(m({},this.transform(e).defaultVars),t)},r.prototype.watchQuery=function(e){e=m(m({},e),{variables:this.getVariables(e.query,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var t=new da(this),n=new fa({queryManager:this,queryInfo:t,options:e});return this.queries.set(n.queryId,t),t.init({document:n.query,observableQuery:n,variables:n.variables}),n},r.prototype.query=function(e,t){var n=this;return t===void 0&&(t=this.generateQueryId()),__DEV__?T(e.query,"query option is required. You must specify your GraphQL document in the query option."):T(e.query,17),__DEV__?T(e.query.kind==="Document",'You must wrap the query string in a "gql" tag.'):T(e.query.kind==="Document",18),__DEV__?T(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):T(!e.returnPartialData,19),__DEV__?T(!e.pollInterval,"pollInterval option only supported on watchQuery."):T(!e.pollInterval,20),this.fetchQuery(t,e).finally(function(){return n.stopQuery(t)})},r.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},r.prototype.generateRequestId=function(){return this.requestIdCounter++},r.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},r.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},r.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},r.prototype.clearStore=function(e){return e===void 0&&(e={discardWatches:!0}),this.cancelPendingFetches(__DEV__?new U("Store reset while query was in flight (not completed in link chain)"):new U(21)),this.queries.forEach(function(t){t.observableQuery?t.networkStatus=te.loading:t.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},r.prototype.getObservableQueries=function(e){var t=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):No(o)?i.set(t.transform(o).document,!1):z(o)&&o.query&&a.add(o)}),this.queries.forEach(function(o,s){var u=o.observableQuery,l=o.document;if(u){if(e==="all"){n.set(s,u);return}var f=u.queryName,p=u.options.fetchPolicy;if(p==="standby"||e==="active"&&!u.hasObservers())return;(e==="active"||f&&i.has(f)||l&&i.has(l))&&(n.set(s,u),f&&i.set(f,!0),l&&i.set(l,!0))}}),a.size&&a.forEach(function(o){var s=Kn("legacyOneTimeQuery"),u=t.getQuery(s).init({document:o.query,variables:o.variables}),l=new fa({queryManager:t,queryInfo:u,options:m(m({},o),{fetchPolicy:"network-only"})});T(l.queryId===s),u.setObservableQuery(l),n.set(s,l)}),__DEV__&&i.size&&i.forEach(function(o,s){o||__DEV__&&T.warn("Unknown query ".concat(typeof s=="string"?"named ":"").concat(JSON.stringify(s,null,2)," requested in refetchQueries options.include array"))}),n},r.prototype.reFetchObservableQueries=function(e){var t=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()),t.getQuery(a).setDiff(null)}),this.broadcastQueries(),Promise.all(n)},r.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},r.prototype.startGraphQLSubscription=function(e){var t=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 l=function(p){return t.getObservableFromLink(n,u,p).map(function(h){if(i!=="no-cache"&&(ha(h,a)&&t.cache.write({query:n,result:h.data,dataId:"ROOT_SUBSCRIPTION",variables:p}),t.broadcastQueries()),on(h))throw new Pt({graphQLErrors:h.errors});return h})};if(this.transform(n).hasClientExports){var f=this.localState.addExportedVariables(n,o,u).then(l);return new Q(function(p){var h=null;return f.then(function(d){return h=d.subscribe(p)},p.error),function(){return h&&h.unsubscribe()}})}return l(o)},r.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},r.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},r.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},r.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){return e.notify()})},r.prototype.getLocalState=function(){return this.localState},r.prototype.getObservableFromLink=function(e,t,n,i){var a=this,o;i===void 0&&(i=(o=t?.queryDeduplication)!==null&&o!==void 0?o:this.queryDeduplication);var s,u=this.transform(e).serverQuery;if(u){var l=this,f=l.inFlightLinkObservables,p=l.link,h={query:u,variables:n,operationName:tn(u)||void 0,context:this.prepareContext(m(m({},t),{forceFetch:!i}))};if(t=h.context,i){var d=f.get(u)||new Map;f.set(u,d);var y=tt(n);if(s=d.get(y),!s){var g=new an([sn(p,h)]);d.set(y,s=g),g.beforeNext(function(){d.delete(y)&&d.size<1&&f.delete(u)})}}else s=new an([sn(p,h)])}else s=new an([Q.of({data:{}})]),t=this.prepareContext(t);var C=this.transform(e).clientQuery;return C&&(s=Qi(s,function(_){return a.localState.runResolvers({document:C,remoteResult:_,context:t,variables:n})})),s},r.prototype.getResultsFromLink=function(e,t,n){var i=e.lastRequestId=this.generateRequestId(),a=this.cache.transformForLink(this.transform(e.document).document);return Qi(this.getObservableFromLink(a,n.context,n.variables),function(o){var s=Ki(o),u=s.length>0;if(i>=e.lastRequestId){if(u&&n.errorPolicy==="none")throw e.markError(new Pt({graphQLErrors:s}));e.markResult(o,a,n,t),e.markReady()}var l={data:o.data,loading:!1,networkStatus:te.ready};return u&&n.errorPolicy!=="ignore"&&(l.errors=s,l.networkStatus=te.error),l},function(o){var s=Il(o)?o:new Pt({networkError:o});throw i>=e.lastRequestId&&e.markError(s),s})},r.prototype.fetchQueryObservable=function(e,t,n){var i=this;n===void 0&&(n=te.loading);var a=this.transform(t.query).document,o=this.getVariables(a,t.variables),s=this.getQuery(e),u=this.defaultOptions.watchQuery,l=t.fetchPolicy,f=l===void 0?u&&u.fetchPolicy||"cache-first":l,p=t.errorPolicy,h=p===void 0?u&&u.errorPolicy||"none":p,d=t.returnPartialData,y=d===void 0?!1:d,g=t.notifyOnNetworkStatusChange,C=g===void 0?!1:g,_=t.context,b=_===void 0?{}:_,S=Object.assign({},t,{query:a,variables:o,fetchPolicy:f,errorPolicy:h,returnPartialData:y,notifyOnNetworkStatusChange:C,context:b}),O=function(I){S.variables=I;var R=i.fetchQueryByPolicy(s,S,n);return S.fetchPolicy!=="standby"&&R.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",t),R},k=function(){return i.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,function(I){k(),setTimeout(function(){return N.cancel(I)})});var N=new an(this.transform(S.query).hasClientExports?this.localState.addExportedVariables(S.query,S.variables,S.context).then(O):O(S.variables));return N.promise.then(k,k),N},r.prototype.refetchQueries=function(e){var t=this,n=e.updateCache,i=e.include,a=e.optimistic,o=a===void 0?!1:a,s=e.removeOptimistic,u=s===void 0?o?Kn("refetchQueries"):void 0:s,l=e.onQueryUpdated,f=new Map;i&&this.getObservableQueries(i).forEach(function(h,d){f.set(d,{oq:h,lastDiff:t.getQuery(d).getDiff()})});var p=new Map;return n&&this.cache.batch({update:n,optimistic:o&&u||!1,removeOptimistic:u,onWatchUpdated:function(h,d,y){var g=h.watcher instanceof da&&h.watcher.observableQuery;if(g){if(l){f.delete(g.queryId);var C=l(g,d,y);return C===!0&&(C=g.refetch()),C!==!1&&p.set(g,C),C}l!==null&&f.set(g.queryId,{oq:g,lastDiff:y,diff:d})}}}),f.size&&f.forEach(function(h,d){var y=h.oq,g=h.lastDiff,C=h.diff,_;if(l){if(!C){var b=y.queryInfo;b.reset(),C=b.getDiff()}_=l(y,C,g)}(!l||_===!0)&&(_=y.refetch()),_!==!1&&p.set(y,_),d.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(d)}),u&&this.cache.removeOptimistic(u),p},r.prototype.fetchQueryByPolicy=function(e,t,n){var i=this,a=t.query,o=t.variables,s=t.fetchPolicy,u=t.refetchWritePolicy,l=t.errorPolicy,f=t.returnPartialData,p=t.context,h=t.notifyOnNetworkStatusChange,d=e.networkStatus;e.init({document:this.transform(a).document,variables:o,networkStatus:n});var y=function(){return e.getDiff(o)},g=function(O,k){k===void 0&&(k=e.networkStatus||te.loading);var N=O.result;__DEV__&&!f&&!ue(N,{})&&Ts(O.missing);var I=function(R){return Q.of(m({data:R,loading:er(k),networkStatus:k},O.complete?null:{partial:!0}))};return N&&i.transform(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:N},context:p,variables:o,onlyRunForcedResolvers:!0}).then(function(R){return I(R.data||void 0)}):l==="none"&&k===te.refetch&&Array.isArray(O.missing)?I(void 0):I(N)},C=s==="no-cache"?0:n===te.refetch&&u!=="merge"?1:2,_=function(){return i.getResultsFromLink(e,C,{variables:o,context:p,fetchPolicy:s,errorPolicy:l})},b=h&&typeof d=="number"&&d!==n&&er(n);switch(s){default:case"cache-first":{var S=y();return S.complete?[g(S,e.markReady())]:f||b?[g(S),_()]:[_()]}case"cache-and-network":{var S=y();return S.complete||f||b?[g(S),_()]:[_()]}case"cache-only":return[g(y(),e.markReady())];case"network-only":return b?[g(y()),_()]:[_()];case"no-cache":return b?[g(e.getDiff()),_()]:[_()];case"standby":return[]}},r.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new da(this,e)),this.queries.get(e)},r.prototype.prepareContext=function(e){e===void 0&&(e={});var t=this.localState.prepareContext(e);return m(m({},t),{clientAwareness:this.clientAwareness})},r}();var Nl=!1;var Is=function(){function r(e){var t=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,l=e.ssrForceFetchDelay,f=l===void 0?0:l,p=e.connectToDevTools,h=p===void 0?typeof window=="object"&&!window.__APOLLO_CLIENT__&&__DEV__:p,d=e.queryDeduplication,y=d===void 0?!0:d,g=e.defaultOptions,C=e.assumeImmutableResults,_=C===void 0?!1:C,b=e.resolvers,S=e.typeDefs,O=e.fragmentMatcher,k=e.name,N=e.version,I=e.link;if(I||(I=n?new ns({uri:n,credentials:i,headers:a}):st.empty()),!o)throw __DEV__?new U(`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 U(9);if(this.link=I,this.cache=o,this.disableNetworkFetches=u||f>0,this.queryDeduplication=y,this.defaultOptions=g||Object.create(null),this.typeDefs=S,f&&setTimeout(function(){return t.disableNetworkFetches=!1},f),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),h&&typeof window=="object"&&(window.__APOLLO_CLIENT__=this),!Nl&&h&&__DEV__&&(Nl=!0,typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var R=window.navigator,re=R&&R.userAgent,ee=void 0;typeof re=="string"&&(re.indexOf("Chrome/")>-1?ee="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":re.indexOf("Firefox/")>-1&&(ee="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),ee&&__DEV__&&T.log("Download the Apollo DevTools for a better development experience: "+ee)}this.version=vu,this.localState=new pa({cache:o,client:this,resolvers:b,fragmentMatcher:O}),this.queryManager=new Dl({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:y,ssrMode:u,clientAwareness:{name:k,version:N},localState:this.localState,assumeImmutableResults:_,onBroadcast:h?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return r.prototype.stop=function(){this.queryManager.stop()},r.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=zn(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=m(m({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},r.prototype.query=function(e){return this.defaultOptions.query&&(e=zn(this.defaultOptions.query,e)),__DEV__?T(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."):T(e.fetchPolicy!=="cache-and-network",10),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=m(m({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},r.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=zn(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},r.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},r.prototype.readQuery=function(e,t){return t===void 0&&(t=!1),this.cache.readQuery(e,t)},r.prototype.readFragment=function(e,t){return t===void 0&&(t=!1),this.cache.readFragment(e,t)},r.prototype.writeQuery=function(e){var t=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),t},r.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),t},r.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},r.prototype.__requestRaw=function(e){return sn(this.link,e)},r.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(t){return t()}))}).then(function(){return e.reFetchObservableQueries()})},r.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(t){return t()}))})},r.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter(function(n){return n!==e})}},r.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter(function(n){return n!==e})}},r.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},r.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),n=[],i=[];t.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__&&T.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(o))}),a},r.prototype.getObservableQueries=function(e){return e===void 0&&(e="active"),this.queryManager.getObservableQueries(e)},r.prototype.extract=function(e){return this.cache.extract(e)},r.prototype.restore=function(e){return this.cache.restore(e)},r.prototype.addResolvers=function(e){this.localState.addResolvers(e)},r.prototype.setResolvers=function(e){this.localState.setResolvers(e)},r.prototype.getResolvers=function(){return this.localState.getResolvers()},r.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},r.prototype.setLink=function(e){this.link=this.queryManager.link=e},r}();Qc(gr?"log":"silent");function qe(r){return r===null?"null":Array.isArray(r)?"array":typeof r}function Rt(r){return qe(r)==="object"}function Pl(r){return Array.isArray(r)&&r.length>0&&r.every(e=>"message"in e)}function ks(r,e){return r.length<124?r:e}var Rl="graphql-transport-ws";var He;(function(r){r[r.InternalServerError=4500]="InternalServerError",r[r.InternalClientError=4005]="InternalClientError",r[r.BadRequest=4400]="BadRequest",r[r.BadResponse=4004]="BadResponse",r[r.Unauthorized=4401]="Unauthorized",r[r.Forbidden=4403]="Forbidden",r[r.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",r[r.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",r[r.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",r[r.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",r[r.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(He||(He={}));var be;(function(r){r.ConnectionInit="connection_init",r.ConnectionAck="connection_ack",r.Ping="ping",r.Pong="pong",r.Subscribe="subscribe",r.Next="next",r.Error="error",r.Complete="complete"})(be||(be={}));function Ll(r){if(!Rt(r))throw new Error(`Message is expected to be an object, but got ${qe(r)}`);if(!r.type)throw new Error("Message is missing the 'type' property");if(typeof r.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${qe(r.type)}`);switch(r.type){case be.ConnectionInit:case be.ConnectionAck:case be.Ping:case be.Pong:{if(r.payload!=null&&!Rt(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${r.payload}"`);break}case be.Subscribe:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${qe(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!Rt(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an object, but got ${qe(r.payload)}`);if(typeof r.payload.query!="string")throw new Error(`"${r.type}" message payload expects the 'query' property to be a string, but got ${qe(r.payload.query)}`);if(r.payload.variables!=null&&!Rt(r.payload.variables))throw new Error(`"${r.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${qe(r.payload.variables)}`);if(r.payload.operationName!=null&&qe(r.payload.operationName)!=="string")throw new Error(`"${r.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${qe(r.payload.operationName)}`);if(r.payload.extensions!=null&&!Rt(r.payload.extensions))throw new Error(`"${r.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${qe(r.payload.extensions)}`);break}case be.Next:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${qe(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!Rt(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an object, but got ${qe(r.payload)}`);break}case be.Error:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${qe(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!Pl(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(r.payload)}`);break}case be.Complete:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${qe(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${r.type}"`)}return r}function Fl(r,e){return Ll(typeof r=="string"?JSON.parse(r,e):r)}function hn(r,e){return Ll(r),JSON.stringify(r,e)}function $l(r){let{url:e,connectionParams:t,lazy:n=!0,onNonLazyError:i=console.error,lazyCloseTimeout:a=0,keepAlive:o=0,disablePong:s,connectionAckWaitTimeout:u=0,retryAttempts:l=5,retryWait:f=async function(me){let oe=1e3;for(let G=0;G<me;G++)oe*=2;await new Promise(G=>setTimeout(G,oe+Math.floor(Math.random()*(3e3-300)+300)))},shouldRetry:p=ma,isFatalConnectionProblem:h,on:d,webSocketImpl:y,generateID:g=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,me=>{let oe=Math.random()*16|0;return(me=="x"?oe:oe&3|8).toString(16)})},jsonMessageReplacer:C,jsonMessageReviver:_}=r,b;if(y){if(!Pd(y))throw new Error("Invalid WebSocket implementation provided");b=y}else typeof WebSocket<"u"?b=WebSocket:typeof global<"u"?b=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(b=window.WebSocket||window.MozWebSocket);if(!b)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let S=b,O=(()=>{let B=(()=>{let oe={};return{on(G,K){return oe[G]=K,()=>{delete oe[G]}},emit(G){var K;"id"in G&&((K=oe[G.id])===null||K===void 0||K.call(oe,G))}}})(),me={connecting:d?.connecting?[d.connecting]:[],opened:d?.opened?[d.opened]:[],connected:d?.connected?[d.connected]:[],ping:d?.ping?[d.ping]:[],pong:d?.pong?[d.pong]:[],message:d?.message?[B.emit,d.message]:[B.emit],closed:d?.closed?[d.closed]:[],error:d?.error?[d.error]:[]};return{onMessage:B.on,on(oe,G){let K=me[oe];return K.push(G),()=>{K.splice(K.indexOf(G),1)}},emit(oe,...G){for(let K of[...me[oe]])K(...G)}}})();function k(B){let me=[O.on("error",oe=>{me.forEach(G=>G()),B(oe)}),O.on("closed",oe=>{me.forEach(G=>G()),B(oe)})]}let N,I=0,R,re=!1,ee=0,Ct=!1;async function It(){clearTimeout(R);let[B,me]=await(N??(N=new Promise((K,St)=>(async()=>{if(re){if(await f(ee),!I)return N=void 0,St({code:1e3,reason:"All Subscriptions Gone"});ee++}O.emit("connecting");let V=new S(typeof e=="function"?await e():e,Rl),wt,Ut;function Ti(){isFinite(o)&&o>0&&(clearTimeout(Ut),Ut=setTimeout(()=>{V.readyState===S.OPEN&&(V.send(hn({type:be.Ping})),O.emit("ping",!1,void 0))},o))}k(De=>{N=void 0,clearTimeout(wt),clearTimeout(Ut),St(De),ma(De)&&De.code===4499&&(V.close(4499,"Terminated"),V.onerror=null,V.onclose=null)}),V.onerror=De=>O.emit("error",De),V.onclose=De=>O.emit("closed",De),V.onopen=async()=>{try{O.emit("opened",V);let De=typeof t=="function"?await t():t;if(V.readyState!==S.OPEN)return;V.send(hn(De?{type:be.ConnectionInit,payload:De}:{type:be.ConnectionInit},C)),isFinite(u)&&u>0&&(wt=setTimeout(()=>{V.close(He.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},u)),Ti()}catch(De){O.emit("error",De),V.close(He.InternalClientError,ks(De instanceof Error?De.message:new Error(De).message,"Internal client error"))}};let zr=!1;V.onmessage=({data:De})=>{try{let Ne=Fl(De,_);if(O.emit("message",Ne),Ne.type==="ping"||Ne.type==="pong"){O.emit(Ne.type,!0,Ne.payload),Ne.type==="pong"?Ti():s||(V.send(hn(Ne.payload?{type:be.Pong,payload:Ne.payload}:{type:be.Pong})),O.emit("pong",!1,Ne.payload));return}if(zr)return;if(Ne.type!==be.ConnectionAck)throw new Error(`First message cannot be of type ${Ne.type}`);clearTimeout(wt),zr=!0,O.emit("connected",V,Ne.payload),re=!1,ee=0,K([V,new Promise((H1,Tf)=>k(Tf))])}catch(Ne){V.onmessage=null,O.emit("error",Ne),V.close(He.BadResponse,ks(Ne instanceof Error?Ne.message:new Error(Ne).message,"Bad response"))}}})())));B.readyState===S.CLOSING&&await me;let oe=()=>{},G=new Promise(K=>oe=K);return[B,oe,Promise.race([G.then(()=>{if(!I){let K=()=>B.close(1e3,"Normal Closure");isFinite(a)&&a>0?R=setTimeout(()=>{B.readyState===S.OPEN&&K()},a):K()}}),me])]}function ke(B){if(ma(B)&&(Nd(B.code)||[He.InternalServerError,He.InternalClientError,He.BadRequest,He.BadResponse,He.Unauthorized,He.SubprotocolNotAcceptable,He.SubscriberAlreadyExists,He.TooManyInitialisationRequests].includes(B.code)))throw B;if(Ct)return!1;if(ma(B)&&B.code===1e3)return I>0;if(!l||ee>=l||!p(B)||h?.(B))throw B;return re=!0}return n||(async()=>{for(I++;;)try{let[,,B]=await It();await B}catch(B){try{if(!ke(B))return}catch(me){return i?.(me)}}})(),{on:O.on,subscribe(B,me){let oe=g(B),G=!1,K=!1,St=()=>{I--,G=!0};return(async()=>{for(I++;;)try{let[V,wt,Ut]=await It();if(G)return wt();let Ti=O.onMessage(oe,zr=>{switch(zr.type){case be.Next:{me.next(zr.payload);return}case be.Error:{K=!0,G=!0,me.error(zr.payload),St();return}case be.Complete:{G=!0,St();return}}});V.send(hn({id:oe,type:be.Subscribe,payload:B},C)),St=()=>{!G&&V.readyState===S.OPEN&&V.send(hn({id:oe,type:be.Complete},C)),I--,G=!0,wt()},await Ut.finally(Ti);return}catch(V){if(!ke(V))return}})().then(()=>{K||me.complete()}).catch(V=>{me.error(V)}),()=>{G||St()}},async dispose(){if(Ct=!0,N){let[B]=await N;B.close(1e3,"Normal Closure")}},terminate(){N&&O.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}function ma(r){return Rt(r)&&"code"in r&&"reason"in r}function Nd(r){return[1e3,1001,1006,1005,1012,1013,1013].includes(r)?!1:r>=1e3&&r<=1999}function Pd(r){return typeof r=="function"&&"constructor"in r&&"CLOSED"in r&&"CLOSING"in r&&"CONNECTING"in r&&"OPEN"in r}function Rd(r){return z(r)&&"code"in r&&"reason"in r}var Ml=function(r){ge(e,r);function e(t){var n=r.call(this)||this;return n.client=t,n}return e.prototype.request=function(t){var n=this;return new Q(function(i){return n.client.subscribe(m(m({},t),{query:Xr(t.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(a){return a instanceof Error?i.error(a):Rd(a)?i.error(new Error("Socket closed with event ".concat(a.code," ").concat(a.reason||""))):i.error(new Pt({graphQLErrors:Array.isArray(a)?a:[a]}))}})})},e}(st);var Ra=function(){return Ra=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Ra.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function wa(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?wa=function(t){return typeof t}:wa=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wa(r)}function Ld(r){return wa(r)=="object"&&r!==null}var cf=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function Ms(r,e){for(var t=/\r\n|[\n\r]/g,n=1,i=e+1,a;(a=t.exec(r.body))&&a.index<e;)n+=1,i=e+1-(a.index+a[0].length);return{line:n,column:i}}function Fd(r){return uf(r.source,Ms(r.source,r.start))}function uf(r,e){var t=r.locationOffset.column-1,n=_a(t)+r.body,i=e.line-1,a=r.locationOffset.line-1,o=e.line+a,s=e.line===1?t:0,u=e.column+s,l="".concat(r.name,":").concat(o,":").concat(u,`
54
- `),f=n.split(/\r\n|[\n\r]/g),p=f[i];if(p.length>120){for(var h=Math.floor(u/80),d=u%80,y=[],g=0;g<p.length;g+=80)y.push(p.slice(g,g+80));return l+jl([["".concat(o),y[0]]].concat(y.slice(1,h+1).map(function(C){return["",C]}),[[" ",_a(d-1)+"^"],["",y[h+1]]]))}return l+jl([["".concat(o-1),f[i-1]],["".concat(o),p],["",_a(u-1)+"^"],["".concat(o+1),f[i+1]]])}function jl(r){var e=r.filter(function(n){n[0];var i=n[1];return i!==void 0}),t=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 $d(t,i)+(a?" | "+a:" |")}).join(`
55
- `)}function _a(r){return Array(r+1).join(" ")}function $d(r,e){return _a(r-e.length)+e}function Ea(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ea=function(t){return typeof t}:Ea=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ea(r)}function Ul(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Md(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ul(Object(t),!0).forEach(function(n){jd(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ul(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function jd(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ud(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function ql(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function qd(r,e,t){return e&&ql(r.prototype,e),t&&ql(r,t),r}function Bd(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&vi(r,e)}function Vd(r){var e=ff();return function(){var n=bi(r),i;if(e){var a=bi(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return lf(this,i)}}function lf(r,e){return e&&(Ea(e)==="object"||typeof e=="function")?e:ii(r)}function ii(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function js(r){var e=typeof Map=="function"?new Map:void 0;return js=function(n){if(n===null||!Qd(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 xa(n,arguments,bi(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),vi(i,n)},js(r)}function xa(r,e,t){return ff()?xa=Reflect.construct:xa=function(i,a,o){var s=[null];s.push.apply(s,a);var u=Function.bind.apply(i,s),l=new u;return o&&vi(l,o.prototype),l},xa.apply(null,arguments)}function ff(){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 Qd(r){return Function.toString.call(r).indexOf("[native code]")!==-1}function vi(r,e){return vi=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},vi(r,e)}function bi(r){return bi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},bi(r)}var Wd=function(r){Bd(t,r);var e=Vd(t);function t(n,i,a,o,s,u,l){var f,p,h,d;Ud(this,t),d=e.call(this,n),d.name="GraphQLError",d.originalError=u??void 0,d.nodes=Bl(Array.isArray(i)?i:i?[i]:void 0);for(var y=[],g=0,C=(_=d.nodes)!==null&&_!==void 0?_:[];g<C.length;g++){var _,b=C[g],S=b.loc;S!=null&&y.push(S)}y=Bl(y),d.source=a??((f=y)===null||f===void 0?void 0:f[0].source),d.positions=o??((p=y)===null||p===void 0?void 0:p.map(function(k){return k.start})),d.locations=o&&a?o.map(function(k){return Ms(a,k)}):(h=y)===null||h===void 0?void 0:h.map(function(k){return Ms(k.source,k.start)}),d.path=s??void 0;var O=u?.extensions;return l==null&&Ld(O)?d.extensions=Md({},O):d.extensions=l??{},Object.defineProperties(ii(d),{message:{enumerable:!0},locations:{enumerable:d.locations!=null},path:{enumerable:d.path!=null},extensions:{enumerable:d.extensions!=null&&Object.keys(d.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),u!=null&&u.stack?(Object.defineProperty(ii(d),"stack",{value:u.stack,writable:!0,configurable:!0}),lf(d)):(Error.captureStackTrace?Error.captureStackTrace(ii(d),t):Object.defineProperty(ii(d),"stack",{value:Error().stack,writable:!0,configurable:!0}),d)}return qd(t,[{key:"toString",value:function(){return Gd(this)}},{key:cf,get:function(){return"Object"}}]),t}(js(Error));function Bl(r){return r===void 0||r.length===0?void 0:r}function Gd(r){var e=r.message;if(r.nodes)for(var t=0,n=r.nodes;t<n.length;t++){var i=n[t];i.loc&&(e+=`
51
+ `)),e=e.replace(/\n$/,""),e},Nt=function(r){ge(e,r);function e(t){var n=t.graphQLErrors,i=t.clientErrors,a=t.networkError,o=t.errorMessage,s=t.extraInfo,u=r.call(this,o)||this;return u.name="ApolloError",u.graphQLErrors=n||[],u.clientErrors=i||[],u.networkError=a||null,u.message=o||Od(u),u.extraInfo=s,u.__proto__=e.prototype,u}return e}(Error);var te;(function(r){r[r.loading=1]="loading",r[r.setVariables=2]="setVariables",r[r.fetchMore=3]="fetchMore",r[r.refetch=4]="refetch",r[r.poll=6]="poll",r[r.ready=7]="ready",r[r.error=8]="error"})(te||(te={}));function er(r){return r?r<7:!1}var Td=Object.assign,Ad=Object.hasOwnProperty,fa=function(r){ge(e,r);function e(t){var n=t.queryManager,i=t.queryInfo,a=t.options,o=r.call(this,function(C){try{var _=C._subscription._observer;_&&!_.error&&(_.error=Id)}catch{}var b=!o.observers.size;o.observers.add(C);var S=o.last;return S&&S.error?C.error&&C.error(S.error):S&&S.result&&C.next&&C.next(S.result),b&&o.reobserve().catch(function(){}),function(){o.observers.delete(C)&&!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,l=u.fetchPolicy,f=l===void 0?"cache-first":l,p=a.fetchPolicy,h=p===void 0?f:p,d=a.initialFetchPolicy,y=d===void 0?h==="standby"?f:h:d;o.options=m(m({},a),{initialFetchPolicy:y,fetchPolicy:h}),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 t=this;return new Promise(function(n,i){var a={next:function(s){n(s),t.observers.delete(a),t.observers.size||t.queryManager.removeQuery(t.queryId),setTimeout(function(){o.unsubscribe()},0)},error:i},o=t.subscribe(a)})},e.prototype.getCurrentResult=function(t){t===void 0&&(t=!0);var n=this.getLastResult(!0),i=this.queryInfo.networkStatus||n&&n.networkStatus||te.ready,a=m(m({},n),{loading:er(i),networkStatus:i}),o=this.options.fetchPolicy,s=o===void 0?"cache-first":o;if(!(s==="network-only"||s==="no-cache"||s==="standby"||this.queryManager.transform(this.options.query).hasForcedResolvers)){var u=this.queryInfo.getDiff();(u.complete||this.options.returnPartialData)&&(a.data=u.result),ue(a.data,{})&&(a.data=void 0),u.complete?(delete a.partial,u.complete&&a.networkStatus===te.loading&&(s==="cache-first"||s==="cache-only")&&(a.networkStatus=te.ready,a.loading=!1)):a.partial=!0,__DEV__&&!u.complete&&!this.options.partialRefetch&&!a.loading&&!a.data&&!a.error&&Ts(u.missing)}return t&&this.updateLastResult(a),a},e.prototype.isDifferentFromLastResult=function(t,n){return!this.last||!ue(this.last.result,t)||n&&!ue(this.last.variables,n)},e.prototype.getLast=function(t,n){var i=this.last;if(i&&i[t]&&(!n||ue(i.variables,this.variables)))return i[t]},e.prototype.getLastResult=function(t){return this.getLast("result",t)},e.prototype.getLastError=function(t){return this.getLast("error",t)},e.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},e.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},e.prototype.refetch=function(t){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__&&t&&Ad.call(t,"variables")){var o=Vn(this.query),s=o.variableDefinitions;(!s||!s.some(function(u){return u.variable.name.value==="variables"}))&&__DEV__&&T.warn("Called refetch(".concat(JSON.stringify(t),") 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 t&&!ue(this.options.variables,t)&&(i.variables=this.options.variables=m(m({},this.options.variables),t)),this.queryInfo.resetLastWrite(),this.reobserve(i,te.refetch)},e.prototype.fetchMore=function(t){var n=this,i=m(m({},t.query?t:m(m(m(m({},this.options),{query:this.query}),t),{variables:m(m({},this.options.variables),t.variables)})),{fetchPolicy:"no-cache"}),a=this.queryManager.generateQueryId(),o=this.queryInfo,s=o.networkStatus;o.networkStatus=te.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var u=new Set;return this.queryManager.fetchQuery(a,i,te.fetchMore).then(function(l){return n.queryManager.removeQuery(a),o.networkStatus===te.fetchMore&&(o.networkStatus=s),n.queryManager.cache.batch({update:function(f){var p=t.updateQuery;p?f.updateQuery({query:n.query,variables:n.variables,returnPartialData:!0,optimistic:!1},function(h){return p(h,{fetchMoreResult:l.data,variables:i.variables})}):f.writeQuery({query:i.query,variables:i.variables,data:l.data})},onWatchUpdated:function(f){u.add(f.query)}}),l}).finally(function(){u.has(n.query)||Os(n)})},e.prototype.subscribeToMore=function(t){var n=this,i=this.queryManager.startGraphQLSubscription({query:t.document,variables:t.variables,context:t.context}).subscribe({next:function(a){var o=t.updateQuery;o&&n.updateQuery(function(s,u){var l=u.variables;return o(s,{subscriptionData:a,variables:l})})},error:function(a){if(t.onError){t.onError(a);return}__DEV__&&T.error("Unhandled GraphQL subscription error",a)}});return this.subscriptions.add(i),function(){n.subscriptions.delete(i)&&i.unsubscribe()}},e.prototype.setOptions=function(t){return this.reobserve(t)},e.prototype.setVariables=function(t){return ue(this.variables,t)?this.observers.size?this.result():Promise.resolve():(this.options.variables=t,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:t},te.setVariables):Promise.resolve())},e.prototype.updateQuery=function(t){var n=this.queryManager,i=n.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,a=t(i,{variables:this.variables});a&&(n.cache.writeQuery({query:this.options.query,data:a,variables:this.variables}),n.broadcastQueries())},e.prototype.startPolling=function(t){this.options.pollInterval=t,this.updatePolling()},e.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},e.prototype.applyNextFetchPolicy=function(t,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:t,options:n,observable:this,initialFetchPolicy:s}):t==="variables-changed"?n.fetchPolicy=s:n.fetchPolicy=n.nextFetchPolicy)}return n.fetchPolicy},e.prototype.fetch=function(t,n){return this.queryManager.setObservableQuery(this),this.queryManager.fetchQueryObservable(this.queryId,t,n)},e.prototype.updatePolling=function(){var t=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__?T(a,"Attempted to start a polling query without a polling interval."):T(a,13);var o=i||(this.pollingInfo={});o.interval=a;var s=function(){t.pollingInfo&&(er(t.queryInfo.networkStatus)?u():t.reobserve({fetchPolicy:t.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},te.poll).then(u,u))},u=function(){var l=t.pollingInfo;l&&(clearTimeout(l.timeout),l.timeout=setTimeout(s,l.interval))};u()}}},e.prototype.updateLastResult=function(t,n){return n===void 0&&(n=this.variables),this.last=m(m({},this.last),{result:this.queryManager.assumeImmutableResults?t:Vi(t),variables:n}),xe(t.errors)||delete this.last.error,this.last},e.prototype.reobserve=function(t,n){var i=this;this.isTornDown=!1;var a=n===te.refetch||n===te.fetchMore||n===te.poll,o=this.options.variables,s=this.options.fetchPolicy,u=Jt(this.options,t||{}),l=a?u:Td(this.options,u);a||(this.updatePolling(),t&&t.variables&&!ue(t.variables,o)&&l.fetchPolicy!=="standby"&&l.fetchPolicy===s&&(this.applyNextFetchPolicy("variables-changed",l),n===void 0&&(n=te.setVariables)));var f=l.variables&&m({},l.variables),p=this.fetch(l,n),h={next:function(d){i.reportResult(d,f)},error:function(d){i.reportError(d,f)}};return a||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=p,this.observer=h),p.addObserver(h),p.promise},e.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},e.prototype.reportResult=function(t,n){var i=this.getLastError();(i||this.isDifferentFromLastResult(t,n))&&((i||!t.partial||this.options.returnPartialData)&&this.updateLastResult(t,n),xr(this.observers,"next",t))},e.prototype.reportError=function(t,n){var i=m(m({},this.getLastResult()),{error:t,errors:t.graphQLErrors,networkStatus:te.error,loading:!1});this.updateLastResult(i,n),xr(this.observers,"error",this.last.error=t)},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(t){return t.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},e}(Q);Wi(fa);function Os(r){var e=r.options,t=e.fetchPolicy,n=e.nextFetchPolicy;return t==="cache-and-network"||t==="network-only"?r.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(){return this.nextFetchPolicy=n,typeof n=="function"?n.apply(this,arguments):t}}):r.reobserve()}function Id(r){__DEV__&&T.error("Unhandled error",r.message,r.stack)}function Ts(r){__DEV__&&r&&__DEV__&&T.debug("Missing cache result fields: ".concat(JSON.stringify(r)),r)}var pa=function(){function r(e){var t=e.cache,n=e.client,i=e.resolvers,a=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=t,n&&(this.client=n),i&&this.addResolvers(i),a&&this.setFragmentMatcher(a)}return r.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(n){t.resolvers=Uo(t.resolvers,n)}):this.resolvers=Uo(this.resolvers,e)},r.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},r.prototype.getResolvers=function(){return this.resolvers||{}},r.prototype.runResolvers=function(e){var t=e.document,n=e.remoteResult,i=e.context,a=e.variables,o=e.onlyRunForcedResolvers,s=o===void 0?!1:o;return pt(this,void 0,void 0,function(){return dt(this,function(u){return t?[2,this.resolveDocument(t,n.data,i,a,this.fragmentMatcher,s).then(function(l){return m(m({},n),{data:l.result})})]:[2,n]})})},r.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},r.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},r.prototype.clientQuery=function(e){return Zr(["client"],e)&&this.resolvers?e:null},r.prototype.serverQuery=function(e){return jo(e)},r.prototype.prepareContext=function(e){var t=this.cache;return m(m({},e),{cache:t,getCacheKey:function(n){return t.identify(n)}})},r.prototype.addExportedVariables=function(e,t,n){return t===void 0&&(t={}),n===void 0&&(n={}),pt(this,void 0,void 0,function(){return dt(this,function(i){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(n),t).then(function(a){return m(m({},t),a.exportedVariables)})]:[2,m({},t)]})})},r.prototype.shouldForceResolvers=function(e){var t=!1;return Me(e,{Directive:{enter:function(n){if(n.name.value==="client"&&n.arguments&&(t=n.arguments.some(function(i){return i.name.value==="always"&&i.value.kind==="BooleanValue"&&i.value.value===!0}),t))return vr}}}),t},r.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:Mo(e),variables:t,returnPartialData:!0,optimistic:!1}).result},r.prototype.resolveDocument=function(e,t,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),pt(this,void 0,void 0,function(){var s,u,l,f,p,h,d,y,g,C,_;return dt(this,function(b){return s=wr(e),u=Sr(e),l=br(u),f=this.collectSelectionsToResolve(s,l),p=s.operation,h=p?p.charAt(0).toUpperCase()+p.slice(1):"Query",d=this,y=d.cache,g=d.client,C={fragmentMap:l,context:m(m({},n),{cache:y,client:g}),variables:i,fragmentMatcher:a,defaultOperationType:h,exportedVariables:{},selectionsToResolve:f,onlyRunForcedResolvers:o},_=!1,[2,this.resolveSelectionSet(s.selectionSet,_,t,C).then(function(S){return{result:S,exportedVariables:C.exportedVariables}})]})})},r.prototype.resolveSelectionSet=function(e,t,n,i){return pt(this,void 0,void 0,function(){var a,o,s,u,l,f=this;return dt(this,function(p){return a=i.fragmentMap,o=i.context,s=i.variables,u=[n],l=function(h){return pt(f,void 0,void 0,function(){var d,y;return dt(this,function(g){return!t&&!i.selectionsToResolve.has(h)?[2]:Dt(h,s)?et(h)?[2,this.resolveField(h,t,n,i).then(function(C){var _;typeof C<"u"&&u.push((_={},_[at(h)]=C,_))})]:(Ro(h)?d=h:(d=a[h.name.value],__DEV__?T(d,"No fragment named ".concat(h.name.value)):T(d,11)),d&&d.typeCondition&&(y=d.typeCondition.name.value,i.fragmentMatcher(n,y,o))?[2,this.resolveSelectionSet(d.selectionSet,t,n,i).then(function(C){u.push(C)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(l)).then(function(){return Qn(u)})]})})},r.prototype.resolveField=function(e,t,n,i){return pt(this,void 0,void 0,function(){var a,o,s,u,l,f,p,h,d,y=this;return dt(this,function(g){return n?(a=i.variables,o=e.name.value,s=at(e),u=o!==s,l=n[s]||n[o],f=Promise.resolve(l),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(p=n.__typename||i.defaultOperationType,h=this.resolvers&&this.resolvers[p],h&&(d=h[u?o:s],d&&(f=Promise.resolve(fn.withValue(this.cache,d,[n,Pt(e,a),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,f.then(function(C){var _,b;if(C===void 0&&(C=l),e.directives&&e.directives.forEach(function(O){O.name.value==="export"&&O.arguments&&O.arguments.forEach(function(k){k.name.value==="as"&&k.value.kind==="StringValue"&&(i.exportedVariables[k.value.value]=C)})}),!e.selectionSet||C==null)return C;var S=(b=(_=e.directives)===null||_===void 0?void 0:_.some(function(O){return O.name.value==="client"}))!==null&&b!==void 0?b:!1;if(Array.isArray(C))return y.resolveSubSelectedArray(e,t||S,C,i);if(e.selectionSet)return y.resolveSelectionSet(e.selectionSet,t||S,C,i)})]):[2,null]})})},r.prototype.resolveSubSelectedArray=function(e,t,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,t,o,i);if(e.selectionSet)return a.resolveSelectionSet(e.selectionSet,t,o,i)}))},r.prototype.collectSelectionsToResolve=function(e,t){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),Me(o,{Directive:function(u,l,f,p,h){u.name.value==="client"&&h.forEach(function(d){n(d)&&jn(d)&&s.add(d)})},FragmentSpread:function(u,l,f,p,h){var d=t[u.name.value];__DEV__?T(d,"No fragment named ".concat(u.name.value)):T(d,12);var y=a(d);y.size>0&&(h.forEach(function(g){n(g)&&jn(g)&&s.add(g)}),s.add(u),y.forEach(function(g){s.add(g)}))}})}return i.get(o)}return a(e)},r}();var dn=new(ot?WeakMap:Map);function As(r,e){var t=r[e];typeof t=="function"&&(r[e]=function(){return dn.set(r,(dn.get(r)+1)%1e15),t.apply(this,arguments)})}function Il(r){r.notifyTimeout&&(clearTimeout(r.notifyTimeout),r.notifyTimeout=void 0)}var da=function(){function r(e,t){t===void 0&&(t=e.generateQueryId()),this.queryId=t,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=e.cache;dn.has(n)||(dn.set(n,0),As(n,"evict"),As(n,"modify"),As(n,"reset"))}return r.prototype.init=function(e){var t=e.networkStatus||te.loading;return this.variables&&this.networkStatus!==te.loading&&!ue(this.variables,e.variables)&&(t=te.setVariables),ue(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},r.prototype.reset=function(){Il(this),this.dirty=!1},r.prototype.getDiff=function(e){e===void 0&&(e=this.variables);var t=this.getDiffOptions(e);if(this.lastDiff&&ue(t,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(t);return this.updateLastDiff(i,t),i},r.prototype.updateLastDiff=function(e,t){this.lastDiff=e?{diff:e,options:t||this.getDiffOptions()}:void 0},r.prototype.getDiffOptions=function(e){var t;return e===void 0&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:(t=this.observableQuery)===null||t===void 0?void 0:t.options.canonizeResults}},r.prototype.setDiff=function(e){var t=this,n=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),!this.dirty&&!ue(n&&n.result,e&&e.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return t.notify()},0)))},r.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){var n=t.getDiff();n.fromOptimisticTransaction?e.observe():Os(e)})):delete this.oqListener)},r.prototype.notify=function(){var e=this;Il(this),this.shouldNotify()&&this.listeners.forEach(function(t){return t(e)}),this.dirty=!1},r.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(er(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if(e!=="cache-only"&&e!=="cache-and-network")return!1}return!0},r.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=r.prototype.cancel,this.subscriptions.forEach(function(t){return t.unsubscribe()});var e=this.observableQuery;e&&e.stopPolling()}},r.prototype.cancel=function(){},r.prototype.updateWatch=function(e){var t=this;e===void 0&&(e=this.variables);var n=this.observableQuery;if(!(n&&n.options.fetchPolicy==="no-cache")){var i=m(m({},this.getDiffOptions(e)),{watcher:this,callback:function(a){return t.setDiff(a)}});(!this.lastWatch||!ue(i,this.lastWatch))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=i))}},r.prototype.resetLastWrite=function(){this.lastWrite=void 0},r.prototype.shouldWrite=function(e,t){var n=this.lastWrite;return!(n&&n.dmCount===dn.get(this.cache)&&ue(t,n.variables)&&ue(e.data,n.result.data))},r.prototype.markResult=function(e,t,n,i){var a=this,o=new ze,s=xe(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&xe(e.incremental)){var u=Gi(this.getDiff().result,e);e.data=u}else if("hasNext"in e&&e.hasNext){var l=this.getDiff();e.data=o.merge(l.result,e.data)}this.graphQLErrors=s,n.fetchPolicy==="no-cache"?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):i!==0&&(ha(e,n.errorPolicy)?this.cache.performTransaction(function(f){if(a.shouldWrite(e,n.variables))f.writeQuery({query:t,data:e.data,variables:n.variables,overwrite:i===1}),a.lastWrite={result:e,variables:n.variables,dmCount:dn.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){e.data=a.lastDiff.diff.result;return}var p=a.getDiffOptions(n.variables),h=f.diff(p);a.stopped||a.updateWatch(n.variables),a.updateLastDiff(h,p),h.complete&&(e.data=h.result)}):this.lastWrite=void 0)},r.prototype.markReady=function(){return this.networkError=null,this.networkStatus=te.ready},r.prototype.markError=function(e){return this.networkStatus=te.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},r}();function ha(r,e){e===void 0&&(e="none");var t=e==="ignore"||e==="all",n=!on(r);return!n&&t&&r.data&&(n=!0),n}var kd=Object.prototype.hasOwnProperty,kl=function(){function r(e){var t=e.cache,n=e.link,i=e.defaultOptions,a=e.queryDeduplication,o=a===void 0?!1:a,s=e.onBroadcast,u=e.ssrMode,l=u===void 0?!1:u,f=e.clientAwareness,p=f===void 0?{}:f,h=e.localState,d=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(ot?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=t,this.link=n,this.defaultOptions=i||Object.create(null),this.queryDeduplication=o,this.clientAwareness=p,this.localState=h||new pa({cache:t}),this.ssrMode=l,this.assumeImmutableResults=!!d,(this.onBroadcast=s)&&(this.mutationStore=Object.create(null))}return r.prototype.stop=function(){var e=this;this.queries.forEach(function(t,n){e.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(__DEV__?new U("QueryManager stopped while query was in flight"):new U(14))},r.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(t){return t(e)}),this.fetchCancelFns.clear()},r.prototype.mutate=function(e){var t,n,i=e.mutation,a=e.variables,o=e.optimisticResponse,s=e.updateQueries,u=e.refetchQueries,l=u===void 0?[]:u,f=e.awaitRefetchQueries,p=f===void 0?!1:f,h=e.update,d=e.onQueryUpdated,y=e.fetchPolicy,g=y===void 0?((t=this.defaultOptions.mutate)===null||t===void 0?void 0:t.fetchPolicy)||"network-only":y,C=e.errorPolicy,_=C===void 0?((n=this.defaultOptions.mutate)===null||n===void 0?void 0:n.errorPolicy)||"none":C,b=e.keepRootFields,S=e.context;return pt(this,void 0,void 0,function(){var O,k,P,I,R,re;return dt(this,function(ee){switch(ee.label){case 0:return __DEV__?T(i,"mutation option is required. You must specify your GraphQL document in the mutation option."):T(i,15),__DEV__?T(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."):T(g==="network-only"||g==="no-cache",16),O=this.generateMutationId(),k=this.transform(i),P=k.document,I=k.hasClientExports,i=this.cache.transformForLink(P),a=this.getVariables(i,a),I?[4,this.localState.addExportedVariables(i,a,S)]:[3,2];case 1:a=ee.sent(),ee.label=2;case 2:return R=this.mutationStore&&(this.mutationStore[O]={mutation:i,variables:a,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:O,document:i,variables:a,fetchPolicy:g,errorPolicy:_,context:S,updateQueries:s,update:h,keepRootFields:b}),this.broadcastQueries(),re=this,[2,new Promise(function(Ct,It){return Qi(re.getObservableFromLink(i,m(m({},S),{optimisticResponse:o}),a,!1),function(ke){if(on(ke)&&_==="none")throw new Nt({graphQLErrors:Ki(ke)});R&&(R.loading=!1,R.error=null);var B=m({},ke);return typeof l=="function"&&(l=l(B)),_==="ignore"&&on(B)&&delete B.errors,re.markMutationResult({mutationId:O,result:B,document:i,variables:a,fetchPolicy:g,errorPolicy:_,context:S,update:h,updateQueries:s,awaitRefetchQueries:p,refetchQueries:l,removeOptimistic:o?O:void 0,onQueryUpdated:d,keepRootFields:b})}).subscribe({next:function(ke){re.broadcastQueries(),(!("hasNext"in ke)||ke.hasNext===!1)&&Ct(ke)},error:function(ke){R&&(R.loading=!1,R.error=ke),o&&re.cache.removeOptimistic(O),re.broadcastQueries(),It(ke instanceof Nt?ke:new Nt({networkError:ke}))}})})]}})})},r.prototype.markMutationResult=function(e,t){var n=this;t===void 0&&(t=this.cache);var i=e.result,a=[],o=e.fetchPolicy==="no-cache";if(!o&&ha(i,e.errorPolicy)){if(Ht(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),Ht(i)&&xe(i.incremental)){var s=t.diff({id:"ROOT_MUTATION",query:this.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),u=void 0;s.result&&(u=Gi(s.result,i)),typeof u<"u"&&(i.data=u,a.push({result:u,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var l=e.updateQueries;l&&this.queries.forEach(function(p,h){var d=p.observableQuery,y=d&&d.queryName;if(!(!y||!kd.call(l,y))){var g=l[y],C=n.queries.get(h),_=C.document,b=C.variables,S=t.diff({query:_,variables:b,returnPartialData:!0,optimistic:!1}),O=S.result,k=S.complete;if(k&&O){var P=g(O,{mutationResult:i,queryName:_&&tn(_)||void 0,queryVariables:b});P&&a.push({result:P,dataId:"ROOT_QUERY",query:_,variables:b})}}})}if(a.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var f=[];if(this.refetchQueries({updateCache:function(p){o||a.forEach(function(g){return p.write(g)});var h=e.update,d=!du(i)||Ht(i)&&!i.hasNext;if(h){if(!o){var y=p.diff({id:"ROOT_MUTATION",query:n.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});y.complete&&(i=m(m({},i),{data:y.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}d&&h(p,i,{context:e.context,variables:e.variables})}!o&&!e.keepRootFields&&d&&p.modify({id:"ROOT_MUTATION",fields:function(g,C){var _=C.fieldName,b=C.DELETE;return _==="__typename"?g:b}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(p){return f.push(p)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(f).then(function(){return i})}return Promise.resolve(i)},r.prototype.markMutationOptimistic=function(e,t){var n=this,i=typeof e=="function"?e(t.variables):e;return this.cache.recordOptimisticTransaction(function(a){try{n.markMutationResult(m(m({},t),{result:{data:i}}),a)}catch(o){__DEV__&&T.error(o)}},t.mutationId)},r.prototype.fetchQuery=function(e,t,n){return this.fetchQueryObservable(e,t,n).promise},r.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(t,n){e[n]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}}),e},r.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},r.prototype.transform=function(e){var t=this.transformCache;if(!t.has(e)){var n=this.cache.transformDocument(e),i=$o(n),a=this.localState.clientQuery(n),o=i&&this.localState.serverQuery(i),s={document:n,hasClientExports:ko(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:a,serverQuery:o,defaultVars:_r(xt(n)),asQuery:m(m({},n),{definitions:n.definitions.map(function(l){return l.kind==="OperationDefinition"&&l.operation!=="query"?m(m({},l),{operation:"query"}):l})})},u=function(l){l&&!t.has(l)&&t.set(l,s)};u(e),u(n),u(a),u(o)}return t.get(e)},r.prototype.getVariables=function(e,t){return m(m({},this.transform(e).defaultVars),t)},r.prototype.watchQuery=function(e){e=m(m({},e),{variables:this.getVariables(e.query,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var t=new da(this),n=new fa({queryManager:this,queryInfo:t,options:e});return this.queries.set(n.queryId,t),t.init({document:n.query,observableQuery:n,variables:n.variables}),n},r.prototype.query=function(e,t){var n=this;return t===void 0&&(t=this.generateQueryId()),__DEV__?T(e.query,"query option is required. You must specify your GraphQL document in the query option."):T(e.query,17),__DEV__?T(e.query.kind==="Document",'You must wrap the query string in a "gql" tag.'):T(e.query.kind==="Document",18),__DEV__?T(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):T(!e.returnPartialData,19),__DEV__?T(!e.pollInterval,"pollInterval option only supported on watchQuery."):T(!e.pollInterval,20),this.fetchQuery(t,e).finally(function(){return n.stopQuery(t)})},r.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},r.prototype.generateRequestId=function(){return this.requestIdCounter++},r.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},r.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},r.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},r.prototype.clearStore=function(e){return e===void 0&&(e={discardWatches:!0}),this.cancelPendingFetches(__DEV__?new U("Store reset while query was in flight (not completed in link chain)"):new U(21)),this.queries.forEach(function(t){t.observableQuery?t.networkStatus=te.loading:t.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},r.prototype.getObservableQueries=function(e){var t=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):Po(o)?i.set(t.transform(o).document,!1):z(o)&&o.query&&a.add(o)}),this.queries.forEach(function(o,s){var u=o.observableQuery,l=o.document;if(u){if(e==="all"){n.set(s,u);return}var f=u.queryName,p=u.options.fetchPolicy;if(p==="standby"||e==="active"&&!u.hasObservers())return;(e==="active"||f&&i.has(f)||l&&i.has(l))&&(n.set(s,u),f&&i.set(f,!0),l&&i.set(l,!0))}}),a.size&&a.forEach(function(o){var s=Kn("legacyOneTimeQuery"),u=t.getQuery(s).init({document:o.query,variables:o.variables}),l=new fa({queryManager:t,queryInfo:u,options:m(m({},o),{fetchPolicy:"network-only"})});T(l.queryId===s),u.setObservableQuery(l),n.set(s,l)}),__DEV__&&i.size&&i.forEach(function(o,s){o||__DEV__&&T.warn("Unknown query ".concat(typeof s=="string"?"named ":"").concat(JSON.stringify(s,null,2)," requested in refetchQueries options.include array"))}),n},r.prototype.reFetchObservableQueries=function(e){var t=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()),t.getQuery(a).setDiff(null)}),this.broadcastQueries(),Promise.all(n)},r.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},r.prototype.startGraphQLSubscription=function(e){var t=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 l=function(p){return t.getObservableFromLink(n,u,p).map(function(h){if(i!=="no-cache"&&(ha(h,a)&&t.cache.write({query:n,result:h.data,dataId:"ROOT_SUBSCRIPTION",variables:p}),t.broadcastQueries()),on(h))throw new Nt({graphQLErrors:h.errors});return h})};if(this.transform(n).hasClientExports){var f=this.localState.addExportedVariables(n,o,u).then(l);return new Q(function(p){var h=null;return f.then(function(d){return h=d.subscribe(p)},p.error),function(){return h&&h.unsubscribe()}})}return l(o)},r.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},r.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},r.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},r.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){return e.notify()})},r.prototype.getLocalState=function(){return this.localState},r.prototype.getObservableFromLink=function(e,t,n,i){var a=this,o;i===void 0&&(i=(o=t?.queryDeduplication)!==null&&o!==void 0?o:this.queryDeduplication);var s,u=this.transform(e).serverQuery;if(u){var l=this,f=l.inFlightLinkObservables,p=l.link,h={query:u,variables:n,operationName:tn(u)||void 0,context:this.prepareContext(m(m({},t),{forceFetch:!i}))};if(t=h.context,i){var d=f.get(u)||new Map;f.set(u,d);var y=tt(n);if(s=d.get(y),!s){var g=new an([sn(p,h)]);d.set(y,s=g),g.beforeNext(function(){d.delete(y)&&d.size<1&&f.delete(u)})}}else s=new an([sn(p,h)])}else s=new an([Q.of({data:{}})]),t=this.prepareContext(t);var C=this.transform(e).clientQuery;return C&&(s=Qi(s,function(_){return a.localState.runResolvers({document:C,remoteResult:_,context:t,variables:n})})),s},r.prototype.getResultsFromLink=function(e,t,n){var i=e.lastRequestId=this.generateRequestId(),a=this.cache.transformForLink(this.transform(e.document).document);return Qi(this.getObservableFromLink(a,n.context,n.variables),function(o){var s=Ki(o),u=s.length>0;if(i>=e.lastRequestId){if(u&&n.errorPolicy==="none")throw e.markError(new Nt({graphQLErrors:s}));e.markResult(o,a,n,t),e.markReady()}var l={data:o.data,loading:!1,networkStatus:te.ready};return u&&n.errorPolicy!=="ignore"&&(l.errors=s,l.networkStatus=te.error),l},function(o){var s=Al(o)?o:new Nt({networkError:o});throw i>=e.lastRequestId&&e.markError(s),s})},r.prototype.fetchQueryObservable=function(e,t,n){var i=this;n===void 0&&(n=te.loading);var a=this.transform(t.query).document,o=this.getVariables(a,t.variables),s=this.getQuery(e),u=this.defaultOptions.watchQuery,l=t.fetchPolicy,f=l===void 0?u&&u.fetchPolicy||"cache-first":l,p=t.errorPolicy,h=p===void 0?u&&u.errorPolicy||"none":p,d=t.returnPartialData,y=d===void 0?!1:d,g=t.notifyOnNetworkStatusChange,C=g===void 0?!1:g,_=t.context,b=_===void 0?{}:_,S=Object.assign({},t,{query:a,variables:o,fetchPolicy:f,errorPolicy:h,returnPartialData:y,notifyOnNetworkStatusChange:C,context:b}),O=function(I){S.variables=I;var R=i.fetchQueryByPolicy(s,S,n);return S.fetchPolicy!=="standby"&&R.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",t),R},k=function(){return i.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,function(I){k(),setTimeout(function(){return P.cancel(I)})});var P=new an(this.transform(S.query).hasClientExports?this.localState.addExportedVariables(S.query,S.variables,S.context).then(O):O(S.variables));return P.promise.then(k,k),P},r.prototype.refetchQueries=function(e){var t=this,n=e.updateCache,i=e.include,a=e.optimistic,o=a===void 0?!1:a,s=e.removeOptimistic,u=s===void 0?o?Kn("refetchQueries"):void 0:s,l=e.onQueryUpdated,f=new Map;i&&this.getObservableQueries(i).forEach(function(h,d){f.set(d,{oq:h,lastDiff:t.getQuery(d).getDiff()})});var p=new Map;return n&&this.cache.batch({update:n,optimistic:o&&u||!1,removeOptimistic:u,onWatchUpdated:function(h,d,y){var g=h.watcher instanceof da&&h.watcher.observableQuery;if(g){if(l){f.delete(g.queryId);var C=l(g,d,y);return C===!0&&(C=g.refetch()),C!==!1&&p.set(g,C),C}l!==null&&f.set(g.queryId,{oq:g,lastDiff:y,diff:d})}}}),f.size&&f.forEach(function(h,d){var y=h.oq,g=h.lastDiff,C=h.diff,_;if(l){if(!C){var b=y.queryInfo;b.reset(),C=b.getDiff()}_=l(y,C,g)}(!l||_===!0)&&(_=y.refetch()),_!==!1&&p.set(y,_),d.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(d)}),u&&this.cache.removeOptimistic(u),p},r.prototype.fetchQueryByPolicy=function(e,t,n){var i=this,a=t.query,o=t.variables,s=t.fetchPolicy,u=t.refetchWritePolicy,l=t.errorPolicy,f=t.returnPartialData,p=t.context,h=t.notifyOnNetworkStatusChange,d=e.networkStatus;e.init({document:this.transform(a).document,variables:o,networkStatus:n});var y=function(){return e.getDiff(o)},g=function(O,k){k===void 0&&(k=e.networkStatus||te.loading);var P=O.result;__DEV__&&!f&&!ue(P,{})&&Ts(O.missing);var I=function(R){return Q.of(m({data:R,loading:er(k),networkStatus:k},O.complete?null:{partial:!0}))};return P&&i.transform(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:P},context:p,variables:o,onlyRunForcedResolvers:!0}).then(function(R){return I(R.data||void 0)}):l==="none"&&k===te.refetch&&Array.isArray(O.missing)?I(void 0):I(P)},C=s==="no-cache"?0:n===te.refetch&&u!=="merge"?1:2,_=function(){return i.getResultsFromLink(e,C,{variables:o,context:p,fetchPolicy:s,errorPolicy:l})},b=h&&typeof d=="number"&&d!==n&&er(n);switch(s){default:case"cache-first":{var S=y();return S.complete?[g(S,e.markReady())]:f||b?[g(S),_()]:[_()]}case"cache-and-network":{var S=y();return S.complete||f||b?[g(S),_()]:[_()]}case"cache-only":return[g(y(),e.markReady())];case"network-only":return b?[g(y()),_()]:[_()];case"no-cache":return b?[g(e.getDiff()),_()]:[_()];case"standby":return[]}},r.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new da(this,e)),this.queries.get(e)},r.prototype.prepareContext=function(e){e===void 0&&(e={});var t=this.localState.prepareContext(e);return m(m({},t),{clientAwareness:this.clientAwareness})},r}();var Dl=!1;var Is=function(){function r(e){var t=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,l=e.ssrForceFetchDelay,f=l===void 0?0:l,p=e.connectToDevTools,h=p===void 0?typeof window=="object"&&!window.__APOLLO_CLIENT__&&__DEV__:p,d=e.queryDeduplication,y=d===void 0?!0:d,g=e.defaultOptions,C=e.assumeImmutableResults,_=C===void 0?!1:C,b=e.resolvers,S=e.typeDefs,O=e.fragmentMatcher,k=e.name,P=e.version,I=e.link;if(I||(I=n?new ns({uri:n,credentials:i,headers:a}):st.empty()),!o)throw __DEV__?new U(`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 U(9);if(this.link=I,this.cache=o,this.disableNetworkFetches=u||f>0,this.queryDeduplication=y,this.defaultOptions=g||Object.create(null),this.typeDefs=S,f&&setTimeout(function(){return t.disableNetworkFetches=!1},f),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),h&&typeof window=="object"&&(window.__APOLLO_CLIENT__=this),!Dl&&h&&__DEV__&&(Dl=!0,typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var R=window.navigator,re=R&&R.userAgent,ee=void 0;typeof re=="string"&&(re.indexOf("Chrome/")>-1?ee="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":re.indexOf("Firefox/")>-1&&(ee="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),ee&&__DEV__&&T.log("Download the Apollo DevTools for a better development experience: "+ee)}this.version=gu,this.localState=new pa({cache:o,client:this,resolvers:b,fragmentMatcher:O}),this.queryManager=new kl({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:y,ssrMode:u,clientAwareness:{name:k,version:P},localState:this.localState,assumeImmutableResults:_,onBroadcast:h?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return r.prototype.stop=function(){this.queryManager.stop()},r.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=zn(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=m(m({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},r.prototype.query=function(e){return this.defaultOptions.query&&(e=zn(this.defaultOptions.query,e)),__DEV__?T(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."):T(e.fetchPolicy!=="cache-and-network",10),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=m(m({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},r.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=zn(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},r.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},r.prototype.readQuery=function(e,t){return t===void 0&&(t=!1),this.cache.readQuery(e,t)},r.prototype.readFragment=function(e,t){return t===void 0&&(t=!1),this.cache.readFragment(e,t)},r.prototype.writeQuery=function(e){var t=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),t},r.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),t},r.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},r.prototype.__requestRaw=function(e){return sn(this.link,e)},r.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(t){return t()}))}).then(function(){return e.reFetchObservableQueries()})},r.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(t){return t()}))})},r.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter(function(n){return n!==e})}},r.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter(function(n){return n!==e})}},r.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},r.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),n=[],i=[];t.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__&&T.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(o))}),a},r.prototype.getObservableQueries=function(e){return e===void 0&&(e="active"),this.queryManager.getObservableQueries(e)},r.prototype.extract=function(e){return this.cache.extract(e)},r.prototype.restore=function(e){return this.cache.restore(e)},r.prototype.addResolvers=function(e){this.localState.addResolvers(e)},r.prototype.setResolvers=function(e){this.localState.setResolvers(e)},r.prototype.getResolvers=function(){return this.localState.getResolvers()},r.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},r.prototype.setLink=function(e){this.link=this.queryManager.link=e},r}();Vc(gr?"log":"silent");function qe(r){return r===null?"null":Array.isArray(r)?"array":typeof r}function Rt(r){return qe(r)==="object"}function Pl(r){return Array.isArray(r)&&r.length>0&&r.every(e=>"message"in e)}function ks(r,e){return r.length<124?r:e}var Nl="graphql-transport-ws";var He;(function(r){r[r.InternalServerError=4500]="InternalServerError",r[r.InternalClientError=4005]="InternalClientError",r[r.BadRequest=4400]="BadRequest",r[r.BadResponse=4004]="BadResponse",r[r.Unauthorized=4401]="Unauthorized",r[r.Forbidden=4403]="Forbidden",r[r.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",r[r.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",r[r.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",r[r.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",r[r.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(He||(He={}));var be;(function(r){r.ConnectionInit="connection_init",r.ConnectionAck="connection_ack",r.Ping="ping",r.Pong="pong",r.Subscribe="subscribe",r.Next="next",r.Error="error",r.Complete="complete"})(be||(be={}));function Rl(r){if(!Rt(r))throw new Error(`Message is expected to be an object, but got ${qe(r)}`);if(!r.type)throw new Error("Message is missing the 'type' property");if(typeof r.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${qe(r.type)}`);switch(r.type){case be.ConnectionInit:case be.ConnectionAck:case be.Ping:case be.Pong:{if(r.payload!=null&&!Rt(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${r.payload}"`);break}case be.Subscribe:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${qe(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!Rt(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an object, but got ${qe(r.payload)}`);if(typeof r.payload.query!="string")throw new Error(`"${r.type}" message payload expects the 'query' property to be a string, but got ${qe(r.payload.query)}`);if(r.payload.variables!=null&&!Rt(r.payload.variables))throw new Error(`"${r.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${qe(r.payload.variables)}`);if(r.payload.operationName!=null&&qe(r.payload.operationName)!=="string")throw new Error(`"${r.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${qe(r.payload.operationName)}`);if(r.payload.extensions!=null&&!Rt(r.payload.extensions))throw new Error(`"${r.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${qe(r.payload.extensions)}`);break}case be.Next:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${qe(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!Rt(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an object, but got ${qe(r.payload)}`);break}case be.Error:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${qe(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!Pl(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(r.payload)}`);break}case be.Complete:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${qe(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${r.type}"`)}return r}function Ll(r,e){return Rl(typeof r=="string"?JSON.parse(r,e):r)}function hn(r,e){return Rl(r),JSON.stringify(r,e)}function Fl(r){let{url:e,connectionParams:t,lazy:n=!0,onNonLazyError:i=console.error,lazyCloseTimeout:a=0,keepAlive:o=0,disablePong:s,connectionAckWaitTimeout:u=0,retryAttempts:l=5,retryWait:f=async function(me){let oe=1e3;for(let G=0;G<me;G++)oe*=2;await new Promise(G=>setTimeout(G,oe+Math.floor(Math.random()*(3e3-300)+300)))},shouldRetry:p=ma,isFatalConnectionProblem:h,on:d,webSocketImpl:y,generateID:g=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,me=>{let oe=Math.random()*16|0;return(me=="x"?oe:oe&3|8).toString(16)})},jsonMessageReplacer:C,jsonMessageReviver:_}=r,b;if(y){if(!Pd(y))throw new Error("Invalid WebSocket implementation provided");b=y}else typeof WebSocket<"u"?b=WebSocket:typeof global<"u"?b=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(b=window.WebSocket||window.MozWebSocket);if(!b)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let S=b,O=(()=>{let B=(()=>{let oe={};return{on(G,K){return oe[G]=K,()=>{delete oe[G]}},emit(G){var K;"id"in G&&((K=oe[G.id])===null||K===void 0||K.call(oe,G))}}})(),me={connecting:d?.connecting?[d.connecting]:[],opened:d?.opened?[d.opened]:[],connected:d?.connected?[d.connected]:[],ping:d?.ping?[d.ping]:[],pong:d?.pong?[d.pong]:[],message:d?.message?[B.emit,d.message]:[B.emit],closed:d?.closed?[d.closed]:[],error:d?.error?[d.error]:[]};return{onMessage:B.on,on(oe,G){let K=me[oe];return K.push(G),()=>{K.splice(K.indexOf(G),1)}},emit(oe,...G){for(let K of[...me[oe]])K(...G)}}})();function k(B){let me=[O.on("error",oe=>{me.forEach(G=>G()),B(oe)}),O.on("closed",oe=>{me.forEach(G=>G()),B(oe)})]}let P,I=0,R,re=!1,ee=0,Ct=!1;async function It(){clearTimeout(R);let[B,me]=await(P??(P=new Promise((K,St)=>(async()=>{if(re){if(await f(ee),!I)return P=void 0,St({code:1e3,reason:"All Subscriptions Gone"});ee++}O.emit("connecting");let V=new S(typeof e=="function"?await e():e,Nl),wt,Ut;function Ti(){isFinite(o)&&o>0&&(clearTimeout(Ut),Ut=setTimeout(()=>{V.readyState===S.OPEN&&(V.send(hn({type:be.Ping})),O.emit("ping",!1,void 0))},o))}k(De=>{P=void 0,clearTimeout(wt),clearTimeout(Ut),St(De),ma(De)&&De.code===4499&&(V.close(4499,"Terminated"),V.onerror=null,V.onclose=null)}),V.onerror=De=>O.emit("error",De),V.onclose=De=>O.emit("closed",De),V.onopen=async()=>{try{O.emit("opened",V);let De=typeof t=="function"?await t():t;if(V.readyState!==S.OPEN)return;V.send(hn(De?{type:be.ConnectionInit,payload:De}:{type:be.ConnectionInit},C)),isFinite(u)&&u>0&&(wt=setTimeout(()=>{V.close(He.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},u)),Ti()}catch(De){O.emit("error",De),V.close(He.InternalClientError,ks(De instanceof Error?De.message:new Error(De).message,"Internal client error"))}};let zr=!1;V.onmessage=({data:De})=>{try{let Pe=Ll(De,_);if(O.emit("message",Pe),Pe.type==="ping"||Pe.type==="pong"){O.emit(Pe.type,!0,Pe.payload),Pe.type==="pong"?Ti():s||(V.send(hn(Pe.payload?{type:be.Pong,payload:Pe.payload}:{type:be.Pong})),O.emit("pong",!1,Pe.payload));return}if(zr)return;if(Pe.type!==be.ConnectionAck)throw new Error(`First message cannot be of type ${Pe.type}`);clearTimeout(wt),zr=!0,O.emit("connected",V,Pe.payload),re=!1,ee=0,K([V,new Promise((z1,Of)=>k(Of))])}catch(Pe){V.onmessage=null,O.emit("error",Pe),V.close(He.BadResponse,ks(Pe instanceof Error?Pe.message:new Error(Pe).message,"Bad response"))}}})())));B.readyState===S.CLOSING&&await me;let oe=()=>{},G=new Promise(K=>oe=K);return[B,oe,Promise.race([G.then(()=>{if(!I){let K=()=>B.close(1e3,"Normal Closure");isFinite(a)&&a>0?R=setTimeout(()=>{B.readyState===S.OPEN&&K()},a):K()}}),me])]}function ke(B){if(ma(B)&&(Dd(B.code)||[He.InternalServerError,He.InternalClientError,He.BadRequest,He.BadResponse,He.Unauthorized,He.SubprotocolNotAcceptable,He.SubscriberAlreadyExists,He.TooManyInitialisationRequests].includes(B.code)))throw B;if(Ct)return!1;if(ma(B)&&B.code===1e3)return I>0;if(!l||ee>=l||!p(B)||h?.(B))throw B;return re=!0}return n||(async()=>{for(I++;;)try{let[,,B]=await It();await B}catch(B){try{if(!ke(B))return}catch(me){return i?.(me)}}})(),{on:O.on,subscribe(B,me){let oe=g(B),G=!1,K=!1,St=()=>{I--,G=!0};return(async()=>{for(I++;;)try{let[V,wt,Ut]=await It();if(G)return wt();let Ti=O.onMessage(oe,zr=>{switch(zr.type){case be.Next:{me.next(zr.payload);return}case be.Error:{K=!0,G=!0,me.error(zr.payload),St();return}case be.Complete:{G=!0,St();return}}});V.send(hn({id:oe,type:be.Subscribe,payload:B},C)),St=()=>{!G&&V.readyState===S.OPEN&&V.send(hn({id:oe,type:be.Complete},C)),I--,G=!0,wt()},await Ut.finally(Ti);return}catch(V){if(!ke(V))return}})().then(()=>{K||me.complete()}).catch(V=>{me.error(V)}),()=>{G||St()}},async dispose(){if(Ct=!0,P){let[B]=await P;B.close(1e3,"Normal Closure")}},terminate(){P&&O.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}function ma(r){return Rt(r)&&"code"in r&&"reason"in r}function Dd(r){return[1e3,1001,1006,1005,1012,1013,1013].includes(r)?!1:r>=1e3&&r<=1999}function Pd(r){return typeof r=="function"&&"constructor"in r&&"CLOSED"in r&&"CLOSING"in r&&"CONNECTING"in r&&"OPEN"in r}function Nd(r){return z(r)&&"code"in r&&"reason"in r}var $l=function(r){ge(e,r);function e(t){var n=r.call(this)||this;return n.client=t,n}return e.prototype.request=function(t){var n=this;return new Q(function(i){return n.client.subscribe(m(m({},t),{query:Xr(t.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(a){return a instanceof Error?i.error(a):Nd(a)?i.error(new Error("Socket closed with event ".concat(a.code," ").concat(a.reason||""))):i.error(new Nt({graphQLErrors:Array.isArray(a)?a:[a]}))}})})},e}(st);var Ra=function(){return Ra=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Ra.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function wa(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?wa=function(t){return typeof t}:wa=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wa(r)}function Rd(r){return wa(r)=="object"&&r!==null}var sf=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function $s(r,e){for(var t=/\r\n|[\n\r]/g,n=1,i=e+1,a;(a=t.exec(r.body))&&a.index<e;)n+=1,i=e+1-(a.index+a[0].length);return{line:n,column:i}}function Ld(r){return cf(r.source,$s(r.source,r.start))}function cf(r,e){var t=r.locationOffset.column-1,n=_a(t)+r.body,i=e.line-1,a=r.locationOffset.line-1,o=e.line+a,s=e.line===1?t:0,u=e.column+s,l="".concat(r.name,":").concat(o,":").concat(u,`
54
+ `),f=n.split(/\r\n|[\n\r]/g),p=f[i];if(p.length>120){for(var h=Math.floor(u/80),d=u%80,y=[],g=0;g<p.length;g+=80)y.push(p.slice(g,g+80));return l+Ml([["".concat(o),y[0]]].concat(y.slice(1,h+1).map(function(C){return["",C]}),[[" ",_a(d-1)+"^"],["",y[h+1]]]))}return l+Ml([["".concat(o-1),f[i-1]],["".concat(o),p],["",_a(u-1)+"^"],["".concat(o+1),f[i+1]]])}function Ml(r){var e=r.filter(function(n){n[0];var i=n[1];return i!==void 0}),t=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 Fd(t,i)+(a?" | "+a:" |")}).join(`
55
+ `)}function _a(r){return Array(r+1).join(" ")}function Fd(r,e){return _a(r-e.length)+e}function Ea(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ea=function(t){return typeof t}:Ea=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ea(r)}function jl(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function $d(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?jl(Object(t),!0).forEach(function(n){Md(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):jl(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Md(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function jd(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function Ul(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function Ud(r,e,t){return e&&Ul(r.prototype,e),t&&Ul(r,t),r}function qd(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&vi(r,e)}function Bd(r){var e=lf();return function(){var n=bi(r),i;if(e){var a=bi(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return uf(this,i)}}function uf(r,e){return e&&(Ea(e)==="object"||typeof e=="function")?e:ii(r)}function ii(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Ms(r){var e=typeof Map=="function"?new Map:void 0;return Ms=function(n){if(n===null||!Vd(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 xa(n,arguments,bi(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),vi(i,n)},Ms(r)}function xa(r,e,t){return lf()?xa=Reflect.construct:xa=function(i,a,o){var s=[null];s.push.apply(s,a);var u=Function.bind.apply(i,s),l=new u;return o&&vi(l,o.prototype),l},xa.apply(null,arguments)}function lf(){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 Vd(r){return Function.toString.call(r).indexOf("[native code]")!==-1}function vi(r,e){return vi=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},vi(r,e)}function bi(r){return bi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},bi(r)}var Qd=function(r){qd(t,r);var e=Bd(t);function t(n,i,a,o,s,u,l){var f,p,h,d;jd(this,t),d=e.call(this,n),d.name="GraphQLError",d.originalError=u??void 0,d.nodes=ql(Array.isArray(i)?i:i?[i]:void 0);for(var y=[],g=0,C=(_=d.nodes)!==null&&_!==void 0?_:[];g<C.length;g++){var _,b=C[g],S=b.loc;S!=null&&y.push(S)}y=ql(y),d.source=a??((f=y)===null||f===void 0?void 0:f[0].source),d.positions=o??((p=y)===null||p===void 0?void 0:p.map(function(k){return k.start})),d.locations=o&&a?o.map(function(k){return $s(a,k)}):(h=y)===null||h===void 0?void 0:h.map(function(k){return $s(k.source,k.start)}),d.path=s??void 0;var O=u?.extensions;return l==null&&Rd(O)?d.extensions=$d({},O):d.extensions=l??{},Object.defineProperties(ii(d),{message:{enumerable:!0},locations:{enumerable:d.locations!=null},path:{enumerable:d.path!=null},extensions:{enumerable:d.extensions!=null&&Object.keys(d.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),u!=null&&u.stack?(Object.defineProperty(ii(d),"stack",{value:u.stack,writable:!0,configurable:!0}),uf(d)):(Error.captureStackTrace?Error.captureStackTrace(ii(d),t):Object.defineProperty(ii(d),"stack",{value:Error().stack,writable:!0,configurable:!0}),d)}return Ud(t,[{key:"toString",value:function(){return Wd(this)}},{key:sf,get:function(){return"Object"}}]),t}(Ms(Error));function ql(r){return r===void 0||r.length===0?void 0:r}function Wd(r){var e=r.message;if(r.nodes)for(var t=0,n=r.nodes;t<n.length;t++){var i=n[t];i.loc&&(e+=`
56
56
 
57
- `+Fd(i.loc))}else if(r.source&&r.locations)for(var a=0,o=r.locations;a<o.length;a++){var s=o[a];e+=`
57
+ `+Ld(i.loc))}else if(r.source&&r.locations)for(var a=0,o=r.locations;a<o.length;a++){var s=o[a];e+=`
58
58
 
59
- `+uf(r.source,s)}return e}function nt(r,e,t){return new Wd("Syntax Error: ".concat(t),void 0,r,[e])}var j=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 Kd(r,e){var t=Boolean(r);if(!t)throw new Error(e??"Unexpected invariant triggered.")}var zd=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,Us=zd;function pf(r){var e=r.prototype.toJSON;typeof e=="function"||Kd(0),r.prototype.inspect=e,Us&&(r.prototype[Us]=e)}var df=function(){function r(t,n,i){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=i}var e=r.prototype;return e.toJSON=function(){return{start:this.start,end:this.end}},r}();pf(df);var Se=function(){function r(t,n,i,a,o,s,u){this.kind=t,this.start=n,this.end=i,this.line=a,this.column=o,this.value=u,this.prev=s,this.next=null}var e=r.prototype;return e.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},r}();pf(Se);var w=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 Oa(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Oa=function(t){return typeof t}:Oa=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oa(r)}var Hd=10,hf=2;function Jd(r){return Ya(r,[])}function Ya(r,e){switch(Oa(r)){case"string":return JSON.stringify(r);case"function":return r.name?"[function ".concat(r.name,"]"):"[function]";case"object":return r===null?"null":Yd(r,e);default:return String(r)}}function Yd(r,e){if(e.indexOf(r)!==-1)return"[Circular]";var t=[].concat(e,[r]),n=e1(r);if(n!==void 0){var i=n.call(r);if(i!==r)return typeof i=="string"?i:Ya(i,t)}else if(Array.isArray(r))return Zd(r,t);return Xd(r,t)}function Xd(r,e){var t=Object.keys(r);if(t.length===0)return"{}";if(e.length>hf)return"["+t1(r)+"]";var n=t.map(function(i){var a=Ya(r[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function Zd(r,e){if(r.length===0)return"[]";if(e.length>hf)return"[Array]";for(var t=Math.min(Hd,r.length),n=r.length-t,i=[],a=0;a<t;++a)i.push(Ya(r[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function e1(r){var e=r[String(Us)];if(typeof e=="function")return e;if(typeof r.inspect=="function")return r.inspect}function t1(r){var e=Object.prototype.toString.call(r).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof r.constructor=="function"){var t=r.constructor.name;if(typeof t=="string"&&t!=="")return t}return e}function Ds(r,e){var t=Boolean(r);if(!t)throw new Error(e)}function Ns(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ns=function(t){return typeof t}:Ns=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ns(r)}var r1=function(e,t){return e instanceof t};function Vl(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function n1(r,e,t){return e&&Vl(r.prototype,e),t&&Vl(r,t),r}var mf=function(){function r(e){var t=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"||Ds(0,"Body must be a string. Received: ".concat(Jd(e),".")),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||Ds(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Ds(0,"column in locationOffset is 1-indexed and must be positive.")}return n1(r,[{key:cf,get:function(){return"Source"}}]),r}();function i1(r){return r1(r,mf)}var a1=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 o1(r){var e=r.split(/\r\n|[\n\r]/g),t=s1(r);if(t!==0)for(var n=1;n<e.length;n++)e[n]=e[n].slice(t);for(var i=0;i<e.length&&Ql(e[i]);)++i;for(var a=e.length;a>i&&Ql(e[a-1]);)--a;return e.slice(i,a).join(`
60
- `)}function Ql(r){for(var e=0;e<r.length;++e)if(r[e]!==" "&&r[e]!==" ")return!1;return!0}function s1(r){for(var e,t=!0,n=!0,i=0,a=null,o=0;o<r.length;++o)switch(r.charCodeAt(o)){case 13:r.charCodeAt(o+1)===10&&++o;case 10:t=!1,n=!0,i=0;break;case 9:case 32:++i;break;default:n&&!t&&(a===null||i<a)&&(a=i),n=!1}return(e=a)!==null&&e!==void 0?e:0}var c1=function(){function r(t){var n=new Se(w.SOF,0,0,0,0,null);this.source=t,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}var e=r.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!==w.EOF)do{var i;n=(i=n.next)!==null&&i!==void 0?i:n.next=l1(this,n)}while(n.kind===w.COMMENT);return n},r}();function u1(r){return r===w.BANG||r===w.DOLLAR||r===w.AMP||r===w.PAREN_L||r===w.PAREN_R||r===w.SPREAD||r===w.COLON||r===w.EQUALS||r===w.AT||r===w.BRACKET_L||r===w.BRACKET_R||r===w.BRACE_L||r===w.PIPE||r===w.BRACE_R}function Mr(r){return isNaN(r)?w.EOF:r<127?JSON.stringify(String.fromCharCode(r)):'"\\u'.concat(("00"+r.toString(16).toUpperCase()).slice(-4),'"')}function l1(r,e){for(var t=r.source,n=t.body,i=n.length,a=e.end;a<i;){var o=n.charCodeAt(a),s=r.line,u=1+a-r.lineStart;switch(o){case 65279:case 9:case 32:case 44:++a;continue;case 10:++a,++r.line,r.lineStart=a;continue;case 13:n.charCodeAt(a+1)===10?a+=2:++a,++r.line,r.lineStart=a;continue;case 33:return new Se(w.BANG,a,a+1,s,u,e);case 35:return p1(t,a,s,u,e);case 36:return new Se(w.DOLLAR,a,a+1,s,u,e);case 38:return new Se(w.AMP,a,a+1,s,u,e);case 40:return new Se(w.PAREN_L,a,a+1,s,u,e);case 41:return new Se(w.PAREN_R,a,a+1,s,u,e);case 46:if(n.charCodeAt(a+1)===46&&n.charCodeAt(a+2)===46)return new Se(w.SPREAD,a,a+3,s,u,e);break;case 58:return new Se(w.COLON,a,a+1,s,u,e);case 61:return new Se(w.EQUALS,a,a+1,s,u,e);case 64:return new Se(w.AT,a,a+1,s,u,e);case 91:return new Se(w.BRACKET_L,a,a+1,s,u,e);case 93:return new Se(w.BRACKET_R,a,a+1,s,u,e);case 123:return new Se(w.BRACE_L,a,a+1,s,u,e);case 124:return new Se(w.PIPE,a,a+1,s,u,e);case 125:return new Se(w.BRACE_R,a,a+1,s,u,e);case 34:return n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34?m1(t,a,s,u,e,r):h1(t,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 d1(t,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 g1(t,a,s,u,e)}throw nt(t,a,f1(o))}var l=r.line,f=1+a-r.lineStart;return new Se(w.EOF,i,i,l,f,e)}function f1(r){return r<32&&r!==9&&r!==10&&r!==13?"Cannot contain the invalid character ".concat(Mr(r),"."):r===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:"Cannot parse the unexpected character ".concat(Mr(r),".")}function p1(r,e,t,n,i){var a=r.body,o,s=e;do o=a.charCodeAt(++s);while(!isNaN(o)&&(o>31||o===9));return new Se(w.COMMENT,e,s,t,n,i,a.slice(e+1,s))}function d1(r,e,t,n,i,a){var o=r.body,s=t,u=e,l=!1;if(s===45&&(s=o.charCodeAt(++u)),s===48){if(s=o.charCodeAt(++u),s>=48&&s<=57)throw nt(r,u,"Invalid number, unexpected digit after 0: ".concat(Mr(s),"."))}else u=Ps(r,u,s),s=o.charCodeAt(u);if(s===46&&(l=!0,s=o.charCodeAt(++u),u=Ps(r,u,s),s=o.charCodeAt(u)),(s===69||s===101)&&(l=!0,s=o.charCodeAt(++u),(s===43||s===45)&&(s=o.charCodeAt(++u)),u=Ps(r,u,s),s=o.charCodeAt(u)),s===46||v1(s))throw nt(r,u,"Invalid number, expected digit but got: ".concat(Mr(s),"."));return new Se(l?w.FLOAT:w.INT,e,u,n,i,a,o.slice(e,u))}function Ps(r,e,t){var n=r.body,i=e,a=t;if(a>=48&&a<=57){do a=n.charCodeAt(++i);while(a>=48&&a<=57);return i}throw nt(r,i,"Invalid number, expected digit but got: ".concat(Mr(a),"."))}function h1(r,e,t,n,i){for(var a=r.body,o=e+1,s=o,u=0,l="";o<a.length&&!isNaN(u=a.charCodeAt(o))&&u!==10&&u!==13;){if(u===34)return l+=a.slice(s,o),new Se(w.STRING,e,o+1,t,n,i,l);if(u<32&&u!==9)throw nt(r,o,"Invalid character within String: ".concat(Mr(u),"."));if(++o,u===92){switch(l+=a.slice(s,o-1),u=a.charCodeAt(o),u){case 34:l+='"';break;case 47:l+="/";break;case 92:l+="\\";break;case 98:l+="\b";break;case 102:l+="\f";break;case 110:l+=`
61
- `;break;case 114:l+="\r";break;case 116:l+=" ";break;case 117:{var f=y1(a.charCodeAt(o+1),a.charCodeAt(o+2),a.charCodeAt(o+3),a.charCodeAt(o+4));if(f<0){var p=a.slice(o+1,o+5);throw nt(r,o,"Invalid character escape sequence: \\u".concat(p,"."))}l+=String.fromCharCode(f),o+=4;break}default:throw nt(r,o,"Invalid character escape sequence: \\".concat(String.fromCharCode(u),"."))}++o,s=o}}throw nt(r,o,"Unterminated string.")}function m1(r,e,t,n,i,a){for(var o=r.body,s=e+3,u=s,l=0,f="";s<o.length&&!isNaN(l=o.charCodeAt(s));){if(l===34&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34)return f+=o.slice(u,s),new Se(w.BLOCK_STRING,e,s+3,t,n,i,o1(f));if(l<32&&l!==9&&l!==10&&l!==13)throw nt(r,s,"Invalid character within String: ".concat(Mr(l),"."));l===10?(++s,++a.line,a.lineStart=s):l===13?(o.charCodeAt(s+1)===10?s+=2:++s,++a.line,a.lineStart=s):l===92&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34&&o.charCodeAt(s+3)===34?(f+=o.slice(u,s)+'"""',s+=4,u=s):++s}throw nt(r,s,"Unterminated string.")}function y1(r,e,t,n){return ya(r)<<12|ya(e)<<8|ya(t)<<4|ya(n)}function ya(r){return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1}function g1(r,e,t,n,i){for(var a=r.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 Se(w.NAME,e,s,t,n,i,a.slice(e,s))}function v1(r){return r===95||r>=65&&r<=90||r>=97&&r<=122}function b1(r,e){var t=new C1(r,e);return t.parseDocument()}var C1=function(){function r(t,n){var i=i1(t)?t:new mf(t);this._lexer=new c1(i),this._options=n}var e=r.prototype;return e.parseName=function(){var n=this.expectToken(w.NAME);return{kind:j.NAME,value:n.value,loc:this.loc(n)}},e.parseDocument=function(){var n=this._lexer.token;return{kind:j.DOCUMENT,definitions:this.many(w.SOF,this.parseDefinition,w.EOF),loc:this.loc(n)}},e.parseDefinition=function(){if(this.peek(w.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(w.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(w.BRACE_L))return{kind:j.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(n)};var i=this.parseOperationType(),a;return this.peek(w.NAME)&&(a=this.parseName()),{kind:j.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(w.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(w.PAREN_L,this.parseVariableDefinition,w.PAREN_R)},e.parseVariableDefinition=function(){var n=this._lexer.token;return{kind:j.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(w.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(w.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(w.DOLLAR),{kind:j.VARIABLE,name:this.parseName(),loc:this.loc(n)}},e.parseSelectionSet=function(){var n=this._lexer.token;return{kind:j.SELECTION_SET,selections:this.many(w.BRACE_L,this.parseSelection,w.BRACE_R),loc:this.loc(n)}},e.parseSelection=function(){return this.peek(w.SPREAD)?this.parseFragment():this.parseField()},e.parseField=function(){var n=this._lexer.token,i=this.parseName(),a,o;return this.expectOptionalToken(w.COLON)?(a=i,o=this.parseName()):o=i,{kind:j.FIELD,alias:a,name:o,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(w.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},e.parseArguments=function(n){var i=n?this.parseConstArgument:this.parseArgument;return this.optionalMany(w.PAREN_L,i,w.PAREN_R)},e.parseArgument=function(){var n=this._lexer.token,i=this.parseName();return this.expectToken(w.COLON),{kind:j.ARGUMENT,name:i,value:this.parseValueLiteral(!1),loc:this.loc(n)}},e.parseConstArgument=function(){var n=this._lexer.token;return{kind:j.ARGUMENT,name:this.parseName(),value:(this.expectToken(w.COLON),this.parseValueLiteral(!0)),loc:this.loc(n)}},e.parseFragment=function(){var n=this._lexer.token;this.expectToken(w.SPREAD);var i=this.expectOptionalKeyword("on");return!i&&this.peek(w.NAME)?{kind:j.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(n)}:{kind:j.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:j.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:j.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 w.BRACKET_L:return this.parseList(n);case w.BRACE_L:return this.parseObject(n);case w.INT:return this._lexer.advance(),{kind:j.INT,value:i.value,loc:this.loc(i)};case w.FLOAT:return this._lexer.advance(),{kind:j.FLOAT,value:i.value,loc:this.loc(i)};case w.STRING:case w.BLOCK_STRING:return this.parseStringLiteral();case w.NAME:switch(this._lexer.advance(),i.value){case"true":return{kind:j.BOOLEAN,value:!0,loc:this.loc(i)};case"false":return{kind:j.BOOLEAN,value:!1,loc:this.loc(i)};case"null":return{kind:j.NULL,loc:this.loc(i)};default:return{kind:j.ENUM,value:i.value,loc:this.loc(i)}}case w.DOLLAR:if(!n)return this.parseVariable();break}throw this.unexpected()},e.parseStringLiteral=function(){var n=this._lexer.token;return this._lexer.advance(),{kind:j.STRING,value:n.value,block:n.kind===w.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:j.LIST,values:this.any(w.BRACKET_L,o,w.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:j.OBJECT,fields:this.any(w.BRACE_L,o,w.BRACE_R),loc:this.loc(a)}},e.parseObjectField=function(n){var i=this._lexer.token,a=this.parseName();return this.expectToken(w.COLON),{kind:j.OBJECT_FIELD,name:a,value:this.parseValueLiteral(n),loc:this.loc(i)}},e.parseDirectives=function(n){for(var i=[];this.peek(w.AT);)i.push(this.parseDirective(n));return i},e.parseDirective=function(n){var i=this._lexer.token;return this.expectToken(w.AT),{kind:j.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(n),loc:this.loc(i)}},e.parseTypeReference=function(){var n=this._lexer.token,i;return this.expectOptionalToken(w.BRACKET_L)?(i=this.parseTypeReference(),this.expectToken(w.BRACKET_R),i={kind:j.LIST_TYPE,type:i,loc:this.loc(n)}):i=this.parseNamedType(),this.expectOptionalToken(w.BANG)?{kind:j.NON_NULL_TYPE,type:i,loc:this.loc(n)}:i},e.parseNamedType=function(){var n=this._lexer.token;return{kind:j.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===w.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(w.STRING)||this.peek(w.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(w.BRACE_L,this.parseOperationTypeDefinition,w.BRACE_R);return{kind:j.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(w.COLON);var a=this.parseNamedType();return{kind:j.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:j.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:j.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(w.AMP);do i.push(this.parseNamedType());while(this.expectOptionalToken(w.AMP)||this.peek(w.NAME));return i}return this.delimitedMany(w.AMP,this.parseNamedType)},e.parseFieldsDefinition=function(){var n;return((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLEmptyFields)===!0&&this.peek(w.BRACE_L)&&this._lexer.lookahead().kind===w.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(w.BRACE_L,this.parseFieldDefinition,w.BRACE_R)},e.parseFieldDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseArgumentDefs();this.expectToken(w.COLON);var s=this.parseTypeReference(),u=this.parseDirectives(!0);return{kind:j.FIELD_DEFINITION,description:i,name:a,arguments:o,type:s,directives:u,loc:this.loc(n)}},e.parseArgumentDefs=function(){return this.optionalMany(w.PAREN_L,this.parseInputValueDef,w.PAREN_R)},e.parseInputValueDef=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName();this.expectToken(w.COLON);var o=this.parseTypeReference(),s;this.expectOptionalToken(w.EQUALS)&&(s=this.parseValueLiteral(!0));var u=this.parseDirectives(!0);return{kind:j.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:j.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:j.UNION_TYPE_DEFINITION,description:i,name:a,directives:o,types:s,loc:this.loc(n)}},e.parseUnionMemberTypes=function(){return this.expectOptionalToken(w.EQUALS)?this.delimitedMany(w.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:j.ENUM_TYPE_DEFINITION,description:i,name:a,directives:o,values:s,loc:this.loc(n)}},e.parseEnumValuesDefinition=function(){return this.optionalMany(w.BRACE_L,this.parseEnumValueDefinition,w.BRACE_R)},e.parseEnumValueDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseDirectives(!0);return{kind:j.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:j.INPUT_OBJECT_TYPE_DEFINITION,description:i,name:a,directives:o,fields:s,loc:this.loc(n)}},e.parseInputFieldsDefinition=function(){return this.optionalMany(w.BRACE_L,this.parseInputValueDef,w.BRACE_R)},e.parseTypeSystemExtension=function(){var n=this._lexer.lookahead();if(n.kind===w.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(w.BRACE_L,this.parseOperationTypeDefinition,w.BRACE_R);if(i.length===0&&a.length===0)throw this.unexpected();return{kind:j.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:j.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:j.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:j.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:j.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:j.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:j.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(w.AT);var a=this.parseName(),o=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var u=this.parseDirectiveLocations();return{kind:j.DIRECTIVE_DEFINITION,description:i,name:a,arguments:o,repeatable:s,locations:u,loc:this.loc(n)}},e.parseDirectiveLocations=function(){return this.delimitedMany(w.PIPE,this.parseDirectiveLocation)},e.parseDirectiveLocation=function(){var n=this._lexer.token,i=this.parseName();if(a1[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 df(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 nt(this._lexer.source,i.start,"Expected ".concat(yf(n),", found ").concat(Rs(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===w.NAME&&i.value===n)this._lexer.advance();else throw nt(this._lexer.source,i.start,'Expected "'.concat(n,'", found ').concat(Rs(i),"."))},e.expectOptionalKeyword=function(n){var i=this._lexer.token;return i.kind===w.NAME&&i.value===n?(this._lexer.advance(),!0):!1},e.unexpected=function(n){var i=n??this._lexer.token;return nt(this._lexer.source,i.start,"Unexpected ".concat(Rs(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},r}();function Rs(r){var e=r.value;return yf(r.kind)+(e!=null?' "'.concat(e,'"'):"")}function yf(r){return u1(r)?'"'.concat(r,'"'):r}var Ta=new Map,qs=new Map,gf=!0,La=!1;function vf(r){return r.replace(/[\s,]+/g," ").trim()}function S1(r){return vf(r.source.body.substring(r.start,r.end))}function w1(r){var e=new Set,t=[];return r.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,a=S1(n.loc),o=qs.get(i);o&&!o.has(a)?gf&&console.warn("Warning: fragment with name "+i+` already exists.
59
+ `+cf(r.source,s)}return e}function nt(r,e,t){return new Qd("Syntax Error: ".concat(t),void 0,r,[e])}var j=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 Gd(r,e){var t=Boolean(r);if(!t)throw new Error(e??"Unexpected invariant triggered.")}var Kd=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,js=Kd;function ff(r){var e=r.prototype.toJSON;typeof e=="function"||Gd(0),r.prototype.inspect=e,js&&(r.prototype[js]=e)}var pf=function(){function r(t,n,i){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=i}var e=r.prototype;return e.toJSON=function(){return{start:this.start,end:this.end}},r}();ff(pf);var Se=function(){function r(t,n,i,a,o,s,u){this.kind=t,this.start=n,this.end=i,this.line=a,this.column=o,this.value=u,this.prev=s,this.next=null}var e=r.prototype;return e.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},r}();ff(Se);var w=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 Oa(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Oa=function(t){return typeof t}:Oa=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oa(r)}var zd=10,df=2;function Hd(r){return Ya(r,[])}function Ya(r,e){switch(Oa(r)){case"string":return JSON.stringify(r);case"function":return r.name?"[function ".concat(r.name,"]"):"[function]";case"object":return r===null?"null":Jd(r,e);default:return String(r)}}function Jd(r,e){if(e.indexOf(r)!==-1)return"[Circular]";var t=[].concat(e,[r]),n=Zd(r);if(n!==void 0){var i=n.call(r);if(i!==r)return typeof i=="string"?i:Ya(i,t)}else if(Array.isArray(r))return Xd(r,t);return Yd(r,t)}function Yd(r,e){var t=Object.keys(r);if(t.length===0)return"{}";if(e.length>df)return"["+e1(r)+"]";var n=t.map(function(i){var a=Ya(r[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function Xd(r,e){if(r.length===0)return"[]";if(e.length>df)return"[Array]";for(var t=Math.min(zd,r.length),n=r.length-t,i=[],a=0;a<t;++a)i.push(Ya(r[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function Zd(r){var e=r[String(js)];if(typeof e=="function")return e;if(typeof r.inspect=="function")return r.inspect}function e1(r){var e=Object.prototype.toString.call(r).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof r.constructor=="function"){var t=r.constructor.name;if(typeof t=="string"&&t!=="")return t}return e}function Ds(r,e){var t=Boolean(r);if(!t)throw new Error(e)}var t1=function(e,t){return e instanceof t};function Bl(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function r1(r,e,t){return e&&Bl(r.prototype,e),t&&Bl(r,t),r}var hf=function(){function r(e){var t=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"||Ds(0,"Body must be a string. Received: ".concat(Hd(e),".")),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||Ds(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Ds(0,"column in locationOffset is 1-indexed and must be positive.")}return r1(r,[{key:sf,get:function(){return"Source"}}]),r}();function n1(r){return t1(r,hf)}var i1=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 a1(r){var e=r.split(/\r\n|[\n\r]/g),t=o1(r);if(t!==0)for(var n=1;n<e.length;n++)e[n]=e[n].slice(t);for(var i=0;i<e.length&&Vl(e[i]);)++i;for(var a=e.length;a>i&&Vl(e[a-1]);)--a;return e.slice(i,a).join(`
60
+ `)}function Vl(r){for(var e=0;e<r.length;++e)if(r[e]!==" "&&r[e]!==" ")return!1;return!0}function o1(r){for(var e,t=!0,n=!0,i=0,a=null,o=0;o<r.length;++o)switch(r.charCodeAt(o)){case 13:r.charCodeAt(o+1)===10&&++o;case 10:t=!1,n=!0,i=0;break;case 9:case 32:++i;break;default:n&&!t&&(a===null||i<a)&&(a=i),n=!1}return(e=a)!==null&&e!==void 0?e:0}var s1=function(){function r(t){var n=new Se(w.SOF,0,0,0,0,null);this.source=t,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}var e=r.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!==w.EOF)do{var i;n=(i=n.next)!==null&&i!==void 0?i:n.next=u1(this,n)}while(n.kind===w.COMMENT);return n},r}();function c1(r){return r===w.BANG||r===w.DOLLAR||r===w.AMP||r===w.PAREN_L||r===w.PAREN_R||r===w.SPREAD||r===w.COLON||r===w.EQUALS||r===w.AT||r===w.BRACKET_L||r===w.BRACKET_R||r===w.BRACE_L||r===w.PIPE||r===w.BRACE_R}function Mr(r){return isNaN(r)?w.EOF:r<127?JSON.stringify(String.fromCharCode(r)):'"\\u'.concat(("00"+r.toString(16).toUpperCase()).slice(-4),'"')}function u1(r,e){for(var t=r.source,n=t.body,i=n.length,a=e.end;a<i;){var o=n.charCodeAt(a),s=r.line,u=1+a-r.lineStart;switch(o){case 65279:case 9:case 32:case 44:++a;continue;case 10:++a,++r.line,r.lineStart=a;continue;case 13:n.charCodeAt(a+1)===10?a+=2:++a,++r.line,r.lineStart=a;continue;case 33:return new Se(w.BANG,a,a+1,s,u,e);case 35:return f1(t,a,s,u,e);case 36:return new Se(w.DOLLAR,a,a+1,s,u,e);case 38:return new Se(w.AMP,a,a+1,s,u,e);case 40:return new Se(w.PAREN_L,a,a+1,s,u,e);case 41:return new Se(w.PAREN_R,a,a+1,s,u,e);case 46:if(n.charCodeAt(a+1)===46&&n.charCodeAt(a+2)===46)return new Se(w.SPREAD,a,a+3,s,u,e);break;case 58:return new Se(w.COLON,a,a+1,s,u,e);case 61:return new Se(w.EQUALS,a,a+1,s,u,e);case 64:return new Se(w.AT,a,a+1,s,u,e);case 91:return new Se(w.BRACKET_L,a,a+1,s,u,e);case 93:return new Se(w.BRACKET_R,a,a+1,s,u,e);case 123:return new Se(w.BRACE_L,a,a+1,s,u,e);case 124:return new Se(w.PIPE,a,a+1,s,u,e);case 125:return new Se(w.BRACE_R,a,a+1,s,u,e);case 34:return n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34?h1(t,a,s,u,e,r):d1(t,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 p1(t,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 y1(t,a,s,u,e)}throw nt(t,a,l1(o))}var l=r.line,f=1+a-r.lineStart;return new Se(w.EOF,i,i,l,f,e)}function l1(r){return r<32&&r!==9&&r!==10&&r!==13?"Cannot contain the invalid character ".concat(Mr(r),"."):r===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:"Cannot parse the unexpected character ".concat(Mr(r),".")}function f1(r,e,t,n,i){var a=r.body,o,s=e;do o=a.charCodeAt(++s);while(!isNaN(o)&&(o>31||o===9));return new Se(w.COMMENT,e,s,t,n,i,a.slice(e+1,s))}function p1(r,e,t,n,i,a){var o=r.body,s=t,u=e,l=!1;if(s===45&&(s=o.charCodeAt(++u)),s===48){if(s=o.charCodeAt(++u),s>=48&&s<=57)throw nt(r,u,"Invalid number, unexpected digit after 0: ".concat(Mr(s),"."))}else u=Ps(r,u,s),s=o.charCodeAt(u);if(s===46&&(l=!0,s=o.charCodeAt(++u),u=Ps(r,u,s),s=o.charCodeAt(u)),(s===69||s===101)&&(l=!0,s=o.charCodeAt(++u),(s===43||s===45)&&(s=o.charCodeAt(++u)),u=Ps(r,u,s),s=o.charCodeAt(u)),s===46||g1(s))throw nt(r,u,"Invalid number, expected digit but got: ".concat(Mr(s),"."));return new Se(l?w.FLOAT:w.INT,e,u,n,i,a,o.slice(e,u))}function Ps(r,e,t){var n=r.body,i=e,a=t;if(a>=48&&a<=57){do a=n.charCodeAt(++i);while(a>=48&&a<=57);return i}throw nt(r,i,"Invalid number, expected digit but got: ".concat(Mr(a),"."))}function d1(r,e,t,n,i){for(var a=r.body,o=e+1,s=o,u=0,l="";o<a.length&&!isNaN(u=a.charCodeAt(o))&&u!==10&&u!==13;){if(u===34)return l+=a.slice(s,o),new Se(w.STRING,e,o+1,t,n,i,l);if(u<32&&u!==9)throw nt(r,o,"Invalid character within String: ".concat(Mr(u),"."));if(++o,u===92){switch(l+=a.slice(s,o-1),u=a.charCodeAt(o),u){case 34:l+='"';break;case 47:l+="/";break;case 92:l+="\\";break;case 98:l+="\b";break;case 102:l+="\f";break;case 110:l+=`
61
+ `;break;case 114:l+="\r";break;case 116:l+=" ";break;case 117:{var f=m1(a.charCodeAt(o+1),a.charCodeAt(o+2),a.charCodeAt(o+3),a.charCodeAt(o+4));if(f<0){var p=a.slice(o+1,o+5);throw nt(r,o,"Invalid character escape sequence: \\u".concat(p,"."))}l+=String.fromCharCode(f),o+=4;break}default:throw nt(r,o,"Invalid character escape sequence: \\".concat(String.fromCharCode(u),"."))}++o,s=o}}throw nt(r,o,"Unterminated string.")}function h1(r,e,t,n,i,a){for(var o=r.body,s=e+3,u=s,l=0,f="";s<o.length&&!isNaN(l=o.charCodeAt(s));){if(l===34&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34)return f+=o.slice(u,s),new Se(w.BLOCK_STRING,e,s+3,t,n,i,a1(f));if(l<32&&l!==9&&l!==10&&l!==13)throw nt(r,s,"Invalid character within String: ".concat(Mr(l),"."));l===10?(++s,++a.line,a.lineStart=s):l===13?(o.charCodeAt(s+1)===10?s+=2:++s,++a.line,a.lineStart=s):l===92&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34&&o.charCodeAt(s+3)===34?(f+=o.slice(u,s)+'"""',s+=4,u=s):++s}throw nt(r,s,"Unterminated string.")}function m1(r,e,t,n){return ya(r)<<12|ya(e)<<8|ya(t)<<4|ya(n)}function ya(r){return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1}function y1(r,e,t,n,i){for(var a=r.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 Se(w.NAME,e,s,t,n,i,a.slice(e,s))}function g1(r){return r===95||r>=65&&r<=90||r>=97&&r<=122}function v1(r,e){var t=new b1(r,e);return t.parseDocument()}var b1=function(){function r(t,n){var i=n1(t)?t:new hf(t);this._lexer=new s1(i),this._options=n}var e=r.prototype;return e.parseName=function(){var n=this.expectToken(w.NAME);return{kind:j.NAME,value:n.value,loc:this.loc(n)}},e.parseDocument=function(){var n=this._lexer.token;return{kind:j.DOCUMENT,definitions:this.many(w.SOF,this.parseDefinition,w.EOF),loc:this.loc(n)}},e.parseDefinition=function(){if(this.peek(w.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(w.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(w.BRACE_L))return{kind:j.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(n)};var i=this.parseOperationType(),a;return this.peek(w.NAME)&&(a=this.parseName()),{kind:j.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(w.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(w.PAREN_L,this.parseVariableDefinition,w.PAREN_R)},e.parseVariableDefinition=function(){var n=this._lexer.token;return{kind:j.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(w.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(w.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(w.DOLLAR),{kind:j.VARIABLE,name:this.parseName(),loc:this.loc(n)}},e.parseSelectionSet=function(){var n=this._lexer.token;return{kind:j.SELECTION_SET,selections:this.many(w.BRACE_L,this.parseSelection,w.BRACE_R),loc:this.loc(n)}},e.parseSelection=function(){return this.peek(w.SPREAD)?this.parseFragment():this.parseField()},e.parseField=function(){var n=this._lexer.token,i=this.parseName(),a,o;return this.expectOptionalToken(w.COLON)?(a=i,o=this.parseName()):o=i,{kind:j.FIELD,alias:a,name:o,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(w.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},e.parseArguments=function(n){var i=n?this.parseConstArgument:this.parseArgument;return this.optionalMany(w.PAREN_L,i,w.PAREN_R)},e.parseArgument=function(){var n=this._lexer.token,i=this.parseName();return this.expectToken(w.COLON),{kind:j.ARGUMENT,name:i,value:this.parseValueLiteral(!1),loc:this.loc(n)}},e.parseConstArgument=function(){var n=this._lexer.token;return{kind:j.ARGUMENT,name:this.parseName(),value:(this.expectToken(w.COLON),this.parseValueLiteral(!0)),loc:this.loc(n)}},e.parseFragment=function(){var n=this._lexer.token;this.expectToken(w.SPREAD);var i=this.expectOptionalKeyword("on");return!i&&this.peek(w.NAME)?{kind:j.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(n)}:{kind:j.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:j.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:j.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 w.BRACKET_L:return this.parseList(n);case w.BRACE_L:return this.parseObject(n);case w.INT:return this._lexer.advance(),{kind:j.INT,value:i.value,loc:this.loc(i)};case w.FLOAT:return this._lexer.advance(),{kind:j.FLOAT,value:i.value,loc:this.loc(i)};case w.STRING:case w.BLOCK_STRING:return this.parseStringLiteral();case w.NAME:switch(this._lexer.advance(),i.value){case"true":return{kind:j.BOOLEAN,value:!0,loc:this.loc(i)};case"false":return{kind:j.BOOLEAN,value:!1,loc:this.loc(i)};case"null":return{kind:j.NULL,loc:this.loc(i)};default:return{kind:j.ENUM,value:i.value,loc:this.loc(i)}}case w.DOLLAR:if(!n)return this.parseVariable();break}throw this.unexpected()},e.parseStringLiteral=function(){var n=this._lexer.token;return this._lexer.advance(),{kind:j.STRING,value:n.value,block:n.kind===w.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:j.LIST,values:this.any(w.BRACKET_L,o,w.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:j.OBJECT,fields:this.any(w.BRACE_L,o,w.BRACE_R),loc:this.loc(a)}},e.parseObjectField=function(n){var i=this._lexer.token,a=this.parseName();return this.expectToken(w.COLON),{kind:j.OBJECT_FIELD,name:a,value:this.parseValueLiteral(n),loc:this.loc(i)}},e.parseDirectives=function(n){for(var i=[];this.peek(w.AT);)i.push(this.parseDirective(n));return i},e.parseDirective=function(n){var i=this._lexer.token;return this.expectToken(w.AT),{kind:j.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(n),loc:this.loc(i)}},e.parseTypeReference=function(){var n=this._lexer.token,i;return this.expectOptionalToken(w.BRACKET_L)?(i=this.parseTypeReference(),this.expectToken(w.BRACKET_R),i={kind:j.LIST_TYPE,type:i,loc:this.loc(n)}):i=this.parseNamedType(),this.expectOptionalToken(w.BANG)?{kind:j.NON_NULL_TYPE,type:i,loc:this.loc(n)}:i},e.parseNamedType=function(){var n=this._lexer.token;return{kind:j.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===w.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(w.STRING)||this.peek(w.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(w.BRACE_L,this.parseOperationTypeDefinition,w.BRACE_R);return{kind:j.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(w.COLON);var a=this.parseNamedType();return{kind:j.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:j.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:j.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(w.AMP);do i.push(this.parseNamedType());while(this.expectOptionalToken(w.AMP)||this.peek(w.NAME));return i}return this.delimitedMany(w.AMP,this.parseNamedType)},e.parseFieldsDefinition=function(){var n;return((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLEmptyFields)===!0&&this.peek(w.BRACE_L)&&this._lexer.lookahead().kind===w.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(w.BRACE_L,this.parseFieldDefinition,w.BRACE_R)},e.parseFieldDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseArgumentDefs();this.expectToken(w.COLON);var s=this.parseTypeReference(),u=this.parseDirectives(!0);return{kind:j.FIELD_DEFINITION,description:i,name:a,arguments:o,type:s,directives:u,loc:this.loc(n)}},e.parseArgumentDefs=function(){return this.optionalMany(w.PAREN_L,this.parseInputValueDef,w.PAREN_R)},e.parseInputValueDef=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName();this.expectToken(w.COLON);var o=this.parseTypeReference(),s;this.expectOptionalToken(w.EQUALS)&&(s=this.parseValueLiteral(!0));var u=this.parseDirectives(!0);return{kind:j.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:j.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:j.UNION_TYPE_DEFINITION,description:i,name:a,directives:o,types:s,loc:this.loc(n)}},e.parseUnionMemberTypes=function(){return this.expectOptionalToken(w.EQUALS)?this.delimitedMany(w.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:j.ENUM_TYPE_DEFINITION,description:i,name:a,directives:o,values:s,loc:this.loc(n)}},e.parseEnumValuesDefinition=function(){return this.optionalMany(w.BRACE_L,this.parseEnumValueDefinition,w.BRACE_R)},e.parseEnumValueDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseDirectives(!0);return{kind:j.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:j.INPUT_OBJECT_TYPE_DEFINITION,description:i,name:a,directives:o,fields:s,loc:this.loc(n)}},e.parseInputFieldsDefinition=function(){return this.optionalMany(w.BRACE_L,this.parseInputValueDef,w.BRACE_R)},e.parseTypeSystemExtension=function(){var n=this._lexer.lookahead();if(n.kind===w.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(w.BRACE_L,this.parseOperationTypeDefinition,w.BRACE_R);if(i.length===0&&a.length===0)throw this.unexpected();return{kind:j.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:j.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:j.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:j.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:j.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:j.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:j.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(w.AT);var a=this.parseName(),o=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var u=this.parseDirectiveLocations();return{kind:j.DIRECTIVE_DEFINITION,description:i,name:a,arguments:o,repeatable:s,locations:u,loc:this.loc(n)}},e.parseDirectiveLocations=function(){return this.delimitedMany(w.PIPE,this.parseDirectiveLocation)},e.parseDirectiveLocation=function(){var n=this._lexer.token,i=this.parseName();if(i1[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 pf(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 nt(this._lexer.source,i.start,"Expected ".concat(mf(n),", found ").concat(Ns(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===w.NAME&&i.value===n)this._lexer.advance();else throw nt(this._lexer.source,i.start,'Expected "'.concat(n,'", found ').concat(Ns(i),"."))},e.expectOptionalKeyword=function(n){var i=this._lexer.token;return i.kind===w.NAME&&i.value===n?(this._lexer.advance(),!0):!1},e.unexpected=function(n){var i=n??this._lexer.token;return nt(this._lexer.source,i.start,"Unexpected ".concat(Ns(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},r}();function Ns(r){var e=r.value;return mf(r.kind)+(e!=null?' "'.concat(e,'"'):"")}function mf(r){return c1(r)?'"'.concat(r,'"'):r}var Ta=new Map,Us=new Map,yf=!0,La=!1;function gf(r){return r.replace(/[\s,]+/g," ").trim()}function C1(r){return gf(r.source.body.substring(r.start,r.end))}function S1(r){var e=new Set,t=[];return r.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,a=C1(n.loc),o=Us.get(i);o&&!o.has(a)?yf&&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||qs.set(i,o=new Set),o.add(a),e.has(a)||(e.add(a),t.push(n))}else t.push(n)}),Ra(Ra({},r),{definitions:t})}function _1(r){var e=new Set(r.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 t=r.loc;return t&&(delete t.startToken,delete t.endToken),r}function E1(r){var e=vf(r);if(!Ta.has(e)){var t=b1(r,{experimentalFragmentVariables:La,allowLegacyFragmentVariables:La});if(!t||t.kind!=="Document")throw new Error("Not a valid GraphQL document.");Ta.set(e,_1(w1(t)))}return Ta.get(e)}function E(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];typeof r=="string"&&(r=[r]);var n=r[0];return e.forEach(function(i,a){i&&i.kind==="Document"?n+=i.loc.source.body:n+=i,n+=r[a+1]}),E1(n)}function x1(){Ta.clear(),qs.clear()}function O1(){gf=!1}function T1(){La=!0}function A1(){La=!1}var ri={gql:E,resetCaches:x1,disableFragmentWarnings:O1,enableExperimentalFragmentVariables:T1,disableExperimentalFragmentVariables:A1};(function(r){r.gql=ri.gql,r.resetCaches=ri.resetCaches,r.disableFragmentWarnings=ri.disableFragmentWarnings,r.enableExperimentalFragmentVariables=ri.enableExperimentalFragmentVariables,r.disableExperimentalFragmentVariables=ri.disableExperimentalFragmentVariables})(E||(E={}));E.default=E;function A(r){if(r.error)throw r.error;if(r.errors)throw r.errors;return r.data}function I1(){}function ec(){return I1}var v=ec,Ge=ec,J=ec,bf=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},Cf=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},jr=class{constructor(e){this.code=e}};bf([v(),Cf("design:type",String)],jr.prototype,"code",void 0);jr=bf([J(),Cf("design:paramtypes",[String])],jr);var tc=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},rc=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Tt=class{constructor(e,t){this.address=e,this.name=t}};tc([v(),rc("design:type",String)],Tt.prototype,"address",void 0);tc([v(),rc("design:type",String)],Tt.prototype,"name",void 0);Tt=tc([J(),rc("design:paramtypes",[String,String])],Tt);var fe=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},Te=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},ir=class{constructor(e,t){this.key=t,this.signature=e}};fe([v(),Te("design:type",String)],ir.prototype,"signature",void 0);fe([v(),Te("design:type",String)],ir.prototype,"key",void 0);fe([v(),Te("design:type",Boolean)],ir.prototype,"valid",void 0);fe([v(),Te("design:type",Boolean)],ir.prototype,"invalid",void 0);ir=fe([J(),Ge(),Te("design:paramtypes",[String,String])],ir);var Ur=class{};fe([v(),Te("design:type",String)],Ur.prototype,"signature",void 0);fe([v(),Te("design:type",String)],Ur.prototype,"key",void 0);fe([v(),Te("design:type",Boolean)],Ur.prototype,"valid",void 0);fe([v(),Te("design:type",Boolean)],Ur.prototype,"invalid",void 0);Ur=fe([Ge()],Ur);function lr(r){let e=class{constructor(n,i,a,o){this.author=n,this.timestamp=i,this.data=a,this.proof=o}};return fe([v(),Te("design:type",String)],e.prototype,"author",void 0),fe([v(),Te("design:type",String)],e.prototype,"timestamp",void 0),fe([v(),Te("design:type",Object)],e.prototype,"data",void 0),fe([v(),Te("design:type",ir)],e.prototype,"proof",void 0),e=fe([J(),Te("design:paramtypes",[String,String,Object,ir])],e),e}function k1(r){let e=class{};return fe([v(),Te("design:type",String)],e.prototype,"author",void 0),fe([v(),Te("design:type",String)],e.prototype,"timestamp",void 0),fe([v(),Te("design:type",Object)],e.prototype,"data",void 0),fe([v(),Te("design:type",Ur)],e.prototype,"proof",void 0),e=fe([Ge()],e),e}var Wl=class extends lr(){};Wl=fe([J()],Wl);var Fa=class extends lr(){};fe([v(),Te("design:type",Tt)],Fa.prototype,"language",void 0);fe([v(),Te("design:type",jr)],Fa.prototype,"icon",void 0);Fa=fe([J()],Fa);function Eg(r){return r&&r.author&&r.timestamp&&r.data}var _e=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},$e=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},ct=class{constructor(e){this.source=e.source?e.source:"",this.target=e.target?e.target:"",this.predicate=e.predicate?e.predicate:""}};_e([v(),$e("design:type",String)],ct.prototype,"source",void 0);_e([v(),$e("design:type",String)],ct.prototype,"target",void 0);_e([v(),$e("design:type",String)],ct.prototype,"predicate",void 0);ct=_e([J(),$e("design:paramtypes",[Object])],ct);var $a=class{};_e([v(),$e("design:type",Array)],$a.prototype,"additions",void 0);_e([v(),$e("design:type",Array)],$a.prototype,"removals",void 0);$a=_e([Ge()],$a);var Ma=class{constructor(e,t){this.additions=e,this.removals=t}};_e([v(),$e("design:type",Array)],Ma.prototype,"additions",void 0);_e([v(),$e("design:type",Array)],Ma.prototype,"removals",void 0);Ma=_e([J(),$e("design:paramtypes",[Array,Array])],Ma);var Ci=class{};_e([v(),$e("design:type",String)],Ci.prototype,"source",void 0);_e([v(),$e("design:type",String)],Ci.prototype,"target",void 0);_e([v(),$e("design:type",String)],Ci.prototype,"predicate",void 0);Ci=_e([Ge()],Ci);var qr=class extends lr(){hash(){let e=JSON.stringify(this.data,Object.keys(this.data).sort())+JSON.stringify(this.author)+this.timestamp,t=0,n,i;for(n=0;n<e.length;n++)i=e.charCodeAt(n),t=(t<<5)-t+i,t|=0;return t}};_e([v(),$e("design:type",String)],qr.prototype,"status",void 0);qr=_e([J()],qr);var Bs=class extends k1(){};_e([v(),$e("design:type",String)],Bs.prototype,"status",void 0);Bs=_e([Ge()],Bs);function Dg(r,e){return r.author==e.author&&r.timestamp==e.timestamp&&r.data.source==e.data.source&&r.data.predicate==e.data.predicate&&r.data.target==e.data.target}function Ng(r){return r&&r.source&&r.target}var ja=class{constructor(e,t){this.oldLink=e,this.newLink=t}};_e([v(),$e("design:type",qr)],ja.prototype,"oldLink",void 0);_e([v(),$e("design:type",qr)],ja.prototype,"newLink",void 0);ja=_e([J(),$e("design:paramtypes",[qr,qr])],ja);var Vr=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},Ei=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Vs,ar=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 t=JSON.parse(JSON.stringify(this.links));return t=t.filter(n=>n.data.predicate===e.predicate),e.limit&&(t=t.slice(0,e.limit)),t}getSingleTarget(e){delete e.target;let t=this.get(e);return t.length?t[0].data.target:null}};Vr([v(),Ei("design:type",Array)],ar.prototype,"links",void 0);ar=Vr([J(),Ei("design:paramtypes",[Array])],ar);var Qs=class{};Vr([v(),Ei("design:type",Array)],Qs.prototype,"links",void 0);Qs=Vr([Ge()],Qs);var Ws=Vs=class{constructor(e){e?this.links=e:this.links=[]}static fromLink(e){let t=new Vs;return t.links.push(e),t}};Vr([v(),Ei("design:type",Array)],Ws.prototype,"links",void 0);Ws=Vs=Vr([Ge(),Ei("design:paramtypes",[Array])],Ws);var Gs=class extends lr(){};Gs=Vr([J()],Gs);var L=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},$=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},rr=class{constructor(e,t){this.did=e,t?this.perspective=t:this.perspective=new ar}};L([v(),$("design:type",String)],rr.prototype,"did",void 0);L([v(),$("design:type",ar)],rr.prototype,"perspective",void 0);L([v(),$("design:type",String)],rr.prototype,"directMessageLanguage",void 0);rr=L([J(),$("design:paramtypes",[String,ar])],rr);var Gl=class extends lr(){};Gl=L([J()],Gl);var or=class{constructor(e,t,n,i,a,o){this.did=e,this.didSigningKeyId=t,this.deviceKeyType=n,this.deviceKey=i,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};L([v(),$("design:type",String)],or.prototype,"did",void 0);L([v(),$("design:type",String)],or.prototype,"didSigningKeyId",void 0);L([v(),$("design:type",String)],or.prototype,"deviceKeyType",void 0);L([v(),$("design:type",String)],or.prototype,"deviceKey",void 0);L([v(),$("design:type",String)],or.prototype,"deviceKeySignedByDid",void 0);L([v(),$("design:type",String)],or.prototype,"didSignedByDeviceKey",void 0);or=L([J(),$("design:paramtypes",[String,String,String,String,String,String])],or);var sr=class{constructor(e,t,n,i,a,o){this.did=e,this.didSigningKeyId=t,this.deviceKeyType=n,this.deviceKey=i,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};L([v(),$("design:type",String)],sr.prototype,"did",void 0);L([v(),$("design:type",String)],sr.prototype,"didSigningKeyId",void 0);L([v(),$("design:type",String)],sr.prototype,"deviceKeyType",void 0);L([v(),$("design:type",String)],sr.prototype,"deviceKey",void 0);L([v(),$("design:type",String)],sr.prototype,"deviceKeySignedByDid",void 0);L([v(),$("design:type",String)],sr.prototype,"didSignedByDeviceKey",void 0);sr=L([Ge(),$("design:paramtypes",[String,String,String,String,String,String])],sr);var Ua=class{constructor(e,t){this.signature=e,this.publicKey=t}};L([v(),$("design:type",String)],Ua.prototype,"signature",void 0);L([v(),$("design:type",String)],Ua.prototype,"publicKey",void 0);Ua=L([J(),$("design:paramtypes",[String,String])],Ua);var wn=class{constructor(e,t){this.domain=e,this.pointers=t}};L([v(),$("design:type",String)],wn.prototype,"domain",void 0);L([v(),$("design:type",Array)],wn.prototype,"pointers",void 0);wn=L([J(),$("design:paramtypes",[String,Array])],wn);var qa=class{constructor(e,t){this.with=e,this.can=t}};L([v(),$("design:type",wn)],qa.prototype,"with",void 0);L([v(),$("design:type",Array)],qa.prototype,"can",void 0);qa=L([J(),$("design:paramtypes",[wn,Array])],qa);var jt=class{constructor(e,t,n,i,a){this.appName=e,this.appDesc=t,this.appIconPath=a,this.appUrl=n,this.capabilities=i}};L([v(),$("design:type",String)],jt.prototype,"appName",void 0);L([v(),$("design:type",String)],jt.prototype,"appDesc",void 0);L([v(),$("design:type",String)],jt.prototype,"appUrl",void 0);L([v(),$("design:type",String)],jt.prototype,"appIconPath",void 0);L([v(),$("design:type",Array)],jt.prototype,"capabilities",void 0);jt=L([J(),$("design:paramtypes",[String,String,String,Array,String])],jt);var _n=class{constructor(e,t,n,i){this.requestId=e,this.auth=t,this.token=n,this.revoked=i}};L([v(),$("design:type",String)],_n.prototype,"requestId",void 0);L([v(),$("design:type",String)],_n.prototype,"token",void 0);L([v(),$("design:type",Boolean)],_n.prototype,"revoked",void 0);L([v(),$("design:type",jt)],_n.prototype,"auth",void 0);_n=L([J(),$("design:paramtypes",[String,jt,String,Boolean])],_n);var En=class{constructor(e,t){this.domain=e,this.pointers=t}};L([v(),$("design:type",String)],En.prototype,"domain",void 0);L([v(),$("design:type",Array)],En.prototype,"pointers",void 0);En=L([Ge(),$("design:paramtypes",[String,Array])],En);var Ba=class{constructor(e,t){this.with=e,this.can=t}};L([v(),$("design:type",En)],Ba.prototype,"with",void 0);L([v(),$("design:type",Array)],Ba.prototype,"can",void 0);Ba=L([Ge(),$("design:paramtypes",[En,Array])],Ba);var cr=class{constructor(e,t,n,i,a,o){this.appName=e,this.appDesc=t,this.appUrl=i,this.appDomain=n,this.capabilities=o,this.appIconPath=a}};L([v(),$("design:type",String)],cr.prototype,"appName",void 0);L([v(),$("design:type",String)],cr.prototype,"appDesc",void 0);L([v(),$("design:type",String)],cr.prototype,"appDomain",void 0);L([v(),$("design:type",String)],cr.prototype,"appUrl",void 0);L([v(),$("design:type",String)],cr.prototype,"appIconPath",void 0);L([v(),$("design:type",Array)],cr.prototype,"capabilities",void 0);cr=L([Ge(),$("design:paramtypes",[String,String,String,String,String,Array])],cr);var On=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},Tn=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},ut=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)}};On([v(),Tn("design:type",Boolean)],ut.prototype,"isInitialized",void 0);On([v(),Tn("design:type",Boolean)],ut.prototype,"isUnlocked",void 0);On([v(),Tn("design:type",String)],ut.prototype,"did",void 0);On([v(),Tn("design:type",String)],ut.prototype,"didDocument",void 0);On([v(),Tn("design:type",String)],ut.prototype,"error",void 0);ut=On([J(),Tn("design:paramtypes",[Object])],ut);var Kl=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ce=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Ye,Xe,Ks=class{constructor(e,t){Ye.set(this,void 0),Xe.set(this,void 0),Kl(this,Ye,e,"f"),Kl(this,Xe,t,"f")}async otherAgents(){return await Ce(this,Ye,"f").otherAgents(Ce(this,Xe,"f"))}async hasTelepresenceAdapter(){return await Ce(this,Ye,"f").hasTelepresenceAdapter(Ce(this,Xe,"f"))}async onlineAgents(){return await Ce(this,Ye,"f").onlineAgents(Ce(this,Xe,"f"))}async setOnlineStatus(e){return await Ce(this,Ye,"f").setOnlineStatus(Ce(this,Xe,"f"),e)}async setOnlineStatusU(e){return await Ce(this,Ye,"f").setOnlineStatusU(Ce(this,Xe,"f"),e)}async sendSignal(e,t){return await Ce(this,Ye,"f").sendSignal(Ce(this,Xe,"f"),e,t)}async sendSignalU(e,t){return await Ce(this,Ye,"f").sendSignalU(Ce(this,Xe,"f"),e,t)}async sendBroadcast(e){return await Ce(this,Ye,"f").sendBroadcast(Ce(this,Xe,"f"),e)}async sendBroadcastU(e){return await Ce(this,Ye,"f").sendBroadcastU(Ce(this,Xe,"f"),e)}async addSignalHandler(e){await Ce(this,Ye,"f").addSignalHandler(Ce(this,Xe,"f"),e)}removeSignalHandler(e){Ce(this,Ye,"f").removeSignalHandler(Ce(this,Xe,"f"),e)}};Ye=new WeakMap,Xe=new WeakMap;var Qr=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},Wr=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Ue=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)}};Qr([v(),Wr("design:type",String)],Ue.prototype,"source",void 0);Qr([v(),Wr("design:type",String)],Ue.prototype,"target",void 0);Qr([v(),Wr("design:type",String)],Ue.prototype,"predicate",void 0);Qr([v(),Wr("design:type",Date)],Ue.prototype,"fromDate",void 0);Qr([v(),Wr("design:type",Date)],Ue.prototype,"untilDate",void 0);Qr([v(),Wr("design:type",Number)],Ue.prototype,"limit",void 0);Ue=Qr([J(),Ge(),Wr("design:paramtypes",[Object])],Ue);var zl=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Je=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},gt,Lt;function Ls(r){return encodeURIComponent(r).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}var lt=class{constructor(){gt.set(this,void 0),Lt.set(this,void 0)}static fromUrl(e){if(!e||!e.startsWith("literal://"))throw new Error("Can't create Literal from non-literal URL");let t=new lt;return zl(t,Lt,e,"f"),t}static from(e){let t=new lt;return zl(t,gt,e,"f"),t}toUrl(){if(Je(this,Lt,"f")&&!Je(this,gt,"f"))return Je(this,Lt,"f");if(!Je(this,Lt,"f")&&!Je(this,gt,"f"))throw new Error("Can't turn empty Literal into URL");let e;switch(typeof Je(this,gt,"f")){case"string":e=`string:${Ls(Je(this,gt,"f"))}`;break;case"number":e=`number:${Ls(Je(this,gt,"f"))}`;break;case"object":e=`json:${Ls(JSON.stringify(Je(this,gt,"f")))}`;break}return`literal://${e}`}get(){if(Je(this,gt,"f"))return Je(this,gt,"f");if(!Je(this,Lt,"f"))throw new Error("Can't render empty Literal");if(!Je(this,Lt,"f").startsWith("literal://"))throw new Error("Can't render Literal from non-literal URL");let e=Je(this,Lt,"f").substring(10);if(e.startsWith("string:"))return decodeURIComponent(e.substring(7));if(e.startsWith("number:")){let t=e.substring(7);return parseFloat(t)}if(e.startsWith("json:")){let t=e.substring(5);return JSON.parse(decodeURIComponent(t))}throw new Error(`Can't parse unknown literal: ${e}`)}};gt=new WeakMap,Lt=new WeakMap;function nr(r){return r.charAt(0).toUpperCase()+r.slice(1)}function Sf(r){return`set${nr(r)}`}function Mt(r){return r.endsWith("y")?r.slice(0,-1)+"ies":r+"s"}function nc(r){return r.endsWith("ies")?r.slice(0,-3)+"y":r.endsWith("s")?r.slice(0,-1):r}function D1(r){return`add${nr(nc(r))}`}function N1(r){let e=r.substring(3),t=Mt(e);return t.charAt(0).toLowerCase()+t.slice(1)}function P1(r){return`remove${nr(nc(r))}`}function R1(r){let e=r.substring(6),t=Mt(e);return t.charAt(0).toLowerCase()+t.slice(1)}function L1(r){let e=r.substring(13),t=Mt(e);return t.charAt(0).toLowerCase()+t.slice(1)}function F1(r){return`setCollection${nr(nc(r))}`}function Dr(r){if(Array.isArray(r))return`[${r.map(Dr).join(", ")}]`;let e=Object.keys(r),t=[];for(let n of e){let i=JSON.stringify(r[n]),a=`${n}: ${i}`;t.push(a)}return`{${t.join(", ")}}`}var Fs=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},q=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Be,Ve,de,Va=class{constructor(r,e,t){Be.set(this,void 0),Ve.set(this,void 0),de.set(this,void 0),Fs(this,Be,e,"f"),Fs(this,Ve,t,"f"),Fs(this,de,r,"f")}get baseExpression(){return q(this,Be,"f")}async init(){let isInstance=await q(this,de,"f").isSubjectInstance(q(this,Be,"f"),q(this,Ve,"f"));if(!isInstance)throw`Not a valid subject instance of ${q(this,Ve,"f")} for ${q(this,Be,"f")}`;let results=await q(this,de,"f").infer(`subject_class("${q(this,Ve,"f")}", C), property(C, Property)`),properties=results.map(r=>r.Property);for(let r of properties){let e=await q(this,de,"f").infer(`subject_class("${q(this,Ve,"f")}", C), property_resolve(C, "${r}")`);Object.defineProperty(this,r,{configurable:!0,get:async()=>{let t=await q(this,de,"f").infer(`subject_class("${q(this,Ve,"f")}", C), property_getter(C, "${q(this,Be,"f")}", "${r}", Value)`);if(t&&t.length>0){let n=t[0].Value;if(e)try{let i=await q(this,de,"f").getExpression(n);try{return JSON.parse(i.data)}catch{return i.data}}catch{return n}else return n}else return t||void 0}})}let setters=await q(this,de,"f").infer(`subject_class("${q(this,Ve,"f")}", C), property_setter(C, Property, Setter)`);for(let setter of setters||[])if(setter){let property=setter.Property,actions=eval(setter.Setter),resolveLanguageResults=await q(this,de,"f").infer(`subject_class("${q(this,Ve,"f")}", C), property_resolve_language(C, "${property}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),this[Sf(property)]=async r=>{resolveLanguage&&(r=await q(this,de,"f").createExpression(r,resolveLanguage)),await q(this,de,"f").executeAction(actions,q(this,Be,"f"),[{name:"value",value:r}])}}let results2=await q(this,de,"f").infer(`subject_class("${q(this,Ve,"f")}", C), collection(C, Collection)`);results2||(results2=[]);let collections=results2.map(r=>r.Collection);for(let r of collections)Object.defineProperty(this,r,{configurable:!0,get:async()=>{let e=await q(this,de,"f").infer(`subject_class("${q(this,Ve,"f")}", C), collection_getter(C, "${q(this,Be,"f")}", "${r}", Value)`);return e&&e.length>0&&e[0].Value?e[0].Value.filter(n=>n!==""&&n!==""):[]}});let adders=await q(this,de,"f").infer(`subject_class("${q(this,Ve,"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[D1(collection)]=async r=>{Array.isArray(r)?await Promise.all(r.map(e=>q(this,de,"f").executeAction(actions,q(this,Be,"f"),[{name:"value",value:e}]))):await q(this,de,"f").executeAction(actions,q(this,Be,"f"),[{name:"value",value:r}])}}let removers=await q(this,de,"f").infer(`subject_class("${q(this,Ve,"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[P1(collection)]=async r=>{Array.isArray(r)?await Promise.all(r.map(e=>q(this,de,"f").executeAction(actions,q(this,Be,"f"),[{name:"value",value:e}]))):await q(this,de,"f").executeAction(actions,q(this,Be,"f"),[{name:"value",value:r}])}}let collectionSetters=await q(this,de,"f").infer(`subject_class("${q(this,Ve,"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[F1(collection)]=async r=>{Array.isArray(r)?await q(this,de,"f").executeAction(actions,q(this,Be,"f"),r.map(e=>({name:"value",value:e}))):await q(this,de,"f").executeAction(actions,q(this,Be,"f"),[{name:"value",value:r}])}}}};Be=new WeakMap,Ve=new WeakMap,de=new WeakMap;var mn=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},F=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},he,Oe,Nr,Pr,Rr,ai,Sn=class{constructor(r,e){he.set(this,void 0),Oe.set(this,void 0),Nr.set(this,void 0),Pr.set(this,void 0),Rr.set(this,void 0),ai.set(this,void 0),mn(this,Nr,[],"f"),mn(this,Pr,[],"f"),mn(this,Rr,[],"f"),mn(this,ai,[],"f"),mn(this,he,r,"f"),mn(this,Oe,e,"f"),F(this,Oe,"f").addPerspectiveLinkAddedListener(F(this,he,"f").uuid,F(this,Nr,"f")),F(this,Oe,"f").addPerspectiveLinkRemovedListener(F(this,he,"f").uuid,F(this,Pr,"f")),F(this,Oe,"f").addPerspectiveLinkUpdatedListener(F(this,he,"f").uuid,F(this,Rr,"f")),F(this,Oe,"f").addPerspectiveSyncStateChangeListener(F(this,he,"f").uuid,F(this,ai,"f"))}async executeAction(r,e,t){let n=a=>{if(a)return a==="this"?e:a},i=a=>{if(t){let o=a;for(let s of t)o=o.replace(s.name,s.value);return o}else return a};for(let a of r){let o=n(i(a.source)),s=n(i(a.predicate)),u=n(i(a.target)),l=a?.local??!1;switch(a.action){case"addLink":await this.add(new ct({source:o,predicate:s,target:u}),l?"local":"shared");break;case"removeLink":let f=await this.get(new Ue({source:o,predicate:s,target:u}));for(let h of f)await this.remove(h);break;case"setSingleTarget":await this.setSingleTarget(new ct({source:o,predicate:s,target:u}),l?"local":"shared");break;case"collectionSetter":let p=await this.get(new Ue({source:o,predicate:s}));await this.removeLinks(p),await this.addLinks(t.map(h=>new ct({source:o,predicate:s,target:h.value})),l?"local":"shared");break}}}get uuid(){return F(this,he,"f").uuid}get name(){return F(this,he,"f").name}get sharedUrl(){return F(this,he,"f").sharedUrl}get neighbourhood(){return F(this,he,"f").neighbourhood}get state(){return F(this,he,"f").state}async get(r){return await F(this,Oe,"f").queryLinks(F(this,he,"f").uuid,r)}async infer(r){return await F(this,Oe,"f").queryProlog(F(this,he,"f").uuid,r)}async add(r,e="shared"){return await F(this,Oe,"f").addLink(F(this,he,"f").uuid,r,e)}async addLinks(r,e="shared"){return await F(this,Oe,"f").addLinks(F(this,he,"f").uuid,r,e)}async removeLinks(r){return await F(this,Oe,"f").removeLinks(F(this,he,"f").uuid,r)}async linkMutations(r,e="shared"){return await F(this,Oe,"f").linkMutations(F(this,he,"f").uuid,r,e)}async addLinkExpression(r,e="shared"){return await F(this,Oe,"f").addLinkExpression(F(this,he,"f").uuid,r,e)}async update(r,e){return await F(this,Oe,"f").updateLink(F(this,he,"f").uuid,r,e)}async remove(r){return await F(this,Oe,"f").removeLink(F(this,he,"f").uuid,r)}async getExpression(r){return await F(this,Oe,"f").getExpression(r)}async createExpression(r,e){return await F(this,Oe,"f").createExpression(r,e)}async addListener(r,e){r==="link-added"?F(this,Nr,"f").push(e):r==="link-removed"?F(this,Pr,"f").push(e):r==="link-updated"&&F(this,Rr,"f").push(e)}async addSyncStateChangeListener(r){F(this,ai,"f").push(r)}async removeListener(r,e){if(r==="link-added"){let t=F(this,Nr,"f").indexOf(e);F(this,Nr,"f").splice(t,1)}else if(r==="link-removed"){let t=F(this,Pr,"f").indexOf(e);F(this,Pr,"f").splice(t,1)}else if(r==="link-updated"){let t=F(this,Rr,"f").indexOf(e);F(this,Rr,"f").splice(t,1)}}async snapshot(){return F(this,Oe,"f").snapshotByUUID(F(this,he,"f").uuid)}async loadSnapshot(r){let e=JSON.parse(JSON.stringify(r));delete e.__typename,e.links.forEach(t=>{delete t.data.__typename});for(let t of e.links)await this.addLinkExpression(t)}async getSingleTarget(r){delete r.target;let e=await this.get(r);return e.length?e[0].data.target:null}async setSingleTarget(r,e="shared"){let t=new Ue({source:r.source,predicate:r.predicate}),n=await this.get(t),i=[];for(let o of n)delete o.__typename,delete o.data.__typename,delete o.proof.__typename,i.push(o);let a=[r];await this.linkMutations({additions:a,removals:i},e)}async sdnaFlows(){return(await this.infer("register_sdna_flow(X, _)")).map(e=>e.X)}async availableFlows(r){return(await this.infer(`flowable("${r}", F), register_sdna_flow(X, F)`)).map(t=>t.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(r,e){return(await this.infer(`register_sdna_flow("${r}", F), flow_state(X, ${e}, F)`)).map(n=>n.X)}async flowState(r,e){return(await this.infer(`register_sdna_flow("${r}", F), flow_state("${e}", X, F)`))[0].X}async flowActions(r,e){return(await this.infer(`register_sdna_flow("${r}", 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(){return(await this.get(new Ue({predicate:"ad4m://sdna"}))).map(e=>e.data.target).map(e=>lt.fromUrl(e).get())}async addSdna(r,e,t){let n="ad4m://has_custom_sdna";t==="subject_class"?n="ad4m://has_subject_class":t==="flow"&&(n="ad4m://has_flow");let i=lt.from(r).toUrl(),a=await this.get(new Ue({source:"ad4m://self",predicate:n,target:i})),o=[];a.length===0&&o.push(new ct({source:"ad4m://self",predicate:n,target:i})),o.push(new ct({source:i,predicate:"ad4m://sdna",target:lt.from(e).toUrl()})),await this.addLinks(o)}async subjectClasses(){try{return(await this.infer("subject_class(X, _)")).map(r=>r.X)}catch{return[]}}async stringOrTemplateObjectToSubjectClass(r){if(typeof r=="string")return r;{let e=await this.subjectClassesByTemplate(r);return e[0]?e[0]:r.className}}async createSubject(subjectClass,exprAddr){let className=await this.stringOrTemplateObjectToSubjectClass(subjectClass),result=await this.infer(`subject_class("${className}", C), constructor(C, Actions)`);if(!result.length)throw"No constructor found for given subject class: "+className;let actions=result.map(x=>eval(x.Actions));return await this.executeAction(actions[0],exprAddr,void 0),this.getSubjectProxy(exprAddr,subjectClass)}async removeSubject(subjectClass,exprAddr){let className=await this.stringOrTemplateObjectToSubjectClass(subjectClass),result=await this.infer(`subject_class("${className}", C), destructor(C, Actions)`);if(!result.length)throw"No constructor found for given subject class: "+className;let actions=result.map(x=>eval(x.Actions));await this.executeAction(actions[0],exprAddr,void 0)}async isSubjectInstance(r,e){let t=await this.stringOrTemplateObjectToSubjectClass(e);return await this.infer(`subject_class("${t}", C), instance(C, "${r}")`)}async getSubjectProxy(r,e){if(!await this.isSubjectInstance(r,e))throw`Expression ${r} is not a subject instance of given class: ${JSON.stringify(e)}`;let t=await this.stringOrTemplateObjectToSubjectClass(e),n=new Va(this,r,t);return await n.init(),n}async getAllSubjectInstances(r){let e=[];typeof r=="string"?e=[r]:e=await this.subjectClassesByTemplate(r);let t=[];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)));t=t.concat(a)}return t}async getAllSubjectProxies(r){let e=[];typeof r=="string"?e=[r]:e=await this.subjectClassesByTemplate(r);let t=[];for(let n of e)t=await this.infer(`subject_class("${n}", C), instance(C, X)`);return t}async subjectClassesByTemplate(r){let e=[],t=[];Object.getPrototypeOf(r).__properties?Object.keys(Object.getPrototypeOf(r).__properties).forEach(l=>e.push(l)):e.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=>!t.includes(l)):t.push(...Object.keys(r).filter(l=>Array.isArray(r[l])).filter(l=>l!=="isSubjectInstance"));let n=Object.getOwnPropertyNames(r).filter(l=>typeof r[l]=="function"&&l.startsWith("set")&&!l.startsWith("setCollection"));n=n.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>typeof r[l]=="function"&&l.startsWith("set")&&!l.startsWith("setCollection")));let i=Object.getOwnPropertyNames(r).filter(l=>typeof r[l]=="function"&&l.startsWith("add"));i=i.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>typeof r[l]=="function"&&l.startsWith("add")));let a=Object.getOwnPropertyNames(r).filter(l=>typeof r[l]=="function"&&l.startsWith("remove"));a=a.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>typeof r[l]=="function"&&l.startsWith("remove")));let o=Object.getOwnPropertyNames(r).filter(l=>typeof r[l]=="function"&&l.startsWith("setCollection"));o=o.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>typeof r[l]=="function"&&l.startsWith("setCollection")));let s="subject_class(Class, C)";for(let l of e)s+=`, property(C, "${l}")`;for(let l of t)s+=`, collection(C, "${l}")`;for(let l of n){let f=l.substring(3);f=f.charAt(0).toLowerCase()+f.slice(1),s+=`, property_setter(C, "${f}", _)`}for(let l of i)s+=`, collection_adder(C, "${N1(l)}", _)`;for(let l of a)s+=`, collection_remover(C, "${R1(l)}", _)`;for(let l of o)s+=`, collection_setter(C, "${L1(l)}", _)`;s+=".";let u=await this.infer(s);return u?u.map(l=>l.Class):[]}async ensureSDNASubjectClass(r){if((await this.subjectClassesByTemplate(new r)).length>0)return;let{name:t,sdna:n}=r.generateSDNA();await this.addSdna(t,n,"subject_class")}getNeighbourhoodProxy(){return F(this,Oe,"f").getNeighbourhoodProxy(F(this,he,"f").uuid)}};he=new WeakMap,Oe=new WeakMap,Nr=new WeakMap,Pr=new WeakMap,Rr=new WeakMap,ai=new WeakMap;var Ar=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},H=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ce,oi,si,ci,Aa,ui,Ia,rt=`
63
+ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||Us.set(i,o=new Set),o.add(a),e.has(a)||(e.add(a),t.push(n))}else t.push(n)}),Ra(Ra({},r),{definitions:t})}function w1(r){var e=new Set(r.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 t=r.loc;return t&&(delete t.startToken,delete t.endToken),r}function _1(r){var e=gf(r);if(!Ta.has(e)){var t=v1(r,{experimentalFragmentVariables:La,allowLegacyFragmentVariables:La});if(!t||t.kind!=="Document")throw new Error("Not a valid GraphQL document.");Ta.set(e,w1(S1(t)))}return Ta.get(e)}function E(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];typeof r=="string"&&(r=[r]);var n=r[0];return e.forEach(function(i,a){i&&i.kind==="Document"?n+=i.loc.source.body:n+=i,n+=r[a+1]}),_1(n)}function E1(){Ta.clear(),Us.clear()}function x1(){yf=!1}function O1(){La=!0}function T1(){La=!1}var ri={gql:E,resetCaches:E1,disableFragmentWarnings:x1,enableExperimentalFragmentVariables:O1,disableExperimentalFragmentVariables:T1};(function(r){r.gql=ri.gql,r.resetCaches=ri.resetCaches,r.disableFragmentWarnings=ri.disableFragmentWarnings,r.enableExperimentalFragmentVariables=ri.enableExperimentalFragmentVariables,r.disableExperimentalFragmentVariables=ri.disableExperimentalFragmentVariables})(E||(E={}));E.default=E;function A(r){if(r.error)throw r.error;if(r.errors)throw r.errors;return r.data}function A1(){}function Zs(){return A1}var v=Zs,Ge=Zs,J=Zs,vf=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},bf=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},jr=class{constructor(e){this.code=e}};vf([v(),bf("design:type",String)],jr.prototype,"code",void 0);jr=vf([J(),bf("design:paramtypes",[String])],jr);var ec=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},tc=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Tt=class{constructor(e,t){this.address=e,this.name=t}};ec([v(),tc("design:type",String)],Tt.prototype,"address",void 0);ec([v(),tc("design:type",String)],Tt.prototype,"name",void 0);Tt=ec([J(),tc("design:paramtypes",[String,String])],Tt);var fe=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},Te=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},ir=class{constructor(e,t){this.key=t,this.signature=e}};fe([v(),Te("design:type",String)],ir.prototype,"signature",void 0);fe([v(),Te("design:type",String)],ir.prototype,"key",void 0);fe([v(),Te("design:type",Boolean)],ir.prototype,"valid",void 0);fe([v(),Te("design:type",Boolean)],ir.prototype,"invalid",void 0);ir=fe([J(),Ge(),Te("design:paramtypes",[String,String])],ir);var Ur=class{};fe([v(),Te("design:type",String)],Ur.prototype,"signature",void 0);fe([v(),Te("design:type",String)],Ur.prototype,"key",void 0);fe([v(),Te("design:type",Boolean)],Ur.prototype,"valid",void 0);fe([v(),Te("design:type",Boolean)],Ur.prototype,"invalid",void 0);Ur=fe([Ge()],Ur);function lr(r){let e=class{constructor(n,i,a,o){this.author=n,this.timestamp=i,this.data=a,this.proof=o}};return fe([v(),Te("design:type",String)],e.prototype,"author",void 0),fe([v(),Te("design:type",String)],e.prototype,"timestamp",void 0),fe([v(),Te("design:type",Object)],e.prototype,"data",void 0),fe([v(),Te("design:type",ir)],e.prototype,"proof",void 0),e=fe([J(),Te("design:paramtypes",[String,String,Object,ir])],e),e}function I1(r){let e=class{};return fe([v(),Te("design:type",String)],e.prototype,"author",void 0),fe([v(),Te("design:type",String)],e.prototype,"timestamp",void 0),fe([v(),Te("design:type",Object)],e.prototype,"data",void 0),fe([v(),Te("design:type",Ur)],e.prototype,"proof",void 0),e=fe([Ge()],e),e}var Ql=class extends lr(){};Ql=fe([J()],Ql);var Fa=class extends lr(){};fe([v(),Te("design:type",Tt)],Fa.prototype,"language",void 0);fe([v(),Te("design:type",jr)],Fa.prototype,"icon",void 0);Fa=fe([J()],Fa);function _6(r){return r&&r.author&&r.timestamp&&r.data}var _e=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},$e=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},ct=class{constructor(e){this.source=e.source?e.source:"",this.target=e.target?e.target:"",this.predicate=e.predicate?e.predicate:""}};_e([v(),$e("design:type",String)],ct.prototype,"source",void 0);_e([v(),$e("design:type",String)],ct.prototype,"target",void 0);_e([v(),$e("design:type",String)],ct.prototype,"predicate",void 0);ct=_e([J(),$e("design:paramtypes",[Object])],ct);var $a=class{};_e([v(),$e("design:type",Array)],$a.prototype,"additions",void 0);_e([v(),$e("design:type",Array)],$a.prototype,"removals",void 0);$a=_e([Ge()],$a);var Ma=class{constructor(e,t){this.additions=e,this.removals=t}};_e([v(),$e("design:type",Array)],Ma.prototype,"additions",void 0);_e([v(),$e("design:type",Array)],Ma.prototype,"removals",void 0);Ma=_e([J(),$e("design:paramtypes",[Array,Array])],Ma);var Ci=class{};_e([v(),$e("design:type",String)],Ci.prototype,"source",void 0);_e([v(),$e("design:type",String)],Ci.prototype,"target",void 0);_e([v(),$e("design:type",String)],Ci.prototype,"predicate",void 0);Ci=_e([Ge()],Ci);var qr=class extends lr(){hash(){let e=JSON.stringify(this.data,Object.keys(this.data).sort())+JSON.stringify(this.author)+this.timestamp,t=0,n,i;for(n=0;n<e.length;n++)i=e.charCodeAt(n),t=(t<<5)-t+i,t|=0;return t}};_e([v(),$e("design:type",String)],qr.prototype,"status",void 0);qr=_e([J()],qr);var qs=class extends I1(){};_e([v(),$e("design:type",String)],qs.prototype,"status",void 0);qs=_e([Ge()],qs);function k6(r,e){return r.author==e.author&&r.timestamp==e.timestamp&&r.data.source==e.data.source&&r.data.predicate==e.data.predicate&&r.data.target==e.data.target}function D6(r){return r&&r.source&&r.target}var ja=class{constructor(e,t){this.oldLink=e,this.newLink=t}};_e([v(),$e("design:type",qr)],ja.prototype,"oldLink",void 0);_e([v(),$e("design:type",qr)],ja.prototype,"newLink",void 0);ja=_e([J(),$e("design:paramtypes",[qr,qr])],ja);var Vr=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},Ei=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Bs,ar=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 t=JSON.parse(JSON.stringify(this.links));return t=t.filter(n=>n.data.predicate===e.predicate),e.limit&&(t=t.slice(0,e.limit)),t}getSingleTarget(e){delete e.target;let t=this.get(e);return t.length?t[0].data.target:null}};Vr([v(),Ei("design:type",Array)],ar.prototype,"links",void 0);ar=Vr([J(),Ei("design:paramtypes",[Array])],ar);var Vs=class{};Vr([v(),Ei("design:type",Array)],Vs.prototype,"links",void 0);Vs=Vr([Ge()],Vs);var Qs=Bs=class{constructor(e){e?this.links=e:this.links=[]}static fromLink(e){let t=new Bs;return t.links.push(e),t}};Vr([v(),Ei("design:type",Array)],Qs.prototype,"links",void 0);Qs=Bs=Vr([Ge(),Ei("design:paramtypes",[Array])],Qs);var Ws=class extends lr(){};Ws=Vr([J()],Ws);var L=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},$=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},rr=class{constructor(e,t){this.did=e,t?this.perspective=t:this.perspective=new ar}};L([v(),$("design:type",String)],rr.prototype,"did",void 0);L([v(),$("design:type",ar)],rr.prototype,"perspective",void 0);L([v(),$("design:type",String)],rr.prototype,"directMessageLanguage",void 0);rr=L([J(),$("design:paramtypes",[String,ar])],rr);var Wl=class extends lr(){};Wl=L([J()],Wl);var or=class{constructor(e,t,n,i,a,o){this.did=e,this.didSigningKeyId=t,this.deviceKeyType=n,this.deviceKey=i,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};L([v(),$("design:type",String)],or.prototype,"did",void 0);L([v(),$("design:type",String)],or.prototype,"didSigningKeyId",void 0);L([v(),$("design:type",String)],or.prototype,"deviceKeyType",void 0);L([v(),$("design:type",String)],or.prototype,"deviceKey",void 0);L([v(),$("design:type",String)],or.prototype,"deviceKeySignedByDid",void 0);L([v(),$("design:type",String)],or.prototype,"didSignedByDeviceKey",void 0);or=L([J(),$("design:paramtypes",[String,String,String,String,String,String])],or);var sr=class{constructor(e,t,n,i,a,o){this.did=e,this.didSigningKeyId=t,this.deviceKeyType=n,this.deviceKey=i,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};L([v(),$("design:type",String)],sr.prototype,"did",void 0);L([v(),$("design:type",String)],sr.prototype,"didSigningKeyId",void 0);L([v(),$("design:type",String)],sr.prototype,"deviceKeyType",void 0);L([v(),$("design:type",String)],sr.prototype,"deviceKey",void 0);L([v(),$("design:type",String)],sr.prototype,"deviceKeySignedByDid",void 0);L([v(),$("design:type",String)],sr.prototype,"didSignedByDeviceKey",void 0);sr=L([Ge(),$("design:paramtypes",[String,String,String,String,String,String])],sr);var Ua=class{constructor(e,t){this.signature=e,this.publicKey=t}};L([v(),$("design:type",String)],Ua.prototype,"signature",void 0);L([v(),$("design:type",String)],Ua.prototype,"publicKey",void 0);Ua=L([J(),$("design:paramtypes",[String,String])],Ua);var wn=class{constructor(e,t){this.domain=e,this.pointers=t}};L([v(),$("design:type",String)],wn.prototype,"domain",void 0);L([v(),$("design:type",Array)],wn.prototype,"pointers",void 0);wn=L([J(),$("design:paramtypes",[String,Array])],wn);var qa=class{constructor(e,t){this.with=e,this.can=t}};L([v(),$("design:type",wn)],qa.prototype,"with",void 0);L([v(),$("design:type",Array)],qa.prototype,"can",void 0);qa=L([J(),$("design:paramtypes",[wn,Array])],qa);var jt=class{constructor(e,t,n,i,a){this.appName=e,this.appDesc=t,this.appIconPath=a,this.appUrl=n,this.capabilities=i}};L([v(),$("design:type",String)],jt.prototype,"appName",void 0);L([v(),$("design:type",String)],jt.prototype,"appDesc",void 0);L([v(),$("design:type",String)],jt.prototype,"appUrl",void 0);L([v(),$("design:type",String)],jt.prototype,"appIconPath",void 0);L([v(),$("design:type",Array)],jt.prototype,"capabilities",void 0);jt=L([J(),$("design:paramtypes",[String,String,String,Array,String])],jt);var _n=class{constructor(e,t,n,i){this.requestId=e,this.auth=t,this.token=n,this.revoked=i}};L([v(),$("design:type",String)],_n.prototype,"requestId",void 0);L([v(),$("design:type",String)],_n.prototype,"token",void 0);L([v(),$("design:type",Boolean)],_n.prototype,"revoked",void 0);L([v(),$("design:type",jt)],_n.prototype,"auth",void 0);_n=L([J(),$("design:paramtypes",[String,jt,String,Boolean])],_n);var En=class{constructor(e,t){this.domain=e,this.pointers=t}};L([v(),$("design:type",String)],En.prototype,"domain",void 0);L([v(),$("design:type",Array)],En.prototype,"pointers",void 0);En=L([Ge(),$("design:paramtypes",[String,Array])],En);var Ba=class{constructor(e,t){this.with=e,this.can=t}};L([v(),$("design:type",En)],Ba.prototype,"with",void 0);L([v(),$("design:type",Array)],Ba.prototype,"can",void 0);Ba=L([Ge(),$("design:paramtypes",[En,Array])],Ba);var cr=class{constructor(e,t,n,i,a,o){this.appName=e,this.appDesc=t,this.appUrl=i,this.appDomain=n,this.capabilities=o,this.appIconPath=a}};L([v(),$("design:type",String)],cr.prototype,"appName",void 0);L([v(),$("design:type",String)],cr.prototype,"appDesc",void 0);L([v(),$("design:type",String)],cr.prototype,"appDomain",void 0);L([v(),$("design:type",String)],cr.prototype,"appUrl",void 0);L([v(),$("design:type",String)],cr.prototype,"appIconPath",void 0);L([v(),$("design:type",Array)],cr.prototype,"capabilities",void 0);cr=L([Ge(),$("design:paramtypes",[String,String,String,String,String,Array])],cr);var On=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},Tn=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},ut=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)}};On([v(),Tn("design:type",Boolean)],ut.prototype,"isInitialized",void 0);On([v(),Tn("design:type",Boolean)],ut.prototype,"isUnlocked",void 0);On([v(),Tn("design:type",String)],ut.prototype,"did",void 0);On([v(),Tn("design:type",String)],ut.prototype,"didDocument",void 0);On([v(),Tn("design:type",String)],ut.prototype,"error",void 0);ut=On([J(),Tn("design:paramtypes",[Object])],ut);var Gl=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ce=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Ye,Xe,Gs=class{constructor(e,t){Ye.set(this,void 0),Xe.set(this,void 0),Gl(this,Ye,e,"f"),Gl(this,Xe,t,"f")}async otherAgents(){return await Ce(this,Ye,"f").otherAgents(Ce(this,Xe,"f"))}async hasTelepresenceAdapter(){return await Ce(this,Ye,"f").hasTelepresenceAdapter(Ce(this,Xe,"f"))}async onlineAgents(){return await Ce(this,Ye,"f").onlineAgents(Ce(this,Xe,"f"))}async setOnlineStatus(e){return await Ce(this,Ye,"f").setOnlineStatus(Ce(this,Xe,"f"),e)}async setOnlineStatusU(e){return await Ce(this,Ye,"f").setOnlineStatusU(Ce(this,Xe,"f"),e)}async sendSignal(e,t){return await Ce(this,Ye,"f").sendSignal(Ce(this,Xe,"f"),e,t)}async sendSignalU(e,t){return await Ce(this,Ye,"f").sendSignalU(Ce(this,Xe,"f"),e,t)}async sendBroadcast(e){return await Ce(this,Ye,"f").sendBroadcast(Ce(this,Xe,"f"),e)}async sendBroadcastU(e){return await Ce(this,Ye,"f").sendBroadcastU(Ce(this,Xe,"f"),e)}async addSignalHandler(e){await Ce(this,Ye,"f").addSignalHandler(Ce(this,Xe,"f"),e)}removeSignalHandler(e){Ce(this,Ye,"f").removeSignalHandler(Ce(this,Xe,"f"),e)}};Ye=new WeakMap,Xe=new WeakMap;var Qr=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},Wr=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Ue=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)}};Qr([v(),Wr("design:type",String)],Ue.prototype,"source",void 0);Qr([v(),Wr("design:type",String)],Ue.prototype,"target",void 0);Qr([v(),Wr("design:type",String)],Ue.prototype,"predicate",void 0);Qr([v(),Wr("design:type",Date)],Ue.prototype,"fromDate",void 0);Qr([v(),Wr("design:type",Date)],Ue.prototype,"untilDate",void 0);Qr([v(),Wr("design:type",Number)],Ue.prototype,"limit",void 0);Ue=Qr([J(),Ge(),Wr("design:paramtypes",[Object])],Ue);var Kl=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Je=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},gt,Lt;function Rs(r){return encodeURIComponent(r).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}var lt=class{constructor(){gt.set(this,void 0),Lt.set(this,void 0)}static fromUrl(e){if(!e||!e.startsWith("literal://"))throw new Error("Can't create Literal from non-literal URL");let t=new lt;return Kl(t,Lt,e,"f"),t}static from(e){let t=new lt;return Kl(t,gt,e,"f"),t}toUrl(){if(Je(this,Lt,"f")&&!Je(this,gt,"f"))return Je(this,Lt,"f");if(!Je(this,Lt,"f")&&!Je(this,gt,"f"))throw new Error("Can't turn empty Literal into URL");let e;switch(typeof Je(this,gt,"f")){case"string":e=`string:${Rs(Je(this,gt,"f"))}`;break;case"number":e=`number:${Rs(Je(this,gt,"f"))}`;break;case"object":e=`json:${Rs(JSON.stringify(Je(this,gt,"f")))}`;break}return`literal://${e}`}get(){if(Je(this,gt,"f"))return Je(this,gt,"f");if(!Je(this,Lt,"f"))throw new Error("Can't render empty Literal");if(!Je(this,Lt,"f").startsWith("literal://"))throw new Error("Can't render Literal from non-literal URL");let e=Je(this,Lt,"f").substring(10);if(e.startsWith("string:"))return decodeURIComponent(e.substring(7));if(e.startsWith("number:")){let t=e.substring(7);return parseFloat(t)}if(e.startsWith("json:")){let t=e.substring(5);return JSON.parse(decodeURIComponent(t))}throw new Error(`Can't parse unknown literal: ${e}`)}};gt=new WeakMap,Lt=new WeakMap;function nr(r){return r.charAt(0).toUpperCase()+r.slice(1)}function Cf(r){return`set${nr(r)}`}function Mt(r){return r.endsWith("y")?r.slice(0,-1)+"ies":r+"s"}function rc(r){return r.endsWith("ies")?r.slice(0,-3)+"y":r.endsWith("s")?r.slice(0,-1):r}function k1(r){return`add${nr(rc(r))}`}function D1(r){let e=r.substring(3),t=Mt(e);return t.charAt(0).toLowerCase()+t.slice(1)}function P1(r){return`remove${nr(rc(r))}`}function N1(r){let e=r.substring(6),t=Mt(e);return t.charAt(0).toLowerCase()+t.slice(1)}function R1(r){let e=r.substring(13),t=Mt(e);return t.charAt(0).toLowerCase()+t.slice(1)}function L1(r){return`setCollection${nr(rc(r))}`}function Dr(r){if(Array.isArray(r))return`[${r.map(Dr).join(", ")}]`;let e=Object.keys(r),t=[];for(let n of e){let i=JSON.stringify(r[n]),a=`${n}: ${i}`;t.push(a)}return`{${t.join(", ")}}`}var Ls=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},q=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Be,Ve,de,Va=class{constructor(r,e,t){Be.set(this,void 0),Ve.set(this,void 0),de.set(this,void 0),Ls(this,Be,e,"f"),Ls(this,Ve,t,"f"),Ls(this,de,r,"f")}get baseExpression(){return q(this,Be,"f")}async init(){let isInstance=await q(this,de,"f").isSubjectInstance(q(this,Be,"f"),q(this,Ve,"f"));if(!isInstance)throw`Not a valid subject instance of ${q(this,Ve,"f")} for ${q(this,Be,"f")}`;let results=await q(this,de,"f").infer(`subject_class("${q(this,Ve,"f")}", C), property(C, Property)`),properties=results.map(r=>r.Property);for(let r of properties){let e=await q(this,de,"f").infer(`subject_class("${q(this,Ve,"f")}", C), property_resolve(C, "${r}")`);Object.defineProperty(this,r,{configurable:!0,get:async()=>{let t=await q(this,de,"f").infer(`subject_class("${q(this,Ve,"f")}", C), property_getter(C, "${q(this,Be,"f")}", "${r}", Value)`);if(t&&t.length>0){let n=t[0].Value;if(e)try{let i=await q(this,de,"f").getExpression(n);try{return JSON.parse(i.data)}catch{return i.data}}catch{return n}else return n}else return t||void 0}})}let setters=await q(this,de,"f").infer(`subject_class("${q(this,Ve,"f")}", C), property_setter(C, Property, Setter)`);for(let setter of setters||[])if(setter){let property=setter.Property,actions=eval(setter.Setter),resolveLanguageResults=await q(this,de,"f").infer(`subject_class("${q(this,Ve,"f")}", C), property_resolve_language(C, "${property}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),this[Cf(property)]=async r=>{resolveLanguage&&(r=await q(this,de,"f").createExpression(r,resolveLanguage)),await q(this,de,"f").executeAction(actions,q(this,Be,"f"),[{name:"value",value:r}])}}let results2=await q(this,de,"f").infer(`subject_class("${q(this,Ve,"f")}", C), collection(C, Collection)`);results2||(results2=[]);let collections=results2.map(r=>r.Collection);for(let r of collections)Object.defineProperty(this,r,{configurable:!0,get:async()=>{let e=await q(this,de,"f").infer(`subject_class("${q(this,Ve,"f")}", C), collection_getter(C, "${q(this,Be,"f")}", "${r}", Value)`);return e&&e.length>0&&e[0].Value?e[0].Value.filter(n=>n!==""&&n!==""):[]}});let adders=await q(this,de,"f").infer(`subject_class("${q(this,Ve,"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[k1(collection)]=async r=>{Array.isArray(r)?await Promise.all(r.map(e=>q(this,de,"f").executeAction(actions,q(this,Be,"f"),[{name:"value",value:e}]))):await q(this,de,"f").executeAction(actions,q(this,Be,"f"),[{name:"value",value:r}])}}let removers=await q(this,de,"f").infer(`subject_class("${q(this,Ve,"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[P1(collection)]=async r=>{Array.isArray(r)?await Promise.all(r.map(e=>q(this,de,"f").executeAction(actions,q(this,Be,"f"),[{name:"value",value:e}]))):await q(this,de,"f").executeAction(actions,q(this,Be,"f"),[{name:"value",value:r}])}}let collectionSetters=await q(this,de,"f").infer(`subject_class("${q(this,Ve,"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[L1(collection)]=async r=>{Array.isArray(r)?await q(this,de,"f").executeAction(actions,q(this,Be,"f"),r.map(e=>({name:"value",value:e}))):await q(this,de,"f").executeAction(actions,q(this,Be,"f"),[{name:"value",value:r}])}}}};Be=new WeakMap,Ve=new WeakMap,de=new WeakMap;var mn=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},F=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},he,Oe,Pr,Nr,Rr,ai,Sn=class{constructor(r,e){he.set(this,void 0),Oe.set(this,void 0),Pr.set(this,void 0),Nr.set(this,void 0),Rr.set(this,void 0),ai.set(this,void 0),mn(this,Pr,[],"f"),mn(this,Nr,[],"f"),mn(this,Rr,[],"f"),mn(this,ai,[],"f"),mn(this,he,r,"f"),mn(this,Oe,e,"f"),F(this,Oe,"f").addPerspectiveLinkAddedListener(F(this,he,"f").uuid,F(this,Pr,"f")),F(this,Oe,"f").addPerspectiveLinkRemovedListener(F(this,he,"f").uuid,F(this,Nr,"f")),F(this,Oe,"f").addPerspectiveLinkUpdatedListener(F(this,he,"f").uuid,F(this,Rr,"f")),F(this,Oe,"f").addPerspectiveSyncStateChangeListener(F(this,he,"f").uuid,F(this,ai,"f"))}async executeAction(r,e,t){let n=a=>{if(a)return a==="this"?e:a},i=a=>{if(t){let o=a;for(let s of t)o=o.replace(s.name,s.value);return o}else return a};for(let a of r){let o=n(i(a.source)),s=n(i(a.predicate)),u=n(i(a.target)),l=a?.local??!1;switch(a.action){case"addLink":await this.add(new ct({source:o,predicate:s,target:u}),l?"local":"shared");break;case"removeLink":let f=await this.get(new Ue({source:o,predicate:s,target:u}));for(let h of f)await this.remove(h);break;case"setSingleTarget":await this.setSingleTarget(new ct({source:o,predicate:s,target:u}),l?"local":"shared");break;case"collectionSetter":let p=await this.get(new Ue({source:o,predicate:s}));await this.removeLinks(p),await this.addLinks(t.map(h=>new ct({source:o,predicate:s,target:h.value})),l?"local":"shared");break}}}get uuid(){return F(this,he,"f").uuid}get name(){return F(this,he,"f").name}get sharedUrl(){return F(this,he,"f").sharedUrl}get neighbourhood(){return F(this,he,"f").neighbourhood}get state(){return F(this,he,"f").state}async get(r){return await F(this,Oe,"f").queryLinks(F(this,he,"f").uuid,r)}async infer(r){return await F(this,Oe,"f").queryProlog(F(this,he,"f").uuid,r)}async add(r,e="shared"){return await F(this,Oe,"f").addLink(F(this,he,"f").uuid,r,e)}async addLinks(r,e="shared"){return await F(this,Oe,"f").addLinks(F(this,he,"f").uuid,r,e)}async removeLinks(r){return await F(this,Oe,"f").removeLinks(F(this,he,"f").uuid,r)}async linkMutations(r,e="shared"){return await F(this,Oe,"f").linkMutations(F(this,he,"f").uuid,r,e)}async addLinkExpression(r,e="shared"){return await F(this,Oe,"f").addLinkExpression(F(this,he,"f").uuid,r,e)}async update(r,e){return await F(this,Oe,"f").updateLink(F(this,he,"f").uuid,r,e)}async remove(r){return await F(this,Oe,"f").removeLink(F(this,he,"f").uuid,r)}async getExpression(r){return await F(this,Oe,"f").getExpression(r)}async createExpression(r,e){return await F(this,Oe,"f").createExpression(r,e)}async addListener(r,e){r==="link-added"?F(this,Pr,"f").push(e):r==="link-removed"?F(this,Nr,"f").push(e):r==="link-updated"&&F(this,Rr,"f").push(e)}async addSyncStateChangeListener(r){F(this,ai,"f").push(r)}async removeListener(r,e){if(r==="link-added"){let t=F(this,Pr,"f").indexOf(e);F(this,Pr,"f").splice(t,1)}else if(r==="link-removed"){let t=F(this,Nr,"f").indexOf(e);F(this,Nr,"f").splice(t,1)}else if(r==="link-updated"){let t=F(this,Rr,"f").indexOf(e);F(this,Rr,"f").splice(t,1)}}async snapshot(){return F(this,Oe,"f").snapshotByUUID(F(this,he,"f").uuid)}async loadSnapshot(r){let e=JSON.parse(JSON.stringify(r));delete e.__typename,e.links.forEach(t=>{delete t.data.__typename});for(let t of e.links)await this.addLinkExpression(t)}async getSingleTarget(r){delete r.target;let e=await this.get(r);return e.length?e[0].data.target:null}async setSingleTarget(r,e="shared"){let t=new Ue({source:r.source,predicate:r.predicate}),n=await this.get(t),i=[];for(let o of n)delete o.__typename,delete o.data.__typename,delete o.proof.__typename,i.push(o);let a=[r];await this.linkMutations({additions:a,removals:i},e)}async sdnaFlows(){return(await this.infer("register_sdna_flow(X, _)")).map(e=>e.X)}async availableFlows(r){return(await this.infer(`flowable("${r}", F), register_sdna_flow(X, F)`)).map(t=>t.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(r,e){return(await this.infer(`register_sdna_flow("${r}", F), flow_state(X, ${e}, F)`)).map(n=>n.X)}async flowState(r,e){return(await this.infer(`register_sdna_flow("${r}", F), flow_state("${e}", X, F)`))[0].X}async flowActions(r,e){return(await this.infer(`register_sdna_flow("${r}", 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(){return(await this.get(new Ue({predicate:"ad4m://sdna"}))).map(e=>e.data.target).map(e=>lt.fromUrl(e).get())}async addSdna(r,e,t){let n="ad4m://has_custom_sdna";t==="subject_class"?n="ad4m://has_subject_class":t==="flow"&&(n="ad4m://has_flow");let i=lt.from(r).toUrl(),a=await this.get(new Ue({source:"ad4m://self",predicate:n,target:i})),o=[];a.length===0&&o.push(new ct({source:"ad4m://self",predicate:n,target:i})),o.push(new ct({source:i,predicate:"ad4m://sdna",target:lt.from(e).toUrl()})),await this.addLinks(o)}async subjectClasses(){try{return(await this.infer("subject_class(X, _)")).map(r=>r.X)}catch{return[]}}async stringOrTemplateObjectToSubjectClass(r){if(typeof r=="string")return r;{let e=await this.subjectClassesByTemplate(r);return e[0]?e[0]:r.className}}async createSubject(subjectClass,exprAddr){let className=await this.stringOrTemplateObjectToSubjectClass(subjectClass),result=await this.infer(`subject_class("${className}", C), constructor(C, Actions)`);if(!result.length)throw"No constructor found for given subject class: "+className;let actions=result.map(x=>eval(x.Actions));return await this.executeAction(actions[0],exprAddr,void 0),this.getSubjectProxy(exprAddr,subjectClass)}async removeSubject(subjectClass,exprAddr){let className=await this.stringOrTemplateObjectToSubjectClass(subjectClass),result=await this.infer(`subject_class("${className}", C), destructor(C, Actions)`);if(!result.length)throw"No constructor found for given subject class: "+className;let actions=result.map(x=>eval(x.Actions));await this.executeAction(actions[0],exprAddr,void 0)}async isSubjectInstance(r,e){let t=await this.stringOrTemplateObjectToSubjectClass(e);return await this.infer(`subject_class("${t}", C), instance(C, "${r}")`)}async getSubjectProxy(r,e){if(!await this.isSubjectInstance(r,e))throw`Expression ${r} is not a subject instance of given class: ${JSON.stringify(e)}`;let t=await this.stringOrTemplateObjectToSubjectClass(e),n=new Va(this,r,t);return await n.init(),n}async getAllSubjectInstances(r){let e=[];typeof r=="string"?e=[r]:e=await this.subjectClassesByTemplate(r);let t=[];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)));t=t.concat(a)}return t}async getAllSubjectProxies(r){let e=[];typeof r=="string"?e=[r]:e=await this.subjectClassesByTemplate(r);let t=[];for(let n of e)t=await this.infer(`subject_class("${n}", C), instance(C, X)`);return t}async subjectClassesByTemplate(r){let e=[],t=[];Object.getPrototypeOf(r).__properties?Object.keys(Object.getPrototypeOf(r).__properties).forEach(l=>e.push(l)):e.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=>!t.includes(l)):t.push(...Object.keys(r).filter(l=>Array.isArray(r[l])).filter(l=>l!=="isSubjectInstance"));let n=Object.getOwnPropertyNames(r).filter(l=>typeof r[l]=="function"&&l.startsWith("set")&&!l.startsWith("setCollection"));n=n.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>typeof r[l]=="function"&&l.startsWith("set")&&!l.startsWith("setCollection")));let i=Object.getOwnPropertyNames(r).filter(l=>typeof r[l]=="function"&&l.startsWith("add"));i=i.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>typeof r[l]=="function"&&l.startsWith("add")));let a=Object.getOwnPropertyNames(r).filter(l=>typeof r[l]=="function"&&l.startsWith("remove"));a=a.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>typeof r[l]=="function"&&l.startsWith("remove")));let o=Object.getOwnPropertyNames(r).filter(l=>typeof r[l]=="function"&&l.startsWith("setCollection"));o=o.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>typeof r[l]=="function"&&l.startsWith("setCollection")));let s="subject_class(Class, C)";for(let l of e)s+=`, property(C, "${l}")`;for(let l of t)s+=`, collection(C, "${l}")`;for(let l of n){let f=l.substring(3);f=f.charAt(0).toLowerCase()+f.slice(1),s+=`, property_setter(C, "${f}", _)`}for(let l of i)s+=`, collection_adder(C, "${D1(l)}", _)`;for(let l of a)s+=`, collection_remover(C, "${N1(l)}", _)`;for(let l of o)s+=`, collection_setter(C, "${R1(l)}", _)`;s+=".";let u=await this.infer(s);return u?u.map(l=>l.Class):[]}async ensureSDNASubjectClass(r){if((await this.subjectClassesByTemplate(new r)).length>0)return;let{name:t,sdna:n}=r.generateSDNA();await this.addSdna(t,n,"subject_class")}getNeighbourhoodProxy(){return F(this,Oe,"f").getNeighbourhoodProxy(F(this,he,"f").uuid)}};he=new WeakMap,Oe=new WeakMap,Pr=new WeakMap,Nr=new WeakMap,Rr=new WeakMap,ai=new WeakMap;var Ar=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},H=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ce,oi,si,ci,Aa,ui,Ia,rt=`
64
64
  author
65
65
  timestamp
66
66
  status
@@ -183,7 +183,7 @@ neighbourhood {
183
183
  }
184
184
  }
185
185
  }
186
- `}).subscribe({next:n=>{t.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 Ks(H(this,Ia,"f"),e)}};ce=new WeakMap,oi=new WeakMap,si=new WeakMap,ci=new WeakMap,Aa=new WeakMap,ui=new WeakMap,Ia=new WeakMap;var ga=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Z=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ie,li,fi,pi,ni=`
186
+ `}).subscribe({next:n=>{t.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 Gs(H(this,Ia,"f"),e)}};ce=new WeakMap,oi=new WeakMap,si=new WeakMap,ci=new WeakMap,Aa=new WeakMap,ui=new WeakMap,Ia=new WeakMap;var ga=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Z=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ie,li,fi,pi,ni=`
187
187
  did
188
188
  directMessageLanguage
189
189
  perspective {
@@ -226,7 +226,7 @@ neighbourhood {
226
226
  deviceKey
227
227
  deviceKeySignedByDid
228
228
  didSignedByDeviceKey
229
- `,$1=`
229
+ `,F1=`
230
230
  signature
231
231
  publicKey
232
232
  `,Si=class{constructor(e,t=!0){ie.set(this,void 0),li.set(this,void 0),fi.set(this,void 0),pi.set(this,void 0),ga(this,ie,e,"f"),ga(this,fi,[],"f"),ga(this,pi,[],"f"),ga(this,li,[],"f"),t&&(this.subscribeAgentUpdated(),this.subscribeAgentStatusChanged(),this.subscribeAppsChanged())}async me(){let{agent:e}=A(await Z(this,ie,"f").query({query:E`query agent { agent { ${ni} } }`})),t=new rr(e.did,e.perspective);return t.directMessageLanguage=e.directMessageLanguage,t}async status(){let{agentStatus:e}=A(await Z(this,ie,"f").query({query:E`query agentStatus {
@@ -325,16 +325,16 @@ neighbourhood {
325
325
  }
326
326
  `}));return e}async signMessage(e){let{agentSignMessage:t}=A(await Z(this,ie,"f").mutate({mutation:E`mutation agentSignMessage($message: String!) {
327
327
  agentSignMessage(message: $message) {
328
- ${$1}
328
+ ${F1}
329
329
  }
330
- }`,variables:{message:e}}));return t}};ie=new WeakMap,li=new WeakMap,fi=new WeakMap,pi=new WeakMap;var M1=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},tr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},vt,Hl=`
330
+ }`,variables:{message:e}}));return t}};ie=new WeakMap,li=new WeakMap,fi=new WeakMap,pi=new WeakMap;var $1=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},tr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},vt,zl=`
331
331
  name
332
332
  address
333
333
  settings
334
334
  icon { code }
335
335
  constructorIcon { code }
336
336
  settingsIcon { code }
337
- `,Jl=`
337
+ `,Hl=`
338
338
  name
339
339
  address
340
340
  description
@@ -344,13 +344,13 @@ neighbourhood {
344
344
  templateAppliedParams
345
345
  possibleTemplateParams
346
346
  sourceCodeLink
347
- `,zs=class{constructor(e){vt.set(this,void 0),M1(this,vt,e,"f")}async byAddress(e){let{language:t}=A(await tr(this,vt,"f").query({query:E`query byAddress($address: String!) {
347
+ `,Ks=class{constructor(e){vt.set(this,void 0),$1(this,vt,e,"f")}async byAddress(e){let{language:t}=A(await tr(this,vt,"f").query({query:E`query byAddress($address: String!) {
348
348
  language(address: $address) {
349
- ${Hl}
349
+ ${zl}
350
350
  }
351
351
  }`,variables:{address:e}}));return t}async byFilter(e){let{languages:t}=A(await tr(this,vt,"f").query({query:E`query byFilter($filter: String!) {
352
352
  languages(filter: $filter) {
353
- ${Hl}
353
+ ${zl}
354
354
  }
355
355
  }`,variables:{filter:e}}));return t}async all(){return this.byFilter("")}async writeSettings(e,t){let{languageWriteSettings:n}=A(await tr(this,vt,"f").mutate({mutation:E`mutation writeSettings($languageAddress: String!, $settings: String!) {
356
356
  languageWriteSettings(languageAddress: $languageAddress, settings: $settings)
@@ -366,13 +366,13 @@ neighbourhood {
366
366
  $languageMeta: LanguageMetaInput!,
367
367
  ) {
368
368
  languagePublish(languagePath: $languagePath, languageMeta: $languageMeta) {
369
- ${Jl}
369
+ ${Hl}
370
370
  }
371
371
  }`,variables:{languagePath:e,languageMeta:t}}));return n}async meta(e){let{languageMeta:t}=A(await tr(this,vt,"f").query({query:E`query languageMeta(
372
372
  $address: String!,
373
373
  ) {
374
374
  languageMeta(address: $address) {
375
- ${Jl}
375
+ ${Hl}
376
376
  }
377
377
  }`,variables:{address:e}}));return t}async source(e){let{languageSource:t}=A(await tr(this,vt,"f").query({query:E`query languageSource(
378
378
  $address: String!,
@@ -382,7 +382,7 @@ neighbourhood {
382
382
  $address: String!,
383
383
  ) {
384
384
  languageRemove(address: $address)
385
- }`,variables:{address:e}}));return t}};vt=new WeakMap;var j1=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Le=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Qe,Lr,Hs=class{constructor(e){Qe.set(this,void 0),Lr.set(this,new Map),j1(this,Qe,e,"f")}async publishFromPerspective(e,t,n){let{neighbourhoodPublishFromPerspective:i}=A(await Le(this,Qe,"f").mutate({mutation:E`mutation neighbourhoodPublishFromPerspective(
385
+ }`,variables:{address:e}}));return t}};vt=new WeakMap;var M1=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Le=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Qe,Lr,zs=class{constructor(e){Qe.set(this,void 0),Lr.set(this,new Map),M1(this,Qe,e,"f")}async publishFromPerspective(e,t,n){let{neighbourhoodPublishFromPerspective:i}=A(await Le(this,Qe,"f").mutate({mutation:E`mutation neighbourhoodPublishFromPerspective(
386
386
  $linkLanguage: String!,
387
387
  $meta: PerspectiveInput!,
388
388
  $perspectiveUUID: String!
@@ -502,7 +502,7 @@ neighbourhood {
502
502
  }
503
503
  proof { valid, invalid, signature, key }
504
504
  }
505
- }`,variables:{perspectiveUUID:e}}).subscribe({next:n=>{let{neighbourhoodSignal:i}=A(n);t.dispatchSignal(e,i)}})}async addSignalHandler(e,t){let n=Le(this,Lr,"f").get(e);n||(n=[],await this.subscribeToSignals(e)),n.push(t),Le(this,Lr,"f").set(e,n)}removeSignalHandler(e,t){let n=Le(this,Lr,"f").get(e);if(n){let i=n.indexOf(t);i>-1&&n.splice(i,1)}Le(this,Lr,"f").set(e,n)}};Qe=new WeakMap,Lr=new WeakMap;var $s=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},se=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},le,di,hi,Ca=`
505
+ }`,variables:{perspectiveUUID:e}}).subscribe({next:n=>{let{neighbourhoodSignal:i}=A(n);t.dispatchSignal(e,i)}})}async addSignalHandler(e,t){let n=Le(this,Lr,"f").get(e);n||(n=[],await this.subscribeToSignals(e)),n.push(t),Le(this,Lr,"f").set(e,n)}removeSignalHandler(e,t){let n=Le(this,Lr,"f").get(e);if(n){let i=n.indexOf(t);i>-1&&n.splice(i,1)}Le(this,Lr,"f").set(e,n)}};Qe=new WeakMap,Lr=new WeakMap;var Fs=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},se=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},le,di,hi,Ca=`
506
506
  author
507
507
  timestamp
508
508
  data {
@@ -514,7 +514,7 @@ data {
514
514
  }
515
515
  }
516
516
  proof { valid, invalid, signature, key }
517
- `,Js=class{constructor(e,t=!0){le.set(this,void 0),di.set(this,void 0),hi.set(this,void 0),$s(this,le,e,"f"),$s(this,di,[],"f"),$s(this,hi,[],"f"),t&&(this.subscribeMessageReceived(),this.subscribeExceptionOccurred())}async info(){let{runtimeInfo:e}=A(await se(this,le,"f").query({query:E`query runtimeInfo {
517
+ `,Hs=class{constructor(e,t=!0){le.set(this,void 0),di.set(this,void 0),hi.set(this,void 0),Fs(this,le,e,"f"),Fs(this,di,[],"f"),Fs(this,hi,[],"f"),t&&(this.subscribeMessageReceived(),this.subscribeExceptionOccurred())}async info(){let{runtimeInfo:e}=A(await se(this,le,"f").query({query:E`query runtimeInfo {
518
518
  runtimeInfo {
519
519
  ad4mExecutorVersion,
520
520
  isInitialized,
@@ -571,7 +571,7 @@ proof { valid, invalid, signature, key }
571
571
  type
572
572
  addon
573
573
  }
574
- }`}).subscribe({next:e=>{se(this,hi,"f").forEach(t=>{t(e.data.exceptionOccurred)})},error:e=>console.error(e)})}};le=new WeakMap,di=new WeakMap,hi=new WeakMap;var U1=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},vn=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Ft,Ys=class{constructor(e){Ft.set(this,void 0),U1(this,Ft,e,"f")}async get(e){let{expression:t}=A(await vn(this,Ft,"f").query({query:E`query expression($url: String!) {
574
+ }`}).subscribe({next:e=>{se(this,hi,"f").forEach(t=>{t(e.data.exceptionOccurred)})},error:e=>console.error(e)})}};le=new WeakMap,di=new WeakMap,hi=new WeakMap;var j1=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},vn=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Ft,Js=class{constructor(e){Ft.set(this,void 0),j1(this,Ft,e,"f")}async get(e){let{expression:t}=A(await vn(this,Ft,"f").query({query:E`query expression($url: String!) {
575
575
  expression(url: $url) {
576
576
  author
577
577
  timestamp
@@ -609,16 +609,16 @@ proof { valid, invalid, signature, key }
609
609
  }
610
610
  }`,variables:{url:e}}));return t}async interact(e,t){let{expressionInteract:n}=A(await vn(this,Ft,"f").mutate({mutation:E`mutation expressionInteract($url: String!, $interactionCall: InteractionCall!){
611
611
  expressionInteract(url: $url, interactionCall: $interactionCall)
612
- }`,variables:{url:e,interactionCall:t}}));return n}};Ft=new WeakMap;var Ir=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},je=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},$t,ka,mi,Da,yi,Cn,Na,Wa=class{constructor(e,t=!0){$t.set(this,void 0),ka.set(this,void 0),mi.set(this,void 0),Da.set(this,void 0),yi.set(this,void 0),Cn.set(this,void 0),Na.set(this,void 0),Ir(this,$t,e,"f"),Ir(this,ka,new Si(je(this,$t,"f"),t),"f"),Ir(this,mi,new Ys(je(this,$t,"f")),"f"),Ir(this,Da,new zs(je(this,$t,"f")),"f"),Ir(this,yi,new Hs(je(this,$t,"f")),"f"),Ir(this,Cn,new Qa(je(this,$t,"f"),t),"f"),je(this,Cn,"f").setExpressionClient(je(this,mi,"f")),je(this,Cn,"f").setNeighbourhoodClient(je(this,yi,"f")),Ir(this,Na,new Js(je(this,$t,"f"),t),"f")}get agent(){return je(this,ka,"f")}get expression(){return je(this,mi,"f")}get languages(){return je(this,Da,"f")}get neighbourhood(){return je(this,yi,"f")}get perspective(){return je(this,Cn,"f")}get runtime(){return je(this,Na,"f")}};$t=new WeakMap,ka=new WeakMap,mi=new WeakMap,Da=new WeakMap,yi=new WeakMap,Cn=new WeakMap,Na=new WeakMap;var Yl;(function(r){r[r.LanguageIsNotLoaded=0]="LanguageIsNotLoaded",r[r.ExpressionIsNotVerified=1]="ExpressionIsNotVerified",r[r.AgentIsUntrusted=2]="AgentIsUntrusted",r[r.CapabilityRequested=3]="CapabilityRequested"})(Yl||(Yl={}));var ic=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},ac=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},$r=class{constructor(e,t){this.language=e,this.expression=t}};ic([v(),ac("design:type",Tt)],$r.prototype,"language",void 0);ic([v(),ac("design:type",String)],$r.prototype,"expression",void 0);$r=ic([J(),ac("design:paramtypes",[Tt,String])],$r);function Zg(r){return r.language.address==="did"?r.expression.toString():`${r.language.address}://${r.expression}`}function e6(r){if(r.startsWith("literal://")){let a=new Tt;a.address="literal",a.name="literal";let o=r.substring(10);return new $r(a,o)}let t=/^([^:^\s]+):\/\/([\s\S]+)$/.exec(r);if(t&&t.length==3){let a=t[1],o=t[2],s=new Tt;return s.address=a,new $r(s,o)}let i=/^did:([^\s]+)$/.exec(r);if(i&&i.length==2){let a=new Tt;return a.address="did",new $r(a,r)}throw new Error("Couldn't parse string as expression URL or DID: "+r)}var it=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},At=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Ga=class{};it([v(),At("design:type",String)],Ga.prototype,"name",void 0);it([v(),At("design:type",String)],Ga.prototype,"type",void 0);Ga=it([J()],Ga);var wi=class{};it([v(),At("design:type",String)],wi.prototype,"label",void 0);it([v(),At("design:type",String)],wi.prototype,"name",void 0);it([v(),At("design:type",Array)],wi.prototype,"parameters",void 0);wi=it([J()],wi);var Ka=class{get parameters(){return JSON.parse(this.parametersStringified)}constructor(e,t){this.name=e,this.parametersStringified=JSON.stringify(t)}};it([v(),At("design:type",String)],Ka.prototype,"name",void 0);it([v(),At("design:type",String)],Ka.prototype,"parametersStringified",void 0);Ka=it([Ge(),At("design:paramtypes",[String,Object])],Ka);var za=class{};it([v(),At("design:type",String)],za.prototype,"did",void 0);it([v(),At("design:type",Gs)],za.prototype,"status",void 0);za=it([J()],za);var Xl=class{},Gr=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},An=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},ur=class{};Gr([v(),An("design:type",String)],ur.prototype,"name",void 0);Gr([v(),An("design:type",String)],ur.prototype,"address",void 0);Gr([v(),An("design:type",String)],ur.prototype,"settings",void 0);Gr([v(),An("design:type",jr)],ur.prototype,"icon",void 0);Gr([v(),An("design:type",jr)],ur.prototype,"constructorIcon",void 0);Gr([v(),An("design:type",jr)],ur.prototype,"settingsIcon",void 0);ur=Gr([J()],ur);var Ke=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},Ze=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},bt=class{};Ke([v(),Ze("design:type",String)],bt.prototype,"name",void 0);Ke([v(),Ze("design:type",String)],bt.prototype,"address",void 0);Ke([v(),Ze("design:type",String)],bt.prototype,"description",void 0);Ke([v(),Ze("design:type",String)],bt.prototype,"author",void 0);Ke([v(),Ze("design:type",Boolean)],bt.prototype,"templated",void 0);Ke([v(),Ze("design:type",String)],bt.prototype,"templateSourceLanguageAddress",void 0);Ke([v(),Ze("design:type",String)],bt.prototype,"templateAppliedParams",void 0);Ke([v(),Ze("design:type",Array)],bt.prototype,"possibleTemplateParams",void 0);Ke([v(),Ze("design:type",String)],bt.prototype,"sourceCodeLink",void 0);bt=Ke([J()],bt);var xn=class{constructor(e,t){this.name=e,this.description=t,this.description||(this.description="")}};Ke([v(),Ze("design:type",String)],xn.prototype,"name",void 0);Ke([v(),Ze("design:type",String)],xn.prototype,"description",void 0);Ke([v(),Ze("design:type",Array)],xn.prototype,"possibleTemplateParams",void 0);Ke([v(),Ze("design:type",String)],xn.prototype,"sourceCodeLink",void 0);xn=Ke([Ge(),Ze("design:paramtypes",[String,String])],xn);var Zl=class{},ef=class extends lr(){},tf=class{},Xa=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},oc=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Ha=class{constructor(e,t){this.linkLanguage=e,this.meta=t}};Xa([v(),oc("design:type",String)],Ha.prototype,"linkLanguage",void 0);Xa([v(),oc("design:type",ar)],Ha.prototype,"meta",void 0);Ha=Xa([J(),oc("design:paramtypes",[String,ar])],Ha);var Xs=class extends lr(){};Xs=Xa([J()],Xs);var In=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},kn=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Zs;(function(r){r.Private="Private",r.NeighbourhoodJoinInitiated="NeighbourhoodJoinInitiated",r.LinkLanguageFailedToInstall="LinkLanguageFailedToInstall",r.LinkLanguageInstalledButNotSynced="LinkLanguageInstalledButNotSynced",r.Synced="Synced"})(Zs||(Zs={}));var Br=class{constructor(e,t,n){this.uuid=e,this.name=t,n?this.state=n:this.state=Zs.Private}};In([v(),kn("design:type",String)],Br.prototype,"uuid",void 0);In([v(),kn("design:type",String)],Br.prototype,"name",void 0);In([v(),kn("design:type",String)],Br.prototype,"state",void 0);In([v(),kn("design:type",String)],Br.prototype,"sharedUrl",void 0);In([v(),kn("design:type",Xs)],Br.prototype,"neighbourhood",void 0);Br=In([J(),kn("design:paramtypes",[String,String,String])],Br);var Za=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},wf=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Ja=class{};Za([v(),wf("design:type",Array)],Ja.prototype,"additions",void 0);Za([v(),wf("design:type",Array)],Ja.prototype,"removals",void 0);Ja=Za([J()],Ja);var rf=class extends lr(){};rf=Za([J()],rf);var nf=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},bn=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},gi,Fr,Sa="smart_literal://content";function q1(r){let e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=t.length;for(let i=0;i<r;i++)e+=t.charAt(Math.floor(Math.random()*n));return e}var _i=class{constructor(e,t){gi.set(this,void 0),Fr.set(this,void 0),nf(this,gi,e,"f"),nf(this,Fr,t,"f")}get base(){return bn(this,Fr,"f")}static async create(e,t){let n=lt.from(q1(10)).toUrl(),i=new _i(e,n);return await i.set(t),i}static async isSmartLiteralBase(e,t){return(await e.get(new Ue({source:t,predicate:Sa}))).length>0}static async getAllSmartLiterals(e){return(await e.get(new Ue({predicate:Sa}))).map(n=>new _i(e,n.data.source))}async get(){let e=await bn(this,gi,"f").getSingleTarget(new Ue({source:bn(this,Fr,"f"),predicate:Sa}));if(!e)throw`No content for smart literal ${bn(this,Fr,"f")}`;return lt.fromUrl(e).get()}async set(e){let t=lt.from(e);await bn(this,gi,"f").setSingleTarget(new ct({source:bn(this,Fr,"f"),predicate:Sa,target:t.toUrl()}))}};gi=new WeakMap,Fr=new WeakMap;var af=class{};function d6(r,e,t){return{action:"addLink",source:r,predicate:e,target:t}}function h6(r){return`triple(this, "${r}", _)`}function m6(r){return function(e,t,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(r&&r.where)for(let f in r.where){let p=r.where[f];u+=`, property_getter(C, Instance, "${f}", "${p}")`}r&&r.condition&&(u+=", "+r.condition);let l=await a.infer(u);if(l==!1)return o;if(typeof l=="string")throw l;for(let f of l){let p=f.Instance,h=new Va(a,p,s);await h.init(),o.push(h)}return o}}}function y6(r){return function(e,t){if(e.__properties=e.__properties||{},e.__properties[t]=e.__properties[t]||{},e.__properties[t]={...e.__properties[t],...r},r.writable){let n=t;e[`set${nr(n)}`]=()=>{}}Object.defineProperty(e,t,{configurable:!0,writable:!0})}}function g6(r){return function(e,t){e.__properties=e.__properties||{},e.__properties[t]=e.__properties[t]||{},e.__properties[t]={...e.__properties[t],through:r.through,required:!0,initial:r.value,flag:!0},e[t]=r.value,Object.defineProperty(e,t,{configurable:!0,writable:!0})}}function v6(r){return function(e,t){e.__collections=e.__collections||{},e.__collections[t]=r;let n=t;e[`add${nr(n)}`]=()=>{},e[`remove${nr(n)}`]=()=>{},e[`setCollection${nr(n)}`]=()=>{},Object.defineProperty(e,t,{configurable:!0,writable:!0})}}function _f(r){let e="",t="abcdefghijklmnopqrstuvwxyz",n=t.length;for(let i=0;i<r;i++)e+=t.charAt(Math.floor(Math.random()*n));return e}function b6(r){return function(e){e.prototype.className=r.name,e.className=r.name,e.generateSDNA=function(){let t="",n=r.name,i=e.prototype,a=_f(8);t+=`subject_class("${n}", ${a}).
612
+ }`,variables:{url:e,interactionCall:t}}));return n}};Ft=new WeakMap;var Ir=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},je=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},$t,ka,mi,Da,yi,Cn,Pa,Wa=class{constructor(e,t=!0){$t.set(this,void 0),ka.set(this,void 0),mi.set(this,void 0),Da.set(this,void 0),yi.set(this,void 0),Cn.set(this,void 0),Pa.set(this,void 0),Ir(this,$t,e,"f"),Ir(this,ka,new Si(je(this,$t,"f"),t),"f"),Ir(this,mi,new Js(je(this,$t,"f")),"f"),Ir(this,Da,new Ks(je(this,$t,"f")),"f"),Ir(this,yi,new zs(je(this,$t,"f")),"f"),Ir(this,Cn,new Qa(je(this,$t,"f"),t),"f"),je(this,Cn,"f").setExpressionClient(je(this,mi,"f")),je(this,Cn,"f").setNeighbourhoodClient(je(this,yi,"f")),Ir(this,Pa,new Hs(je(this,$t,"f"),t),"f")}get agent(){return je(this,ka,"f")}get expression(){return je(this,mi,"f")}get languages(){return je(this,Da,"f")}get neighbourhood(){return je(this,yi,"f")}get perspective(){return je(this,Cn,"f")}get runtime(){return je(this,Pa,"f")}};$t=new WeakMap,ka=new WeakMap,mi=new WeakMap,Da=new WeakMap,yi=new WeakMap,Cn=new WeakMap,Pa=new WeakMap;var Jl;(function(r){r[r.LanguageIsNotLoaded=0]="LanguageIsNotLoaded",r[r.ExpressionIsNotVerified=1]="ExpressionIsNotVerified",r[r.AgentIsUntrusted=2]="AgentIsUntrusted",r[r.CapabilityRequested=3]="CapabilityRequested"})(Jl||(Jl={}));var nc=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},ic=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},$r=class{constructor(e,t){this.language=e,this.expression=t}};nc([v(),ic("design:type",Tt)],$r.prototype,"language",void 0);nc([v(),ic("design:type",String)],$r.prototype,"expression",void 0);$r=nc([J(),ic("design:paramtypes",[Tt,String])],$r);function X6(r){return r.language.address==="did"?r.expression.toString():`${r.language.address}://${r.expression}`}function Z6(r){if(r.startsWith("literal://")){let a=new Tt;a.address="literal",a.name="literal";let o=r.substring(10);return new $r(a,o)}let t=/^([^:^\s]+):\/\/([\s\S]+)$/.exec(r);if(t&&t.length==3){let a=t[1],o=t[2],s=new Tt;return s.address=a,new $r(s,o)}let i=/^did:([^\s]+)$/.exec(r);if(i&&i.length==2){let a=new Tt;return a.address="did",new $r(a,r)}throw new Error("Couldn't parse string as expression URL or DID: "+r)}var it=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},At=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Ga=class{};it([v(),At("design:type",String)],Ga.prototype,"name",void 0);it([v(),At("design:type",String)],Ga.prototype,"type",void 0);Ga=it([J()],Ga);var wi=class{};it([v(),At("design:type",String)],wi.prototype,"label",void 0);it([v(),At("design:type",String)],wi.prototype,"name",void 0);it([v(),At("design:type",Array)],wi.prototype,"parameters",void 0);wi=it([J()],wi);var Ka=class{get parameters(){return JSON.parse(this.parametersStringified)}constructor(e,t){this.name=e,this.parametersStringified=JSON.stringify(t)}};it([v(),At("design:type",String)],Ka.prototype,"name",void 0);it([v(),At("design:type",String)],Ka.prototype,"parametersStringified",void 0);Ka=it([Ge(),At("design:paramtypes",[String,Object])],Ka);var za=class{};it([v(),At("design:type",String)],za.prototype,"did",void 0);it([v(),At("design:type",Ws)],za.prototype,"status",void 0);za=it([J()],za);var Yl=class{},Gr=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},An=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},ur=class{};Gr([v(),An("design:type",String)],ur.prototype,"name",void 0);Gr([v(),An("design:type",String)],ur.prototype,"address",void 0);Gr([v(),An("design:type",String)],ur.prototype,"settings",void 0);Gr([v(),An("design:type",jr)],ur.prototype,"icon",void 0);Gr([v(),An("design:type",jr)],ur.prototype,"constructorIcon",void 0);Gr([v(),An("design:type",jr)],ur.prototype,"settingsIcon",void 0);ur=Gr([J()],ur);var Ke=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},Ze=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},bt=class{};Ke([v(),Ze("design:type",String)],bt.prototype,"name",void 0);Ke([v(),Ze("design:type",String)],bt.prototype,"address",void 0);Ke([v(),Ze("design:type",String)],bt.prototype,"description",void 0);Ke([v(),Ze("design:type",String)],bt.prototype,"author",void 0);Ke([v(),Ze("design:type",Boolean)],bt.prototype,"templated",void 0);Ke([v(),Ze("design:type",String)],bt.prototype,"templateSourceLanguageAddress",void 0);Ke([v(),Ze("design:type",String)],bt.prototype,"templateAppliedParams",void 0);Ke([v(),Ze("design:type",Array)],bt.prototype,"possibleTemplateParams",void 0);Ke([v(),Ze("design:type",String)],bt.prototype,"sourceCodeLink",void 0);bt=Ke([J()],bt);var xn=class{constructor(e,t){this.name=e,this.description=t,this.description||(this.description="")}};Ke([v(),Ze("design:type",String)],xn.prototype,"name",void 0);Ke([v(),Ze("design:type",String)],xn.prototype,"description",void 0);Ke([v(),Ze("design:type",Array)],xn.prototype,"possibleTemplateParams",void 0);Ke([v(),Ze("design:type",String)],xn.prototype,"sourceCodeLink",void 0);xn=Ke([Ge(),Ze("design:paramtypes",[String,String])],xn);var Xl=class{},Zl=class extends lr(){},ef=class{},Xa=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},ac=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Ha=class{constructor(e,t){this.linkLanguage=e,this.meta=t}};Xa([v(),ac("design:type",String)],Ha.prototype,"linkLanguage",void 0);Xa([v(),ac("design:type",ar)],Ha.prototype,"meta",void 0);Ha=Xa([J(),ac("design:paramtypes",[String,ar])],Ha);var Ys=class extends lr(){};Ys=Xa([J()],Ys);var In=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},kn=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Xs;(function(r){r.Private="Private",r.NeighbourhoodJoinInitiated="NeighbourhoodJoinInitiated",r.LinkLanguageFailedToInstall="LinkLanguageFailedToInstall",r.LinkLanguageInstalledButNotSynced="LinkLanguageInstalledButNotSynced",r.Synced="Synced"})(Xs||(Xs={}));var Br=class{constructor(e,t,n){this.uuid=e,this.name=t,n?this.state=n:this.state=Xs.Private}};In([v(),kn("design:type",String)],Br.prototype,"uuid",void 0);In([v(),kn("design:type",String)],Br.prototype,"name",void 0);In([v(),kn("design:type",String)],Br.prototype,"state",void 0);In([v(),kn("design:type",String)],Br.prototype,"sharedUrl",void 0);In([v(),kn("design:type",Ys)],Br.prototype,"neighbourhood",void 0);Br=In([J(),kn("design:paramtypes",[String,String,String])],Br);var Za=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},Sf=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Ja=class{};Za([v(),Sf("design:type",Array)],Ja.prototype,"additions",void 0);Za([v(),Sf("design:type",Array)],Ja.prototype,"removals",void 0);Ja=Za([J()],Ja);var tf=class extends lr(){};tf=Za([J()],tf);var rf=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},bn=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},gi,Fr,Sa="smart_literal://content";function U1(r){let e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=t.length;for(let i=0;i<r;i++)e+=t.charAt(Math.floor(Math.random()*n));return e}var _i=class{constructor(e,t){gi.set(this,void 0),Fr.set(this,void 0),rf(this,gi,e,"f"),rf(this,Fr,t,"f")}get base(){return bn(this,Fr,"f")}static async create(e,t){let n=lt.from(U1(10)).toUrl(),i=new _i(e,n);return await i.set(t),i}static async isSmartLiteralBase(e,t){return(await e.get(new Ue({source:t,predicate:Sa}))).length>0}static async getAllSmartLiterals(e){return(await e.get(new Ue({predicate:Sa}))).map(n=>new _i(e,n.data.source))}async get(){let e=await bn(this,gi,"f").getSingleTarget(new Ue({source:bn(this,Fr,"f"),predicate:Sa}));if(!e)throw`No content for smart literal ${bn(this,Fr,"f")}`;return lt.fromUrl(e).get()}async set(e){let t=lt.from(e);await bn(this,gi,"f").setSingleTarget(new ct({source:bn(this,Fr,"f"),predicate:Sa,target:t.toUrl()}))}};gi=new WeakMap,Fr=new WeakMap;var nf=class{};function pg(r,e,t){return{action:"addLink",source:r,predicate:e,target:t}}function dg(r){return`triple(this, "${r}", _)`}function hg(r){return function(e,t,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(r&&r.where)for(let f in r.where){let p=r.where[f];u+=`, property_getter(C, Instance, "${f}", "${p}")`}r&&r.condition&&(u+=", "+r.condition);let l=await a.infer(u);if(l==!1)return o;if(typeof l=="string")throw l;for(let f of l){let p=f.Instance,h=new Va(a,p,s);await h.init(),o.push(h)}return o}}}function mg(r){return function(e,t){if(e.__properties=e.__properties||{},e.__properties[t]=e.__properties[t]||{},e.__properties[t]={...e.__properties[t],...r},r.writable){let n=t;e[`set${nr(n)}`]=()=>{}}Object.defineProperty(e,t,{configurable:!0,writable:!0})}}function yg(r){return function(e,t){e.__properties=e.__properties||{},e.__properties[t]=e.__properties[t]||{},e.__properties[t]={...e.__properties[t],through:r.through,required:!0,initial:r.value,flag:!0},e[t]=r.value,Object.defineProperty(e,t,{configurable:!0,writable:!0})}}function gg(r){return function(e,t){e.__collections=e.__collections||{},e.__collections[t]=r;let n=t;e[`add${nr(n)}`]=()=>{},e[`remove${nr(n)}`]=()=>{},e[`setCollection${nr(n)}`]=()=>{},Object.defineProperty(e,t,{configurable:!0,writable:!0})}}function wf(r){let e="",t="abcdefghijklmnopqrstuvwxyz",n=t.length;for(let i=0;i<r;i++)e+=t.charAt(Math.floor(Math.random()*n));return e}function vg(r){return function(e){e.prototype.className=r.name,e.className=r.name,e.generateSDNA=function(){let t="",n=r.name,i=e.prototype,a=wf(8);t+=`subject_class("${n}", ${a}).
613
613
  `;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 l=[],f=i.__properties||{};for(let y in f){let g=`property(${a}, "${y}").
614
- `,{through:C,initial:_,required:b,resolveLanguage:S,writable:O,flag:k,getter:N,setter:I,local:R}=f[y];if(S&&(g+=`property_resolve(${a}, "${y}").
614
+ `,{through:C,initial:_,required:b,resolveLanguage:S,writable:O,flag:k,getter:P,setter:I,local:R}=f[y];if(S&&(g+=`property_resolve(${a}, "${y}").
615
615
  `,g+=`property_resolve_language(${a}, "${y}", "${S}").
616
- `),N?g+=`property_getter(${a}, Base, "${y}", Value) :- ${N}.
616
+ `),P?g+=`property_getter(${a}, Base, "${y}", Value) :- ${P}.
617
617
  `:C&&(g+=`property_getter(${a}, Base, "${y}", Value) :- triple(Base, "${C}", Value).
618
618
  `,b&&(k?u.push(`triple(Base, "${C}", "${_}")`):u.push(`triple(Base, "${C}", _)`))),I)g+=`property_setter(${a}, "${y}", Actions) :- ${I}.
619
- `;else if(O&&typeof i[Sf(y)]=="function"){let ee=[{action:"setSingleTarget",source:"this",predicate:C,target:"value",...R&&{local:!0}}];g+=`property_setter(${a}, "${y}", '${Dr(ee)}').
619
+ `;else if(O&&typeof i[Cf(y)]=="function"){let ee=[{action:"setSingleTarget",source:"this",predicate:C,target:"value",...R&&{local:!0}}];g+=`property_setter(${a}, "${y}", '${Dr(ee)}').
620
620
  `}l.push(g),_&&(s.push({action:"addLink",source:"this",predicate:C,target:_}),o.push({action:"removeLink",source:"this",predicate:C,target:_}))}let p=[],h=i.__collections||{};for(let y in h){let g=`collection(${a}, "${y}").
621
- `,{through:C,where:_,local:b}=h[y];if(C){if(_){if(!_.isInstance&&!_.condition)throw"'where' needs one of 'isInstance' or 'condition'";let N=[];if(_.isInstance){let R;_.isInstance.name?R=_.isInstance.name:R=_.isInstance,N.push(`instance(OtherClass, Target), subject_class("${R}", OtherClass)`)}_.condition&&N.push(_.condition);let I=N.join(", ");g+=`collection_getter(${a}, Base, "${y}", List) :- setof(Target, (triple(Base, "${C}", Target), ${I}), List).
621
+ `,{through:C,where:_,local:b}=h[y];if(C){if(_){if(!_.isInstance&&!_.condition)throw"'where' needs one of 'isInstance' or 'condition'";let P=[];if(_.isInstance){let R;_.isInstance.name?R=_.isInstance.name:R=_.isInstance,P.push(`instance(OtherClass, Target), subject_class("${R}", OtherClass)`)}_.condition&&P.push(_.condition);let I=P.join(", ");g+=`collection_getter(${a}, Base, "${y}", List) :- setof(Target, (triple(Base, "${C}", Target), ${I}), List).
622
622
  `}else g+=`collection_getter(${a}, Base, "${y}", List) :- findall(C, triple(Base, "${C}", C), List).
623
623
  `;let S=[{action:"addLink",source:"this",predicate:C,target:"value",...b&&{local:!0}}],O=[{action:"removeLink",source:"this",predicate:C,target:"value"}],k=[{action:"collectionSetter",source:"this",predicate:C,target:"value",...b&&{local:!0}}];g+=`collection_adder(${a}, "${Mt(y)}", '${Dr(S)}').
624
624
  `,g+=`collection_remover(${a}, "${Mt(y)}", '${Dr(O)}').
@@ -631,7 +631,7 @@ proof { valid, invalid, signature, key }
631
631
  `,t+=l.join(`
632
632
  `),t+=`
633
633
  `,t+=p.join(`
634
- `),{sdna:t,name:n}},Object.defineProperty(e,"type",{configurable:!0})}}var C6=`
634
+ `),{sdna:t,name:n}},Object.defineProperty(e,"type",{configurable:!0})}}var bg=`
635
635
  type Agent {
636
636
  did: String!
637
637
  directMessageLanguage: String
@@ -1008,7 +1008,7 @@ type Subscription {
1008
1008
  perspectiveUpdated: PerspectiveHandle
1009
1009
  runtimeMessageReceived: PerspectiveExpression
1010
1010
  }
1011
- `;function of(r){return r?.length?r.length===1?r.toString():r.length===2?r.join(" and "):r.slice(0,-1).join(", ")+", and "+r.slice(-1):""}function Ef(r){let e=r.can.includes("*")?["READ","WRITE","UPDATE"]:r.can,t=r.with.domain==="*"?"":r.with.domain,n=r.with.pointers.includes("*")?["all AD4M data"]:r.with.pointers;return`${of(e)} your ${t} actions, with access to ${of(n)}`}var kr=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},M=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},We,Fe,Pa,ae,sf=class{constructor(r,e,t){We.set(this,void 0),Fe.set(this,void 0),Pa.set(this,void 0),ae.set(this,void 0),kr(this,We,e||lt.from(_f(24)).toUrl(),"f"),kr(this,ae,r,"f"),kr(this,Pa,t||"ad4m://self","f")}get baseExpression(){return M(this,We,"f")}async getData(id){let tempId=id??M(this,We,"f"),isInstance=await M(this,ae,"f").isSubjectInstance(tempId,M(this,Fe,"f"));if(!isInstance)throw`Not a valid subject instance of ${M(this,Fe,"f")} for ${tempId}`;let results=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), property(C, Property)`),properties=results.map(r=>r.Property);for(let r of properties){let e=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), property_resolve(C, "${r}")`),t=async()=>{let n=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), property_getter(C, "${tempId}", "${r}", Value)`);if(n&&n.length>0){let i=n[0].Value;if(e)try{let a=await M(this,ae,"f").getExpression(i);try{return JSON.parse(a.data)}catch{return a.data}}catch{return i}else return i}else return n||void 0};this[r]=await t()}let results2=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), collection(C, Collection)`);results2||(results2=[]);let collections=results2.map(r=>r.Collection);for(let c of collections){let getProperty=async()=>{let results=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), collection_getter(C, "${tempId}", "${c}", Value)`);return results&&results.length>0&&results[0].Value?eval(results[0].Value):[]};this[c]=await getProperty()}return kr(this,We,tempId,"f"),this}async setProperty(key,value){let setters=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), property_setter(C, "${key}", Setter)`);if(setters&&setters.length>0){let actions=eval(setters[0].Setter),resolveLanguageResults=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), property_resolve_language(C, "${key}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),resolveLanguage&&(value=await M(this,ae,"f").createExpression(value,resolveLanguage)),await M(this,ae,"f").executeAction(actions,M(this,We,"f"),[{name:"value",value}])}}async setCollectionSetter(key,value){let collectionSetters=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), collection_setter(C, "${Mt(key)}", Setter)`);if(collectionSetters||(collectionSetters=[]),collectionSetters.length>0){let actions=eval(collectionSetters[0].Setter);value&&(Array.isArray(value)?await M(this,ae,"f").executeAction(actions,M(this,We,"f"),value.map(r=>({name:"value",value:r}))):await M(this,ae,"f").executeAction(actions,M(this,We,"f"),[{name:"value",value}]))}}async setCollectionAdder(key,value){let adders=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), collection_adder(C, "${Mt(key)}", Adder)`);if(adders||(adders=[]),adders.length>0){let actions=eval(adders[0].Adder);value&&(Array.isArray(value)?await Promise.all(value.map(r=>M(this,ae,"f").executeAction(actions,M(this,We,"f"),[{name:"value",value:r}]))):await M(this,ae,"f").executeAction(actions,M(this,We,"f"),[{name:"value",value}]))}}async setCollectionRemover(key,value){let removers=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), collection_remover(C, "${Mt(key)}", Remover)`);if(removers||(removers=[]),removers.length>0){let actions=eval(removers[0].Remover);value&&(Array.isArray(value)?await Promise.all(value.map(r=>M(this,ae,"f").executeAction(actions,M(this,We,"f"),[{name:"value",value:r}]))):await M(this,ae,"f").executeAction(actions,M(this,We,"f"),[{name:"value",value}]))}}async save(){kr(this,Fe,await M(this,ae,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await M(this,ae,"f").createSubject(this,M(this,We,"f")),await M(this,ae,"f").add(new ct({source:M(this,Pa,"f"),predicate:"ad4m://has_child",target:this.baseExpression})),await this.update()}async update(){kr(this,Fe,await M(this,ae,"f").stringOrTemplateObjectToSubjectClass(this),"f");let r=Object.entries(this);for(let[e,t]of r)if(t)if(t?.action)switch(t.action){case"setter":await this.setCollectionSetter(e,t.value);break;case"adder":await this.setCollectionAdder(e,t.value);break;case"remover":await this.setCollectionRemover(e,t.value);default:await this.setCollectionSetter(e,t.value);break}else Array.isArray(t)&&t.length>0?await this.setCollectionSetter(e,t):await this.setProperty(e,t);await this.getData()}async get(){return kr(this,Fe,await M(this,ae,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await this.getData()}async delete(){await M(this,ae,"f").removeSubject(this,M(this,We,"f"))}static async all(r){let e=await r.stringOrTemplateObjectToSubjectClass(this),t=await r.getAllSubjectProxies(e),n=[];if(t){for(let i of t){let a=new this(r,i.X);n.push(await a.get())}return n}return[]}static async query(r,e){let t=e?.source||"ad4m://self",n=await r.stringOrTemplateObjectToSubjectClass(this),i=[];if(e)try{if((await r.infer(`findall([Timestamp, Base], (subject_class("${n}", C), instance(C, Base), link("${t}", Predicate, Base, Timestamp, Author)), AllData), sort(AllData, SortedData), length(SortedData, DataLength).`))[0].DataLength>=e.size){let s=`findall([Timestamp, Base], (subject_class("${n}", C), instance(C, Base), link("${t}", Predicate, Base, Timestamp, Author)), AllData), sort(AllData, SortedData), reverse(SortedData, ReverseSortedData), paginate(ReverseSortedData, ${e.page}, ${e.size}, PageData).`;i=await r.infer(s),i=i[0].PageData.map(u=>({Base:u[1],Timestamp:u[0]}))}else i=await r.infer(`subject_class("${n}", C), instance(C, Base), triple("${t}", Predicate, Base).`)}catch(o){console.log("Query failed",o)}else i=await r.infer(`subject_class("${n}", C), instance(C, Base), triple("${t}", Predicate, Base).`);return i?await Promise.all(i.map(async o=>await new this(r,o.Base).get())):[]}};We=new WeakMap,Fe=new WeakMap,Pa=new WeakMap,ae=new WeakMap;var eo="0.8.0-fix";function V1(){let r=new AbortController;return setTimeout(()=>r.abort(),20),r}function sc(r,e=5e3){return ye(this,null,function*(){return Promise.race([new Promise((t,n)=>{let i=new WebSocket(r);i.onopen=()=>{t(i)},i.onerror=a=>{n(a)}}),new Promise((t,n)=>{setTimeout(()=>{n(new Error("WebSocket connection timed out"))},e)})])})}function cc(r){return ye(this,null,function*(){try{let e=yield fetch(`http://localhost:${r}/graphql/`,{signal:V1().signal,mode:"no-cors"});if(e.status===400||e.status===0)return r;throw new Error(`Could not connect to port ${r}`)}catch(e){throw new Error(`Could not connect to port ${r}`)}})}function Q1(){return new Promise((r,e)=>{let t=document.querySelector("ad4m-connect"),n=t==null?void 0:t.getAd4mClient();n?r(n):e("No Ad4mClient found")})}function uc(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(r){return!1}return!0}function xf(r,e){uc()&&localStorage.setItem(`${eo}/${r}`,e)}function Kr(r){return uc()?localStorage.getItem(`${eo}/${r}`):null}function Of(r){uc()&&localStorage.removeItem(`${eo}/${r}`)}var W1=r=>{let e=new Set;do for(let t of Reflect.ownKeys(r))e.add([r,t]);while((r=Reflect.getPrototypeOf(r))&&r!==Object.prototype);return e};function xi(r,{include:e,exclude:t}={}){let n=i=>{let a=o=>typeof o=="string"?i===o:o.test(i);return e?e.some(a):t?!t.some(a):!0};for(let[i,a]of W1(r.constructor.prototype)){if(a==="constructor"||!n(a))continue;let o=Reflect.getOwnPropertyDescriptor(i,a);o&&typeof o.value=="function"&&(r[a]=r[a].bind(r))}return r}var Oi=class{constructor({appName:e,appDesc:t,appIconPath:n,appUrl:i,appDomain:a,capabilities:o,port:s,token:u,url:l}){this.activeSocket=null;this.requestedRestart=!1;this.authState="unauthenticated";this.connectionState="not_connected";this.port=12e3;this.capabilities=[];this.listeners={authstatechange:[],configstatechange:[],connectionstatechange:[]};xi(this);this.appName=e,this.appDesc=t,this.appDomain=a,this.appUrl=i,this.appIconPath=n,this.capabilities=o,this.port=s||this.port,this.url=l||`ws://localhost:${this.port}/graphql`,this.token=u||this.token,this.buildClient()}notifyConfigChange(e,t){this.listeners.configstatechange.forEach(n=>{n(e,t)})}notifyConnectionChange(e){this.connectionState!==e&&(this.connectionState=e,this.listeners.connectionstatechange.forEach(t=>{t(e)}))}notifyAuthChange(e){this.authState!==e&&(this.authState=e,this.listeners.authstatechange.forEach(t=>{t(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,t){this.listeners[e].push(t)}connect(e){return ye(this,null,function*(){try{if(e){yield sc(e,1e4),this.setUrl(e);let t=this.buildClient();return yield this.checkAuth(),t}else{let t=yield this.ensureConnection();return yield this.checkAuth(),t}}catch(t){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}connectToPort(e){return ye(this,null,function*(){try{if(e){let t=yield cc(e);this.setPort(t)}else{let t=yield this.findPort();this.setPort(t)}return this.buildClient()}catch(t){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}ensureConnection(){return ye(this,null,function*(){var t,n;if(((t=this.activeSocket)==null?void 0:t.readyState)===WebSocket.OPEN&&((n=this.activeSocket)==null?void 0:n.url)===this.url&&this.ad4mClient)return this.ad4mClient;try{return yield sc(this.url,1e4),this.buildClient()}catch(i){return this.connectToPort()}})}findPort(){return ye(this,null,function*(){let e=[...Array(10).keys()].map((i,a)=>cc(12e3+a)),n=(yield Promise.allSettled(e)).find(i=>i.status==="fulfilled");if(n)return n.value;throw Error("Couldn't find an open port")})}buildClient(){this.notifyConnectionChange("connecting");try{new WebSocket(this.url)}catch(e){this.notifyConnectionChange("not_connected")}return this.apolloClient&&this.wsClient&&(this.requestedRestart=!0,this.wsClient.dispose(),this.apolloClient.stop()),this.wsClient=$l({url:this.url,connectionParams:()=>ye(this,null,function*(){return{headers:{authorization:this.token}}}),on:{connecting:()=>{this.requestedRestart||this.notifyConnectionChange("connecting")},opened:e=>{this.activeSocket=e},error:e=>{this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")},connected:()=>{this.notifyConnectionChange("connected")},closed:()=>{this.requestedRestart||(this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1)}}}),this.apolloClient=new Is({link:new Ml(this.wsClient),cache:new la({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"},mutate:{fetchPolicy:"no-cache"}}}),this.ad4mClient=new Wa(this.apolloClient),this.ad4mClient}checkAuth(){return ye(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 ye(this,null,function*(){var t;return e&&this.setToken(null),this.requestId=yield(t=this.ad4mClient)==null?void 0:t.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 ye(this,null,function*(){var n;let t=yield(n=this.ad4mClient)==null?void 0:n.agent.generateJwt(this.requestId,e);return this.setToken(t),yield this.buildClient(),yield this.checkAuth(),this.token})}};function lc(){return Y`
1011
+ `;function af(r){return r?.length?r.length===1?r.toString():r.length===2?r.join(" and "):r.slice(0,-1).join(", ")+", and "+r.slice(-1):""}function _f(r){let e=r.can.includes("*")?["READ","WRITE","UPDATE"]:r.can,t=r.with.domain==="*"?"":r.with.domain,n=r.with.pointers.includes("*")?["all AD4M data"]:r.with.pointers;return`${af(e)} your ${t} actions, with access to ${af(n)}`}var kr=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},M=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},We,Fe,Na,ae,of=class{constructor(r,e,t){We.set(this,void 0),Fe.set(this,void 0),Na.set(this,void 0),ae.set(this,void 0),kr(this,We,e||lt.from(wf(24)).toUrl(),"f"),kr(this,ae,r,"f"),kr(this,Na,t||"ad4m://self","f")}get baseExpression(){return M(this,We,"f")}async getData(id){let tempId=id??M(this,We,"f"),isInstance=await M(this,ae,"f").isSubjectInstance(tempId,M(this,Fe,"f"));if(!isInstance)throw`Not a valid subject instance of ${M(this,Fe,"f")} for ${tempId}`;let results=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), property(C, Property)`),properties=results.map(r=>r.Property);for(let r of properties){let e=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), property_resolve(C, "${r}")`),t=async()=>{let n=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), property_getter(C, "${tempId}", "${r}", Value)`);if(n&&n.length>0){let i=n[0].Value;if(e)try{let a=await M(this,ae,"f").getExpression(i);try{return JSON.parse(a.data)}catch{return a.data}}catch{return i}else return i}else return n||void 0};this[r]=await t()}let results2=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), collection(C, Collection)`);results2||(results2=[]);let collections=results2.map(r=>r.Collection);for(let c of collections){let getProperty=async()=>{let results=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), collection_getter(C, "${tempId}", "${c}", Value)`);return results&&results.length>0&&results[0].Value?eval(results[0].Value):[]};this[c]=await getProperty()}return kr(this,We,tempId,"f"),this}async setProperty(key,value){let setters=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), property_setter(C, "${key}", Setter)`);if(setters&&setters.length>0){let actions=eval(setters[0].Setter),resolveLanguageResults=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), property_resolve_language(C, "${key}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),resolveLanguage&&(value=await M(this,ae,"f").createExpression(value,resolveLanguage)),await M(this,ae,"f").executeAction(actions,M(this,We,"f"),[{name:"value",value}])}}async setCollectionSetter(key,value){let collectionSetters=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), collection_setter(C, "${Mt(key)}", Setter)`);if(collectionSetters||(collectionSetters=[]),collectionSetters.length>0){let actions=eval(collectionSetters[0].Setter);value&&(Array.isArray(value)?await M(this,ae,"f").executeAction(actions,M(this,We,"f"),value.map(r=>({name:"value",value:r}))):await M(this,ae,"f").executeAction(actions,M(this,We,"f"),[{name:"value",value}]))}}async setCollectionAdder(key,value){let adders=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), collection_adder(C, "${Mt(key)}", Adder)`);if(adders||(adders=[]),adders.length>0){let actions=eval(adders[0].Adder);value&&(Array.isArray(value)?await Promise.all(value.map(r=>M(this,ae,"f").executeAction(actions,M(this,We,"f"),[{name:"value",value:r}]))):await M(this,ae,"f").executeAction(actions,M(this,We,"f"),[{name:"value",value}]))}}async setCollectionRemover(key,value){let removers=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), collection_remover(C, "${Mt(key)}", Remover)`);if(removers||(removers=[]),removers.length>0){let actions=eval(removers[0].Remover);value&&(Array.isArray(value)?await Promise.all(value.map(r=>M(this,ae,"f").executeAction(actions,M(this,We,"f"),[{name:"value",value:r}]))):await M(this,ae,"f").executeAction(actions,M(this,We,"f"),[{name:"value",value}]))}}async save(){kr(this,Fe,await M(this,ae,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await M(this,ae,"f").createSubject(this,M(this,We,"f")),await M(this,ae,"f").add(new ct({source:M(this,Na,"f"),predicate:"ad4m://has_child",target:this.baseExpression})),await this.update()}async update(){kr(this,Fe,await M(this,ae,"f").stringOrTemplateObjectToSubjectClass(this),"f");let r=Object.entries(this);for(let[e,t]of r)if(t)if(t?.action)switch(t.action){case"setter":await this.setCollectionSetter(e,t.value);break;case"adder":await this.setCollectionAdder(e,t.value);break;case"remover":await this.setCollectionRemover(e,t.value);default:await this.setCollectionSetter(e,t.value);break}else Array.isArray(t)&&t.length>0?await this.setCollectionSetter(e,t):await this.setProperty(e,t);await this.getData()}async get(){return kr(this,Fe,await M(this,ae,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await this.getData()}async delete(){await M(this,ae,"f").removeSubject(this,M(this,We,"f"))}static async all(r){let e=await r.stringOrTemplateObjectToSubjectClass(this),t=await r.getAllSubjectProxies(e),n=[];if(t){for(let i of t){let a=new this(r,i.X);n.push(await a.get())}return n}return[]}static async query(r,e){let t=e?.source||"ad4m://self",n=await r.stringOrTemplateObjectToSubjectClass(this),i=[];if(e)try{if((await r.infer(`findall([Timestamp, Base], (subject_class("${n}", C), instance(C, Base), link("${t}", Predicate, Base, Timestamp, Author)), AllData), sort(AllData, SortedData), length(SortedData, DataLength).`))[0].DataLength>=e.size){let s=`findall([Timestamp, Base], (subject_class("${n}", C), instance(C, Base), link("${t}", Predicate, Base, Timestamp, Author)), AllData), sort(AllData, SortedData), reverse(SortedData, ReverseSortedData), paginate(ReverseSortedData, ${e.page}, ${e.size}, PageData).`;i=await r.infer(s),i=i[0].PageData.map(u=>({Base:u[1],Timestamp:u[0]}))}else i=await r.infer(`subject_class("${n}", C), instance(C, Base), triple("${t}", Predicate, Base).`)}catch(o){console.log("Query failed",o)}else i=await r.infer(`subject_class("${n}", C), instance(C, Base), triple("${t}", Predicate, Base).`);return i?await Promise.all(i.map(async o=>await new this(r,o.Base).get())):[]}};We=new WeakMap,Fe=new WeakMap,Na=new WeakMap,ae=new WeakMap;var eo="0.8.0";function B1(){let r=new AbortController;return setTimeout(()=>r.abort(),20),r}function oc(r,e=5e3){return ye(this,null,function*(){return Promise.race([new Promise((t,n)=>{let i=new WebSocket(r);i.onopen=()=>{t(i)},i.onerror=a=>{n(a)}}),new Promise((t,n)=>{setTimeout(()=>{n(new Error("WebSocket connection timed out"))},e)})])})}function sc(r){return ye(this,null,function*(){try{let e=yield fetch(`http://localhost:${r}/graphql/`,{signal:B1().signal,mode:"no-cors"});if(e.status===400||e.status===0)return r;throw new Error(`Could not connect to port ${r}`)}catch(e){throw new Error(`Could not connect to port ${r}`)}})}function V1(){return new Promise((r,e)=>{let t=document.querySelector("ad4m-connect"),n=t==null?void 0:t.getAd4mClient();n?r(n):e("No Ad4mClient found")})}function cc(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(r){return!1}return!0}function Ef(r,e){cc()&&localStorage.setItem(`${eo}/${r}`,e)}function Kr(r){return cc()?localStorage.getItem(`${eo}/${r}`):null}function xf(r){cc()&&localStorage.removeItem(`${eo}/${r}`)}var Q1=r=>{let e=new Set;do for(let t of Reflect.ownKeys(r))e.add([r,t]);while((r=Reflect.getPrototypeOf(r))&&r!==Object.prototype);return e};function xi(r,{include:e,exclude:t}={}){let n=i=>{let a=o=>typeof o=="string"?i===o:o.test(i);return e?e.some(a):t?!t.some(a):!0};for(let[i,a]of Q1(r.constructor.prototype)){if(a==="constructor"||!n(a))continue;let o=Reflect.getOwnPropertyDescriptor(i,a);o&&typeof o.value=="function"&&(r[a]=r[a].bind(r))}return r}var Oi=class{constructor({appName:e,appDesc:t,appIconPath:n,appUrl:i,appDomain:a,capabilities:o,port:s,token:u,url:l}){this.activeSocket=null;this.requestedRestart=!1;this.authState="unauthenticated";this.connectionState="not_connected";this.port=12e3;this.capabilities=[];this.listeners={authstatechange:[],configstatechange:[],connectionstatechange:[]};xi(this);this.appName=e,this.appDesc=t,this.appDomain=a,this.appUrl=i,this.appIconPath=n,this.capabilities=o,this.port=s||this.port,this.url=l||`ws://localhost:${this.port}/graphql`,this.token=u||this.token,this.buildClient()}notifyConfigChange(e,t){this.listeners.configstatechange.forEach(n=>{n(e,t)})}notifyConnectionChange(e){this.connectionState!==e&&(this.connectionState=e,this.listeners.connectionstatechange.forEach(t=>{t(e)}))}notifyAuthChange(e){this.authState!==e&&(this.authState=e,this.listeners.authstatechange.forEach(t=>{t(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,t){this.listeners[e].push(t)}connect(e){return ye(this,null,function*(){try{if(e){yield oc(e,1e4),this.setUrl(e);let t=this.buildClient();return yield this.checkAuth(),t}else{let t=yield this.ensureConnection();return yield this.checkAuth(),t}}catch(t){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}connectToPort(e){return ye(this,null,function*(){try{if(e){let t=yield sc(e);this.setPort(t)}else{let t=yield this.findPort();this.setPort(t)}return this.buildClient()}catch(t){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}ensureConnection(){return ye(this,null,function*(){var t,n;if(((t=this.activeSocket)==null?void 0:t.readyState)===WebSocket.OPEN&&((n=this.activeSocket)==null?void 0:n.url)===this.url&&this.ad4mClient)return this.ad4mClient;try{return yield oc(this.url,1e4),this.buildClient()}catch(i){return this.connectToPort()}})}findPort(){return ye(this,null,function*(){let e=[...Array(10).keys()].map((i,a)=>sc(12e3+a)),n=(yield Promise.allSettled(e)).find(i=>i.status==="fulfilled");if(n)return n.value;throw Error("Couldn't find an open port")})}buildClient(){this.notifyConnectionChange("connecting");try{new WebSocket(this.url)}catch(e){this.notifyConnectionChange("not_connected")}return this.apolloClient&&this.wsClient&&(this.requestedRestart=!0,this.wsClient.dispose(),this.apolloClient.stop()),this.wsClient=Fl({url:this.url,connectionParams:()=>ye(this,null,function*(){return{headers:{authorization:this.token}}}),on:{connecting:()=>{this.requestedRestart||this.notifyConnectionChange("connecting")},opened:e=>{this.activeSocket=e},error:e=>{this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")},connected:()=>{this.notifyConnectionChange("connected")},closed:()=>{this.requestedRestart||(this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1)}}}),this.apolloClient=new Is({link:new $l(this.wsClient),cache:new la({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"},mutate:{fetchPolicy:"no-cache"}}}),this.ad4mClient=new Wa(this.apolloClient),this.ad4mClient}checkAuth(){return ye(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 ye(this,null,function*(){var t;return e&&this.setToken(null),this.requestId=yield(t=this.ad4mClient)==null?void 0:t.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 ye(this,null,function*(){var n;let t=yield(n=this.ad4mClient)==null?void 0:n.agent.generateJwt(this.requestId,e);return this.setToken(t),yield this.buildClient(),yield this.checkAuth(),this.token})}};function uc(){return Y`
1012
1012
  <div>
1013
1013
  <div class="lds-ring">
1014
1014
  <div></div>
@@ -1017,7 +1017,7 @@ type Subscription {
1017
1017
  <div></div>
1018
1018
  </div>
1019
1019
  </div>
1020
- `}function fc({port:r,url:e,isRemote:t,connectToPort:n,changeIsRemote:i,connectRemote:a,changeState:o,changeUrl:s,changePort:u}){return Y`
1020
+ `}function lc({port:r,url:e,isRemote:t,connectToPort:n,changeIsRemote:i,connectRemote:a,changeState:o,changeUrl:s,changePort:u}){return Y`
1021
1021
  <div class="items items--small">
1022
1022
  <div class="text-center">
1023
1023
  <h1 class="heading">Connection Settings</h1>
@@ -1076,7 +1076,7 @@ type Subscription {
1076
1076
  </button>
1077
1077
  </div>`}
1078
1078
  </div>
1079
- `}function pc({connect:r,isMobile:e,hasClickedDownload:t,changeState:n,onDownloaded:i,scanQrcode:a}){function o(s){s.preventDefault();let u=s.currentTarget;window.open(u.href,"_blank"),this.onDownloaded()}return Y`
1079
+ `}function fc({connect:r,isMobile:e,hasClickedDownload:t,changeState:n,onDownloaded:i,scanQrcode:a}){function o(s){s.preventDefault();let u=s.currentTarget;window.open(u.href,"_blank"),this.onDownloaded()}return Y`
1080
1080
  <div class="items">
1081
1081
  ${t?Y`<div class="text-center">
1082
1082
  <a class="button" target="_blank" @click=${()=>r()}>
@@ -1117,7 +1117,7 @@ type Subscription {
1117
1117
  >
1118
1118
  </div>
1119
1119
  </div>
1120
- `}function dc({reconnect:r}){return Y`
1120
+ `}function pc({reconnect:r}){return Y`
1121
1121
  <div class="items items--small">
1122
1122
  <div class="text-center">
1123
1123
  <h1 class="heading">Could not connect to AD4M</h1>
@@ -1126,7 +1126,7 @@ type Subscription {
1126
1126
  <button class="button" @click=${()=>r()}>Try again</button>
1127
1127
  </div>
1128
1128
  </div>
1129
- `}function hc({unlockAgent:r,reconnect:e}){return Y`
1129
+ `}function dc({unlockAgent:r,reconnect:e}){return Y`
1130
1130
  <div class="text-center">
1131
1131
  <div class="items">
1132
1132
  <div>
@@ -1138,7 +1138,7 @@ type Subscription {
1138
1138
  <button class="button" @click=${e}>Reconnect</button>
1139
1139
  </div>
1140
1140
  </div>
1141
- `}function mc(){return Y`
1141
+ `}function hc(){return Y`
1142
1142
  <svg viewBox="0 0 692 670" fill="none" xmlns="http://www.w3.org/2000/svg">
1143
1143
  <defs>
1144
1144
  <linearGradient id="gradient" x1="0" x2="1" y1="0" y2="0">
@@ -1151,7 +1151,7 @@ type Subscription {
1151
1151
  fill="url(#gradient)"
1152
1152
  />
1153
1153
  </svg>
1154
- `}function yc({capabilities:r,appname:e,appiconpath:t,changeState:n,setOpen:i,requestCapability:a}){return Y`
1154
+ `}function mc({capabilities:r,appname:e,appiconpath:t,changeState:n,setOpen:i,requestCapability:a}){return Y`
1155
1155
  <div class="items">
1156
1156
  <div class="text-center">
1157
1157
  <p class="body">An external application</p>
@@ -1161,7 +1161,7 @@ type Subscription {
1161
1161
  ${t&&Y`<div class="dialog__connect">
1162
1162
  <img class="dialog__connect-app" src=${t} alt="Logo" />
1163
1163
  <div class="dialog__connect-check"></div>
1164
- <div class="dialog__connect-ad4m">${mc()}</div>
1164
+ <div class="dialog__connect-ad4m">${hc()}</div>
1165
1165
  </div>`}
1166
1166
  <div>
1167
1167
  <p class="text-center"><b>This will allow the developer to:</b></p>
@@ -1180,7 +1180,7 @@ type Subscription {
1180
1180
  />
1181
1181
  </svg>
1182
1182
  </span>
1183
- <span>${Ef(o)}</span>
1183
+ <span>${_f(o)}</span>
1184
1184
  </li>`)}
1185
1185
  </ul>
1186
1186
  </div>
@@ -1205,7 +1205,7 @@ type Subscription {
1205
1205
  Connection settings
1206
1206
  </button>
1207
1207
  </div>
1208
- `}function gc({code:r,changeState:e,verifyCode:t,changeCode:n}){return Y`
1208
+ `}function yc({code:r,changeState:e,verifyCode:t,changeCode:n}){return Y`
1209
1209
  <div class="items">
1210
1210
  <div class="text-center">
1211
1211
  <div class="heading">Please check Ad4m</div>
@@ -1236,7 +1236,7 @@ type Subscription {
1236
1236
  </button>
1237
1237
  </div>
1238
1238
  </div>
1239
- `}function vc(){return Y`
1239
+ `}function gc(){return Y`
1240
1240
  <div class="items">
1241
1241
  <div class="text-center">
1242
1242
  <h1 class="heading">Request to AD4M blocked</h1>
@@ -1257,7 +1257,7 @@ type Subscription {
1257
1257
  </button>
1258
1258
  </div>
1259
1259
  </div>
1260
- `}function bc({changeState:r,onSuccess:e,uiState:t}){function n(i){let a=new BarcodeDetector,o=i.currentTarget,s=()=>ye(this,null,function*(){try{if(t!=="qr")return;let l=(yield a.detect(o)).find(f=>f.format==="qr_code");if(l!=null&&l.rawValue){r("requestcap"),e(l.rawValue);return}else requestAnimationFrame(s)}catch(u){console.error(u)}});s()}return Y`
1260
+ `}function vc({changeState:r,onSuccess:e,uiState:t}){function n(i){let a=new BarcodeDetector,o=i.currentTarget,s=()=>ye(this,null,function*(){try{if(t!=="qr")return;let l=(yield a.detect(o)).find(f=>f.format==="qr_code");if(l!=null&&l.rawValue){r("requestcap"),e(l.rawValue);return}else requestAnimationFrame(s)}catch(u){console.error(u)}});s()}return Y`
1261
1261
  <div class="qr-scanner">
1262
1262
  <div class="qr-content">
1263
1263
  <button
@@ -1276,7 +1276,7 @@ type Subscription {
1276
1276
  ></video>
1277
1277
  </div>
1278
1278
  </div>
1279
- `}function Cc(){return Y`<header class="dialog__header">
1279
+ `}function bc(){return Y`<header class="dialog__header">
1280
1280
  <div class="dialog__logo">
1281
1281
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 37" fill="none">
1282
1282
  <path
@@ -1285,7 +1285,7 @@ type Subscription {
1285
1285
  />
1286
1286
  </svg>
1287
1287
  </div>
1288
- </header>`}function G1(){return[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i].some(e=>navigator.userAgent.match(e))}var K1=ro`
1288
+ </header>`}function W1(){return[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i].some(e=>navigator.userAgent.match(e))}var G1=ro`
1289
1289
  :host {
1290
1290
  --primary-color: #fff;
1291
1291
  --heading-color: #fff;
@@ -1645,15 +1645,15 @@ type Subscription {
1645
1645
  width: 100vw;
1646
1646
  object-fit: cover;
1647
1647
  }
1648
- `,Ee=class extends Bt{constructor(){super(...arguments);this._code=null;this._isMobile=null;this._hasClickedDownload=null;this._isRemote=!1;this._isOpen=!1;this.uiState="start";this.appName=null;this.appDesc=null;this.appDomain=null;this.appIconPath=null;this.capabilities=[];this.token=Kr("ad4murl")||"";this.port=parseInt(Kr("ad4mport"))||12e3;this.url=Kr("ad4murl")||""}get authState(){return this._client.authState}get connectionState(){return this._client.connectionState}connectedCallback(){super.connectedCallback(),xi(this),this._isMobile=G1(),this._client=new Oi({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(Kr("ad4mport"))||12e3,token:this.token||Kr("ad4mtoken"),url:this.url||Kr("ad4murl")}),this._client.on("configstatechange",this.handleConfigChange),this._client.on("authstatechange",this.handleAuthChange),this._client.on("connectionstatechange",this.handleConnectionChange),this.loadFont()}unlockAgent(t,n=!0){return ye(this,null,function*(){yield this._client.ad4mClient.agent.unlock(t,n)})}verifyCode(t){this._client.verifyCode(t)}changeUrl(t){this._client.setUrl(t)}changePort(t){this._client.setPort(t)}changeUIState(t){this.uiState=t}changeIsRemote(t){this._isRemote=t}changeCode(t){this._code=t}onDownloaded(){this._hasClickedDownload=!0}handleAuthChange(t){let n=new CustomEvent("authstatechange",{detail:t});t==="locked"&&(this._isOpen=!0),this.dispatchEvent(n),this.requestUpdate()}handleConfigChange(t,n){this[t]=n,n?xf("ad4m"+t,n):Of("ad4m"+t),this.requestUpdate()}handleConnectionChange(t){t==="connected"&&this.changeUIState("requestcap"),t==="disconnected"&&(this._isOpen=!0),t==="not_connected"&&this.changeUIState("start");let n=new CustomEvent("connectionstatechange",{detail:t});this.dispatchEvent(n),this.requestUpdate()}loadFont(){let t=document.createElement("link");t.rel="stylesheet",t.type="text/css",t.crossOrigin="anonymous",t.href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap",document.head.appendChild(t)}startCamera(t){return ye(this,null,function*(){try{window.BarcodeDetector.getSupportedFormats()}catch(n){window.BarcodeDetector=Qt}yield this.changeUIState("qr"),setTimeout(()=>ye(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 ye(this,null,function*(){return this._isOpen=!0,this.requestUpdate(),yield this._client.connect()})}getAd4mClient(){return this._client.ad4mClient}connectRemote(t){return ye(this,null,function*(){try{let n=yield this._client.connect(t);return this.changeUIState("requestcap"),n}catch(n){n.message==="Socket closed with event 4500 Invalid Compact JWS"&&this.changeUIState("requestcap")}})}requestCapability(t){return ye(this,null,function*(){try{yield this._client.requestCapability(t),this.changeUIState("verifycode")}catch(n){console.warn(n)}})}isAuthenticated(){return ye(this,null,function*(){return this._client.checkAuth()})}setOpen(t){this._isOpen=t}renderViews(){if(this.connectionState==="connecting")return lc();if(this.uiState==="qr")return bc({changeState:this.changeUIState,onSuccess:t=>this._client.connect(t),uiState:this.uiState});if(this.authState==="locked")return hc({unlockAgent:this.unlockAgent,reconnect:this.connect});if(this.uiState==="settings")return fc({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});if(this.connectionState==="not_connected")return pc({scanQrcode:this.startCamera,connect:this.connect,isMobile:this._isMobile,hasClickedDownload:this._hasClickedDownload,onDownloaded:this.onDownloaded,changeState:this.changeUIState});if(this.connectionState==="connected")return this.uiState==="verifycode"?gc({code:this._code,changeCode:this.changeCode,changeState:this.changeUIState,verifyCode:this.verifyCode}):yc({changeState:this.changeUIState,requestCapability:this.requestCapability,capabilities:this.capabilities,appname:this.appName,setOpen:this.setOpen,appiconpath:this.appIconPath});if(this.connectionState==="disconnected")return dc({reconnect:this.connect});if(this.connectionState==="port_not_found")return vc()}render(){return this._isOpen===!1||this.authState==="authenticated"?null:Y`
1648
+ `,Ee=class extends Bt{constructor(){super(...arguments);this._code=null;this._isMobile=null;this._hasClickedDownload=null;this._isRemote=!1;this._isOpen=!1;this.uiState="start";this.appName=null;this.appDesc=null;this.appDomain=null;this.appIconPath=null;this.capabilities=[];this.token=Kr("ad4murl")||"";this.port=parseInt(Kr("ad4mport"))||12e3;this.url=Kr("ad4murl")||""}get authState(){return this._client.authState}get connectionState(){return this._client.connectionState}connectedCallback(){super.connectedCallback(),xi(this),this._isMobile=W1(),this._client=new Oi({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(Kr("ad4mport"))||12e3,token:this.token||Kr("ad4mtoken"),url:this.url||Kr("ad4murl")}),this._client.on("configstatechange",this.handleConfigChange),this._client.on("authstatechange",this.handleAuthChange),this._client.on("connectionstatechange",this.handleConnectionChange),this.loadFont()}unlockAgent(t,n=!0){return ye(this,null,function*(){yield this._client.ad4mClient.agent.unlock(t,n)})}verifyCode(t){this._client.verifyCode(t)}changeUrl(t){this._client.setUrl(t)}changePort(t){this._client.setPort(t)}changeUIState(t){this.uiState=t}changeIsRemote(t){this._isRemote=t}changeCode(t){this._code=t}onDownloaded(){this._hasClickedDownload=!0}handleAuthChange(t){let n=new CustomEvent("authstatechange",{detail:t});t==="locked"&&(this._isOpen=!0),this.dispatchEvent(n),this.requestUpdate()}handleConfigChange(t,n){this[t]=n,n?Ef("ad4m"+t,n):xf("ad4m"+t),this.requestUpdate()}handleConnectionChange(t){t==="connected"&&this.changeUIState("requestcap"),t==="disconnected"&&(this._isOpen=!0),t==="not_connected"&&this.changeUIState("start");let n=new CustomEvent("connectionstatechange",{detail:t});this.dispatchEvent(n),this.requestUpdate()}loadFont(){let t=document.createElement("link");t.rel="stylesheet",t.type="text/css",t.crossOrigin="anonymous",t.href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap",document.head.appendChild(t)}startCamera(t){return ye(this,null,function*(){try{window.BarcodeDetector.getSupportedFormats()}catch(n){window.BarcodeDetector=Qt}yield this.changeUIState("qr"),setTimeout(()=>ye(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 ye(this,null,function*(){return this._isOpen=!0,this.requestUpdate(),yield this._client.connect()})}getAd4mClient(){return this._client.ad4mClient}connectRemote(t){return ye(this,null,function*(){try{let n=yield this._client.connect(t);return this.changeUIState("requestcap"),n}catch(n){n.message==="Socket closed with event 4500 Invalid Compact JWS"&&this.changeUIState("requestcap")}})}requestCapability(t){return ye(this,null,function*(){try{yield this._client.requestCapability(t),this.changeUIState("verifycode")}catch(n){console.warn(n)}})}isAuthenticated(){return ye(this,null,function*(){return this._client.checkAuth()})}setOpen(t){this._isOpen=t}renderViews(){if(this.connectionState==="connecting")return uc();if(this.uiState==="qr")return vc({changeState:this.changeUIState,onSuccess:t=>this._client.connect(t),uiState:this.uiState});if(this.authState==="locked")return dc({unlockAgent:this.unlockAgent,reconnect:this.connect});if(this.uiState==="settings")return lc({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});if(this.connectionState==="not_connected")return fc({scanQrcode:this.startCamera,connect:this.connect,isMobile:this._isMobile,hasClickedDownload:this._hasClickedDownload,onDownloaded:this.onDownloaded,changeState:this.changeUIState});if(this.connectionState==="connected")return this.uiState==="verifycode"?yc({code:this._code,changeCode:this.changeCode,changeState:this.changeUIState,verifyCode:this.verifyCode}):mc({changeState:this.changeUIState,requestCapability:this.requestCapability,capabilities:this.capabilities,appname:this.appName,setOpen:this.setOpen,appiconpath:this.appIconPath});if(this.connectionState==="disconnected")return pc({reconnect:this.connect});if(this.connectionState==="port_not_found")return gc()}render(){return this._isOpen===!1||this.authState==="authenticated"?null:Y`
1649
1649
  <div class="wrapper">
1650
1650
  <div class="dialog">
1651
- ${Cc()}
1651
+ ${bc()}
1652
1652
  <main class="dialog__content">${this.renderViews()}</main>
1653
1653
  </div>
1654
1654
  <div class="ad4mConnect__backdrop" />
1655
1655
  </div>
1656
- `}};Ee.styles=[K1],Pe([Vt()],Ee.prototype,"_code",2),Pe([Vt()],Ee.prototype,"_isMobile",2),Pe([Vt()],Ee.prototype,"_hasClickedDownload",2),Pe([Vt()],Ee.prototype,"_isRemote",2),Pe([Vt()],Ee.prototype,"_client",2),Pe([Vt()],Ee.prototype,"_isOpen",2),Pe([Vt()],Ee.prototype,"uiState",2),Pe([ft({type:String,reflect:!0})],Ee.prototype,"appName",2),Pe([ft({type:String,reflect:!0})],Ee.prototype,"appDesc",2),Pe([ft({type:String,reflect:!0})],Ee.prototype,"appDomain",2),Pe([ft({type:String,reflect:!0})],Ee.prototype,"appIconPath",2),Pe([ft({type:String,reflect:!0})],Ee.prototype,"capabilities",2),Pe([ft({type:String})],Ee.prototype,"token",2),Pe([ft({type:String,reflect:!0})],Ee.prototype,"port",2),Pe([ft({type:String,reflect:!0})],Ee.prototype,"url",2),Ee=Pe([Uc("ad4m-connect")],Ee);function z1(r){let e=new Ee;return Object.entries(r).forEach(([t,n])=>{e[t]=n}),document.body.appendChild(e),e}export{Ee as Ad4mConnectElement,z1 as default,Q1 as getAd4mClient};
1656
+ `}};Ee.styles=[G1],Ne([Vt()],Ee.prototype,"_code",2),Ne([Vt()],Ee.prototype,"_isMobile",2),Ne([Vt()],Ee.prototype,"_hasClickedDownload",2),Ne([Vt()],Ee.prototype,"_isRemote",2),Ne([Vt()],Ee.prototype,"_client",2),Ne([Vt()],Ee.prototype,"_isOpen",2),Ne([Vt()],Ee.prototype,"uiState",2),Ne([ft({type:String,reflect:!0})],Ee.prototype,"appName",2),Ne([ft({type:String,reflect:!0})],Ee.prototype,"appDesc",2),Ne([ft({type:String,reflect:!0})],Ee.prototype,"appDomain",2),Ne([ft({type:String,reflect:!0})],Ee.prototype,"appIconPath",2),Ne([ft({type:String,reflect:!0})],Ee.prototype,"capabilities",2),Ne([ft({type:String})],Ee.prototype,"token",2),Ne([ft({type:String,reflect:!0})],Ee.prototype,"port",2),Ne([ft({type:String,reflect:!0})],Ee.prototype,"url",2),Ee=Ne([jc("ad4m-connect")],Ee);function K1(r){let e=new Ee;return Object.entries(r).forEach(([t,n])=>{e[t]=n}),document.body.appendChild(e),e}export{Ee as Ad4mConnectElement,K1 as default,V1 as getAd4mClient};
1657
1657
  /*!
1658
1658
  * @undecaf/barcode-detector-polyfill v0.9.20
1659
1659
  * A WebAssembly polyfill for the Barcode Detection API