@coasys/ad4m-connect 0.9.1-prerelease.8 → 0.10.0-prerelease
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core.d.ts +2 -2
- package/dist/core.js +99 -95
- package/dist/utils.js +1 -1
- package/dist/web.js +117 -113
- package/package.json +2 -2
- package/dist/index.js +0 -807
- package/dist/src/components/AgentLocked.d.ts +0 -4
- package/dist/src/components/CapNotMatching.d.ts +0 -1
- package/dist/src/components/CouldNotMakeRequest.d.ts +0 -1
- package/dist/src/components/Disconnected.d.ts +0 -3
- package/dist/src/components/Header.d.ts +0 -1
- package/dist/src/components/InvalidToken.d.ts +0 -3
- package/dist/src/components/Loading.d.ts +0 -1
- package/dist/src/components/Logo.d.ts +0 -1
- package/dist/src/components/RemoteUrl.d.ts +0 -6
- package/dist/src/components/RequestCapability.d.ts +0 -7
- package/dist/src/components/Start.d.ts +0 -8
- package/dist/src/components/VerifyCode.d.ts +0 -6
- package/dist/src/core.d.ts +0 -57
- package/dist/src/electron.d.ts +0 -2
- package/dist/src/utils.d.ts +0 -6
- package/dist/src/web.d.ts +0 -40
package/dist/web.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
var Ap=Object.defineProperty;var kp=Object.getOwnPropertyDescriptor;var he=(r,e,t,n)=>{for(var i=n>1?void 0:n?kp(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&&Ap(e,t,i),i};var ue=(r,e,t)=>new Promise((n,i)=>{var a=c=>{try{s(t.next(c))}catch(u){i(u)}},o=c=>{try{s(t.throw(c))}catch(u){i(u)}},s=c=>c.done?n(c.value):Promise.resolve(c.value).then(a,o);s((t=t.apply(r,e)).next())});var
|
|
2
|
-
\f\r]`,Dn=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ac=/'/g,kc=/"/g,Lc=/^(?:script|style|textarea|title)$/i,Fc=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),q=Fc(1),ih=Fc(2),fr=Symbol.for("lit-noChange"),Ie=Symbol.for("lit-nothing"),Dc=new WeakMap,lr=pr.createTreeWalker(pr,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 Rp=(r,e)=>{let t=r.length-1,n=[],i,a=e===2?"<svg>":"",o=Dn;for(let s=0;s<t;s++){let c=r[s],u,l,p=-1,d=0;for(;d<c.length&&(o.lastIndex=d,l=o.exec(c),l!==null);)d=o.lastIndex,o===Dn?l[1]==="!--"?o=Tc:l[1]!==void 0?o=Ic:l[2]!==void 0?(Lc.test(l[2])&&(i=RegExp("</"+l[2],"g")),o=ur):l[3]!==void 0&&(o=ur):o===ur?l[0]===">"?(o=i??Dn,p=-1):l[1]===void 0?p=-2:(p=o.lastIndex-l[2].length,u=l[1],o=l[3]===void 0?ur:l[3]==='"'?kc:Ac):o===kc||o===Ac?o=ur:o===Tc||o===Ic?o=Dn:(o=ur,i=void 0);let f=o===ur&&r[s+1].startsWith("/>")?" ":"";a+=o===Dn?c+Np:p>=0?(n.push(u),c.slice(0,p)+po+c.slice(p)+Ut+f):c+Ut+(p===-2?(n.push(void 0),s):f)}return[$c(r,a+(r[t]||"<?>")+(e===2?"</svg>":"")),n]},dr=class{constructor({strings:e,_$litType$:t},n){let i;this.parts=[];let a=0,o=0,s=e.length-1,c=this.parts,[u,l]=Rp(e,t);if(this.el=dr.createElement(u,n),lr.currentNode=this.el.content,t===2){let p=this.el.content,d=p.firstChild;d.remove(),p.append(...d.childNodes)}for(;(i=lr.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes()){let p=[];for(let d of i.getAttributeNames())if(d.endsWith(po)||d.startsWith(Ut)){let f=l[o++];if(p.push(d),f!==void 0){let m=i.getAttribute(f.toLowerCase()+po).split(Ut),g=/([.?@])?(.*)/.exec(f);c.push({type:1,index:a,name:g[2],strings:m,ctor:g[1]==="."?ho:g[1]==="?"?mo:g[1]==="@"?go:Jr})}else c.push({type:6,index:a})}for(let d of p)i.removeAttribute(d)}if(Lc.test(i.tagName)){let p=i.textContent.split(Ut),d=p.length-1;if(d>0){i.textContent=zr?zr.emptyScript:"";for(let f=0;f<d;f++)i.append(p[f],Nn()),lr.nextNode(),c.push({type:2,index:++a});i.append(p[d],Nn())}}}else if(i.nodeType===8)if(i.data===Pc)c.push({type:2,index:a});else{let p=-1;for(;(p=i.data.indexOf(Ut,p+1))!==-1;)c.push({type:7,index:a}),p+=Ut.length-1}a++}}static createElement(e,t){let n=pr.createElement("template");return n.innerHTML=e,n}};function Hr(r,e,t=r,n){var i,a,o,s;if(e===fr)return e;let c=n!==void 0?(i=t._$Co)===null||i===void 0?void 0:i[n]:t._$Cl,u=Pn(e)?void 0:e._$litDirective$;return c?.constructor!==u&&((a=c?._$AO)===null||a===void 0||a.call(c,!1),u===void 0?c=void 0:(c=new u(r),c._$AT(r,t,n)),n!==void 0?((o=(s=t)._$Co)!==null&&o!==void 0?o:s._$Co=[])[n]=c:t._$Cl=c),c!==void 0&&(e=Hr(r,c._$AS(r,e.values),c,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:pr).importNode(n,!0);lr.currentNode=a;let o=lr.nextNode(),s=0,c=0,u=i[0];for(;u!==void 0;){if(s===u.index){let l;u.type===2?l=new hr(o,o.nextSibling,this,e):u.type===1?l=new u.ctor(o,u.name,u.strings,this,e):u.type===6&&(l=new yo(o,this,e)),this._$AV.push(l),u=i[++c]}s!==u?.index&&(o=lr.nextNode(),s++)}return lr.currentNode=pr,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++}},hr=class{constructor(e,t,n,i){var a;this.type=2,this._$AH=Ie,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=Hr(this,e,t),Pn(e)?e===Ie||e==null||e===""?(this._$AH!==Ie&&this._$AR(),this._$AH=Ie):e!==this._$AH&&e!==fr&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):Pp(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!==Ie&&Pn(this._$AH)?this._$AA.nextSibling.data=e:this.$(pr.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=dr.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 dr(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 hr(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))}},Jr=class{constructor(e,t,n,i,a){this.type=1,this._$AH=Ie,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=Ie}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=Hr(this,e,t,0),o=!Pn(e)||e!==this._$AH&&e!==fr,o&&(this._$AH=e);else{let s=e,c,u;for(e=a[0],c=0;c<a.length-1;c++)u=Hr(this,s[n+c],t,c),u===fr&&(u=this._$AH[c]),o||(o=!Pn(u)||u!==this._$AH[c]),u===Ie?e=Ie:e!==Ie&&(e+=(u??"")+a[c+1]),this._$AH[c]=u}o&&!i&&this.j(e)}j(e){e===Ie?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},ho=class extends Jr{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Ie?void 0:e}},Lp=zr?zr.emptyScript:"",mo=class extends Jr{constructor(){super(...arguments),this.type=4}j(e){e&&e!==Ie?this.element.setAttribute(this.name,Lp):this.element.removeAttribute(this.name)}},go=class extends Jr{constructor(e,t,n,i,a){super(e,t,n,i,a),this.type=5}_$AI(e,t=this){var n;if((e=(n=Hr(this,e,t,0))!==null&&n!==void 0?n:Ie)===fr)return;let i=this._$AH,a=e===Ie&&i!==Ie||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,o=e!==Ie&&(i===Ie||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){Hr(this,e)}};var Nc=Ni.litHtmlPolyfillSupport;Nc?.(dr,hr),((uo=Ni.litHtmlVersions)!==null&&uo!==void 0?uo: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 hr(e.insertBefore(Nn(),s),s,void 0,t??{})}return o._$AI(r),o};var vo,bo;var qt=class extends At{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 fr}};qt.finalized=!0,qt._$litElement$=!0,(vo=globalThis.litElementHydrateSupport)===null||vo===void 0||vo.call(globalThis,{LitElement:qt});var jc=globalThis.litElementPolyfillSupport;jc?.({LitElement:qt});((bo=globalThis.litElementVersions)!==null&&bo!==void 0?bo: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 Fp=(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)}},$p=(r,e,t)=>{e.constructor.createProperty(t,r)};function it(r){return(e,t)=>t!==void 0?$p(r,e,t):Fp(r,e)}function Ye(r){return it({...r,state:!0})}var Co,Dh=((Co=window.HTMLSlotElement)===null||Co===void 0?void 0:Co.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 Mp,getDefaultScanner as jp}from"https://cdn.jsdelivr.net/npm/@undecaf/zbar-wasm@0.9.15/dist/main.js";function Up(r,e,t,n){return new(t||(t=Promise))(function(i,a){function o(u){try{c(n.next(u))}catch(l){a(l)}}function s(u){try{c(n.throw(u))}catch(l){a(l)}}function c(u){var l;u.done?i(u.value):(l=u.value,l instanceof t?l:new t(function(p){p(l)})).then(o,s)}c((n=n.apply(r,e||[])).next())})}var k=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 k.formatsToConfigs[e]=t,k.typesToFormats[n]=k.typesToFormats[n]||e,t}static formats(){return Object.keys(k.formatsToConfigs)}static toFormat(e){return k.typesToFormats[e]}static configure(e,t){var n;(n=k.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;k.formatsToConfigs={},k.typesToFormats={},k.register("codabar",new k(X.ZBAR_CODABAR)),k.register("code_39",new k(X.ZBAR_CODE39)),k.register("code_93",new k(X.ZBAR_CODE93)),k.register("code_128",new k(X.ZBAR_CODE128)),k.register("databar",new k(X.ZBAR_DATABAR)),k.register("databar_exp",new k(X.ZBAR_DATABAR_EXP)),k.register("ean_2",new k(X.ZBAR_EAN2)),k.register("ean_5",new k(X.ZBAR_EAN5)),k.register("ean_8",new k(X.ZBAR_EAN8)),k.register("ean_13",new k(X.ZBAR_EAN13)),k.register("ean_13+2",new k(X.ZBAR_EAN13)).add(new k(X.ZBAR_EAN2)),k.register("ean_13+5",new k(X.ZBAR_EAN13)).add(new k(X.ZBAR_EAN5)),k.register("isbn_10",new k(X.ZBAR_ISBN10)).add(new k(X.ZBAR_EAN13)),k.register("isbn_13",new k(X.ZBAR_ISBN13)).add(new k(X.ZBAR_EAN13)),k.register("isbn_13+2",new k(X.ZBAR_ISBN13)).add(new k(X.ZBAR_EAN13)).add(new k(X.ZBAR_EAN2)),k.register("isbn_13+5",new k(X.ZBAR_ISBN13)).add(new k(X.ZBAR_EAN13)).add(new k(X.ZBAR_EAN5)),k.register("itf",new k(X.ZBAR_I25)),k.register("qr_code",new k(X.ZBAR_QRCODE)),k.register("sq_code",new k(X.ZBAR_SQCODE)),k.register("upc_a",new k(X.ZBAR_UPCA)).add(new k(X.ZBAR_EAN13)),k.register("upc_e",new k(X.ZBAR_UPCE)).add(new k(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 So=class{},qp=(()=>{try{return new OffscreenCanvas(1,1).getContext("2d")instanceof OffscreenCanvasRenderingContext2D}catch{return!1}})(),Bt=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=>!k.formats().includes(n));if(t.length)throw new TypeError(`Unsupported barcode format(s): ${t.join(", ")}`)}this.formats=e.formats||k.formats(),this.zbarConfig=e.zbar||new So}static getSupportedFormats(){return Promise.resolve(k.formats())}detect(e){if(!Bt.isImageBitmapSource(e))throw new TypeError("BarcodeDetector.detect() argument is not an ImageBitmapSource");let t=Bt.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),Mp(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)=>Up(this,void 0,void 0,function*(){if(!this.scanner){let n=yield jp();this.formats.length>0&&(n.setConfig(X.ZBAR_NONE,Bc.ZBAR_CFG_ENABLE,0),this.formats.forEach(i=>k.configure(n,i))),this.scanner=n}e(this.scanner)}))}toImageData(e){let t=n=>{let i=Bt.intrinsicDimensions(n);this.canvas&&this.canvas.width===i.width&&this.canvas.height===i.height||(this.canvas=function(s,c){if(qp)return new OffscreenCanvas(s,c);{let u=document.createElement("canvas");return u.width=s,u.height=c,u}}(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:k.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 wo=function(r,e){return wo=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])},wo(r,e)};function be(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");wo(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var h=function(){return h=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},h.apply(this,arguments)};function St(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 ut(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(l){try{u(n.next(l))}catch(p){o(p)}}function c(l){try{u(n.throw(l))}catch(p){o(p)}}function u(l){l.done?a(l.value):i(l.value).then(s,c)}u((n=n.apply(r,e||[])).next())})}function lt(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(u){return function(l){return c([u,l])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(t=0)),t;)try{if(n=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){t.label=u[1];break}if(u[0]===6&&t.label<a[1]){t.label=a[1],a=u;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(u);break}a[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(l){u=[6,l],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Vt(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 _o="Invariant Violation",Vc=Object.setPrototypeOf,Bp=Vc===void 0?function(r,e){return r.__proto__=e,r}:Vc,M=function(r){be(e,r);function e(t){t===void 0&&(t=_o);var n=r.call(this,typeof t=="number"?_o+": "+t+" (see https://github.com/apollographql/invariant-packages)":t)||this;return n.framesToPop=1,n.name=_o,Bp(n,e.prototype),n}return e}(Error);function T(r,e){if(!r)throw new M(e)}var Ri=["debug","log","warn","error","silent"],Eo=Ri.indexOf("log");function Pi(r){return function(){if(Ri.indexOf(r)>=Eo){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[Eo];return Eo=Math.max(0,Ri.indexOf(r)),e}function Ae(r){try{return r()}catch{}}var Li=Ae(function(){return globalThis})||Ae(function(){return window})||Ae(function(){return self})||Ae(function(){return global})||Ae(function(){return Ae.constructor("return this")()});var Gc="__",Wc=[Gc,Gc].join("DEV");function Vp(){try{return Boolean(__DEV__)}catch{return Object.defineProperty(Li,Wc,{value:Ae(function(){return"production"})!=="production",enumerable:!1,configurable:!0,writable:!0}),Li[Wc]}}var mr=Vp();function Qt(r){try{return r()}catch{}}var xo=Qt(function(){return globalThis})||Qt(function(){return window})||Qt(function(){return self})||Qt(function(){return global})||Qt(function(){return Qt.constructor("return this")()}),Oo=!1;function Qp(){xo&&!Qt(function(){return"production"})&&!Qt(function(){return process})&&(Object.defineProperty(xo,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),Oo=!0)}Qp();function To(){Oo&&(delete xo.process,Oo=!1)}var a2=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",o2=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator",Kc=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";var Ee=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 Io(r,e){var t=Boolean(r);if(!t)throw new Error(e??"Unexpected invariant triggered.")}var Gp=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,Ln=Gp;function Fi(r){var e=r.prototype.toJSON;typeof e=="function"||Io(0),r.prototype.inspect=e,Ln&&(r.prototype[Ln]=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,c){this.kind=t,this.start=n,this.end=i,this.line=a,this.column=o,this.value=c,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 Wp=10,Jc=2;function Fn(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":Kp(r,e);default:return String(r)}}function Kp(r,e){if(e.indexOf(r)!==-1)return"[Circular]";var t=[].concat(e,[r]),n=Jp(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 Hp(r,t);return zp(r,t)}function zp(r,e){var t=Object.keys(r);if(t.length===0)return"{}";if(e.length>Jc)return"["+Yp(r)+"]";var n=t.map(function(i){var a=Mi(r[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function Hp(r,e){if(r.length===0)return"[]";if(e.length>Jc)return"[Array]";for(var t=Math.min(Wp,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 Jp(r){var e=r[String(Ln)];if(typeof e=="function")return e;if(typeof r.inspect=="function")return r.inspect}function Yp(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 $n(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 Xp(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"||$n(0,"Body must be a string. Received: ".concat(Fn(e),".")),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||$n(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||$n(0,"column in locationOffset is 1-indexed and must be positive.")}return Xp(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 Ap=Object.defineProperty;var kp=Object.getOwnPropertyDescriptor;var he=(r,e,t,n)=>{for(var i=n>1?void 0:n?kp(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&&Ap(e,t,i),i};var ue=(r,e,t)=>new Promise((n,i)=>{var a=c=>{try{s(t.next(c))}catch(u){i(u)}},o=c=>{try{s(t.throw(c))}catch(u){i(u)}},s=c=>c.done?n(c.value):Promise.resolve(c.value).then(a,o);s((t=t.apply(r,e)).next())});var ki=window,Di=ki.ShadowRoot&&(ki.ShadyCSS===void 0||ki.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,no=Symbol(),_c=new WeakMap,kn=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==no)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(Di&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=_c.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&_c.set(t,e))}return e}toString(){return this.cssText}},Ec=r=>new kn(typeof r=="string"?r:r+"",void 0,no),io=(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 kn(t,r,no)},ao=(r,e)=>{Di?r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet):e.forEach(t=>{let n=document.createElement("style"),i=ki.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=t.cssText,r.appendChild(n)})},Ni=Di?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(let n of e.cssRules)t+=n.cssText;return Ec(t)})(r):r;var oo,Pi=window,xc=Pi.trustedTypes,Dp=xc?xc.emptyScript:"",Oc=Pi.reactiveElementPolyfillSupport,co={toAttribute(r,e){switch(e){case Boolean:r=r?Dp: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}},Tc=(r,e)=>e!==r&&(e==e||r==r),so={attribute:!0,type:String,converter:co,reflect:!1,hasChanged:Tc},uo="finalized",At=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=so){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)||so}static finalize(){if(this.hasOwnProperty(uo))return!1;this[uo]=!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(Ni(i))}else e!==void 0&&t.push(Ni(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 ao(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=so){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:co).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:co;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||Tc)(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){}};At[uo]=!0,At.elementProperties=new Map,At.elementStyles=[],At.shadowRootOptions={mode:"open"},Oc?.({ReactiveElement:At}),((oo=Pi.reactiveElementVersions)!==null&&oo!==void 0?oo:Pi.reactiveElementVersions=[]).push("1.6.3");var lo,Ri=window,zr=Ri.trustedTypes,Ic=zr?zr.createPolicy("lit-html",{createHTML:r=>r}):void 0,fo="$lit$",Ut=`lit$${(Math.random()+"").slice(9)}$`,Lc="?"+Ut,Np=`<${Lc}>`,pr=document,Nn=()=>pr.createComment(""),Pn=r=>r===null||typeof r!="object"&&typeof r!="function",Fc=Array.isArray,Pp=r=>Fc(r)||typeof r?.[Symbol.iterator]=="function",po=`[
|
|
2
|
+
\f\r]`,Dn=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ac=/-->/g,kc=/>/g,ur=RegExp(`>|${po}(?:([^\\s"'>=/]+)(${po}*=${po}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Dc=/'/g,Nc=/"/g,$c=/^(?:script|style|textarea|title)$/i,Mc=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),q=Mc(1),ih=Mc(2),fr=Symbol.for("lit-noChange"),Ie=Symbol.for("lit-nothing"),Pc=new WeakMap,lr=pr.createTreeWalker(pr,129,null,!1);function jc(r,e){if(!Array.isArray(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ic!==void 0?Ic.createHTML(e):e}var Rp=(r,e)=>{let t=r.length-1,n=[],i,a=e===2?"<svg>":"",o=Dn;for(let s=0;s<t;s++){let c=r[s],u,l,p=-1,d=0;for(;d<c.length&&(o.lastIndex=d,l=o.exec(c),l!==null);)d=o.lastIndex,o===Dn?l[1]==="!--"?o=Ac:l[1]!==void 0?o=kc:l[2]!==void 0?($c.test(l[2])&&(i=RegExp("</"+l[2],"g")),o=ur):l[3]!==void 0&&(o=ur):o===ur?l[0]===">"?(o=i??Dn,p=-1):l[1]===void 0?p=-2:(p=o.lastIndex-l[2].length,u=l[1],o=l[3]===void 0?ur:l[3]==='"'?Nc:Dc):o===Nc||o===Dc?o=ur:o===Ac||o===kc?o=Dn:(o=ur,i=void 0);let f=o===ur&&r[s+1].startsWith("/>")?" ":"";a+=o===Dn?c+Np:p>=0?(n.push(u),c.slice(0,p)+fo+c.slice(p)+Ut+f):c+Ut+(p===-2?(n.push(void 0),s):f)}return[jc(r,a+(r[t]||"<?>")+(e===2?"</svg>":"")),n]},dr=class{constructor({strings:e,_$litType$:t},n){let i;this.parts=[];let a=0,o=0,s=e.length-1,c=this.parts,[u,l]=Rp(e,t);if(this.el=dr.createElement(u,n),lr.currentNode=this.el.content,t===2){let p=this.el.content,d=p.firstChild;d.remove(),p.append(...d.childNodes)}for(;(i=lr.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes()){let p=[];for(let d of i.getAttributeNames())if(d.endsWith(fo)||d.startsWith(Ut)){let f=l[o++];if(p.push(d),f!==void 0){let m=i.getAttribute(f.toLowerCase()+fo).split(Ut),g=/([.?@])?(.*)/.exec(f);c.push({type:1,index:a,name:g[2],strings:m,ctor:g[1]==="."?mo:g[1]==="?"?go:g[1]==="@"?yo:Jr})}else c.push({type:6,index:a})}for(let d of p)i.removeAttribute(d)}if($c.test(i.tagName)){let p=i.textContent.split(Ut),d=p.length-1;if(d>0){i.textContent=zr?zr.emptyScript:"";for(let f=0;f<d;f++)i.append(p[f],Nn()),lr.nextNode(),c.push({type:2,index:++a});i.append(p[d],Nn())}}}else if(i.nodeType===8)if(i.data===Lc)c.push({type:2,index:a});else{let p=-1;for(;(p=i.data.indexOf(Ut,p+1))!==-1;)c.push({type:7,index:a}),p+=Ut.length-1}a++}}static createElement(e,t){let n=pr.createElement("template");return n.innerHTML=e,n}};function Hr(r,e,t=r,n){var i,a,o,s;if(e===fr)return e;let c=n!==void 0?(i=t._$Co)===null||i===void 0?void 0:i[n]:t._$Cl,u=Pn(e)?void 0:e._$litDirective$;return c?.constructor!==u&&((a=c?._$AO)===null||a===void 0||a.call(c,!1),u===void 0?c=void 0:(c=new u(r),c._$AT(r,t,n)),n!==void 0?((o=(s=t)._$Co)!==null&&o!==void 0?o:s._$Co=[])[n]=c:t._$Cl=c),c!==void 0&&(e=Hr(r,c._$AS(r,e.values),c,n)),e}var ho=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:pr).importNode(n,!0);lr.currentNode=a;let o=lr.nextNode(),s=0,c=0,u=i[0];for(;u!==void 0;){if(s===u.index){let l;u.type===2?l=new hr(o,o.nextSibling,this,e):u.type===1?l=new u.ctor(o,u.name,u.strings,this,e):u.type===6&&(l=new vo(o,this,e)),this._$AV.push(l),u=i[++c]}s!==u?.index&&(o=lr.nextNode(),s++)}return lr.currentNode=pr,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++}},hr=class{constructor(e,t,n,i){var a;this.type=2,this._$AH=Ie,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=Hr(this,e,t),Pn(e)?e===Ie||e==null||e===""?(this._$AH!==Ie&&this._$AR(),this._$AH=Ie):e!==this._$AH&&e!==fr&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):Pp(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!==Ie&&Pn(this._$AH)?this._$AA.nextSibling.data=e:this.$(pr.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=dr.createElement(jc(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 ho(a,this),s=o.u(this.options);o.v(n),this.$(s),this._$AH=o}}_$AC(e){let t=Pc.get(e.strings);return t===void 0&&Pc.set(e.strings,t=new dr(e)),t}T(e){Fc(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 hr(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))}},Jr=class{constructor(e,t,n,i,a){this.type=1,this._$AH=Ie,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=Ie}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=Hr(this,e,t,0),o=!Pn(e)||e!==this._$AH&&e!==fr,o&&(this._$AH=e);else{let s=e,c,u;for(e=a[0],c=0;c<a.length-1;c++)u=Hr(this,s[n+c],t,c),u===fr&&(u=this._$AH[c]),o||(o=!Pn(u)||u!==this._$AH[c]),u===Ie?e=Ie:e!==Ie&&(e+=(u??"")+a[c+1]),this._$AH[c]=u}o&&!i&&this.j(e)}j(e){e===Ie?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},mo=class extends Jr{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Ie?void 0:e}},Lp=zr?zr.emptyScript:"",go=class extends Jr{constructor(){super(...arguments),this.type=4}j(e){e&&e!==Ie?this.element.setAttribute(this.name,Lp):this.element.removeAttribute(this.name)}},yo=class extends Jr{constructor(e,t,n,i,a){super(e,t,n,i,a),this.type=5}_$AI(e,t=this){var n;if((e=(n=Hr(this,e,t,0))!==null&&n!==void 0?n:Ie)===fr)return;let i=this._$AH,a=e===Ie&&i!==Ie||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,o=e!==Ie&&(i===Ie||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)}},vo=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){Hr(this,e)}};var Rc=Ri.litHtmlPolyfillSupport;Rc?.(dr,hr),((lo=Ri.litHtmlVersions)!==null&&lo!==void 0?lo:Ri.litHtmlVersions=[]).push("2.8.0");var Uc=(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 hr(e.insertBefore(Nn(),s),s,void 0,t??{})}return o._$AI(r),o};var bo,Co;var qt=class extends At{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=Uc(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 fr}};qt.finalized=!0,qt._$litElement$=!0,(bo=globalThis.litElementHydrateSupport)===null||bo===void 0||bo.call(globalThis,{LitElement:qt});var qc=globalThis.litElementPolyfillSupport;qc?.({LitElement:qt});((Co=globalThis.litElementVersions)!==null&&Co!==void 0?Co:globalThis.litElementVersions=[]).push("3.3.3");var Bc=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 Fp=(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)}},$p=(r,e,t)=>{e.constructor.createProperty(t,r)};function it(r){return(e,t)=>t!==void 0?$p(r,e,t):Fp(r,e)}function Ye(r){return it({...r,state:!0})}var So,Dh=((So=window.HTMLSlotElement)===null||So===void 0?void 0:So.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 Mp,getDefaultScanner as jp}from"https://cdn.jsdelivr.net/npm/@undecaf/zbar-wasm@0.9.15/dist/main.js";function Up(r,e,t,n){return new(t||(t=Promise))(function(i,a){function o(u){try{c(n.next(u))}catch(l){a(l)}}function s(u){try{c(n.throw(u))}catch(l){a(l)}}function c(u){var l;u.done?i(u.value):(l=u.value,l instanceof t?l:new t(function(p){p(l)})).then(o,s)}c((n=n.apply(r,e||[])).next())})}var k=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 k.formatsToConfigs[e]=t,k.typesToFormats[n]=k.typesToFormats[n]||e,t}static formats(){return Object.keys(k.formatsToConfigs)}static toFormat(e){return k.typesToFormats[e]}static configure(e,t){var n;(n=k.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}},Vc;k.formatsToConfigs={},k.typesToFormats={},k.register("codabar",new k(X.ZBAR_CODABAR)),k.register("code_39",new k(X.ZBAR_CODE39)),k.register("code_93",new k(X.ZBAR_CODE93)),k.register("code_128",new k(X.ZBAR_CODE128)),k.register("databar",new k(X.ZBAR_DATABAR)),k.register("databar_exp",new k(X.ZBAR_DATABAR_EXP)),k.register("ean_2",new k(X.ZBAR_EAN2)),k.register("ean_5",new k(X.ZBAR_EAN5)),k.register("ean_8",new k(X.ZBAR_EAN8)),k.register("ean_13",new k(X.ZBAR_EAN13)),k.register("ean_13+2",new k(X.ZBAR_EAN13)).add(new k(X.ZBAR_EAN2)),k.register("ean_13+5",new k(X.ZBAR_EAN13)).add(new k(X.ZBAR_EAN5)),k.register("isbn_10",new k(X.ZBAR_ISBN10)).add(new k(X.ZBAR_EAN13)),k.register("isbn_13",new k(X.ZBAR_ISBN13)).add(new k(X.ZBAR_EAN13)),k.register("isbn_13+2",new k(X.ZBAR_ISBN13)).add(new k(X.ZBAR_EAN13)).add(new k(X.ZBAR_EAN2)),k.register("isbn_13+5",new k(X.ZBAR_ISBN13)).add(new k(X.ZBAR_EAN13)).add(new k(X.ZBAR_EAN5)),k.register("itf",new k(X.ZBAR_I25)),k.register("qr_code",new k(X.ZBAR_QRCODE)),k.register("sq_code",new k(X.ZBAR_SQCODE)),k.register("upc_a",new k(X.ZBAR_UPCA)).add(new k(X.ZBAR_EAN13)),k.register("upc_e",new k(X.ZBAR_UPCE)).add(new k(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"}(Vc||(Vc={}));var wo=class{},qp=(()=>{try{return new OffscreenCanvas(1,1).getContext("2d")instanceof OffscreenCanvasRenderingContext2D}catch{return!1}})(),Bt=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=>!k.formats().includes(n));if(t.length)throw new TypeError(`Unsupported barcode format(s): ${t.join(", ")}`)}this.formats=e.formats||k.formats(),this.zbarConfig=e.zbar||new wo}static getSupportedFormats(){return Promise.resolve(k.formats())}detect(e){if(!Bt.isImageBitmapSource(e))throw new TypeError("BarcodeDetector.detect() argument is not an ImageBitmapSource");let t=Bt.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),Mp(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)=>Up(this,void 0,void 0,function*(){if(!this.scanner){let n=yield jp();this.formats.length>0&&(n.setConfig(X.ZBAR_NONE,Qc.ZBAR_CFG_ENABLE,0),this.formats.forEach(i=>k.configure(n,i))),this.scanner=n}e(this.scanner)}))}toImageData(e){let t=n=>{let i=Bt.intrinsicDimensions(n);this.canvas&&this.canvas.width===i.width&&this.canvas.height===i.height||(this.canvas=function(s,c){if(qp)return new OffscreenCanvas(s,c);{let u=document.createElement("canvas");return u.width=s,u.height=c,u}}(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:k.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 _o=function(r,e){return _o=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])},_o(r,e)};function be(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");_o(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var h=function(){return h=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},h.apply(this,arguments)};function St(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 ut(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(l){try{u(n.next(l))}catch(p){o(p)}}function c(l){try{u(n.throw(l))}catch(p){o(p)}}function u(l){l.done?a(l.value):i(l.value).then(s,c)}u((n=n.apply(r,e||[])).next())})}function lt(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(u){return function(l){return c([u,l])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(t=0)),t;)try{if(n=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){t.label=u[1];break}if(u[0]===6&&t.label<a[1]){t.label=a[1],a=u;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(u);break}a[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(l){u=[6,l],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Vt(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 Eo="Invariant Violation",Gc=Object.setPrototypeOf,Bp=Gc===void 0?function(r,e){return r.__proto__=e,r}:Gc,M=function(r){be(e,r);function e(t){t===void 0&&(t=Eo);var n=r.call(this,typeof t=="number"?Eo+": "+t+" (see https://github.com/apollographql/invariant-packages)":t)||this;return n.framesToPop=1,n.name=Eo,Bp(n,e.prototype),n}return e}(Error);function T(r,e){if(!r)throw new M(e)}var Fi=["debug","log","warn","error","silent"],xo=Fi.indexOf("log");function Li(r){return function(){if(Fi.indexOf(r)>=xo){var e=console[r]||console.log;return e.apply(console,arguments)}}}(function(r){r.debug=Li("debug"),r.log=Li("log"),r.warn=Li("warn"),r.error=Li("error")})(T||(T={}));function Wc(r){var e=Fi[xo];return xo=Math.max(0,Fi.indexOf(r)),e}function Ae(r){try{return r()}catch{}}var $i=Ae(function(){return globalThis})||Ae(function(){return window})||Ae(function(){return self})||Ae(function(){return global})||Ae(function(){return Ae.constructor("return this")()});var Kc="__",zc=[Kc,Kc].join("DEV");function Vp(){try{return Boolean(__DEV__)}catch{return Object.defineProperty($i,zc,{value:Ae(function(){return"production"})!=="production",enumerable:!1,configurable:!0,writable:!0}),$i[zc]}}var mr=Vp();function Qt(r){try{return r()}catch{}}var Oo=Qt(function(){return globalThis})||Qt(function(){return window})||Qt(function(){return self})||Qt(function(){return global})||Qt(function(){return Qt.constructor("return this")()}),To=!1;function Qp(){Oo&&!Qt(function(){return"production"})&&!Qt(function(){return process})&&(Object.defineProperty(Oo,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),To=!0)}Qp();function Io(){To&&(delete Oo.process,To=!1)}var a2=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",o2=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator",Hc=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";var Ee=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 Ao(r,e){var t=Boolean(r);if(!t)throw new Error(e??"Unexpected invariant triggered.")}var Gp=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,Ln=Gp;function Mi(r){var e=r.prototype.toJSON;typeof e=="function"||Ao(0),r.prototype.inspect=e,Ln&&(r.prototype[Ln]=e)}var Jc=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}();Mi(Jc);var Yc=function(){function r(t,n,i,a,o,s,c){this.kind=t,this.start=n,this.end=i,this.line=a,this.column=o,this.value=c,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}();Mi(Yc);function ko(r){return r!=null&&typeof r.kind=="string"}function ji(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ji=function(t){return typeof t}:ji=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ji(r)}var Wp=10,Xc=2;function Fn(r){return Ui(r,[])}function Ui(r,e){switch(ji(r)){case"string":return JSON.stringify(r);case"function":return r.name?"[function ".concat(r.name,"]"):"[function]";case"object":return r===null?"null":Kp(r,e);default:return String(r)}}function Kp(r,e){if(e.indexOf(r)!==-1)return"[Circular]";var t=[].concat(e,[r]),n=Jp(r);if(n!==void 0){var i=n.call(r);if(i!==r)return typeof i=="string"?i:Ui(i,t)}else if(Array.isArray(r))return Hp(r,t);return zp(r,t)}function zp(r,e){var t=Object.keys(r);if(t.length===0)return"{}";if(e.length>Xc)return"["+Yp(r)+"]";var n=t.map(function(i){var a=Ui(r[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function Hp(r,e){if(r.length===0)return"[]";if(e.length>Xc)return"[Array]";for(var t=Math.min(Wp,r.length),n=r.length-t,i=[],a=0;a<t;++a)i.push(Ui(r[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function Jp(r){var e=r[String(Ln)];if(typeof e=="function")return e;if(typeof r.inspect=="function")return r.inspect}function Yp(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 $n(r,e){var t=Boolean(r);if(!t)throw new Error(e)}function Zc(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 Xp(r,e,t){return e&&Zc(r.prototype,e),t&&Zc(r,t),r}var qi=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"||$n(0,"Body must be a string. Received: ".concat(Fn(e),".")),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||$n(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||$n(0,"column in locationOffset is 1-indexed and must be positive.")}return Xp(r,[{key:Hc,get:function(){return"Source"}}]),r}();function eu(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,c="";return s&&!(n&&i)&&(c+=`
|
|
5
5
|
`+e),c+=e?r.replace(/\n/g,`
|
|
6
6
|
`+e):r,s&&(c+=`
|
|
7
|
-
`),'"""'+c.replace(/"""/g,'\\"""')+'"""'}var Zp={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"]},gr=Object.freeze({});function Fe(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Zp,n=void 0,i=Array.isArray(r),a=[r],o=-1,s=[],c=void 0,u=void 0,l=void 0,p=[],d=[],f=r;do{o++;var m=o===a.length,g=m&&s.length!==0;if(m){if(u=d.length===0?void 0:p[p.length-1],c=l,l=d.pop(),g){if(i)c=c.slice();else{for(var b={},_=0,v=Object.keys(c);_<v.length;_++){var C=v[_];b[C]=c[C]}c=b}for(var E=0,A=0;A<s.length;A++){var D=s[A][0],I=s[A][1];i&&(D-=E),i&&I===null?(c.splice(D,1),E++):c[D]=I}}o=n.index,a=n.keys,s=n.edits,i=n.inArray,n=n.prev}else{if(u=l?i?o:a[o]:void 0,c=l?l[u]:f,c==null)continue;l&&p.push(u)}var R=void 0;if(!Array.isArray(c)){if(!
|
|
7
|
+
`),'"""'+c.replace(/"""/g,'\\"""')+'"""'}var Zp={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"]},gr=Object.freeze({});function Fe(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Zp,n=void 0,i=Array.isArray(r),a=[r],o=-1,s=[],c=void 0,u=void 0,l=void 0,p=[],d=[],f=r;do{o++;var m=o===a.length,g=m&&s.length!==0;if(m){if(u=d.length===0?void 0:p[p.length-1],c=l,l=d.pop(),g){if(i)c=c.slice();else{for(var b={},_=0,v=Object.keys(c);_<v.length;_++){var C=v[_];b[C]=c[C]}c=b}for(var E=0,A=0;A<s.length;A++){var D=s[A][0],I=s[A][1];i&&(D-=E),i&&I===null?(c.splice(D,1),E++):c[D]=I}}o=n.index,a=n.keys,s=n.edits,i=n.inArray,n=n.prev}else{if(u=l?i?o:a[o]:void 0,c=l?l[u]:f,c==null)continue;l&&p.push(u)}var R=void 0;if(!Array.isArray(c)){if(!ko(c))throw new Error("Invalid AST Node: ".concat(Fn(c),"."));var ie=Do(e,c.kind,m);if(ie){if(R=ie.call(e,c,u,l,p,d),R===gr)break;if(R===!1){if(!m){p.pop();continue}}else if(R!==void 0&&(s.push([u,R]),!m))if(ko(R))c=R;else{p.pop();continue}}}if(R===void 0&&g&&s.push([u,c]),m)p.pop();else{var te;n={inArray:i,index:o,keys:a,edits:s,prev:n},i=Array.isArray(c),a=i?c:(te=t[c.kind])!==null&&te!==void 0?te:[],o=-1,s=[],l&&d.push(l),l=c}}while(n!==void 0);return s.length!==0&&(f=s[s.length-1][1]),f}function Do(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 Yr(r){return Fe(r,{leave:tf})}var ef=80,tf={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return N(e.definitions,`
|
|
8
8
|
|
|
9
9
|
`)+`
|
|
10
10
|
`},OperationDefinition:function(e){var t=e.operation,n=e.name,i=me("(",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+me(" = ",i)+me(" ",N(a," "))},SelectionSet:function(e){var t=e.selections;return ft(t)},Field:function(e){var t=e.alias,n=e.name,i=e.arguments,a=e.directives,o=e.selectionSet,s=me("",t,": ")+n,c=s+me("(",N(i,", "),")");return c.length>ef&&(c=s+me(`(
|
|
11
|
-
`,
|
|
11
|
+
`,Bi(N(i,`
|
|
12
12
|
`)),`
|
|
13
|
-
)`)),N([c,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+me(" ",N(n," "))},InlineFragment:function(e){var t=e.typeCondition,n=e.directives,i=e.selectionSet;return N(["...",me("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(me("(",N(i,", "),")")," ")+"on ".concat(n," ").concat(me("",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?
|
|
14
|
-
`,
|
|
13
|
+
)`)),N([c,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+me(" ",N(n," "))},InlineFragment:function(e){var t=e.typeCondition,n=e.directives,i=e.selectionSet;return N(["...",me("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(me("(",N(i,", "),")")," ")+"on ".concat(n," ").concat(me("",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?eu(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+me("(",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:pt(function(r){var e=r.directives,t=r.operationTypes;return N(["schema",N(e," "),ft(t)]," ")}),OperationTypeDefinition:function(e){var t=e.operation,n=e.type;return t+": "+n},ScalarTypeDefinition:pt(function(r){var e=r.name,t=r.directives;return N(["scalar",e,N(t," ")]," ")}),ObjectTypeDefinition:pt(function(r){var e=r.name,t=r.interfaces,n=r.directives,i=r.fields;return N(["type",e,me("implements ",N(t," & ")),N(n," "),ft(i)]," ")}),FieldDefinition:pt(function(r){var e=r.name,t=r.arguments,n=r.type,i=r.directives;return e+(tu(t)?me(`(
|
|
14
|
+
`,Bi(N(t,`
|
|
15
15
|
`)),`
|
|
16
|
-
)`):me("(",N(t,", "),")"))+": "+n+me(" ",N(i," "))}),InputValueDefinition:pt(function(r){var e=r.name,t=r.type,n=r.defaultValue,i=r.directives;return N([e+": "+t,me("= ",n),N(i," ")]," ")}),InterfaceTypeDefinition:pt(function(r){var e=r.name,t=r.interfaces,n=r.directives,i=r.fields;return N(["interface",e,me("implements ",N(t," & ")),N(n," "),ft(i)]," ")}),UnionTypeDefinition:pt(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:pt(function(r){var e=r.name,t=r.directives,n=r.values;return N(["enum",e,N(t," "),ft(n)]," ")}),EnumValueDefinition:pt(function(r){var e=r.name,t=r.directives;return N([e,N(t," ")]," ")}),InputObjectTypeDefinition:pt(function(r){var e=r.name,t=r.directives,n=r.fields;return N(["input",e,N(t," "),ft(n)]," ")}),DirectiveDefinition:pt(function(r){var e=r.name,t=r.arguments,n=r.repeatable,i=r.locations;return"directive @"+e+(
|
|
17
|
-
`,
|
|
16
|
+
)`):me("(",N(t,", "),")"))+": "+n+me(" ",N(i," "))}),InputValueDefinition:pt(function(r){var e=r.name,t=r.type,n=r.defaultValue,i=r.directives;return N([e+": "+t,me("= ",n),N(i," ")]," ")}),InterfaceTypeDefinition:pt(function(r){var e=r.name,t=r.interfaces,n=r.directives,i=r.fields;return N(["interface",e,me("implements ",N(t," & ")),N(n," "),ft(i)]," ")}),UnionTypeDefinition:pt(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:pt(function(r){var e=r.name,t=r.directives,n=r.values;return N(["enum",e,N(t," "),ft(n)]," ")}),EnumValueDefinition:pt(function(r){var e=r.name,t=r.directives;return N([e,N(t," ")]," ")}),InputObjectTypeDefinition:pt(function(r){var e=r.name,t=r.directives,n=r.fields;return N(["input",e,N(t," "),ft(n)]," ")}),DirectiveDefinition:pt(function(r){var e=r.name,t=r.arguments,n=r.repeatable,i=r.locations;return"directive @"+e+(tu(t)?me(`(
|
|
17
|
+
`,Bi(N(t,`
|
|
18
18
|
`)),`
|
|
19
19
|
)`):me("(",N(t,", "),")"))+(n?" repeatable":"")+" on "+N(i," | ")}),SchemaExtension:function(e){var t=e.directives,n=e.operationTypes;return N(["extend schema",N(t," "),ft(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,me("implements ",N(n," & ")),N(i," "),ft(a)]," ")},InterfaceTypeExtension:function(e){var t=e.name,n=e.interfaces,i=e.directives,a=e.fields;return N(["extend interface",t,me("implements ",N(n," & ")),N(i," "),ft(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," "),ft(i)]," ")},InputObjectTypeExtension:function(e){var t=e.name,n=e.directives,i=e.fields;return N(["extend input",t,N(n," "),ft(i)]," ")}};function pt(r){return function(e){return N([e.description,r(e)],`
|
|
20
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 ft(r){return me(`{
|
|
21
|
-
`,
|
|
21
|
+
`,Bi(N(r,`
|
|
22
22
|
`)),`
|
|
23
|
-
}`)}function me(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return e!=null&&e!==""?r+e+t:""}function
|
|
23
|
+
}`)}function me(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return e!=null&&e!==""?r+e+t:""}function Bi(r){return me(" ",r.replace(/\n/g,`
|
|
24
24
|
`))}function rf(r){return r.indexOf(`
|
|
25
|
-
`)!==-1}function Zc(r){return r!=null&&r.some(rf)}function Mn(r){return r.kind===Ee.FIELD||r.kind===Ee.FRAGMENT_SPREAD||r.kind===Ee.INLINE_FRAGMENT}function eu(){return typeof ji=="function"?To():To()}function df(){__DEV__?T(typeof mr=="boolean",mr):T(typeof mr=="boolean",39)}eu();df();function kt(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 Xr(r,e,t){var n=new Set(r),i=n.size;return Fe(e,{Directive:function(a){if(n.delete(a.name.value)&&(!t||!n.size))return gr}}),t?!n.size:n.size<i}function Do(r){return r&&Xr(["client","export"],r,!0)}function hf(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(!!hf(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 No(r,e){var t=e,n=[];r.definitions.forEach(function(a){if(a.kind==="OperationDefinition")throw __DEV__?new M("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 M(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=h(h({},r),{definitions:Vt([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:t}}]}}],r.definitions,!0)});return i}function yr(r){r===void 0&&(r=[]);var e={};return r.forEach(function(t){e[t.name.value]=t}),e}function vr(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 H(r){return r!==null&&typeof r=="object"}function wt(r){return{__ref:String(r)}}function W(r){return Boolean(r&&typeof r=="object"&&typeof r.__ref=="string")}function Po(r){return H(r)&&r.kind==="Document"&&Array.isArray(r.definitions)}function mf(r){return r.kind==="StringValue"}function gf(r){return r.kind==="BooleanValue"}function yf(r){return r.kind==="IntValue"}function vf(r){return r.kind==="FloatValue"}function bf(r){return r.kind==="Variable"}function Cf(r){return r.kind==="ObjectValue"}function Sf(r){return r.kind==="ListValue"}function wf(r){return r.kind==="EnumValue"}function _f(r){return r.kind==="NullValue"}function Gt(r,e,t,n){if(yf(t)||vf(t))r[e.value]=Number(t.value);else if(gf(t)||mf(t))r[e.value]=t.value;else if(Cf(t)){var i={};t.fields.map(function(o){return Gt(i,o.name,o.value,n)}),r[e.value]=i}else if(bf(t)){var a=(n||{})[t.name.value];r[e.value]=a}else if(Sf(t))r[e.value]=t.values.map(function(o){var s={};return Gt(s,e,o,n),s[e.value]});else if(wf(t))r[e.value]=t.value;else if(_f(t))r[e.value]=null;else throw __DEV__?new M('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 M(55)}function Ro(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 Gt(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 Gt(n,a,o,e)})),Un(r.name.value,n,t)}var Ef=["connection","include","skip","client","rest","export"],Un=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(jn(i),")")}else return t.connection.key;var a=r;if(e){var o=jn(e);a+="(".concat(o,")")}return t&&Object.keys(t).forEach(function(s){Ef.indexOf(s)===-1&&(t[s]&&Object.keys(t[s]).length?a+="@".concat(s,"(").concat(jn(t[s]),")"):a+="@".concat(s))}),a},{setStringify:function(r){var e=jn;return jn=r,e}}),jn=function(e){return JSON.stringify(e,xf)};function xf(r,e){return H(e)&&!Array.isArray(e)&&(e=Object.keys(e).sort().reduce(function(t,n){return t[n]=e[n],t},{})),e}function Dt(r,e){if(r.arguments&&r.arguments.length){var t={};return r.arguments.forEach(function(n){var i=n.name,a=n.value;return Gt(t,i,a,e)}),t}return null}function at(r){return r.alias?r.alias.value:r.name.value}function qn(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(Xe(a)){if(a.name.value==="__typename")return r[at(a)]}else{var o=qn(r,vr(a,t).selectionSet,t);if(typeof o=="string")return o}}}function Xe(r){return r.kind==="Field"}function Lo(r){return r.kind==="InlineFragment"}function Zr(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 M('Schema type definitions not allowed in queries. Found: "'.concat(t.kind,'"')):new M(48);return t});return __DEV__?T(e.length<=1,"Ambiguous GraphQL document: contains ".concat(e.length," operations")):T(e.length<=1,49),r}function _t(r){return Zr(r),r.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function en(r){return r.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function br(r){return r.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function Bn(r){var e=_t(r);return __DEV__?T(e&&e.operation==="query","Must contain a query definition."):T(e&&e.operation==="query",50),e}function Fo(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 Cr(r){Zr(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 M("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new M(54)}function Sr(r){var e=Object.create(null),t=r&&r.variableDefinitions;return t&&t.length&&t.forEach(function(n){n.defaultValue&&Gt(e,n.variable.name,n.defaultValue)}),e}var ae=Array.isArray;function Oe(r){return Array.isArray(r)&&r.length>0}var ru={kind:Ee.FIELD,name:{kind:Ee.NAME,value:"__typename"}};function iu(r,e){return!r||r.selectionSet.selections.every(function(t){return t.kind===Ee.FRAGMENT_SPREAD&&iu(e[t.name.value],e)})}function Of(r){return iu(_t(r)||Fo(r),yr(br(r)))?null:r}function Tf(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 $o(r,e){for(var t=nu(""),n=nu(""),i=function(v){for(var C=0,E=void 0;C<v.length&&(E=v[C]);++C)if(!ae(E)){if(E.kind===Ee.OPERATION_DEFINITION)return t(E.name&&E.name.value);if(E.kind===Ee.FRAGMENT_DEFINITION)return n(E.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===Ee.OPERATION_DEFINITION&&++a;var s=Tf(r),c=r.some(function(v){return v.remove}),u=function(v){return c&&v&&v.some(s)},l=new Map,p=!1,d={enter:function(v){if(u(v.directives))return p=!0,null}},f=Fe(e,{Field:d,InlineFragment:d,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(v,C,E,A,D){var I=i(D);I&&I.variables.add(v.name.value)}},FragmentSpread:{enter:function(v,C,E,A,D){if(u(v.directives))return p=!0,null;var I=i(D);I&&I.fragmentSpreads.add(v.name.value)}},FragmentDefinition:{enter:function(v,C,E,A){l.set(JSON.stringify(A),v)},leave:function(v,C,E,A){var D=l.get(JSON.stringify(A));if(v===D)return v;if(a>0&&v.selectionSet.selections.every(function(I){return I.kind===Ee.FIELD&&I.name.value==="__typename"}))return n(v.name.value).removed=!0,p=!0,null}},Directive:{leave:function(v){if(s(v))return p=!0,null}}});if(!p)return e;var m=function(v){return v.transitiveVars||(v.transitiveVars=new Set(v.variables),v.removed||v.fragmentSpreads.forEach(function(C){m(n(C)).transitiveVars.forEach(function(E){v.transitiveVars.add(E)})})),v},g=new Set;f.definitions.forEach(function(v){v.kind===Ee.OPERATION_DEFINITION?m(t(v.name&&v.name.value)).fragmentSpreads.forEach(function(C){g.add(C)}):v.kind===Ee.FRAGMENT_DEFINITION&&a===0&&!n(v.name.value).removed&&g.add(v.name.value)}),g.forEach(function(v){m(n(v)).fragmentSpreads.forEach(function(C){g.add(C)})});var b=function(v){return!!(!g.has(v)||n(v).removed)},_={enter:function(v){if(b(v.name.value))return null}};return Of(Fe(f,{FragmentSpread:_,FragmentDefinition:_,OperationDefinition:{leave:function(v){if(v.variableDefinitions){var C=m(t(v.name&&v.name.value)).transitiveVars;if(C.size<v.variableDefinitions.length)return h(h({},v),{variableDefinitions:v.variableDefinitions.filter(function(E){return C.has(E.variable.name.value)})})}}}}))}var wr=Object.assign(function(r){return Fe(r,{SelectionSet:{enter:function(e,t,n){if(!(n&&n.kind===Ee.OPERATION_DEFINITION)){var i=e.selections;if(!!i){var a=i.some(function(s){return Xe(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=n;if(!(Xe(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return h(h({},e),{selections:Vt(Vt([],i,!0),[ru],!1)})}}}}}})},{added:function(r){return r===ru}}),If={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 Mo(r){return $o([If],Zr(r))}function jo(r){var e=Cr(r),t=e.operation;if(t==="query")return r;var n=Fe(r,{OperationDefinition:{enter:function(i){return h(h({},i),{operation:"query"})}}});return n}function Uo(r){Zr(r);var e=$o([{test:function(t){return t.name.value==="client"},remove:!0}],r);return e}var Af=Object.prototype.hasOwnProperty;function qo(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return Vn(r)}function Vn(r){var e=r[0]||{},t=r.length;if(t>1)for(var n=new Ge,i=1;i<t;++i)e=n.merge(e,r[i]);return e}var kf=function(r,e,t){return this.merge(r[t],e[t])},Ge=function(){function r(e){e===void 0&&(e=kf),this.reconciler=e,this.isObject=H,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 H(t)&&H(e)?(Object.keys(t).forEach(function(o){if(Af.call(e,o)){var s=e[o];if(t[o]!==s){var c=n.reconciler.apply(n,Vt([e,t,o],i,!1));c!==s&&(e=n.shallowCopyForMerge(e),e[o]=c)}}else e=n.shallowCopyForMerge(e),e[o]=t[o]}),e):t},r.prototype.shallowCopyForMerge=function(e){return H(e)&&(this.pastCopies.has(e)||(Array.isArray(e)?e=e.slice(0):e=h({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},r}();function Df(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=Nf(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 Nf(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 Go(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"},Ko=function(r){return Wo()&&Boolean(Symbol[r])},zo=function(r){return Ko(r)?Symbol[r]:"@@"+r};Wo()&&!Ko("observable")&&(Symbol.observable=Symbol("observable"));var Pf=zo("iterator"),Vo=zo("observable"),su=zo("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 Qn(r){var e=r.constructor;return e!==void 0&&(e=e[su],e===null&&(e=void 0)),e!==void 0?e:Q}function Rf(r){return r instanceof Q}function tn(r){tn.log?tn.log(r):setTimeout(function(){throw r})}function qi(r){Promise.resolve().then(function(){try{r()}catch(e){tn(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){tn(n)}}function Qo(r){r._observer=void 0,r._queue=void 0,r._state="closed"}function Lf(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(Qo(r),i)i.call(n,t);else throw t;break;case"complete":Qo(r),i&&i.call(n);break}}catch(a){tn(a)}r._state==="closed"?cu(r):r._state==="running"&&(r._state="ready")}function Bo(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 Lf(r)});return}uu(r,e,t)}}var Ff=function(){function r(t,n){this._cleanup=void 0,this._observer=t,this._queue=void 0,this._state="initializing";var i=new $f(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"&&(Qo(this),cu(this))},Go(r,[{key:"closed",get:function(){return this._state==="closed"}}]),r}(),$f=function(){function r(t){this._subscription=t}var e=r.prototype;return e.next=function(n){Bo(this._subscription,"next",n)},e.error=function(n){Bo(this._subscription,"error",n)},e.complete=function(){Bo(this._subscription,"complete")},Go(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 Ff(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(){c.unsubscribe(),a()}var c=i.subscribe({next:function(u){try{n(u,s)}catch(l){o(l),c.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=Qn(this);return new a(function(o){return i.subscribe({next:function(s){try{s=n(s)}catch(c){return o.error(c)}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=Qn(this);return new a(function(o){return i.subscribe({next:function(s){try{if(!n(s))return}catch(c){return o.error(c)}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=Qn(this),o=arguments.length>1,s=!1,c=arguments[1],u=c;return new a(function(l){return i.subscribe({next:function(p){var d=!s;if(s=!0,!d||o)try{u=n(u,p)}catch(f){return l.error(f)}else u=p},error:function(p){l.error(p)},complete:function(){if(!s&&!o)return l.error(new TypeError("Cannot reduce an empty sequence"));l.next(u),l.complete()}})})},e.concat=function(){for(var n=this,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];var s=Qn(this);return new s(function(c){var u,l=0;function p(d){u=d.subscribe({next:function(f){c.next(f)},error:function(f){c.error(f)},complete:function(){l===a.length?(u=void 0,c.complete()):p(s.from(a[l++]))}})}return p(n),function(){u&&(u.unsubscribe(),u=void 0)}})},e.flatMap=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Qn(this);return new a(function(o){var s=[],c=i.subscribe({next:function(l){if(n)try{l=n(l)}catch(d){return o.error(d)}var p=a.from(l).subscribe({next:function(d){o.next(d)},error:function(d){o.error(d)},complete:function(){var d=s.indexOf(p);d>=0&&s.splice(d,1),u()}});s.push(p)},error:function(l){o.error(l)},complete:function(){u()}});function u(){c.closed&&s.length===0&&o.complete()}return function(){s.forEach(function(l){return l.unsubscribe()}),c.unsubscribe()}})},e[Vo]=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,Vo);if(a){var o=a.call(n);if(Object(o)!==o)throw new TypeError(o+" is not an object");return Rf(o)&&o.constructor===i?o:new i(function(s){return o.subscribe(s)})}if(Ko("iterator")&&(a=Bi(n,Pf),a))return new i(function(s){qi(function(){if(!s.closed){for(var c=Df(a.call(n)),u;!(u=c()).done;){var l=u.value;if(s.next(l),s.closed)return}s.complete()}})});if(Array.isArray(n))return new i(function(s){qi(function(){if(!s.closed){for(var c=0;c<n.length;++c)if(s.next(n[c]),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 c=0;c<i.length;++c)if(s.next(i[c]),s.closed)return;s.complete()}})})},Go(r,null,[{key:su,get:function(){return this}}]),r}();Wo()&&Object.defineProperty(Q,Symbol("extensions"),{value:{symbol:Vo,hostReportError:tn},configurable:!0});function Ho(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 rn;typeof self<"u"?rn=self:typeof window<"u"?rn=window:typeof global<"u"?rn=global:typeof module<"u"?rn=module:rn=Function("return this")();var P3=Ho(rn);var lu=Q.prototype,pu="@@observable";lu[pu]||(lu[pu]=function(){return this});var Mf=Object.prototype.toString;function Vi(r){return Jo(r)}function Jo(r,e){switch(Mf.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]=Jo(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]=Jo(r[i],e)}),n}default:return r}}function jf(r){var e=new Set([r]);return e.forEach(function(t){H(t)&&Uf(t)===t&&Object.getOwnPropertyNames(t).forEach(function(n){H(t[n])&&e.add(t[n])})}),r}function Uf(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__&&jf(r),r}function _r(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,c=!1,u={then:function(f){return new Promise(function(m){return m(f())})}};function l(f,m){return f?function(g){++s;var b=function(){return f(g)};u=u.then(b,b).then(function(_){--s,i&&i.call(n,_),c&&p.complete()},function(_){throw--s,_}).catch(function(_){a&&a.call(n,_)})}:function(g){return m&&m.call(n,g)}}var p={next:l(e,i),error:l(t,a),complete:function(){c=!0,s||o&&o.call(n)}},d=r.subscribe(p);return function(){return d.unsubscribe()}})}var ot=typeof WeakMap=="function"&&Ae(function(){return navigator.product})!=="ReactNative",fu=typeof WeakSet=="function",Yo=typeof Symbol=="function"&&typeof Symbol.for=="function",Wt=Yo&&Symbol.asyncIterator,W3=typeof Ae(function(){return window.document.createElement})=="function",K3=Ae(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1;function Gi(r){function e(t){Object.defineProperty(r,t,{value:Q})}return Yo&&Symbol.species&&e(Symbol.species),e("@@species"),r}function du(r){return r&&typeof r.then=="function"}var nn=function(r){be(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),_r(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),_r(n.observers,"error",i))},complete:function(){var i=n,a=i.sub,o=i.sources,s=o===void 0?[]:o;if(a!==null){var c=s.shift();c?du(c)?c.then(function(u){return n.sub=u.subscribe(n.handlers)}):n.sub=c.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"),_r(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);Gi(nn);function Kt(r){return"incremental"in r}function qf(r){return"hasNext"in r&&"data"in r}function hu(r){return Kt(r)||qf(r)}function Wi(r,e){var t=r,n=new Ge;return Kt(e)&&Oe(e.incremental)&&e.incremental.forEach(function(i){for(var a=i.data,o=i.path,s=o.length-1;s>=0;--s){var c=o[s],u=!isNaN(+c),l=u?[]:{};l[c]=a,a=l}t=n.merge(t,a)}),t}function an(r){var e=Ki(r);return Oe(e)}function Ki(r){var e=Oe(r.errors)?r.errors.slice(0):[];return Kt(r)&&Oe(r.incremental)&&r.incremental.forEach(function(t){t.errors&&e.push.apply(e,t.errors)}),e}function zt(){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 Wn(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 gu(r){var e=Wn("stringifyForDisplay");return JSON.stringify(r,function(t,n){return n===void 0?e:n}).split(JSON.stringify(e)).join("<undefined>")}function Kn(r,e){return zt(r,e,e.variables&&{variables:h(h({},r&&r.variables),e.variables)})}function zi(r){return new Q(function(e){e.error(r)})}var zn=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 Xo(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 M("illegal argument: ".concat(i)):new M(27)}return r}function Zo(r,e){var t=h({},r),n=function(a){typeof a=="function"?t=h(h({},t),a(t)):t=h(h({},t),a)},i=function(){return h({},t)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:n}),Object.defineProperty(e,"getContext",{enumerable:!1,value:i}),e}function es(r){var e={variables:r.variables||{},extensions:r.extensions||{},operationName:r.operationName,query:r.query};return e.operationName||(e.operationName=typeof e.query!="string"?en(e.query)||void 0:""),e}function yu(r,e){return e?e(r):Q.of()}function Hn(r){return typeof r=="function"?new st(r):r}function Hi(r){return r.request.length<=1}var Bf=function(r){be(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(Hn).reduce(function(t,n){return t.concat(n)})},r.split=function(e,t,n){var i=Hn(t),a=Hn(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(Zo(t.context,es(Xo(t))))||Q.of()},r.concat=function(e,t){var n=Hn(e);if(Hi(n))return __DEV__&&T.warn(new Bf("You are calling concat on a terminating link, which will have no effect",n)),n;var i=Hn(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 M("request is not implemented"):new M(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 on=st.execute;var vu="3.7.10";function bu(r){return!!r.body}function Cu(r){return!!r.getReader}function Su(r){return!!(Wt&&r[Symbol.asyncIterator])}function wu(r){return!!r.stream}function _u(r){return!!r.arrayBuffer}function Eu(r){return!!r.pipe}function ts(r){var e,t=r[Symbol.asyncIterator]();return e={next:function(){return t.next()}},e[Symbol.asyncIterator]=function(){return this},e}function rs(r){var e=null,t=null,n=!1,i=[],a=[];function o(p){if(!t){if(a.length){var d=a.shift();if(Array.isArray(d)&&d[0])return d[0]({value:p,done:!1})}i.push(p)}}function s(p){t=p;var d=a.slice();d.forEach(function(f){f[1](p)}),!e||e()}function c(){n=!0;var p=a.slice();p.forEach(function(d){d[0]({value:void 0,done:!0})}),!e||e()}e=function(){e=null,r.removeListener("data",o),r.removeListener("error",s),r.removeListener("end",c),r.removeListener("finish",c),r.removeListener("close",c)},r.on("data",o),r.on("error",s),r.on("end",c),r.on("finish",c),r.on("close",c);function u(){return new Promise(function(p,d){if(t)return d(t);if(i.length)return p({value:i.shift(),done:!1});if(n)return p({value:void 0,done:!0});a.push([p,d])})}var l={next:function(){return u()}};return Wt&&(l[Symbol.asyncIterator]=function(){return this}),l}function ns(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 Wt&&(t[Symbol.asyncIterator]=function(){return this}),t}function Ji(r){var e={next:function(){return r.read()}};return Wt&&(e[Symbol.asyncIterator]=function(){return this}),e}function xu(r){var e=r;if(bu(r)&&(e=r.body),Su(e))return ts(e);if(Cu(e))return Ji(e.getReader());if(wu(e))return Ji(e.stream().getReader());if(_u(e))return ns(e.arrayBuffer());if(Eu(e))return rs(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 ut(this,void 0,void 0,function(){var a,o,s,c,u,l,p,d,f,m,g,b,_,v,C,E,A,D,I,R;return lt(this,function(ie){switch(ie.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=",c=o?.includes(s)?o?.substring(o?.indexOf(s)+s.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",u="--".concat(c),l="",p=xu(r),d=!0,ie.label=1;case 1:return d?[4,p.next()]:[3,3];case 2:for(f=ie.sent(),m=f.value,g=f.done,b=typeof m=="string"?m:a.decode(m),d=!g,l+=b,_=l.indexOf(u);_>-1;){if(v=void 0,R=[l.slice(0,_),l.slice(_+u.length)],v=R[0],l=R[1],v.trim()){if(C=v.indexOf(`\r
|
|
25
|
+
`)!==-1}function tu(r){return r!=null&&r.some(rf)}function Mn(r){return r.kind===Ee.FIELD||r.kind===Ee.FRAGMENT_SPREAD||r.kind===Ee.INLINE_FRAGMENT}function ru(){return typeof qi=="function"?Io():Io()}function df(){__DEV__?T(typeof mr=="boolean",mr):T(typeof mr=="boolean",39)}ru();df();function kt(r,e){var t=r.directives;return!t||!t.length?!0:nu(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 Xr(r,e,t){var n=new Set(r),i=n.size;return Fe(e,{Directive:function(a){if(n.delete(a.name.value)&&(!t||!n.size))return gr}}),t?!n.size:n.size<i}function No(r){return r&&Xr(["client","export"],r,!0)}function hf(r){var e=r.name.value;return e==="skip"||e==="include"}function nu(r){var e=[];return r&&r.length&&r.forEach(function(t){if(!!hf(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 Po(r,e){var t=e,n=[];r.definitions.forEach(function(a){if(a.kind==="OperationDefinition")throw __DEV__?new M("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 M(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=h(h({},r),{definitions:Vt([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:t}}]}}],r.definitions,!0)});return i}function yr(r){r===void 0&&(r=[]);var e={};return r.forEach(function(t){e[t.name.value]=t}),e}function vr(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 J(r){return r!==null&&typeof r=="object"}function wt(r){return{__ref:String(r)}}function K(r){return Boolean(r&&typeof r=="object"&&typeof r.__ref=="string")}function Ro(r){return J(r)&&r.kind==="Document"&&Array.isArray(r.definitions)}function mf(r){return r.kind==="StringValue"}function gf(r){return r.kind==="BooleanValue"}function yf(r){return r.kind==="IntValue"}function vf(r){return r.kind==="FloatValue"}function bf(r){return r.kind==="Variable"}function Cf(r){return r.kind==="ObjectValue"}function Sf(r){return r.kind==="ListValue"}function wf(r){return r.kind==="EnumValue"}function _f(r){return r.kind==="NullValue"}function Gt(r,e,t,n){if(yf(t)||vf(t))r[e.value]=Number(t.value);else if(gf(t)||mf(t))r[e.value]=t.value;else if(Cf(t)){var i={};t.fields.map(function(o){return Gt(i,o.name,o.value,n)}),r[e.value]=i}else if(bf(t)){var a=(n||{})[t.name.value];r[e.value]=a}else if(Sf(t))r[e.value]=t.values.map(function(o){var s={};return Gt(s,e,o,n),s[e.value]});else if(wf(t))r[e.value]=t.value;else if(_f(t))r[e.value]=null;else throw __DEV__?new M('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 M(55)}function Lo(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 Gt(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 Gt(n,a,o,e)})),Un(r.name.value,n,t)}var Ef=["connection","include","skip","client","rest","export"],Un=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(jn(i),")")}else return t.connection.key;var a=r;if(e){var o=jn(e);a+="(".concat(o,")")}return t&&Object.keys(t).forEach(function(s){Ef.indexOf(s)===-1&&(t[s]&&Object.keys(t[s]).length?a+="@".concat(s,"(").concat(jn(t[s]),")"):a+="@".concat(s))}),a},{setStringify:function(r){var e=jn;return jn=r,e}}),jn=function(e){return JSON.stringify(e,xf)};function xf(r,e){return J(e)&&!Array.isArray(e)&&(e=Object.keys(e).sort().reduce(function(t,n){return t[n]=e[n],t},{})),e}function Dt(r,e){if(r.arguments&&r.arguments.length){var t={};return r.arguments.forEach(function(n){var i=n.name,a=n.value;return Gt(t,i,a,e)}),t}return null}function at(r){return r.alias?r.alias.value:r.name.value}function qn(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(Xe(a)){if(a.name.value==="__typename")return r[at(a)]}else{var o=qn(r,vr(a,t).selectionSet,t);if(typeof o=="string")return o}}}function Xe(r){return r.kind==="Field"}function Fo(r){return r.kind==="InlineFragment"}function Zr(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 M('Schema type definitions not allowed in queries. Found: "'.concat(t.kind,'"')):new M(48);return t});return __DEV__?T(e.length<=1,"Ambiguous GraphQL document: contains ".concat(e.length," operations")):T(e.length<=1,49),r}function _t(r){return Zr(r),r.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function en(r){return r.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function br(r){return r.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function Bn(r){var e=_t(r);return __DEV__?T(e&&e.operation==="query","Must contain a query definition."):T(e&&e.operation==="query",50),e}function $o(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 Cr(r){Zr(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 M("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new M(54)}function Sr(r){var e=Object.create(null),t=r&&r.variableDefinitions;return t&&t.length&&t.forEach(function(n){n.defaultValue&&Gt(e,n.variable.name,n.defaultValue)}),e}var ae=Array.isArray;function Oe(r){return Array.isArray(r)&&r.length>0}var iu={kind:Ee.FIELD,name:{kind:Ee.NAME,value:"__typename"}};function ou(r,e){return!r||r.selectionSet.selections.every(function(t){return t.kind===Ee.FRAGMENT_SPREAD&&ou(e[t.name.value],e)})}function Of(r){return ou(_t(r)||$o(r),yr(br(r)))?null:r}function Tf(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 au(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 Mo(r,e){for(var t=au(""),n=au(""),i=function(v){for(var C=0,E=void 0;C<v.length&&(E=v[C]);++C)if(!ae(E)){if(E.kind===Ee.OPERATION_DEFINITION)return t(E.name&&E.name.value);if(E.kind===Ee.FRAGMENT_DEFINITION)return n(E.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===Ee.OPERATION_DEFINITION&&++a;var s=Tf(r),c=r.some(function(v){return v.remove}),u=function(v){return c&&v&&v.some(s)},l=new Map,p=!1,d={enter:function(v){if(u(v.directives))return p=!0,null}},f=Fe(e,{Field:d,InlineFragment:d,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(v,C,E,A,D){var I=i(D);I&&I.variables.add(v.name.value)}},FragmentSpread:{enter:function(v,C,E,A,D){if(u(v.directives))return p=!0,null;var I=i(D);I&&I.fragmentSpreads.add(v.name.value)}},FragmentDefinition:{enter:function(v,C,E,A){l.set(JSON.stringify(A),v)},leave:function(v,C,E,A){var D=l.get(JSON.stringify(A));if(v===D)return v;if(a>0&&v.selectionSet.selections.every(function(I){return I.kind===Ee.FIELD&&I.name.value==="__typename"}))return n(v.name.value).removed=!0,p=!0,null}},Directive:{leave:function(v){if(s(v))return p=!0,null}}});if(!p)return e;var m=function(v){return v.transitiveVars||(v.transitiveVars=new Set(v.variables),v.removed||v.fragmentSpreads.forEach(function(C){m(n(C)).transitiveVars.forEach(function(E){v.transitiveVars.add(E)})})),v},g=new Set;f.definitions.forEach(function(v){v.kind===Ee.OPERATION_DEFINITION?m(t(v.name&&v.name.value)).fragmentSpreads.forEach(function(C){g.add(C)}):v.kind===Ee.FRAGMENT_DEFINITION&&a===0&&!n(v.name.value).removed&&g.add(v.name.value)}),g.forEach(function(v){m(n(v)).fragmentSpreads.forEach(function(C){g.add(C)})});var b=function(v){return!!(!g.has(v)||n(v).removed)},_={enter:function(v){if(b(v.name.value))return null}};return Of(Fe(f,{FragmentSpread:_,FragmentDefinition:_,OperationDefinition:{leave:function(v){if(v.variableDefinitions){var C=m(t(v.name&&v.name.value)).transitiveVars;if(C.size<v.variableDefinitions.length)return h(h({},v),{variableDefinitions:v.variableDefinitions.filter(function(E){return C.has(E.variable.name.value)})})}}}}))}var wr=Object.assign(function(r){return Fe(r,{SelectionSet:{enter:function(e,t,n){if(!(n&&n.kind===Ee.OPERATION_DEFINITION)){var i=e.selections;if(!!i){var a=i.some(function(s){return Xe(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=n;if(!(Xe(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return h(h({},e),{selections:Vt(Vt([],i,!0),[iu],!1)})}}}}}})},{added:function(r){return r===iu}}),If={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 jo(r){return Mo([If],Zr(r))}function Uo(r){var e=Cr(r),t=e.operation;if(t==="query")return r;var n=Fe(r,{OperationDefinition:{enter:function(i){return h(h({},i),{operation:"query"})}}});return n}function qo(r){Zr(r);var e=Mo([{test:function(t){return t.name.value==="client"},remove:!0}],r);return e}var Af=Object.prototype.hasOwnProperty;function Bo(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return Vn(r)}function Vn(r){var e=r[0]||{},t=r.length;if(t>1)for(var n=new Ge,i=1;i<t;++i)e=n.merge(e,r[i]);return e}var kf=function(r,e,t){return this.merge(r[t],e[t])},Ge=function(){function r(e){e===void 0&&(e=kf),this.reconciler=e,this.isObject=J,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 J(t)&&J(e)?(Object.keys(t).forEach(function(o){if(Af.call(e,o)){var s=e[o];if(t[o]!==s){var c=n.reconciler.apply(n,Vt([e,t,o],i,!1));c!==s&&(e=n.shallowCopyForMerge(e),e[o]=c)}}else e=n.shallowCopyForMerge(e),e[o]=t[o]}),e):t},r.prototype.shallowCopyForMerge=function(e){return J(e)&&(this.pastCopies.has(e)||(Array.isArray(e)?e=e.slice(0):e=h({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},r}();function Df(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=Nf(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 Nf(r,e){if(!!r){if(typeof r=="string")return su(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 su(r,e)}}function su(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 cu(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 Wo(r,e,t){return e&&cu(r.prototype,e),t&&cu(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}var Ko=function(){return typeof Symbol=="function"},zo=function(r){return Ko()&&Boolean(Symbol[r])},Ho=function(r){return zo(r)?Symbol[r]:"@@"+r};Ko()&&!zo("observable")&&(Symbol.observable=Symbol("observable"));var Pf=Ho("iterator"),Qo=Ho("observable"),uu=Ho("species");function Qi(r,e){var t=r[e];if(t!=null){if(typeof t!="function")throw new TypeError(t+" is not a function");return t}}function Qn(r){var e=r.constructor;return e!==void 0&&(e=e[uu],e===null&&(e=void 0)),e!==void 0?e:Q}function Rf(r){return r instanceof Q}function tn(r){tn.log?tn.log(r):setTimeout(function(){throw r})}function Vi(r){Promise.resolve().then(function(){try{r()}catch(e){tn(e)}})}function lu(r){var e=r._cleanup;if(e!==void 0&&(r._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var t=Qi(e,"unsubscribe");t&&t.call(e)}}catch(n){tn(n)}}function Go(r){r._observer=void 0,r._queue=void 0,r._state="closed"}function Lf(r){var e=r._queue;if(!!e){r._queue=void 0,r._state="ready";for(var t=0;t<e.length&&(pu(r,e[t].type,e[t].value),r._state!=="closed");++t);}}function pu(r,e,t){r._state="running";var n=r._observer;try{var i=Qi(n,e);switch(e){case"next":i&&i.call(n,t);break;case"error":if(Go(r),i)i.call(n,t);else throw t;break;case"complete":Go(r),i&&i.call(n);break}}catch(a){tn(a)}r._state==="closed"?lu(r):r._state==="running"&&(r._state="ready")}function Vo(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}],Vi(function(){return Lf(r)});return}pu(r,e,t)}}var Ff=function(){function r(t,n){this._cleanup=void 0,this._observer=t,this._queue=void 0,this._state="initializing";var i=new $f(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"&&(Go(this),lu(this))},Wo(r,[{key:"closed",get:function(){return this._state==="closed"}}]),r}(),$f=function(){function r(t){this._subscription=t}var e=r.prototype;return e.next=function(n){Vo(this._subscription,"next",n)},e.error=function(n){Vo(this._subscription,"error",n)},e.complete=function(){Vo(this._subscription,"complete")},Wo(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 Ff(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(){c.unsubscribe(),a()}var c=i.subscribe({next:function(u){try{n(u,s)}catch(l){o(l),c.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=Qn(this);return new a(function(o){return i.subscribe({next:function(s){try{s=n(s)}catch(c){return o.error(c)}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=Qn(this);return new a(function(o){return i.subscribe({next:function(s){try{if(!n(s))return}catch(c){return o.error(c)}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=Qn(this),o=arguments.length>1,s=!1,c=arguments[1],u=c;return new a(function(l){return i.subscribe({next:function(p){var d=!s;if(s=!0,!d||o)try{u=n(u,p)}catch(f){return l.error(f)}else u=p},error:function(p){l.error(p)},complete:function(){if(!s&&!o)return l.error(new TypeError("Cannot reduce an empty sequence"));l.next(u),l.complete()}})})},e.concat=function(){for(var n=this,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];var s=Qn(this);return new s(function(c){var u,l=0;function p(d){u=d.subscribe({next:function(f){c.next(f)},error:function(f){c.error(f)},complete:function(){l===a.length?(u=void 0,c.complete()):p(s.from(a[l++]))}})}return p(n),function(){u&&(u.unsubscribe(),u=void 0)}})},e.flatMap=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Qn(this);return new a(function(o){var s=[],c=i.subscribe({next:function(l){if(n)try{l=n(l)}catch(d){return o.error(d)}var p=a.from(l).subscribe({next:function(d){o.next(d)},error:function(d){o.error(d)},complete:function(){var d=s.indexOf(p);d>=0&&s.splice(d,1),u()}});s.push(p)},error:function(l){o.error(l)},complete:function(){u()}});function u(){c.closed&&s.length===0&&o.complete()}return function(){s.forEach(function(l){return l.unsubscribe()}),c.unsubscribe()}})},e[Qo]=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=Qi(n,Qo);if(a){var o=a.call(n);if(Object(o)!==o)throw new TypeError(o+" is not an object");return Rf(o)&&o.constructor===i?o:new i(function(s){return o.subscribe(s)})}if(zo("iterator")&&(a=Qi(n,Pf),a))return new i(function(s){Vi(function(){if(!s.closed){for(var c=Df(a.call(n)),u;!(u=c()).done;){var l=u.value;if(s.next(l),s.closed)return}s.complete()}})});if(Array.isArray(n))return new i(function(s){Vi(function(){if(!s.closed){for(var c=0;c<n.length;++c)if(s.next(n[c]),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){Vi(function(){if(!s.closed){for(var c=0;c<i.length;++c)if(s.next(i[c]),s.closed)return;s.complete()}})})},Wo(r,null,[{key:uu,get:function(){return this}}]),r}();Ko()&&Object.defineProperty(Q,Symbol("extensions"),{value:{symbol:Qo,hostReportError:tn},configurable:!0});function Jo(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 rn;typeof self<"u"?rn=self:typeof window<"u"?rn=window:typeof global<"u"?rn=global:typeof module<"u"?rn=module:rn=Function("return this")();var P3=Jo(rn);var fu=Q.prototype,du="@@observable";fu[du]||(fu[du]=function(){return this});var Mf=Object.prototype.toString;function Gi(r){return Yo(r)}function Yo(r,e){switch(Mf.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]=Yo(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]=Yo(r[i],e)}),n}default:return r}}function jf(r){var e=new Set([r]);return e.forEach(function(t){J(t)&&Uf(t)===t&&Object.getOwnPropertyNames(t).forEach(function(n){J(t[n])&&e.add(t[n])})}),r}function Uf(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__&&jf(r),r}function _r(r,e,t){var n=[];r.forEach(function(i){return i[e]&&n.push(i)}),n.forEach(function(i){return i[e](t)})}function Wi(r,e,t){return new Q(function(n){var i=n.next,a=n.error,o=n.complete,s=0,c=!1,u={then:function(f){return new Promise(function(m){return m(f())})}};function l(f,m){return f?function(g){++s;var b=function(){return f(g)};u=u.then(b,b).then(function(_){--s,i&&i.call(n,_),c&&p.complete()},function(_){throw--s,_}).catch(function(_){a&&a.call(n,_)})}:function(g){return m&&m.call(n,g)}}var p={next:l(e,i),error:l(t,a),complete:function(){c=!0,s||o&&o.call(n)}},d=r.subscribe(p);return function(){return d.unsubscribe()}})}var ot=typeof WeakMap=="function"&&Ae(function(){return navigator.product})!=="ReactNative",hu=typeof WeakSet=="function",Xo=typeof Symbol=="function"&&typeof Symbol.for=="function",Wt=Xo&&Symbol.asyncIterator,W3=typeof Ae(function(){return window.document.createElement})=="function",K3=Ae(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1;function Ki(r){function e(t){Object.defineProperty(r,t,{value:Q})}return Xo&&Symbol.species&&e(Symbol.species),e("@@species"),r}function mu(r){return r&&typeof r.then=="function"}var nn=function(r){be(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),_r(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),_r(n.observers,"error",i))},complete:function(){var i=n,a=i.sub,o=i.sources,s=o===void 0?[]:o;if(a!==null){var c=s.shift();c?mu(c)?c.then(function(u){return n.sub=u.subscribe(n.handlers)}):n.sub=c.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"),_r(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)]),mu(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);Ki(nn);function Kt(r){return"incremental"in r}function qf(r){return"hasNext"in r&&"data"in r}function gu(r){return Kt(r)||qf(r)}function zi(r,e){var t=r,n=new Ge;return Kt(e)&&Oe(e.incremental)&&e.incremental.forEach(function(i){for(var a=i.data,o=i.path,s=o.length-1;s>=0;--s){var c=o[s],u=!isNaN(+c),l=u?[]:{};l[c]=a,a=l}t=n.merge(t,a)}),t}function an(r){var e=Hi(r);return Oe(e)}function Hi(r){var e=Oe(r.errors)?r.errors.slice(0):[];return Kt(r)&&Oe(r.incremental)&&r.incremental.forEach(function(t){t.errors&&e.push.apply(e,t.errors)}),e}function zt(){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 yu=new Map;function Wn(r){var e=yu.get(r)||1;return yu.set(r,e+1),"".concat(r,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function vu(r){var e=Wn("stringifyForDisplay");return JSON.stringify(r,function(t,n){return n===void 0?e:n}).split(JSON.stringify(e)).join("<undefined>")}function Kn(r,e){return zt(r,e,e.variables&&{variables:h(h({},r&&r.variables),e.variables)})}function Ji(r){return new Q(function(e){e.error(r)})}var zn=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 Zo(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 M("illegal argument: ".concat(i)):new M(27)}return r}function es(r,e){var t=h({},r),n=function(a){typeof a=="function"?t=h(h({},t),a(t)):t=h(h({},t),a)},i=function(){return h({},t)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:n}),Object.defineProperty(e,"getContext",{enumerable:!1,value:i}),e}function ts(r){var e={variables:r.variables||{},extensions:r.extensions||{},operationName:r.operationName,query:r.query};return e.operationName||(e.operationName=typeof e.query!="string"?en(e.query)||void 0:""),e}function bu(r,e){return e?e(r):Q.of()}function Hn(r){return typeof r=="function"?new st(r):r}function Yi(r){return r.request.length<=1}var Bf=function(r){be(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(Hn).reduce(function(t,n){return t.concat(n)})},r.split=function(e,t,n){var i=Hn(t),a=Hn(n||new r(bu));return Yi(i)&&Yi(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(es(t.context,ts(Zo(t))))||Q.of()},r.concat=function(e,t){var n=Hn(e);if(Yi(n))return __DEV__&&T.warn(new Bf("You are calling concat on a terminating link, which will have no effect",n)),n;var i=Hn(t);return Yi(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(bu)))},r.prototype.concat=function(e){return r.concat(this,e)},r.prototype.request=function(e,t){throw __DEV__?new M("request is not implemented"):new M(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 on=st.execute;var Cu="3.7.10";function Su(r){return!!r.body}function wu(r){return!!r.getReader}function _u(r){return!!(Wt&&r[Symbol.asyncIterator])}function Eu(r){return!!r.stream}function xu(r){return!!r.arrayBuffer}function Ou(r){return!!r.pipe}function rs(r){var e,t=r[Symbol.asyncIterator]();return e={next:function(){return t.next()}},e[Symbol.asyncIterator]=function(){return this},e}function ns(r){var e=null,t=null,n=!1,i=[],a=[];function o(p){if(!t){if(a.length){var d=a.shift();if(Array.isArray(d)&&d[0])return d[0]({value:p,done:!1})}i.push(p)}}function s(p){t=p;var d=a.slice();d.forEach(function(f){f[1](p)}),!e||e()}function c(){n=!0;var p=a.slice();p.forEach(function(d){d[0]({value:void 0,done:!0})}),!e||e()}e=function(){e=null,r.removeListener("data",o),r.removeListener("error",s),r.removeListener("end",c),r.removeListener("finish",c),r.removeListener("close",c)},r.on("data",o),r.on("error",s),r.on("end",c),r.on("finish",c),r.on("close",c);function u(){return new Promise(function(p,d){if(t)return d(t);if(i.length)return p({value:i.shift(),done:!1});if(n)return p({value:void 0,done:!0});a.push([p,d])})}var l={next:function(){return u()}};return Wt&&(l[Symbol.asyncIterator]=function(){return this}),l}function is(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 Wt&&(t[Symbol.asyncIterator]=function(){return this}),t}function Xi(r){var e={next:function(){return r.read()}};return Wt&&(e[Symbol.asyncIterator]=function(){return this}),e}function Tu(r){var e=r;if(Su(r)&&(e=r.body),_u(e))return rs(e);if(wu(e))return Xi(e.getReader());if(Eu(e))return Xi(e.stream().getReader());if(xu(e))return is(e.arrayBuffer());if(Ou(e))return ns(e);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var Iu=Object.prototype.hasOwnProperty;function Au(r,e){var t,n,i;return ut(this,void 0,void 0,function(){var a,o,s,c,u,l,p,d,f,m,g,b,_,v,C,E,A,D,I,R;return lt(this,function(ie){switch(ie.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=",c=o?.includes(s)?o?.substring(o?.indexOf(s)+s.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",u="--".concat(c),l="",p=Tu(r),d=!0,ie.label=1;case 1:return d?[4,p.next()]:[3,3];case 2:for(f=ie.sent(),m=f.value,g=f.done,b=typeof m=="string"?m:a.decode(m),d=!g,l+=b,_=l.indexOf(u);_>-1;){if(v=void 0,R=[l.slice(0,_),l.slice(_+u.length)],v=R[0],l=R[1],v.trim()){if(C=v.indexOf(`\r
|
|
27
27
|
\r
|
|
28
|
-
`),E=Vf(v.slice(0,C)),A=E["content-type"],A&&A.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");D=v.slice(C);try{I=
|
|
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(
|
|
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
|
|
28
|
+
`),E=Vf(v.slice(0,C)),A=E["content-type"],A&&A.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");D=v.slice(C);try{I=ku(r,D.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(te){Zi(te,e)}}_=l.indexOf(u)}return[3,1];case 3:return(i=e.complete)===null||i===void 0||i.call(e),[2]}})})}function Vf(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 ku(r,e){if(r.status>=300){var t=function(){try{return JSON.parse(e)}catch{return e}};zn(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 Zi(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 Du(r,e,t){Qf(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 Zi(n,t)})}function Qf(r){return function(e){return e.text().then(function(t){return ku(e,t)}).then(function(t){return e.status>=300&&zn(e,t,"Response not successful: Received status code ".concat(e.status)),!Array.isArray(t)&&!Iu.call(t,"data")&&!Iu.call(t,"errors")&&zn(e,t,"Server response was missing for query '".concat(Array.isArray(r)?r.map(function(n){return n.operationName}):r.operationName,"'.")),t})}}var Jn=function(r,e){var t;try{t=JSON.stringify(r)}catch(i){var n=__DEV__?new M("Network request failed. ".concat(e," is not serializable: ").concat(i.message)):new M(24);throw n.parseError=i,n}return t};var Gf={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},Wf={accept:"*/*","content-type":"application/json"},Kf={method:"POST"},Nu={http:Gf,headers:Wf,options:Kf},Pu=function(r,e){return e(r)};function Ru(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var i={},a={};t.forEach(function(p){i=h(h(h({},i),p.options),{headers:h(h({},i.headers),p.headers)}),p.credentials&&(i.credentials=p.credentials),a=h(h({},a),p.http)}),i.headers&&(i.headers=zf(i.headers,a.preserveHeaderCase));var o=r.operationName,s=r.extensions,c=r.variables,u=r.query,l={operationName:o,variables:c};return a.includeExtensions&&(l.extensions=s),a.includeQuery&&(l.query=e(u,Yr)),{options:i,body:l}}function zf(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 Lu=function(r){if(!r&&typeof fetch>"u")throw __DEV__?new M(`
|
|
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 M(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,d){t.push("".concat(p,"=").concat(encodeURIComponent(d)))};if("query"in e&&n("query",e.query),e.operationName&&n("operationName",e.operationName),e.variables){var i=void 0;try{i=Jn(e.variables,"Variables map")}catch(p){return{parseError:p}}n("variables",i)}if(e.extensions){var a=void 0;try{a=Jn(e.extensions,"Extensions map")}catch(p){return{parseError:p}}n("extensions",a)}var o="",s=r,c=r.indexOf("#");c!==-1&&(o=r.substr(c),s=r.substr(0,c));var u=s.indexOf("?")===-1?"?":"&",l=s+u+t.join("&")+o;return{newURI:l}}var $u=Ae(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,c=r.useGETForQueries,u=r.includeUnusedVariables,l=u===void 0?!1:u,p=St(r,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);__DEV__&&Pu(n||$u);var d={http:{includeExtensions:o,preserveHeaderCase:s},options:p.fetchOptions,credentials:p.credentials,headers:p.headers};return new st(function(f){var m=Lu(f,t),g=f.getContext(),b={};if(g.clientAwareness){var _=g.clientAwareness,v=_.name,C=_.version;v&&(b["apollographql-client-name"]=v),C&&(b["apollographql-client-version"]=C)}var E=h(h({},b),g.headers),A={http:g.http,options:g.fetchOptions,credentials:g.credentials,headers:E},D=Nu(f,a,ku,d,A),I=D.options,R=D.body;if(R.variables&&!l){var ie=new Set(Object.keys(R.variables));Fe(f.query,{Variable:function(z,bt,V){V&&V.kind!=="VariableDefinition"&&ie.delete(z.name.value)}}),ie.size&&(R.variables=h({},R.variables),ie.forEach(function(z){delete R.variables[z]}))}var ee;if(!I.signal){var vt=Ru(),It=vt.controller,ke=vt.signal;ee=It,ee&&(I.signal=ke)}var U=function(z){return z.kind==="OperationDefinition"&&z.operation==="mutation"};if(c&&!f.query.definitions.some(U)&&(I.method="GET"),Xr(["defer"],f.query)&&(I.headers=I.headers||{},I.headers.accept="multipart/mixed; deferSpec=20220824, application/json"),I.method==="GET"){var ve=Fu(m,R),ce=ve.newURI,K=ve.parseError;if(K)return zi(K);m=ce}else try{I.body=Jn(R,"Payload")}catch(z){return zi(z)}return new Q(function(z){var bt=n||Ae(function(){return fetch})||$u;return bt(m,I).then(function(V){var Ct;f.setContext({response:V});var jt=(Ct=V.headers)===null||Ct===void 0?void 0:Ct.get("content-type");return jt!==null&&/^multipart\/mixed/i.test(jt)?Tu(V,z):Au(V,f,z)}).catch(function(V){return Yi(V,z)}),function(){ee&&ee.abort()}})})};var is=function(r){be(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:Hf}=Object.prototype,Uu=Function.prototype.toString,as=new Map;function fe(r,e){try{return os(r,e)}finally{as.clear()}}function os(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(!Hf.call(e,i[s]))return!1;for(let s=0;s<o;++s){let c=i[s];if(!os(r[c],e[c]))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,c]=o.value;if(!e.has(s)||a&&!os(c,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:!Xf(i,Yf)}}return!1}function qu(r){return Object.keys(r).filter(Jf,r)}function Jf(r){return this[r]!==void 0}var Yf="{ [native code] }";function Xf(r,e){let t=r.length-e.length;return t>=0&&r.indexOf(e,t)===t}function Bu(r,e){let t=as.get(r);if(t){if(t.has(e))return!0}else as.set(r,t=new Set);return t.add(e),!1}var Zf=function(){return Object.create(null)},Vu=Array.prototype,ed=Vu.forEach,td=Vu.slice,Et=function(){function r(e,t){e===void 0&&(e=!0),t===void 0&&(t=Zf),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 ed.call(e,function(n){return t=t.getChildTrie(n)}),t.data||(t.data=this.makeData(td.call(e)))},r.prototype.getChildTrie=function(e){var t=this.weakness&&rd(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 rd(r){switch(typeof r){case"object":if(r===null)break;case"function":return!0}return!1}var Pe=null,Qu={},nd=1,id=()=>class{constructor(){this.id=["slot",nd++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=Pe;e;e=e.parent)if(this.id in e.slots){let t=e.slots[this.id];if(t===Qu)break;return e!==Pe&&(Pe.slots[this.id]=t),!0}return Pe&&(Pe.slots[this.id]=Qu),!1}getValue(){if(this.hasValue())return Pe.slots[this.id]}withValue(e,t,n,i){let a={__proto__:null,[this.id]:e},o=Pe;Pe={parent:o,slots:a};try{return t.apply(i,n)}finally{Pe=o}}static bind(e){let t=Pe;return function(){let n=Pe;try{return Pe=t,e.apply(this,arguments)}finally{Pe=n}}}static noContext(e,t,n){if(Pe){let i=Pe;try{return Pe=null,e.apply(n,t)}finally{Pe=i}}else return e.apply(n,t)}};function Gu(r){try{return r()}catch{}}var ss="@wry/context:Slot",ad=Gu(()=>globalThis)||Gu(()=>global)||Object.create(null),Wu=ad,sn=Wu[ss]||Array[ss]||function(r){try{Object.defineProperty(Wu,ss,{value:r,enumerable:!1,writable:!1,configurable:!0})}finally{return r}}(id());var{bind:od,noContext:sd}=sn;function cd(){}var ud=function(){function r(e,t){e===void 0&&(e=1/0),t===void 0&&(t=cd),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 sn,cs,ld=Object.prototype.hasOwnProperty,ls=(cs=Array.from,cs===void 0?function(r){var e=[];return r.forEach(function(t){return e.push(t)}),e}:cs);function Xi(r){var e=r.unsubscribe;typeof e=="function"&&(r.unsubscribe=void 0,e())}var Yn=[],pd=100;function cn(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 dd(r){return r.slice(0)}var hd=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&&!Ht(this))return Ku(this),this.value[0]},r.prototype.recompute=function(e){return cn(!this.recomputing,"already recomputing"),Ku(this),Ht(this)?md(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),ps(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=Yn.pop()||new Set),this.deps.add(e)},r.prototype.forgetDeps=function(){var e=this;this.deps&&(ls(this.deps).forEach(function(t){return t.delete(e)}),this.deps.clear(),Yn.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,[]),Ht(r)?Yu(e,r):Xu(e,r),e}function md(r,e){return el(r),Zi.withValue(r,gd,[r,e]),vd(r,e)&&yd(r),zu(r.value)}function gd(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 Ht(r){return r.dirty||!!(r.dirtyChildren&&r.dirtyChildren.size)}function yd(r){r.dirty=!1,!Ht(r)&&Ju(r)}function Hu(r){ps(r,Yu)}function Ju(r){ps(r,Xu)}function ps(r,e){var t=r.parents.size;if(t)for(var n=ls(r.parents),i=0;i<t;++i)e(n[i],r)}function Yu(r,e){cn(r.childValues.has(e)),cn(Ht(e));var t=!Ht(r);if(!r.dirtyChildren)r.dirtyChildren=Yn.pop()||new Set;else if(r.dirtyChildren.has(e))return;r.dirtyChildren.add(e),t&&Hu(r)}function Xu(r,e){cn(r.childValues.has(e)),cn(!Ht(e));var t=r.childValues.get(e);t.length===0?r.childValues.set(e,dd(e.value)):fd(t,e.value)||r.setDirty(),Zu(r,e),!Ht(r)&&Ju(r)}function Zu(r,e){var t=r.dirtyChildren;t&&(t.delete(e),t.size===0&&(Yn.length<pd&&Yn.push(t),r.dirtyChildren=null))}function el(r){r.childValues.size>0&&r.childValues.forEach(function(e,t){tl(r,t)}),r.forgetDeps(),cn(r.dirtyChildren===null)}function tl(r,e){e.parents.delete(r),r.childValues.delete(e),Zu(r,e)}function vd(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 bd={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 c=o&&ld.call(bd,o)?o:"setDirty";ls(s).forEach(function(u){return u[c]()}),e.delete(a),Xi(s)}},n}function rl(){var r=new Et(typeof WeakMap=="function");return function(){return r.lookupArray(arguments)}}var I4=rl(),us=new Set;function Er(r,e){e===void 0&&(e=Object.create(null));var t=new ud(e.max||Math.pow(2,16),function(u){return u.dispose()}),n=e.keyArgs,i=e.makeCacheKey||rl(),a=function(){var u=i.apply(null,n?n.apply(null,arguments):arguments);if(u===void 0)return r.apply(null,arguments);var l=t.get(u);l||(t.set(u,l=new hd(r)),l.subscribe=e.subscribe,l.forget=function(){return t.delete(u)});var p=l.recompute(Array.prototype.slice.call(arguments));return t.set(u,l),us.add(t),Zi.hasValue()||(us.forEach(function(d){return d.clean()}),us.clear()),p};Object.defineProperty(a,"size",{get:function(){return t.map.size},configurable:!1,enumerable:!1});function o(u){var l=t.get(u);l&&l.setDirty()}a.dirtyKey=o,a.dirty=function(){o(i.apply(null,arguments))};function s(u){var l=t.get(u);if(l)return l.peek()}a.peekKey=s,a.peek=function(){return s(i.apply(null,arguments))};function c(u){return t.delete(u)}return a.forgetKey=c,a.forget=function(){return c(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=Er(No)}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(h(h({},e),{rootId:e.id||"ROOT_QUERY",optimistic:t}))},r.prototype.readFragment=function(e,t){return t===void 0&&(t=!!e.optimistic),this.read(h(h({},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=St(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=St(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(h(h({},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(h(h({},e),{data:a})),a)}})},r}();var Xn=function(r){be(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 c=s.path.length-1;c>=0;--c)s.missing=(o={},o[s.path[c]]=s.missing,o)}else s.missing=s.path;return s.__proto__=e.prototype,s}return e}(Error);var Ce=Object.prototype.hasOwnProperty;function Zn(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=Zn(n)?Zn(i)?void 0:{_id:i}:{id:n}),Zn(n)&&!Zn(i)&&(n=i),!Zn(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 zt(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 ds=/^[_a-z][_0-9a-z]*/i;function dt(r){var e=r.match(ds);return e?e[0]:r}function ta(r,e,t){return H(e)?ae(e)?e.every(function(n){return ta(r,n,t)}):r.selections.every(function(n){if(Xe(n)&&kt(n,t)){var i=at(n);return Ce.call(e,i)&&(!n.selectionSet||ta(n.selectionSet,e[i],t))}return!0}):!1}function Jt(r){return H(r)&&!W(r)&&!ae(r)}function ol(){return new Ge}function ia(r,e){var t=yr(br(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),hs=function(){return aa},sl=Object.create(null),un=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 wt(i);if(W(i))return i;var o=n.policies.identify(i)[0];if(o){var s=wt(o);return a&&n.merge(o,i),s}}}return r.prototype.toObject=function(){return h({},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),Ce.call(this.data,e)){var n=this.data[e];if(n&&Ce.call(n,t))return n[t]}if(t==="__typename"&&Ce.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof Yt)return this.parent.get(e,t)},r.prototype.lookup=function(e,t){if(t&&this.group.depend(e,"__exists"),Ce.call(this.data,e))return this.data[e];if(this instanceof Yt)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 Ge(Sd).merge(a,o);if(this.data[i]=s,s!==a&&(delete this.refs[i],this.group.caching)){var c=Object.create(null);a||(c.__exists=1),Object.keys(o).forEach(function(u){if(!a||a[u]!==s[u]){c[u]=1;var l=dt(u);l!==u&&!n.policies.hasKeyArgs(s.__typename,l)&&(c[l]=1),s[u]===void 0&&!(n instanceof Yt)&&delete s[u]}}),c.__typename&&!(a&&a.__typename)&&this.policies.rootTypenamesById[i]===s.__typename&&delete c.__typename,Object.keys(c).forEach(function(u){return n.group.dirty(i,u)})}}},r.prototype.modify=function(e,t){var n=this,i=this.lookup(e);if(i){var a=Object.create(null),o=!1,s=!0,c={DELETE:aa,INVALIDATE:sl,isReference:W,toReference:this.toReference,canRead:this.canRead,readField:function(u,l){return n.policies.readField(typeof u=="string"?{fieldName:u,from:l||wt(e)}:u,{store:n})}};if(Object.keys(i).forEach(function(u){var l=dt(u),p=i[u];if(p!==void 0){var d=typeof t=="function"?t:t[u]||t[l];if(d){var f=d===hs?aa:d(Gn(p),h(h({},c),{fieldName:l,storeFieldName:u,storage:n.getStorage(e,u)}));f===sl?n.group.dirty(e,u):(f===aa&&(f=void 0),f!==p&&(a[u]=f,o=!0,p=f))}p!==void 0&&(s=!1)}}),o)return this.merge(e,a),s&&(this instanceof Yt?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]=hs,i):hs)}return!1},r.prototype.evict=function(e,t){var n=!1;return e.id&&(Ce.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof Yt&&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){Ce.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&&Ce.call(e,a)||t.delete(a)}),e){var n=e.__META,i=St(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 Yt?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){Ce.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 Yt;)a=a.parent;i.forEach(function(o){return a.delete(o)})}return i},r.prototype.findChildRefIds=function(e){if(!Ce.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),H(a)&&Object.keys(a).forEach(function(o){var s=a[o];H(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 Et(ot)},r.prototype.depend=function(e,t){if(this.d){this.d(ms(e,t));var n=dt(t);n!==t&&this.d(ms(e,n)),this.parent&&this.parent.depend(e,t)}},r.prototype.dirty=function(e,t){this.d&&this.d.dirty(ms(e,t),t==="__exists"?"forget":"setDirty")},r}();function ms(r,e){return e+"#"+r}function gs(r,e){xr(r)&&r.group.depend(e,"__exists")}(function(r){var e=function(t){be(n,t);function n(i){var a=i.policies,o=i.resultCaching,s=o===void 0?!0:o,c=i.seed,u=t.call(this,a,new cl(s))||this;return u.stump=new Cd(u),u.storageTrie=new Et(ot),c&&u.replace(c),u}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})(un||(un={}));var Yt=function(r){be(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(c){fe(o[c],s[c])||n.group.dirty(a,c)}):(n.group.dirty(a,"__exists"),Object.keys(s).forEach(function(c){n.group.dirty(a,c)})):n.delete(a)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return h(h({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(t){var n=this.parent.findChildRefIds(t);return Ce.call(this.data,t)?h(h({},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}(un),Cd=function(r){be(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}(Yt);function Sd(r,e,t){var n=r[t],i=e[t];return fe(n,i)?n:i}function xr(r){return!!(r instanceof un&&r.group.caching)}function wd(r){return H(r)?ae(r)?r.slice(0):h({__proto__:Object.getPrototypeOf(r)},r):r}var oa=function(){function r(){this.known=new(fu?WeakSet:Set),this.pool=new Et(ot),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return r.prototype.isKnown=function(e){return H(e)&&this.known.has(e)},r.prototype.pass=function(e){if(H(e)){var t=wd(e);return this.passes.set(t,e),t}return e},r.prototype.admit=function(e){var t=this;if(H(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),c=[s],u=this.sortedKeys(e);c.push(u.json);var l=c.length;u.sorted.forEach(function(f){c.push(t.admit(e[f]))});var o=this.pool.lookupArray(c);if(!o.object){var p=o.object=Object.create(s);this.known.add(p),u.sorted.forEach(function(f,m){p[f]=c[l+m]}),__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 Ze=Object.assign(function(r){if(H(r)){ys===void 0&&ul();var e=ys.admit(r),t=vs.get(e);return t===void 0&&vs.set(e,t=JSON.stringify(e)),t}return JSON.stringify(r)},{reset:ul}),ys,vs;function ul(){ys=new oa,vs=new(ot?WeakMap:Map)}function ll(r){return[r.selectionSet,r.objectOrReference,r.context,r.context.canonizeResults]}var pl=function(){function r(e){var t=this;this.knownResults=new(ot?WeakMap:Map),this.config=zt(e,{addTypename:e.addTypename!==!1,canonizeResults:na(e)}),this.canon=e.canon||new oa,this.executeSelectionSet=Er(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?h(h({},s),{result:t.canon.admit(s.result)}):s:(gs(n.context.store,n.enclosingRef.__ref),t.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize,keyArgs:ll,makeCacheKey:function(n,i,a,o){if(xr(a.store))return a.store.makeCacheKey(n,W(i)?i.__ref:i,a.varString,o)}}),this.executeSubSelectedArray=Er(function(n){return gs(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(xr(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,c=s===void 0?!0:s,u=e.canonizeResults,l=u===void 0?this.config.canonizeResults:u,p=this.config.cache.policies;o=h(h({},Sr(Bn(n))),o);var d=wt(a),f=this.executeSelectionSet({selectionSet:Cr(n).selectionSet,objectOrReference:d,enclosingRef:d,context:h({store:t,query:n,policies:p,variables:o,varString:Ze(o),canonizeResults:l},ia(n,this.config.fragments))}),m;if(f.missing&&(m=[new Xn(_d(f.missing),f.missing,n,o)],!c))throw m[0];return{result:f.result,complete:!m,missing:m}},r.prototype.isFresh=function(e,t,n,i){if(xr(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,c=o.policies,u=o.store,l=u.getFieldValue(i,"__typename"),p=[],d,f=new Ge;this.config.addTypename&&typeof l=="string"&&!c.rootIdsByTypename[l]&&p.push({__typename:l});function m(C,E){var A;return C.missing&&(d=f.merge(d,(A={},A[E]=C.missing,A))),C.result}var g=new Set(n.selections);g.forEach(function(C){var E,A;if(!!kt(C,s))if(Xe(C)){var D=c.readField({fieldName:C.name.value,field:C,variables:o.variables,from:i},o),I=at(C);D===void 0?wr.added(C)||(d=f.merge(d,(E={},E[I]="Can't find field '".concat(C.name.value,"' on ").concat(W(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),E))):ae(D)?D=m(t.executeSubSelectedArray({field:C,array:D,enclosingRef:a,context:o}),I):C.selectionSet?D!=null&&(D=m(t.executeSelectionSet({selectionSet:C.selectionSet,objectOrReference:D,enclosingRef:W(D)?D:a,context:o}),I)):o.canonizeResults&&(D=t.canon.pass(D)),D!==void 0&&p.push((A={},A[I]=D,A))}else{var R=vr(C,o.lookupFragment);if(!R&&C.kind===Ee.FRAGMENT_SPREAD)throw __DEV__?new M("No fragment named ".concat(C.name.value)):new M(5);R&&c.fragmentMatches(R,l)&&R.selectionSet.selections.forEach(g.add,g)}});var b=Vn(p),_={result:b,missing:d},v=o.canonizeResults?this.canon.admit(_):Gn(_);return v.result&&this.knownResults.set(v.result,n),v},r.prototype.execSubSelectedArrayImpl=function(e){var t=this,n=e.field,i=e.array,a=e.enclosingRef,o=e.context,s,c=new Ge;function u(l,p){var d;return l.missing&&(s=c.merge(s,(d={},d[p]=l.missing,d))),l.result}return n.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(l,p){return l===null?null:ae(l)?u(t.executeSubSelectedArray({field:n,array:l,enclosingRef:a,context:o}),p):n.selectionSet?u(t.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:l,enclosingRef:W(l)?l:a,context:o}),p):(__DEV__&&Ed(o.store,n,l),l)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:s}},r}();function _d(r){try{JSON.stringify(r,function(e,t){if(typeof t=="string")throw t;return t})}catch(e){return e}}function Ed(r,e,t){if(!e.selectionSet){var n=new Set([t]);n.forEach(function(i){H(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 ln=new sn,fl=new WeakMap;function ei(r){var e=fl.get(r);return e||fl.set(r,e={vars:new Set,dep:ea()}),e}function bs(r){ei(r).vars.forEach(function(e){return e.forgetCache(r)})}function dl(r){ei(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(c){ei(c).dep.dirty(n),xd(c)});var o=Array.from(t);t.clear(),o.forEach(function(c){return c(r)})}}else{var s=ln.getValue();s&&(i(s),ei(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),ei(a).vars.add(n),n};return n.forgetCache=function(a){return e.delete(a)},n}function xd(r){r.broadcastWatches&&r.broadcastWatches()}var hl=Object.create(null);function Cs(r){var e=JSON.stringify(r);return hl[e]||(hl[e]=Object.create(null))}function Ss(r){var e=Cs(r);return e.keyFieldsFn||(e.keyFieldsFn=function(t,n){var i=function(o,s){return n.readField(s,o)},a=n.keyObject=_s(r,function(o){var s=pn(n.storeObject,o,i);return s===void 0&&t!==n.storeObject&&Ce.call(t,o[0])&&(s=pn(t,o,gl)),__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 ws(r){var e=Cs(r);return e.keyArgsFn||(e.keyArgsFn=function(t,n){var i=n.field,a=n.variables,o=n.fieldName,s=_s(r,function(u){var l=u[0],p=l.charAt(0);if(p==="@"){if(i&&Oe(i.directives)){var d=l.slice(1),f=i.directives.find(function(_){return _.name.value===d}),m=f&&Dt(f,a);return m&&pn(m,u.slice(1))}return}if(p==="$"){var g=l.slice(1);if(a&&Ce.call(a,g)){var b=u.slice(0);return b[0]=g,pn(a,b)}return}if(t)return pn(t,u)}),c=JSON.stringify(s);return(t||c!=="{}")&&(o+=":"+c),o})}function _s(r,e){var t=new Ge;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=Cs(r);if(!e.paths){var t=e.paths=[],n=[];r.forEach(function(i,a){ae(i)?(ml(i).forEach(function(o){return t.push(n.concat(o))}),n.length=0):(n.push(i),ae(r[a+1])||(t.push(n.slice(0)),n.length=0))})}return e.paths}function gl(r,e){return r[e]}function pn(r,e,t){return t=t||gl,yl(e.reduce(function n(i,a){return ae(i)?i.map(function(o){return n(o,a)}):i&&t(i,a)},r))}function yl(r){return H(r)?ae(r)?r.map(yl):_s(Object.keys(r).sort(),function(e){return pn(r,e)}):r}Un.setStringify(Ze);function Es(r){return r.args!==void 0?r.args:r.field?Dt(r.field,r.variables):null}var Od=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=h({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=h(h({},t),{typename:a,storeObject:o,readField:t&&t.readField||function(){var d=ca(arguments,o);return i.readField(d,{store:i.cache.data,variables:d.variables})}}),c,u=a&&this.getTypePolicy(a),l=u&&u.keyFn||this.config.dataIdFromObject;l;){var p=l(e,s);if(ae(p))l=Ss(p);else{c=p;break}}return c=c?String(c):void 0,s.keyObject?[c,s.keyObject]:[c]},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,c=St(i,["queryType","mutationType","subscriptionType"]);a&&t.setRootTypename("Query",n),o&&t.setRootTypename("Mutation",n),s&&t.setRootTypename("Subscription",n),Ce.call(t.toBeAdded,n)?t.toBeAdded[n].push(c):t.toBeAdded[n]=[c]})},r.prototype.updateTypePolicy=function(e,t){var n=this,i=this.getTypePolicy(e),a=t.keyFields,o=t.fields;function s(c,u){c.merge=typeof u=="function"?u:u===!0?bl:u===!1?Cl:c.merge}s(i,t.merge),i.keyFn=a===!1?Od:ae(a)?Ss(a):typeof a=="function"?a:i.keyFn,o&&Object.keys(o).forEach(function(c){var u=n.getFieldPolicy(e,c,!0),l=o[c];if(typeof l=="function")u.read=l;else{var p=l.keyArgs,d=l.read,f=l.merge;u.keyFn=p===!1?vl:ae(p)?ws(p):typeof p=="function"?p:u.keyFn,typeof d=="function"&&(u.read=d),s(u,f)}u.read&&u.merge&&(u.keyFn=u.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(ds);(!a||a[0]!==i)&&t.fuzzySubtypes.set(i,new RegExp(i))})})},r.prototype.getTypePolicy=function(e){var t=this;if(!Ce.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),c=s.fields,u=St(s,["fields"]);Object.assign(n,u),Object.assign(n.fields,c)})}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),c=[s],u=function(m){var g=a.getSupertypeSet(m,!1);g&&g.size&&c.indexOf(g)<0&&c.push(g)},l=!!(n&&this.fuzzySubtypes.size),p=!1,d=0;d<c.length;++d){var f=c[d];if(f.has(o))return s.has(o)||(p&&__DEV__&&T.warn("Inferring subtype ".concat(t," of supertype ").concat(o)),s.add(o)),!0;f.forEach(u),l&&d===c.length-1&&ta(e.selectionSet,n,i)&&(l=!1,p=!0,this.fuzzySubtypes.forEach(function(m,g){var b=t.match(m);b&&b[0]===t&&u(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},c=Es(e);o;){var u=o(c,s);if(ae(u))o=ws(u);else{a=u||n;break}}return a===void 0&&(a=e.field?Ro(e.field,e.variables):Un(n,Es(e))),a===!1?n:n===dt(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=dt(o),c=t.store.getFieldValue(n,o),u=this.getFieldPolicy(e.typename,s,!1),l=u&&u.read;if(l){var p=Sl(this,n,e,t,t.store.getStorage(W(n)?n.__ref:n,o));return ln.withValue(this.cache,l,[c,p])}return c}}},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,c=n.merge;return c===bl?_l(i.store)(e,t):c===Cl?t:(i.overwrite&&(e=void 0),c(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=dt(a),s=t.variables||n.variables,c=n.store,u=c.toReference,l=c.canRead;return{args:Es(t),field:t.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:W,toReference:u,storage:i,cache:r.cache,canRead:l,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=h({},n),Ce.call(o,"from")||(o.from=e)),__DEV__&&o.from===void 0&&__DEV__&&T.warn("Undefined 'from' passed to readField with arguments ".concat(gu(Array.from(r)))),o.variables===void 0&&(o.variables=t),o}function _l(r){return function(t,n){if(ae(t)||ae(n))throw __DEV__?new M("Cannot automatically merge arrays"):new M(4);if(H(t)&&H(n)){var i=r.getFieldValue(t,"__typename"),a=r.getFieldValue(n,"__typename"),o=i&&a&&i!==a;if(o)return n;if(W(t)&&Jt(n))return r.merge(t.__ref,n),t;if(Jt(t)&&W(n))return r.merge(t,n.__ref),n;if(Jt(t)&&Jt(n))return h(h({},t),n)}return n}}function xs(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:h(h({},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,c=t.overwrite,u=_t(i),l=ol();s=h(h({},Sr(u)),s);var p=h(h({store:e,written:Object.create(null),merge:function(f,m){return l.merge(f,m)},variables:s,varString:Ze(s)},ia(i,this.fragments)),{overwrite:!!c,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),d=this.processSelectionSet({result:a||Object.create(null),dataId:o,selectionSet:u.selectionSet,mergeTree:{map:new Map},context:p});if(!W(d))throw __DEV__?new M("Could not identify object ".concat(JSON.stringify(a))):new M(7);return p.incomingById.forEach(function(f,m){var g=f.storeObject,b=f.mergeTree,_=f.fieldNodeSet,v=wt(m);if(b&&b.map.size){var C=n.applyMerges(b,v,g,p);if(W(C))return;g=C}if(__DEV__&&!p.overwrite){var E=Object.create(null);_.forEach(function(I){I.selectionSet&&(E[I.name.value]=!0)});var A=function(I){return E[dt(I)]===!0},D=function(I){var R=b&&b.map.get(I);return Boolean(R&&R.info&&R.info.merge)};Object.keys(g).forEach(function(I){A(I)&&!D(I)&&Td(v,g,I,p.store)})}e.merge(m,g)}),e.retain(d.__ref),d},r.prototype.processSelectionSet=function(e){var t=this,n=e.dataId,i=e.result,a=e.selectionSet,o=e.context,s=e.mergeTree,c=this.cache.policies,u=Object.create(null),l=n&&c.rootTypenamesById[n]||qn(i,a,o.fragmentMap)||n&&o.store.get(n,"__typename");typeof l=="string"&&(u.__typename=l);var p=function(){var C=ca(arguments,u,o.variables);if(W(C.from)){var E=o.incomingById.get(C.from.__ref);if(E){var A=c.readField(h(h({},C),{from:E.storeObject}),o);if(A!==void 0)return A}}return c.readField(C,o)},d=new Set;this.flattenFields(a,i,o,l).forEach(function(C,E){var A,D=at(E),I=i[D];if(d.add(E),I!==void 0){var R=c.getStoreFieldName({typename:l,fieldName:E.name.value,field:E,variables:C.variables}),ie=El(s,R),ee=t.processFieldValue(I,E,E.selectionSet?xs(C,!1,!1):C,ie),vt=void 0;E.selectionSet&&(W(ee)||Jt(ee))&&(vt=p("__typename",ee));var It=c.getMergeFunction(l,E.name.value,vt);It?ie.info={field:E,typename:l,merge:It}:xl(s,R),u=C.merge(u,(A={},A[R]=ee,A))}else __DEV__&&!C.clientOnly&&!C.deferred&&!wr.added(E)&&!c.getReadFunction(l,E.name.value)&&__DEV__&&T.error("Missing field '".concat(at(E),"' while writing result ").concat(JSON.stringify(i,null,2)).substring(0,1e3))});try{var f=c.identify(i,{typename:l,selectionSet:a,fragmentMap:o.fragmentMap,storeObject:u,readField:p}),m=f[0],g=f[1];n=n||m,g&&(u=o.merge(u,g))}catch(C){if(!n)throw C}if(typeof n=="string"){var b=wt(n),_=o.written[n]||(o.written[n]=[]);if(_.indexOf(a)>=0||(_.push(a),this.reader&&this.reader.isFresh(i,b,a,o)))return b;var v=o.incomingById.get(n);return v?(v.storeObject=o.merge(v.storeObject,u),v.mergeTree=Os(v.mergeTree,s),d.forEach(function(C){return v.fieldNodeSet.add(C)})):o.incomingById.set(n,{storeObject:u,mergeTree:ua(s)?void 0:s,fieldNodeSet:d}),b}return u},r.prototype.processFieldValue=function(e,t,n,i){var a=this;return!t.selectionSet||e===null?__DEV__?Vi(e):e:ae(e)?e.map(function(o,s){var c=a.processFieldValue(o,t,n,El(i,s));return xl(i,s),c}):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:i})},r.prototype.flattenFields=function(e,t,n,i){i===void 0&&(i=qn(t,e,n.fragmentMap));var a=new Map,o=this.cache.policies,s=new Et(!1);return function c(u,l){var p=s.lookup(u,l.clientOnly,l.deferred);p.visited||(p.visited=!0,u.selections.forEach(function(d){if(!!kt(d,n.variables)){var f=l.clientOnly,m=l.deferred;if(!(f&&m)&&Oe(d.directives)&&d.directives.forEach(function(_){var v=_.name.value;if(v==="client"&&(f=!0),v==="defer"){var C=Dt(_,n.variables);(!C||C.if!==!1)&&(m=!0)}}),Xe(d)){var g=a.get(d);g&&(f=f&&g.clientOnly,m=m&&g.deferred),a.set(d,xs(n,f,m))}else{var b=vr(d,n.lookupFragment);if(!b&&d.kind===Ee.FRAGMENT_SPREAD)throw __DEV__?new M("No fragment named ".concat(d.name.value)):new M(8);b&&o.fragmentMatches(b,i,t,n.variables)&&c(b.selectionSet,xs(n,f,m))}}}))}(e,n),a},r.prototype.applyMerges=function(e,t,n,i,a){var o,s=this;if(e.map.size&&!W(n)){var c=!ae(n)&&(W(t)||Jt(t))?t:void 0,u=n;c&&!a&&(a=[W(c)?c.__ref:c]);var l,p=function(d,f){return ae(d)?typeof f=="number"?d[f]:void 0:i.store.getFieldValue(d,String(f))};e.map.forEach(function(d,f){var m=p(c,f),g=p(u,f);if(g!==void 0){a&&a.push(f);var b=s.applyMerges(d,m,g,i,a);b!==g&&(l=l||new Map,l.set(f,b)),a&&T(a.pop()===f)}}),l&&(n=ae(u)?u.slice(0):h({},u),l.forEach(function(d,f){n[f]=d}))}return e.info?this.cache.policies.runMergeFunction(t,n,e.info,i,a&&(o=i.store).getStorage.apply(o,a)):n},r}();var Il=[];function El(r,e){var t=r.map;return t.has(e)||t.set(e,Il.pop()||{map:new Map}),t.get(e)}function Os(r,e){if(r===e||!e||ua(e))return r;if(!r||ua(r))return e;var t=r.info&&e.info?h(h({},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,c){a.map.set(c,Os(s,e.map.get(c))),o.delete(c)}),o.forEach(function(s){a.map.set(s,Os(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)&&(Il.push(n),t.delete(e))}var Ol=new Set;function Td(r,e,t,n){var i=function(p){var d=n.getFieldValue(p,t);return typeof d=="object"&&d},a=i(r);if(!!a){var o=i(e);if(!!o&&!W(a)&&!fe(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"),c=dt(t),u="".concat(s,".").concat(c);if(!Ol.has(u)){Ol.add(u);var l=[];!ae(a)&&!ae(o)&&[a,o].forEach(function(p){var d=n.getFieldValue(p,"__typename");typeof d=="string"&&!l.includes(d)&&l.push(d)}),__DEV__&&T.warn("Cache data may be lost when replacing the ".concat(c," field of a ").concat(s,` object.
|
|
38
|
+
`):new M(23)};var Fu=function(){if(typeof AbortController>"u")return{controller:!1,signal:!1};var r=new AbortController,e=r.signal;return{controller:r,signal:e}};var $u=function(r,e){var t=r.getContext(),n=t.uri;return n||(typeof e=="function"?e(r):e||"/graphql")};function Mu(r,e){var t=[],n=function(p,d){t.push("".concat(p,"=").concat(encodeURIComponent(d)))};if("query"in e&&n("query",e.query),e.operationName&&n("operationName",e.operationName),e.variables){var i=void 0;try{i=Jn(e.variables,"Variables map")}catch(p){return{parseError:p}}n("variables",i)}if(e.extensions){var a=void 0;try{a=Jn(e.extensions,"Extensions map")}catch(p){return{parseError:p}}n("extensions",a)}var o="",s=r,c=r.indexOf("#");c!==-1&&(o=r.substr(c),s=r.substr(0,c));var u=s.indexOf("?")===-1?"?":"&",l=s+u+t.join("&")+o;return{newURI:l}}var ju=Ae(function(){return fetch}),Uu=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?Pu:i,o=r.includeExtensions,s=r.preserveHeaderCase,c=r.useGETForQueries,u=r.includeUnusedVariables,l=u===void 0?!1:u,p=St(r,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);__DEV__&&Lu(n||ju);var d={http:{includeExtensions:o,preserveHeaderCase:s},options:p.fetchOptions,credentials:p.credentials,headers:p.headers};return new st(function(f){var m=$u(f,t),g=f.getContext(),b={};if(g.clientAwareness){var _=g.clientAwareness,v=_.name,C=_.version;v&&(b["apollographql-client-name"]=v),C&&(b["apollographql-client-version"]=C)}var E=h(h({},b),g.headers),A={http:g.http,options:g.fetchOptions,credentials:g.credentials,headers:E},D=Ru(f,a,Nu,d,A),I=D.options,R=D.body;if(R.variables&&!l){var ie=new Set(Object.keys(R.variables));Fe(f.query,{Variable:function(H,bt,V){V&&V.kind!=="VariableDefinition"&&ie.delete(H.name.value)}}),ie.size&&(R.variables=h({},R.variables),ie.forEach(function(H){delete R.variables[H]}))}var te;if(!I.signal){var vt=Fu(),It=vt.controller,ke=vt.signal;te=It,te&&(I.signal=ke)}var U=function(H){return H.kind==="OperationDefinition"&&H.operation==="mutation"};if(c&&!f.query.definitions.some(U)&&(I.method="GET"),Xr(["defer"],f.query)&&(I.headers=I.headers||{},I.headers.accept="multipart/mixed; deferSpec=20220824, application/json"),I.method==="GET"){var ve=Mu(m,R),ce=ve.newURI,z=ve.parseError;if(z)return Ji(z);m=ce}else try{I.body=Jn(R,"Payload")}catch(H){return Ji(H)}return new Q(function(H){var bt=n||Ae(function(){return fetch})||ju;return bt(m,I).then(function(V){var Ct;f.setContext({response:V});var jt=(Ct=V.headers)===null||Ct===void 0?void 0:Ct.get("content-type");return jt!==null&&/^multipart\/mixed/i.test(jt)?Au(V,H):Du(V,f,H)}).catch(function(V){return Zi(V,H)}),function(){te&&te.abort()}})})};var as=function(r){be(e,r);function e(t){t===void 0&&(t={});var n=r.call(this,Uu(t).request)||this;return n.options=t,n}return e}(st);var{toString:qu,hasOwnProperty:Hf}=Object.prototype,Bu=Function.prototype.toString,os=new Map;function fe(r,e){try{return ss(r,e)}finally{os.clear()}}function ss(r,e){if(r===e)return!0;let t=qu.call(r),n=qu.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=Vu(r),a=Vu(e),o=i.length;if(o!==a.length)return!1;for(let s=0;s<o;++s)if(!Hf.call(e,i[s]))return!1;for(let s=0;s<o;++s){let c=i[s];if(!ss(r[c],e[c]))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,c]=o.value;if(!e.has(s)||a&&!ss(c,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=Bu.call(r);return i!==Bu.call(e)?!1:!Xf(i,Yf)}}return!1}function Vu(r){return Object.keys(r).filter(Jf,r)}function Jf(r){return this[r]!==void 0}var Yf="{ [native code] }";function Xf(r,e){let t=r.length-e.length;return t>=0&&r.indexOf(e,t)===t}function Qu(r,e){let t=os.get(r);if(t){if(t.has(e))return!0}else os.set(r,t=new Set);return t.add(e),!1}var Zf=function(){return Object.create(null)},Gu=Array.prototype,ed=Gu.forEach,td=Gu.slice,Et=function(){function r(e,t){e===void 0&&(e=!0),t===void 0&&(t=Zf),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 ed.call(e,function(n){return t=t.getChildTrie(n)}),t.data||(t.data=this.makeData(td.call(e)))},r.prototype.getChildTrie=function(e){var t=this.weakness&&rd(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 rd(r){switch(typeof r){case"object":if(r===null)break;case"function":return!0}return!1}var Pe=null,Wu={},nd=1,id=()=>class{constructor(){this.id=["slot",nd++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=Pe;e;e=e.parent)if(this.id in e.slots){let t=e.slots[this.id];if(t===Wu)break;return e!==Pe&&(Pe.slots[this.id]=t),!0}return Pe&&(Pe.slots[this.id]=Wu),!1}getValue(){if(this.hasValue())return Pe.slots[this.id]}withValue(e,t,n,i){let a={__proto__:null,[this.id]:e},o=Pe;Pe={parent:o,slots:a};try{return t.apply(i,n)}finally{Pe=o}}static bind(e){let t=Pe;return function(){let n=Pe;try{return Pe=t,e.apply(this,arguments)}finally{Pe=n}}}static noContext(e,t,n){if(Pe){let i=Pe;try{return Pe=null,e.apply(n,t)}finally{Pe=i}}else return e.apply(n,t)}};function Ku(r){try{return r()}catch{}}var cs="@wry/context:Slot",ad=Ku(()=>globalThis)||Ku(()=>global)||Object.create(null),zu=ad,sn=zu[cs]||Array[cs]||function(r){try{Object.defineProperty(zu,cs,{value:r,enumerable:!1,writable:!1,configurable:!0})}finally{return r}}(id());var{bind:od,noContext:sd}=sn;function cd(){}var ud=function(){function r(e,t){e===void 0&&(e=1/0),t===void 0&&(t=cd),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}(),ta=new sn,us,ld=Object.prototype.hasOwnProperty,ps=(us=Array.from,us===void 0?function(r){var e=[];return r.forEach(function(t){return e.push(t)}),e}:us);function ea(r){var e=r.unsubscribe;typeof e=="function"&&(r.unsubscribe=void 0,e())}var Yn=[],pd=100;function cn(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 Ju(r){switch(r.length){case 0:throw new Error("unknown value");case 1:return r[0];case 2:throw r[1]}}function dd(r){return r.slice(0)}var hd=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&&!Ht(this))return Hu(this),this.value[0]},r.prototype.recompute=function(e){return cn(!this.recomputing,"already recomputing"),Hu(this),Ht(this)?md(this,e):Ju(this.value)},r.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,Yu(this),ea(this))},r.prototype.dispose=function(){var e=this;this.setDirty(),rl(this),fs(this,function(t,n){t.setDirty(),nl(t,e)})},r.prototype.forget=function(){this.dispose()},r.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=Yn.pop()||new Set),this.deps.add(e)},r.prototype.forgetDeps=function(){var e=this;this.deps&&(ps(this.deps).forEach(function(t){return t.delete(e)}),this.deps.clear(),Yn.push(this.deps),this.deps=null)},r.count=0,r}();function Hu(r){var e=ta.getValue();if(e)return r.parents.add(e),e.childValues.has(r)||e.childValues.set(r,[]),Ht(r)?Zu(e,r):el(e,r),e}function md(r,e){return rl(r),ta.withValue(r,gd,[r,e]),vd(r,e)&&yd(r),Ju(r.value)}function gd(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 Ht(r){return r.dirty||!!(r.dirtyChildren&&r.dirtyChildren.size)}function yd(r){r.dirty=!1,!Ht(r)&&Xu(r)}function Yu(r){fs(r,Zu)}function Xu(r){fs(r,el)}function fs(r,e){var t=r.parents.size;if(t)for(var n=ps(r.parents),i=0;i<t;++i)e(n[i],r)}function Zu(r,e){cn(r.childValues.has(e)),cn(Ht(e));var t=!Ht(r);if(!r.dirtyChildren)r.dirtyChildren=Yn.pop()||new Set;else if(r.dirtyChildren.has(e))return;r.dirtyChildren.add(e),t&&Yu(r)}function el(r,e){cn(r.childValues.has(e)),cn(!Ht(e));var t=r.childValues.get(e);t.length===0?r.childValues.set(e,dd(e.value)):fd(t,e.value)||r.setDirty(),tl(r,e),!Ht(r)&&Xu(r)}function tl(r,e){var t=r.dirtyChildren;t&&(t.delete(e),t.size===0&&(Yn.length<pd&&Yn.push(t),r.dirtyChildren=null))}function rl(r){r.childValues.size>0&&r.childValues.forEach(function(e,t){nl(r,t)}),r.forgetDeps(),cn(r.dirtyChildren===null)}function nl(r,e){e.parents.delete(r),r.childValues.delete(e),tl(r,e)}function vd(r,e){if(typeof r.subscribe=="function")try{ea(r),r.unsubscribe=r.subscribe.apply(null,e)}catch{return r.setDirty(),!1}return!0}var bd={setDirty:!0,dispose:!0,forget:!0};function ra(r){var e=new Map,t=r&&r.subscribe;function n(i){var a=ta.getValue();if(a){var o=e.get(i);o||e.set(i,o=new Set),a.dependOn(o),typeof t=="function"&&(ea(o),o.unsubscribe=t(i))}}return n.dirty=function(a,o){var s=e.get(a);if(s){var c=o&&ld.call(bd,o)?o:"setDirty";ps(s).forEach(function(u){return u[c]()}),e.delete(a),ea(s)}},n}function il(){var r=new Et(typeof WeakMap=="function");return function(){return r.lookupArray(arguments)}}var I4=il(),ls=new Set;function Er(r,e){e===void 0&&(e=Object.create(null));var t=new ud(e.max||Math.pow(2,16),function(u){return u.dispose()}),n=e.keyArgs,i=e.makeCacheKey||il(),a=function(){var u=i.apply(null,n?n.apply(null,arguments):arguments);if(u===void 0)return r.apply(null,arguments);var l=t.get(u);l||(t.set(u,l=new hd(r)),l.subscribe=e.subscribe,l.forget=function(){return t.delete(u)});var p=l.recompute(Array.prototype.slice.call(arguments));return t.set(u,l),ls.add(t),ta.hasValue()||(ls.forEach(function(d){return d.clean()}),ls.clear()),p};Object.defineProperty(a,"size",{get:function(){return t.map.size},configurable:!1,enumerable:!1});function o(u){var l=t.get(u);l&&l.setDirty()}a.dirtyKey=o,a.dirty=function(){o(i.apply(null,arguments))};function s(u){var l=t.get(u);if(l)return l.peek()}a.peekKey=s,a.peek=function(){return s(i.apply(null,arguments))};function c(u){return t.delete(u)}return a.forgetKey=c,a.forget=function(){return c(i.apply(null,arguments))},a.makeCacheKey=i,a.getKey=n?function(){return i.apply(null,n.apply(null,arguments))}:i,Object.freeze(a)}var ds=function(){function r(){this.getFragmentDoc=Er(Po)}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(h(h({},e),{rootId:e.id||"ROOT_QUERY",optimistic:t}))},r.prototype.readFragment=function(e,t){return t===void 0&&(t=!!e.optimistic),this.read(h(h({},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=St(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=St(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(h(h({},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(h(h({},e),{data:a})),a)}})},r}();var Xn=function(r){be(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 c=s.path.length-1;c>=0;--c)s.missing=(o={},o[s.path[c]]=s.missing,o)}else s.missing=s.path;return s.__proto__=e.prototype,s}return e}(Error);var Ce=Object.prototype.hasOwnProperty;function Zn(r){return r==null}function ia(r,e){var t=r.__typename,n=r.id,i=r._id;if(typeof t=="string"&&(e&&(e.keyObject=Zn(n)?Zn(i)?void 0:{_id:i}:{id:n}),Zn(n)&&!Zn(i)&&(n=i),!Zn(n)))return"".concat(t,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var al={dataIdFromObject:ia,addTypename:!0,resultCaching:!0,canonizeResults:!1};function ol(r){return zt(al,r)}function aa(r){var e=r.canonizeResults;return e===void 0?al.canonizeResults:e}function sl(r,e){return K(e)?r.get(e.__ref,"__typename"):e&&e.__typename}var hs=/^[_a-z][_0-9a-z]*/i;function dt(r){var e=r.match(hs);return e?e[0]:r}function na(r,e,t){return J(e)?ae(e)?e.every(function(n){return na(r,n,t)}):r.selections.every(function(n){if(Xe(n)&&kt(n,t)){var i=at(n);return Ce.call(e,i)&&(!n.selectionSet||na(n.selectionSet,e[i],t))}return!0}):!1}function Jt(r){return J(r)&&!K(r)&&!ae(r)}function cl(){return new Ge}function oa(r,e){var t=yr(br(r));return{fragmentMap:t,lookupFragment:function(n){var i=t[n];return!i&&e&&(i=e.lookup(n)),i||null}}}var sa=Object.create(null),ms=function(){return sa},ul=Object.create(null),un=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(K(i)?n.get(i.__ref,a):i&&i[a])},this.canRead=function(i){return K(i)?n.has(i.__ref):typeof i=="object"},this.toReference=function(i,a){if(typeof i=="string")return wt(i);if(K(i))return i;var o=n.policies.identify(i)[0];if(o){var s=wt(o);return a&&n.merge(o,i),s}}}return r.prototype.toObject=function(){return h({},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),Ce.call(this.data,e)){var n=this.data[e];if(n&&Ce.call(n,t))return n[t]}if(t==="__typename"&&Ce.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof Yt)return this.parent.get(e,t)},r.prototype.lookup=function(e,t){if(t&&this.group.depend(e,"__exists"),Ce.call(this.data,e))return this.data[e];if(this instanceof Yt)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;K(e)&&(e=e.__ref),K(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 Ge(Sd).merge(a,o);if(this.data[i]=s,s!==a&&(delete this.refs[i],this.group.caching)){var c=Object.create(null);a||(c.__exists=1),Object.keys(o).forEach(function(u){if(!a||a[u]!==s[u]){c[u]=1;var l=dt(u);l!==u&&!n.policies.hasKeyArgs(s.__typename,l)&&(c[l]=1),s[u]===void 0&&!(n instanceof Yt)&&delete s[u]}}),c.__typename&&!(a&&a.__typename)&&this.policies.rootTypenamesById[i]===s.__typename&&delete c.__typename,Object.keys(c).forEach(function(u){return n.group.dirty(i,u)})}}},r.prototype.modify=function(e,t){var n=this,i=this.lookup(e);if(i){var a=Object.create(null),o=!1,s=!0,c={DELETE:sa,INVALIDATE:ul,isReference:K,toReference:this.toReference,canRead:this.canRead,readField:function(u,l){return n.policies.readField(typeof u=="string"?{fieldName:u,from:l||wt(e)}:u,{store:n})}};if(Object.keys(i).forEach(function(u){var l=dt(u),p=i[u];if(p!==void 0){var d=typeof t=="function"?t:t[u]||t[l];if(d){var f=d===ms?sa:d(Gn(p),h(h({},c),{fieldName:l,storeFieldName:u,storage:n.getStorage(e,u)}));f===ul?n.group.dirty(e,u):(f===sa&&(f=void 0),f!==p&&(a[u]=f,o=!0,p=f))}p!==void 0&&(s=!1)}}),o)return this.merge(e,a),s&&(this instanceof Yt?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]=ms,i):ms)}return!1},r.prototype.evict=function(e,t){var n=!1;return e.id&&(Ce.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof Yt&&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){Ce.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&&Ce.call(e,a)||t.delete(a)}),e){var n=e.__META,i=St(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 Yt?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){Ce.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 Yt;)a=a.parent;i.forEach(function(o){return a.delete(o)})}return i},r.prototype.findChildRefIds=function(e){if(!Ce.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){K(a)&&(t[a.__ref]=!0),J(a)&&Object.keys(a).forEach(function(o){var s=a[o];J(s)&&i.add(s)})})}return this.refs[e]},r.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},r}();var ll=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?ra():null,this.keyMaker=new Et(ot)},r.prototype.depend=function(e,t){if(this.d){this.d(gs(e,t));var n=dt(t);n!==t&&this.d(gs(e,n)),this.parent&&this.parent.depend(e,t)}},r.prototype.dirty=function(e,t){this.d&&this.d.dirty(gs(e,t),t==="__exists"?"forget":"setDirty")},r}();function gs(r,e){return e+"#"+r}function ys(r,e){xr(r)&&r.group.depend(e,"__exists")}(function(r){var e=function(t){be(n,t);function n(i){var a=i.policies,o=i.resultCaching,s=o===void 0?!0:o,c=i.seed,u=t.call(this,a,new ll(s))||this;return u.stump=new Cd(u),u.storageTrie=new Et(ot),c&&u.replace(c),u}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})(un||(un={}));var Yt=function(r){be(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(c){fe(o[c],s[c])||n.group.dirty(a,c)}):(n.group.dirty(a,"__exists"),Object.keys(s).forEach(function(c){n.group.dirty(a,c)})):n.delete(a)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return h(h({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(t){var n=this.parent.findChildRefIds(t);return Ce.call(this.data,t)?h(h({},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}(un),Cd=function(r){be(e,r);function e(t){return r.call(this,"EntityStore.Stump",t,function(){},new ll(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}(Yt);function Sd(r,e,t){var n=r[t],i=e[t];return fe(n,i)?n:i}function xr(r){return!!(r instanceof un&&r.group.caching)}function wd(r){return J(r)?ae(r)?r.slice(0):h({__proto__:Object.getPrototypeOf(r)},r):r}var ca=function(){function r(){this.known=new(hu?WeakSet:Set),this.pool=new Et(ot),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return r.prototype.isKnown=function(e){return J(e)&&this.known.has(e)},r.prototype.pass=function(e){if(J(e)){var t=wd(e);return this.passes.set(t,e),t}return e},r.prototype.admit=function(e){var t=this;if(J(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),c=[s],u=this.sortedKeys(e);c.push(u.json);var l=c.length;u.sorted.forEach(function(f){c.push(t.admit(e[f]))});var o=this.pool.lookupArray(c);if(!o.object){var p=o.object=Object.create(s);this.known.add(p),u.sorted.forEach(function(f,m){p[f]=c[l+m]}),__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 Ze=Object.assign(function(r){if(J(r)){vs===void 0&&pl();var e=vs.admit(r),t=bs.get(e);return t===void 0&&bs.set(e,t=JSON.stringify(e)),t}return JSON.stringify(r)},{reset:pl}),vs,bs;function pl(){vs=new ca,bs=new(ot?WeakMap:Map)}function fl(r){return[r.selectionSet,r.objectOrReference,r.context,r.context.canonizeResults]}var dl=function(){function r(e){var t=this;this.knownResults=new(ot?WeakMap:Map),this.config=zt(e,{addTypename:e.addTypename!==!1,canonizeResults:aa(e)}),this.canon=e.canon||new ca,this.executeSelectionSet=Er(function(n){var i,a=n.context.canonizeResults,o=fl(n);o[3]=!a;var s=(i=t.executeSelectionSet).peek.apply(i,o);return s?a?h(h({},s),{result:t.canon.admit(s.result)}):s:(ys(n.context.store,n.enclosingRef.__ref),t.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize,keyArgs:fl,makeCacheKey:function(n,i,a,o){if(xr(a.store))return a.store.makeCacheKey(n,K(i)?i.__ref:i,a.varString,o)}}),this.executeSubSelectedArray=Er(function(n){return ys(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(xr(o.store))return o.store.makeCacheKey(i,a,o.varString)}})}return r.prototype.resetCanon=function(){this.canon=new ca},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,c=s===void 0?!0:s,u=e.canonizeResults,l=u===void 0?this.config.canonizeResults:u,p=this.config.cache.policies;o=h(h({},Sr(Bn(n))),o);var d=wt(a),f=this.executeSelectionSet({selectionSet:Cr(n).selectionSet,objectOrReference:d,enclosingRef:d,context:h({store:t,query:n,policies:p,variables:o,varString:Ze(o),canonizeResults:l},oa(n,this.config.fragments))}),m;if(f.missing&&(m=[new Xn(_d(f.missing),f.missing,n,o)],!c))throw m[0];return{result:f.result,complete:!m,missing:m}},r.prototype.isFresh=function(e,t,n,i){if(xr(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(K(i)&&!o.policies.rootTypenamesById[i.__ref]&&!o.store.has(i.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(i.__ref," object")};var s=o.variables,c=o.policies,u=o.store,l=u.getFieldValue(i,"__typename"),p=[],d,f=new Ge;this.config.addTypename&&typeof l=="string"&&!c.rootIdsByTypename[l]&&p.push({__typename:l});function m(C,E){var A;return C.missing&&(d=f.merge(d,(A={},A[E]=C.missing,A))),C.result}var g=new Set(n.selections);g.forEach(function(C){var E,A;if(!!kt(C,s))if(Xe(C)){var D=c.readField({fieldName:C.name.value,field:C,variables:o.variables,from:i},o),I=at(C);D===void 0?wr.added(C)||(d=f.merge(d,(E={},E[I]="Can't find field '".concat(C.name.value,"' on ").concat(K(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),E))):ae(D)?D=m(t.executeSubSelectedArray({field:C,array:D,enclosingRef:a,context:o}),I):C.selectionSet?D!=null&&(D=m(t.executeSelectionSet({selectionSet:C.selectionSet,objectOrReference:D,enclosingRef:K(D)?D:a,context:o}),I)):o.canonizeResults&&(D=t.canon.pass(D)),D!==void 0&&p.push((A={},A[I]=D,A))}else{var R=vr(C,o.lookupFragment);if(!R&&C.kind===Ee.FRAGMENT_SPREAD)throw __DEV__?new M("No fragment named ".concat(C.name.value)):new M(5);R&&c.fragmentMatches(R,l)&&R.selectionSet.selections.forEach(g.add,g)}});var b=Vn(p),_={result:b,missing:d},v=o.canonizeResults?this.canon.admit(_):Gn(_);return v.result&&this.knownResults.set(v.result,n),v},r.prototype.execSubSelectedArrayImpl=function(e){var t=this,n=e.field,i=e.array,a=e.enclosingRef,o=e.context,s,c=new Ge;function u(l,p){var d;return l.missing&&(s=c.merge(s,(d={},d[p]=l.missing,d))),l.result}return n.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(l,p){return l===null?null:ae(l)?u(t.executeSubSelectedArray({field:n,array:l,enclosingRef:a,context:o}),p):n.selectionSet?u(t.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:l,enclosingRef:K(l)?l:a,context:o}),p):(__DEV__&&Ed(o.store,n,l),l)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:s}},r}();function _d(r){try{JSON.stringify(r,function(e,t){if(typeof t=="string")throw t;return t})}catch(e){return e}}function Ed(r,e,t){if(!e.selectionSet){var n=new Set([t]);n.forEach(function(i){J(i)&&(__DEV__?T(!K(i),"Missing selection set for object of type ".concat(sl(r,i)," returned for query field ").concat(e.name.value)):T(!K(i),6),Object.values(i).forEach(n.add,n))})}}var ln=new sn,hl=new WeakMap;function ei(r){var e=hl.get(r);return e||hl.set(r,e={vars:new Set,dep:ra()}),e}function Cs(r){ei(r).vars.forEach(function(e){return e.forgetCache(r)})}function ml(r){ei(r).vars.forEach(function(e){return e.attachCache(r)})}function ua(r){var e=new Set,t=new Set,n=function(a){if(arguments.length>0){if(r!==a){r=a,e.forEach(function(c){ei(c).dep.dirty(n),xd(c)});var o=Array.from(t);t.clear(),o.forEach(function(c){return c(r)})}}else{var s=ln.getValue();s&&(i(s),ei(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),ei(a).vars.add(n),n};return n.forgetCache=function(a){return e.delete(a)},n}function xd(r){r.broadcastWatches&&r.broadcastWatches()}var gl=Object.create(null);function Ss(r){var e=JSON.stringify(r);return gl[e]||(gl[e]=Object.create(null))}function ws(r){var e=Ss(r);return e.keyFieldsFn||(e.keyFieldsFn=function(t,n){var i=function(o,s){return n.readField(s,o)},a=n.keyObject=Es(r,function(o){var s=pn(n.storeObject,o,i);return s===void 0&&t!==n.storeObject&&Ce.call(t,o[0])&&(s=pn(t,o,vl)),__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 _s(r){var e=Ss(r);return e.keyArgsFn||(e.keyArgsFn=function(t,n){var i=n.field,a=n.variables,o=n.fieldName,s=Es(r,function(u){var l=u[0],p=l.charAt(0);if(p==="@"){if(i&&Oe(i.directives)){var d=l.slice(1),f=i.directives.find(function(_){return _.name.value===d}),m=f&&Dt(f,a);return m&&pn(m,u.slice(1))}return}if(p==="$"){var g=l.slice(1);if(a&&Ce.call(a,g)){var b=u.slice(0);return b[0]=g,pn(a,b)}return}if(t)return pn(t,u)}),c=JSON.stringify(s);return(t||c!=="{}")&&(o+=":"+c),o})}function Es(r,e){var t=new Ge;return yl(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 yl(r){var e=Ss(r);if(!e.paths){var t=e.paths=[],n=[];r.forEach(function(i,a){ae(i)?(yl(i).forEach(function(o){return t.push(n.concat(o))}),n.length=0):(n.push(i),ae(r[a+1])||(t.push(n.slice(0)),n.length=0))})}return e.paths}function vl(r,e){return r[e]}function pn(r,e,t){return t=t||vl,bl(e.reduce(function n(i,a){return ae(i)?i.map(function(o){return n(o,a)}):i&&t(i,a)},r))}function bl(r){return J(r)?ae(r)?r.map(bl):Es(Object.keys(r).sort(),function(e){return pn(r,e)}):r}Un.setStringify(Ze);function xs(r){return r.args!==void 0?r.args:r.field?Dt(r.field,r.variables):null}var Od=function(){},Cl=function(r,e){return e.fieldName},Sl=function(r,e,t){var n=t.mergeObjects;return n(r,e)},wl=function(r,e){return e},El=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=h({dataIdFromObject:ia},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=h(h({},t),{typename:a,storeObject:o,readField:t&&t.readField||function(){var d=la(arguments,o);return i.readField(d,{store:i.cache.data,variables:d.variables})}}),c,u=a&&this.getTypePolicy(a),l=u&&u.keyFn||this.config.dataIdFromObject;l;){var p=l(e,s);if(ae(p))l=ws(p);else{c=p;break}}return c=c?String(c):void 0,s.keyObject?[c,s.keyObject]:[c]},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,c=St(i,["queryType","mutationType","subscriptionType"]);a&&t.setRootTypename("Query",n),o&&t.setRootTypename("Mutation",n),s&&t.setRootTypename("Subscription",n),Ce.call(t.toBeAdded,n)?t.toBeAdded[n].push(c):t.toBeAdded[n]=[c]})},r.prototype.updateTypePolicy=function(e,t){var n=this,i=this.getTypePolicy(e),a=t.keyFields,o=t.fields;function s(c,u){c.merge=typeof u=="function"?u:u===!0?Sl:u===!1?wl:c.merge}s(i,t.merge),i.keyFn=a===!1?Od:ae(a)?ws(a):typeof a=="function"?a:i.keyFn,o&&Object.keys(o).forEach(function(c){var u=n.getFieldPolicy(e,c,!0),l=o[c];if(typeof l=="function")u.read=l;else{var p=l.keyArgs,d=l.read,f=l.merge;u.keyFn=p===!1?Cl:ae(p)?_s(p):typeof p=="function"?p:u.keyFn,typeof d=="function"&&(u.read=d),s(u,f)}u.read&&u.merge&&(u.keyFn=u.keyFn||Cl)})},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(hs);(!a||a[0]!==i)&&t.fuzzySubtypes.set(i,new RegExp(i))})})},r.prototype.getTypePolicy=function(e){var t=this;if(!Ce.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),c=s.fields,u=St(s,["fields"]);Object.assign(n,u),Object.assign(n.fields,c)})}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),c=[s],u=function(m){var g=a.getSupertypeSet(m,!1);g&&g.size&&c.indexOf(g)<0&&c.push(g)},l=!!(n&&this.fuzzySubtypes.size),p=!1,d=0;d<c.length;++d){var f=c[d];if(f.has(o))return s.has(o)||(p&&__DEV__&&T.warn("Inferring subtype ".concat(t," of supertype ").concat(o)),s.add(o)),!0;f.forEach(u),l&&d===c.length-1&&na(e.selectionSet,n,i)&&(l=!1,p=!0,this.fuzzySubtypes.forEach(function(m,g){var b=t.match(m);b&&b[0]===t&&u(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},c=xs(e);o;){var u=o(c,s);if(ae(u))o=_s(u);else{a=u||n;break}}return a===void 0&&(a=e.field?Lo(e.field,e.variables):Un(n,xs(e))),a===!1?n:n===dt(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=dt(o),c=t.store.getFieldValue(n,o),u=this.getFieldPolicy(e.typename,s,!1),l=u&&u.read;if(l){var p=_l(this,n,e,t,t.store.getStorage(K(n)?n.__ref:n,o));return ln.withValue(this.cache,l,[c,p])}return c}}},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,c=n.merge;return c===Sl?xl(i.store)(e,t):c===wl?t:(i.overwrite&&(e=void 0),c(e,t,_l(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:i.variables},i,a||Object.create(null))))},r}();function _l(r,e,t,n,i){var a=r.getStoreFieldName(t),o=dt(a),s=t.variables||n.variables,c=n.store,u=c.toReference,l=c.canRead;return{args:xs(t),field:t.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:K,toReference:u,storage:i,cache:r.cache,canRead:l,readField:function(){return r.readField(la(arguments,e,s),n)},mergeObjects:xl(n.store)}}function la(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=h({},n),Ce.call(o,"from")||(o.from=e)),__DEV__&&o.from===void 0&&__DEV__&&T.warn("Undefined 'from' passed to readField with arguments ".concat(vu(Array.from(r)))),o.variables===void 0&&(o.variables=t),o}function xl(r){return function(t,n){if(ae(t)||ae(n))throw __DEV__?new M("Cannot automatically merge arrays"):new M(4);if(J(t)&&J(n)){var i=r.getFieldValue(t,"__typename"),a=r.getFieldValue(n,"__typename"),o=i&&a&&i!==a;if(o)return n;if(K(t)&&Jt(n))return r.merge(t.__ref,n),t;if(Jt(t)&&K(n))return r.merge(t,n.__ref),n;if(Jt(t)&&Jt(n))return h(h({},t),n)}return n}}function Os(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:h(h({},r),{clientOnly:e,deferred:t})),i}var Al=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,c=t.overwrite,u=_t(i),l=cl();s=h(h({},Sr(u)),s);var p=h(h({store:e,written:Object.create(null),merge:function(f,m){return l.merge(f,m)},variables:s,varString:Ze(s)},oa(i,this.fragments)),{overwrite:!!c,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),d=this.processSelectionSet({result:a||Object.create(null),dataId:o,selectionSet:u.selectionSet,mergeTree:{map:new Map},context:p});if(!K(d))throw __DEV__?new M("Could not identify object ".concat(JSON.stringify(a))):new M(7);return p.incomingById.forEach(function(f,m){var g=f.storeObject,b=f.mergeTree,_=f.fieldNodeSet,v=wt(m);if(b&&b.map.size){var C=n.applyMerges(b,v,g,p);if(K(C))return;g=C}if(__DEV__&&!p.overwrite){var E=Object.create(null);_.forEach(function(I){I.selectionSet&&(E[I.name.value]=!0)});var A=function(I){return E[dt(I)]===!0},D=function(I){var R=b&&b.map.get(I);return Boolean(R&&R.info&&R.info.merge)};Object.keys(g).forEach(function(I){A(I)&&!D(I)&&Td(v,g,I,p.store)})}e.merge(m,g)}),e.retain(d.__ref),d},r.prototype.processSelectionSet=function(e){var t=this,n=e.dataId,i=e.result,a=e.selectionSet,o=e.context,s=e.mergeTree,c=this.cache.policies,u=Object.create(null),l=n&&c.rootTypenamesById[n]||qn(i,a,o.fragmentMap)||n&&o.store.get(n,"__typename");typeof l=="string"&&(u.__typename=l);var p=function(){var C=la(arguments,u,o.variables);if(K(C.from)){var E=o.incomingById.get(C.from.__ref);if(E){var A=c.readField(h(h({},C),{from:E.storeObject}),o);if(A!==void 0)return A}}return c.readField(C,o)},d=new Set;this.flattenFields(a,i,o,l).forEach(function(C,E){var A,D=at(E),I=i[D];if(d.add(E),I!==void 0){var R=c.getStoreFieldName({typename:l,fieldName:E.name.value,field:E,variables:C.variables}),ie=Ol(s,R),te=t.processFieldValue(I,E,E.selectionSet?Os(C,!1,!1):C,ie),vt=void 0;E.selectionSet&&(K(te)||Jt(te))&&(vt=p("__typename",te));var It=c.getMergeFunction(l,E.name.value,vt);It?ie.info={field:E,typename:l,merge:It}:Tl(s,R),u=C.merge(u,(A={},A[R]=te,A))}else __DEV__&&!C.clientOnly&&!C.deferred&&!wr.added(E)&&!c.getReadFunction(l,E.name.value)&&__DEV__&&T.error("Missing field '".concat(at(E),"' while writing result ").concat(JSON.stringify(i,null,2)).substring(0,1e3))});try{var f=c.identify(i,{typename:l,selectionSet:a,fragmentMap:o.fragmentMap,storeObject:u,readField:p}),m=f[0],g=f[1];n=n||m,g&&(u=o.merge(u,g))}catch(C){if(!n)throw C}if(typeof n=="string"){var b=wt(n),_=o.written[n]||(o.written[n]=[]);if(_.indexOf(a)>=0||(_.push(a),this.reader&&this.reader.isFresh(i,b,a,o)))return b;var v=o.incomingById.get(n);return v?(v.storeObject=o.merge(v.storeObject,u),v.mergeTree=Ts(v.mergeTree,s),d.forEach(function(C){return v.fieldNodeSet.add(C)})):o.incomingById.set(n,{storeObject:u,mergeTree:pa(s)?void 0:s,fieldNodeSet:d}),b}return u},r.prototype.processFieldValue=function(e,t,n,i){var a=this;return!t.selectionSet||e===null?__DEV__?Gi(e):e:ae(e)?e.map(function(o,s){var c=a.processFieldValue(o,t,n,Ol(i,s));return Tl(i,s),c}):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:i})},r.prototype.flattenFields=function(e,t,n,i){i===void 0&&(i=qn(t,e,n.fragmentMap));var a=new Map,o=this.cache.policies,s=new Et(!1);return function c(u,l){var p=s.lookup(u,l.clientOnly,l.deferred);p.visited||(p.visited=!0,u.selections.forEach(function(d){if(!!kt(d,n.variables)){var f=l.clientOnly,m=l.deferred;if(!(f&&m)&&Oe(d.directives)&&d.directives.forEach(function(_){var v=_.name.value;if(v==="client"&&(f=!0),v==="defer"){var C=Dt(_,n.variables);(!C||C.if!==!1)&&(m=!0)}}),Xe(d)){var g=a.get(d);g&&(f=f&&g.clientOnly,m=m&&g.deferred),a.set(d,Os(n,f,m))}else{var b=vr(d,n.lookupFragment);if(!b&&d.kind===Ee.FRAGMENT_SPREAD)throw __DEV__?new M("No fragment named ".concat(d.name.value)):new M(8);b&&o.fragmentMatches(b,i,t,n.variables)&&c(b.selectionSet,Os(n,f,m))}}}))}(e,n),a},r.prototype.applyMerges=function(e,t,n,i,a){var o,s=this;if(e.map.size&&!K(n)){var c=!ae(n)&&(K(t)||Jt(t))?t:void 0,u=n;c&&!a&&(a=[K(c)?c.__ref:c]);var l,p=function(d,f){return ae(d)?typeof f=="number"?d[f]:void 0:i.store.getFieldValue(d,String(f))};e.map.forEach(function(d,f){var m=p(c,f),g=p(u,f);if(g!==void 0){a&&a.push(f);var b=s.applyMerges(d,m,g,i,a);b!==g&&(l=l||new Map,l.set(f,b)),a&&T(a.pop()===f)}}),l&&(n=ae(u)?u.slice(0):h({},u),l.forEach(function(d,f){n[f]=d}))}return e.info?this.cache.policies.runMergeFunction(t,n,e.info,i,a&&(o=i.store).getStorage.apply(o,a)):n},r}();var kl=[];function Ol(r,e){var t=r.map;return t.has(e)||t.set(e,kl.pop()||{map:new Map}),t.get(e)}function Ts(r,e){if(r===e||!e||pa(e))return r;if(!r||pa(r))return e;var t=r.info&&e.info?h(h({},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,c){a.map.set(c,Ts(s,e.map.get(c))),o.delete(c)}),o.forEach(function(s){a.map.set(s,Ts(e.map.get(s),r.map.get(s)))})}return a}function pa(r){return!r||!(r.info||r.map.size)}function Tl(r,e){var t=r.map,n=t.get(e);n&&pa(n)&&(kl.push(n),t.delete(e))}var Il=new Set;function Td(r,e,t,n){var i=function(p){var d=n.getFieldValue(p,t);return typeof d=="object"&&d},a=i(r);if(!!a){var o=i(e);if(!!o&&!K(a)&&!fe(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"),c=dt(t),u="".concat(s,".").concat(c);if(!Il.has(u)){Il.add(u);var l=[];!ae(a)&&!ae(o)&&[a,o].forEach(function(p){var d=n.getFieldValue(p,"__typename");typeof d=="string"&&!l.includes(d)&&l.push(d)}),__DEV__&&T.warn("Cache data may be lost when replacing the ".concat(c," field of a ").concat(s,` object.
|
|
39
39
|
|
|
40
40
|
To address this problem (which is not a bug in Apollo Client), `).concat(l.length?"either ensure all objects of type "+l.join(" and ")+" have an ID or a custom merge function, or ":"","define a custom merge function for the ").concat(u,` 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
|
|
49
|
+
`))}}}}var fa=function(r){be(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=ua,n.txCount=0,n.config=ol(t),n.addTypename=!!n.config.addTypename,n.policies=new El({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 un.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 Al(this,this.storeReader=new dl({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:aa(this.config),canon:t?void 0:i&&i.canon,fragments:a}),a),this.maybeBroadcastWatch=Er(function(o,s){return n.broadcastWatch(o,s)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(o){var s=o.optimistic?n.optimisticData:n.data;if(xr(s)){var c=o.optimistic,u=o.id,l=o.variables;return s.makeCacheKey(o.query,o.callback,Ze({optimistic:c,id:u,variables:l}))}}}),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(h(h({},t),{store:t.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:i})).result||null}catch(a){if(a instanceof Xn)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(Ce.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(h(h({},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||ml(this),this.watches.add(t),t.immediate&&this.maybeBroadcastWatch(t),function(){n.watches.delete(t)&&!n.watches.size&&Cs(n),n.maybeBroadcastWatch.forget(t)}},e.prototype.gc=function(t){Ze.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(K(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(Ce.call(t,"id"))return!1;t=h(h({},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(),Ze.reset(),t&&t.discardWatches?(this.watches.forEach(function(i){return n.maybeBroadcastWatch.forget(i)}),this.watches.clear(),Cs(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,c=t.onWatchUpdated,u,l=function(d){var f=n,m=f.data,g=f.optimisticData;++n.txCount,d&&(n.data=n.optimisticData=d);try{return u=i(n)}finally{--n.txCount,n.data=m,n.optimisticData=g}},p=new Set;return c&&!this.txCount&&this.broadcastWatches(h(h({},t),{onWatchUpdated:function(d){return p.add(d),!1}})),typeof o=="string"?this.optimisticData=this.optimisticData.addLayer(o,l):o===!1?l(this.data):l(),typeof s=="string"&&(this.optimisticData=this.optimisticData.removeLayer(s)),c&&p.size?(this.broadcastWatches(h(h({},t),{onWatchUpdated:function(d,f){var m=c.call(this,d,f);return m!==!1&&p.delete(d),m}})),p.size&&p.forEach(function(d){return n.maybeBroadcastWatch.dirty(d)})):this.broadcastWatches(t),u},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=wr(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||!fe(i.result,a.result))&&t.callback(t.lastDiff=a,i)},e}(ds);function Dl(r){return r.hasOwnProperty("graphQLErrors")}var Id=function(r){var e="";if(Oe(r.graphQLErrors)||Oe(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},Nt=function(r){be(e,r);function e(t){var n=t.graphQLErrors,i=t.clientErrors,a=t.networkError,o=t.errorMessage,s=t.extraInfo,c=r.call(this,o)||this;return c.name="ApolloError",c.graphQLErrors=n||[],c.clientErrors=i||[],c.networkError=a||null,c.message=o||Id(c),c.extraInfo=s,c.__proto__=e.prototype,c}return e}(Error);var
|
|
52
|
-
Did you mean to call refetch(variables) instead of refetch({ variables })?`))}return t&&!fe(this.options.variables,t)&&(i.variables=this.options.variables=h(h({},this.options.variables),t)),this.queryInfo.resetLastWrite(),this.reobserve(i,te.refetch)},e.prototype.fetchMore=function(t){var n=this,i=h(h({},t.query?t:h(h(h(h({},this.options),{query:this.query}),t),{variables:h(h({},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 c=new Set;return this.queryManager.fetchQuery(a,i,te.fetchMore).then(function(u){return n.queryManager.removeQuery(a),o.networkStatus===te.fetchMore&&(o.networkStatus=s),n.queryManager.cache.batch({update:function(l){var p=t.updateQuery;p?l.updateQuery({query:n.query,variables:n.variables,returnPartialData:!0,optimistic:!1},function(d){return p(d,{fetchMoreResult:u.data,variables:i.variables})}):l.writeQuery({query:i.query,variables:i.variables,data:u.data})},onWatchUpdated:function(l){c.add(l.query)}}),u}).finally(function(){c.has(n.query)||Ts(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,c){var u=c.variables;return o(s,{subscriptionData:a,variables:u})})},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 fe(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&&(Xt(t.queryInfo.networkStatus)?c():t.reobserve({fetchPolicy:t.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},te.poll).then(c,c))},c=function(){var u=t.pollingInfo;u&&(clearTimeout(u.timeout),u.timeout=setTimeout(s,u.interval))};c()}}},e.prototype.updateLastResult=function(t,n){return n===void 0&&(n=this.variables),this.last=h(h({},this.last),{result:this.queryManager.assumeImmutableResults?t:Vi(t),variables:n}),Oe(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,c=zt(this.options,t||{}),u=a?c:Ad(this.options,c);a||(this.updatePolling(),t&&t.variables&&!fe(t.variables,o)&&u.fetchPolicy!=="standby"&&u.fetchPolicy===s&&(this.applyNextFetchPolicy("variables-changed",u),n===void 0&&(n=te.setVariables)));var l=u.variables&&h({},u.variables),p=this.fetch(u,n),d={next:function(f){i.reportResult(f,l)},error:function(f){i.reportError(f,l)}};return a||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=p,this.observer=d),p.addObserver(d),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),_r(this.observers,"next",t))},e.prototype.reportError=function(t,n){var i=h(h({},this.getLastResult()),{error:t,errors:t.graphQLErrors,networkStatus:te.error,loading:!1});this.updateLastResult(i,n),_r(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);Gi(pa);function Ts(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 Dd(r){__DEV__&&T.error("Unhandled error",r.message,r.stack)}function Is(r){__DEV__&&r&&__DEV__&&T.debug("Missing cache result fields: ".concat(JSON.stringify(r)),r)}var fa=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=qo(t.resolvers,n)}):this.resolvers=qo(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 ut(this,void 0,void 0,function(){return lt(this,function(c){return t?[2,this.resolveDocument(t,n.data,i,a,this.fragmentMatcher,s).then(function(u){return h(h({},n),{data:u.result})})]:[2,n]})})},r.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},r.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},r.prototype.clientQuery=function(e){return Xr(["client"],e)&&this.resolvers?e:null},r.prototype.serverQuery=function(e){return Uo(e)},r.prototype.prepareContext=function(e){var t=this.cache;return h(h({},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={}),ut(this,void 0,void 0,function(){return lt(this,function(i){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(n),t).then(function(a){return h(h({},t),a.exportedVariables)})]:[2,h({},t)]})})},r.prototype.shouldForceResolvers=function(e){var t=!1;return Fe(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 gr}}}),t},r.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:jo(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),ut(this,void 0,void 0,function(){var s,c,u,l,p,d,f,m,g,b,_;return lt(this,function(v){return s=Cr(e),c=br(e),u=yr(c),l=this.collectSelectionsToResolve(s,u),p=s.operation,d=p?p.charAt(0).toUpperCase()+p.slice(1):"Query",f=this,m=f.cache,g=f.client,b={fragmentMap:u,context:h(h({},n),{cache:m,client:g}),variables:i,fragmentMatcher:a,defaultOperationType:d,exportedVariables:{},selectionsToResolve:l,onlyRunForcedResolvers:o},_=!1,[2,this.resolveSelectionSet(s.selectionSet,_,t,b).then(function(C){return{result:C,exportedVariables:b.exportedVariables}})]})})},r.prototype.resolveSelectionSet=function(e,t,n,i){return ut(this,void 0,void 0,function(){var a,o,s,c,u,l=this;return lt(this,function(p){return a=i.fragmentMap,o=i.context,s=i.variables,c=[n],u=function(d){return ut(l,void 0,void 0,function(){var f,m;return lt(this,function(g){return!t&&!i.selectionsToResolve.has(d)?[2]:kt(d,s)?Xe(d)?[2,this.resolveField(d,t,n,i).then(function(b){var _;typeof b<"u"&&c.push((_={},_[at(d)]=b,_))})]:(Lo(d)?f=d:(f=a[d.name.value],__DEV__?T(f,"No fragment named ".concat(d.name.value)):T(f,11)),f&&f.typeCondition&&(m=f.typeCondition.name.value,i.fragmentMatcher(n,m,o))?[2,this.resolveSelectionSet(f.selectionSet,t,n,i).then(function(b){c.push(b)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(u)).then(function(){return Vn(c)})]})})},r.prototype.resolveField=function(e,t,n,i){return ut(this,void 0,void 0,function(){var a,o,s,c,u,l,p,d,f,m=this;return lt(this,function(g){return n?(a=i.variables,o=e.name.value,s=at(e),c=o!==s,u=n[s]||n[o],l=Promise.resolve(u),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(p=n.__typename||i.defaultOperationType,d=this.resolvers&&this.resolvers[p],d&&(f=d[c?o:s],f&&(l=Promise.resolve(ln.withValue(this.cache,f,[n,Dt(e,a),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,l.then(function(b){var _,v;if(b===void 0&&(b=u),e.directives&&e.directives.forEach(function(E){E.name.value==="export"&&E.arguments&&E.arguments.forEach(function(A){A.name.value==="as"&&A.value.kind==="StringValue"&&(i.exportedVariables[A.value.value]=b)})}),!e.selectionSet||b==null)return b;var C=(v=(_=e.directives)===null||_===void 0?void 0:_.some(function(E){return E.name.value==="client"}))!==null&&v!==void 0?v:!1;if(Array.isArray(b))return m.resolveSubSelectedArray(e,t||C,b,i);if(e.selectionSet)return m.resolveSelectionSet(e.selectionSet,t||C,b,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),Fe(o,{Directive:function(c,u,l,p,d){c.name.value==="client"&&d.forEach(function(f){n(f)&&Mn(f)&&s.add(f)})},FragmentSpread:function(c,u,l,p,d){var f=t[c.name.value];__DEV__?T(f,"No fragment named ".concat(c.name.value)):T(f,12);var m=a(f);m.size>0&&(d.forEach(function(g){n(g)&&Mn(g)&&s.add(g)}),s.add(c),m.forEach(function(g){s.add(g)}))}})}return i.get(o)}return a(e)},r}();var fn=new(ot?WeakMap:Map);function As(r,e){var t=r[e];typeof t=="function"&&(r[e]=function(){return fn.set(r,(fn.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;fn.has(n)||(fn.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&&!fe(this.variables,e.variables)&&(t=te.setVariables),fe(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&&fe(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&&!fe(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():Ts(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(Xt(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=h(h({},this.getDiffOptions(e)),{watcher:this,callback:function(a){return t.setDiff(a)}});(!this.lastWatch||!fe(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===fn.get(this.cache)&&fe(t,n.variables)&&fe(e.data,n.result.data))},r.prototype.markResult=function(e,t,n,i){var a=this,o=new Ge,s=Oe(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Oe(e.incremental)){var c=Wi(this.getDiff().result,e);e.data=c}else if("hasNext"in e&&e.hasNext){var u=this.getDiff();e.data=o.merge(u.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(l){if(a.shouldWrite(e,n.variables))l.writeQuery({query:t,data:e.data,variables:n.variables,overwrite:i===1}),a.lastWrite={result:e,variables:n.variables,dmCount:fn.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){e.data=a.lastDiff.diff.result;return}var p=a.getDiffOptions(n.variables),d=l.diff(p);a.stopped||a.updateWatch(n.variables),a.updateLastDiff(d,p),d.complete&&(e.data=d.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=!an(r);return!n&&t&&r.data&&(n=!0),n}var Nd=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,c=e.ssrMode,u=c===void 0?!1:c,l=e.clientAwareness,p=l===void 0?{}:l,d=e.localState,f=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=d||new fa({cache:t}),this.ssrMode=u,this.assumeImmutableResults=!!f,(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 M("QueryManager stopped while query was in flight"):new M(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,c=e.refetchQueries,u=c===void 0?[]:c,l=e.awaitRefetchQueries,p=l===void 0?!1:l,d=e.update,f=e.onQueryUpdated,m=e.fetchPolicy,g=m===void 0?((t=this.defaultOptions.mutate)===null||t===void 0?void 0:t.fetchPolicy)||"network-only":m,b=e.errorPolicy,_=b===void 0?((n=this.defaultOptions.mutate)===null||n===void 0?void 0:n.errorPolicy)||"none":b,v=e.keepRootFields,C=e.context;return ut(this,void 0,void 0,function(){var E,A,D,I,R,ie;return lt(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),E=this.generateMutationId(),A=this.transform(i),D=A.document,I=A.hasClientExports,i=this.cache.transformForLink(D),a=this.getVariables(i,a),I?[4,this.localState.addExportedVariables(i,a,C)]:[3,2];case 1:a=ee.sent(),ee.label=2;case 2:return R=this.mutationStore&&(this.mutationStore[E]={mutation:i,variables:a,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:E,document:i,variables:a,fetchPolicy:g,errorPolicy:_,context:C,updateQueries:s,update:d,keepRootFields:v}),this.broadcastQueries(),ie=this,[2,new Promise(function(vt,It){return Qi(ie.getObservableFromLink(i,h(h({},C),{optimisticResponse:o}),a,!1),function(ke){if(an(ke)&&_==="none")throw new Nt({graphQLErrors:Ki(ke)});R&&(R.loading=!1,R.error=null);var U=h({},ke);return typeof u=="function"&&(u=u(U)),_==="ignore"&&an(U)&&delete U.errors,ie.markMutationResult({mutationId:E,result:U,document:i,variables:a,fetchPolicy:g,errorPolicy:_,context:C,update:d,updateQueries:s,awaitRefetchQueries:p,refetchQueries:u,removeOptimistic:o?E:void 0,onQueryUpdated:f,keepRootFields:v})}).subscribe({next:function(ke){ie.broadcastQueries(),(!("hasNext"in ke)||ke.hasNext===!1)&&vt(ke)},error:function(ke){R&&(R.loading=!1,R.error=ke),o&&ie.cache.removeOptimistic(E),ie.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(Kt(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),Kt(i)&&Oe(i.incremental)){var s=t.diff({id:"ROOT_MUTATION",query:this.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),c=void 0;s.result&&(c=Wi(s.result,i)),typeof c<"u"&&(i.data=c,a.push({result:c,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var u=e.updateQueries;u&&this.queries.forEach(function(p,d){var f=p.observableQuery,m=f&&f.queryName;if(!(!m||!Nd.call(u,m))){var g=u[m],b=n.queries.get(d),_=b.document,v=b.variables,C=t.diff({query:_,variables:v,returnPartialData:!0,optimistic:!1}),E=C.result,A=C.complete;if(A&&E){var D=g(E,{mutationResult:i,queryName:_&&en(_)||void 0,queryVariables:v});D&&a.push({result:D,dataId:"ROOT_QUERY",query:_,variables:v})}}})}if(a.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(p){o||a.forEach(function(g){return p.write(g)});var d=e.update,f=!hu(i)||Kt(i)&&!i.hasNext;if(d){if(!o){var m=p.diff({id:"ROOT_MUTATION",query:n.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});m.complete&&(i=h(h({},i),{data:m.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}f&&d(p,i,{context:e.context,variables:e.variables})}!o&&!e.keepRootFields&&f&&p.modify({id:"ROOT_MUTATION",fields:function(g,b){var _=b.fieldName,v=b.DELETE;return _==="__typename"?g:v}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(p){return l.push(p)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(l).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(h(h({},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=Mo(n),a=this.localState.clientQuery(n),o=i&&this.localState.serverQuery(i),s={document:n,hasClientExports:Do(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:a,serverQuery:o,defaultVars:Sr(_t(n)),asQuery:h(h({},n),{definitions:n.definitions.map(function(u){return u.kind==="OperationDefinition"&&u.operation!=="query"?h(h({},u),{operation:"query"}):u})})},c=function(u){u&&!t.has(u)&&t.set(u,s)};c(e),c(n),c(a),c(o)}return t.get(e)},r.prototype.getVariables=function(e,t){return h(h({},this.transform(e).defaultVars),t)},r.prototype.watchQuery=function(e){e=h(h({},e),{variables:this.getVariables(e.query,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var t=new da(this),n=new pa({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 M("Store reset while query was in flight (not completed in link chain)"):new M(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):H(o)&&o.query&&a.add(o)}),this.queries.forEach(function(o,s){var c=o.observableQuery,u=o.document;if(c){if(e==="all"){n.set(s,c);return}var l=c.queryName,p=c.options.fetchPolicy;if(p==="standby"||e==="active"&&!c.hasObservers())return;(e==="active"||l&&i.has(l)||u&&i.has(u))&&(n.set(s,c),l&&i.set(l,!0),u&&i.set(u,!0))}}),a.size&&a.forEach(function(o){var s=Wn("legacyOneTimeQuery"),c=t.getQuery(s).init({document:o.query,variables:o.variables}),u=new pa({queryManager:t,queryInfo:c,options:h(h({},o),{fetchPolicy:"network-only"})});T(u.queryId===s),c.setObservableQuery(u),n.set(s,u)}),__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,c=s===void 0?{}:s;n=this.transform(n).document,o=this.getVariables(n,o);var u=function(p){return t.getObservableFromLink(n,c,p).map(function(d){if(i!=="no-cache"&&(ha(d,a)&&t.cache.write({query:n,result:d.data,dataId:"ROOT_SUBSCRIPTION",variables:p}),t.broadcastQueries()),an(d))throw new Nt({graphQLErrors:d.errors});return d})};if(this.transform(n).hasClientExports){var l=this.localState.addExportedVariables(n,o,c).then(u);return new Q(function(p){var d=null;return l.then(function(f){return d=f.subscribe(p)},p.error),function(){return d&&d.unsubscribe()}})}return u(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,c=this.transform(e).serverQuery;if(c){var u=this,l=u.inFlightLinkObservables,p=u.link,d={query:c,variables:n,operationName:en(c)||void 0,context:this.prepareContext(h(h({},t),{forceFetch:!i}))};if(t=d.context,i){var f=l.get(c)||new Map;l.set(c,f);var m=Ze(n);if(s=f.get(m),!s){var g=new nn([on(p,d)]);f.set(m,s=g),g.beforeNext(function(){f.delete(m)&&f.size<1&&l.delete(c)})}}else s=new nn([on(p,d)])}else s=new nn([Q.of({data:{}})]),t=this.prepareContext(t);var b=this.transform(e).clientQuery;return b&&(s=Qi(s,function(_){return a.localState.runResolvers({document:b,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),c=s.length>0;if(i>=e.lastRequestId){if(c&&n.errorPolicy==="none")throw e.markError(new Nt({graphQLErrors:s}));e.markResult(o,a,n,t),e.markReady()}var u={data:o.data,loading:!1,networkStatus:te.ready};return c&&n.errorPolicy!=="ignore"&&(u.errors=s,u.networkStatus=te.error),u},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),c=this.defaultOptions.watchQuery,u=t.fetchPolicy,l=u===void 0?c&&c.fetchPolicy||"cache-first":u,p=t.errorPolicy,d=p===void 0?c&&c.errorPolicy||"none":p,f=t.returnPartialData,m=f===void 0?!1:f,g=t.notifyOnNetworkStatusChange,b=g===void 0?!1:g,_=t.context,v=_===void 0?{}:_,C=Object.assign({},t,{query:a,variables:o,fetchPolicy:l,errorPolicy:d,returnPartialData:m,notifyOnNetworkStatusChange:b,context:v}),E=function(I){C.variables=I;var R=i.fetchQueryByPolicy(s,C,n);return C.fetchPolicy!=="standby"&&R.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",t),R},A=function(){return i.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,function(I){A(),setTimeout(function(){return D.cancel(I)})});var D=new nn(this.transform(C.query).hasClientExports?this.localState.addExportedVariables(C.query,C.variables,C.context).then(E):E(C.variables));return D.promise.then(A,A),D},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,c=s===void 0?o?Wn("refetchQueries"):void 0:s,u=e.onQueryUpdated,l=new Map;i&&this.getObservableQueries(i).forEach(function(d,f){l.set(f,{oq:d,lastDiff:t.getQuery(f).getDiff()})});var p=new Map;return n&&this.cache.batch({update:n,optimistic:o&&c||!1,removeOptimistic:c,onWatchUpdated:function(d,f,m){var g=d.watcher instanceof da&&d.watcher.observableQuery;if(g){if(u){l.delete(g.queryId);var b=u(g,f,m);return b===!0&&(b=g.refetch()),b!==!1&&p.set(g,b),b}u!==null&&l.set(g.queryId,{oq:g,lastDiff:m,diff:f})}}}),l.size&&l.forEach(function(d,f){var m=d.oq,g=d.lastDiff,b=d.diff,_;if(u){if(!b){var v=m.queryInfo;v.reset(),b=v.getDiff()}_=u(m,b,g)}(!u||_===!0)&&(_=m.refetch()),_!==!1&&p.set(m,_),f.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(f)}),c&&this.cache.removeOptimistic(c),p},r.prototype.fetchQueryByPolicy=function(e,t,n){var i=this,a=t.query,o=t.variables,s=t.fetchPolicy,c=t.refetchWritePolicy,u=t.errorPolicy,l=t.returnPartialData,p=t.context,d=t.notifyOnNetworkStatusChange,f=e.networkStatus;e.init({document:this.transform(a).document,variables:o,networkStatus:n});var m=function(){return e.getDiff(o)},g=function(E,A){A===void 0&&(A=e.networkStatus||te.loading);var D=E.result;__DEV__&&!l&&!fe(D,{})&&Is(E.missing);var I=function(R){return Q.of(h({data:R,loading:Xt(A),networkStatus:A},E.complete?null:{partial:!0}))};return D&&i.transform(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:D},context:p,variables:o,onlyRunForcedResolvers:!0}).then(function(R){return I(R.data||void 0)}):u==="none"&&A===te.refetch&&Array.isArray(E.missing)?I(void 0):I(D)},b=s==="no-cache"?0:n===te.refetch&&c!=="merge"?1:2,_=function(){return i.getResultsFromLink(e,b,{variables:o,context:p,fetchPolicy:s,errorPolicy:u})},v=d&&typeof f=="number"&&f!==n&&Xt(n);switch(s){default:case"cache-first":{var C=m();return C.complete?[g(C,e.markReady())]:l||v?[g(C),_()]:[_()]}case"cache-and-network":{var C=m();return C.complete||l||v?[g(C),_()]:[_()]}case"cache-only":return[g(m(),e.markReady())];case"network-only":return v?[g(m()),_()]:[_()];case"no-cache":return v?[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 h(h({},t),{clientAwareness:this.clientAwareness})},r}();var Nl=!1;var ks=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,c=s===void 0?!1:s,u=e.ssrForceFetchDelay,l=u===void 0?0:u,p=e.connectToDevTools,d=p===void 0?typeof window=="object"&&!window.__APOLLO_CLIENT__&&__DEV__:p,f=e.queryDeduplication,m=f===void 0?!0:f,g=e.defaultOptions,b=e.assumeImmutableResults,_=b===void 0?!1:b,v=e.resolvers,C=e.typeDefs,E=e.fragmentMatcher,A=e.name,D=e.version,I=e.link;if(I||(I=n?new is({uri:n,credentials:i,headers:a}):st.empty()),!o)throw __DEV__?new M(`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 M(9);if(this.link=I,this.cache=o,this.disableNetworkFetches=c||l>0,this.queryDeduplication=m,this.defaultOptions=g||Object.create(null),this.typeDefs=C,l&&setTimeout(function(){return t.disableNetworkFetches=!1},l),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),d&&typeof window=="object"&&(window.__APOLLO_CLIENT__=this),!Nl&&d&&__DEV__&&(Nl=!0,typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var R=window.navigator,ie=R&&R.userAgent,ee=void 0;typeof ie=="string"&&(ie.indexOf("Chrome/")>-1?ee="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":ie.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 fa({cache:o,client:this,resolvers:v,fragmentMatcher:E}),this.queryManager=new Dl({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:m,ssrMode:c,clientAwareness:{name:A,version:D},localState:this.localState,assumeImmutableResults:_,onBroadcast:d?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=Kn(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=h(h({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},r.prototype.query=function(e){return this.defaultOptions.query&&(e=Kn(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=h(h({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},r.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Kn(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 on(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(mr?"log":"silent");function Me(r){return r===null?"null":Array.isArray(r)?"array":typeof r}function Pt(r){return Me(r)==="object"}function Pl(r){return Array.isArray(r)&&r.length>0&&r.every(e=>"message"in e)}function Ds(r,e){return r.length<124?r:e}var Rl="graphql-transport-ws";var We;(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"})(We||(We={}));var Se;(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"})(Se||(Se={}));function Ll(r){if(!Pt(r))throw new Error(`Message is expected to be an object, but got ${Me(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 ${Me(r.type)}`);switch(r.type){case Se.ConnectionInit:case Se.ConnectionAck:case Se.Ping:case Se.Pong:{if(r.payload!=null&&!Pt(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 Se.Subscribe:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${Me(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!Pt(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an object, but got ${Me(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 ${Me(r.payload.query)}`);if(r.payload.variables!=null&&!Pt(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 ${Me(r.payload.variables)}`);if(r.payload.operationName!=null&&Me(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 ${Me(r.payload.operationName)}`);if(r.payload.extensions!=null&&!Pt(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 ${Me(r.payload.extensions)}`);break}case Se.Next:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${Me(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!Pt(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an object, but got ${Me(r.payload)}`);break}case Se.Error:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${Me(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 Se.Complete:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${Me(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 dn(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:c=0,retryAttempts:u=5,retryWait:l=async function(ve){let ce=1e3;for(let K=0;K<ve;K++)ce*=2;await new Promise(K=>setTimeout(K,ce+Math.floor(Math.random()*(3e3-300)+300)))},shouldRetry:p=ma,isFatalConnectionProblem:d,on:f,webSocketImpl:m,generateID:g=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,ve=>{let ce=Math.random()*16|0;return(ve=="x"?ce:ce&3|8).toString(16)})},jsonMessageReplacer:b,jsonMessageReviver:_}=r,v;if(m){if(!Rd(m))throw new Error("Invalid WebSocket implementation provided");v=m}else typeof WebSocket<"u"?v=WebSocket:typeof global<"u"?v=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(v=window.WebSocket||window.MozWebSocket);if(!v)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let C=v,E=(()=>{let U=(()=>{let ce={};return{on(K,z){return ce[K]=z,()=>{delete ce[K]}},emit(K){var z;"id"in K&&((z=ce[K.id])===null||z===void 0||z.call(ce,K))}}})(),ve={connecting:f?.connecting?[f.connecting]:[],opened:f?.opened?[f.opened]:[],connected:f?.connected?[f.connected]:[],ping:f?.ping?[f.ping]:[],pong:f?.pong?[f.pong]:[],message:f?.message?[U.emit,f.message]:[U.emit],closed:f?.closed?[f.closed]:[],error:f?.error?[f.error]:[]};return{onMessage:U.on,on(ce,K){let z=ve[ce];return z.push(K),()=>{z.splice(z.indexOf(K),1)}},emit(ce,...K){for(let z of[...ve[ce]])z(...K)}}})();function A(U){let ve=[E.on("error",ce=>{ve.forEach(K=>K()),U(ce)}),E.on("closed",ce=>{ve.forEach(K=>K()),U(ce)})]}let D,I=0,R,ie=!1,ee=0,vt=!1;async function It(){clearTimeout(R);let[U,ve]=await(D??(D=new Promise((z,bt)=>(async()=>{if(ie){if(await l(ee),!I)return D=void 0,bt({code:1e3,reason:"All Subscriptions Gone"});ee++}E.emit("connecting");let V=new C(typeof e=="function"?await e():e,Rl),Ct,jt;function Ti(){isFinite(o)&&o>0&&(clearTimeout(jt),jt=setTimeout(()=>{V.readyState===C.OPEN&&(V.send(dn({type:Se.Ping})),E.emit("ping",!1,void 0))},o))}A(De=>{D=void 0,clearTimeout(Ct),clearTimeout(jt),bt(De),ma(De)&&De.code===4499&&(V.close(4499,"Terminated"),V.onerror=null,V.onclose=null)}),V.onerror=De=>E.emit("error",De),V.onclose=De=>E.emit("closed",De),V.onopen=async()=>{try{E.emit("opened",V);let De=typeof t=="function"?await t():t;if(V.readyState!==C.OPEN)return;V.send(dn(De?{type:Se.ConnectionInit,payload:De}:{type:Se.ConnectionInit},b)),isFinite(c)&&c>0&&(Ct=setTimeout(()=>{V.close(We.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},c)),Ti()}catch(De){E.emit("error",De),V.close(We.InternalClientError,Ds(De instanceof Error?De.message:new Error(De).message,"Internal client error"))}};let Kr=!1;V.onmessage=({data:De})=>{try{let Ne=Fl(De,_);if(E.emit("message",Ne),Ne.type==="ping"||Ne.type==="pong"){E.emit(Ne.type,!0,Ne.payload),Ne.type==="pong"?Ti():s||(V.send(dn(Ne.payload?{type:Se.Pong,payload:Ne.payload}:{type:Se.Pong})),E.emit("pong",!1,Ne.payload));return}if(Kr)return;if(Ne.type!==Se.ConnectionAck)throw new Error(`First message cannot be of type ${Ne.type}`);clearTimeout(Ct),Kr=!0,E.emit("connected",V,Ne.payload),ie=!1,ee=0,z([V,new Promise((X1,Ip)=>A(Ip))])}catch(Ne){V.onmessage=null,E.emit("error",Ne),V.close(We.BadResponse,Ds(Ne instanceof Error?Ne.message:new Error(Ne).message,"Bad response"))}}})())));U.readyState===C.CLOSING&&await ve;let ce=()=>{},K=new Promise(z=>ce=z);return[U,ce,Promise.race([K.then(()=>{if(!I){let z=()=>U.close(1e3,"Normal Closure");isFinite(a)&&a>0?R=setTimeout(()=>{U.readyState===C.OPEN&&z()},a):z()}}),ve])]}function ke(U){if(ma(U)&&(Pd(U.code)||[We.InternalServerError,We.InternalClientError,We.BadRequest,We.BadResponse,We.Unauthorized,We.SubprotocolNotAcceptable,We.SubscriberAlreadyExists,We.TooManyInitialisationRequests].includes(U.code)))throw U;if(vt)return!1;if(ma(U)&&U.code===1e3)return I>0;if(!u||ee>=u||!p(U)||d?.(U))throw U;return ie=!0}return n||(async()=>{for(I++;;)try{let[,,U]=await It();await U}catch(U){try{if(!ke(U))return}catch(ve){return i?.(ve)}}})(),{on:E.on,subscribe(U,ve){let ce=g(U),K=!1,z=!1,bt=()=>{I--,K=!0};return(async()=>{for(I++;;)try{let[V,Ct,jt]=await It();if(K)return Ct();let Ti=E.onMessage(ce,Kr=>{switch(Kr.type){case Se.Next:{ve.next(Kr.payload);return}case Se.Error:{z=!0,K=!0,ve.error(Kr.payload),bt();return}case Se.Complete:{K=!0,bt();return}}});V.send(dn({id:ce,type:Se.Subscribe,payload:U},b)),bt=()=>{!K&&V.readyState===C.OPEN&&V.send(dn({id:ce,type:Se.Complete},b)),I--,K=!0,Ct()},await jt.finally(Ti);return}catch(V){if(!ke(V))return}})().then(()=>{z||ve.complete()}).catch(V=>{ve.error(V)}),()=>{K||bt()}},async dispose(){if(vt=!0,D){let[U]=await D;U.close(1e3,"Normal Closure")}},terminate(){D&&E.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}function ma(r){return Pt(r)&&"code"in r&&"reason"in r}function Pd(r){return[1e3,1001,1006,1005,1012,1013,1013].includes(r)?!1:r>=1e3&&r<=1999}function Rd(r){return typeof r=="function"&&"constructor"in r&&"CLOSED"in r&&"CLOSING"in r&&"CONNECTING"in r&&"OPEN"in r}function Ld(r){return H(r)&&"code"in r&&"reason"in r}var Ml=function(r){be(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(h(h({},t),{query:Yr(t.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(a){return a instanceof Error?i.error(a):Ld(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 La=function(){return La=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},La.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function _a(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_a=function(t){return typeof t}:_a=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_a(r)}function Fd(r){return _a(r)=="object"&&r!==null}var sp=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 $d(r){return cp(r.source,$s(r.source,r.start))}function cp(r,e){var t=r.locationOffset.column-1,n=Ea(t)+r.body,i=e.line-1,a=r.locationOffset.line-1,o=e.line+a,s=e.line===1?t:0,c=e.column+s,u="".concat(r.name,":").concat(o,":").concat(c,`
|
|
54
|
-
`),l=n.split(/\r\n|[\n\r]/g),p=l[i];if(p.length>120){for(var d=Math.floor(c/80),f=c%80,m=[],g=0;g<p.length;g+=80)m.push(p.slice(g,g+80));return u+
|
|
55
|
-
`)}function
|
|
51
|
+
`)),e=e.replace(/\n$/,""),e},Nt=function(r){be(e,r);function e(t){var n=t.graphQLErrors,i=t.clientErrors,a=t.networkError,o=t.errorMessage,s=t.extraInfo,c=r.call(this,o)||this;return c.name="ApolloError",c.graphQLErrors=n||[],c.clientErrors=i||[],c.networkError=a||null,c.message=o||Id(c),c.extraInfo=s,c.__proto__=e.prototype,c}return e}(Error);var re;(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"})(re||(re={}));function Xt(r){return r?r<7:!1}var Ad=Object.assign,kd=Object.hasOwnProperty,da=function(r){be(e,r);function e(t){var n=t.queryManager,i=t.queryInfo,a=t.options,o=r.call(this,function(b){try{var _=b._subscription._observer;_&&!_.error&&(_.error=Dd)}catch{}var v=!o.observers.size;o.observers.add(b);var C=o.last;return C&&C.error?b.error&&b.error(C.error):C&&C.result&&b.next&&b.next(C.result),v&&o.reobserve().catch(function(){}),function(){o.observers.delete(b)&&!o.observers.size&&o.tearDownQuery()}})||this;o.observers=new Set,o.subscriptions=new Set,o.queryInfo=i,o.queryManager=n,o.isTornDown=!1;var s=n.defaultOptions.watchQuery,c=s===void 0?{}:s,u=c.fetchPolicy,l=u===void 0?"cache-first":u,p=a.fetchPolicy,d=p===void 0?l:p,f=a.initialFetchPolicy,m=f===void 0?d==="standby"?l:d:f;o.options=h(h({},a),{initialFetchPolicy:m,fetchPolicy:d}),o.queryId=i.queryId||n.generateQueryId();var g=_t(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||re.ready,a=h(h({},n),{loading:Xt(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 c=this.queryInfo.getDiff();(c.complete||this.options.returnPartialData)&&(a.data=c.result),fe(a.data,{})&&(a.data=void 0),c.complete?(delete a.partial,c.complete&&a.networkStatus===re.loading&&(s==="cache-first"||s==="cache-only")&&(a.networkStatus=re.ready,a.loading=!1)):a.partial=!0,__DEV__&&!c.complete&&!this.options.partialRefetch&&!a.loading&&!a.data&&!a.error&&As(c.missing)}return t&&this.updateLastResult(a),a},e.prototype.isDifferentFromLastResult=function(t,n){return!this.last||!fe(this.last.result,t)||n&&!fe(this.last.variables,n)},e.prototype.getLast=function(t,n){var i=this.last;if(i&&i[t]&&(!n||fe(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&&kd.call(t,"variables")){var o=Bn(this.query),s=o.variableDefinitions;(!s||!s.some(function(c){return c.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&&!fe(this.options.variables,t)&&(i.variables=this.options.variables=h(h({},this.options.variables),t)),this.queryInfo.resetLastWrite(),this.reobserve(i,re.refetch)},e.prototype.fetchMore=function(t){var n=this,i=h(h({},t.query?t:h(h(h(h({},this.options),{query:this.query}),t),{variables:h(h({},this.options.variables),t.variables)})),{fetchPolicy:"no-cache"}),a=this.queryManager.generateQueryId(),o=this.queryInfo,s=o.networkStatus;o.networkStatus=re.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var c=new Set;return this.queryManager.fetchQuery(a,i,re.fetchMore).then(function(u){return n.queryManager.removeQuery(a),o.networkStatus===re.fetchMore&&(o.networkStatus=s),n.queryManager.cache.batch({update:function(l){var p=t.updateQuery;p?l.updateQuery({query:n.query,variables:n.variables,returnPartialData:!0,optimistic:!1},function(d){return p(d,{fetchMoreResult:u.data,variables:i.variables})}):l.writeQuery({query:i.query,variables:i.variables,data:u.data})},onWatchUpdated:function(l){c.add(l.query)}}),u}).finally(function(){c.has(n.query)||Is(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,c){var u=c.variables;return o(s,{subscriptionData:a,variables:u})})},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 fe(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},re.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&&(Xt(t.queryInfo.networkStatus)?c():t.reobserve({fetchPolicy:t.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},re.poll).then(c,c))},c=function(){var u=t.pollingInfo;u&&(clearTimeout(u.timeout),u.timeout=setTimeout(s,u.interval))};c()}}},e.prototype.updateLastResult=function(t,n){return n===void 0&&(n=this.variables),this.last=h(h({},this.last),{result:this.queryManager.assumeImmutableResults?t:Gi(t),variables:n}),Oe(t.errors)||delete this.last.error,this.last},e.prototype.reobserve=function(t,n){var i=this;this.isTornDown=!1;var a=n===re.refetch||n===re.fetchMore||n===re.poll,o=this.options.variables,s=this.options.fetchPolicy,c=zt(this.options,t||{}),u=a?c:Ad(this.options,c);a||(this.updatePolling(),t&&t.variables&&!fe(t.variables,o)&&u.fetchPolicy!=="standby"&&u.fetchPolicy===s&&(this.applyNextFetchPolicy("variables-changed",u),n===void 0&&(n=re.setVariables)));var l=u.variables&&h({},u.variables),p=this.fetch(u,n),d={next:function(f){i.reportResult(f,l)},error:function(f){i.reportError(f,l)}};return a||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=p,this.observer=d),p.addObserver(d),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),_r(this.observers,"next",t))},e.prototype.reportError=function(t,n){var i=h(h({},this.getLastResult()),{error:t,errors:t.graphQLErrors,networkStatus:re.error,loading:!1});this.updateLastResult(i,n),_r(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);Ki(da);function Is(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 Dd(r){__DEV__&&T.error("Unhandled error",r.message,r.stack)}function As(r){__DEV__&&r&&__DEV__&&T.debug("Missing cache result fields: ".concat(JSON.stringify(r)),r)}var ha=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=Bo(t.resolvers,n)}):this.resolvers=Bo(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 ut(this,void 0,void 0,function(){return lt(this,function(c){return t?[2,this.resolveDocument(t,n.data,i,a,this.fragmentMatcher,s).then(function(u){return h(h({},n),{data:u.result})})]:[2,n]})})},r.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},r.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},r.prototype.clientQuery=function(e){return Xr(["client"],e)&&this.resolvers?e:null},r.prototype.serverQuery=function(e){return qo(e)},r.prototype.prepareContext=function(e){var t=this.cache;return h(h({},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={}),ut(this,void 0,void 0,function(){return lt(this,function(i){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(n),t).then(function(a){return h(h({},t),a.exportedVariables)})]:[2,h({},t)]})})},r.prototype.shouldForceResolvers=function(e){var t=!1;return Fe(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 gr}}}),t},r.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:Uo(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),ut(this,void 0,void 0,function(){var s,c,u,l,p,d,f,m,g,b,_;return lt(this,function(v){return s=Cr(e),c=br(e),u=yr(c),l=this.collectSelectionsToResolve(s,u),p=s.operation,d=p?p.charAt(0).toUpperCase()+p.slice(1):"Query",f=this,m=f.cache,g=f.client,b={fragmentMap:u,context:h(h({},n),{cache:m,client:g}),variables:i,fragmentMatcher:a,defaultOperationType:d,exportedVariables:{},selectionsToResolve:l,onlyRunForcedResolvers:o},_=!1,[2,this.resolveSelectionSet(s.selectionSet,_,t,b).then(function(C){return{result:C,exportedVariables:b.exportedVariables}})]})})},r.prototype.resolveSelectionSet=function(e,t,n,i){return ut(this,void 0,void 0,function(){var a,o,s,c,u,l=this;return lt(this,function(p){return a=i.fragmentMap,o=i.context,s=i.variables,c=[n],u=function(d){return ut(l,void 0,void 0,function(){var f,m;return lt(this,function(g){return!t&&!i.selectionsToResolve.has(d)?[2]:kt(d,s)?Xe(d)?[2,this.resolveField(d,t,n,i).then(function(b){var _;typeof b<"u"&&c.push((_={},_[at(d)]=b,_))})]:(Fo(d)?f=d:(f=a[d.name.value],__DEV__?T(f,"No fragment named ".concat(d.name.value)):T(f,11)),f&&f.typeCondition&&(m=f.typeCondition.name.value,i.fragmentMatcher(n,m,o))?[2,this.resolveSelectionSet(f.selectionSet,t,n,i).then(function(b){c.push(b)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(u)).then(function(){return Vn(c)})]})})},r.prototype.resolveField=function(e,t,n,i){return ut(this,void 0,void 0,function(){var a,o,s,c,u,l,p,d,f,m=this;return lt(this,function(g){return n?(a=i.variables,o=e.name.value,s=at(e),c=o!==s,u=n[s]||n[o],l=Promise.resolve(u),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(p=n.__typename||i.defaultOperationType,d=this.resolvers&&this.resolvers[p],d&&(f=d[c?o:s],f&&(l=Promise.resolve(ln.withValue(this.cache,f,[n,Dt(e,a),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,l.then(function(b){var _,v;if(b===void 0&&(b=u),e.directives&&e.directives.forEach(function(E){E.name.value==="export"&&E.arguments&&E.arguments.forEach(function(A){A.name.value==="as"&&A.value.kind==="StringValue"&&(i.exportedVariables[A.value.value]=b)})}),!e.selectionSet||b==null)return b;var C=(v=(_=e.directives)===null||_===void 0?void 0:_.some(function(E){return E.name.value==="client"}))!==null&&v!==void 0?v:!1;if(Array.isArray(b))return m.resolveSubSelectedArray(e,t||C,b,i);if(e.selectionSet)return m.resolveSelectionSet(e.selectionSet,t||C,b,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),Fe(o,{Directive:function(c,u,l,p,d){c.name.value==="client"&&d.forEach(function(f){n(f)&&Mn(f)&&s.add(f)})},FragmentSpread:function(c,u,l,p,d){var f=t[c.name.value];__DEV__?T(f,"No fragment named ".concat(c.name.value)):T(f,12);var m=a(f);m.size>0&&(d.forEach(function(g){n(g)&&Mn(g)&&s.add(g)}),s.add(c),m.forEach(function(g){s.add(g)}))}})}return i.get(o)}return a(e)},r}();var fn=new(ot?WeakMap:Map);function ks(r,e){var t=r[e];typeof t=="function"&&(r[e]=function(){return fn.set(r,(fn.get(r)+1)%1e15),t.apply(this,arguments)})}function Nl(r){r.notifyTimeout&&(clearTimeout(r.notifyTimeout),r.notifyTimeout=void 0)}var ma=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;fn.has(n)||(fn.set(n,0),ks(n,"evict"),ks(n,"modify"),ks(n,"reset"))}return r.prototype.init=function(e){var t=e.networkStatus||re.loading;return this.variables&&this.networkStatus!==re.loading&&!fe(this.variables,e.variables)&&(t=re.setVariables),fe(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(){Nl(this),this.dirty=!1},r.prototype.getDiff=function(e){e===void 0&&(e=this.variables);var t=this.getDiffOptions(e);if(this.lastDiff&&fe(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&&!fe(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():Is(e)})):delete this.oqListener)},r.prototype.notify=function(){var e=this;Nl(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(Xt(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=h(h({},this.getDiffOptions(e)),{watcher:this,callback:function(a){return t.setDiff(a)}});(!this.lastWatch||!fe(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===fn.get(this.cache)&&fe(t,n.variables)&&fe(e.data,n.result.data))},r.prototype.markResult=function(e,t,n,i){var a=this,o=new Ge,s=Oe(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Oe(e.incremental)){var c=zi(this.getDiff().result,e);e.data=c}else if("hasNext"in e&&e.hasNext){var u=this.getDiff();e.data=o.merge(u.result,e.data)}this.graphQLErrors=s,n.fetchPolicy==="no-cache"?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):i!==0&&(ga(e,n.errorPolicy)?this.cache.performTransaction(function(l){if(a.shouldWrite(e,n.variables))l.writeQuery({query:t,data:e.data,variables:n.variables,overwrite:i===1}),a.lastWrite={result:e,variables:n.variables,dmCount:fn.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){e.data=a.lastDiff.diff.result;return}var p=a.getDiffOptions(n.variables),d=l.diff(p);a.stopped||a.updateWatch(n.variables),a.updateLastDiff(d,p),d.complete&&(e.data=d.result)}):this.lastWrite=void 0)},r.prototype.markReady=function(){return this.networkError=null,this.networkStatus=re.ready},r.prototype.markError=function(e){return this.networkStatus=re.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},r}();function ga(r,e){e===void 0&&(e="none");var t=e==="ignore"||e==="all",n=!an(r);return!n&&t&&r.data&&(n=!0),n}var Nd=Object.prototype.hasOwnProperty,Pl=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,c=e.ssrMode,u=c===void 0?!1:c,l=e.clientAwareness,p=l===void 0?{}:l,d=e.localState,f=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=d||new ha({cache:t}),this.ssrMode=u,this.assumeImmutableResults=!!f,(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 M("QueryManager stopped while query was in flight"):new M(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,c=e.refetchQueries,u=c===void 0?[]:c,l=e.awaitRefetchQueries,p=l===void 0?!1:l,d=e.update,f=e.onQueryUpdated,m=e.fetchPolicy,g=m===void 0?((t=this.defaultOptions.mutate)===null||t===void 0?void 0:t.fetchPolicy)||"network-only":m,b=e.errorPolicy,_=b===void 0?((n=this.defaultOptions.mutate)===null||n===void 0?void 0:n.errorPolicy)||"none":b,v=e.keepRootFields,C=e.context;return ut(this,void 0,void 0,function(){var E,A,D,I,R,ie;return lt(this,function(te){switch(te.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),E=this.generateMutationId(),A=this.transform(i),D=A.document,I=A.hasClientExports,i=this.cache.transformForLink(D),a=this.getVariables(i,a),I?[4,this.localState.addExportedVariables(i,a,C)]:[3,2];case 1:a=te.sent(),te.label=2;case 2:return R=this.mutationStore&&(this.mutationStore[E]={mutation:i,variables:a,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:E,document:i,variables:a,fetchPolicy:g,errorPolicy:_,context:C,updateQueries:s,update:d,keepRootFields:v}),this.broadcastQueries(),ie=this,[2,new Promise(function(vt,It){return Wi(ie.getObservableFromLink(i,h(h({},C),{optimisticResponse:o}),a,!1),function(ke){if(an(ke)&&_==="none")throw new Nt({graphQLErrors:Hi(ke)});R&&(R.loading=!1,R.error=null);var U=h({},ke);return typeof u=="function"&&(u=u(U)),_==="ignore"&&an(U)&&delete U.errors,ie.markMutationResult({mutationId:E,result:U,document:i,variables:a,fetchPolicy:g,errorPolicy:_,context:C,update:d,updateQueries:s,awaitRefetchQueries:p,refetchQueries:u,removeOptimistic:o?E:void 0,onQueryUpdated:f,keepRootFields:v})}).subscribe({next:function(ke){ie.broadcastQueries(),(!("hasNext"in ke)||ke.hasNext===!1)&&vt(ke)},error:function(ke){R&&(R.loading=!1,R.error=ke),o&&ie.cache.removeOptimistic(E),ie.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&&ga(i,e.errorPolicy)){if(Kt(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),Kt(i)&&Oe(i.incremental)){var s=t.diff({id:"ROOT_MUTATION",query:this.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),c=void 0;s.result&&(c=zi(s.result,i)),typeof c<"u"&&(i.data=c,a.push({result:c,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var u=e.updateQueries;u&&this.queries.forEach(function(p,d){var f=p.observableQuery,m=f&&f.queryName;if(!(!m||!Nd.call(u,m))){var g=u[m],b=n.queries.get(d),_=b.document,v=b.variables,C=t.diff({query:_,variables:v,returnPartialData:!0,optimistic:!1}),E=C.result,A=C.complete;if(A&&E){var D=g(E,{mutationResult:i,queryName:_&&en(_)||void 0,queryVariables:v});D&&a.push({result:D,dataId:"ROOT_QUERY",query:_,variables:v})}}})}if(a.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(p){o||a.forEach(function(g){return p.write(g)});var d=e.update,f=!gu(i)||Kt(i)&&!i.hasNext;if(d){if(!o){var m=p.diff({id:"ROOT_MUTATION",query:n.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});m.complete&&(i=h(h({},i),{data:m.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}f&&d(p,i,{context:e.context,variables:e.variables})}!o&&!e.keepRootFields&&f&&p.modify({id:"ROOT_MUTATION",fields:function(g,b){var _=b.fieldName,v=b.DELETE;return _==="__typename"?g:v}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(p){return l.push(p)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(l).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(h(h({},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=jo(n),a=this.localState.clientQuery(n),o=i&&this.localState.serverQuery(i),s={document:n,hasClientExports:No(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:a,serverQuery:o,defaultVars:Sr(_t(n)),asQuery:h(h({},n),{definitions:n.definitions.map(function(u){return u.kind==="OperationDefinition"&&u.operation!=="query"?h(h({},u),{operation:"query"}):u})})},c=function(u){u&&!t.has(u)&&t.set(u,s)};c(e),c(n),c(a),c(o)}return t.get(e)},r.prototype.getVariables=function(e,t){return h(h({},this.transform(e).defaultVars),t)},r.prototype.watchQuery=function(e){e=h(h({},e),{variables:this.getVariables(e.query,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var t=new ma(this),n=new da({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 M("Store reset while query was in flight (not completed in link chain)"):new M(21)),this.queries.forEach(function(t){t.observableQuery?t.networkStatus=re.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):Ro(o)?i.set(t.transform(o).document,!1):J(o)&&o.query&&a.add(o)}),this.queries.forEach(function(o,s){var c=o.observableQuery,u=o.document;if(c){if(e==="all"){n.set(s,c);return}var l=c.queryName,p=c.options.fetchPolicy;if(p==="standby"||e==="active"&&!c.hasObservers())return;(e==="active"||l&&i.has(l)||u&&i.has(u))&&(n.set(s,c),l&&i.set(l,!0),u&&i.set(u,!0))}}),a.size&&a.forEach(function(o){var s=Wn("legacyOneTimeQuery"),c=t.getQuery(s).init({document:o.query,variables:o.variables}),u=new da({queryManager:t,queryInfo:c,options:h(h({},o),{fetchPolicy:"network-only"})});T(u.queryId===s),c.setObservableQuery(u),n.set(s,u)}),__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,c=s===void 0?{}:s;n=this.transform(n).document,o=this.getVariables(n,o);var u=function(p){return t.getObservableFromLink(n,c,p).map(function(d){if(i!=="no-cache"&&(ga(d,a)&&t.cache.write({query:n,result:d.data,dataId:"ROOT_SUBSCRIPTION",variables:p}),t.broadcastQueries()),an(d))throw new Nt({graphQLErrors:d.errors});return d})};if(this.transform(n).hasClientExports){var l=this.localState.addExportedVariables(n,o,c).then(u);return new Q(function(p){var d=null;return l.then(function(f){return d=f.subscribe(p)},p.error),function(){return d&&d.unsubscribe()}})}return u(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,c=this.transform(e).serverQuery;if(c){var u=this,l=u.inFlightLinkObservables,p=u.link,d={query:c,variables:n,operationName:en(c)||void 0,context:this.prepareContext(h(h({},t),{forceFetch:!i}))};if(t=d.context,i){var f=l.get(c)||new Map;l.set(c,f);var m=Ze(n);if(s=f.get(m),!s){var g=new nn([on(p,d)]);f.set(m,s=g),g.beforeNext(function(){f.delete(m)&&f.size<1&&l.delete(c)})}}else s=new nn([on(p,d)])}else s=new nn([Q.of({data:{}})]),t=this.prepareContext(t);var b=this.transform(e).clientQuery;return b&&(s=Wi(s,function(_){return a.localState.runResolvers({document:b,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 Wi(this.getObservableFromLink(a,n.context,n.variables),function(o){var s=Hi(o),c=s.length>0;if(i>=e.lastRequestId){if(c&&n.errorPolicy==="none")throw e.markError(new Nt({graphQLErrors:s}));e.markResult(o,a,n,t),e.markReady()}var u={data:o.data,loading:!1,networkStatus:re.ready};return c&&n.errorPolicy!=="ignore"&&(u.errors=s,u.networkStatus=re.error),u},function(o){var s=Dl(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=re.loading);var a=this.transform(t.query).document,o=this.getVariables(a,t.variables),s=this.getQuery(e),c=this.defaultOptions.watchQuery,u=t.fetchPolicy,l=u===void 0?c&&c.fetchPolicy||"cache-first":u,p=t.errorPolicy,d=p===void 0?c&&c.errorPolicy||"none":p,f=t.returnPartialData,m=f===void 0?!1:f,g=t.notifyOnNetworkStatusChange,b=g===void 0?!1:g,_=t.context,v=_===void 0?{}:_,C=Object.assign({},t,{query:a,variables:o,fetchPolicy:l,errorPolicy:d,returnPartialData:m,notifyOnNetworkStatusChange:b,context:v}),E=function(I){C.variables=I;var R=i.fetchQueryByPolicy(s,C,n);return C.fetchPolicy!=="standby"&&R.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",t),R},A=function(){return i.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,function(I){A(),setTimeout(function(){return D.cancel(I)})});var D=new nn(this.transform(C.query).hasClientExports?this.localState.addExportedVariables(C.query,C.variables,C.context).then(E):E(C.variables));return D.promise.then(A,A),D},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,c=s===void 0?o?Wn("refetchQueries"):void 0:s,u=e.onQueryUpdated,l=new Map;i&&this.getObservableQueries(i).forEach(function(d,f){l.set(f,{oq:d,lastDiff:t.getQuery(f).getDiff()})});var p=new Map;return n&&this.cache.batch({update:n,optimistic:o&&c||!1,removeOptimistic:c,onWatchUpdated:function(d,f,m){var g=d.watcher instanceof ma&&d.watcher.observableQuery;if(g){if(u){l.delete(g.queryId);var b=u(g,f,m);return b===!0&&(b=g.refetch()),b!==!1&&p.set(g,b),b}u!==null&&l.set(g.queryId,{oq:g,lastDiff:m,diff:f})}}}),l.size&&l.forEach(function(d,f){var m=d.oq,g=d.lastDiff,b=d.diff,_;if(u){if(!b){var v=m.queryInfo;v.reset(),b=v.getDiff()}_=u(m,b,g)}(!u||_===!0)&&(_=m.refetch()),_!==!1&&p.set(m,_),f.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(f)}),c&&this.cache.removeOptimistic(c),p},r.prototype.fetchQueryByPolicy=function(e,t,n){var i=this,a=t.query,o=t.variables,s=t.fetchPolicy,c=t.refetchWritePolicy,u=t.errorPolicy,l=t.returnPartialData,p=t.context,d=t.notifyOnNetworkStatusChange,f=e.networkStatus;e.init({document:this.transform(a).document,variables:o,networkStatus:n});var m=function(){return e.getDiff(o)},g=function(E,A){A===void 0&&(A=e.networkStatus||re.loading);var D=E.result;__DEV__&&!l&&!fe(D,{})&&As(E.missing);var I=function(R){return Q.of(h({data:R,loading:Xt(A),networkStatus:A},E.complete?null:{partial:!0}))};return D&&i.transform(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:D},context:p,variables:o,onlyRunForcedResolvers:!0}).then(function(R){return I(R.data||void 0)}):u==="none"&&A===re.refetch&&Array.isArray(E.missing)?I(void 0):I(D)},b=s==="no-cache"?0:n===re.refetch&&c!=="merge"?1:2,_=function(){return i.getResultsFromLink(e,b,{variables:o,context:p,fetchPolicy:s,errorPolicy:u})},v=d&&typeof f=="number"&&f!==n&&Xt(n);switch(s){default:case"cache-first":{var C=m();return C.complete?[g(C,e.markReady())]:l||v?[g(C),_()]:[_()]}case"cache-and-network":{var C=m();return C.complete||l||v?[g(C),_()]:[_()]}case"cache-only":return[g(m(),e.markReady())];case"network-only":return v?[g(m()),_()]:[_()];case"no-cache":return v?[g(e.getDiff()),_()]:[_()];case"standby":return[]}},r.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new ma(this,e)),this.queries.get(e)},r.prototype.prepareContext=function(e){e===void 0&&(e={});var t=this.localState.prepareContext(e);return h(h({},t),{clientAwareness:this.clientAwareness})},r}();var Rl=!1;var Ds=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,c=s===void 0?!1:s,u=e.ssrForceFetchDelay,l=u===void 0?0:u,p=e.connectToDevTools,d=p===void 0?typeof window=="object"&&!window.__APOLLO_CLIENT__&&__DEV__:p,f=e.queryDeduplication,m=f===void 0?!0:f,g=e.defaultOptions,b=e.assumeImmutableResults,_=b===void 0?!1:b,v=e.resolvers,C=e.typeDefs,E=e.fragmentMatcher,A=e.name,D=e.version,I=e.link;if(I||(I=n?new as({uri:n,credentials:i,headers:a}):st.empty()),!o)throw __DEV__?new M(`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 M(9);if(this.link=I,this.cache=o,this.disableNetworkFetches=c||l>0,this.queryDeduplication=m,this.defaultOptions=g||Object.create(null),this.typeDefs=C,l&&setTimeout(function(){return t.disableNetworkFetches=!1},l),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),d&&typeof window=="object"&&(window.__APOLLO_CLIENT__=this),!Rl&&d&&__DEV__&&(Rl=!0,typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var R=window.navigator,ie=R&&R.userAgent,te=void 0;typeof ie=="string"&&(ie.indexOf("Chrome/")>-1?te="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":ie.indexOf("Firefox/")>-1&&(te="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),te&&__DEV__&&T.log("Download the Apollo DevTools for a better development experience: "+te)}this.version=Cu,this.localState=new ha({cache:o,client:this,resolvers:v,fragmentMatcher:E}),this.queryManager=new Pl({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:m,ssrMode:c,clientAwareness:{name:A,version:D},localState:this.localState,assumeImmutableResults:_,onBroadcast:d?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=Kn(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=h(h({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},r.prototype.query=function(e){return this.defaultOptions.query&&(e=Kn(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=h(h({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},r.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Kn(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 on(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}();Wc(mr?"log":"silent");function Me(r){return r===null?"null":Array.isArray(r)?"array":typeof r}function Pt(r){return Me(r)==="object"}function Ll(r){return Array.isArray(r)&&r.length>0&&r.every(e=>"message"in e)}function Ns(r,e){return r.length<124?r:e}var Fl="graphql-transport-ws";var We;(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"})(We||(We={}));var Se;(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"})(Se||(Se={}));function $l(r){if(!Pt(r))throw new Error(`Message is expected to be an object, but got ${Me(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 ${Me(r.type)}`);switch(r.type){case Se.ConnectionInit:case Se.ConnectionAck:case Se.Ping:case Se.Pong:{if(r.payload!=null&&!Pt(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 Se.Subscribe:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${Me(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!Pt(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an object, but got ${Me(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 ${Me(r.payload.query)}`);if(r.payload.variables!=null&&!Pt(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 ${Me(r.payload.variables)}`);if(r.payload.operationName!=null&&Me(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 ${Me(r.payload.operationName)}`);if(r.payload.extensions!=null&&!Pt(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 ${Me(r.payload.extensions)}`);break}case Se.Next:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${Me(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!Pt(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an object, but got ${Me(r.payload)}`);break}case Se.Error:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${Me(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!Ll(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 Se.Complete:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${Me(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 Ml(r,e){return $l(typeof r=="string"?JSON.parse(r,e):r)}function dn(r,e){return $l(r),JSON.stringify(r,e)}function jl(r){let{url:e,connectionParams:t,lazy:n=!0,onNonLazyError:i=console.error,lazyCloseTimeout:a=0,keepAlive:o=0,disablePong:s,connectionAckWaitTimeout:c=0,retryAttempts:u=5,retryWait:l=async function(ve){let ce=1e3;for(let z=0;z<ve;z++)ce*=2;await new Promise(z=>setTimeout(z,ce+Math.floor(Math.random()*(3e3-300)+300)))},shouldRetry:p=ya,isFatalConnectionProblem:d,on:f,webSocketImpl:m,generateID:g=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,ve=>{let ce=Math.random()*16|0;return(ve=="x"?ce:ce&3|8).toString(16)})},jsonMessageReplacer:b,jsonMessageReviver:_}=r,v;if(m){if(!Rd(m))throw new Error("Invalid WebSocket implementation provided");v=m}else typeof WebSocket<"u"?v=WebSocket:typeof global<"u"?v=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(v=window.WebSocket||window.MozWebSocket);if(!v)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let C=v,E=(()=>{let U=(()=>{let ce={};return{on(z,H){return ce[z]=H,()=>{delete ce[z]}},emit(z){var H;"id"in z&&((H=ce[z.id])===null||H===void 0||H.call(ce,z))}}})(),ve={connecting:f?.connecting?[f.connecting]:[],opened:f?.opened?[f.opened]:[],connected:f?.connected?[f.connected]:[],ping:f?.ping?[f.ping]:[],pong:f?.pong?[f.pong]:[],message:f?.message?[U.emit,f.message]:[U.emit],closed:f?.closed?[f.closed]:[],error:f?.error?[f.error]:[]};return{onMessage:U.on,on(ce,z){let H=ve[ce];return H.push(z),()=>{H.splice(H.indexOf(z),1)}},emit(ce,...z){for(let H of[...ve[ce]])H(...z)}}})();function A(U){let ve=[E.on("error",ce=>{ve.forEach(z=>z()),U(ce)}),E.on("closed",ce=>{ve.forEach(z=>z()),U(ce)})]}let D,I=0,R,ie=!1,te=0,vt=!1;async function It(){clearTimeout(R);let[U,ve]=await(D??(D=new Promise((H,bt)=>(async()=>{if(ie){if(await l(te),!I)return D=void 0,bt({code:1e3,reason:"All Subscriptions Gone"});te++}E.emit("connecting");let V=new C(typeof e=="function"?await e():e,Fl),Ct,jt;function Ai(){isFinite(o)&&o>0&&(clearTimeout(jt),jt=setTimeout(()=>{V.readyState===C.OPEN&&(V.send(dn({type:Se.Ping})),E.emit("ping",!1,void 0))},o))}A(De=>{D=void 0,clearTimeout(Ct),clearTimeout(jt),bt(De),ya(De)&&De.code===4499&&(V.close(4499,"Terminated"),V.onerror=null,V.onclose=null)}),V.onerror=De=>E.emit("error",De),V.onclose=De=>E.emit("closed",De),V.onopen=async()=>{try{E.emit("opened",V);let De=typeof t=="function"?await t():t;if(V.readyState!==C.OPEN)return;V.send(dn(De?{type:Se.ConnectionInit,payload:De}:{type:Se.ConnectionInit},b)),isFinite(c)&&c>0&&(Ct=setTimeout(()=>{V.close(We.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},c)),Ai()}catch(De){E.emit("error",De),V.close(We.InternalClientError,Ns(De instanceof Error?De.message:new Error(De).message,"Internal client error"))}};let Kr=!1;V.onmessage=({data:De})=>{try{let Ne=Ml(De,_);if(E.emit("message",Ne),Ne.type==="ping"||Ne.type==="pong"){E.emit(Ne.type,!0,Ne.payload),Ne.type==="pong"?Ai():s||(V.send(dn(Ne.payload?{type:Se.Pong,payload:Ne.payload}:{type:Se.Pong})),E.emit("pong",!1,Ne.payload));return}if(Kr)return;if(Ne.type!==Se.ConnectionAck)throw new Error(`First message cannot be of type ${Ne.type}`);clearTimeout(Ct),Kr=!0,E.emit("connected",V,Ne.payload),ie=!1,te=0,H([V,new Promise((X1,Ip)=>A(Ip))])}catch(Ne){V.onmessage=null,E.emit("error",Ne),V.close(We.BadResponse,Ns(Ne instanceof Error?Ne.message:new Error(Ne).message,"Bad response"))}}})())));U.readyState===C.CLOSING&&await ve;let ce=()=>{},z=new Promise(H=>ce=H);return[U,ce,Promise.race([z.then(()=>{if(!I){let H=()=>U.close(1e3,"Normal Closure");isFinite(a)&&a>0?R=setTimeout(()=>{U.readyState===C.OPEN&&H()},a):H()}}),ve])]}function ke(U){if(ya(U)&&(Pd(U.code)||[We.InternalServerError,We.InternalClientError,We.BadRequest,We.BadResponse,We.Unauthorized,We.SubprotocolNotAcceptable,We.SubscriberAlreadyExists,We.TooManyInitialisationRequests].includes(U.code)))throw U;if(vt)return!1;if(ya(U)&&U.code===1e3)return I>0;if(!u||te>=u||!p(U)||d?.(U))throw U;return ie=!0}return n||(async()=>{for(I++;;)try{let[,,U]=await It();await U}catch(U){try{if(!ke(U))return}catch(ve){return i?.(ve)}}})(),{on:E.on,subscribe(U,ve){let ce=g(U),z=!1,H=!1,bt=()=>{I--,z=!0};return(async()=>{for(I++;;)try{let[V,Ct,jt]=await It();if(z)return Ct();let Ai=E.onMessage(ce,Kr=>{switch(Kr.type){case Se.Next:{ve.next(Kr.payload);return}case Se.Error:{H=!0,z=!0,ve.error(Kr.payload),bt();return}case Se.Complete:{z=!0,bt();return}}});V.send(dn({id:ce,type:Se.Subscribe,payload:U},b)),bt=()=>{!z&&V.readyState===C.OPEN&&V.send(dn({id:ce,type:Se.Complete},b)),I--,z=!0,Ct()},await jt.finally(Ai);return}catch(V){if(!ke(V))return}})().then(()=>{H||ve.complete()}).catch(V=>{ve.error(V)}),()=>{z||bt()}},async dispose(){if(vt=!0,D){let[U]=await D;U.close(1e3,"Normal Closure")}},terminate(){D&&E.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}function ya(r){return Pt(r)&&"code"in r&&"reason"in r}function Pd(r){return[1e3,1001,1006,1005,1012,1013,1013].includes(r)?!1:r>=1e3&&r<=1999}function Rd(r){return typeof r=="function"&&"constructor"in r&&"CLOSED"in r&&"CLOSING"in r&&"CONNECTING"in r&&"OPEN"in r}function Ld(r){return J(r)&&"code"in r&&"reason"in r}var Ul=function(r){be(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(h(h({},t),{query:Yr(t.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(a){return a instanceof Error?i.error(a):Ld(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 Fa=function(){return Fa=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},Fa.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;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 Fd(r){return Ea(r)=="object"&&r!==null}var up=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 $d(r){return lp(r.source,Ms(r.source,r.start))}function lp(r,e){var t=r.locationOffset.column-1,n=xa(t)+r.body,i=e.line-1,a=r.locationOffset.line-1,o=e.line+a,s=e.line===1?t:0,c=e.column+s,u="".concat(r.name,":").concat(o,":").concat(c,`
|
|
54
|
+
`),l=n.split(/\r\n|[\n\r]/g),p=l[i];if(p.length>120){for(var d=Math.floor(c/80),f=c%80,m=[],g=0;g<p.length;g+=80)m.push(p.slice(g,g+80));return u+ql([["".concat(o),m[0]]].concat(m.slice(1,d+1).map(function(b){return["",b]}),[[" ",xa(f-1)+"^"],["",m[d+1]]]))}return u+ql([["".concat(o-1),l[i-1]],["".concat(o),p],["",xa(c-1)+"^"],["".concat(o+1),l[i+1]]])}function ql(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 Md(t,i)+(a?" | "+a:" |")}).join(`
|
|
55
|
+
`)}function xa(r){return Array(r+1).join(" ")}function Md(r,e){return xa(r-e.length)+e}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)}function Bl(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 jd(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Bl(Object(t),!0).forEach(function(n){Ud(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Bl(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Ud(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function qd(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}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 Bd(r,e,t){return e&&Vl(r.prototype,e),t&&Vl(r,t),r}function Vd(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&&Ci(r,e)}function Qd(r){var e=fp();return function(){var n=Si(r),i;if(e){var a=Si(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return pp(this,i)}}function pp(r,e){return e&&(Oa(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||!Gd(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 Ta(n,arguments,Si(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Ci(i,n)},js(r)}function Ta(r,e,t){return fp()?Ta=Reflect.construct:Ta=function(i,a,o){var s=[null];s.push.apply(s,a);var c=Function.bind.apply(i,s),u=new c;return o&&Ci(u,o.prototype),u},Ta.apply(null,arguments)}function fp(){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 Gd(r){return Function.toString.call(r).indexOf("[native code]")!==-1}function Ci(r,e){return Ci=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Ci(r,e)}function Si(r){return Si=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Si(r)}var Wd=function(r){Vd(t,r);var e=Qd(t);function t(n,i,a,o,s,c,u){var l,p,d,f;qd(this,t),f=e.call(this,n),f.name="GraphQLError",f.originalError=c??void 0,f.nodes=Ql(Array.isArray(i)?i:i?[i]:void 0);for(var m=[],g=0,b=(_=f.nodes)!==null&&_!==void 0?_:[];g<b.length;g++){var _,v=b[g],C=v.loc;C!=null&&m.push(C)}m=Ql(m),f.source=a??((l=m)===null||l===void 0?void 0:l[0].source),f.positions=o??((p=m)===null||p===void 0?void 0:p.map(function(A){return A.start})),f.locations=o&&a?o.map(function(A){return Ms(a,A)}):(d=m)===null||d===void 0?void 0:d.map(function(A){return Ms(A.source,A.start)}),f.path=s??void 0;var E=c?.extensions;return u==null&&Fd(E)?f.extensions=jd({},E):f.extensions=u??{},Object.defineProperties(ii(f),{message:{enumerable:!0},locations:{enumerable:f.locations!=null},path:{enumerable:f.path!=null},extensions:{enumerable:f.extensions!=null&&Object.keys(f.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),c!=null&&c.stack?(Object.defineProperty(ii(f),"stack",{value:c.stack,writable:!0,configurable:!0}),pp(f)):(Error.captureStackTrace?Error.captureStackTrace(ii(f),t):Object.defineProperty(ii(f),"stack",{value:Error().stack,writable:!0,configurable:!0}),f)}return Bd(t,[{key:"toString",value:function(){return Kd(this)}},{key:up,get:function(){return"Object"}}]),t}(js(Error));function Ql(r){return r===void 0||r.length===0?void 0:r}function Kd(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
57
|
`+$d(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
|
-
`+
|
|
60
|
-
`)}function
|
|
61
|
-
`;break;case 114:u+="\r";break;case 116:u+=" ";break;case 117:{var l=y1(a.charCodeAt(o+1),a.charCodeAt(o+2),a.charCodeAt(o+3),a.charCodeAt(o+4));if(l<0){var p=a.slice(o+1,o+5);throw tt(r,o,"Invalid character escape sequence: \\u".concat(p,"."))}u+=String.fromCharCode(l),o+=4;break}default:throw tt(r,o,"Invalid character escape sequence: \\".concat(String.fromCharCode(c),"."))}++o,s=o}}throw tt(r,o,"Unterminated string.")}function g1(r,e,t,n,i,a){for(var o=r.body,s=e+3,c=s,u=0,l="";s<o.length&&!isNaN(u=o.charCodeAt(s));){if(u===34&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34)return l+=o.slice(c,s),new _e(S.BLOCK_STRING,e,s+3,t,n,i,s1(l));if(u<32&&u!==9&&u!==10&&u!==13)throw tt(r,s,"Invalid character within String: ".concat(Fr(u),"."));u===10?(++s,++a.line,a.lineStart=s):u===13?(o.charCodeAt(s+1)===10?s+=2:++s,++a.line,a.lineStart=s):u===92&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34&&o.charCodeAt(s+3)===34?(l+=o.slice(c,s)+'"""',s+=4,c=s):++s}throw tt(r,s,"Unterminated string.")}function y1(r,e,t,n){return ga(r)<<12|ga(e)<<8|ga(t)<<4|ga(n)}function ga(r){return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1}function v1(r,e,t,n,i){for(var a=r.body,o=a.length,s=e+1,c=0;s!==o&&!isNaN(c=a.charCodeAt(s))&&(c===95||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122);)++s;return new _e(S.NAME,e,s,t,n,i,a.slice(e,s))}function b1(r){return r===95||r>=65&&r<=90||r>=97&&r<=122}function C1(r,e){var t=new S1(r,e);return t.parseDocument()}var S1=function(){function r(t,n){var i=a1(t)?t:new hp(t);this._lexer=new u1(i),this._options=n}var e=r.prototype;return e.parseName=function(){var n=this.expectToken(S.NAME);return{kind:$.NAME,value:n.value,loc:this.loc(n)}},e.parseDocument=function(){var n=this._lexer.token;return{kind:$.DOCUMENT,definitions:this.many(S.SOF,this.parseDefinition,S.EOF),loc:this.loc(n)}},e.parseDefinition=function(){if(this.peek(S.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(S.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(S.BRACE_L))return{kind:$.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(n)};var i=this.parseOperationType(),a;return this.peek(S.NAME)&&(a=this.parseName()),{kind:$.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(S.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(S.PAREN_L,this.parseVariableDefinition,S.PAREN_R)},e.parseVariableDefinition=function(){var n=this._lexer.token;return{kind:$.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(S.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(S.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(S.DOLLAR),{kind:$.VARIABLE,name:this.parseName(),loc:this.loc(n)}},e.parseSelectionSet=function(){var n=this._lexer.token;return{kind:$.SELECTION_SET,selections:this.many(S.BRACE_L,this.parseSelection,S.BRACE_R),loc:this.loc(n)}},e.parseSelection=function(){return this.peek(S.SPREAD)?this.parseFragment():this.parseField()},e.parseField=function(){var n=this._lexer.token,i=this.parseName(),a,o;return this.expectOptionalToken(S.COLON)?(a=i,o=this.parseName()):o=i,{kind:$.FIELD,alias:a,name:o,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(S.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},e.parseArguments=function(n){var i=n?this.parseConstArgument:this.parseArgument;return this.optionalMany(S.PAREN_L,i,S.PAREN_R)},e.parseArgument=function(){var n=this._lexer.token,i=this.parseName();return this.expectToken(S.COLON),{kind:$.ARGUMENT,name:i,value:this.parseValueLiteral(!1),loc:this.loc(n)}},e.parseConstArgument=function(){var n=this._lexer.token;return{kind:$.ARGUMENT,name:this.parseName(),value:(this.expectToken(S.COLON),this.parseValueLiteral(!0)),loc:this.loc(n)}},e.parseFragment=function(){var n=this._lexer.token;this.expectToken(S.SPREAD);var i=this.expectOptionalKeyword("on");return!i&&this.peek(S.NAME)?{kind:$.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(n)}:{kind:$.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:$.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:$.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 S.BRACKET_L:return this.parseList(n);case S.BRACE_L:return this.parseObject(n);case S.INT:return this._lexer.advance(),{kind:$.INT,value:i.value,loc:this.loc(i)};case S.FLOAT:return this._lexer.advance(),{kind:$.FLOAT,value:i.value,loc:this.loc(i)};case S.STRING:case S.BLOCK_STRING:return this.parseStringLiteral();case S.NAME:switch(this._lexer.advance(),i.value){case"true":return{kind:$.BOOLEAN,value:!0,loc:this.loc(i)};case"false":return{kind:$.BOOLEAN,value:!1,loc:this.loc(i)};case"null":return{kind:$.NULL,loc:this.loc(i)};default:return{kind:$.ENUM,value:i.value,loc:this.loc(i)}}case S.DOLLAR:if(!n)return this.parseVariable();break}throw this.unexpected()},e.parseStringLiteral=function(){var n=this._lexer.token;return this._lexer.advance(),{kind:$.STRING,value:n.value,block:n.kind===S.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:$.LIST,values:this.any(S.BRACKET_L,o,S.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:$.OBJECT,fields:this.any(S.BRACE_L,o,S.BRACE_R),loc:this.loc(a)}},e.parseObjectField=function(n){var i=this._lexer.token,a=this.parseName();return this.expectToken(S.COLON),{kind:$.OBJECT_FIELD,name:a,value:this.parseValueLiteral(n),loc:this.loc(i)}},e.parseDirectives=function(n){for(var i=[];this.peek(S.AT);)i.push(this.parseDirective(n));return i},e.parseDirective=function(n){var i=this._lexer.token;return this.expectToken(S.AT),{kind:$.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(n),loc:this.loc(i)}},e.parseTypeReference=function(){var n=this._lexer.token,i;return this.expectOptionalToken(S.BRACKET_L)?(i=this.parseTypeReference(),this.expectToken(S.BRACKET_R),i={kind:$.LIST_TYPE,type:i,loc:this.loc(n)}):i=this.parseNamedType(),this.expectOptionalToken(S.BANG)?{kind:$.NON_NULL_TYPE,type:i,loc:this.loc(n)}:i},e.parseNamedType=function(){var n=this._lexer.token;return{kind:$.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===S.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(S.STRING)||this.peek(S.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(S.BRACE_L,this.parseOperationTypeDefinition,S.BRACE_R);return{kind:$.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(S.COLON);var a=this.parseNamedType();return{kind:$.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:$.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),c=this.parseFieldsDefinition();return{kind:$.OBJECT_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:c,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(S.AMP);do i.push(this.parseNamedType());while(this.expectOptionalToken(S.AMP)||this.peek(S.NAME));return i}return this.delimitedMany(S.AMP,this.parseNamedType)},e.parseFieldsDefinition=function(){var n;return((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLEmptyFields)===!0&&this.peek(S.BRACE_L)&&this._lexer.lookahead().kind===S.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(S.BRACE_L,this.parseFieldDefinition,S.BRACE_R)},e.parseFieldDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseArgumentDefs();this.expectToken(S.COLON);var s=this.parseTypeReference(),c=this.parseDirectives(!0);return{kind:$.FIELD_DEFINITION,description:i,name:a,arguments:o,type:s,directives:c,loc:this.loc(n)}},e.parseArgumentDefs=function(){return this.optionalMany(S.PAREN_L,this.parseInputValueDef,S.PAREN_R)},e.parseInputValueDef=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName();this.expectToken(S.COLON);var o=this.parseTypeReference(),s;this.expectOptionalToken(S.EQUALS)&&(s=this.parseValueLiteral(!0));var c=this.parseDirectives(!0);return{kind:$.INPUT_VALUE_DEFINITION,description:i,name:a,type:o,defaultValue:s,directives:c,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),c=this.parseFieldsDefinition();return{kind:$.INTERFACE_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:c,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:$.UNION_TYPE_DEFINITION,description:i,name:a,directives:o,types:s,loc:this.loc(n)}},e.parseUnionMemberTypes=function(){return this.expectOptionalToken(S.EQUALS)?this.delimitedMany(S.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:$.ENUM_TYPE_DEFINITION,description:i,name:a,directives:o,values:s,loc:this.loc(n)}},e.parseEnumValuesDefinition=function(){return this.optionalMany(S.BRACE_L,this.parseEnumValueDefinition,S.BRACE_R)},e.parseEnumValueDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseDirectives(!0);return{kind:$.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:$.INPUT_OBJECT_TYPE_DEFINITION,description:i,name:a,directives:o,fields:s,loc:this.loc(n)}},e.parseInputFieldsDefinition=function(){return this.optionalMany(S.BRACE_L,this.parseInputValueDef,S.BRACE_R)},e.parseTypeSystemExtension=function(){var n=this._lexer.lookahead();if(n.kind===S.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(S.BRACE_L,this.parseOperationTypeDefinition,S.BRACE_R);if(i.length===0&&a.length===0)throw this.unexpected();return{kind:$.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:$.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:$.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:$.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:$.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:$.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:$.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(S.AT);var a=this.parseName(),o=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var c=this.parseDirectiveLocations();return{kind:$.DIRECTIVE_DEFINITION,description:i,name:a,arguments:o,repeatable:s,locations:c,loc:this.loc(n)}},e.parseDirectiveLocations=function(){return this.delimitedMany(S.PIPE,this.parseDirectiveLocation)},e.parseDirectiveLocation=function(){var n=this._lexer.token,i=this.parseName();if(o1[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 fp(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 tt(this._lexer.source,i.start,"Expected ".concat(mp(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===S.NAME&&i.value===n)this._lexer.advance();else throw tt(this._lexer.source,i.start,'Expected "'.concat(n,'", found ').concat(Rs(i),"."))},e.expectOptionalKeyword=function(n){var i=this._lexer.token;return i.kind===S.NAME&&i.value===n?(this._lexer.advance(),!0):!1},e.unexpected=function(n){var i=n??this._lexer.token;return tt(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 mp(r.kind)+(e!=null?' "'.concat(e,'"'):"")}function mp(r){return l1(r)?'"'.concat(r,'"'):r}var Ia=new Map,Us=new Map,gp=!0,Fa=!1;function yp(r){return r.replace(/[\s,]+/g," ").trim()}function w1(r){return yp(r.source.body.substring(r.start,r.end))}function _1(r){var e=new Set,t=[];return r.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,a=w1(n.loc),o=Us.get(i);o&&!o.has(a)?gp&&console.warn("Warning: fragment with name "+i+` already exists.
|
|
59
|
+
`+lp(r.source,s)}return e}function tt(r,e,t){return new Wd("Syntax Error: ".concat(t),void 0,r,[e])}var $=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 zd(r,e){var t=Boolean(r);if(!t)throw new Error(e??"Unexpected invariant triggered.")}var Hd=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,Us=Hd;function dp(r){var e=r.prototype.toJSON;typeof e=="function"||zd(0),r.prototype.inspect=e,Us&&(r.prototype[Us]=e)}var hp=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}();dp(hp);var _e=function(){function r(t,n,i,a,o,s,c){this.kind=t,this.start=n,this.end=i,this.line=a,this.column=o,this.value=c,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}();dp(_e);var S=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 Ia(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ia=function(t){return typeof t}:Ia=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ia(r)}var Jd=10,mp=2;function Yd(r){return Za(r,[])}function Za(r,e){switch(Ia(r)){case"string":return JSON.stringify(r);case"function":return r.name?"[function ".concat(r.name,"]"):"[function]";case"object":return r===null?"null":Xd(r,e);default:return String(r)}}function Xd(r,e){if(e.indexOf(r)!==-1)return"[Circular]";var t=[].concat(e,[r]),n=t1(r);if(n!==void 0){var i=n.call(r);if(i!==r)return typeof i=="string"?i:Za(i,t)}else if(Array.isArray(r))return e1(r,t);return Zd(r,t)}function Zd(r,e){var t=Object.keys(r);if(t.length===0)return"{}";if(e.length>mp)return"["+r1(r)+"]";var n=t.map(function(i){var a=Za(r[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function e1(r,e){if(r.length===0)return"[]";if(e.length>mp)return"[Array]";for(var t=Math.min(Jd,r.length),n=r.length-t,i=[],a=0;a<t;++a)i.push(Za(r[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function t1(r){var e=r[String(Us)];if(typeof e=="function")return e;if(typeof r.inspect=="function")return r.inspect}function r1(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 Ps(r,e){var t=Boolean(r);if(!t)throw new Error(e)}var n1=function(e,t){return e instanceof t};function Gl(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 i1(r,e,t){return e&&Gl(r.prototype,e),t&&Gl(r,t),r}var gp=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"||Ps(0,"Body must be a string. Received: ".concat(Yd(e),".")),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||Ps(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Ps(0,"column in locationOffset is 1-indexed and must be positive.")}return i1(r,[{key:up,get:function(){return"Source"}}]),r}();function a1(r){return n1(r,gp)}var o1=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 s1(r){var e=r.split(/\r\n|[\n\r]/g),t=c1(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&&Wl(e[i]);)++i;for(var a=e.length;a>i&&Wl(e[a-1]);)--a;return e.slice(i,a).join(`
|
|
60
|
+
`)}function Wl(r){for(var e=0;e<r.length;++e)if(r[e]!==" "&&r[e]!==" ")return!1;return!0}function c1(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 u1=function(){function r(t){var n=new _e(S.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!==S.EOF)do{var i;n=(i=n.next)!==null&&i!==void 0?i:n.next=p1(this,n)}while(n.kind===S.COMMENT);return n},r}();function l1(r){return r===S.BANG||r===S.DOLLAR||r===S.AMP||r===S.PAREN_L||r===S.PAREN_R||r===S.SPREAD||r===S.COLON||r===S.EQUALS||r===S.AT||r===S.BRACKET_L||r===S.BRACKET_R||r===S.BRACE_L||r===S.PIPE||r===S.BRACE_R}function Fr(r){return isNaN(r)?S.EOF:r<127?JSON.stringify(String.fromCharCode(r)):'"\\u'.concat(("00"+r.toString(16).toUpperCase()).slice(-4),'"')}function p1(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,c=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 _e(S.BANG,a,a+1,s,c,e);case 35:return d1(t,a,s,c,e);case 36:return new _e(S.DOLLAR,a,a+1,s,c,e);case 38:return new _e(S.AMP,a,a+1,s,c,e);case 40:return new _e(S.PAREN_L,a,a+1,s,c,e);case 41:return new _e(S.PAREN_R,a,a+1,s,c,e);case 46:if(n.charCodeAt(a+1)===46&&n.charCodeAt(a+2)===46)return new _e(S.SPREAD,a,a+3,s,c,e);break;case 58:return new _e(S.COLON,a,a+1,s,c,e);case 61:return new _e(S.EQUALS,a,a+1,s,c,e);case 64:return new _e(S.AT,a,a+1,s,c,e);case 91:return new _e(S.BRACKET_L,a,a+1,s,c,e);case 93:return new _e(S.BRACKET_R,a,a+1,s,c,e);case 123:return new _e(S.BRACE_L,a,a+1,s,c,e);case 124:return new _e(S.PIPE,a,a+1,s,c,e);case 125:return new _e(S.BRACE_R,a,a+1,s,c,e);case 34:return n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34?g1(t,a,s,c,e,r):m1(t,a,s,c,e);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return h1(t,a,o,s,c,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 v1(t,a,s,c,e)}throw tt(t,a,f1(o))}var u=r.line,l=1+a-r.lineStart;return new _e(S.EOF,i,i,u,l,e)}function f1(r){return r<32&&r!==9&&r!==10&&r!==13?"Cannot contain the invalid character ".concat(Fr(r),"."):r===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:"Cannot parse the unexpected character ".concat(Fr(r),".")}function d1(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 _e(S.COMMENT,e,s,t,n,i,a.slice(e+1,s))}function h1(r,e,t,n,i,a){var o=r.body,s=t,c=e,u=!1;if(s===45&&(s=o.charCodeAt(++c)),s===48){if(s=o.charCodeAt(++c),s>=48&&s<=57)throw tt(r,c,"Invalid number, unexpected digit after 0: ".concat(Fr(s),"."))}else c=Rs(r,c,s),s=o.charCodeAt(c);if(s===46&&(u=!0,s=o.charCodeAt(++c),c=Rs(r,c,s),s=o.charCodeAt(c)),(s===69||s===101)&&(u=!0,s=o.charCodeAt(++c),(s===43||s===45)&&(s=o.charCodeAt(++c)),c=Rs(r,c,s),s=o.charCodeAt(c)),s===46||b1(s))throw tt(r,c,"Invalid number, expected digit but got: ".concat(Fr(s),"."));return new _e(u?S.FLOAT:S.INT,e,c,n,i,a,o.slice(e,c))}function Rs(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 tt(r,i,"Invalid number, expected digit but got: ".concat(Fr(a),"."))}function m1(r,e,t,n,i){for(var a=r.body,o=e+1,s=o,c=0,u="";o<a.length&&!isNaN(c=a.charCodeAt(o))&&c!==10&&c!==13;){if(c===34)return u+=a.slice(s,o),new _e(S.STRING,e,o+1,t,n,i,u);if(c<32&&c!==9)throw tt(r,o,"Invalid character within String: ".concat(Fr(c),"."));if(++o,c===92){switch(u+=a.slice(s,o-1),c=a.charCodeAt(o),c){case 34:u+='"';break;case 47:u+="/";break;case 92:u+="\\";break;case 98:u+="\b";break;case 102:u+="\f";break;case 110:u+=`
|
|
61
|
+
`;break;case 114:u+="\r";break;case 116:u+=" ";break;case 117:{var l=y1(a.charCodeAt(o+1),a.charCodeAt(o+2),a.charCodeAt(o+3),a.charCodeAt(o+4));if(l<0){var p=a.slice(o+1,o+5);throw tt(r,o,"Invalid character escape sequence: \\u".concat(p,"."))}u+=String.fromCharCode(l),o+=4;break}default:throw tt(r,o,"Invalid character escape sequence: \\".concat(String.fromCharCode(c),"."))}++o,s=o}}throw tt(r,o,"Unterminated string.")}function g1(r,e,t,n,i,a){for(var o=r.body,s=e+3,c=s,u=0,l="";s<o.length&&!isNaN(u=o.charCodeAt(s));){if(u===34&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34)return l+=o.slice(c,s),new _e(S.BLOCK_STRING,e,s+3,t,n,i,s1(l));if(u<32&&u!==9&&u!==10&&u!==13)throw tt(r,s,"Invalid character within String: ".concat(Fr(u),"."));u===10?(++s,++a.line,a.lineStart=s):u===13?(o.charCodeAt(s+1)===10?s+=2:++s,++a.line,a.lineStart=s):u===92&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34&&o.charCodeAt(s+3)===34?(l+=o.slice(c,s)+'"""',s+=4,c=s):++s}throw tt(r,s,"Unterminated string.")}function y1(r,e,t,n){return va(r)<<12|va(e)<<8|va(t)<<4|va(n)}function va(r){return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1}function v1(r,e,t,n,i){for(var a=r.body,o=a.length,s=e+1,c=0;s!==o&&!isNaN(c=a.charCodeAt(s))&&(c===95||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122);)++s;return new _e(S.NAME,e,s,t,n,i,a.slice(e,s))}function b1(r){return r===95||r>=65&&r<=90||r>=97&&r<=122}function C1(r,e){var t=new S1(r,e);return t.parseDocument()}var S1=function(){function r(t,n){var i=a1(t)?t:new gp(t);this._lexer=new u1(i),this._options=n}var e=r.prototype;return e.parseName=function(){var n=this.expectToken(S.NAME);return{kind:$.NAME,value:n.value,loc:this.loc(n)}},e.parseDocument=function(){var n=this._lexer.token;return{kind:$.DOCUMENT,definitions:this.many(S.SOF,this.parseDefinition,S.EOF),loc:this.loc(n)}},e.parseDefinition=function(){if(this.peek(S.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(S.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(S.BRACE_L))return{kind:$.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(n)};var i=this.parseOperationType(),a;return this.peek(S.NAME)&&(a=this.parseName()),{kind:$.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(S.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(S.PAREN_L,this.parseVariableDefinition,S.PAREN_R)},e.parseVariableDefinition=function(){var n=this._lexer.token;return{kind:$.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(S.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(S.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(S.DOLLAR),{kind:$.VARIABLE,name:this.parseName(),loc:this.loc(n)}},e.parseSelectionSet=function(){var n=this._lexer.token;return{kind:$.SELECTION_SET,selections:this.many(S.BRACE_L,this.parseSelection,S.BRACE_R),loc:this.loc(n)}},e.parseSelection=function(){return this.peek(S.SPREAD)?this.parseFragment():this.parseField()},e.parseField=function(){var n=this._lexer.token,i=this.parseName(),a,o;return this.expectOptionalToken(S.COLON)?(a=i,o=this.parseName()):o=i,{kind:$.FIELD,alias:a,name:o,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(S.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},e.parseArguments=function(n){var i=n?this.parseConstArgument:this.parseArgument;return this.optionalMany(S.PAREN_L,i,S.PAREN_R)},e.parseArgument=function(){var n=this._lexer.token,i=this.parseName();return this.expectToken(S.COLON),{kind:$.ARGUMENT,name:i,value:this.parseValueLiteral(!1),loc:this.loc(n)}},e.parseConstArgument=function(){var n=this._lexer.token;return{kind:$.ARGUMENT,name:this.parseName(),value:(this.expectToken(S.COLON),this.parseValueLiteral(!0)),loc:this.loc(n)}},e.parseFragment=function(){var n=this._lexer.token;this.expectToken(S.SPREAD);var i=this.expectOptionalKeyword("on");return!i&&this.peek(S.NAME)?{kind:$.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(n)}:{kind:$.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:$.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:$.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 S.BRACKET_L:return this.parseList(n);case S.BRACE_L:return this.parseObject(n);case S.INT:return this._lexer.advance(),{kind:$.INT,value:i.value,loc:this.loc(i)};case S.FLOAT:return this._lexer.advance(),{kind:$.FLOAT,value:i.value,loc:this.loc(i)};case S.STRING:case S.BLOCK_STRING:return this.parseStringLiteral();case S.NAME:switch(this._lexer.advance(),i.value){case"true":return{kind:$.BOOLEAN,value:!0,loc:this.loc(i)};case"false":return{kind:$.BOOLEAN,value:!1,loc:this.loc(i)};case"null":return{kind:$.NULL,loc:this.loc(i)};default:return{kind:$.ENUM,value:i.value,loc:this.loc(i)}}case S.DOLLAR:if(!n)return this.parseVariable();break}throw this.unexpected()},e.parseStringLiteral=function(){var n=this._lexer.token;return this._lexer.advance(),{kind:$.STRING,value:n.value,block:n.kind===S.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:$.LIST,values:this.any(S.BRACKET_L,o,S.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:$.OBJECT,fields:this.any(S.BRACE_L,o,S.BRACE_R),loc:this.loc(a)}},e.parseObjectField=function(n){var i=this._lexer.token,a=this.parseName();return this.expectToken(S.COLON),{kind:$.OBJECT_FIELD,name:a,value:this.parseValueLiteral(n),loc:this.loc(i)}},e.parseDirectives=function(n){for(var i=[];this.peek(S.AT);)i.push(this.parseDirective(n));return i},e.parseDirective=function(n){var i=this._lexer.token;return this.expectToken(S.AT),{kind:$.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(n),loc:this.loc(i)}},e.parseTypeReference=function(){var n=this._lexer.token,i;return this.expectOptionalToken(S.BRACKET_L)?(i=this.parseTypeReference(),this.expectToken(S.BRACKET_R),i={kind:$.LIST_TYPE,type:i,loc:this.loc(n)}):i=this.parseNamedType(),this.expectOptionalToken(S.BANG)?{kind:$.NON_NULL_TYPE,type:i,loc:this.loc(n)}:i},e.parseNamedType=function(){var n=this._lexer.token;return{kind:$.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===S.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(S.STRING)||this.peek(S.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(S.BRACE_L,this.parseOperationTypeDefinition,S.BRACE_R);return{kind:$.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(S.COLON);var a=this.parseNamedType();return{kind:$.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:$.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),c=this.parseFieldsDefinition();return{kind:$.OBJECT_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:c,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(S.AMP);do i.push(this.parseNamedType());while(this.expectOptionalToken(S.AMP)||this.peek(S.NAME));return i}return this.delimitedMany(S.AMP,this.parseNamedType)},e.parseFieldsDefinition=function(){var n;return((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLEmptyFields)===!0&&this.peek(S.BRACE_L)&&this._lexer.lookahead().kind===S.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(S.BRACE_L,this.parseFieldDefinition,S.BRACE_R)},e.parseFieldDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseArgumentDefs();this.expectToken(S.COLON);var s=this.parseTypeReference(),c=this.parseDirectives(!0);return{kind:$.FIELD_DEFINITION,description:i,name:a,arguments:o,type:s,directives:c,loc:this.loc(n)}},e.parseArgumentDefs=function(){return this.optionalMany(S.PAREN_L,this.parseInputValueDef,S.PAREN_R)},e.parseInputValueDef=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName();this.expectToken(S.COLON);var o=this.parseTypeReference(),s;this.expectOptionalToken(S.EQUALS)&&(s=this.parseValueLiteral(!0));var c=this.parseDirectives(!0);return{kind:$.INPUT_VALUE_DEFINITION,description:i,name:a,type:o,defaultValue:s,directives:c,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),c=this.parseFieldsDefinition();return{kind:$.INTERFACE_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:c,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:$.UNION_TYPE_DEFINITION,description:i,name:a,directives:o,types:s,loc:this.loc(n)}},e.parseUnionMemberTypes=function(){return this.expectOptionalToken(S.EQUALS)?this.delimitedMany(S.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:$.ENUM_TYPE_DEFINITION,description:i,name:a,directives:o,values:s,loc:this.loc(n)}},e.parseEnumValuesDefinition=function(){return this.optionalMany(S.BRACE_L,this.parseEnumValueDefinition,S.BRACE_R)},e.parseEnumValueDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseDirectives(!0);return{kind:$.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:$.INPUT_OBJECT_TYPE_DEFINITION,description:i,name:a,directives:o,fields:s,loc:this.loc(n)}},e.parseInputFieldsDefinition=function(){return this.optionalMany(S.BRACE_L,this.parseInputValueDef,S.BRACE_R)},e.parseTypeSystemExtension=function(){var n=this._lexer.lookahead();if(n.kind===S.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(S.BRACE_L,this.parseOperationTypeDefinition,S.BRACE_R);if(i.length===0&&a.length===0)throw this.unexpected();return{kind:$.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:$.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:$.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:$.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:$.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:$.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:$.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(S.AT);var a=this.parseName(),o=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var c=this.parseDirectiveLocations();return{kind:$.DIRECTIVE_DEFINITION,description:i,name:a,arguments:o,repeatable:s,locations:c,loc:this.loc(n)}},e.parseDirectiveLocations=function(){return this.delimitedMany(S.PIPE,this.parseDirectiveLocation)},e.parseDirectiveLocation=function(){var n=this._lexer.token,i=this.parseName();if(o1[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 hp(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 tt(this._lexer.source,i.start,"Expected ".concat(yp(n),", found ").concat(Ls(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===S.NAME&&i.value===n)this._lexer.advance();else throw tt(this._lexer.source,i.start,'Expected "'.concat(n,'", found ').concat(Ls(i),"."))},e.expectOptionalKeyword=function(n){var i=this._lexer.token;return i.kind===S.NAME&&i.value===n?(this._lexer.advance(),!0):!1},e.unexpected=function(n){var i=n??this._lexer.token;return tt(this._lexer.source,i.start,"Unexpected ".concat(Ls(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 Ls(r){var e=r.value;return yp(r.kind)+(e!=null?' "'.concat(e,'"'):"")}function yp(r){return l1(r)?'"'.concat(r,'"'):r}var Aa=new Map,qs=new Map,vp=!0,$a=!1;function bp(r){return r.replace(/[\s,]+/g," ").trim()}function w1(r){return bp(r.source.body.substring(r.start,r.end))}function _1(r){var e=new Set,t=[];return r.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,a=w1(n.loc),o=qs.get(i);o&&!o.has(a)?vp&&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||Us.set(i,o=new Set),o.add(a),e.has(a)||(e.add(a),t.push(n))}else t.push(n)}),La(La({},r),{definitions:t})}function E1(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 x1(r){var e=yp(r);if(!Ia.has(e)){var t=C1(r,{experimentalFragmentVariables:Fa,allowLegacyFragmentVariables:Fa});if(!t||t.kind!=="Document")throw new Error("Not a valid GraphQL document.");Ia.set(e,E1(_1(t)))}return Ia.get(e)}function w(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]}),x1(n)}function O1(){Ia.clear(),Us.clear()}function T1(){gp=!1}function I1(){Fa=!0}function A1(){Fa=!1}var ti={gql:w,resetCaches:O1,disableFragmentWarnings:T1,enableExperimentalFragmentVariables:I1,disableExperimentalFragmentVariables:A1};(function(r){r.gql=ti.gql,r.resetCaches=ti.resetCaches,r.disableFragmentWarnings=ti.disableFragmentWarnings,r.enableExperimentalFragmentVariables=ti.enableExperimentalFragmentVariables,r.disableExperimentalFragmentVariables=ti.disableExperimentalFragmentVariables})(w||(w={}));w.default=w;function O(r){if(!r)throw"Got no result from Apollo";if(r.error)throw r.error;if(r.errors)throw r.errors;return r.data}function k1(){}function Zs(){return k1}var y=Zs,Ve=Zs,Y=Zs,vp=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},bp=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},$r=class{constructor(e){this.code=e}};vp([y(),bp("design:type",String)],$r.prototype,"code",void 0);$r=vp([Y(),bp("design:paramtypes",[String])],$r);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)},xt=class{constructor(e,t){this.address=e,this.name=t}};ec([y(),tc("design:type",String)],xt.prototype,"address",void 0);ec([y(),tc("design:type",String)],xt.prototype,"name",void 0);xt=ec([Y(),tc("design:paramtypes",[String,String])],xt);var de=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)},rr=class{constructor(e,t){this.key=t,this.signature=e}};de([y(),Te("design:type",String)],rr.prototype,"signature",void 0);de([y(),Te("design:type",String)],rr.prototype,"key",void 0);de([y(),Te("design:type",Boolean)],rr.prototype,"valid",void 0);de([y(),Te("design:type",Boolean)],rr.prototype,"invalid",void 0);rr=de([Y(),Ve(),Te("design:paramtypes",[String,String])],rr);var Mr=class{};de([y(),Te("design:type",String)],Mr.prototype,"signature",void 0);de([y(),Te("design:type",String)],Mr.prototype,"key",void 0);de([y(),Te("design:type",Boolean)],Mr.prototype,"valid",void 0);de([y(),Te("design:type",Boolean)],Mr.prototype,"invalid",void 0);Mr=de([Ve()],Mr);function cr(r){let e=class{constructor(n,i,a,o){this.author=n,this.timestamp=i,this.data=a,this.proof=o}};return de([y(),Te("design:type",String)],e.prototype,"author",void 0),de([y(),Te("design:type",String)],e.prototype,"timestamp",void 0),de([y(),Te("design:type",Object)],e.prototype,"data",void 0),de([y(),Te("design:type",rr)],e.prototype,"proof",void 0),e=de([Y(),Te("design:paramtypes",[String,String,Object,rr])],e),e}function D1(r){let e=class{};return de([y(),Te("design:type",String)],e.prototype,"author",void 0),de([y(),Te("design:type",String)],e.prototype,"timestamp",void 0),de([y(),Te("design:type",Object)],e.prototype,"data",void 0),de([y(),Te("design:type",Mr)],e.prototype,"proof",void 0),e=de([Ve()],e),e}var Gl=class extends cr(){};Gl=de([Y()],Gl);var $a=class extends cr(){};de([y(),Te("design:type",xt)],$a.prototype,"language",void 0);de([y(),Te("design:type",$r)],$a.prototype,"icon",void 0);$a=de([Y()],$a);function Ty(r){return r&&r.author&&r.timestamp&&r.data}var xe=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},Le=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},jr=class{constructor(e){this.source=e.source?e.source:"",this.target=e.target?e.target:"",this.predicate=e.predicate?e.predicate:""}};xe([y(),Le("design:type",String)],jr.prototype,"source",void 0);xe([y(),Le("design:type",String)],jr.prototype,"target",void 0);xe([y(),Le("design:type",String)],jr.prototype,"predicate",void 0);jr=xe([Y(),Le("design:paramtypes",[Object])],jr);var Ma=class{};xe([y(),Le("design:type",Array)],Ma.prototype,"additions",void 0);xe([y(),Le("design:type",Array)],Ma.prototype,"removals",void 0);Ma=xe([Ve()],Ma);var ja=class{constructor(e,t){this.additions=e,this.removals=t}};xe([y(),Le("design:type",Array)],ja.prototype,"additions",void 0);xe([y(),Le("design:type",Array)],ja.prototype,"removals",void 0);ja=xe([Y(),Le("design:paramtypes",[Array,Array])],ja);var Ci=class{};xe([y(),Le("design:type",String)],Ci.prototype,"source",void 0);xe([y(),Le("design:type",String)],Ci.prototype,"target",void 0);xe([y(),Le("design:type",String)],Ci.prototype,"predicate",void 0);Ci=xe([Ve()],Ci);var Ur=class extends cr(){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}};xe([y(),Le("design:type",String)],Ur.prototype,"status",void 0);Ur=xe([Y()],Ur);var qs=class extends D1(){};xe([y(),Le("design:type",String)],qs.prototype,"status",void 0);qs=xe([Ve()],qs);function Ry(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 Ly(r){return r&&r.source&&r.target}var Ua=class{constructor(e,t){this.oldLink=e,this.newLink=t}};xe([y(),Le("design:type",Ur)],Ua.prototype,"oldLink",void 0);xe([y(),Le("design:type",Ur)],Ua.prototype,"newLink",void 0);Ua=xe([Y(),Le("design:paramtypes",[Ur,Ur])],Ua);var Br=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,nr=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}};Br([y(),Ei("design:type",Array)],nr.prototype,"links",void 0);nr=Br([Y(),Ei("design:paramtypes",[Array])],nr);var Vs=class{};Br([y(),Ei("design:type",Array)],Vs.prototype,"links",void 0);Vs=Br([Ve()],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}};Br([y(),Ei("design:type",Array)],Qs.prototype,"links",void 0);Qs=Bs=Br([Ve(),Ei("design:paramtypes",[Array])],Qs);var Gs=class extends cr(){};Gs=Br([Y()],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},F=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},er=class{constructor(e,t){this.did=e,t?this.perspective=t:this.perspective=new nr}};L([y(),F("design:type",String)],er.prototype,"did",void 0);L([y(),F("design:type",nr)],er.prototype,"perspective",void 0);L([y(),F("design:type",String)],er.prototype,"directMessageLanguage",void 0);er=L([Y(),F("design:paramtypes",[String,nr])],er);var Wl=class extends cr(){};Wl=L([Y()],Wl);var ir=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([y(),F("design:type",String)],ir.prototype,"did",void 0);L([y(),F("design:type",String)],ir.prototype,"didSigningKeyId",void 0);L([y(),F("design:type",String)],ir.prototype,"deviceKeyType",void 0);L([y(),F("design:type",String)],ir.prototype,"deviceKey",void 0);L([y(),F("design:type",String)],ir.prototype,"deviceKeySignedByDid",void 0);L([y(),F("design:type",String)],ir.prototype,"didSignedByDeviceKey",void 0);ir=L([Y(),F("design:paramtypes",[String,String,String,String,String,String])],ir);var ar=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([y(),F("design:type",String)],ar.prototype,"did",void 0);L([y(),F("design:type",String)],ar.prototype,"didSigningKeyId",void 0);L([y(),F("design:type",String)],ar.prototype,"deviceKeyType",void 0);L([y(),F("design:type",String)],ar.prototype,"deviceKey",void 0);L([y(),F("design:type",String)],ar.prototype,"deviceKeySignedByDid",void 0);L([y(),F("design:type",String)],ar.prototype,"didSignedByDeviceKey",void 0);ar=L([Ve(),F("design:paramtypes",[String,String,String,String,String,String])],ar);var qa=class{constructor(e,t){this.signature=e,this.publicKey=t}};L([y(),F("design:type",String)],qa.prototype,"signature",void 0);L([y(),F("design:type",String)],qa.prototype,"publicKey",void 0);qa=L([Y(),F("design:paramtypes",[String,String])],qa);var Sn=class{constructor(e,t){this.domain=e,this.pointers=t}};L([y(),F("design:type",String)],Sn.prototype,"domain",void 0);L([y(),F("design:type",Array)],Sn.prototype,"pointers",void 0);Sn=L([Y(),F("design:paramtypes",[String,Array])],Sn);var Ba=class{constructor(e,t){this.with=e,this.can=t}};L([y(),F("design:type",Sn)],Ba.prototype,"with",void 0);L([y(),F("design:type",Array)],Ba.prototype,"can",void 0);Ba=L([Y(),F("design:paramtypes",[Sn,Array])],Ba);var Mt=class{constructor(e,t,n,i,a){this.appName=e,this.appDesc=t,this.appIconPath=a,this.appUrl=n,this.capabilities=i}};L([y(),F("design:type",String)],Mt.prototype,"appName",void 0);L([y(),F("design:type",String)],Mt.prototype,"appDesc",void 0);L([y(),F("design:type",String)],Mt.prototype,"appUrl",void 0);L([y(),F("design:type",String)],Mt.prototype,"appIconPath",void 0);L([y(),F("design:type",Array)],Mt.prototype,"capabilities",void 0);Mt=L([Y(),F("design:paramtypes",[String,String,String,Array,String])],Mt);var wn=class{constructor(e,t,n,i){this.requestId=e,this.auth=t,this.token=n,this.revoked=i}};L([y(),F("design:type",String)],wn.prototype,"requestId",void 0);L([y(),F("design:type",String)],wn.prototype,"token",void 0);L([y(),F("design:type",Boolean)],wn.prototype,"revoked",void 0);L([y(),F("design:type",Mt)],wn.prototype,"auth",void 0);wn=L([Y(),F("design:paramtypes",[String,Mt,String,Boolean])],wn);var _n=class{constructor(e,t){this.domain=e,this.pointers=t}};L([y(),F("design:type",String)],_n.prototype,"domain",void 0);L([y(),F("design:type",Array)],_n.prototype,"pointers",void 0);_n=L([Ve(),F("design:paramtypes",[String,Array])],_n);var Va=class{constructor(e,t){this.with=e,this.can=t}};L([y(),F("design:type",_n)],Va.prototype,"with",void 0);L([y(),F("design:type",Array)],Va.prototype,"can",void 0);Va=L([Ve(),F("design:paramtypes",[_n,Array])],Va);var or=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([y(),F("design:type",String)],or.prototype,"appName",void 0);L([y(),F("design:type",String)],or.prototype,"appDesc",void 0);L([y(),F("design:type",String)],or.prototype,"appDomain",void 0);L([y(),F("design:type",String)],or.prototype,"appUrl",void 0);L([y(),F("design:type",String)],or.prototype,"appIconPath",void 0);L([y(),F("design:type",Array)],or.prototype,"capabilities",void 0);or=L([Ve(),F("design:paramtypes",[String,String,String,String,String,Array])],or);var xn=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},On=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},ct=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)}};xn([y(),On("design:type",Boolean)],ct.prototype,"isInitialized",void 0);xn([y(),On("design:type",Boolean)],ct.prototype,"isUnlocked",void 0);xn([y(),On("design:type",String)],ct.prototype,"did",void 0);xn([y(),On("design:type",String)],ct.prototype,"didDocument",void 0);xn([y(),On("design:type",String)],ct.prototype,"error",void 0);ct=xn([Y(),On("design:paramtypes",[Object])],ct);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},we=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)},ze,He,Ws=class{constructor(e,t){ze.set(this,void 0),He.set(this,void 0),Kl(this,ze,e,"f"),Kl(this,He,t,"f")}async otherAgents(){return await we(this,ze,"f").otherAgents(we(this,He,"f"))}async hasTelepresenceAdapter(){return await we(this,ze,"f").hasTelepresenceAdapter(we(this,He,"f"))}async onlineAgents(){return await we(this,ze,"f").onlineAgents(we(this,He,"f"))}async setOnlineStatus(e){return await we(this,ze,"f").setOnlineStatus(we(this,He,"f"),e)}async setOnlineStatusU(e){return await we(this,ze,"f").setOnlineStatusU(we(this,He,"f"),e)}async sendSignal(e,t){return await we(this,ze,"f").sendSignal(we(this,He,"f"),e,t)}async sendSignalU(e,t){return await we(this,ze,"f").sendSignalU(we(this,He,"f"),e,t)}async sendBroadcast(e){return await we(this,ze,"f").sendBroadcast(we(this,He,"f"),e)}async sendBroadcastU(e){return await we(this,ze,"f").sendBroadcastU(we(this,He,"f"),e)}async addSignalHandler(e){await we(this,ze,"f").addSignalHandler(we(this,He,"f"),e)}removeSignalHandler(e){we(this,ze,"f").removeSignalHandler(we(this,He,"f"),e)}};ze=new WeakMap,He=new WeakMap;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},Qr=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},rt=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)}};Vr([y(),Qr("design:type",String)],rt.prototype,"source",void 0);Vr([y(),Qr("design:type",String)],rt.prototype,"target",void 0);Vr([y(),Qr("design:type",String)],rt.prototype,"predicate",void 0);Vr([y(),Qr("design:type",Date)],rt.prototype,"fromDate",void 0);Vr([y(),Qr("design:type",Date)],rt.prototype,"untilDate",void 0);Vr([y(),Qr("design:type",Number)],rt.prototype,"limit",void 0);rt=Vr([Y(),Ve(),Qr("design:paramtypes",[Object])],rt);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},Ke=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)},ht,Rt;function Ls(r){return encodeURIComponent(r).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}var Ot=class{constructor(){ht.set(this,void 0),Rt.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 Ot;return zl(t,Rt,e,"f"),t}static from(e){let t=new Ot;return zl(t,ht,e,"f"),t}toUrl(){if(Ke(this,Rt,"f")&&!Ke(this,ht,"f"))return Ke(this,Rt,"f");if(!Ke(this,Rt,"f")&&!Ke(this,ht,"f"))throw new Error("Can't turn empty Literal into URL");let e;switch(typeof Ke(this,ht,"f")){case"string":e=`string:${Ls(Ke(this,ht,"f"))}`;break;case"number":e=`number:${Ls(Ke(this,ht,"f"))}`;break;case"object":e=`json:${Ls(JSON.stringify(Ke(this,ht,"f")))}`;break}return`literal://${e}`}get(){if(Ke(this,ht,"f"))return Ke(this,ht,"f");if(!Ke(this,Rt,"f"))throw new Error("Can't render empty Literal");if(!Ke(this,Rt,"f").startsWith("literal://"))throw new Error("Can't render Literal from non-literal URL");let e=Ke(this,Rt,"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}`)}};ht=new WeakMap,Rt=new WeakMap;function tr(r){return r.charAt(0).toUpperCase()+r.slice(1)}function Cp(r){return`set${tr(r)}`}function $t(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 N1(r){return`add${tr(rc(r))}`}function P1(r){let e=r.substring(3),t=$t(e);return t.charAt(0).toLowerCase()+t.slice(1)}function R1(r){return`remove${tr(rc(r))}`}function L1(r){let e=r.substring(6),t=$t(e);return t.charAt(0).toLowerCase()+t.slice(1)}function F1(r){let e=r.substring(13),t=$t(e);return t.charAt(0).toLowerCase()+t.slice(1)}function $1(r){return`setCollection${tr(rc(r))}`}function Ar(r){if(Array.isArray(r))return`[${r.map(Ar).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},j=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)},je,Ue,ge,Qa=class{constructor(r,e,t){je.set(this,void 0),Ue.set(this,void 0),ge.set(this,void 0),Fs(this,je,e,"f"),Fs(this,Ue,t,"f"),Fs(this,ge,r,"f")}get baseExpression(){return j(this,je,"f")}async init(){let isInstance=await j(this,ge,"f").isSubjectInstance(j(this,je,"f"),j(this,Ue,"f"));if(!isInstance)throw`Not a valid subject instance of ${j(this,Ue,"f")} for ${j(this,je,"f")}`;let results=await j(this,ge,"f").infer(`subject_class("${j(this,Ue,"f")}", C), property(C, Property)`),properties=results.map(r=>r.Property);for(let r of properties){let e=await j(this,ge,"f").infer(`subject_class("${j(this,Ue,"f")}", C), property_resolve(C, "${r}")`);Object.defineProperty(this,r,{configurable:!0,get:async()=>{let t=await j(this,ge,"f").infer(`subject_class("${j(this,Ue,"f")}", C), property_getter(C, "${j(this,je,"f")}", "${r}", Value)`);if(t&&t.length>0){let n=t[0].Value;if(e)try{if(n){let i=await j(this,ge,"f").getExpression(n);try{return JSON.parse(i.data)}catch{return i.data}}else return n}catch{return n}else return n}else return t||void 0}})}let setters=await j(this,ge,"f").infer(`subject_class("${j(this,Ue,"f")}", C), property_setter(C, Property, Setter)`);for(let setter of setters||[])if(setter){let property=setter.Property,actions=eval(setter.Setter),resolveLanguageResults=await j(this,ge,"f").infer(`subject_class("${j(this,Ue,"f")}", C), property_resolve_language(C, "${property}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),this[Cp(property)]=async r=>{resolveLanguage&&(r=await j(this,ge,"f").createExpression(r,resolveLanguage)),await j(this,ge,"f").executeAction(actions,j(this,je,"f"),[{name:"value",value:r}])}}let results2=await j(this,ge,"f").infer(`subject_class("${j(this,Ue,"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 j(this,ge,"f").infer(`subject_class("${j(this,Ue,"f")}", C), collection_getter(C, "${j(this,je,"f")}", "${r}", Value)`);return e&&e.length>0&&e[0].Value?e[0].Value.filter(n=>n!==""&&n!==""):[]}});let adders=await j(this,ge,"f").infer(`subject_class("${j(this,Ue,"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[N1(collection)]=async r=>{Array.isArray(r)?await Promise.all(r.map(e=>j(this,ge,"f").executeAction(actions,j(this,je,"f"),[{name:"value",value:e}]))):await j(this,ge,"f").executeAction(actions,j(this,je,"f"),[{name:"value",value:r}])}}let removers=await j(this,ge,"f").infer(`subject_class("${j(this,Ue,"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[R1(collection)]=async r=>{Array.isArray(r)?await Promise.all(r.map(e=>j(this,ge,"f").executeAction(actions,j(this,je,"f"),[{name:"value",value:e}]))):await j(this,ge,"f").executeAction(actions,j(this,je,"f"),[{name:"value",value:r}])}}let collectionSetters=await j(this,ge,"f").infer(`subject_class("${j(this,Ue,"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[$1(collection)]=async r=>{Array.isArray(r)?await j(this,ge,"f").executeAction(actions,j(this,je,"f"),r.map(e=>({name:"value",value:e}))):await j(this,ge,"f").executeAction(actions,j(this,je,"f"),[{name:"value",value:r}])}}}};je=new WeakMap,Ue=new WeakMap,ge=new WeakMap;var hn=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},P=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)},oe,pe,kr,Dr,Nr,ii,Cn=class{constructor(r,e){oe.set(this,void 0),pe.set(this,void 0),kr.set(this,void 0),Dr.set(this,void 0),Nr.set(this,void 0),ii.set(this,void 0),hn(this,kr,[],"f"),hn(this,Dr,[],"f"),hn(this,Nr,[],"f"),hn(this,ii,[],"f"),hn(this,oe,r,"f"),hn(this,pe,e,"f"),this.uuid=P(this,oe,"f").uuid,this.name=P(this,oe,"f").name,this.sharedUrl=P(this,oe,"f").sharedUrl,this.neighbourhood=P(this,oe,"f").neighbourhood,this.state=P(this,oe,"f").state,P(this,pe,"f").addPerspectiveLinkAddedListener(P(this,oe,"f").uuid,P(this,kr,"f")),P(this,pe,"f").addPerspectiveLinkRemovedListener(P(this,oe,"f").uuid,P(this,Dr,"f")),P(this,pe,"f").addPerspectiveLinkUpdatedListener(P(this,oe,"f").uuid,P(this,Nr,"f")),P(this,pe,"f").addPerspectiveSyncStateChangeListener(P(this,oe,"f").uuid,P(this,ii,"f"))}async executeAction(r,e,t){return await P(this,pe,"f").executeCommands(P(this,oe,"f").uuid,JSON.stringify(r),e,JSON.stringify(t))}async get(r){return await P(this,pe,"f").queryLinks(P(this,oe,"f").uuid,r)}async infer(r){return await P(this,pe,"f").queryProlog(P(this,oe,"f").uuid,r)}async add(r,e="shared"){return await P(this,pe,"f").addLink(P(this,oe,"f").uuid,r,e)}async addLinks(r,e="shared"){return await P(this,pe,"f").addLinks(P(this,oe,"f").uuid,r,e)}async removeLinks(r){return await P(this,pe,"f").removeLinks(P(this,oe,"f").uuid,r)}async linkMutations(r,e="shared"){return await P(this,pe,"f").linkMutations(P(this,oe,"f").uuid,r,e)}async addLinkExpression(r,e="shared"){return await P(this,pe,"f").addLinkExpression(P(this,oe,"f").uuid,r,e)}async update(r,e){return await P(this,pe,"f").updateLink(P(this,oe,"f").uuid,r,e)}async remove(r){return await P(this,pe,"f").removeLink(P(this,oe,"f").uuid,r)}async getExpression(r){return await P(this,pe,"f").getExpression(r)}async createExpression(r,e){return await P(this,pe,"f").createExpression(r,e)}async addListener(r,e){r==="link-added"?P(this,kr,"f").push(e):r==="link-removed"?P(this,Dr,"f").push(e):r==="link-updated"&&P(this,Nr,"f").push(e)}async addSyncStateChangeListener(r){P(this,ii,"f").push(r)}async removeListener(r,e){if(r==="link-added"){let t=P(this,kr,"f").indexOf(e);P(this,kr,"f").splice(t,1)}else if(r==="link-removed"){let t=P(this,Dr,"f").indexOf(e);P(this,Dr,"f").splice(t,1)}else if(r==="link-updated"){let t=P(this,Nr,"f").indexOf(e);P(this,Nr,"f").splice(t,1)}}async snapshot(){return P(this,pe,"f").snapshotByUUID(P(this,oe,"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 rt({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 rt({predicate:"ad4m://sdna"}))).map(e=>e.data.target).map(e=>Ot.fromUrl(e).get())}async addSdna(r,e,t){return P(this,pe,"f").addSdna(P(this,oe,"f").uuid,r,e,t)}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(r,e){let t;if(typeof r=="string")t=r,await P(this,pe,"f").createSubject(P(this,oe,"f").uuid,JSON.stringify({className:t}),e);else{let n=this.buildQueryFromTemplate(r);await P(this,pe,"f").createSubject(P(this,oe,"f").uuid,JSON.stringify({query:n}),e)}return this.getSubjectProxy(e,r)}async getSubjectData(r,e){if(typeof r=="string")return JSON.parse(await P(this,pe,"f").getSubjectData(P(this,oe,"f").uuid,JSON.stringify({className:r}),e));let t=this.buildQueryFromTemplate(r);return JSON.parse(await P(this,pe,"f").getSubjectData(P(this,oe,"f").uuid,JSON.stringify({query:t}),e))}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 Qa(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}buildQueryFromTemplate(r){let e=[],t=[];Object.getPrototypeOf(r).__properties?Object.keys(Object.getPrototypeOf(r).__properties).forEach(c=>e.push(c)):e.push(...Object.keys(r).filter(c=>!Array.isArray(r[c]))),Object.getPrototypeOf(r).__collections?Object.keys(Object.getPrototypeOf(r).__collections).filter(c=>c!=="isSubjectInstance").forEach(c=>!t.includes(c)):t.push(...Object.keys(r).filter(c=>Array.isArray(r[c])).filter(c=>c!=="isSubjectInstance"));let n=Object.getOwnPropertyNames(r).filter(c=>typeof r[c]=="function"&&c.startsWith("set")&&!c.startsWith("setCollection"));n=n.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(c=>typeof r[c]=="function"&&c.startsWith("set")&&!c.startsWith("setCollection")));let i=Object.getOwnPropertyNames(r).filter(c=>typeof r[c]=="function"&&c.startsWith("add"));i=i.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(c=>typeof r[c]=="function"&&c.startsWith("add")));let a=Object.getOwnPropertyNames(r).filter(c=>typeof r[c]=="function"&&c.startsWith("remove"));a=a.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(c=>typeof r[c]=="function"&&c.startsWith("remove")));let o=Object.getOwnPropertyNames(r).filter(c=>typeof r[c]=="function"&&c.startsWith("setCollection"));o=o.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(c=>typeof r[c]=="function"&&c.startsWith("setCollection")));let s="subject_class(Class, C)";for(let c of e)s+=`, property(C, "${c}")`;for(let c of t)s+=`, collection(C, "${c}")`;for(let c of n){let u=c.substring(3);u=u.charAt(0).toLowerCase()+u.slice(1),s+=`, property_setter(C, "${u}", _)`}for(let c of i)s+=`, collection_adder(C, "${P1(c)}", _)`;for(let c of a)s+=`, collection_remover(C, "${L1(c)}", _)`;for(let c of o)s+=`, collection_setter(C, "${F1(c)}", _)`;return s+=".",s}async subjectClassesByTemplate(r){let e=this.buildQueryFromTemplate(r),t=await this.infer(e);return t?t.map(n=>n.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 P(this,pe,"f").getNeighbourhoodProxy(P(this,oe,"f").uuid)}};oe=new WeakMap,pe=new WeakMap,kr=new WeakMap,Dr=new WeakMap,Nr=new WeakMap,ii=new WeakMap;var Or=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},G=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)},ne,ai,oi,si,Aa,ci,ka,et=`
|
|
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)}),Fa(Fa({},r),{definitions:t})}function E1(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 x1(r){var e=bp(r);if(!Aa.has(e)){var t=C1(r,{experimentalFragmentVariables:$a,allowLegacyFragmentVariables:$a});if(!t||t.kind!=="Document")throw new Error("Not a valid GraphQL document.");Aa.set(e,E1(_1(t)))}return Aa.get(e)}function w(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]}),x1(n)}function O1(){Aa.clear(),qs.clear()}function T1(){vp=!1}function I1(){$a=!0}function A1(){$a=!1}var ti={gql:w,resetCaches:O1,disableFragmentWarnings:T1,enableExperimentalFragmentVariables:I1,disableExperimentalFragmentVariables:A1};(function(r){r.gql=ti.gql,r.resetCaches=ti.resetCaches,r.disableFragmentWarnings=ti.disableFragmentWarnings,r.enableExperimentalFragmentVariables=ti.enableExperimentalFragmentVariables,r.disableExperimentalFragmentVariables=ti.disableExperimentalFragmentVariables})(w||(w={}));w.default=w;function O(r){if(!r)throw"Got no result from Apollo";if(r.error)throw r.error;if(r.errors)throw r.errors;return r.data}function k1(){}function tc(){return k1}var y=tc,Ve=tc,Y=tc,Cp=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},Sp=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},$r=class{constructor(e){this.code=e}};Cp([y(),Sp("design:type",String)],$r.prototype,"code",void 0);$r=Cp([Y(),Sp("design:paramtypes",[String])],$r);var rc=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},nc=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},xt=class{constructor(e,t){this.address=e,this.name=t}};rc([y(),nc("design:type",String)],xt.prototype,"address",void 0);rc([y(),nc("design:type",String)],xt.prototype,"name",void 0);xt=rc([Y(),nc("design:paramtypes",[String,String])],xt);var de=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)},rr=class{constructor(e,t){this.key=t,this.signature=e}};de([y(),Te("design:type",String)],rr.prototype,"signature",void 0);de([y(),Te("design:type",String)],rr.prototype,"key",void 0);de([y(),Te("design:type",Boolean)],rr.prototype,"valid",void 0);de([y(),Te("design:type",Boolean)],rr.prototype,"invalid",void 0);rr=de([Y(),Ve(),Te("design:paramtypes",[String,String])],rr);var Mr=class{};de([y(),Te("design:type",String)],Mr.prototype,"signature",void 0);de([y(),Te("design:type",String)],Mr.prototype,"key",void 0);de([y(),Te("design:type",Boolean)],Mr.prototype,"valid",void 0);de([y(),Te("design:type",Boolean)],Mr.prototype,"invalid",void 0);Mr=de([Ve()],Mr);function cr(r){let e=class{constructor(n,i,a,o){this.author=n,this.timestamp=i,this.data=a,this.proof=o}};return de([y(),Te("design:type",String)],e.prototype,"author",void 0),de([y(),Te("design:type",String)],e.prototype,"timestamp",void 0),de([y(),Te("design:type",Object)],e.prototype,"data",void 0),de([y(),Te("design:type",rr)],e.prototype,"proof",void 0),e=de([Y(),Te("design:paramtypes",[String,String,Object,rr])],e),e}function D1(r){let e=class{};return de([y(),Te("design:type",String)],e.prototype,"author",void 0),de([y(),Te("design:type",String)],e.prototype,"timestamp",void 0),de([y(),Te("design:type",Object)],e.prototype,"data",void 0),de([y(),Te("design:type",Mr)],e.prototype,"proof",void 0),e=de([Ve()],e),e}var Kl=class extends cr(){};Kl=de([Y()],Kl);var Ma=class extends cr(){};de([y(),Te("design:type",xt)],Ma.prototype,"language",void 0);de([y(),Te("design:type",$r)],Ma.prototype,"icon",void 0);Ma=de([Y()],Ma);function Ty(r){return r&&r.author&&r.timestamp&&r.data}var xe=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},Le=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},jr=class{constructor(e){this.source=e.source?e.source:"",this.target=e.target?e.target:"",this.predicate=e.predicate?e.predicate:""}};xe([y(),Le("design:type",String)],jr.prototype,"source",void 0);xe([y(),Le("design:type",String)],jr.prototype,"target",void 0);xe([y(),Le("design:type",String)],jr.prototype,"predicate",void 0);jr=xe([Y(),Le("design:paramtypes",[Object])],jr);var ja=class{};xe([y(),Le("design:type",Array)],ja.prototype,"additions",void 0);xe([y(),Le("design:type",Array)],ja.prototype,"removals",void 0);ja=xe([Ve()],ja);var Ua=class{constructor(e,t){this.additions=e,this.removals=t}};xe([y(),Le("design:type",Array)],Ua.prototype,"additions",void 0);xe([y(),Le("design:type",Array)],Ua.prototype,"removals",void 0);Ua=xe([Y(),Le("design:paramtypes",[Array,Array])],Ua);var wi=class{};xe([y(),Le("design:type",String)],wi.prototype,"source",void 0);xe([y(),Le("design:type",String)],wi.prototype,"target",void 0);xe([y(),Le("design:type",String)],wi.prototype,"predicate",void 0);wi=xe([Ve()],wi);var Ur=class extends cr(){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}};xe([y(),Le("design:type",String)],Ur.prototype,"status",void 0);Ur=xe([Y()],Ur);var Bs=class extends D1(){};xe([y(),Le("design:type",String)],Bs.prototype,"status",void 0);Bs=xe([Ve()],Bs);function Ry(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 Ly(r){return r&&r.source&&r.target}var qa=class{constructor(e,t){this.oldLink=e,this.newLink=t}};xe([y(),Le("design:type",Ur)],qa.prototype,"oldLink",void 0);xe([y(),Le("design:type",Ur)],qa.prototype,"newLink",void 0);qa=xe([Y(),Le("design:paramtypes",[Ur,Ur])],qa);var Br=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},Oi=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Vs,nr=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}};Br([y(),Oi("design:type",Array)],nr.prototype,"links",void 0);nr=Br([Y(),Oi("design:paramtypes",[Array])],nr);var Qs=class{};Br([y(),Oi("design:type",Array)],Qs.prototype,"links",void 0);Qs=Br([Ve()],Qs);var Gs=Vs=class{constructor(e){e?this.links=e:this.links=[]}static fromLink(e){let t=new Vs;return t.links.push(e),t}};Br([y(),Oi("design:type",Array)],Gs.prototype,"links",void 0);Gs=Vs=Br([Ve(),Oi("design:paramtypes",[Array])],Gs);var Ws=class extends cr(){};Ws=Br([Y()],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},F=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},er=class{constructor(e,t){this.did=e,t?this.perspective=t:this.perspective=new nr}};L([y(),F("design:type",String)],er.prototype,"did",void 0);L([y(),F("design:type",nr)],er.prototype,"perspective",void 0);L([y(),F("design:type",String)],er.prototype,"directMessageLanguage",void 0);er=L([Y(),F("design:paramtypes",[String,nr])],er);var zl=class extends cr(){};zl=L([Y()],zl);var ir=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([y(),F("design:type",String)],ir.prototype,"did",void 0);L([y(),F("design:type",String)],ir.prototype,"didSigningKeyId",void 0);L([y(),F("design:type",String)],ir.prototype,"deviceKeyType",void 0);L([y(),F("design:type",String)],ir.prototype,"deviceKey",void 0);L([y(),F("design:type",String)],ir.prototype,"deviceKeySignedByDid",void 0);L([y(),F("design:type",String)],ir.prototype,"didSignedByDeviceKey",void 0);ir=L([Y(),F("design:paramtypes",[String,String,String,String,String,String])],ir);var ar=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([y(),F("design:type",String)],ar.prototype,"did",void 0);L([y(),F("design:type",String)],ar.prototype,"didSigningKeyId",void 0);L([y(),F("design:type",String)],ar.prototype,"deviceKeyType",void 0);L([y(),F("design:type",String)],ar.prototype,"deviceKey",void 0);L([y(),F("design:type",String)],ar.prototype,"deviceKeySignedByDid",void 0);L([y(),F("design:type",String)],ar.prototype,"didSignedByDeviceKey",void 0);ar=L([Ve(),F("design:paramtypes",[String,String,String,String,String,String])],ar);var Ba=class{constructor(e,t){this.signature=e,this.publicKey=t}};L([y(),F("design:type",String)],Ba.prototype,"signature",void 0);L([y(),F("design:type",String)],Ba.prototype,"publicKey",void 0);Ba=L([Y(),F("design:paramtypes",[String,String])],Ba);var Sn=class{constructor(e,t){this.domain=e,this.pointers=t}};L([y(),F("design:type",String)],Sn.prototype,"domain",void 0);L([y(),F("design:type",Array)],Sn.prototype,"pointers",void 0);Sn=L([Y(),F("design:paramtypes",[String,Array])],Sn);var Va=class{constructor(e,t){this.with=e,this.can=t}};L([y(),F("design:type",Sn)],Va.prototype,"with",void 0);L([y(),F("design:type",Array)],Va.prototype,"can",void 0);Va=L([Y(),F("design:paramtypes",[Sn,Array])],Va);var Mt=class{constructor(e,t,n,i,a){this.appName=e,this.appDesc=t,this.appIconPath=a,this.appUrl=n,this.capabilities=i}};L([y(),F("design:type",String)],Mt.prototype,"appName",void 0);L([y(),F("design:type",String)],Mt.prototype,"appDesc",void 0);L([y(),F("design:type",String)],Mt.prototype,"appUrl",void 0);L([y(),F("design:type",String)],Mt.prototype,"appIconPath",void 0);L([y(),F("design:type",Array)],Mt.prototype,"capabilities",void 0);Mt=L([Y(),F("design:paramtypes",[String,String,String,Array,String])],Mt);var wn=class{constructor(e,t,n,i){this.requestId=e,this.auth=t,this.token=n,this.revoked=i}};L([y(),F("design:type",String)],wn.prototype,"requestId",void 0);L([y(),F("design:type",String)],wn.prototype,"token",void 0);L([y(),F("design:type",Boolean)],wn.prototype,"revoked",void 0);L([y(),F("design:type",Mt)],wn.prototype,"auth",void 0);wn=L([Y(),F("design:paramtypes",[String,Mt,String,Boolean])],wn);var _n=class{constructor(e,t){this.domain=e,this.pointers=t}};L([y(),F("design:type",String)],_n.prototype,"domain",void 0);L([y(),F("design:type",Array)],_n.prototype,"pointers",void 0);_n=L([Ve(),F("design:paramtypes",[String,Array])],_n);var Qa=class{constructor(e,t){this.with=e,this.can=t}};L([y(),F("design:type",_n)],Qa.prototype,"with",void 0);L([y(),F("design:type",Array)],Qa.prototype,"can",void 0);Qa=L([Ve(),F("design:paramtypes",[_n,Array])],Qa);var or=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([y(),F("design:type",String)],or.prototype,"appName",void 0);L([y(),F("design:type",String)],or.prototype,"appDesc",void 0);L([y(),F("design:type",String)],or.prototype,"appDomain",void 0);L([y(),F("design:type",String)],or.prototype,"appUrl",void 0);L([y(),F("design:type",String)],or.prototype,"appIconPath",void 0);L([y(),F("design:type",Array)],or.prototype,"capabilities",void 0);or=L([Ve(),F("design:paramtypes",[String,String,String,String,String,Array])],or);var xn=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},On=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},ct=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)}};xn([y(),On("design:type",Boolean)],ct.prototype,"isInitialized",void 0);xn([y(),On("design:type",Boolean)],ct.prototype,"isUnlocked",void 0);xn([y(),On("design:type",String)],ct.prototype,"did",void 0);xn([y(),On("design:type",String)],ct.prototype,"didDocument",void 0);xn([y(),On("design:type",String)],ct.prototype,"error",void 0);ct=xn([Y(),On("design:paramtypes",[Object])],ct);var Hl=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},we=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)},ze,He,Ks=class{constructor(e,t){ze.set(this,void 0),He.set(this,void 0),Hl(this,ze,e,"f"),Hl(this,He,t,"f")}async otherAgents(){return await we(this,ze,"f").otherAgents(we(this,He,"f"))}async hasTelepresenceAdapter(){return await we(this,ze,"f").hasTelepresenceAdapter(we(this,He,"f"))}async onlineAgents(){return await we(this,ze,"f").onlineAgents(we(this,He,"f"))}async setOnlineStatus(e){return await we(this,ze,"f").setOnlineStatus(we(this,He,"f"),e)}async setOnlineStatusU(e){return await we(this,ze,"f").setOnlineStatusU(we(this,He,"f"),e)}async sendSignal(e,t){return await we(this,ze,"f").sendSignal(we(this,He,"f"),e,t)}async sendSignalU(e,t){return await we(this,ze,"f").sendSignalU(we(this,He,"f"),e,t)}async sendBroadcast(e){return await we(this,ze,"f").sendBroadcast(we(this,He,"f"),e)}async sendBroadcastU(e){return await we(this,ze,"f").sendBroadcastU(we(this,He,"f"),e)}async addSignalHandler(e){await we(this,ze,"f").addSignalHandler(we(this,He,"f"),e)}removeSignalHandler(e){we(this,ze,"f").removeSignalHandler(we(this,He,"f"),e)}};ze=new WeakMap,He=new WeakMap;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},Qr=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},rt=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)}};Vr([y(),Qr("design:type",String)],rt.prototype,"source",void 0);Vr([y(),Qr("design:type",String)],rt.prototype,"target",void 0);Vr([y(),Qr("design:type",String)],rt.prototype,"predicate",void 0);Vr([y(),Qr("design:type",Date)],rt.prototype,"fromDate",void 0);Vr([y(),Qr("design:type",Date)],rt.prototype,"untilDate",void 0);Vr([y(),Qr("design:type",Number)],rt.prototype,"limit",void 0);rt=Vr([Y(),Ve(),Qr("design:paramtypes",[Object])],rt);var Jl=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},Ke=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)},ht,Rt;function Fs(r){return encodeURIComponent(r).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}var Ot=class{constructor(){ht.set(this,void 0),Rt.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 Ot;return Jl(t,Rt,e,"f"),t}static from(e){let t=new Ot;return Jl(t,ht,e,"f"),t}toUrl(){if(Ke(this,Rt,"f")&&!Ke(this,ht,"f"))return Ke(this,Rt,"f");if(!Ke(this,Rt,"f")&&!Ke(this,ht,"f"))throw new Error("Can't turn empty Literal into URL");let e;switch(typeof Ke(this,ht,"f")){case"string":e=`string:${Fs(Ke(this,ht,"f"))}`;break;case"number":e=`number:${Fs(Ke(this,ht,"f"))}`;break;case"object":e=`json:${Fs(JSON.stringify(Ke(this,ht,"f")))}`;break}return`literal://${e}`}get(){if(Ke(this,ht,"f"))return Ke(this,ht,"f");if(!Ke(this,Rt,"f"))throw new Error("Can't render empty Literal");if(!Ke(this,Rt,"f").startsWith("literal://"))throw new Error("Can't render Literal from non-literal URL");let e=Ke(this,Rt,"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}`)}};ht=new WeakMap,Rt=new WeakMap;function tr(r){return r.charAt(0).toUpperCase()+r.slice(1)}function wp(r){return`set${tr(r)}`}function $t(r){return r.endsWith("y")?r.slice(0,-1)+"ies":r+"s"}function ic(r){return r.endsWith("ies")?r.slice(0,-3)+"y":r.endsWith("s")?r.slice(0,-1):r}function N1(r){return`add${tr(ic(r))}`}function P1(r){let e=r.substring(3),t=$t(e);return t.charAt(0).toLowerCase()+t.slice(1)}function R1(r){return`remove${tr(ic(r))}`}function L1(r){let e=r.substring(6),t=$t(e);return t.charAt(0).toLowerCase()+t.slice(1)}function F1(r){let e=r.substring(13),t=$t(e);return t.charAt(0).toLowerCase()+t.slice(1)}function $1(r){return`setCollection${tr(ic(r))}`}function Ar(r){if(Array.isArray(r))return`[${r.map(Ar).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 $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},j=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)},je,Ue,ge,Ga=class{constructor(r,e,t){je.set(this,void 0),Ue.set(this,void 0),ge.set(this,void 0),$s(this,je,e,"f"),$s(this,Ue,t,"f"),$s(this,ge,r,"f")}get baseExpression(){return j(this,je,"f")}async init(){let isInstance=await j(this,ge,"f").isSubjectInstance(j(this,je,"f"),j(this,Ue,"f"));if(!isInstance)throw`Not a valid subject instance of ${j(this,Ue,"f")} for ${j(this,je,"f")}`;let results=await j(this,ge,"f").infer(`subject_class("${j(this,Ue,"f")}", C), property(C, Property)`),properties=results.map(r=>r.Property);for(let r of properties){let e=await j(this,ge,"f").infer(`subject_class("${j(this,Ue,"f")}", C), property_resolve(C, "${r}")`);Object.defineProperty(this,r,{configurable:!0,get:async()=>{let t=await j(this,ge,"f").infer(`subject_class("${j(this,Ue,"f")}", C), property_getter(C, "${j(this,je,"f")}", "${r}", Value)`);if(t&&t.length>0){let n=t[0].Value;if(e)try{if(n){let i=await j(this,ge,"f").getExpression(n);try{return JSON.parse(i.data)}catch{return i.data}}else return n}catch{return n}else return n}else return t||void 0}})}let setters=await j(this,ge,"f").infer(`subject_class("${j(this,Ue,"f")}", C), property_setter(C, Property, Setter)`);for(let setter of setters||[])if(setter){let property=setter.Property,actions=eval(setter.Setter),resolveLanguageResults=await j(this,ge,"f").infer(`subject_class("${j(this,Ue,"f")}", C), property_resolve_language(C, "${property}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),this[wp(property)]=async r=>{resolveLanguage&&(r=await j(this,ge,"f").createExpression(r,resolveLanguage)),await j(this,ge,"f").executeAction(actions,j(this,je,"f"),[{name:"value",value:r}])}}let results2=await j(this,ge,"f").infer(`subject_class("${j(this,Ue,"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 j(this,ge,"f").infer(`subject_class("${j(this,Ue,"f")}", C), collection_getter(C, "${j(this,je,"f")}", "${r}", Value)`);return e&&e.length>0&&e[0].Value?e[0].Value.filter(n=>n!==""&&n!==""):[]}});let adders=await j(this,ge,"f").infer(`subject_class("${j(this,Ue,"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[N1(collection)]=async r=>{Array.isArray(r)?await Promise.all(r.map(e=>j(this,ge,"f").executeAction(actions,j(this,je,"f"),[{name:"value",value:e}]))):await j(this,ge,"f").executeAction(actions,j(this,je,"f"),[{name:"value",value:r}])}}let removers=await j(this,ge,"f").infer(`subject_class("${j(this,Ue,"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[R1(collection)]=async r=>{Array.isArray(r)?await Promise.all(r.map(e=>j(this,ge,"f").executeAction(actions,j(this,je,"f"),[{name:"value",value:e}]))):await j(this,ge,"f").executeAction(actions,j(this,je,"f"),[{name:"value",value:r}])}}let collectionSetters=await j(this,ge,"f").infer(`subject_class("${j(this,Ue,"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[$1(collection)]=async r=>{Array.isArray(r)?await j(this,ge,"f").executeAction(actions,j(this,je,"f"),r.map(e=>({name:"value",value:e}))):await j(this,ge,"f").executeAction(actions,j(this,je,"f"),[{name:"value",value:r}])}}}};je=new WeakMap,Ue=new WeakMap,ge=new WeakMap;var hn=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},P=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)},oe,pe,kr,Dr,Nr,ai,Cn=class{constructor(r,e){oe.set(this,void 0),pe.set(this,void 0),kr.set(this,void 0),Dr.set(this,void 0),Nr.set(this,void 0),ai.set(this,void 0),hn(this,kr,[],"f"),hn(this,Dr,[],"f"),hn(this,Nr,[],"f"),hn(this,ai,[],"f"),hn(this,oe,r,"f"),hn(this,pe,e,"f"),this.uuid=P(this,oe,"f").uuid,this.name=P(this,oe,"f").name,this.sharedUrl=P(this,oe,"f").sharedUrl,this.neighbourhood=P(this,oe,"f").neighbourhood,this.state=P(this,oe,"f").state,P(this,pe,"f").addPerspectiveLinkAddedListener(P(this,oe,"f").uuid,P(this,kr,"f")),P(this,pe,"f").addPerspectiveLinkRemovedListener(P(this,oe,"f").uuid,P(this,Dr,"f")),P(this,pe,"f").addPerspectiveLinkUpdatedListener(P(this,oe,"f").uuid,P(this,Nr,"f")),P(this,pe,"f").addPerspectiveSyncStateChangeListener(P(this,oe,"f").uuid,P(this,ai,"f"))}async executeAction(r,e,t){return await P(this,pe,"f").executeCommands(P(this,oe,"f").uuid,JSON.stringify(r),e,JSON.stringify(t))}async get(r){return await P(this,pe,"f").queryLinks(P(this,oe,"f").uuid,r)}async infer(r){return await P(this,pe,"f").queryProlog(P(this,oe,"f").uuid,r)}async add(r,e="shared"){return await P(this,pe,"f").addLink(P(this,oe,"f").uuid,r,e)}async addLinks(r,e="shared"){return await P(this,pe,"f").addLinks(P(this,oe,"f").uuid,r,e)}async removeLinks(r){return await P(this,pe,"f").removeLinks(P(this,oe,"f").uuid,r)}async linkMutations(r,e="shared"){return await P(this,pe,"f").linkMutations(P(this,oe,"f").uuid,r,e)}async addLinkExpression(r,e="shared"){return await P(this,pe,"f").addLinkExpression(P(this,oe,"f").uuid,r,e)}async update(r,e){return await P(this,pe,"f").updateLink(P(this,oe,"f").uuid,r,e)}async remove(r){return await P(this,pe,"f").removeLink(P(this,oe,"f").uuid,r)}async getExpression(r){return await P(this,pe,"f").getExpression(r)}async createExpression(r,e){return await P(this,pe,"f").createExpression(r,e)}async addListener(r,e){r==="link-added"?P(this,kr,"f").push(e):r==="link-removed"?P(this,Dr,"f").push(e):r==="link-updated"&&P(this,Nr,"f").push(e)}async addSyncStateChangeListener(r){P(this,ai,"f").push(r)}async removeListener(r,e){if(r==="link-added"){let t=P(this,kr,"f").indexOf(e);P(this,kr,"f").splice(t,1)}else if(r==="link-removed"){let t=P(this,Dr,"f").indexOf(e);P(this,Dr,"f").splice(t,1)}else if(r==="link-updated"){let t=P(this,Nr,"f").indexOf(e);P(this,Nr,"f").splice(t,1)}}async snapshot(){return P(this,pe,"f").snapshotByUUID(P(this,oe,"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 rt({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 rt({predicate:"ad4m://sdna"}))).map(e=>e.data.target).map(e=>Ot.fromUrl(e).get())}async addSdna(r,e,t){return P(this,pe,"f").addSdna(P(this,oe,"f").uuid,r,e,t)}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(r,e){let t;if(typeof r=="string")t=r,await P(this,pe,"f").createSubject(P(this,oe,"f").uuid,JSON.stringify({className:t}),e);else{let n=this.buildQueryFromTemplate(r);await P(this,pe,"f").createSubject(P(this,oe,"f").uuid,JSON.stringify({query:n}),e)}return this.getSubjectProxy(e,r)}async getSubjectData(r,e){if(typeof r=="string")return JSON.parse(await P(this,pe,"f").getSubjectData(P(this,oe,"f").uuid,JSON.stringify({className:r}),e));let t=this.buildQueryFromTemplate(r);return JSON.parse(await P(this,pe,"f").getSubjectData(P(this,oe,"f").uuid,JSON.stringify({query:t}),e))}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 Ga(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}buildQueryFromTemplate(r){let e=[],t=[];Object.getPrototypeOf(r).__properties?Object.keys(Object.getPrototypeOf(r).__properties).forEach(c=>e.push(c)):e.push(...Object.keys(r).filter(c=>!Array.isArray(r[c]))),Object.getPrototypeOf(r).__collections?Object.keys(Object.getPrototypeOf(r).__collections).filter(c=>c!=="isSubjectInstance").forEach(c=>!t.includes(c)):t.push(...Object.keys(r).filter(c=>Array.isArray(r[c])).filter(c=>c!=="isSubjectInstance"));let n=Object.getOwnPropertyNames(r).filter(c=>typeof r[c]=="function"&&c.startsWith("set")&&!c.startsWith("setCollection"));n=n.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(c=>typeof r[c]=="function"&&c.startsWith("set")&&!c.startsWith("setCollection")));let i=Object.getOwnPropertyNames(r).filter(c=>typeof r[c]=="function"&&c.startsWith("add"));i=i.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(c=>typeof r[c]=="function"&&c.startsWith("add")));let a=Object.getOwnPropertyNames(r).filter(c=>typeof r[c]=="function"&&c.startsWith("remove"));a=a.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(c=>typeof r[c]=="function"&&c.startsWith("remove")));let o=Object.getOwnPropertyNames(r).filter(c=>typeof r[c]=="function"&&c.startsWith("setCollection"));o=o.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(c=>typeof r[c]=="function"&&c.startsWith("setCollection")));let s="subject_class(Class, C)";for(let c of e)s+=`, property(C, "${c}")`;for(let c of t)s+=`, collection(C, "${c}")`;for(let c of n){let u=c.substring(3);u=u.charAt(0).toLowerCase()+u.slice(1),s+=`, property_setter(C, "${u}", _)`}for(let c of i)s+=`, collection_adder(C, "${P1(c)}", _)`;for(let c of a)s+=`, collection_remover(C, "${L1(c)}", _)`;for(let c of o)s+=`, collection_setter(C, "${F1(c)}", _)`;return s+=".",s}async subjectClassesByTemplate(r){let e=this.buildQueryFromTemplate(r),t=await this.infer(e);return t?t.map(n=>n.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 P(this,pe,"f").getNeighbourhoodProxy(P(this,oe,"f").uuid)}};oe=new WeakMap,pe=new WeakMap,kr=new WeakMap,Dr=new WeakMap,Nr=new WeakMap,ai=new WeakMap;var Or=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},G=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)},ne,oi,si,ci,ka,ui,Da,et=`
|
|
64
64
|
author
|
|
65
65
|
timestamp
|
|
66
66
|
status
|
|
@@ -86,7 +86,7 @@ neighbourhood {
|
|
|
86
86
|
}
|
|
87
87
|
author
|
|
88
88
|
}
|
|
89
|
-
`,
|
|
89
|
+
`,Wa=class{constructor(e,t=!0){ne.set(this,void 0),oi.set(this,void 0),si.set(this,void 0),ci.set(this,void 0),ka.set(this,void 0),ui.set(this,void 0),Da.set(this,void 0),Or(this,ne,e,"f"),Or(this,oi,[],"f"),Or(this,si,[],"f"),Or(this,ci,[],"f"),Or(this,ka,[],"f"),t&&(this.subscribePerspectiveAdded(),this.subscribePerspectiveUpdated(),this.subscribePerspectiveRemoved())}setExpressionClient(e){Or(this,ui,e,"f")}setNeighbourhoodClient(e){Or(this,Da,e,"f")}async all(){let{perspectives:e}=O(await G(this,ne,"f").query({query:w`query perspectives {
|
|
90
90
|
perspectives {
|
|
91
91
|
${mn}
|
|
92
92
|
}
|
|
@@ -163,19 +163,19 @@ neighbourhood {
|
|
|
163
163
|
perspectiveCreateSubject(uuid: $uuid, subjectClass: $subjectClass, expressionAddress: $expressionAddress)
|
|
164
164
|
}`,variables:{uuid:e,subjectClass:t,expressionAddress:n}})).perspectiveCreateSubject}async getSubjectData(e,t,n){return O(await G(this,ne,"f").mutate({mutation:w`mutation perspectiveGetSubjectData($uuid: String!, $subjectClass: String!, $expressionAddress: String!) {
|
|
165
165
|
perspectiveGetSubjectData(uuid: $uuid, subjectClass: $subjectClass, expressionAddress: $expressionAddress)
|
|
166
|
-
}`,variables:{uuid:e,subjectClass:t,expressionAddress:n}})).perspectiveGetSubjectData}async getExpression(e){return await G(this,
|
|
166
|
+
}`,variables:{uuid:e,subjectClass:t,expressionAddress:n}})).perspectiveGetSubjectData}async getExpression(e){return await G(this,ui,"f").get(e)}async createExpression(e,t){return await G(this,ui,"f").create(e,t)}addPerspectiveAddedListener(e){G(this,oi,"f").push(e)}subscribePerspectiveAdded(){G(this,ne,"f").subscribe({query:w` subscription {
|
|
167
167
|
perspectiveAdded { ${mn} }
|
|
168
168
|
}
|
|
169
|
-
`}).subscribe({next:e=>{G(this,
|
|
169
|
+
`}).subscribe({next:e=>{G(this,oi,"f").forEach(t=>{t(e.data.perspectiveAdded)})},error:e=>console.error(e)})}addPerspectiveUpdatedListener(e){G(this,si,"f").push(e)}subscribePerspectiveUpdated(){G(this,ne,"f").subscribe({query:w` subscription {
|
|
170
170
|
perspectiveUpdated { ${mn} }
|
|
171
171
|
}
|
|
172
|
-
`}).subscribe({next:e=>{G(this,
|
|
172
|
+
`}).subscribe({next:e=>{G(this,si,"f").forEach(t=>{t(e.data.perspectiveUpdated)})},error:e=>console.error(e)})}addPerspectiveSyncedListener(e){G(this,ka,"f").push(e)}async addPerspectiveSyncStateChangeListener(e,t){G(this,ne,"f").subscribe({query:w` subscription {
|
|
173
173
|
perspectiveSyncStateChange(uuid: "${e}")
|
|
174
174
|
}
|
|
175
|
-
`}).subscribe({next:n=>{t.forEach(i=>{i(n.data.perspectiveSyncStateChange)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}addPerspectiveRemovedListener(e){G(this,
|
|
175
|
+
`}).subscribe({next:n=>{t.forEach(i=>{i(n.data.perspectiveSyncStateChange)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}addPerspectiveRemovedListener(e){G(this,ci,"f").push(e)}subscribePerspectiveRemoved(){G(this,ne,"f").subscribe({query:w` subscription {
|
|
176
176
|
perspectiveRemoved
|
|
177
177
|
}
|
|
178
|
-
`}).subscribe({next:e=>{G(this,
|
|
178
|
+
`}).subscribe({next:e=>{G(this,ci,"f").forEach(t=>{t(e.data.perspectiveRemoved)})},error:e=>console.error(e)})}async addPerspectiveLinkAddedListener(e,t){G(this,ne,"f").subscribe({query:w` subscription {
|
|
179
179
|
perspectiveLinkAdded(uuid: "${e}") { ${et} }
|
|
180
180
|
}
|
|
181
181
|
`}).subscribe({next:n=>{t.forEach(i=>{i(n.data.perspectiveLinkAdded)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}async addPerspectiveLinkRemovedListener(e,t){G(this,ne,"f").subscribe({query:w` subscription {
|
|
@@ -191,7 +191,7 @@ neighbourhood {
|
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
|
-
`}).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
|
|
194
|
+
`}).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(G(this,Da,"f"),e)}};ne=new WeakMap,oi=new WeakMap,si=new WeakMap,ci=new WeakMap,ka=new WeakMap,ui=new WeakMap,Da=new WeakMap;var ba=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)},se,li,pi,fi,ri=`
|
|
195
195
|
did
|
|
196
196
|
directMessageLanguage
|
|
197
197
|
perspective {
|
|
@@ -205,7 +205,7 @@ neighbourhood {
|
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
|
-
`,
|
|
208
|
+
`,Ca=`
|
|
209
209
|
requestId
|
|
210
210
|
revoked
|
|
211
211
|
auth {
|
|
@@ -227,7 +227,7 @@ neighbourhood {
|
|
|
227
227
|
did
|
|
228
228
|
didDocument
|
|
229
229
|
error
|
|
230
|
-
`,
|
|
230
|
+
`,Sa=`
|
|
231
231
|
did
|
|
232
232
|
didSigningKeyId
|
|
233
233
|
deviceKeyType
|
|
@@ -237,7 +237,7 @@ neighbourhood {
|
|
|
237
237
|
`,M1=`
|
|
238
238
|
signature
|
|
239
239
|
publicKey
|
|
240
|
-
`,
|
|
240
|
+
`,_i=class{constructor(e,t=!0){se.set(this,void 0),li.set(this,void 0),pi.set(this,void 0),fi.set(this,void 0),ba(this,se,e,"f"),ba(this,pi,[],"f"),ba(this,fi,[],"f"),ba(this,li,[],"f"),t&&(this.subscribeAgentUpdated(),this.subscribeAgentStatusChanged(),this.subscribeAppsChanged())}async me(){let{agent:e}=O(await Z(this,se,"f").query({query:w`query agent { agent { ${ri} } }`})),t=new er(e.did,e.perspective);return t.directMessageLanguage=e.directMessageLanguage,t}async status(){let{agentStatus:e}=O(await Z(this,se,"f").query({query:w`query agentStatus {
|
|
241
241
|
agentStatus {
|
|
242
242
|
${gn}
|
|
243
243
|
}
|
|
@@ -272,38 +272,38 @@ neighbourhood {
|
|
|
272
272
|
agentUpdatePublicPerspective(perspective: $perspective) {
|
|
273
273
|
${ri}
|
|
274
274
|
}
|
|
275
|
-
}`,variables:{perspective:t}})),i=n,a=new er(i.did,i.perspective);return a.directMessageLanguage=i.directMessageLanguage,a}async mutatePublicPerspective(e){let t=new
|
|
275
|
+
}`,variables:{perspective:t}})),i=n,a=new er(i.did,i.perspective);return a.directMessageLanguage=i.directMessageLanguage,a}async mutatePublicPerspective(e){let t=new Wa(Z(this,se,"f")),n=new _i(Z(this,se,"f")),i=await t.add("Agent Perspective Proxy"),a=await n.me();a.perspective&&await i.loadSnapshot(a.perspective);for(let c of e.additions)await i.add(c);for(let c of e.removals)await i.remove(c);let o=await i.snapshot(),s=await this.updatePublicPerspective(o);return await t.remove(i.uuid),s}async updateDirectMessageLanguage(e){let{agentUpdateDirectMessageLanguage:t}=O(await Z(this,se,"f").mutate({mutation:w`mutation agentUpdateDirectMessageLanguage($directMessageLanguage: String!) {
|
|
276
276
|
agentUpdateDirectMessageLanguage(directMessageLanguage: $directMessageLanguage) {
|
|
277
277
|
${ri}
|
|
278
278
|
}
|
|
279
279
|
}`,variables:{directMessageLanguage:e}})),n=t,i=new er(n.did,n.perspective);return i.directMessageLanguage=n.directMessageLanguage,i}async addEntanglementProofs(e){let{agentAddEntanglementProofs:t}=O(await Z(this,se,"f").mutate({mutation:w`mutation agentAddEntanglementProofs($proofs: [EntanglementProofInput!]!) {
|
|
280
280
|
agentAddEntanglementProofs(proofs: $proofs) {
|
|
281
|
-
${
|
|
281
|
+
${Sa}
|
|
282
282
|
}
|
|
283
283
|
}`,variables:{proofs:e}}));return t}async deleteEntanglementProofs(e){let{agentDeleteEntanglementProofs:t}=O(await Z(this,se,"f").mutate({mutation:w`mutation agentDeleteEntanglementProofs($proofs: [EntanglementProofInput!]!) {
|
|
284
284
|
agentDeleteEntanglementProofs(proofs: $proofs) {
|
|
285
|
-
${
|
|
285
|
+
${Sa}
|
|
286
286
|
}
|
|
287
287
|
}`,variables:{proofs:e}}));return t}async getEntanglementProofs(){let{agentGetEntanglementProofs:e}=O(await Z(this,se,"f").query({query:w`query agentGetEntanglementProofs {
|
|
288
288
|
agentGetEntanglementProofs {
|
|
289
|
-
${
|
|
289
|
+
${Sa}
|
|
290
290
|
}
|
|
291
291
|
}`}));return e}async entanglementProofPreFlight(e,t){let{agentEntanglementProofPreFlight:n}=O(await Z(this,se,"f").mutate({mutation:w`mutation agentEntanglementProofPreFlight($deviceKey: String!, $deviceKeyType: String!) {
|
|
292
292
|
agentEntanglementProofPreFlight(deviceKey: $deviceKey, deviceKeyType: $deviceKeyType) {
|
|
293
|
-
${
|
|
293
|
+
${Sa}
|
|
294
294
|
}
|
|
295
|
-
}`,variables:{deviceKey:e,deviceKeyType:t}}));return n}addUpdatedListener(e){Z(this,
|
|
295
|
+
}`,variables:{deviceKey:e,deviceKeyType:t}}));return n}addUpdatedListener(e){Z(this,pi,"f").push(e)}addAppChangedListener(e){Z(this,li,"f").push(e)}subscribeAgentUpdated(){Z(this,se,"f").subscribe({query:w` subscription {
|
|
296
296
|
agentUpdated { ${ri} }
|
|
297
297
|
}
|
|
298
|
-
`}).subscribe({next:e=>{let t=e.data.agentUpdated;Z(this,
|
|
298
|
+
`}).subscribe({next:e=>{let t=e.data.agentUpdated;Z(this,pi,"f").forEach(n=>{n(t)})},error:e=>console.error(e)})}subscribeAppsChanged(){Z(this,se,"f").subscribe({query:w` subscription {
|
|
299
299
|
agentAppsChanged {
|
|
300
|
-
${
|
|
300
|
+
${Ca}
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
|
-
`}).subscribe({next:e=>{Z(this,
|
|
303
|
+
`}).subscribe({next:e=>{Z(this,li,"f").forEach(t=>{t()})},error:e=>console.error(e)})}addAgentStatusChangedListener(e){Z(this,fi,"f").push(e)}subscribeAgentStatusChanged(){Z(this,se,"f").subscribe({query:w` subscription {
|
|
304
304
|
agentStatusChanged { ${gn} }
|
|
305
305
|
}
|
|
306
|
-
`}).subscribe({next:e=>{let t=e.data.agentStatusChanged;Z(this,
|
|
306
|
+
`}).subscribe({next:e=>{let t=e.data.agentStatusChanged;Z(this,fi,"f").forEach(n=>{n(t)})},error:e=>console.error(e)})}async requestCapability(e){let{agentRequestCapability:t}=O(await Z(this,se,"f").mutate({mutation:w`
|
|
307
307
|
mutation agentRequestCapability($authInfo: AuthInfoInput!) {
|
|
308
308
|
agentRequestCapability(authInfo: $authInfo)
|
|
309
309
|
}
|
|
@@ -317,15 +317,15 @@ neighbourhood {
|
|
|
317
317
|
}
|
|
318
318
|
`,variables:{requestId:e,rand:t}}));return n}async getApps(){let{agentGetApps:e}=O(await Z(this,se,"f").mutate({mutation:w`query agentGetApps {
|
|
319
319
|
agentGetApps {
|
|
320
|
-
${
|
|
320
|
+
${Ca}
|
|
321
321
|
}
|
|
322
322
|
}`}));return e}async removeApp(e){let{agentRemoveApp:t}=O(await Z(this,se,"f").mutate({mutation:w`mutation agentRemoveApp($requestId: String!) {
|
|
323
323
|
agentRemoveApp(requestId: $requestId) {
|
|
324
|
-
${
|
|
324
|
+
${Ca}
|
|
325
325
|
}
|
|
326
326
|
}`,variables:{requestId:e}}));return t}async revokeToken(e){let{agentRevokeToken:t}=O(await Z(this,se,"f").mutate({mutation:w`mutation agentRevokeToken($requestId: String!) {
|
|
327
327
|
agentRevokeToken(requestId: $requestId) {
|
|
328
|
-
${
|
|
328
|
+
${Ca}
|
|
329
329
|
}
|
|
330
330
|
}`,variables:{requestId:e}}));return t}async isLocked(){let{agentIsLocked:e}=O(await Z(this,se,"f").mutate({mutation:w`
|
|
331
331
|
query agentIsLocked {
|
|
@@ -335,14 +335,14 @@ neighbourhood {
|
|
|
335
335
|
agentSignMessage(message: $message) {
|
|
336
336
|
${M1}
|
|
337
337
|
}
|
|
338
|
-
}`,variables:{message:e}}));return t}};se=new WeakMap,
|
|
338
|
+
}`,variables:{message:e}}));return t}};se=new WeakMap,li=new WeakMap,pi=new WeakMap,fi=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},Zt=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)},mt,Yl=`
|
|
339
339
|
name
|
|
340
340
|
address
|
|
341
341
|
settings
|
|
342
342
|
icon { code }
|
|
343
343
|
constructorIcon { code }
|
|
344
344
|
settingsIcon { code }
|
|
345
|
-
`,
|
|
345
|
+
`,Xl=`
|
|
346
346
|
name
|
|
347
347
|
address
|
|
348
348
|
description
|
|
@@ -352,13 +352,13 @@ neighbourhood {
|
|
|
352
352
|
templateAppliedParams
|
|
353
353
|
possibleTemplateParams
|
|
354
354
|
sourceCodeLink
|
|
355
|
-
`,
|
|
355
|
+
`,zs=class{constructor(e){mt.set(this,void 0),j1(this,mt,e,"f")}async byAddress(e){let{language:t}=O(await Zt(this,mt,"f").query({query:w`query byAddress($address: String!) {
|
|
356
356
|
language(address: $address) {
|
|
357
|
-
${
|
|
357
|
+
${Yl}
|
|
358
358
|
}
|
|
359
359
|
}`,variables:{address:e}}));return t}async byFilter(e){let{languages:t}=O(await Zt(this,mt,"f").query({query:w`query byFilter($filter: String!) {
|
|
360
360
|
languages(filter: $filter) {
|
|
361
|
-
${
|
|
361
|
+
${Yl}
|
|
362
362
|
}
|
|
363
363
|
}`,variables:{filter:e}}));return t}async all(){return this.byFilter("")}async writeSettings(e,t){let{languageWriteSettings:n}=O(await Zt(this,mt,"f").mutate({mutation:w`mutation writeSettings($languageAddress: String!, $settings: String!) {
|
|
364
364
|
languageWriteSettings(languageAddress: $languageAddress, settings: $settings)
|
|
@@ -374,13 +374,13 @@ neighbourhood {
|
|
|
374
374
|
$languageMeta: LanguageMetaInput!,
|
|
375
375
|
) {
|
|
376
376
|
languagePublish(languagePath: $languagePath, languageMeta: $languageMeta) {
|
|
377
|
-
${
|
|
377
|
+
${Xl}
|
|
378
378
|
}
|
|
379
379
|
}`,variables:{languagePath:e,languageMeta:t}}));return n}async meta(e){let{languageMeta:t}=O(await Zt(this,mt,"f").query({query:w`query languageMeta(
|
|
380
380
|
$address: String!,
|
|
381
381
|
) {
|
|
382
382
|
languageMeta(address: $address) {
|
|
383
|
-
${
|
|
383
|
+
${Xl}
|
|
384
384
|
}
|
|
385
385
|
}`,variables:{address:e}}));return t}async source(e){let{languageSource:t}=O(await Zt(this,mt,"f").query({query:w`query languageSource(
|
|
386
386
|
$address: String!,
|
|
@@ -390,7 +390,7 @@ neighbourhood {
|
|
|
390
390
|
$address: String!,
|
|
391
391
|
) {
|
|
392
392
|
languageRemove(address: $address)
|
|
393
|
-
}`,variables:{address:e}}));return t}};mt=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},Re=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,Pr,
|
|
393
|
+
}`,variables:{address:e}}));return t}};mt=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},Re=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,Pr,Hs=class{constructor(e){qe.set(this,void 0),Pr.set(this,new Map),U1(this,qe,e,"f")}async publishFromPerspective(e,t,n){let{neighbourhoodPublishFromPerspective:i}=O(await Re(this,qe,"f").mutate({mutation:w`mutation neighbourhoodPublishFromPerspective(
|
|
394
394
|
$linkLanguage: String!,
|
|
395
395
|
$meta: PerspectiveInput!,
|
|
396
396
|
$perspectiveUUID: String!
|
|
@@ -510,7 +510,7 @@ neighbourhood {
|
|
|
510
510
|
}
|
|
511
511
|
proof { valid, invalid, signature, key }
|
|
512
512
|
}
|
|
513
|
-
}`,variables:{perspectiveUUID:e}}).subscribe({next:n=>{let{neighbourhoodSignal:i}=O(n);t.dispatchSignal(e,i)}})}async addSignalHandler(e,t){let n=Re(this,Pr,"f").get(e);n||(n=[],await this.subscribeToSignals(e)),n.push(t),Re(this,Pr,"f").set(e,n)}removeSignalHandler(e,t){let n=Re(this,Pr,"f").get(e);if(n){let i=n.indexOf(t);i>-1&&n.splice(i,1)}Re(this,Pr,"f").set(e,n)}};qe=new WeakMap,Pr=new WeakMap;var
|
|
513
|
+
}`,variables:{perspectiveUUID:e}}).subscribe({next:n=>{let{neighbourhoodSignal:i}=O(n);t.dispatchSignal(e,i)}})}async addSignalHandler(e,t){let n=Re(this,Pr,"f").get(e);n||(n=[],await this.subscribeToSignals(e)),n.push(t),Re(this,Pr,"f").set(e,n)}removeSignalHandler(e,t){let n=Re(this,Pr,"f").get(e);if(n){let i=n.indexOf(t);i>-1&&n.splice(i,1)}Re(this,Pr,"f").set(e,n)}};qe=new WeakMap,Pr=new WeakMap;var ni=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},W=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)},ee,di,hi,mi,gi,wa=`
|
|
514
514
|
author
|
|
515
515
|
timestamp
|
|
516
516
|
data {
|
|
@@ -531,85 +531,88 @@ trigger
|
|
|
531
531
|
perspectiveIds
|
|
532
532
|
webhookUrl
|
|
533
533
|
webhookAuth
|
|
534
|
-
`,
|
|
534
|
+
`,Js=`
|
|
535
535
|
id
|
|
536
536
|
granted
|
|
537
537
|
${q1}
|
|
538
538
|
`,B1=`
|
|
539
|
-
notification { ${
|
|
539
|
+
notification { ${Js} }
|
|
540
540
|
perspectiveId
|
|
541
541
|
triggerMatch
|
|
542
|
-
`,
|
|
542
|
+
`,Ys=class{constructor(e,t=!0){ee.set(this,void 0),di.set(this,void 0),hi.set(this,void 0),mi.set(this,void 0),gi.set(this,void 0),ni(this,ee,e,"f"),ni(this,di,[],"f"),ni(this,hi,[],"f"),ni(this,mi,[],"f"),ni(this,gi,[],"f"),t&&(this.subscribeMessageReceived(),this.subscribeExceptionOccurred(),this.subscribeNotificationTriggered(),this.subscribeNotificationRequested())}async info(){let{runtimeInfo:e}=O(await W(this,ee,"f").query({query:w`query runtimeInfo {
|
|
543
543
|
runtimeInfo {
|
|
544
544
|
ad4mExecutorVersion,
|
|
545
545
|
isInitialized,
|
|
546
546
|
isUnlocked
|
|
547
547
|
}
|
|
548
|
-
}`}));return e}async quit(){return O(await
|
|
548
|
+
}`}));return e}async quit(){return O(await W(this,ee,"f").mutate({mutation:w`mutation runtimeQuit { runtimeQuit }`})).runtimeQuit}async openLink(e){let{runtimeOpenLink:t}=O(await W(this,ee,"f").mutate({mutation:w`mutation runtimeOpenLink($url: String!) {
|
|
549
549
|
runtimeOpenLink(url: $url)
|
|
550
|
-
}`,variables:{url:e}}));return t}async addTrustedAgents(e){let{addTrustedAgents:t}=O(await
|
|
550
|
+
}`,variables:{url:e}}));return t}async addTrustedAgents(e){let{addTrustedAgents:t}=O(await W(this,ee,"f").mutate({mutation:w`mutation addTrustedAgents($agents: [String!]!) {
|
|
551
551
|
addTrustedAgents(agents: $agents)
|
|
552
|
-
}`,variables:{agents:e}}));return t}async deleteTrustedAgents(e){let{deleteTrustedAgents:t}=O(await
|
|
552
|
+
}`,variables:{agents:e}}));return t}async deleteTrustedAgents(e){let{deleteTrustedAgents:t}=O(await W(this,ee,"f").mutate({mutation:w`mutation deleteTrustedAgents($agents: [String!]!) {
|
|
553
553
|
deleteTrustedAgents(agents: $agents)
|
|
554
|
-
}`,variables:{agents:e}}));return t}async getTrustedAgents(){let{getTrustedAgents:e}=O(await
|
|
554
|
+
}`,variables:{agents:e}}));return t}async getTrustedAgents(){let{getTrustedAgents:e}=O(await W(this,ee,"f").query({query:w`query getTrustedAgents {
|
|
555
555
|
getTrustedAgents
|
|
556
|
-
}`}));return e}async addKnownLinkLanguageTemplates(e){let{runtimeAddKnownLinkLanguageTemplates:t}=O(await
|
|
556
|
+
}`}));return e}async addKnownLinkLanguageTemplates(e){let{runtimeAddKnownLinkLanguageTemplates:t}=O(await W(this,ee,"f").mutate({mutation:w`mutation runtimeAddKnownLinkLanguageTemplates($addresses: [String!]!) {
|
|
557
557
|
runtimeAddKnownLinkLanguageTemplates(addresses: $addresses)
|
|
558
|
-
}`,variables:{addresses:e}}));return t}async removeKnownLinkLanguageTemplates(e){let{runtimeRemoveKnownLinkLanguageTemplates:t}=O(await
|
|
558
|
+
}`,variables:{addresses:e}}));return t}async removeKnownLinkLanguageTemplates(e){let{runtimeRemoveKnownLinkLanguageTemplates:t}=O(await W(this,ee,"f").mutate({mutation:w`mutation runtimeRemoveKnownLinkLanguageTemplates($addresses: [String!]!) {
|
|
559
559
|
runtimeRemoveKnownLinkLanguageTemplates(addresses: $addresses)
|
|
560
|
-
}`,variables:{addresses:e}}));return t}async knownLinkLanguageTemplates(){let{runtimeKnownLinkLanguageTemplates:e}=O(await
|
|
560
|
+
}`,variables:{addresses:e}}));return t}async knownLinkLanguageTemplates(){let{runtimeKnownLinkLanguageTemplates:e}=O(await W(this,ee,"f").query({query:w`query runtimeKnownLinkLanguageTemplates {
|
|
561
561
|
runtimeKnownLinkLanguageTemplates
|
|
562
|
-
}`}));return e}async addFriends(e){let{runtimeAddFriends:t}=O(await
|
|
562
|
+
}`}));return e}async addFriends(e){let{runtimeAddFriends:t}=O(await W(this,ee,"f").mutate({mutation:w`mutation runtimeAddFriends($dids: [String!]!) {
|
|
563
563
|
runtimeAddFriends(dids: $dids)
|
|
564
|
-
}`,variables:{dids:e}}));return t}async removeFriends(e){let{runtimeRemoveFriends:t}=O(await
|
|
564
|
+
}`,variables:{dids:e}}));return t}async removeFriends(e){let{runtimeRemoveFriends:t}=O(await W(this,ee,"f").mutate({mutation:w`mutation runtimeRemoveFriends($dids: [String!]!) {
|
|
565
565
|
runtimeRemoveFriends(dids: $dids)
|
|
566
|
-
}`,variables:{dids:e}}));return t}async friends(){let{runtimeFriends:e}=O(await
|
|
566
|
+
}`,variables:{dids:e}}));return t}async friends(){let{runtimeFriends:e}=O(await W(this,ee,"f").query({query:w`query runtimeFriends {
|
|
567
567
|
runtimeFriends
|
|
568
|
-
}`}));return e}async hcAgentInfos(){let{runtimeHcAgentInfos:e}=O(await
|
|
568
|
+
}`}));return e}async hcAgentInfos(){let{runtimeHcAgentInfos:e}=O(await W(this,ee,"f").query({query:w`query runtimeHcAgentInfos {
|
|
569
569
|
runtimeHcAgentInfos
|
|
570
|
-
}`}));return e}async hcAddAgentInfos(e){let{runtimeHcAddAgentInfos:t}=O(await
|
|
570
|
+
}`}));return e}async hcAddAgentInfos(e){let{runtimeHcAddAgentInfos:t}=O(await W(this,ee,"f").mutate({mutation:w`mutation runtimeHcAddAgentInfos($agentInfos: String!) {
|
|
571
571
|
runtimeHcAddAgentInfos(agentInfos: $agentInfos)
|
|
572
|
-
}`,variables:{agentInfos:e}}));return t}async verifyStringSignedByDid(e,t,n,i){let{runtimeVerifyStringSignedByDid:a}=O(await
|
|
572
|
+
}`,variables:{agentInfos:e}}));return t}async verifyStringSignedByDid(e,t,n,i){let{runtimeVerifyStringSignedByDid:a}=O(await W(this,ee,"f").mutate({mutation:w`query runtimeVerifyStringSignedByDid($did: String!, $didSigningKeyId: String!, $data: String!, $signedData: String!) {
|
|
573
573
|
runtimeVerifyStringSignedByDid(did: $did, didSigningKeyId: $didSigningKeyId, data: $data, signedData: $signedData)
|
|
574
|
-
}`,variables:{did:e,didSigningKeyId:t,data:n,signedData:i}}));return a}async setStatus(e){let{runtimeSetStatus:t}=O(await
|
|
574
|
+
}`,variables:{did:e,didSigningKeyId:t,data:n,signedData:i}}));return a}async setStatus(e){let{runtimeSetStatus:t}=O(await W(this,ee,"f").mutate({mutation:w`mutation runtimeSetStatus($status: PerspectiveInput!) {
|
|
575
575
|
runtimeSetStatus(status: $status)
|
|
576
|
-
}`,variables:{status:e}}));return t}async friendStatus(e){let{runtimeFriendStatus:t}=O(await
|
|
577
|
-
runtimeFriendStatus(did: $did) { ${
|
|
578
|
-
}`,variables:{did:e}}));return t}async friendSendMessage(e,t){let{runtimeFriendSendMessage:n}=O(await
|
|
576
|
+
}`,variables:{status:e}}));return t}async friendStatus(e){let{runtimeFriendStatus:t}=O(await W(this,ee,"f").query({query:w`query runtimeFriendStatus($did: String!) {
|
|
577
|
+
runtimeFriendStatus(did: $did) { ${wa} }
|
|
578
|
+
}`,variables:{did:e}}));return t}async friendSendMessage(e,t){let{runtimeFriendSendMessage:n}=O(await W(this,ee,"f").mutate({mutation:w`mutation runtimeFriendSendMessage($did: String!, $message: PerspectiveInput!) {
|
|
579
579
|
runtimeFriendSendMessage(did: $did, message: $message)
|
|
580
|
-
}`,variables:{did:e,message:t}}));return n}async messageInbox(e){let{runtimeMessageInbox:t}=O(await
|
|
581
|
-
runtimeMessageInbox(filter: $filter) { ${
|
|
582
|
-
}`,variables:{filter:e}}));return t}async messageOutbox(e){let{runtimeMessageOutbox:t}=O(await
|
|
580
|
+
}`,variables:{did:e,message:t}}));return n}async messageInbox(e){let{runtimeMessageInbox:t}=O(await W(this,ee,"f").query({query:w`query runtimeMessageInbox($filter: String) {
|
|
581
|
+
runtimeMessageInbox(filter: $filter) { ${wa} }
|
|
582
|
+
}`,variables:{filter:e}}));return t}async messageOutbox(e){let{runtimeMessageOutbox:t}=O(await W(this,ee,"f").query({query:w`query runtimeMessageOutbox($filter: String) {
|
|
583
583
|
runtimeMessageOutbox(filter: $filter) {
|
|
584
584
|
recipient,
|
|
585
585
|
message {
|
|
586
|
-
${
|
|
586
|
+
${wa}
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
|
-
}`,variables:{filter:e}}));return t}async requestInstallNotification(e){let{runtimeRequestInstallNotification:t}=O(await
|
|
589
|
+
}`,variables:{filter:e}}));return t}async requestInstallNotification(e){let{runtimeRequestInstallNotification:t}=O(await W(this,ee,"f").mutate({mutation:w`mutation runtimeRequestInstallNotification($notification: NotificationInput!) {
|
|
590
590
|
runtimeRequestInstallNotification(notification: $notification)
|
|
591
|
-
}`,variables:{notification:e}}));return t}async grantNotification(e){let{runtimeGrantNotification:t}=O(await
|
|
591
|
+
}`,variables:{notification:e}}));return t}async grantNotification(e){let{runtimeGrantNotification:t}=O(await W(this,ee,"f").mutate({mutation:w`mutation runtimeGrantNotification($id: String!) {
|
|
592
592
|
runtimeGrantNotification(id: $id)
|
|
593
|
-
}`,variables:{id:e}}));return t}async notifications(){let{runtimeNotifications:e}=O(await
|
|
594
|
-
runtimeNotifications { ${
|
|
595
|
-
}`}));return e}async updateNotification(e,t){let{runtimeUpdateNotification:n}=O(await
|
|
593
|
+
}`,variables:{id:e}}));return t}async notifications(){let{runtimeNotifications:e}=O(await W(this,ee,"f").query({query:w`query runtimeNotifications {
|
|
594
|
+
runtimeNotifications { ${Js} }
|
|
595
|
+
}`}));return e}async updateNotification(e,t){let{runtimeUpdateNotification:n}=O(await W(this,ee,"f").mutate({mutation:w`mutation runtimeUpdateNotification($id: String!, $notification: NotificationInput!) {
|
|
596
596
|
runtimeUpdateNotification(id: $id, notification: $notification)
|
|
597
|
-
}`,variables:{id:e,notification:t}}));return n}async removeNotification(e){let{runtimeRemoveNotification:t}=O(await
|
|
597
|
+
}`,variables:{id:e,notification:t}}));return n}async removeNotification(e){let{runtimeRemoveNotification:t}=O(await W(this,ee,"f").mutate({mutation:w`mutation runtimeRemoveNotification($id: String!) {
|
|
598
598
|
runtimeRemoveNotification(id: $id)
|
|
599
|
-
}`,variables:{id:e}}));return t}addNotificationTriggeredCallback(e){
|
|
599
|
+
}`,variables:{id:e}}));return t}addNotificationTriggeredCallback(e){W(this,mi,"f").push(e)}addNotificationRequestedCallback(e){W(this,gi,"f").push(e)}subscribeNotificationTriggered(){W(this,ee,"f").subscribe({query:w` subscription {
|
|
600
600
|
runtimeNotificationTriggered { ${B1} }
|
|
601
601
|
}
|
|
602
|
-
`}).subscribe({next:e=>{
|
|
603
|
-
|
|
602
|
+
`}).subscribe({next:e=>{W(this,mi,"f").forEach(t=>{t(e.data.runtimeNotificationTriggered)})},error:e=>console.error(e)})}subscribeNotificationRequested(){W(this,ee,"f").subscribe({query:w` subscription {
|
|
603
|
+
runtimeNotificationRequested { ${Js} }
|
|
604
604
|
}
|
|
605
|
-
`}).subscribe({next:e=>{
|
|
605
|
+
`}).subscribe({next:e=>{W(this,gi,"f").forEach(t=>{t(e.data.runtimeNotificationRequested)})},error:e=>console.error(e)})}addMessageCallback(e){W(this,di,"f").push(e)}subscribeMessageReceived(){W(this,ee,"f").subscribe({query:w` subscription {
|
|
606
|
+
runtimeMessageReceived { ${wa} }
|
|
607
|
+
}
|
|
608
|
+
`}).subscribe({next:e=>{W(this,di,"f").forEach(t=>{t(e.data.runtimeMessageReceived)})},error:e=>console.error(e)})}addExceptionCallback(e){W(this,hi,"f").push(e)}subscribeExceptionOccurred(){W(this,ee,"f").subscribe({query:w` subscription {
|
|
606
609
|
exceptionOccurred {
|
|
607
610
|
title
|
|
608
611
|
message
|
|
609
612
|
type
|
|
610
613
|
addon
|
|
611
614
|
}
|
|
612
|
-
}`}).subscribe({next:e=>{
|
|
615
|
+
}`}).subscribe({next:e=>{W(this,hi,"f").forEach(t=>{t(e.data.exceptionOccurred)})},error:e=>console.error(e)})}};ee=new WeakMap,di=new WeakMap,hi=new WeakMap,mi=new WeakMap,gi=new WeakMap;var V1=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},yn=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)},Lt,Xs=class{constructor(e){Lt.set(this,void 0),V1(this,Lt,e,"f")}async get(e){let{expression:t}=O(await yn(this,Lt,"f").query({query:w`query expression($url: String!) {
|
|
613
616
|
expression(url: $url) {
|
|
614
617
|
author
|
|
615
618
|
timestamp
|
|
@@ -647,14 +650,14 @@ triggerMatch
|
|
|
647
650
|
}
|
|
648
651
|
}`,variables:{url:e}}));return t}async interact(e,t){let{expressionInteract:n}=O(await yn(this,Lt,"f").mutate({mutation:w`mutation expressionInteract($url: String!, $interactionCall: InteractionCall!){
|
|
649
652
|
expressionInteract(url: $url, interactionCall: $interactionCall)
|
|
650
|
-
}`,variables:{url:e,interactionCall:t}}));return n}};Lt=new WeakMap;var Tr=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},$e=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,Da,mi,Na,gi,bn,Pa,Wa=class{constructor(e,t=!0){Ft.set(this,void 0),Da.set(this,void 0),mi.set(this,void 0),Na.set(this,void 0),gi.set(this,void 0),bn.set(this,void 0),Pa.set(this,void 0),Tr(this,Ft,e,"f"),Tr(this,Da,new Si($e(this,Ft,"f"),t),"f"),Tr(this,mi,new Js($e(this,Ft,"f")),"f"),Tr(this,Na,new Ks($e(this,Ft,"f")),"f"),Tr(this,gi,new zs($e(this,Ft,"f")),"f"),Tr(this,bn,new Ga($e(this,Ft,"f"),t),"f"),$e(this,bn,"f").setExpressionClient($e(this,mi,"f")),$e(this,bn,"f").setNeighbourhoodClient($e(this,gi,"f")),Tr(this,Pa,new Hs($e(this,Ft,"f"),t),"f")}get agent(){return $e(this,Da,"f")}get expression(){return $e(this,mi,"f")}get languages(){return $e(this,Na,"f")}get neighbourhood(){return $e(this,gi,"f")}get perspective(){return $e(this,bn,"f")}get runtime(){return $e(this,Pa,"f")}};Ft=new WeakMap,Da=new WeakMap,mi=new WeakMap,Na=new WeakMap,gi=new WeakMap,bn=new WeakMap,Pa=new WeakMap;var Yl;(function(r){r.LanguageIsNotLoaded="LANGUAGE_IS_NOT_LOADED",r.ExpressionIsNotVerified="EXPRESSION_IS_NOT_VERIFIED",r.AgentIsUntrusted="AGENT_IS_UNTRUSTED",r.CapabilityRequested="CAPABILITY_REQUESTED",r.InstallNotificationRequest="INSTALL_NOTIFICATION_REQUEST"})(Yl||(Yl={}));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)},Lr=class{constructor(e,t){this.language=e,this.expression=t}};nc([y(),ic("design:type",xt)],Lr.prototype,"language",void 0);nc([y(),ic("design:type",String)],Lr.prototype,"expression",void 0);Lr=nc([Y(),ic("design:paramtypes",[xt,String])],Lr);function rv(r){return r.language.address==="did"?r.expression.toString():`${r.language.address}://${r.expression}`}function nv(r){if(r.startsWith("literal://")){let a=new xt;a.address="literal",a.name="literal";let o=r.substring(10);return new Lr(a,o)}let t=/^([^:^\s]+):\/\/([\s\S]+)$/.exec(r);if(t&&t.length==3){let a=t[1],o=t[2],s=new xt;return s.address=a,new Lr(s,o)}let i=/^did:([^\s]+)$/.exec(r);if(i&&i.length==2){let a=new xt;return a.address="did",new Lr(a,r)}throw new Error("Couldn't parse string as expression URL or DID: "+r)}var nt=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},Tt=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Ka=class{};nt([y(),Tt("design:type",String)],Ka.prototype,"name",void 0);nt([y(),Tt("design:type",String)],Ka.prototype,"type",void 0);Ka=nt([Y()],Ka);var wi=class{};nt([y(),Tt("design:type",String)],wi.prototype,"label",void 0);nt([y(),Tt("design:type",String)],wi.prototype,"name",void 0);nt([y(),Tt("design:type",Array)],wi.prototype,"parameters",void 0);wi=nt([Y()],wi);var za=class{get parameters(){return JSON.parse(this.parametersStringified)}constructor(e,t){this.name=e,this.parametersStringified=JSON.stringify(t)}};nt([y(),Tt("design:type",String)],za.prototype,"name",void 0);nt([y(),Tt("design:type",String)],za.prototype,"parametersStringified",void 0);za=nt([Ve(),Tt("design:paramtypes",[String,Object])],za);var Ha=class{};nt([y(),Tt("design:type",String)],Ha.prototype,"did",void 0);nt([y(),Tt("design:type",Gs)],Ha.prototype,"status",void 0);Ha=nt([Y()],Ha);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},Tn=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},sr=class{};Gr([y(),Tn("design:type",String)],sr.prototype,"name",void 0);Gr([y(),Tn("design:type",String)],sr.prototype,"address",void 0);Gr([y(),Tn("design:type",String)],sr.prototype,"settings",void 0);Gr([y(),Tn("design:type",$r)],sr.prototype,"icon",void 0);Gr([y(),Tn("design:type",$r)],sr.prototype,"constructorIcon",void 0);Gr([y(),Tn("design:type",$r)],sr.prototype,"settingsIcon",void 0);sr=Gr([Y()],sr);var Qe=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},Je=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},yt=class{};Qe([y(),Je("design:type",String)],yt.prototype,"name",void 0);Qe([y(),Je("design:type",String)],yt.prototype,"address",void 0);Qe([y(),Je("design:type",String)],yt.prototype,"description",void 0);Qe([y(),Je("design:type",String)],yt.prototype,"author",void 0);Qe([y(),Je("design:type",Boolean)],yt.prototype,"templated",void 0);Qe([y(),Je("design:type",String)],yt.prototype,"templateSourceLanguageAddress",void 0);Qe([y(),Je("design:type",String)],yt.prototype,"templateAppliedParams",void 0);Qe([y(),Je("design:type",Array)],yt.prototype,"possibleTemplateParams",void 0);Qe([y(),Je("design:type",String)],yt.prototype,"sourceCodeLink",void 0);yt=Qe([Y()],yt);var En=class{constructor(e,t){this.name=e,this.description=t,this.description||(this.description="")}};Qe([y(),Je("design:type",String)],En.prototype,"name",void 0);Qe([y(),Je("design:type",String)],En.prototype,"description",void 0);Qe([y(),Je("design:type",Array)],En.prototype,"possibleTemplateParams",void 0);Qe([y(),Je("design:type",String)],En.prototype,"sourceCodeLink",void 0);En=Qe([Ve(),Je("design:paramtypes",[String,String])],En);var Zl=class{},ep=class extends cr(){},tp=class{},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},ac=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Ja=class{constructor(e,t){this.linkLanguage=e,this.meta=t}};Za([y(),ac("design:type",String)],Ja.prototype,"linkLanguage",void 0);Za([y(),ac("design:type",nr)],Ja.prototype,"meta",void 0);Ja=Za([Y(),ac("design:paramtypes",[String,nr])],Ja);var Ys=class extends cr(){};Ys=Za([Y()],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},An=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Xs;(function(r){r.Private="PRIVATE",r.NeighboudhoodCreationInitiated="NEIGHBOURHOOD_CREATION_INITIATED",r.NeighbourhoodJoinInitiated="NEIGHBOURHOOD_JOIN_INITIATED",r.LinkLanguageFailedToInstall="LINK_LANGUAGE_FAILED_TO_INSTALL",r.LinkLanguageInstalledButNotSynced="LINK_LANGUAGE_INSTALLED_BUT_NOT_SYNCED",r.Synced="SYNCED"})(Xs||(Xs={}));var qr=class{constructor(e,t,n){this.uuid=e,this.name=t,n?this.state=n:this.state=Xs.Private}};In([y(),An("design:type",String)],qr.prototype,"uuid",void 0);In([y(),An("design:type",String)],qr.prototype,"name",void 0);In([y(),An("design:type",String)],qr.prototype,"state",void 0);In([y(),An("design:type",String)],qr.prototype,"sharedUrl",void 0);In([y(),An("design:type",Ys)],qr.prototype,"neighbourhood",void 0);qr=In([Y(),An("design:paramtypes",[String,String,String])],qr);var eo=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},_p=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Ya=class{};eo([y(),_p("design:type",Array)],Ya.prototype,"additions",void 0);eo([y(),_p("design:type",Array)],Ya.prototype,"removals",void 0);Ya=eo([Y()],Ya);var rp=class extends cr(){};rp=eo([Y()],rp);var np=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)},yi,Rr,wa="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){yi.set(this,void 0),Rr.set(this,void 0),np(this,yi,e,"f"),np(this,Rr,t,"f")}get base(){return vn(this,Rr,"f")}static async create(e,t){let n=Ot.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 rt({source:t,predicate:wa}))).length>0}static async getAllSmartLiterals(e){return(await e.get(new rt({predicate:wa}))).map(n=>new _i(e,n.data.source))}async get(){let e=await vn(this,yi,"f").getSingleTarget(new rt({source:vn(this,Rr,"f"),predicate:wa}));if(!e)throw`No content for smart literal ${vn(this,Rr,"f")}`;return Ot.fromUrl(e).get()}async set(e){let t=Ot.from(e);await vn(this,yi,"f").setSingleTarget(new jr({source:vn(this,Rr,"f"),predicate:wa,target:t.toUrl()}))}};yi=new WeakMap,Rr=new WeakMap;var ip=class{};function gv(r,e,t){return{action:"addLink",source:r,predicate:e,target:t}}function yv(r){return`triple(this, "${r}", _)`}function vv(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,c=`subject_class("${s}", C), instance(C, Instance)`;if(r&&r.where)for(let l in r.where){let p=r.where[l];c+=`, property_getter(C, Instance, "${l}", "${p}")`}r&&r.condition&&(c+=", "+r.condition);let u=await a.infer(c);if(u==!1)return o;if(typeof u=="string")throw u;for(let l of u){let p=l.Instance,d=new Qa(a,p,s);await d.init(),o.push(d)}return o}}}function bv(r){return function(e,t){if(r.required&&!r.initial)throw new Error("SubjectProperty requires an 'initial' option if 'required' is true");if(!r.through&&!r.getter)throw new Error("SubjectProperty requires either 'through' or 'getter' option");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${tr(n)}`]=()=>{}}Object.defineProperty(e,t,{configurable:!0,writable:!0})}}function Cv(r){return function(e,t){if(!r.through&&!r.value)throw new Error("SubjectFlag requires a 'through' and 'value' option");if(!r.through)throw new Error("SubjectFlag requires a 'through' option");if(!r.value)throw new Error("SubjectFlag requires a 'value' option");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 Sv(r){return function(e,t){e.__collections=e.__collections||{},e.__collections[t]=r;let n=t;e[`add${tr(n)}`]=()=>{},e[`remove${tr(n)}`]=()=>{},e[`setCollection${tr(n)}`]=()=>{},Object.defineProperty(e,t,{configurable:!0,writable:!0})}}function Ep(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 wv(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=Ep(8);t+=`subject_class("${n}", ${a}).
|
|
653
|
+
}`,variables:{url:e,interactionCall:t}}));return n}};Lt=new WeakMap;var Tr=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},$e=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,Na,yi,Pa,vi,bn,Ra,Ka=class{constructor(e,t=!0){Ft.set(this,void 0),Na.set(this,void 0),yi.set(this,void 0),Pa.set(this,void 0),vi.set(this,void 0),bn.set(this,void 0),Ra.set(this,void 0),Tr(this,Ft,e,"f"),Tr(this,Na,new _i($e(this,Ft,"f"),t),"f"),Tr(this,yi,new Xs($e(this,Ft,"f")),"f"),Tr(this,Pa,new zs($e(this,Ft,"f")),"f"),Tr(this,vi,new Hs($e(this,Ft,"f")),"f"),Tr(this,bn,new Wa($e(this,Ft,"f"),t),"f"),$e(this,bn,"f").setExpressionClient($e(this,yi,"f")),$e(this,bn,"f").setNeighbourhoodClient($e(this,vi,"f")),Tr(this,Ra,new Ys($e(this,Ft,"f"),t),"f")}get agent(){return $e(this,Na,"f")}get expression(){return $e(this,yi,"f")}get languages(){return $e(this,Pa,"f")}get neighbourhood(){return $e(this,vi,"f")}get perspective(){return $e(this,bn,"f")}get runtime(){return $e(this,Ra,"f")}};Ft=new WeakMap,Na=new WeakMap,yi=new WeakMap,Pa=new WeakMap,vi=new WeakMap,bn=new WeakMap,Ra=new WeakMap;var Zl;(function(r){r.LanguageIsNotLoaded="LANGUAGE_IS_NOT_LOADED",r.ExpressionIsNotVerified="EXPRESSION_IS_NOT_VERIFIED",r.AgentIsUntrusted="AGENT_IS_UNTRUSTED",r.CapabilityRequested="CAPABILITY_REQUESTED",r.InstallNotificationRequest="INSTALL_NOTIFICATION_REQUEST"})(Zl||(Zl={}));var ac=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)},Lr=class{constructor(e,t){this.language=e,this.expression=t}};ac([y(),oc("design:type",xt)],Lr.prototype,"language",void 0);ac([y(),oc("design:type",String)],Lr.prototype,"expression",void 0);Lr=ac([Y(),oc("design:paramtypes",[xt,String])],Lr);function rv(r){return r.language.address==="did"?r.expression.toString():`${r.language.address}://${r.expression}`}function nv(r){if(r.startsWith("literal://")){let a=new xt;a.address="literal",a.name="literal";let o=r.substring(10);return new Lr(a,o)}let t=/^([^:^\s]+):\/\/([\s\S]+)$/.exec(r);if(t&&t.length==3){let a=t[1],o=t[2],s=new xt;return s.address=a,new Lr(s,o)}let i=/^did:([^\s]+)$/.exec(r);if(i&&i.length==2){let a=new xt;return a.address="did",new Lr(a,r)}throw new Error("Couldn't parse string as expression URL or DID: "+r)}var nt=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},Tt=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},za=class{};nt([y(),Tt("design:type",String)],za.prototype,"name",void 0);nt([y(),Tt("design:type",String)],za.prototype,"type",void 0);za=nt([Y()],za);var Ei=class{};nt([y(),Tt("design:type",String)],Ei.prototype,"label",void 0);nt([y(),Tt("design:type",String)],Ei.prototype,"name",void 0);nt([y(),Tt("design:type",Array)],Ei.prototype,"parameters",void 0);Ei=nt([Y()],Ei);var Ha=class{get parameters(){return JSON.parse(this.parametersStringified)}constructor(e,t){this.name=e,this.parametersStringified=JSON.stringify(t)}};nt([y(),Tt("design:type",String)],Ha.prototype,"name",void 0);nt([y(),Tt("design:type",String)],Ha.prototype,"parametersStringified",void 0);Ha=nt([Ve(),Tt("design:paramtypes",[String,Object])],Ha);var Ja=class{};nt([y(),Tt("design:type",String)],Ja.prototype,"did",void 0);nt([y(),Tt("design:type",Ws)],Ja.prototype,"status",void 0);Ja=nt([Y()],Ja);var ep=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},Tn=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},sr=class{};Gr([y(),Tn("design:type",String)],sr.prototype,"name",void 0);Gr([y(),Tn("design:type",String)],sr.prototype,"address",void 0);Gr([y(),Tn("design:type",String)],sr.prototype,"settings",void 0);Gr([y(),Tn("design:type",$r)],sr.prototype,"icon",void 0);Gr([y(),Tn("design:type",$r)],sr.prototype,"constructorIcon",void 0);Gr([y(),Tn("design:type",$r)],sr.prototype,"settingsIcon",void 0);sr=Gr([Y()],sr);var Qe=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},Je=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},yt=class{};Qe([y(),Je("design:type",String)],yt.prototype,"name",void 0);Qe([y(),Je("design:type",String)],yt.prototype,"address",void 0);Qe([y(),Je("design:type",String)],yt.prototype,"description",void 0);Qe([y(),Je("design:type",String)],yt.prototype,"author",void 0);Qe([y(),Je("design:type",Boolean)],yt.prototype,"templated",void 0);Qe([y(),Je("design:type",String)],yt.prototype,"templateSourceLanguageAddress",void 0);Qe([y(),Je("design:type",String)],yt.prototype,"templateAppliedParams",void 0);Qe([y(),Je("design:type",Array)],yt.prototype,"possibleTemplateParams",void 0);Qe([y(),Je("design:type",String)],yt.prototype,"sourceCodeLink",void 0);yt=Qe([Y()],yt);var En=class{constructor(e,t){this.name=e,this.description=t,this.description||(this.description="")}};Qe([y(),Je("design:type",String)],En.prototype,"name",void 0);Qe([y(),Je("design:type",String)],En.prototype,"description",void 0);Qe([y(),Je("design:type",Array)],En.prototype,"possibleTemplateParams",void 0);Qe([y(),Je("design:type",String)],En.prototype,"sourceCodeLink",void 0);En=Qe([Ve(),Je("design:paramtypes",[String,String])],En);var tp=class{},rp=class extends cr(){},np=class{},eo=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},sc=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Ya=class{constructor(e,t){this.linkLanguage=e,this.meta=t}};eo([y(),sc("design:type",String)],Ya.prototype,"linkLanguage",void 0);eo([y(),sc("design:type",nr)],Ya.prototype,"meta",void 0);Ya=eo([Y(),sc("design:paramtypes",[String,nr])],Ya);var Zs=class extends cr(){};Zs=eo([Y()],Zs);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},An=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},ec;(function(r){r.Private="PRIVATE",r.NeighboudhoodCreationInitiated="NEIGHBOURHOOD_CREATION_INITIATED",r.NeighbourhoodJoinInitiated="NEIGHBOURHOOD_JOIN_INITIATED",r.LinkLanguageFailedToInstall="LINK_LANGUAGE_FAILED_TO_INSTALL",r.LinkLanguageInstalledButNotSynced="LINK_LANGUAGE_INSTALLED_BUT_NOT_SYNCED",r.Synced="SYNCED"})(ec||(ec={}));var qr=class{constructor(e,t,n){this.uuid=e,this.name=t,n?this.state=n:this.state=ec.Private}};In([y(),An("design:type",String)],qr.prototype,"uuid",void 0);In([y(),An("design:type",String)],qr.prototype,"name",void 0);In([y(),An("design:type",String)],qr.prototype,"state",void 0);In([y(),An("design:type",String)],qr.prototype,"sharedUrl",void 0);In([y(),An("design:type",Zs)],qr.prototype,"neighbourhood",void 0);qr=In([Y(),An("design:paramtypes",[String,String,String])],qr);var to=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},_p=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Xa=class{};to([y(),_p("design:type",Array)],Xa.prototype,"additions",void 0);to([y(),_p("design:type",Array)],Xa.prototype,"removals",void 0);Xa=to([Y()],Xa);var ip=class extends cr(){};ip=to([Y()],ip);var ap=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)},bi,Rr,_a="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 xi=class{constructor(e,t){bi.set(this,void 0),Rr.set(this,void 0),ap(this,bi,e,"f"),ap(this,Rr,t,"f")}get base(){return vn(this,Rr,"f")}static async create(e,t){let n=Ot.from(Q1(10)).toUrl(),i=new xi(e,n);return await i.set(t),i}static async isSmartLiteralBase(e,t){return(await e.get(new rt({source:t,predicate:_a}))).length>0}static async getAllSmartLiterals(e){return(await e.get(new rt({predicate:_a}))).map(n=>new xi(e,n.data.source))}async get(){let e=await vn(this,bi,"f").getSingleTarget(new rt({source:vn(this,Rr,"f"),predicate:_a}));if(!e)throw`No content for smart literal ${vn(this,Rr,"f")}`;return Ot.fromUrl(e).get()}async set(e){let t=Ot.from(e);await vn(this,bi,"f").setSingleTarget(new jr({source:vn(this,Rr,"f"),predicate:_a,target:t.toUrl()}))}};bi=new WeakMap,Rr=new WeakMap;var op=class{};function gv(r,e,t){return{action:"addLink",source:r,predicate:e,target:t}}function yv(r){return`triple(this, "${r}", _)`}function vv(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,c=`subject_class("${s}", C), instance(C, Instance)`;if(r&&r.where)for(let l in r.where){let p=r.where[l];c+=`, property_getter(C, Instance, "${l}", "${p}")`}r&&r.condition&&(c+=", "+r.condition);let u=await a.infer(c);if(u==!1)return o;if(typeof u=="string")throw u;for(let l of u){let p=l.Instance,d=new Ga(a,p,s);await d.init(),o.push(d)}return o}}}function bv(r){return function(e,t){if(r.required&&!r.initial)throw new Error("SubjectProperty requires an 'initial' option if 'required' is true");if(!r.through&&!r.getter)throw new Error("SubjectProperty requires either 'through' or 'getter' option");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${tr(n)}`]=()=>{}}Object.defineProperty(e,t,{configurable:!0,writable:!0})}}function Cv(r){return function(e,t){if(!r.through&&!r.value)throw new Error("SubjectFlag requires a 'through' and 'value' option");if(!r.through)throw new Error("SubjectFlag requires a 'through' option");if(!r.value)throw new Error("SubjectFlag requires a 'value' option");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 Sv(r){return function(e,t){e.__collections=e.__collections||{},e.__collections[t]=r;let n=t;e[`add${tr(n)}`]=()=>{},e[`remove${tr(n)}`]=()=>{},e[`setCollection${tr(n)}`]=()=>{},Object.defineProperty(e,t,{configurable:!0,writable:!0})}}function Ep(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 wv(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=Ep(8);t+=`subject_class("${n}", ${a}).
|
|
651
654
|
`;let o=[],s=[];i.subjectConstructor&&i.subjectConstructor.length&&(s=s.concat(i.subjectConstructor));let c=[];i.isSubjectInstance&&i.isSubjectInstance.length&&(c=c.concat(i.isSubjectInstance));let u=[],l=i.__properties||{};for(let m in l){let g=`property(${a}, "${m}").
|
|
652
655
|
`,{through:b,initial:_,required:v,resolveLanguage:C,writable:E,flag:A,getter:D,setter:I,local:R}=l[m];if(C&&(g+=`property_resolve(${a}, "${m}").
|
|
653
656
|
`,g+=`property_resolve_language(${a}, "${m}", "${C}").
|
|
654
657
|
`),D?g+=`property_getter(${a}, Base, "${m}", Value) :- ${D}.
|
|
655
658
|
`:b&&(g+=`property_getter(${a}, Base, "${m}", Value) :- triple(Base, "${b}", Value).
|
|
656
659
|
`,v&&(A?c.push(`triple(Base, "${b}", "${_}")`):c.push(`triple(Base, "${b}", _)`))),I)g+=`property_setter(${a}, "${m}", Actions) :- ${I}.
|
|
657
|
-
`;else if(E&&typeof i[
|
|
660
|
+
`;else if(E&&typeof i[wp(m)]=="function"){let te=[{action:"setSingleTarget",source:"this",predicate:b,target:"value",...R&&{local:!0}}];g+=`property_setter(${a}, "${m}", '${Ar(te)}').
|
|
658
661
|
`}u.push(g),_&&(s.push({action:"addLink",source:"this",predicate:b,target:_}),o.push({action:"removeLink",source:"this",predicate:b,target:_}))}let p=[],d=i.__collections||{};for(let m in d){let g=`collection(${a}, "${m}").
|
|
659
662
|
`,{through:b,where:_,local:v}=d[m];if(b){if(_){if(!_.isInstance&&!_.condition)throw"'where' needs one of 'isInstance' or 'condition'";let D=[];if(_.isInstance){let R;_.isInstance.name?R=_.isInstance.name:R=_.isInstance,D.push(`instance(OtherClass, Target), subject_class("${R}", OtherClass)`)}_.condition&&D.push(_.condition);let I=D.join(", ");g+=`collection_getter(${a}, Base, "${m}", List) :- setof(Target, (triple(Base, "${b}", Target), ${I}), List).
|
|
660
663
|
`}else g+=`collection_getter(${a}, Base, "${m}", List) :- findall(C, triple(Base, "${b}", C), List).
|
|
@@ -1078,6 +1081,7 @@ type Subscription {
|
|
|
1078
1081
|
perspectiveSyncStateChange(uuid: String!): String!
|
|
1079
1082
|
perspectiveUpdated: PerspectiveHandle
|
|
1080
1083
|
runtimeMessageReceived: PerspectiveExpression
|
|
1084
|
+
runtimeNotificationRequested: Notification
|
|
1081
1085
|
runtimeNotificationTriggered: TriggeredNotification
|
|
1082
1086
|
}
|
|
1083
1087
|
|
|
@@ -1086,7 +1090,7 @@ type TriggeredNotification {
|
|
|
1086
1090
|
perspectiveId: String!
|
|
1087
1091
|
triggerMatch: String!
|
|
1088
1092
|
}
|
|
1089
|
-
`;function ap(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 xp(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`${ap(e)} your ${t} actions, with access to ${ap(n)}`}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},B=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,gt,Ra,ye,op=class{constructor(r,e,t){Be.set(this,void 0),gt.set(this,void 0),Ra.set(this,void 0),ye.set(this,void 0),Ir(this,Be,e||Ot.from(Ep(24)).toUrl(),"f"),Ir(this,ye,r,"f"),Ir(this,Ra,t||"ad4m://self","f")}get baseExpression(){return B(this,Be,"f")}async getData(r){let e=r??B(this,Be,"f"),t=await B(this,ye,"f").getSubjectData(B(this,gt,"f"),e);return Object.assign(this,t),Ir(this,Be,e,"f"),this}async setProperty(key,value){let setters=await B(this,ye,"f").infer(`subject_class("${B(this,gt,"f")}", C), property_setter(C, "${key}", Setter)`);if(setters&&setters.length>0){let actions=eval(setters[0].Setter),resolveLanguageResults=await B(this,ye,"f").infer(`subject_class("${B(this,gt,"f")}", C), property_resolve_language(C, "${key}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),resolveLanguage&&(value=await B(this,ye,"f").createExpression(value,resolveLanguage)),await B(this,ye,"f").executeAction(actions,B(this,Be,"f"),[{name:"value",value}])}}async setCollectionSetter(key,value){let collectionSetters=await B(this,ye,"f").infer(`subject_class("${B(this,gt,"f")}", C), collection_setter(C, "${$t(key)}", Setter)`);if(collectionSetters||(collectionSetters=[]),collectionSetters.length>0){let actions=eval(collectionSetters[0].Setter);value&&(Array.isArray(value)?await B(this,ye,"f").executeAction(actions,B(this,Be,"f"),value.map(r=>({name:"value",value:r}))):await B(this,ye,"f").executeAction(actions,B(this,Be,"f"),[{name:"value",value}]))}}async setCollectionAdder(key,value){let adders=await B(this,ye,"f").infer(`subject_class("${B(this,gt,"f")}", C), collection_adder(C, "${$t(key)}", Adder)`);if(adders||(adders=[]),adders.length>0){let actions=eval(adders[0].Adder);value&&(Array.isArray(value)?await Promise.all(value.map(r=>B(this,ye,"f").executeAction(actions,B(this,Be,"f"),[{name:"value",value:r}]))):await B(this,ye,"f").executeAction(actions,B(this,Be,"f"),[{name:"value",value}]))}}async setCollectionRemover(key,value){let removers=await B(this,ye,"f").infer(`subject_class("${B(this,gt,"f")}", C), collection_remover(C, "${$t(key)}", Remover)`);if(removers||(removers=[]),removers.length>0){let actions=eval(removers[0].Remover);value&&(Array.isArray(value)?await Promise.all(value.map(r=>B(this,ye,"f").executeAction(actions,B(this,Be,"f"),[{name:"value",value:r}]))):await B(this,ye,"f").executeAction(actions,B(this,Be,"f"),[{name:"value",value}]))}}async save(){Ir(this,gt,await B(this,ye,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await B(this,ye,"f").createSubject(this,B(this,Be,"f")),await B(this,ye,"f").add(new jr({source:B(this,Ra,"f"),predicate:"ad4m://has_child",target:this.baseExpression})),await this.update()}async update(){Ir(this,gt,await B(this,ye,"f").stringOrTemplateObjectToSubjectClass(this),"f");let r=Object.entries(this);for(let[e,t]of r)if(t!=null)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):t!=null&&t!==""&&await this.setProperty(e,t);await this.getData()}async get(){return Ir(this,gt,await B(this,ye,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await this.getData()}async delete(){await B(this,ye,"f").removeSubject(this,B(this,Be,"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(c=>({Base:c[1],Timestamp:c[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())):[]}};Be=new WeakMap,gt=new WeakMap,Ra=new WeakMap,ye=new WeakMap;var to="0.9.1-prerelease.7";function W1(){let r=new AbortController;return setTimeout(()=>r.abort(),20),r}function oc(r,e=1e4){return ue(this,null,function*(){return Promise.race([new Promise((t,n)=>{r.includes("localhost")||t(new WebSocket(r));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 ue(this,null,function*(){try{let e=yield fetch(`http://localhost:${r}/graphql/`,{signal:W1().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 K1(){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 Op(r,e){cc()&&localStorage.setItem(`${to}/${r}`,e)}function Wr(r){return cc()?localStorage.getItem(`${to}/${r}`):null}function Tp(r){cc()&&localStorage.removeItem(`${to}/${r}`)}var z1=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 z1(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:c,url:u}){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=u||`ws://localhost:${this.port}/graphql`,this.token=c||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,t=!0){return ue(this,null,function*(){try{if(e){yield oc(e,1e4),this.setUrl(e);let n=this.buildClient();return yield this.checkAuth(),n}else{let n=yield this.ensureConnection(t);return yield this.checkAuth(),n}}catch(n){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}loginToHosting(e,t){return ue(this,null,function*(){try{let n=yield fetch("https://hosting.ad4m.dev/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,password:t})});if(n.status===200){let i=yield n.json();localStorage.setItem("hosting_token",i.token);let a=localStorage.getItem("hosting_token"),o=yield fetch("https://hosting.ad4m.dev/api/service/info",{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+a}});if(o.status===200){let s=yield o.json();s.serviceId&&(this.setPort(s.port),this.setUrl(`wss://${s.port}.hosting.ad4m.dev/graphql`))}}else if((yield n.json()).message==="Passwords did not match")throw new Error("Passwords did not match")}catch(n){throw console.log(n),new Error(`Error logging in ${n}`)}})}checkEmail(e){return ue(this,null,function*(){try{return(yield fetch(`https://hosting.ad4m.dev/api/auth/check-email?email=${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})).status===200}catch(t){console.log(t)}})}connectToPort(e){return ue(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(e=!0){return ue(this,null,function*(){var n,i;if(((n=this.activeSocket)==null?void 0:n.readyState)===WebSocket.OPEN&&((i=this.activeSocket)==null?void 0:i.url)===this.url&&this.ad4mClient)return this.ad4mClient;try{return yield oc(this.url,1e4),this.buildClient()}catch(a){if(e)return this.connectToPort()}})}findPort(){return ue(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=$l({url:this.url,connectionParams:()=>ue(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||setTimeout(()=>ue(this,null,function*(){let e=yield this.connect(null,!1);e?this.ad4mClient=e:(this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1)}),1e4)}}}),this.apolloClient=new ks({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 ue(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 ue(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 ue(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 q`
|
|
1093
|
+
`;function sp(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 xp(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`${sp(e)} your ${t} actions, with access to ${sp(n)}`}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},B=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,gt,La,ye,cp=class{constructor(r,e,t){Be.set(this,void 0),gt.set(this,void 0),La.set(this,void 0),ye.set(this,void 0),Ir(this,Be,e||Ot.from(Ep(24)).toUrl(),"f"),Ir(this,ye,r,"f"),Ir(this,La,t||"ad4m://self","f")}get baseExpression(){return B(this,Be,"f")}async getData(r){let e=r??B(this,Be,"f");console.log("SubjectEntity: getData");let t=await B(this,ye,"f").getSubjectData(B(this,gt,"f"),e);return console.log("SubjectEntity got data:",t),Object.assign(this,t),Ir(this,Be,e,"f"),this}async setProperty(key,value){let setters=await B(this,ye,"f").infer(`subject_class("${B(this,gt,"f")}", C), property_setter(C, "${key}", Setter)`);if(setters&&setters.length>0){let actions=eval(setters[0].Setter),resolveLanguageResults=await B(this,ye,"f").infer(`subject_class("${B(this,gt,"f")}", C), property_resolve_language(C, "${key}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),resolveLanguage&&(value=await B(this,ye,"f").createExpression(value,resolveLanguage)),await B(this,ye,"f").executeAction(actions,B(this,Be,"f"),[{name:"value",value}])}}async setCollectionSetter(key,value){let collectionSetters=await B(this,ye,"f").infer(`subject_class("${B(this,gt,"f")}", C), collection_setter(C, "${$t(key)}", Setter)`);if(collectionSetters||(collectionSetters=[]),collectionSetters.length>0){let actions=eval(collectionSetters[0].Setter);value&&(Array.isArray(value)?await B(this,ye,"f").executeAction(actions,B(this,Be,"f"),value.map(r=>({name:"value",value:r}))):await B(this,ye,"f").executeAction(actions,B(this,Be,"f"),[{name:"value",value}]))}}async setCollectionAdder(key,value){let adders=await B(this,ye,"f").infer(`subject_class("${B(this,gt,"f")}", C), collection_adder(C, "${$t(key)}", Adder)`);if(adders||(adders=[]),adders.length>0){let actions=eval(adders[0].Adder);value&&(Array.isArray(value)?await Promise.all(value.map(r=>B(this,ye,"f").executeAction(actions,B(this,Be,"f"),[{name:"value",value:r}]))):await B(this,ye,"f").executeAction(actions,B(this,Be,"f"),[{name:"value",value}]))}}async setCollectionRemover(key,value){let removers=await B(this,ye,"f").infer(`subject_class("${B(this,gt,"f")}", C), collection_remover(C, "${$t(key)}", Remover)`);if(removers||(removers=[]),removers.length>0){let actions=eval(removers[0].Remover);value&&(Array.isArray(value)?await Promise.all(value.map(r=>B(this,ye,"f").executeAction(actions,B(this,Be,"f"),[{name:"value",value:r}]))):await B(this,ye,"f").executeAction(actions,B(this,Be,"f"),[{name:"value",value}]))}}async save(){Ir(this,gt,await B(this,ye,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await B(this,ye,"f").createSubject(this,B(this,Be,"f")),await B(this,ye,"f").add(new jr({source:B(this,La,"f"),predicate:"ad4m://has_child",target:this.baseExpression})),await this.update()}async update(){Ir(this,gt,await B(this,ye,"f").stringOrTemplateObjectToSubjectClass(this),"f");let r=Object.entries(this);for(let[e,t]of r)if(t!=null)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):t!=null&&t!==""&&await this.setProperty(e,t);await this.getData()}async get(){return Ir(this,gt,await B(this,ye,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await this.getData()}async delete(){await B(this,ye,"f").removeSubject(this,B(this,Be,"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(c=>({Base:c[1],Timestamp:c[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())):[]}};Be=new WeakMap,gt=new WeakMap,La=new WeakMap,ye=new WeakMap;var ro="0.10.0-prerelease";function W1(){let r=new AbortController;return setTimeout(()=>r.abort(),20),r}function cc(r,e=1e4){return ue(this,null,function*(){return Promise.race([new Promise((t,n)=>{r.includes("localhost")||t(new WebSocket(r));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 uc(r){return ue(this,null,function*(){try{let e=yield fetch(`http://localhost:${r}/graphql/`,{signal:W1().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 K1(){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 lc(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(r){return!1}return!0}function Op(r,e){lc()&&localStorage.setItem(`${ro}/${r}`,e)}function Wr(r){return lc()?localStorage.getItem(`${ro}/${r}`):null}function Tp(r){lc()&&localStorage.removeItem(`${ro}/${r}`)}var z1=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 Ti(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 z1(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 Ii=class{constructor({appName:e,appDesc:t,appIconPath:n,appUrl:i,appDomain:a,capabilities:o,port:s,token:c,url:u}){this.activeSocket=null;this.requestedRestart=!1;this.authState="unauthenticated";this.connectionState="not_connected";this.port=12e3;this.capabilities=[];this.listeners={authstatechange:[],configstatechange:[],connectionstatechange:[]};Ti(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=u||`ws://localhost:${this.port}/graphql`,this.token=c||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 ue(this,null,function*(){try{if(e){yield cc(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")}})}loginToHosting(e,t){return ue(this,null,function*(){try{let n=yield fetch("https://hosting.ad4m.dev/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,password:t})});if(n.status===200){let i=yield n.json();localStorage.setItem("hosting_token",i.token);let a=localStorage.getItem("hosting_token"),o=yield fetch("https://hosting.ad4m.dev/api/service/info",{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+a}});if(o.status===200){let s=yield o.json();s.serviceId&&(this.setPort(s.port),this.setUrl(`wss://${s.port}.hosting.ad4m.dev/graphql`))}}else if((yield n.json()).message==="Passwords did not match")throw new Error("Passwords did not match")}catch(n){throw console.log(n),new Error(`Error logging in ${n}`)}})}checkEmail(e){return ue(this,null,function*(){try{return(yield fetch(`https://hosting.ad4m.dev/api/auth/check-email?email=${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})).status===200}catch(t){console.log(t)}})}connectToPort(e){return ue(this,null,function*(){try{if(e){let t=yield uc(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 ue(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 cc(this.url,1e4),this.buildClient()}catch(i){return this.connectToPort()}})}findPort(){return ue(this,null,function*(){let e=[...Array(10).keys()].map((i,a)=>uc(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=jl({url:this.url,connectionParams:()=>ue(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||setTimeout(()=>ue(this,null,function*(){let e=yield this.connect();e?this.ad4mClient=e:(this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1)}),1e3)}}}),this.apolloClient=new Ds({link:new Ul(this.wsClient),cache:new fa({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"},mutate:{fetchPolicy:"no-cache"}}}),this.ad4mClient=new Ka(this.apolloClient),this.ad4mClient}checkAuth(){return ue(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 ue(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 ue(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 pc(){return q`
|
|
1090
1094
|
<div>
|
|
1091
1095
|
<div class="lds-ring">
|
|
1092
1096
|
<div></div>
|
|
@@ -1095,7 +1099,7 @@ type TriggeredNotification {
|
|
|
1095
1099
|
<div></div>
|
|
1096
1100
|
</div>
|
|
1097
1101
|
</div>
|
|
1098
|
-
`}function
|
|
1102
|
+
`}function fc({port:r,url:e,isRemote:t,connectToPort:n,changeIsRemote:i,connectRemote:a,changeState:o,changeUrl:s,changePort:c}){return q`
|
|
1099
1103
|
<div class="items items--small">
|
|
1100
1104
|
<div class="text-center">
|
|
1101
1105
|
<h1 class="heading">Connection Settings</h1>
|
|
@@ -1154,7 +1158,7 @@ type TriggeredNotification {
|
|
|
1154
1158
|
</button>
|
|
1155
1159
|
</div>`}
|
|
1156
1160
|
</div>
|
|
1157
|
-
`}function
|
|
1161
|
+
`}function dc({connect:r,isMobile:e,hasClickedDownload:t,changeState:n,onDownloaded:i,scanQrcode:a,hosting:o}){function s(c){c.preventDefault();let u=c.currentTarget;window.open(u.href,"_blank"),this.onDownloaded()}return q`
|
|
1158
1162
|
<div class="items">
|
|
1159
1163
|
${t?q`<div class="text-center">
|
|
1160
1164
|
<a class="button" target="_blank" @click=${()=>r()}>
|
|
@@ -1204,7 +1208,7 @@ type TriggeredNotification {
|
|
|
1204
1208
|
>
|
|
1205
1209
|
</div>
|
|
1206
1210
|
</div>
|
|
1207
|
-
`}function
|
|
1211
|
+
`}function hc({reconnect:r}){return q`
|
|
1208
1212
|
<div class="items items--small">
|
|
1209
1213
|
<div class="text-center">
|
|
1210
1214
|
<h1 class="heading">Could not connect to AD4M</h1>
|
|
@@ -1213,7 +1217,7 @@ type TriggeredNotification {
|
|
|
1213
1217
|
<button class="button" @click=${()=>r()}>Try again</button>
|
|
1214
1218
|
</div>
|
|
1215
1219
|
</div>
|
|
1216
|
-
`}function
|
|
1220
|
+
`}function mc({unlockAgent:r,reconnect:e}){return q`
|
|
1217
1221
|
<div class="text-center">
|
|
1218
1222
|
<div class="items">
|
|
1219
1223
|
<div>
|
|
@@ -1225,7 +1229,7 @@ type TriggeredNotification {
|
|
|
1225
1229
|
<button class="button" @click=${e}>Reconnect</button>
|
|
1226
1230
|
</div>
|
|
1227
1231
|
</div>
|
|
1228
|
-
`}function
|
|
1232
|
+
`}function gc(){return q`
|
|
1229
1233
|
<svg viewBox="0 0 692 670" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1230
1234
|
<defs>
|
|
1231
1235
|
<linearGradient id="gradient" x1="0" x2="1" y1="0" y2="0">
|
|
@@ -1238,7 +1242,7 @@ type TriggeredNotification {
|
|
|
1238
1242
|
fill="url(#gradient)"
|
|
1239
1243
|
/>
|
|
1240
1244
|
</svg>
|
|
1241
|
-
`}function
|
|
1245
|
+
`}function yc({capabilities:r,appname:e,appiconpath:t,changeState:n,setOpen:i,requestCapability:a}){return q`
|
|
1242
1246
|
<div class="items">
|
|
1243
1247
|
<div class="text-center">
|
|
1244
1248
|
<p class="body">An external application</p>
|
|
@@ -1248,7 +1252,7 @@ type TriggeredNotification {
|
|
|
1248
1252
|
${t&&q`<div class="dialog__connect">
|
|
1249
1253
|
<img class="dialog__connect-app" src=${t} alt="Logo" />
|
|
1250
1254
|
<div class="dialog__connect-check"></div>
|
|
1251
|
-
<div class="dialog__connect-ad4m">${
|
|
1255
|
+
<div class="dialog__connect-ad4m">${gc()}</div>
|
|
1252
1256
|
</div>`}
|
|
1253
1257
|
<div>
|
|
1254
1258
|
<p class="text-center"><b>This will allow the developer to:</b></p>
|
|
@@ -1292,7 +1296,7 @@ type TriggeredNotification {
|
|
|
1292
1296
|
Connection settings
|
|
1293
1297
|
</button>
|
|
1294
1298
|
</div>
|
|
1295
|
-
`}function
|
|
1299
|
+
`}function vc({code:r,changeState:e,verifyCode:t,changeCode:n}){return q`
|
|
1296
1300
|
<div class="items">
|
|
1297
1301
|
<div class="text-center">
|
|
1298
1302
|
<div class="heading">Please check Ad4m</div>
|
|
@@ -1323,7 +1327,7 @@ type TriggeredNotification {
|
|
|
1323
1327
|
</button>
|
|
1324
1328
|
</div>
|
|
1325
1329
|
</div>
|
|
1326
|
-
`}function
|
|
1330
|
+
`}function bc(){return q`
|
|
1327
1331
|
<div class="items">
|
|
1328
1332
|
<div class="text-center">
|
|
1329
1333
|
<h1 class="heading">Request to AD4M blocked</h1>
|
|
@@ -1344,7 +1348,7 @@ type TriggeredNotification {
|
|
|
1344
1348
|
</button>
|
|
1345
1349
|
</div>
|
|
1346
1350
|
</div>
|
|
1347
|
-
`}function
|
|
1351
|
+
`}function Cc({changeState:r,onSuccess:e,uiState:t}){function n(i){let a=new BarcodeDetector,o=i.currentTarget,s=()=>ue(this,null,function*(){try{if(t!=="qr")return;let u=(yield a.detect(o)).find(l=>l.format==="qr_code");if(u!=null&&u.rawValue){r("requestcap"),e(u.rawValue);return}else requestAnimationFrame(s)}catch(c){console.error(c)}});s()}return q`
|
|
1348
1352
|
<div class="qr-scanner">
|
|
1349
1353
|
<div class="qr-content">
|
|
1350
1354
|
<button
|
|
@@ -1363,7 +1367,7 @@ type TriggeredNotification {
|
|
|
1363
1367
|
></video>
|
|
1364
1368
|
</div>
|
|
1365
1369
|
</div>
|
|
1366
|
-
`}function
|
|
1370
|
+
`}function Sc(){return q`<header class="dialog__header">
|
|
1367
1371
|
<div class="dialog__logo">
|
|
1368
1372
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 37" fill="none">
|
|
1369
1373
|
<path
|
|
@@ -1372,7 +1376,7 @@ type TriggeredNotification {
|
|
|
1372
1376
|
/>
|
|
1373
1377
|
</svg>
|
|
1374
1378
|
</div>
|
|
1375
|
-
</header>`}function
|
|
1379
|
+
</header>`}function wc({step:r,email:e,changeEmail:t,changeState:n,password:i,changePassword:a,login:o,checkEmail:s,passwordError:c,setHostingStep:u}){if(r===0)return q`
|
|
1376
1380
|
<div class="input">
|
|
1377
1381
|
<label class="input__label">EMAIL</label>
|
|
1378
1382
|
<input
|
|
@@ -1435,7 +1439,7 @@ type TriggeredNotification {
|
|
|
1435
1439
|
Back
|
|
1436
1440
|
</button>
|
|
1437
1441
|
</div>
|
|
1438
|
-
`}function H1(){return[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i].some(e=>navigator.userAgent.match(e))}var J1=
|
|
1442
|
+
`}function H1(){return[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i].some(e=>navigator.userAgent.match(e))}var J1=io`
|
|
1439
1443
|
:host {
|
|
1440
1444
|
--primary-color: #fff;
|
|
1441
1445
|
--heading-color: #fff;
|
|
@@ -1832,15 +1836,15 @@ type TriggeredNotification {
|
|
|
1832
1836
|
width: 100vw;
|
|
1833
1837
|
object-fit: cover;
|
|
1834
1838
|
}
|
|
1835
|
-
`,le=class extends qt{constructor(){super(...arguments);this._code=null;this._isMobile=null;this._hasClickedDownload=null;this._isRemote=!1;this._isOpen=!1;this._hostingStep=0;this._email="";this._passowrd="";this._passwordError=null;this._isHostingLoading=!1;this.uiState="start";this.appName=null;this.appDesc=null;this.appDomain=null;this.appIconPath=null;this.capabilities=[];this.hosting=!1;this.token=Wr("ad4mToken")||"";this.port=parseInt(Wr("ad4mport"))||12e3;this.url=Wr("ad4murl")||""}get authState(){return this._client.authState}get connectionState(){return this._client.connectionState}connectedCallback(){super.connectedCallback(),
|
|
1839
|
+
`,le=class extends qt{constructor(){super(...arguments);this._code=null;this._isMobile=null;this._hasClickedDownload=null;this._isRemote=!1;this._isOpen=!1;this._hostingStep=0;this._email="";this._passowrd="";this._passwordError=null;this._isHostingLoading=!1;this.uiState="start";this.appName=null;this.appDesc=null;this.appDomain=null;this.appIconPath=null;this.capabilities=[];this.hosting=!1;this.token=Wr("ad4mToken")||"";this.port=parseInt(Wr("ad4mport"))||12e3;this.url=Wr("ad4murl")||""}get authState(){return this._client.authState}get connectionState(){return this._client.connectionState}connectedCallback(){super.connectedCallback(),Ti(this),this._isMobile=H1(),this._client=new Ii({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(Wr("ad4mport"))||12e3,token:this.token||Wr("ad4mtoken"),url:this.url||Wr("ad4murl")}),this._client.on("configstatechange",this.handleConfigChange),this._client.on("authstatechange",this.handleAuthChange),this._client.on("connectionstatechange",this.handleConnectionChange),this.loadFont()}checkEmail(){return ue(this,null,function*(){try{(yield this._client.checkEmail(this._email))?this._hostingStep=1:this._hostingStep=2}catch(t){console.log(t)}})}loginToHosting(){return ue(this,null,function*(){try{yield this._client.loginToHosting(this._email,this._passowrd),this.changeUIState("connected")}catch(t){this._passwordError="Passwords did not match"}})}changeEmail(t){this._email=t}changePassword(t){this._passowrd=t}unlockAgent(t,n=!0){return ue(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?Op("ad4m"+t,n):Tp("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 ue(this,null,function*(){try{window.BarcodeDetector.getSupportedFormats()}catch(n){window.BarcodeDetector=Bt}yield this.changeUIState("qr"),setTimeout(()=>ue(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 ue(this,null,function*(){return this._isOpen=!0,this.requestUpdate(),yield this._client.connect()})}getAd4mClient(){return this._client.ad4mClient}connectRemote(t){return ue(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 ue(this,null,function*(){try{yield this._client.requestCapability(t),this.changeUIState("verifycode")}catch(n){console.warn(n)}})}isAuthenticated(){return ue(this,null,function*(){return this._client.checkAuth()})}setOpen(t){this._isOpen=t}setHostingStep(t){this._hostingStep=t}renderViews(){if(this.connectionState==="connecting")return pc();if(this.uiState==="hosting")return wc({email:this._email,password:this._passowrd,changeEmail:this.changeEmail,changePassword:this.changePassword,changeState:this.changeUIState,step:this._hostingStep,setHostingStep:this.setHostingStep,login:this.loginToHosting,checkEmail:this.checkEmail,passwordError:this._passwordError});if(this.uiState==="qr")return Cc({changeState:this.changeUIState,onSuccess:t=>{this.changeUrl(t),this._client.connect(t)},uiState:this.uiState});if(this.authState==="locked")return mc({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 dc({scanQrcode:this.startCamera,connect:this.connect,isMobile:this._isMobile,hasClickedDownload:this._hasClickedDownload,onDownloaded:this.onDownloaded,changeState:this.changeUIState,hosting:this.hosting});if(this.connectionState==="connected")return this.uiState==="verifycode"?vc({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 hc({reconnect:this.connect});if(this.connectionState==="port_not_found")return bc()}render(){return this._isOpen===!1||this.authState==="authenticated"?null:q`
|
|
1836
1840
|
<div class="wrapper">
|
|
1837
1841
|
<div class="dialog">
|
|
1838
|
-
${
|
|
1842
|
+
${Sc()}
|
|
1839
1843
|
<main class="dialog__content">${this.renderViews()}</main>
|
|
1840
1844
|
</div>
|
|
1841
1845
|
<div class="ad4mConnect__backdrop" />
|
|
1842
1846
|
</div>
|
|
1843
|
-
`}};le.styles=[J1],he([Ye()],le.prototype,"_code",2),he([Ye()],le.prototype,"_isMobile",2),he([Ye()],le.prototype,"_hasClickedDownload",2),he([Ye()],le.prototype,"_isRemote",2),he([Ye()],le.prototype,"_client",2),he([Ye()],le.prototype,"_isOpen",2),he([Ye()],le.prototype,"_hostingStep",2),he([Ye()],le.prototype,"_email",2),he([Ye()],le.prototype,"_passowrd",2),he([Ye()],le.prototype,"_passwordError",2),he([Ye()],le.prototype,"_isHostingLoading",2),he([Ye()],le.prototype,"uiState",2),he([it({type:String,reflect:!0})],le.prototype,"appName",2),he([it({type:String,reflect:!0})],le.prototype,"appDesc",2),he([it({type:String,reflect:!0})],le.prototype,"appDomain",2),he([it({type:String,reflect:!0})],le.prototype,"appIconPath",2),he([it({type:String,reflect:!0})],le.prototype,"capabilities",2),he([it({type:Boolean,reflect:!0})],le.prototype,"hosting",2),he([it({type:String})],le.prototype,"token",2),he([it({type:String,reflect:!0})],le.prototype,"port",2),he([it({type:String,reflect:!0})],le.prototype,"url",2),le=he([
|
|
1847
|
+
`}};le.styles=[J1],he([Ye()],le.prototype,"_code",2),he([Ye()],le.prototype,"_isMobile",2),he([Ye()],le.prototype,"_hasClickedDownload",2),he([Ye()],le.prototype,"_isRemote",2),he([Ye()],le.prototype,"_client",2),he([Ye()],le.prototype,"_isOpen",2),he([Ye()],le.prototype,"_hostingStep",2),he([Ye()],le.prototype,"_email",2),he([Ye()],le.prototype,"_passowrd",2),he([Ye()],le.prototype,"_passwordError",2),he([Ye()],le.prototype,"_isHostingLoading",2),he([Ye()],le.prototype,"uiState",2),he([it({type:String,reflect:!0})],le.prototype,"appName",2),he([it({type:String,reflect:!0})],le.prototype,"appDesc",2),he([it({type:String,reflect:!0})],le.prototype,"appDomain",2),he([it({type:String,reflect:!0})],le.prototype,"appIconPath",2),he([it({type:String,reflect:!0})],le.prototype,"capabilities",2),he([it({type:Boolean,reflect:!0})],le.prototype,"hosting",2),he([it({type:String})],le.prototype,"token",2),he([it({type:String,reflect:!0})],le.prototype,"port",2),he([it({type:String,reflect:!0})],le.prototype,"url",2),le=he([Bc("ad4m-connect")],le);function Y1(r){let e=new le;return Object.entries(r).forEach(([t,n])=>{e[t]=n}),document.body.appendChild(e),e}export{le as Ad4mConnectElement,Y1 as default,K1 as getAd4mClient};
|
|
1844
1848
|
/*!
|
|
1845
1849
|
* @undecaf/barcode-detector-polyfill v0.9.20
|
|
1846
1850
|
* A WebAssembly polyfill for the Barcode Detection API
|