@coasys/ad4m-connect 0.9.0 → 0.9.1-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/components/Hosting.d.ts +12 -0
- package/dist/components/Start.d.ts +2 -1
- package/dist/core.d.ts +3 -0
- package/dist/core.js +26 -26
- package/dist/utils.js +1 -1
- package/dist/web.d.ts +11 -0
- package/dist/web.js +259 -155
- package/package.json +1 -1
package/dist/web.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
var
|
|
2
|
-
\f\r]`,Nn=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ac=/'/g,Ic=/"/g,Rc=/^(?:script|style|textarea|title)$/i,Lc=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),Y=Lc(1),eh=Lc(2),hr=Symbol.for("lit-noChange"),Ae=Symbol.for("lit-nothing"),kc=new WeakMap,fr=dr.createTreeWalker(dr,129,null,!1);function Fc(r,e){if(!Array.isArray(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return xc!==void 0?xc.createHTML(e):e}var Dp=(r,e)=>{let t=r.length-1,n=[],i,a=e===2?"<svg>":"",o=Nn;for(let s=0;s<t;s++){let u=r[s],l,p,f=-1,h=0;for(;h<u.length&&(o.lastIndex=h,p=o.exec(u),p!==null);)h=o.lastIndex,o===Nn?p[1]==="!--"?o=Oc:p[1]!==void 0?o=Tc:p[2]!==void 0?(Rc.test(p[2])&&(i=RegExp("</"+p[2],"g")),o=pr):p[3]!==void 0&&(o=pr):o===pr?p[0]===">"?(o=i??Nn,f=-1):p[1]===void 0?f=-2:(f=o.lastIndex-p[2].length,l=p[1],o=p[3]===void 0?pr:p[3]==='"'?Ic:Ac):o===Ic||o===Ac?o=pr:o===Oc||o===Tc?o=Nn:(o=pr,i=void 0);let d=o===pr&&r[s+1].startsWith("/>")?" ":"";a+=o===Nn?u+Ip:f>=0?(n.push(l),u.slice(0,f)+lo+u.slice(f)+qt+d):u+qt+(f===-2?(n.push(void 0),s):d)}return[Fc(r,a+(r[t]||"<?>")+(e===2?"</svg>":"")),n]},mr=class{constructor({strings:e,_$litType$:t},n){let i;this.parts=[];let a=0,o=0,s=e.length-1,u=this.parts,[l,p]=Dp(e,t);if(this.el=mr.createElement(l,n),fr.currentNode=this.el.content,t===2){let f=this.el.content,h=f.firstChild;h.remove(),f.append(...h.childNodes)}for(;(i=fr.nextNode())!==null&&u.length<s;){if(i.nodeType===1){if(i.hasAttributes()){let f=[];for(let h of i.getAttributeNames())if(h.endsWith(lo)||h.startsWith(qt)){let d=p[o++];if(f.push(h),d!==void 0){let y=i.getAttribute(d.toLowerCase()+lo).split(qt),g=/([.?@])?(.*)/.exec(d);u.push({type:1,index:a,name:g[2],strings:y,ctor:g[1]==="."?fo:g[1]==="?"?ho:g[1]==="@"?mo:Yr})}else u.push({type:6,index:a})}for(let h of f)i.removeAttribute(h)}if(Rc.test(i.tagName)){let f=i.textContent.split(qt),h=f.length-1;if(h>0){i.textContent=Hr?Hr.emptyScript:"";for(let d=0;d<h;d++)i.append(f[d],Pn()),fr.nextNode(),u.push({type:2,index:++a});i.append(f[h],Pn())}}}else if(i.nodeType===8)if(i.data===Nc)u.push({type:2,index:a});else{let f=-1;for(;(f=i.data.indexOf(qt,f+1))!==-1;)u.push({type:7,index:a}),f+=qt.length-1}a++}}static createElement(e,t){let n=dr.createElement("template");return n.innerHTML=e,n}};function Jr(r,e,t=r,n){var i,a,o,s;if(e===hr)return e;let u=n!==void 0?(i=t._$Co)===null||i===void 0?void 0:i[n]:t._$Cl,l=Rn(e)?void 0:e._$litDirective$;return u?.constructor!==l&&((a=u?._$AO)===null||a===void 0||a.call(u,!1),l===void 0?u=void 0:(u=new l(r),u._$AT(r,t,n)),n!==void 0?((o=(s=t)._$Co)!==null&&o!==void 0?o:s._$Co=[])[n]=u:t._$Cl=u),u!==void 0&&(e=Jr(r,u._$AS(r,e.values),u,n)),e}var po=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var t;let{el:{content:n},parts:i}=this._$AD,a=((t=e?.creationScope)!==null&&t!==void 0?t:dr).importNode(n,!0);fr.currentNode=a;let o=fr.nextNode(),s=0,u=0,l=i[0];for(;l!==void 0;){if(s===l.index){let p;l.type===2?p=new yr(o,o.nextSibling,this,e):l.type===1?p=new l.ctor(o,l.name,l.strings,this,e):l.type===6&&(p=new yo(o,this,e)),this._$AV.push(p),l=i[++u]}s!==l?.index&&(o=fr.nextNode(),s++)}return fr.currentNode=dr,a}v(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}},yr=class{constructor(e,t,n,i){var a;this.type=2,this._$AH=Ae,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=i,this._$Cp=(a=i?.isConnected)===null||a===void 0||a}get _$AU(){var e,t;return(t=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&t!==void 0?t:this._$Cp}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Jr(this,e,t),Rn(e)?e===Ae||e==null||e===""?(this._$AH!==Ae&&this._$AR(),this._$AH=Ae):e!==this._$AH&&e!==hr&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):kp(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==Ae&&Rn(this._$AH)?this._$AA.nextSibling.data=e:this.$(dr.createTextNode(e)),this._$AH=e}g(e){var t;let{values:n,_$litType$:i}=e,a=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=mr.createElement(Fc(i.h,i.h[0]),this.options)),i);if(((t=this._$AH)===null||t===void 0?void 0:t._$AD)===a)this._$AH.v(n);else{let o=new po(a,this),s=o.u(this.options);o.v(n),this.$(s),this._$AH=o}}_$AC(e){let t=kc.get(e.strings);return t===void 0&&kc.set(e.strings,t=new mr(e)),t}T(e){Pc(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,n,i=0;for(let a of e)i===t.length?t.push(n=new yr(this.k(Pn()),this.k(Pn()),this,this.options)):n=t[i],n._$AI(a),i++;i<t.length&&(this._$AR(n&&n._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){var n;for((n=this._$AP)===null||n===void 0||n.call(this,!1,!0,t);e&&e!==this._$AB;){let i=e.nextSibling;e.remove(),e=i}}setConnected(e){var t;this._$AM===void 0&&(this._$Cp=e,(t=this._$AP)===null||t===void 0||t.call(this,e))}},Yr=class{constructor(e,t,n,i,a){this.type=1,this._$AH=Ae,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=a,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=Ae}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,n,i){let a=this.strings,o=!1;if(a===void 0)e=Jr(this,e,t,0),o=!Rn(e)||e!==this._$AH&&e!==hr,o&&(this._$AH=e);else{let s=e,u,l;for(e=a[0],u=0;u<a.length-1;u++)l=Jr(this,s[n+u],t,u),l===hr&&(l=this._$AH[u]),o||(o=!Rn(l)||l!==this._$AH[u]),l===Ae?e=Ae:e!==Ae&&(e+=(l??"")+a[u+1]),this._$AH[u]=l}o&&!i&&this.j(e)}j(e){e===Ae?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},fo=class extends Yr{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Ae?void 0:e}},Np=Hr?Hr.emptyScript:"",ho=class extends Yr{constructor(){super(...arguments),this.type=4}j(e){e&&e!==Ae?this.element.setAttribute(this.name,Np):this.element.removeAttribute(this.name)}},mo=class extends Yr{constructor(e,t,n,i,a){super(e,t,n,i,a),this.type=5}_$AI(e,t=this){var n;if((e=(n=Jr(this,e,t,0))!==null&&n!==void 0?n:Ae)===hr)return;let i=this._$AH,a=e===Ae&&i!==Ae||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,o=e!==Ae&&(i===Ae||a);a&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,n;typeof this._$AH=="function"?this._$AH.call((n=(t=this.options)===null||t===void 0?void 0:t.host)!==null&&n!==void 0?n:this.element,e):this._$AH.handleEvent(e)}},yo=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){Jr(this,e)}};var Dc=Ni.litHtmlPolyfillSupport;Dc?.(mr,yr),((co=Ni.litHtmlVersions)!==null&&co!==void 0?co:Ni.litHtmlVersions=[]).push("2.8.0");var $c=(r,e,t)=>{var n,i;let a=(n=t?.renderBefore)!==null&&n!==void 0?n:e,o=a._$litPart$;if(o===void 0){let s=(i=t?.renderBefore)!==null&&i!==void 0?i:null;a._$litPart$=o=new yr(e.insertBefore(Pn(),s),s,void 0,t??{})}return o._$AI(r),o};var go,vo;var Bt=class extends kt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;let n=super.createRenderRoot();return(e=(t=this.renderOptions).renderBefore)!==null&&e!==void 0||(t.renderBefore=n.firstChild),n}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=$c(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return hr}};Bt.finalized=!0,Bt._$litElement$=!0,(go=globalThis.litElementHydrateSupport)===null||go===void 0||go.call(globalThis,{LitElement:Bt});var Mc=globalThis.litElementPolyfillSupport;Mc?.({LitElement:Bt});((vo=globalThis.litElementVersions)!==null&&vo!==void 0?vo:globalThis.litElementVersions=[]).push("3.3.3");var jc=r=>e=>typeof e=="function"?((t,n)=>(customElements.define(t,n),n))(r,e):((t,n)=>{let{kind:i,elements:a}=n;return{kind:i,elements:a,finisher(o){customElements.define(t,o)}}})(r,e);var Pp=(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)}},Rp=(r,e,t)=>{e.constructor.createProperty(t,r)};function ut(r){return(e,t)=>t!==void 0?Rp(r,e,t):Pp(r,e)}function Vt(r){return ut({...r,state:!0})}var bo,Th=((bo=window.HTMLSlotElement)===null||bo===void 0?void 0:bo.prototype.assignedElements)!=null?(r,e)=>r.assignedElements(e):(r,e)=>r.assignedNodes(e).filter(t=>t.nodeType===Node.ELEMENT_NODE);import{ZBarSymbolType as X,ZBarConfigType as qc,scanRGBABuffer as Lp,getDefaultScanner as Fp}from"https://cdn.jsdelivr.net/npm/@undecaf/zbar-wasm@0.9.15/dist/main.js";function $p(r,e,t,n){return new(t||(t=Promise))(function(i,a){function o(l){try{u(n.next(l))}catch(p){a(p)}}function s(l){try{u(n.throw(l))}catch(p){a(p)}}function u(l){var p;l.done?i(l.value):(p=l.value,p instanceof t?p:new t(function(f){f(p)})).then(o,s)}u((n=n.apply(r,e||[])).next())})}var D=class{constructor(e,t=qc.ZBAR_CFG_ENABLE,n=1){this.symbolType=e,this.configType=t,this.number=n,this.configSteps=[this]}static register(e,t,n=t.symbolType){return D.formatsToConfigs[e]=t,D.typesToFormats[n]=D.typesToFormats[n]||e,t}static formats(){return Object.keys(D.formatsToConfigs)}static toFormat(e){return D.typesToFormats[e]}static configure(e,t){var n;(n=D.formatsToConfigs[t])===null||n===void 0||n.configSteps.forEach(i=>e.setConfig(i.symbolType,i.configType,i.number))}add(e){return this.configSteps.push(e),this}},Uc;D.formatsToConfigs={},D.typesToFormats={},D.register("codabar",new D(X.ZBAR_CODABAR)),D.register("code_39",new D(X.ZBAR_CODE39)),D.register("code_93",new D(X.ZBAR_CODE93)),D.register("code_128",new D(X.ZBAR_CODE128)),D.register("databar",new D(X.ZBAR_DATABAR)),D.register("databar_exp",new D(X.ZBAR_DATABAR_EXP)),D.register("ean_2",new D(X.ZBAR_EAN2)),D.register("ean_5",new D(X.ZBAR_EAN5)),D.register("ean_8",new D(X.ZBAR_EAN8)),D.register("ean_13",new D(X.ZBAR_EAN13)),D.register("ean_13+2",new D(X.ZBAR_EAN13)).add(new D(X.ZBAR_EAN2)),D.register("ean_13+5",new D(X.ZBAR_EAN13)).add(new D(X.ZBAR_EAN5)),D.register("isbn_10",new D(X.ZBAR_ISBN10)).add(new D(X.ZBAR_EAN13)),D.register("isbn_13",new D(X.ZBAR_ISBN13)).add(new D(X.ZBAR_EAN13)),D.register("isbn_13+2",new D(X.ZBAR_ISBN13)).add(new D(X.ZBAR_EAN13)).add(new D(X.ZBAR_EAN2)),D.register("isbn_13+5",new D(X.ZBAR_ISBN13)).add(new D(X.ZBAR_EAN13)).add(new D(X.ZBAR_EAN5)),D.register("itf",new D(X.ZBAR_I25)),D.register("qr_code",new D(X.ZBAR_QRCODE)),D.register("sq_code",new D(X.ZBAR_SQCODE)),D.register("upc_a",new D(X.ZBAR_UPCA)).add(new D(X.ZBAR_EAN13)),D.register("upc_e",new D(X.ZBAR_UPCE)).add(new D(X.ZBAR_EAN13)),function(r){r[r.UNKNOWN=-1]="UNKNOWN",r[r.UPRIGHT=0]="UPRIGHT",r[r.ROTATED_RIGHT=1]="ROTATED_RIGHT",r[r.UPSIDE_DOWN=2]="UPSIDE_DOWN",r[r.ROTATED_LEFT=3]="ROTATED_LEFT"}(Uc||(Uc={}));var Co=class{},Mp=(()=>{try{return new OffscreenCanvas(1,1).getContext("2d")instanceof OffscreenCanvasRenderingContext2D}catch{return!1}})(),Qt=class{constructor(e={}){if(e.formats!==void 0){if(!Array.isArray(e.formats)||!e.formats.length)throw new TypeError(`Barcode formats should be a non-empty array of strings but are: ${JSON.stringify(e)}`);let t=e.formats.filter(n=>!D.formats().includes(n));if(t.length)throw new TypeError(`Unsupported barcode format(s): ${t.join(", ")}`)}this.formats=e.formats||D.formats(),this.zbarConfig=e.zbar||new Co}static getSupportedFormats(){return Promise.resolve(D.formats())}detect(e){if(!Qt.isImageBitmapSource(e))throw new TypeError("BarcodeDetector.detect() argument is not an ImageBitmapSource");let t=Qt.intrinsicDimensions(e);if(t.width===0||t.height===0)return Promise.resolve([]);try{return Promise.all([this.toImageData(e),this.getScanner()]).then(n=>{let i=n[0],a=n[1];return this.zbarConfig.enableCache!==void 0&&a.enableCache(this.zbarConfig.enableCache),Lp(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)=>$p(this,void 0,void 0,function*(){if(!this.scanner){let n=yield Fp();this.formats.length>0&&(n.setConfig(X.ZBAR_NONE,qc.ZBAR_CFG_ENABLE,0),this.formats.forEach(i=>D.configure(n,i))),this.scanner=n}e(this.scanner)}))}toImageData(e){let t=n=>{let i=Qt.intrinsicDimensions(n);this.canvas&&this.canvas.width===i.width&&this.canvas.height===i.height||(this.canvas=function(s,u){if(Mp)return new OffscreenCanvas(s,u);{let l=document.createElement("canvas");return l.width=s,l.height=u,l}}(i.width,i.height));let a=this.canvas,o=a.getContext("2d");return o.drawImage(n,0,0),o.getImageData(0,0,a.width,a.height)};if(e instanceof ImageData)return Promise.resolve(e);if(e instanceof Blob){let n=document.createElement("img");return n.src=URL.createObjectURL(e),n.decode().then(()=>t(n)).finally(()=>URL.revokeObjectURL(n.src))}return e instanceof CanvasRenderingContext2D?Promise.resolve(e.getImageData(0,0,e.canvas.width,e.canvas.height)):Promise.resolve(t(e))}toBarcodeDetectorResult(e){let t={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0};return e.points.forEach(n=>{t.minX=Math.min(t.minX,n.x),t.maxX=Math.max(t.maxX,n.x),t.minY=Math.min(t.minY,n.y),t.maxY=Math.max(t.maxY,n.y)}),{format:D.toFormat(e.type),rawValue:e.decode(this.zbarConfig.encoding),orientation:e.orientation,quality:e.quality,boundingBox:DOMRectReadOnly.fromRect({x:t.minX,y:t.minY,width:t.maxX-t.minX,height:t.maxY-t.minY}),cornerPoints:[{x:t.minX,y:t.minY},{x:t.maxX,y:t.minY},{x:t.maxX,y:t.maxY},{x:t.minX,y:t.maxY}]}}static isImageBitmapSource(e){return e instanceof HTMLImageElement||e instanceof HTMLVideoElement||e instanceof HTMLCanvasElement||e instanceof Blob||e instanceof ImageData||e instanceof CanvasRenderingContext2D||e instanceof ImageBitmap||e&&e.width==0||e&&e.height==0}static intrinsicDimensions(e){return{width:Number(e.naturalWidth||e.videoWidth||e.width),height:Number(e.naturalHeight||e.videoHeight||e.height)}}};var So=function(r,e){return So=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},So(r,e)};function ge(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");So(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var m=function(){return m=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},m.apply(this,arguments)};function 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 lt(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(p){try{l(n.next(p))}catch(f){o(f)}}function u(p){try{l(n.throw(p))}catch(f){o(f)}}function l(p){p.done?a(p.value):i(p.value).then(s,u)}l((n=n.apply(r,e||[])).next())})}function pt(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(l){return function(p){return u([l,p])}}function u(l){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(t=0)),t;)try{if(n=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,i=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){t.label=l[1];break}if(l[0]===6&&t.label<a[1]){t.label=a[1],a=l;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(l);break}a[2]&&t.ops.pop(),t.trys.pop();continue}l=e.call(r,t)}catch(p){l=[6,p],i=0}finally{n=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Wt(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return r.concat(a||Array.prototype.slice.call(e))}var wo="Invariant Violation",Bc=Object.setPrototypeOf,jp=Bc===void 0?function(r,e){return r.__proto__=e,r}:Bc,U=function(r){ge(e,r);function e(t){t===void 0&&(t=wo);var n=r.call(this,typeof t=="number"?wo+": "+t+" (see https://github.com/apollographql/invariant-packages)":t)||this;return n.framesToPop=1,n.name=wo,jp(n,e.prototype),n}return e}(Error);function T(r,e){if(!r)throw new U(e)}var Ri=["debug","log","warn","error","silent"],_o=Ri.indexOf("log");function Pi(r){return function(){if(Ri.indexOf(r)>=_o){var e=console[r]||console.log;return e.apply(console,arguments)}}}(function(r){r.debug=Pi("debug"),r.log=Pi("log"),r.warn=Pi("warn"),r.error=Pi("error")})(T||(T={}));function Vc(r){var e=Ri[_o];return _o=Math.max(0,Ri.indexOf(r)),e}function Ie(r){try{return r()}catch{}}var Li=Ie(function(){return globalThis})||Ie(function(){return window})||Ie(function(){return self})||Ie(function(){return global})||Ie(function(){return Ie.constructor("return this")()});var Qc="__",Wc=[Qc,Qc].join("DEV");function Up(){try{return Boolean(__DEV__)}catch{return Object.defineProperty(Li,Wc,{value:Ie(function(){return"production"})!=="production",enumerable:!1,configurable:!0,writable:!0}),Li[Wc]}}var gr=Up();function Gt(r){try{return r()}catch{}}var Eo=Gt(function(){return globalThis})||Gt(function(){return window})||Gt(function(){return self})||Gt(function(){return global})||Gt(function(){return Gt.constructor("return this")()}),xo=!1;function qp(){Eo&&!Gt(function(){return"production"})&&!Gt(function(){return process})&&(Object.defineProperty(Eo,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),xo=!0)}qp();function Oo(){xo&&(delete Eo.process,xo=!1)}var t2=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",r2=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator",Gc=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";var we=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});function To(r,e){var t=Boolean(r);if(!t)throw new Error(e??"Unexpected invariant triggered.")}var Bp=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,Fn=Bp;function Fi(r){var e=r.prototype.toJSON;typeof e=="function"||To(0),r.prototype.inspect=e,Fn&&(r.prototype[Fn]=e)}var Kc=function(){function r(t,n,i){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=i}var e=r.prototype;return e.toJSON=function(){return{start:this.start,end:this.end}},r}();Fi(Kc);var zc=function(){function r(t,n,i,a,o,s,u){this.kind=t,this.start=n,this.end=i,this.line=a,this.column=o,this.value=u,this.prev=s,this.next=null}var e=r.prototype;return e.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},r}();Fi(zc);function Ao(r){return r!=null&&typeof r.kind=="string"}function $i(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?$i=function(t){return typeof t}:$i=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$i(r)}var Vp=10,Hc=2;function $n(r){return Mi(r,[])}function Mi(r,e){switch($i(r)){case"string":return JSON.stringify(r);case"function":return r.name?"[function ".concat(r.name,"]"):"[function]";case"object":return r===null?"null":Qp(r,e);default:return String(r)}}function Qp(r,e){if(e.indexOf(r)!==-1)return"[Circular]";var t=[].concat(e,[r]),n=Kp(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 Gp(r,t);return Wp(r,t)}function Wp(r,e){var t=Object.keys(r);if(t.length===0)return"{}";if(e.length>Hc)return"["+zp(r)+"]";var n=t.map(function(i){var a=Mi(r[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function Gp(r,e){if(r.length===0)return"[]";if(e.length>Hc)return"[Array]";for(var t=Math.min(Vp,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 Kp(r){var e=r[String(Fn)];if(typeof e=="function")return e;if(typeof r.inspect=="function")return r.inspect}function zp(r){var e=Object.prototype.toString.call(r).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof r.constructor=="function"){var t=r.constructor.name;if(typeof t=="string"&&t!=="")return t}return e}function Mn(r,e){var t=Boolean(r);if(!t)throw new Error(e)}function Jc(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function Hp(r,e,t){return e&&Jc(r.prototype,e),t&&Jc(r,t),r}var ji=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GraphQL request",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{line:1,column:1};typeof e=="string"||Mn(0,"Body must be a string. Received: ".concat($n(e),".")),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||Mn(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Mn(0,"column in locationOffset is 1-indexed and must be positive.")}return Hp(r,[{key:Gc,get:function(){return"Source"}}]),r}();function Yc(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=r.indexOf(`
|
|
1
|
+
var Tp=Object.defineProperty;var Ap=Object.getOwnPropertyDescriptor;var me=(r,e,t,n)=>{for(var i=n>1?void 0:n?Ap(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&&Tp(e,t,i),i};var ue=(r,e,t)=>new Promise((n,i)=>{var a=u=>{try{s(t.next(u))}catch(l){i(l)}},o=u=>{try{s(t.throw(u))}catch(l){i(l)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(a,o);s((t=t.apply(r,e)).next())});var Ai=window,Ii=Ai.ShadowRoot&&(Ai.ShadyCSS===void 0||Ai.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,to=Symbol(),Sc=new WeakMap,Dn=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==to)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(Ii&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=Sc.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Sc.set(t,e))}return e}toString(){return this.cssText}},wc=r=>new Dn(typeof r=="string"?r:r+"",void 0,to),ro=(r,...e)=>{let t=r.length===1?r[0]:e.reduce((n,i,a)=>n+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[a+1],r[0]);return new Dn(t,r,to)},no=(r,e)=>{Ii?r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet):e.forEach(t=>{let n=document.createElement("style"),i=Ai.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=t.cssText,r.appendChild(n)})},ki=Ii?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(let n of e.cssRules)t+=n.cssText;return wc(t)})(r):r;var io,Di=window,_c=Di.trustedTypes,Ip=_c?_c.emptyScript:"",Ec=Di.reactiveElementPolyfillSupport,oo={toAttribute(r,e){switch(e){case Boolean:r=r?Ip:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},xc=(r,e)=>e!==r&&(e==e||r==r),ao={attribute:!0,type:String,converter:oo,reflect:!1,hasChanged:xc},so="finalized",Dt=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var t;this.finalize(),((t=this.h)!==null&&t!==void 0?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();let e=[];return this.elementProperties.forEach((t,n)=>{let i=this._$Ep(n,t);i!==void 0&&(this._$Ev.set(i,n),e.push(i))}),e}static createProperty(e,t=ao){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){let n=typeof e=="symbol"?Symbol():"__"+e,i=this.getPropertyDescriptor(e,n,t);i!==void 0&&Object.defineProperty(this.prototype,e,i)}}static getPropertyDescriptor(e,t,n){return{get(){return this[t]},set(i){let a=this[e];this[t]=i,this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||ao}static finalize(){if(this.hasOwnProperty(so))return!1;this[so]=!0;let e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let t=this.properties,n=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(let i of n)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let i of n)t.unshift(ki(i))}else e!==void 0&&t.push(ki(e));return t}static _$Ep(e,t){let n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(t=>t(this))}addController(e){var t,n;((t=this._$ES)!==null&&t!==void 0?t:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((n=e.hostConnected)===null||n===void 0||n.call(e))}removeController(e){var t;(t=this._$ES)===null||t===void 0||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])})}createRenderRoot(){var e;let t=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return no(t,this.constructor.elementStyles),t}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(t=>{var n;return(n=t.hostConnected)===null||n===void 0?void 0:n.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(t=>{var n;return(n=t.hostDisconnected)===null||n===void 0?void 0:n.call(t)})}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$EO(e,t,n=ao){var i;let a=this.constructor._$Ep(e,n);if(a!==void 0&&n.reflect===!0){let o=(((i=n.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?n.converter:oo).toAttribute(t,n.type);this._$El=e,o==null?this.removeAttribute(a):this.setAttribute(a,o),this._$El=null}}_$AK(e,t){var n;let i=this.constructor,a=i._$Ev.get(e);if(a!==void 0&&this._$El!==a){let o=i.getPropertyOptions(a),s=typeof o.converter=="function"?{fromAttribute:o.converter}:((n=o.converter)===null||n===void 0?void 0:n.fromAttribute)!==void 0?o.converter:oo;this._$El=a,this[a]=s.fromAttribute(t,o.type),this._$El=null}}requestUpdate(e,t,n){let i=!0;e!==void 0&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||xc)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),n.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,n))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((i,a)=>this[a]=i),this._$Ei=void 0);let t=!1,n=this._$AL;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),(e=this._$ES)===null||e===void 0||e.forEach(i=>{var a;return(a=i.hostUpdate)===null||a===void 0?void 0:a.call(i)}),this.update(n)):this._$Ek()}catch(i){throw t=!1,this._$Ek(),i}t&&this._$AE(n)}willUpdate(e){}_$AE(e){var t;(t=this._$ES)===null||t===void 0||t.forEach(n=>{var i;return(i=n.hostUpdated)===null||i===void 0?void 0:i.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((t,n)=>this._$EO(n,this[n],t)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};Dt[so]=!0,Dt.elementProperties=new Map,Dt.elementStyles=[],Dt.shadowRootOptions={mode:"open"},Ec?.({ReactiveElement:Dt}),((io=Di.reactiveElementVersions)!==null&&io!==void 0?io:Di.reactiveElementVersions=[]).push("1.6.3");var co,Ni=window,Hr=Ni.trustedTypes,Oc=Hr?Hr.createPolicy("lit-html",{createHTML:r=>r}):void 0,lo="$lit$",Bt=`lit$${(Math.random()+"").slice(9)}$`,Pc="?"+Bt,kp=`<${Pc}>`,dr=document,Pn=()=>dr.createComment(""),Rn=r=>r===null||typeof r!="object"&&typeof r!="function",Rc=Array.isArray,Dp=r=>Rc(r)||typeof r?.[Symbol.iterator]=="function",uo=`[
|
|
2
|
+
\f\r]`,Nn=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Tc=/-->/g,Ac=/>/g,pr=RegExp(`>|${uo}(?:([^\\s"'>=/]+)(${uo}*=${uo}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ic=/'/g,kc=/"/g,Lc=/^(?:script|style|textarea|title)$/i,Fc=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),V=Fc(1),th=Fc(2),hr=Symbol.for("lit-noChange"),Ie=Symbol.for("lit-nothing"),Dc=new WeakMap,fr=dr.createTreeWalker(dr,129,null,!1);function $c(r,e){if(!Array.isArray(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Oc!==void 0?Oc.createHTML(e):e}var Np=(r,e)=>{let t=r.length-1,n=[],i,a=e===2?"<svg>":"",o=Nn;for(let s=0;s<t;s++){let u=r[s],l,p,f=-1,h=0;for(;h<u.length&&(o.lastIndex=h,p=o.exec(u),p!==null);)h=o.lastIndex,o===Nn?p[1]==="!--"?o=Tc:p[1]!==void 0?o=Ac:p[2]!==void 0?(Lc.test(p[2])&&(i=RegExp("</"+p[2],"g")),o=pr):p[3]!==void 0&&(o=pr):o===pr?p[0]===">"?(o=i??Nn,f=-1):p[1]===void 0?f=-2:(f=o.lastIndex-p[2].length,l=p[1],o=p[3]===void 0?pr:p[3]==='"'?kc:Ic):o===kc||o===Ic?o=pr:o===Tc||o===Ac?o=Nn:(o=pr,i=void 0);let d=o===pr&&r[s+1].startsWith("/>")?" ":"";a+=o===Nn?u+kp:f>=0?(n.push(l),u.slice(0,f)+lo+u.slice(f)+Bt+d):u+Bt+(f===-2?(n.push(void 0),s):d)}return[$c(r,a+(r[t]||"<?>")+(e===2?"</svg>":"")),n]},mr=class{constructor({strings:e,_$litType$:t},n){let i;this.parts=[];let a=0,o=0,s=e.length-1,u=this.parts,[l,p]=Np(e,t);if(this.el=mr.createElement(l,n),fr.currentNode=this.el.content,t===2){let f=this.el.content,h=f.firstChild;h.remove(),f.append(...h.childNodes)}for(;(i=fr.nextNode())!==null&&u.length<s;){if(i.nodeType===1){if(i.hasAttributes()){let f=[];for(let h of i.getAttributeNames())if(h.endsWith(lo)||h.startsWith(Bt)){let d=p[o++];if(f.push(h),d!==void 0){let y=i.getAttribute(d.toLowerCase()+lo).split(Bt),g=/([.?@])?(.*)/.exec(d);u.push({type:1,index:a,name:g[2],strings:y,ctor:g[1]==="."?fo:g[1]==="?"?ho:g[1]==="@"?mo:Yr})}else u.push({type:6,index:a})}for(let h of f)i.removeAttribute(h)}if(Lc.test(i.tagName)){let f=i.textContent.split(Bt),h=f.length-1;if(h>0){i.textContent=Hr?Hr.emptyScript:"";for(let d=0;d<h;d++)i.append(f[d],Pn()),fr.nextNode(),u.push({type:2,index:++a});i.append(f[h],Pn())}}}else if(i.nodeType===8)if(i.data===Pc)u.push({type:2,index:a});else{let f=-1;for(;(f=i.data.indexOf(Bt,f+1))!==-1;)u.push({type:7,index:a}),f+=Bt.length-1}a++}}static createElement(e,t){let n=dr.createElement("template");return n.innerHTML=e,n}};function Jr(r,e,t=r,n){var i,a,o,s;if(e===hr)return e;let u=n!==void 0?(i=t._$Co)===null||i===void 0?void 0:i[n]:t._$Cl,l=Rn(e)?void 0:e._$litDirective$;return u?.constructor!==l&&((a=u?._$AO)===null||a===void 0||a.call(u,!1),l===void 0?u=void 0:(u=new l(r),u._$AT(r,t,n)),n!==void 0?((o=(s=t)._$Co)!==null&&o!==void 0?o:s._$Co=[])[n]=u:t._$Cl=u),u!==void 0&&(e=Jr(r,u._$AS(r,e.values),u,n)),e}var po=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var t;let{el:{content:n},parts:i}=this._$AD,a=((t=e?.creationScope)!==null&&t!==void 0?t:dr).importNode(n,!0);fr.currentNode=a;let o=fr.nextNode(),s=0,u=0,l=i[0];for(;l!==void 0;){if(s===l.index){let p;l.type===2?p=new yr(o,o.nextSibling,this,e):l.type===1?p=new l.ctor(o,l.name,l.strings,this,e):l.type===6&&(p=new yo(o,this,e)),this._$AV.push(p),l=i[++u]}s!==l?.index&&(o=fr.nextNode(),s++)}return fr.currentNode=dr,a}v(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}},yr=class{constructor(e,t,n,i){var a;this.type=2,this._$AH=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=Jr(this,e,t),Rn(e)?e===Ie||e==null||e===""?(this._$AH!==Ie&&this._$AR(),this._$AH=Ie):e!==this._$AH&&e!==hr&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):Dp(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&&Rn(this._$AH)?this._$AA.nextSibling.data=e:this.$(dr.createTextNode(e)),this._$AH=e}g(e){var t;let{values:n,_$litType$:i}=e,a=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=mr.createElement($c(i.h,i.h[0]),this.options)),i);if(((t=this._$AH)===null||t===void 0?void 0:t._$AD)===a)this._$AH.v(n);else{let o=new po(a,this),s=o.u(this.options);o.v(n),this.$(s),this._$AH=o}}_$AC(e){let t=Dc.get(e.strings);return t===void 0&&Dc.set(e.strings,t=new mr(e)),t}T(e){Rc(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,n,i=0;for(let a of e)i===t.length?t.push(n=new yr(this.k(Pn()),this.k(Pn()),this,this.options)):n=t[i],n._$AI(a),i++;i<t.length&&(this._$AR(n&&n._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){var n;for((n=this._$AP)===null||n===void 0||n.call(this,!1,!0,t);e&&e!==this._$AB;){let i=e.nextSibling;e.remove(),e=i}}setConnected(e){var t;this._$AM===void 0&&(this._$Cp=e,(t=this._$AP)===null||t===void 0||t.call(this,e))}},Yr=class{constructor(e,t,n,i,a){this.type=1,this._$AH=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=Jr(this,e,t,0),o=!Rn(e)||e!==this._$AH&&e!==hr,o&&(this._$AH=e);else{let s=e,u,l;for(e=a[0],u=0;u<a.length-1;u++)l=Jr(this,s[n+u],t,u),l===hr&&(l=this._$AH[u]),o||(o=!Rn(l)||l!==this._$AH[u]),l===Ie?e=Ie:e!==Ie&&(e+=(l??"")+a[u+1]),this._$AH[u]=l}o&&!i&&this.j(e)}j(e){e===Ie?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},fo=class extends Yr{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Ie?void 0:e}},Pp=Hr?Hr.emptyScript:"",ho=class extends Yr{constructor(){super(...arguments),this.type=4}j(e){e&&e!==Ie?this.element.setAttribute(this.name,Pp):this.element.removeAttribute(this.name)}},mo=class extends Yr{constructor(e,t,n,i,a){super(e,t,n,i,a),this.type=5}_$AI(e,t=this){var n;if((e=(n=Jr(this,e,t,0))!==null&&n!==void 0?n:Ie)===hr)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){Jr(this,e)}};var Nc=Ni.litHtmlPolyfillSupport;Nc?.(mr,yr),((co=Ni.litHtmlVersions)!==null&&co!==void 0?co:Ni.litHtmlVersions=[]).push("2.8.0");var Mc=(r,e,t)=>{var n,i;let a=(n=t?.renderBefore)!==null&&n!==void 0?n:e,o=a._$litPart$;if(o===void 0){let s=(i=t?.renderBefore)!==null&&i!==void 0?i:null;a._$litPart$=o=new yr(e.insertBefore(Pn(),s),s,void 0,t??{})}return o._$AI(r),o};var go,vo;var Vt=class extends Dt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;let n=super.createRenderRoot();return(e=(t=this.renderOptions).renderBefore)!==null&&e!==void 0||(t.renderBefore=n.firstChild),n}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Mc(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return hr}};Vt.finalized=!0,Vt._$litElement$=!0,(go=globalThis.litElementHydrateSupport)===null||go===void 0||go.call(globalThis,{LitElement:Vt});var jc=globalThis.litElementPolyfillSupport;jc?.({LitElement:Vt});((vo=globalThis.litElementVersions)!==null&&vo!==void 0?vo:globalThis.litElementVersions=[]).push("3.3.3");var Uc=r=>e=>typeof e=="function"?((t,n)=>(customElements.define(t,n),n))(r,e):((t,n)=>{let{kind:i,elements:a}=n;return{kind:i,elements:a,finisher(o){customElements.define(t,o)}}})(r,e);var Rp=(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)}},Lp=(r,e,t)=>{e.constructor.createProperty(t,r)};function ot(r){return(e,t)=>t!==void 0?Lp(r,e,t):Rp(r,e)}function et(r){return ot({...r,state:!0})}var bo,Ah=((bo=window.HTMLSlotElement)===null||bo===void 0?void 0:bo.prototype.assignedElements)!=null?(r,e)=>r.assignedElements(e):(r,e)=>r.assignedNodes(e).filter(t=>t.nodeType===Node.ELEMENT_NODE);import{ZBarSymbolType as X,ZBarConfigType as Bc,scanRGBABuffer as Fp,getDefaultScanner as $p}from"https://cdn.jsdelivr.net/npm/@undecaf/zbar-wasm@0.9.15/dist/main.js";function Mp(r,e,t,n){return new(t||(t=Promise))(function(i,a){function o(l){try{u(n.next(l))}catch(p){a(p)}}function s(l){try{u(n.throw(l))}catch(p){a(p)}}function u(l){var p;l.done?i(l.value):(p=l.value,p instanceof t?p:new t(function(f){f(p)})).then(o,s)}u((n=n.apply(r,e||[])).next())})}var D=class{constructor(e,t=Bc.ZBAR_CFG_ENABLE,n=1){this.symbolType=e,this.configType=t,this.number=n,this.configSteps=[this]}static register(e,t,n=t.symbolType){return D.formatsToConfigs[e]=t,D.typesToFormats[n]=D.typesToFormats[n]||e,t}static formats(){return Object.keys(D.formatsToConfigs)}static toFormat(e){return D.typesToFormats[e]}static configure(e,t){var n;(n=D.formatsToConfigs[t])===null||n===void 0||n.configSteps.forEach(i=>e.setConfig(i.symbolType,i.configType,i.number))}add(e){return this.configSteps.push(e),this}},qc;D.formatsToConfigs={},D.typesToFormats={},D.register("codabar",new D(X.ZBAR_CODABAR)),D.register("code_39",new D(X.ZBAR_CODE39)),D.register("code_93",new D(X.ZBAR_CODE93)),D.register("code_128",new D(X.ZBAR_CODE128)),D.register("databar",new D(X.ZBAR_DATABAR)),D.register("databar_exp",new D(X.ZBAR_DATABAR_EXP)),D.register("ean_2",new D(X.ZBAR_EAN2)),D.register("ean_5",new D(X.ZBAR_EAN5)),D.register("ean_8",new D(X.ZBAR_EAN8)),D.register("ean_13",new D(X.ZBAR_EAN13)),D.register("ean_13+2",new D(X.ZBAR_EAN13)).add(new D(X.ZBAR_EAN2)),D.register("ean_13+5",new D(X.ZBAR_EAN13)).add(new D(X.ZBAR_EAN5)),D.register("isbn_10",new D(X.ZBAR_ISBN10)).add(new D(X.ZBAR_EAN13)),D.register("isbn_13",new D(X.ZBAR_ISBN13)).add(new D(X.ZBAR_EAN13)),D.register("isbn_13+2",new D(X.ZBAR_ISBN13)).add(new D(X.ZBAR_EAN13)).add(new D(X.ZBAR_EAN2)),D.register("isbn_13+5",new D(X.ZBAR_ISBN13)).add(new D(X.ZBAR_EAN13)).add(new D(X.ZBAR_EAN5)),D.register("itf",new D(X.ZBAR_I25)),D.register("qr_code",new D(X.ZBAR_QRCODE)),D.register("sq_code",new D(X.ZBAR_SQCODE)),D.register("upc_a",new D(X.ZBAR_UPCA)).add(new D(X.ZBAR_EAN13)),D.register("upc_e",new D(X.ZBAR_UPCE)).add(new D(X.ZBAR_EAN13)),function(r){r[r.UNKNOWN=-1]="UNKNOWN",r[r.UPRIGHT=0]="UPRIGHT",r[r.ROTATED_RIGHT=1]="ROTATED_RIGHT",r[r.UPSIDE_DOWN=2]="UPSIDE_DOWN",r[r.ROTATED_LEFT=3]="ROTATED_LEFT"}(qc||(qc={}));var Co=class{},jp=(()=>{try{return new OffscreenCanvas(1,1).getContext("2d")instanceof OffscreenCanvasRenderingContext2D}catch{return!1}})(),Qt=class{constructor(e={}){if(e.formats!==void 0){if(!Array.isArray(e.formats)||!e.formats.length)throw new TypeError(`Barcode formats should be a non-empty array of strings but are: ${JSON.stringify(e)}`);let t=e.formats.filter(n=>!D.formats().includes(n));if(t.length)throw new TypeError(`Unsupported barcode format(s): ${t.join(", ")}`)}this.formats=e.formats||D.formats(),this.zbarConfig=e.zbar||new Co}static getSupportedFormats(){return Promise.resolve(D.formats())}detect(e){if(!Qt.isImageBitmapSource(e))throw new TypeError("BarcodeDetector.detect() argument is not an ImageBitmapSource");let t=Qt.intrinsicDimensions(e);if(t.width===0||t.height===0)return Promise.resolve([]);try{return Promise.all([this.toImageData(e),this.getScanner()]).then(n=>{let i=n[0],a=n[1];return this.zbarConfig.enableCache!==void 0&&a.enableCache(this.zbarConfig.enableCache),Fp(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)=>Mp(this,void 0,void 0,function*(){if(!this.scanner){let n=yield $p();this.formats.length>0&&(n.setConfig(X.ZBAR_NONE,Bc.ZBAR_CFG_ENABLE,0),this.formats.forEach(i=>D.configure(n,i))),this.scanner=n}e(this.scanner)}))}toImageData(e){let t=n=>{let i=Qt.intrinsicDimensions(n);this.canvas&&this.canvas.width===i.width&&this.canvas.height===i.height||(this.canvas=function(s,u){if(jp)return new OffscreenCanvas(s,u);{let l=document.createElement("canvas");return l.width=s,l.height=u,l}}(i.width,i.height));let a=this.canvas,o=a.getContext("2d");return o.drawImage(n,0,0),o.getImageData(0,0,a.width,a.height)};if(e instanceof ImageData)return Promise.resolve(e);if(e instanceof Blob){let n=document.createElement("img");return n.src=URL.createObjectURL(e),n.decode().then(()=>t(n)).finally(()=>URL.revokeObjectURL(n.src))}return e instanceof CanvasRenderingContext2D?Promise.resolve(e.getImageData(0,0,e.canvas.width,e.canvas.height)):Promise.resolve(t(e))}toBarcodeDetectorResult(e){let t={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0};return e.points.forEach(n=>{t.minX=Math.min(t.minX,n.x),t.maxX=Math.max(t.maxX,n.x),t.minY=Math.min(t.minY,n.y),t.maxY=Math.max(t.maxY,n.y)}),{format:D.toFormat(e.type),rawValue:e.decode(this.zbarConfig.encoding),orientation:e.orientation,quality:e.quality,boundingBox:DOMRectReadOnly.fromRect({x:t.minX,y:t.minY,width:t.maxX-t.minX,height:t.maxY-t.minY}),cornerPoints:[{x:t.minX,y:t.minY},{x:t.maxX,y:t.minY},{x:t.maxX,y:t.maxY},{x:t.minX,y:t.maxY}]}}static isImageBitmapSource(e){return e instanceof HTMLImageElement||e instanceof HTMLVideoElement||e instanceof HTMLCanvasElement||e instanceof Blob||e instanceof ImageData||e instanceof CanvasRenderingContext2D||e instanceof ImageBitmap||e&&e.width==0||e&&e.height==0}static intrinsicDimensions(e){return{width:Number(e.naturalWidth||e.videoWidth||e.width),height:Number(e.naturalHeight||e.videoHeight||e.height)}}};var So=function(r,e){return So=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},So(r,e)};function be(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");So(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var m=function(){return m=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},m.apply(this,arguments)};function wt(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}function pt(r,e,t,n){function i(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function s(p){try{l(n.next(p))}catch(f){o(f)}}function u(p){try{l(n.throw(p))}catch(f){o(f)}}function l(p){p.done?a(p.value):i(p.value).then(s,u)}l((n=n.apply(r,e||[])).next())})}function ft(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(l){return function(p){return u([l,p])}}function u(l){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(t=0)),t;)try{if(n=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,i=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){t.label=l[1];break}if(l[0]===6&&t.label<a[1]){t.label=a[1],a=l;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(l);break}a[2]&&t.ops.pop(),t.trys.pop();continue}l=e.call(r,t)}catch(p){l=[6,p],i=0}finally{n=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Wt(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return r.concat(a||Array.prototype.slice.call(e))}var wo="Invariant Violation",Vc=Object.setPrototypeOf,Up=Vc===void 0?function(r,e){return r.__proto__=e,r}:Vc,U=function(r){be(e,r);function e(t){t===void 0&&(t=wo);var n=r.call(this,typeof t=="number"?wo+": "+t+" (see https://github.com/apollographql/invariant-packages)":t)||this;return n.framesToPop=1,n.name=wo,Up(n,e.prototype),n}return e}(Error);function T(r,e){if(!r)throw new U(e)}var Ri=["debug","log","warn","error","silent"],_o=Ri.indexOf("log");function Pi(r){return function(){if(Ri.indexOf(r)>=_o){var e=console[r]||console.log;return e.apply(console,arguments)}}}(function(r){r.debug=Pi("debug"),r.log=Pi("log"),r.warn=Pi("warn"),r.error=Pi("error")})(T||(T={}));function Qc(r){var e=Ri[_o];return _o=Math.max(0,Ri.indexOf(r)),e}function ke(r){try{return r()}catch{}}var Li=ke(function(){return globalThis})||ke(function(){return window})||ke(function(){return self})||ke(function(){return global})||ke(function(){return ke.constructor("return this")()});var Wc="__",Gc=[Wc,Wc].join("DEV");function qp(){try{return Boolean(__DEV__)}catch{return Object.defineProperty(Li,Gc,{value:ke(function(){return"production"})!=="production",enumerable:!1,configurable:!0,writable:!0}),Li[Gc]}}var gr=qp();function Gt(r){try{return r()}catch{}}var Eo=Gt(function(){return globalThis})||Gt(function(){return window})||Gt(function(){return self})||Gt(function(){return global})||Gt(function(){return Gt.constructor("return this")()}),xo=!1;function Bp(){Eo&&!Gt(function(){return"production"})&&!Gt(function(){return process})&&(Object.defineProperty(Eo,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),xo=!0)}Bp();function Oo(){xo&&(delete Eo.process,xo=!1)}var r2=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",n2=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator",Kc=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";var 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 To(r,e){var t=Boolean(r);if(!t)throw new Error(e??"Unexpected invariant triggered.")}var Vp=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,Fn=Vp;function Fi(r){var e=r.prototype.toJSON;typeof e=="function"||To(0),r.prototype.inspect=e,Fn&&(r.prototype[Fn]=e)}var zc=function(){function r(t,n,i){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=i}var e=r.prototype;return e.toJSON=function(){return{start:this.start,end:this.end}},r}();Fi(zc);var Hc=function(){function r(t,n,i,a,o,s,u){this.kind=t,this.start=n,this.end=i,this.line=a,this.column=o,this.value=u,this.prev=s,this.next=null}var e=r.prototype;return e.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},r}();Fi(Hc);function Ao(r){return r!=null&&typeof r.kind=="string"}function $i(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?$i=function(t){return typeof t}:$i=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$i(r)}var Qp=10,Jc=2;function $n(r){return Mi(r,[])}function Mi(r,e){switch($i(r)){case"string":return JSON.stringify(r);case"function":return r.name?"[function ".concat(r.name,"]"):"[function]";case"object":return r===null?"null":Wp(r,e);default:return String(r)}}function Wp(r,e){if(e.indexOf(r)!==-1)return"[Circular]";var t=[].concat(e,[r]),n=zp(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 Kp(r,t);return Gp(r,t)}function Gp(r,e){var t=Object.keys(r);if(t.length===0)return"{}";if(e.length>Jc)return"["+Hp(r)+"]";var n=t.map(function(i){var a=Mi(r[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function Kp(r,e){if(r.length===0)return"[]";if(e.length>Jc)return"[Array]";for(var t=Math.min(Qp,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 zp(r){var e=r[String(Fn)];if(typeof e=="function")return e;if(typeof r.inspect=="function")return r.inspect}function Hp(r){var e=Object.prototype.toString.call(r).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof r.constructor=="function"){var t=r.constructor.name;if(typeof t=="string"&&t!=="")return t}return e}function Mn(r,e){var t=Boolean(r);if(!t)throw new Error(e)}function Yc(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function Jp(r,e,t){return e&&Yc(r.prototype,e),t&&Yc(r,t),r}var ji=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GraphQL request",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{line:1,column:1};typeof e=="string"||Mn(0,"Body must be a string. Received: ".concat($n(e),".")),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||Mn(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Mn(0,"column in locationOffset is 1-indexed and must be positive.")}return Jp(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(`
|
|
4
4
|
`)===-1,i=r[0]===" "||r[0]===" ",a=r[r.length-1]==='"',o=r[r.length-1]==="\\",s=!n||a||o||t,u="";return s&&!(n&&i)&&(u+=`
|
|
5
5
|
`+e),u+=e?r.replace(/\n/g,`
|
|
6
6
|
`+e):r,s&&(u+=`
|
|
7
|
-
`),'"""'+u.replace(/"""/g,'\\"""')+'"""'}var
|
|
7
|
+
`),'"""'+u.replace(/"""/g,'\\"""')+'"""'}var Yp={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},vr=Object.freeze({});function Me(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Yp,n=void 0,i=Array.isArray(r),a=[r],o=-1,s=[],u=void 0,l=void 0,p=void 0,f=[],h=[],d=r;do{o++;var y=o===a.length,g=y&&s.length!==0;if(y){if(l=h.length===0?void 0:f[f.length-1],u=p,p=h.pop(),g){if(i)u=u.slice();else{for(var C={},_=0,b=Object.keys(u);_<b.length;_++){var S=b[_];C[S]=u[S]}u=C}for(var O=0,k=0;k<s.length;k++){var N=s[k][0],I=s[k][1];i&&(N-=O),i&&I===null?(u.splice(N,1),O++):u[N]=I}}o=n.index,a=n.keys,s=n.edits,i=n.inArray,n=n.prev}else{if(l=p?i?o:a[o]:void 0,u=p?p[l]:d,u==null)continue;p&&f.push(l)}var R=void 0;if(!Array.isArray(u)){if(!Ao(u))throw new Error("Invalid AST Node: ".concat($n(u),"."));var re=Io(e,u.kind,y);if(re){if(R=re.call(e,u,l,p,f,h),R===vr)break;if(R===!1){if(!y){f.pop();continue}}else if(R!==void 0&&(s.push([l,R]),!y))if(Ao(R))u=R;else{f.pop();continue}}}if(R===void 0&&g&&s.push([l,u]),y)f.pop();else{var ee;n={inArray:i,index:o,keys:a,edits:s,prev:n},i=Array.isArray(u),a=i?u:(ee=t[u.kind])!==null&&ee!==void 0?ee:[],o=-1,s=[],p&&h.push(p),p=u}}while(n!==void 0);return s.length!==0&&(d=s[s.length-1][1]),d}function Io(r,e,t){var n=r[e];if(n){if(!t&&typeof n=="function")return n;var i=t?n.leave:n.enter;if(typeof i=="function")return i}else{var a=t?r.leave:r.enter;if(a){if(typeof a=="function")return a;var o=a[e];if(typeof o=="function")return o}}}function Xr(r){return Me(r,{leave:Zp})}var Xp=80,Zp={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return P(e.definitions,`
|
|
8
8
|
|
|
9
9
|
`)+`
|
|
10
|
-
`},OperationDefinition:function(e){var t=e.operation,n=e.name,i=
|
|
10
|
+
`},OperationDefinition:function(e){var t=e.operation,n=e.name,i=ye("(",P(e.variableDefinitions,", "),")"),a=P(e.directives," "),o=e.selectionSet;return!n&&!a&&!i&&t==="query"?o:P([t,P([n,i]),a,o]," ")},VariableDefinition:function(e){var t=e.variable,n=e.type,i=e.defaultValue,a=e.directives;return t+": "+n+ye(" = ",i)+ye(" ",P(a," "))},SelectionSet:function(e){var t=e.selections;return ht(t)},Field:function(e){var t=e.alias,n=e.name,i=e.arguments,a=e.directives,o=e.selectionSet,s=ye("",t,": ")+n,u=s+ye("(",P(i,", "),")");return u.length>Xp&&(u=s+ye(`(
|
|
11
11
|
`,Ui(P(i,`
|
|
12
12
|
`)),`
|
|
13
|
-
)`)),P([u,P(a," "),o]," ")},Argument:function(e){var t=e.name,n=e.value;return t+": "+n},FragmentSpread:function(e){var t=e.name,n=e.directives;return"..."+t+
|
|
13
|
+
)`)),P([u,P(a," "),o]," ")},Argument:function(e){var t=e.name,n=e.value;return t+": "+n},FragmentSpread:function(e){var t=e.name,n=e.directives;return"..."+t+ye(" ",P(n," "))},InlineFragment:function(e){var t=e.typeCondition,n=e.directives,i=e.selectionSet;return P(["...",ye("on ",t),P(n," "),i]," ")},FragmentDefinition:function(e){var t=e.name,n=e.typeCondition,i=e.variableDefinitions,a=e.directives,o=e.selectionSet;return"fragment ".concat(t).concat(ye("(",P(i,", "),")")," ")+"on ".concat(n," ").concat(ye("",P(a," ")," "))+o},IntValue:function(e){var t=e.value;return t},FloatValue:function(e){var t=e.value;return t},StringValue:function(e,t){var n=e.value,i=e.block;return i?Xc(n,t==="description"?"":" "):JSON.stringify(n)},BooleanValue:function(e){var t=e.value;return t?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){var t=e.value;return t},ListValue:function(e){var t=e.values;return"["+P(t,", ")+"]"},ObjectValue:function(e){var t=e.fields;return"{"+P(t,", ")+"}"},ObjectField:function(e){var t=e.name,n=e.value;return t+": "+n},Directive:function(e){var t=e.name,n=e.arguments;return"@"+t+ye("(",P(n,", "),")")},NamedType:function(e){var t=e.name;return t},ListType:function(e){var t=e.type;return"["+t+"]"},NonNullType:function(e){var t=e.type;return t+"!"},SchemaDefinition:dt(function(r){var e=r.directives,t=r.operationTypes;return P(["schema",P(e," "),ht(t)]," ")}),OperationTypeDefinition:function(e){var t=e.operation,n=e.type;return t+": "+n},ScalarTypeDefinition:dt(function(r){var e=r.name,t=r.directives;return P(["scalar",e,P(t," ")]," ")}),ObjectTypeDefinition:dt(function(r){var e=r.name,t=r.interfaces,n=r.directives,i=r.fields;return P(["type",e,ye("implements ",P(t," & ")),P(n," "),ht(i)]," ")}),FieldDefinition:dt(function(r){var e=r.name,t=r.arguments,n=r.type,i=r.directives;return e+(Zc(t)?ye(`(
|
|
14
14
|
`,Ui(P(t,`
|
|
15
15
|
`)),`
|
|
16
|
-
)`):
|
|
16
|
+
)`):ye("(",P(t,", "),")"))+": "+n+ye(" ",P(i," "))}),InputValueDefinition:dt(function(r){var e=r.name,t=r.type,n=r.defaultValue,i=r.directives;return P([e+": "+t,ye("= ",n),P(i," ")]," ")}),InterfaceTypeDefinition:dt(function(r){var e=r.name,t=r.interfaces,n=r.directives,i=r.fields;return P(["interface",e,ye("implements ",P(t," & ")),P(n," "),ht(i)]," ")}),UnionTypeDefinition:dt(function(r){var e=r.name,t=r.directives,n=r.types;return P(["union",e,P(t," "),n&&n.length!==0?"= "+P(n," | "):""]," ")}),EnumTypeDefinition:dt(function(r){var e=r.name,t=r.directives,n=r.values;return P(["enum",e,P(t," "),ht(n)]," ")}),EnumValueDefinition:dt(function(r){var e=r.name,t=r.directives;return P([e,P(t," ")]," ")}),InputObjectTypeDefinition:dt(function(r){var e=r.name,t=r.directives,n=r.fields;return P(["input",e,P(t," "),ht(n)]," ")}),DirectiveDefinition:dt(function(r){var e=r.name,t=r.arguments,n=r.repeatable,i=r.locations;return"directive @"+e+(Zc(t)?ye(`(
|
|
17
17
|
`,Ui(P(t,`
|
|
18
18
|
`)),`
|
|
19
|
-
)`):
|
|
20
|
-
`)}}function P(r){var e,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(e=r?.filter(function(n){return n}).join(t))!==null&&e!==void 0?e:""}function
|
|
19
|
+
)`):ye("(",P(t,", "),")"))+(n?" repeatable":"")+" on "+P(i," | ")}),SchemaExtension:function(e){var t=e.directives,n=e.operationTypes;return P(["extend schema",P(t," "),ht(n)]," ")},ScalarTypeExtension:function(e){var t=e.name,n=e.directives;return P(["extend scalar",t,P(n," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,n=e.interfaces,i=e.directives,a=e.fields;return P(["extend type",t,ye("implements ",P(n," & ")),P(i," "),ht(a)]," ")},InterfaceTypeExtension:function(e){var t=e.name,n=e.interfaces,i=e.directives,a=e.fields;return P(["extend interface",t,ye("implements ",P(n," & ")),P(i," "),ht(a)]," ")},UnionTypeExtension:function(e){var t=e.name,n=e.directives,i=e.types;return P(["extend union",t,P(n," "),i&&i.length!==0?"= "+P(i," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,n=e.directives,i=e.values;return P(["extend enum",t,P(n," "),ht(i)]," ")},InputObjectTypeExtension:function(e){var t=e.name,n=e.directives,i=e.fields;return P(["extend input",t,P(n," "),ht(i)]," ")}};function dt(r){return function(e){return P([e.description,r(e)],`
|
|
20
|
+
`)}}function P(r){var e,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(e=r?.filter(function(n){return n}).join(t))!==null&&e!==void 0?e:""}function ht(r){return ye(`{
|
|
21
21
|
`,Ui(P(r,`
|
|
22
22
|
`)),`
|
|
23
|
-
}`)}function
|
|
24
|
-
`))}function
|
|
25
|
-
`)!==-1}function Xc(r){return r!=null&&r.some(Zp)}function jn(r){return r.kind===we.FIELD||r.kind===we.FRAGMENT_SPREAD||r.kind===we.INLINE_FRAGMENT}function Zc(){return typeof ji=="function"?Oo():Oo()}function lf(){__DEV__?T(typeof gr=="boolean",gr):T(typeof gr=="boolean",39)}Zc();lf();function Dt(r,e){var t=r.directives;return!t||!t.length?!0:eu(t).every(function(n){var i=n.directive,a=n.ifArgument,o=!1;return a.value.kind==="Variable"?(o=e&&e[a.value.name.value],__DEV__?T(o!==void 0,"Invalid variable referenced in @".concat(i.name.value," directive.")):T(o!==void 0,40)):o=a.value.value,i.name.value==="skip"?!o:o})}function Zr(r,e,t){var n=new Set(r),i=n.size;return Me(e,{Directive:function(a){if(n.delete(a.name.value)&&(!t||!n.size))return vr}}),t?!n.size:n.size<i}function ko(r){return r&&Zr(["client","export"],r,!0)}function pf(r){var e=r.name.value;return e==="skip"||e==="include"}function eu(r){var e=[];return r&&r.length&&r.forEach(function(t){if(!!pf(t)){var n=t.arguments,i=t.name.value;__DEV__?T(n&&n.length===1,"Incorrect number of arguments for the @".concat(i," directive.")):T(n&&n.length===1,41);var a=n[0];__DEV__?T(a.name&&a.name.value==="if","Invalid argument for the @".concat(i," directive.")):T(a.name&&a.name.value==="if",42);var o=a.value;__DEV__?T(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),"Argument for the @".concat(i," directive must be a variable or a boolean value.")):T(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),43),e.push({directive:t,ifArgument:a})}}),e}function Do(r,e){var t=e,n=[];r.definitions.forEach(function(a){if(a.kind==="OperationDefinition")throw __DEV__?new U("Found a ".concat(a.operation," operation").concat(a.name?" named '".concat(a.name.value,"'"):"",". ")+"No operations are allowed when using a fragment as a query. Only fragments are allowed."):new U(44);a.kind==="FragmentDefinition"&&n.push(a)}),typeof t>"u"&&(__DEV__?T(n.length===1,"Found ".concat(n.length," fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")):T(n.length===1,45),t=n[0].name.value);var i=m(m({},r),{definitions:Wt([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:t}}]}}],r.definitions,!0)});return i}function br(r){r===void 0&&(r=[]);var e={};return r.forEach(function(t){e[t.name.value]=t}),e}function Cr(r,e){switch(r.kind){case"InlineFragment":return r;case"FragmentSpread":{var t=r.name.value;if(typeof e=="function")return e(t);var n=e&&e[t];return __DEV__?T(n,"No fragment named ".concat(t)):T(n,46),n||null}default:return null}}function z(r){return r!==null&&typeof r=="object"}function wt(r){return{__ref:String(r)}}function W(r){return Boolean(r&&typeof r=="object"&&typeof r.__ref=="string")}function No(r){return z(r)&&r.kind==="Document"&&Array.isArray(r.definitions)}function ff(r){return r.kind==="StringValue"}function df(r){return r.kind==="BooleanValue"}function hf(r){return r.kind==="IntValue"}function mf(r){return r.kind==="FloatValue"}function yf(r){return r.kind==="Variable"}function gf(r){return r.kind==="ObjectValue"}function vf(r){return r.kind==="ListValue"}function bf(r){return r.kind==="EnumValue"}function Cf(r){return r.kind==="NullValue"}function Kt(r,e,t,n){if(hf(t)||mf(t))r[e.value]=Number(t.value);else if(df(t)||ff(t))r[e.value]=t.value;else if(gf(t)){var i={};t.fields.map(function(o){return Kt(i,o.name,o.value,n)}),r[e.value]=i}else if(yf(t)){var a=(n||{})[t.name.value];r[e.value]=a}else if(vf(t))r[e.value]=t.values.map(function(o){var s={};return Kt(s,e,o,n),s[e.value]});else if(bf(t))r[e.value]=t.value;else if(Cf(t))r[e.value]=null;else throw __DEV__?new U('The inline argument "'.concat(e.value,'" of kind "').concat(t.kind,'"')+"is not supported. Use variables instead of inline arguments to overcome this limitation."):new U(55)}function Po(r,e){var t=null;r.directives&&(t={},r.directives.forEach(function(i){t[i.name.value]={},i.arguments&&i.arguments.forEach(function(a){var o=a.name,s=a.value;return Kt(t[i.name.value],o,s,e)})}));var n=null;return r.arguments&&r.arguments.length&&(n={},r.arguments.forEach(function(i){var a=i.name,o=i.value;return Kt(n,a,o,e)})),qn(r.name.value,n,t)}var Sf=["connection","include","skip","client","rest","export"],qn=Object.assign(function(r,e,t){if(e&&t&&t.connection&&t.connection.key)if(t.connection.filter&&t.connection.filter.length>0){var n=t.connection.filter?t.connection.filter:[];n.sort();var i={};return n.forEach(function(s){i[s]=e[s]}),"".concat(t.connection.key,"(").concat(Un(i),")")}else return t.connection.key;var a=r;if(e){var o=Un(e);a+="(".concat(o,")")}return t&&Object.keys(t).forEach(function(s){Sf.indexOf(s)===-1&&(t[s]&&Object.keys(t[s]).length?a+="@".concat(s,"(").concat(Un(t[s]),")"):a+="@".concat(s))}),a},{setStringify:function(r){var e=Un;return Un=r,e}}),Un=function(e){return JSON.stringify(e,wf)};function wf(r,e){return z(e)&&!Array.isArray(e)&&(e=Object.keys(e).sort().reduce(function(t,n){return t[n]=e[n],t},{})),e}function Nt(r,e){if(r.arguments&&r.arguments.length){var t={};return r.arguments.forEach(function(n){var i=n.name,a=n.value;return Kt(t,i,a,e)}),t}return null}function at(r){return r.alias?r.alias.value:r.name.value}function Bn(r,e,t){if(typeof r.__typename=="string")return r.__typename;for(var n=0,i=e.selections;n<i.length;n++){var a=i[n];if(et(a)){if(a.name.value==="__typename")return r[at(a)]}else{var o=Bn(r,Cr(a,t).selectionSet,t);if(typeof o=="string")return o}}}function et(r){return r.kind==="Field"}function Ro(r){return r.kind==="InlineFragment"}function en(r){__DEV__?T(r&&r.kind==="Document",'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):T(r&&r.kind==="Document",47);var e=r.definitions.filter(function(t){return t.kind!=="FragmentDefinition"}).map(function(t){if(t.kind!=="OperationDefinition")throw __DEV__?new U('Schema type definitions not allowed in queries. Found: "'.concat(t.kind,'"')):new U(48);return t});return __DEV__?T(e.length<=1,"Ambiguous GraphQL document: contains ".concat(e.length," operations")):T(e.length<=1,49),r}function _t(r){return en(r),r.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function tn(r){return r.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function Sr(r){return r.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function Vn(r){var e=_t(r);return __DEV__?T(e&&e.operation==="query","Must contain a query definition."):T(e&&e.operation==="query",50),e}function Lo(r){__DEV__?T(r.kind==="Document",'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):T(r.kind==="Document",51),__DEV__?T(r.definitions.length<=1,"Fragment must have exactly one definition."):T(r.definitions.length<=1,52);var e=r.definitions[0];return __DEV__?T(e.kind==="FragmentDefinition","Must be a fragment definition."):T(e.kind==="FragmentDefinition",53),e}function wr(r){en(r);for(var e,t=0,n=r.definitions;t<n.length;t++){var i=n[t];if(i.kind==="OperationDefinition"){var a=i.operation;if(a==="query"||a==="mutation"||a==="subscription")return i}i.kind==="FragmentDefinition"&&!e&&(e=i)}if(e)return e;throw __DEV__?new U("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new U(54)}function _r(r){var e=Object.create(null),t=r&&r.variableDefinitions;return t&&t.length&&t.forEach(function(n){n.defaultValue&&Kt(e,n.variable.name,n.defaultValue)}),e}var ne=Array.isArray;function Oe(r){return Array.isArray(r)&&r.length>0}var tu={kind:we.FIELD,name:{kind:we.NAME,value:"__typename"}};function nu(r,e){return!r||r.selectionSet.selections.every(function(t){return t.kind===we.FRAGMENT_SPREAD&&nu(e[t.name.value],e)})}function _f(r){return nu(_t(r)||Lo(r),br(Sr(r)))?null:r}function Ef(r){var e=new Set,t=[];return r.forEach(function(n){n.name?e.add(n.name):n.test&&t.push(n.test)}),function(n){return e.has(n.name.value)||t.some(function(i){return i(n)})}}function ru(r){var e=new Map;return function(n){n===void 0&&(n=r);var i=e.get(n);return i||e.set(n,i={variables:new Set,fragmentSpreads:new Set}),i}}function Fo(r,e){for(var t=ru(""),n=ru(""),i=function(b){for(var S=0,O=void 0;S<b.length&&(O=b[S]);++S)if(!ne(O)){if(O.kind===we.OPERATION_DEFINITION)return t(O.name&&O.name.value);if(O.kind===we.FRAGMENT_DEFINITION)return n(O.name.value)}return __DEV__&&T.error("Could not find operation or fragment"),null},a=0,o=e.definitions.length-1;o>=0;--o)e.definitions[o].kind===we.OPERATION_DEFINITION&&++a;var s=Ef(r),u=r.some(function(b){return b.remove}),l=function(b){return u&&b&&b.some(s)},p=new Map,f=!1,h={enter:function(b){if(l(b.directives))return f=!0,null}},d=Me(e,{Field:h,InlineFragment:h,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(b,S,O,k,N){var I=i(N);I&&I.variables.add(b.name.value)}},FragmentSpread:{enter:function(b,S,O,k,N){if(l(b.directives))return f=!0,null;var I=i(N);I&&I.fragmentSpreads.add(b.name.value)}},FragmentDefinition:{enter:function(b,S,O,k){p.set(JSON.stringify(k),b)},leave:function(b,S,O,k){var N=p.get(JSON.stringify(k));if(b===N)return b;if(a>0&&b.selectionSet.selections.every(function(I){return I.kind===we.FIELD&&I.name.value==="__typename"}))return n(b.name.value).removed=!0,f=!0,null}},Directive:{leave:function(b){if(s(b))return f=!0,null}}});if(!f)return e;var y=function(b){return b.transitiveVars||(b.transitiveVars=new Set(b.variables),b.removed||b.fragmentSpreads.forEach(function(S){y(n(S)).transitiveVars.forEach(function(O){b.transitiveVars.add(O)})})),b},g=new Set;d.definitions.forEach(function(b){b.kind===we.OPERATION_DEFINITION?y(t(b.name&&b.name.value)).fragmentSpreads.forEach(function(S){g.add(S)}):b.kind===we.FRAGMENT_DEFINITION&&a===0&&!n(b.name.value).removed&&g.add(b.name.value)}),g.forEach(function(b){y(n(b)).fragmentSpreads.forEach(function(S){g.add(S)})});var C=function(b){return!!(!g.has(b)||n(b).removed)},_={enter:function(b){if(C(b.name.value))return null}};return _f(Me(d,{FragmentSpread:_,FragmentDefinition:_,OperationDefinition:{leave:function(b){if(b.variableDefinitions){var S=y(t(b.name&&b.name.value)).transitiveVars;if(S.size<b.variableDefinitions.length)return m(m({},b),{variableDefinitions:b.variableDefinitions.filter(function(O){return S.has(O.variable.name.value)})})}}}}))}var Er=Object.assign(function(r){return Me(r,{SelectionSet:{enter:function(e,t,n){if(!(n&&n.kind===we.OPERATION_DEFINITION)){var i=e.selections;if(!!i){var a=i.some(function(s){return et(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=n;if(!(et(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return m(m({},e),{selections:Wt(Wt([],i,!0),[tu],!1)})}}}}}})},{added:function(r){return r===tu}}),xf={test:function(r){var e=r.name.value==="connection";return e&&(!r.arguments||!r.arguments.some(function(t){return t.name.value==="key"}))&&__DEV__&&T.warn("Removing an @connection directive even though it does not have a key. You may want to use the key parameter to specify a store key."),e}};function $o(r){return Fo([xf],en(r))}function Mo(r){var e=wr(r),t=e.operation;if(t==="query")return r;var n=Me(r,{OperationDefinition:{enter:function(i){return m(m({},i),{operation:"query"})}}});return n}function jo(r){en(r);var e=Fo([{test:function(t){return t.name.value==="client"},remove:!0}],r);return e}var Of=Object.prototype.hasOwnProperty;function Uo(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return Qn(r)}function Qn(r){var e=r[0]||{},t=r.length;if(t>1)for(var n=new ze,i=1;i<t;++i)e=n.merge(e,r[i]);return e}var Tf=function(r,e,t){return this.merge(r[t],e[t])},ze=function(){function r(e){e===void 0&&(e=Tf),this.reconciler=e,this.isObject=z,this.pastCopies=new Set}return r.prototype.merge=function(e,t){for(var n=this,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];return z(t)&&z(e)?(Object.keys(t).forEach(function(o){if(Of.call(e,o)){var s=e[o];if(t[o]!==s){var u=n.reconciler.apply(n,Wt([e,t,o],i,!1));u!==s&&(e=n.shallowCopyForMerge(e),e[o]=u)}}else e=n.shallowCopyForMerge(e),e[o]=t[o]}),e):t},r.prototype.shallowCopyForMerge=function(e){return z(e)&&(this.pastCopies.has(e)||(Array.isArray(e)?e=e.slice(0):e=m({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},r}();function Af(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=If(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 If(r,e){if(!!r){if(typeof r=="string")return iu(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return iu(r,e)}}function iu(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function au(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function Qo(r,e,t){return e&&au(r.prototype,e),t&&au(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}var Wo=function(){return typeof Symbol=="function"},Go=function(r){return Wo()&&Boolean(Symbol[r])},Ko=function(r){return Go(r)?Symbol[r]:"@@"+r};Wo()&&!Go("observable")&&(Symbol.observable=Symbol("observable"));var kf=Ko("iterator"),Bo=Ko("observable"),ou=Ko("species");function Bi(r,e){var t=r[e];if(t!=null){if(typeof t!="function")throw new TypeError(t+" is not a function");return t}}function Wn(r){var e=r.constructor;return e!==void 0&&(e=e[ou],e===null&&(e=void 0)),e!==void 0?e:Q}function Df(r){return r instanceof Q}function rn(r){rn.log?rn.log(r):setTimeout(function(){throw r})}function qi(r){Promise.resolve().then(function(){try{r()}catch(e){rn(e)}})}function su(r){var e=r._cleanup;if(e!==void 0&&(r._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var t=Bi(e,"unsubscribe");t&&t.call(e)}}catch(n){rn(n)}}function Vo(r){r._observer=void 0,r._queue=void 0,r._state="closed"}function Nf(r){var e=r._queue;if(!!e){r._queue=void 0,r._state="ready";for(var t=0;t<e.length&&(cu(r,e[t].type,e[t].value),r._state!=="closed");++t);}}function cu(r,e,t){r._state="running";var n=r._observer;try{var i=Bi(n,e);switch(e){case"next":i&&i.call(n,t);break;case"error":if(Vo(r),i)i.call(n,t);else throw t;break;case"complete":Vo(r),i&&i.call(n);break}}catch(a){rn(a)}r._state==="closed"?su(r):r._state==="running"&&(r._state="ready")}function qo(r,e,t){if(r._state!=="closed"){if(r._state==="buffering"){r._queue.push({type:e,value:t});return}if(r._state!=="ready"){r._state="buffering",r._queue=[{type:e,value:t}],qi(function(){return Nf(r)});return}cu(r,e,t)}}var Pf=function(){function r(t,n){this._cleanup=void 0,this._observer=t,this._queue=void 0,this._state="initializing";var i=new Rf(this);try{this._cleanup=n.call(void 0,i)}catch(a){i.error(a)}this._state==="initializing"&&(this._state="ready")}var e=r.prototype;return e.unsubscribe=function(){this._state!=="closed"&&(Vo(this),su(this))},Qo(r,[{key:"closed",get:function(){return this._state==="closed"}}]),r}(),Rf=function(){function r(t){this._subscription=t}var e=r.prototype;return e.next=function(n){qo(this._subscription,"next",n)},e.error=function(n){qo(this._subscription,"error",n)},e.complete=function(){qo(this._subscription,"complete")},Qo(r,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),r}(),Q=function(){function r(t){if(!(this instanceof r))throw new TypeError("Observable cannot be called as a function");if(typeof t!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=t}var e=r.prototype;return e.subscribe=function(n){return(typeof n!="object"||n===null)&&(n={next:n,error:arguments[1],complete:arguments[2]}),new Pf(n,this._subscriber)},e.forEach=function(n){var i=this;return new Promise(function(a,o){if(typeof n!="function"){o(new TypeError(n+" is not a function"));return}function s(){u.unsubscribe(),a()}var u=i.subscribe({next:function(l){try{n(l,s)}catch(p){o(p),u.unsubscribe()}},error:o,complete:a})})},e.map=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Wn(this);return new a(function(o){return i.subscribe({next:function(s){try{s=n(s)}catch(u){return o.error(u)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},e.filter=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Wn(this);return new a(function(o){return i.subscribe({next:function(s){try{if(!n(s))return}catch(u){return o.error(u)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},e.reduce=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Wn(this),o=arguments.length>1,s=!1,u=arguments[1],l=u;return new a(function(p){return i.subscribe({next:function(f){var h=!s;if(s=!0,!h||o)try{l=n(l,f)}catch(d){return p.error(d)}else l=f},error:function(f){p.error(f)},complete:function(){if(!s&&!o)return p.error(new TypeError("Cannot reduce an empty sequence"));p.next(l),p.complete()}})})},e.concat=function(){for(var n=this,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];var s=Wn(this);return new s(function(u){var l,p=0;function f(h){l=h.subscribe({next:function(d){u.next(d)},error:function(d){u.error(d)},complete:function(){p===a.length?(l=void 0,u.complete()):f(s.from(a[p++]))}})}return f(n),function(){l&&(l.unsubscribe(),l=void 0)}})},e.flatMap=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Wn(this);return new a(function(o){var s=[],u=i.subscribe({next:function(p){if(n)try{p=n(p)}catch(h){return o.error(h)}var f=a.from(p).subscribe({next:function(h){o.next(h)},error:function(h){o.error(h)},complete:function(){var h=s.indexOf(f);h>=0&&s.splice(h,1),l()}});s.push(f)},error:function(p){o.error(p)},complete:function(){l()}});function l(){u.closed&&s.length===0&&o.complete()}return function(){s.forEach(function(p){return p.unsubscribe()}),u.unsubscribe()}})},e[Bo]=function(){return this},r.from=function(n){var i=typeof this=="function"?this:r;if(n==null)throw new TypeError(n+" is not an object");var a=Bi(n,Bo);if(a){var o=a.call(n);if(Object(o)!==o)throw new TypeError(o+" is not an object");return Df(o)&&o.constructor===i?o:new i(function(s){return o.subscribe(s)})}if(Go("iterator")&&(a=Bi(n,kf),a))return new i(function(s){qi(function(){if(!s.closed){for(var u=Af(a.call(n)),l;!(l=u()).done;){var p=l.value;if(s.next(p),s.closed)return}s.complete()}})});if(Array.isArray(n))return new i(function(s){qi(function(){if(!s.closed){for(var u=0;u<n.length;++u)if(s.next(n[u]),s.closed)return;s.complete()}})});throw new TypeError(n+" is not observable")},r.of=function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];var o=typeof this=="function"?this:r;return new o(function(s){qi(function(){if(!s.closed){for(var u=0;u<i.length;++u)if(s.next(i[u]),s.closed)return;s.complete()}})})},Qo(r,null,[{key:ou,get:function(){return this}}]),r}();Wo()&&Object.defineProperty(Q,Symbol("extensions"),{value:{symbol:Bo,hostReportError:rn},configurable:!0});function zo(r){var e,t=r.Symbol;if(typeof t=="function")if(t.observable)e=t.observable;else{typeof t.for=="function"?e=t.for("https://github.com/benlesh/symbol-observable"):e=t("https://github.com/benlesh/symbol-observable");try{t.observable=e}catch{}}else e="@@observable";return e}var nn;typeof self<"u"?nn=self:typeof window<"u"?nn=window:typeof global<"u"?nn=global:typeof module<"u"?nn=module:nn=Function("return this")();var I3=zo(nn);var uu=Q.prototype,lu="@@observable";uu[lu]||(uu[lu]=function(){return this});var Lf=Object.prototype.toString;function Vi(r){return Ho(r)}function Ho(r,e){switch(Lf.call(r)){case"[object Array]":{if(e=e||new Map,e.has(r))return e.get(r);var t=r.slice(0);return e.set(r,t),t.forEach(function(i,a){t[a]=Ho(i,e)}),t}case"[object Object]":{if(e=e||new Map,e.has(r))return e.get(r);var n=Object.create(Object.getPrototypeOf(r));return e.set(r,n),Object.keys(r).forEach(function(i){n[i]=Ho(r[i],e)}),n}default:return r}}function Ff(r){var e=new Set([r]);return e.forEach(function(t){z(t)&&$f(t)===t&&Object.getOwnPropertyNames(t).forEach(function(n){z(t[n])&&e.add(t[n])})}),r}function $f(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__&&Ff(r),r}function xr(r,e,t){var n=[];r.forEach(function(i){return i[e]&&n.push(i)}),n.forEach(function(i){return i[e](t)})}function Qi(r,e,t){return new Q(function(n){var i=n.next,a=n.error,o=n.complete,s=0,u=!1,l={then:function(d){return new Promise(function(y){return y(d())})}};function p(d,y){return d?function(g){++s;var C=function(){return d(g)};l=l.then(C,C).then(function(_){--s,i&&i.call(n,_),u&&f.complete()},function(_){throw--s,_}).catch(function(_){a&&a.call(n,_)})}:function(g){return y&&y.call(n,g)}}var f={next:p(e,i),error:p(t,a),complete:function(){u=!0,s||o&&o.call(n)}},h=r.subscribe(f);return function(){return h.unsubscribe()}})}var ot=typeof WeakMap=="function"&&Ie(function(){return navigator.product})!=="ReactNative",pu=typeof WeakSet=="function",Jo=typeof Symbol=="function"&&typeof Symbol.for=="function",zt=Jo&&Symbol.asyncIterator,B3=typeof Ie(function(){return window.document.createElement})=="function",V3=Ie(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1;function Wi(r){function e(t){Object.defineProperty(r,t,{value:Q})}return Jo&&Symbol.species&&e(Symbol.species),e("@@species"),r}function fu(r){return r&&typeof r.then=="function"}var an=function(r){ge(e,r);function e(t){var n=r.call(this,function(i){return n.addObserver(i),function(){return n.removeObserver(i)}})||this;return n.observers=new Set,n.promise=new Promise(function(i,a){n.resolve=i,n.reject=a}),n.handlers={next:function(i){n.sub!==null&&(n.latest=["next",i],n.notify("next",i),xr(n.observers,"next",i))},error:function(i){var a=n.sub;a!==null&&(a&&setTimeout(function(){return a.unsubscribe()}),n.sub=null,n.latest=["error",i],n.reject(i),n.notify("error",i),xr(n.observers,"error",i))},complete:function(){var i=n,a=i.sub,o=i.sources,s=o===void 0?[]:o;if(a!==null){var u=s.shift();u?fu(u)?u.then(function(l){return n.sub=l.subscribe(n.handlers)}):n.sub=u.subscribe(n.handlers):(a&&setTimeout(function(){return a.unsubscribe()}),n.sub=null,n.latest&&n.latest[0]==="next"?n.resolve(n.latest[1]):n.resolve(),n.notify("complete"),xr(n.observers,"complete"))}}},n.nextResultListeners=new Set,n.cancel=function(i){n.reject(i),n.sources=[],n.handlers.complete()},n.promise.catch(function(i){}),typeof t=="function"&&(t=[new Q(t)]),fu(t)?t.then(function(i){return n.start(i)},n.handlers.error):n.start(t),n}return e.prototype.start=function(t){this.sub===void 0&&(this.sources=Array.from(t),this.handlers.complete())},e.prototype.deliverLastMessage=function(t){if(this.latest){var n=this.latest[0],i=t[n];i&&i.call(t,this.latest[1]),this.sub===null&&n==="next"&&t.complete&&t.complete()}},e.prototype.addObserver=function(t){this.observers.has(t)||(this.deliverLastMessage(t),this.observers.add(t))},e.prototype.removeObserver=function(t){this.observers.delete(t)&&this.observers.size<1&&this.handlers.complete()},e.prototype.notify=function(t,n){var i=this.nextResultListeners;i.size&&(this.nextResultListeners=new Set,i.forEach(function(a){return a(t,n)}))},e.prototype.beforeNext=function(t){var n=!1;this.nextResultListeners.add(function(i,a){n||(n=!0,t(i,a))})},e}(Q);Wi(an);function Ht(r){return"incremental"in r}function Mf(r){return"hasNext"in r&&"data"in r}function du(r){return Ht(r)||Mf(r)}function Gi(r,e){var t=r,n=new ze;return Ht(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 u=o[s],l=!isNaN(+u),p=l?[]:{};p[u]=a,a=p}t=n.merge(t,a)}),t}function on(r){var e=Ki(r);return Oe(e)}function Ki(r){var e=Oe(r.errors)?r.errors.slice(0):[];return Ht(r)&&Oe(r.incremental)&&r.incremental.forEach(function(t){t.errors&&e.push.apply(e,t.errors)}),e}function Jt(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=Object.create(null);return r.forEach(function(n){!n||Object.keys(n).forEach(function(i){var a=n[i];a!==void 0&&(t[i]=a)})}),t}var hu=new Map;function Kn(r){var e=hu.get(r)||1;return hu.set(r,e+1),"".concat(r,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function mu(r){var e=Kn("stringifyForDisplay");return JSON.stringify(r,function(t,n){return n===void 0?e:n}).split(JSON.stringify(e)).join("<undefined>")}function zn(r,e){return Jt(r,e,e.variables&&{variables:m(m({},r&&r.variables),e.variables)})}function zi(r){return new Q(function(e){e.error(r)})}var Hn=function(r,e,t){var n=new Error(t);throw n.name="ServerError",n.response=r,n.statusCode=r.status,n.result=e,n};function Yo(r){for(var e=["query","operationName","variables","extensions","context"],t=0,n=Object.keys(r);t<n.length;t++){var i=n[t];if(e.indexOf(i)<0)throw __DEV__?new U("illegal argument: ".concat(i)):new U(27)}return r}function Xo(r,e){var t=m({},r),n=function(a){typeof a=="function"?t=m(m({},t),a(t)):t=m(m({},t),a)},i=function(){return m({},t)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:n}),Object.defineProperty(e,"getContext",{enumerable:!1,value:i}),e}function Zo(r){var e={variables:r.variables||{},extensions:r.extensions||{},operationName:r.operationName,query:r.query};return e.operationName||(e.operationName=typeof e.query!="string"?tn(e.query)||void 0:""),e}function yu(r,e){return e?e(r):Q.of()}function Jn(r){return typeof r=="function"?new st(r):r}function Hi(r){return r.request.length<=1}var jf=function(r){ge(e,r);function e(t,n){var i=r.call(this,t)||this;return i.link=n,i}return e}(Error),st=function(){function r(e){e&&(this.request=e)}return r.empty=function(){return new r(function(){return Q.of()})},r.from=function(e){return e.length===0?r.empty():e.map(Jn).reduce(function(t,n){return t.concat(n)})},r.split=function(e,t,n){var i=Jn(t),a=Jn(n||new r(yu));return Hi(i)&&Hi(a)?new r(function(o){return e(o)?i.request(o)||Q.of():a.request(o)||Q.of()}):new r(function(o,s){return e(o)?i.request(o,s)||Q.of():a.request(o,s)||Q.of()})},r.execute=function(e,t){return e.request(Xo(t.context,Zo(Yo(t))))||Q.of()},r.concat=function(e,t){var n=Jn(e);if(Hi(n))return __DEV__&&T.warn(new jf("You are calling concat on a terminating link, which will have no effect",n)),n;var i=Jn(t);return Hi(i)?new r(function(a){return n.request(a,function(o){return i.request(o)||Q.of()})||Q.of()}):new r(function(a,o){return n.request(a,function(s){return i.request(s,o)||Q.of()})||Q.of()})},r.prototype.split=function(e,t,n){return this.concat(r.split(e,t,n||new r(yu)))},r.prototype.concat=function(e){return r.concat(this,e)},r.prototype.request=function(e,t){throw __DEV__?new U("request is not implemented"):new U(22)},r.prototype.onError=function(e,t){if(t&&t.error)return t.error(e),!1;throw e},r.prototype.setOnError=function(e){return this.onError=e,this},r}();var sn=st.execute;var gu="3.7.10";function vu(r){return!!r.body}function bu(r){return!!r.getReader}function Cu(r){return!!(zt&&r[Symbol.asyncIterator])}function Su(r){return!!r.stream}function wu(r){return!!r.arrayBuffer}function _u(r){return!!r.pipe}function es(r){var e,t=r[Symbol.asyncIterator]();return e={next:function(){return t.next()}},e[Symbol.asyncIterator]=function(){return this},e}function ts(r){var e=null,t=null,n=!1,i=[],a=[];function o(f){if(!t){if(a.length){var h=a.shift();if(Array.isArray(h)&&h[0])return h[0]({value:f,done:!1})}i.push(f)}}function s(f){t=f;var h=a.slice();h.forEach(function(d){d[1](f)}),!e||e()}function u(){n=!0;var f=a.slice();f.forEach(function(h){h[0]({value:void 0,done:!0})}),!e||e()}e=function(){e=null,r.removeListener("data",o),r.removeListener("error",s),r.removeListener("end",u),r.removeListener("finish",u),r.removeListener("close",u)},r.on("data",o),r.on("error",s),r.on("end",u),r.on("finish",u),r.on("close",u);function l(){return new Promise(function(f,h){if(t)return h(t);if(i.length)return f({value:i.shift(),done:!1});if(n)return f({value:void 0,done:!0});a.push([f,h])})}var p={next:function(){return l()}};return zt&&(p[Symbol.asyncIterator]=function(){return this}),p}function rs(r){var e=!1,t={next:function(){return e?Promise.resolve({value:void 0,done:!0}):(e=!0,new Promise(function(n,i){r.then(function(a){n({value:a,done:!1})}).catch(i)}))}};return zt&&(t[Symbol.asyncIterator]=function(){return this}),t}function Ji(r){var e={next:function(){return r.read()}};return zt&&(e[Symbol.asyncIterator]=function(){return this}),e}function Eu(r){var e=r;if(vu(r)&&(e=r.body),Cu(e))return es(e);if(bu(e))return Ji(e.getReader());if(Su(e))return Ji(e.stream().getReader());if(wu(e))return rs(e.arrayBuffer());if(_u(e))return ts(e);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var xu=Object.prototype.hasOwnProperty;function Ou(r,e){var t,n,i;return lt(this,void 0,void 0,function(){var a,o,s,u,l,p,f,h,d,y,g,C,_,b,S,O,k,N,I,R;return pt(this,function(re){switch(re.label){case 0:if(TextDecoder===void 0)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");a=new TextDecoder("utf-8"),o=(t=r.headers)===null||t===void 0?void 0:t.get("content-type"),s="boundary=",u=o?.includes(s)?o?.substring(o?.indexOf(s)+s.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",l="--".concat(u),p="",f=Eu(r),h=!0,re.label=1;case 1:return h?[4,f.next()]:[3,3];case 2:for(d=re.sent(),y=d.value,g=d.done,C=typeof y=="string"?y:a.decode(y),h=!g,p+=C,_=p.indexOf(l);_>-1;){if(b=void 0,R=[p.slice(0,_),p.slice(_+l.length)],b=R[0],p=R[1],b.trim()){if(S=b.indexOf(`\r
|
|
23
|
+
}`)}function ye(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return e!=null&&e!==""?r+e+t:""}function Ui(r){return ye(" ",r.replace(/\n/g,`
|
|
24
|
+
`))}function ef(r){return r.indexOf(`
|
|
25
|
+
`)!==-1}function Zc(r){return r!=null&&r.some(ef)}function jn(r){return r.kind===Ee.FIELD||r.kind===Ee.FRAGMENT_SPREAD||r.kind===Ee.INLINE_FRAGMENT}function eu(){return typeof ji=="function"?Oo():Oo()}function pf(){__DEV__?T(typeof gr=="boolean",gr):T(typeof gr=="boolean",39)}eu();pf();function Nt(r,e){var t=r.directives;return!t||!t.length?!0:tu(t).every(function(n){var i=n.directive,a=n.ifArgument,o=!1;return a.value.kind==="Variable"?(o=e&&e[a.value.name.value],__DEV__?T(o!==void 0,"Invalid variable referenced in @".concat(i.name.value," directive.")):T(o!==void 0,40)):o=a.value.value,i.name.value==="skip"?!o:o})}function Zr(r,e,t){var n=new Set(r),i=n.size;return Me(e,{Directive:function(a){if(n.delete(a.name.value)&&(!t||!n.size))return vr}}),t?!n.size:n.size<i}function ko(r){return r&&Zr(["client","export"],r,!0)}function ff(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(!!ff(t)){var n=t.arguments,i=t.name.value;__DEV__?T(n&&n.length===1,"Incorrect number of arguments for the @".concat(i," directive.")):T(n&&n.length===1,41);var a=n[0];__DEV__?T(a.name&&a.name.value==="if","Invalid argument for the @".concat(i," directive.")):T(a.name&&a.name.value==="if",42);var o=a.value;__DEV__?T(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),"Argument for the @".concat(i," directive must be a variable or a boolean value.")):T(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),43),e.push({directive:t,ifArgument:a})}}),e}function Do(r,e){var t=e,n=[];r.definitions.forEach(function(a){if(a.kind==="OperationDefinition")throw __DEV__?new U("Found a ".concat(a.operation," operation").concat(a.name?" named '".concat(a.name.value,"'"):"",". ")+"No operations are allowed when using a fragment as a query. Only fragments are allowed."):new U(44);a.kind==="FragmentDefinition"&&n.push(a)}),typeof t>"u"&&(__DEV__?T(n.length===1,"Found ".concat(n.length," fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")):T(n.length===1,45),t=n[0].name.value);var i=m(m({},r),{definitions:Wt([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:t}}]}}],r.definitions,!0)});return i}function br(r){r===void 0&&(r=[]);var e={};return r.forEach(function(t){e[t.name.value]=t}),e}function Cr(r,e){switch(r.kind){case"InlineFragment":return r;case"FragmentSpread":{var t=r.name.value;if(typeof e=="function")return e(t);var n=e&&e[t];return __DEV__?T(n,"No fragment named ".concat(t)):T(n,46),n||null}default:return null}}function H(r){return r!==null&&typeof r=="object"}function _t(r){return{__ref:String(r)}}function G(r){return Boolean(r&&typeof r=="object"&&typeof r.__ref=="string")}function No(r){return H(r)&&r.kind==="Document"&&Array.isArray(r.definitions)}function df(r){return r.kind==="StringValue"}function hf(r){return r.kind==="BooleanValue"}function mf(r){return r.kind==="IntValue"}function yf(r){return r.kind==="FloatValue"}function gf(r){return r.kind==="Variable"}function vf(r){return r.kind==="ObjectValue"}function bf(r){return r.kind==="ListValue"}function Cf(r){return r.kind==="EnumValue"}function Sf(r){return r.kind==="NullValue"}function Kt(r,e,t,n){if(mf(t)||yf(t))r[e.value]=Number(t.value);else if(hf(t)||df(t))r[e.value]=t.value;else if(vf(t)){var i={};t.fields.map(function(o){return Kt(i,o.name,o.value,n)}),r[e.value]=i}else if(gf(t)){var a=(n||{})[t.name.value];r[e.value]=a}else if(bf(t))r[e.value]=t.values.map(function(o){var s={};return Kt(s,e,o,n),s[e.value]});else if(Cf(t))r[e.value]=t.value;else if(Sf(t))r[e.value]=null;else throw __DEV__?new U('The inline argument "'.concat(e.value,'" of kind "').concat(t.kind,'"')+"is not supported. Use variables instead of inline arguments to overcome this limitation."):new U(55)}function Po(r,e){var t=null;r.directives&&(t={},r.directives.forEach(function(i){t[i.name.value]={},i.arguments&&i.arguments.forEach(function(a){var o=a.name,s=a.value;return Kt(t[i.name.value],o,s,e)})}));var n=null;return r.arguments&&r.arguments.length&&(n={},r.arguments.forEach(function(i){var a=i.name,o=i.value;return Kt(n,a,o,e)})),qn(r.name.value,n,t)}var wf=["connection","include","skip","client","rest","export"],qn=Object.assign(function(r,e,t){if(e&&t&&t.connection&&t.connection.key)if(t.connection.filter&&t.connection.filter.length>0){var n=t.connection.filter?t.connection.filter:[];n.sort();var i={};return n.forEach(function(s){i[s]=e[s]}),"".concat(t.connection.key,"(").concat(Un(i),")")}else return t.connection.key;var a=r;if(e){var o=Un(e);a+="(".concat(o,")")}return t&&Object.keys(t).forEach(function(s){wf.indexOf(s)===-1&&(t[s]&&Object.keys(t[s]).length?a+="@".concat(s,"(").concat(Un(t[s]),")"):a+="@".concat(s))}),a},{setStringify:function(r){var e=Un;return Un=r,e}}),Un=function(e){return JSON.stringify(e,_f)};function _f(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 Pt(r,e){if(r.arguments&&r.arguments.length){var t={};return r.arguments.forEach(function(n){var i=n.name,a=n.value;return Kt(t,i,a,e)}),t}return null}function st(r){return r.alias?r.alias.value:r.name.value}function Bn(r,e,t){if(typeof r.__typename=="string")return r.__typename;for(var n=0,i=e.selections;n<i.length;n++){var a=i[n];if(tt(a)){if(a.name.value==="__typename")return r[st(a)]}else{var o=Bn(r,Cr(a,t).selectionSet,t);if(typeof o=="string")return o}}}function tt(r){return r.kind==="Field"}function Ro(r){return r.kind==="InlineFragment"}function en(r){__DEV__?T(r&&r.kind==="Document",'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):T(r&&r.kind==="Document",47);var e=r.definitions.filter(function(t){return t.kind!=="FragmentDefinition"}).map(function(t){if(t.kind!=="OperationDefinition")throw __DEV__?new U('Schema type definitions not allowed in queries. Found: "'.concat(t.kind,'"')):new U(48);return t});return __DEV__?T(e.length<=1,"Ambiguous GraphQL document: contains ".concat(e.length," operations")):T(e.length<=1,49),r}function Et(r){return en(r),r.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function tn(r){return r.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function Sr(r){return r.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function Vn(r){var e=Et(r);return __DEV__?T(e&&e.operation==="query","Must contain a query definition."):T(e&&e.operation==="query",50),e}function Lo(r){__DEV__?T(r.kind==="Document",'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):T(r.kind==="Document",51),__DEV__?T(r.definitions.length<=1,"Fragment must have exactly one definition."):T(r.definitions.length<=1,52);var e=r.definitions[0];return __DEV__?T(e.kind==="FragmentDefinition","Must be a fragment definition."):T(e.kind==="FragmentDefinition",53),e}function wr(r){en(r);for(var e,t=0,n=r.definitions;t<n.length;t++){var i=n[t];if(i.kind==="OperationDefinition"){var a=i.operation;if(a==="query"||a==="mutation"||a==="subscription")return i}i.kind==="FragmentDefinition"&&!e&&(e=i)}if(e)return e;throw __DEV__?new U("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new U(54)}function _r(r){var e=Object.create(null),t=r&&r.variableDefinitions;return t&&t.length&&t.forEach(function(n){n.defaultValue&&Kt(e,n.variable.name,n.defaultValue)}),e}var ne=Array.isArray;function Te(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 Ef(r){return iu(Et(r)||Lo(r),br(Sr(r)))?null:r}function xf(r){var e=new Set,t=[];return r.forEach(function(n){n.name?e.add(n.name):n.test&&t.push(n.test)}),function(n){return e.has(n.name.value)||t.some(function(i){return i(n)})}}function nu(r){var e=new Map;return function(n){n===void 0&&(n=r);var i=e.get(n);return i||e.set(n,i={variables:new Set,fragmentSpreads:new Set}),i}}function Fo(r,e){for(var t=nu(""),n=nu(""),i=function(b){for(var S=0,O=void 0;S<b.length&&(O=b[S]);++S)if(!ne(O)){if(O.kind===Ee.OPERATION_DEFINITION)return t(O.name&&O.name.value);if(O.kind===Ee.FRAGMENT_DEFINITION)return n(O.name.value)}return __DEV__&&T.error("Could not find operation or fragment"),null},a=0,o=e.definitions.length-1;o>=0;--o)e.definitions[o].kind===Ee.OPERATION_DEFINITION&&++a;var s=xf(r),u=r.some(function(b){return b.remove}),l=function(b){return u&&b&&b.some(s)},p=new Map,f=!1,h={enter:function(b){if(l(b.directives))return f=!0,null}},d=Me(e,{Field:h,InlineFragment:h,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(b,S,O,k,N){var I=i(N);I&&I.variables.add(b.name.value)}},FragmentSpread:{enter:function(b,S,O,k,N){if(l(b.directives))return f=!0,null;var I=i(N);I&&I.fragmentSpreads.add(b.name.value)}},FragmentDefinition:{enter:function(b,S,O,k){p.set(JSON.stringify(k),b)},leave:function(b,S,O,k){var N=p.get(JSON.stringify(k));if(b===N)return b;if(a>0&&b.selectionSet.selections.every(function(I){return I.kind===Ee.FIELD&&I.name.value==="__typename"}))return n(b.name.value).removed=!0,f=!0,null}},Directive:{leave:function(b){if(s(b))return f=!0,null}}});if(!f)return e;var y=function(b){return b.transitiveVars||(b.transitiveVars=new Set(b.variables),b.removed||b.fragmentSpreads.forEach(function(S){y(n(S)).transitiveVars.forEach(function(O){b.transitiveVars.add(O)})})),b},g=new Set;d.definitions.forEach(function(b){b.kind===Ee.OPERATION_DEFINITION?y(t(b.name&&b.name.value)).fragmentSpreads.forEach(function(S){g.add(S)}):b.kind===Ee.FRAGMENT_DEFINITION&&a===0&&!n(b.name.value).removed&&g.add(b.name.value)}),g.forEach(function(b){y(n(b)).fragmentSpreads.forEach(function(S){g.add(S)})});var C=function(b){return!!(!g.has(b)||n(b).removed)},_={enter:function(b){if(C(b.name.value))return null}};return Ef(Me(d,{FragmentSpread:_,FragmentDefinition:_,OperationDefinition:{leave:function(b){if(b.variableDefinitions){var S=y(t(b.name&&b.name.value)).transitiveVars;if(S.size<b.variableDefinitions.length)return m(m({},b),{variableDefinitions:b.variableDefinitions.filter(function(O){return S.has(O.variable.name.value)})})}}}}))}var Er=Object.assign(function(r){return Me(r,{SelectionSet:{enter:function(e,t,n){if(!(n&&n.kind===Ee.OPERATION_DEFINITION)){var i=e.selections;if(!!i){var a=i.some(function(s){return tt(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=n;if(!(tt(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return m(m({},e),{selections:Wt(Wt([],i,!0),[ru],!1)})}}}}}})},{added:function(r){return r===ru}}),Of={test:function(r){var e=r.name.value==="connection";return e&&(!r.arguments||!r.arguments.some(function(t){return t.name.value==="key"}))&&__DEV__&&T.warn("Removing an @connection directive even though it does not have a key. You may want to use the key parameter to specify a store key."),e}};function $o(r){return Fo([Of],en(r))}function Mo(r){var e=wr(r),t=e.operation;if(t==="query")return r;var n=Me(r,{OperationDefinition:{enter:function(i){return m(m({},i),{operation:"query"})}}});return n}function jo(r){en(r);var e=Fo([{test:function(t){return t.name.value==="client"},remove:!0}],r);return e}var Tf=Object.prototype.hasOwnProperty;function Uo(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return Qn(r)}function Qn(r){var e=r[0]||{},t=r.length;if(t>1)for(var n=new ze,i=1;i<t;++i)e=n.merge(e,r[i]);return e}var Af=function(r,e,t){return this.merge(r[t],e[t])},ze=function(){function r(e){e===void 0&&(e=Af),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(Tf.call(e,o)){var s=e[o];if(t[o]!==s){var u=n.reconciler.apply(n,Wt([e,t,o],i,!1));u!==s&&(e=n.shallowCopyForMerge(e),e[o]=u)}}else e=n.shallowCopyForMerge(e),e[o]=t[o]}),e):t},r.prototype.shallowCopyForMerge=function(e){return H(e)&&(this.pastCopies.has(e)||(Array.isArray(e)?e=e.slice(0):e=m({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},r}();function If(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=kf(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 kf(r,e){if(!!r){if(typeof r=="string")return au(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return au(r,e)}}function au(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function ou(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function Qo(r,e,t){return e&&ou(r.prototype,e),t&&ou(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}var Wo=function(){return typeof Symbol=="function"},Go=function(r){return Wo()&&Boolean(Symbol[r])},Ko=function(r){return Go(r)?Symbol[r]:"@@"+r};Wo()&&!Go("observable")&&(Symbol.observable=Symbol("observable"));var Df=Ko("iterator"),Bo=Ko("observable"),su=Ko("species");function Bi(r,e){var t=r[e];if(t!=null){if(typeof t!="function")throw new TypeError(t+" is not a function");return t}}function Wn(r){var e=r.constructor;return e!==void 0&&(e=e[su],e===null&&(e=void 0)),e!==void 0?e:W}function Nf(r){return r instanceof W}function rn(r){rn.log?rn.log(r):setTimeout(function(){throw r})}function qi(r){Promise.resolve().then(function(){try{r()}catch(e){rn(e)}})}function cu(r){var e=r._cleanup;if(e!==void 0&&(r._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var t=Bi(e,"unsubscribe");t&&t.call(e)}}catch(n){rn(n)}}function Vo(r){r._observer=void 0,r._queue=void 0,r._state="closed"}function Pf(r){var e=r._queue;if(!!e){r._queue=void 0,r._state="ready";for(var t=0;t<e.length&&(uu(r,e[t].type,e[t].value),r._state!=="closed");++t);}}function uu(r,e,t){r._state="running";var n=r._observer;try{var i=Bi(n,e);switch(e){case"next":i&&i.call(n,t);break;case"error":if(Vo(r),i)i.call(n,t);else throw t;break;case"complete":Vo(r),i&&i.call(n);break}}catch(a){rn(a)}r._state==="closed"?cu(r):r._state==="running"&&(r._state="ready")}function qo(r,e,t){if(r._state!=="closed"){if(r._state==="buffering"){r._queue.push({type:e,value:t});return}if(r._state!=="ready"){r._state="buffering",r._queue=[{type:e,value:t}],qi(function(){return Pf(r)});return}uu(r,e,t)}}var Rf=function(){function r(t,n){this._cleanup=void 0,this._observer=t,this._queue=void 0,this._state="initializing";var i=new Lf(this);try{this._cleanup=n.call(void 0,i)}catch(a){i.error(a)}this._state==="initializing"&&(this._state="ready")}var e=r.prototype;return e.unsubscribe=function(){this._state!=="closed"&&(Vo(this),cu(this))},Qo(r,[{key:"closed",get:function(){return this._state==="closed"}}]),r}(),Lf=function(){function r(t){this._subscription=t}var e=r.prototype;return e.next=function(n){qo(this._subscription,"next",n)},e.error=function(n){qo(this._subscription,"error",n)},e.complete=function(){qo(this._subscription,"complete")},Qo(r,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),r}(),W=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 Rf(n,this._subscriber)},e.forEach=function(n){var i=this;return new Promise(function(a,o){if(typeof n!="function"){o(new TypeError(n+" is not a function"));return}function s(){u.unsubscribe(),a()}var u=i.subscribe({next:function(l){try{n(l,s)}catch(p){o(p),u.unsubscribe()}},error:o,complete:a})})},e.map=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Wn(this);return new a(function(o){return i.subscribe({next:function(s){try{s=n(s)}catch(u){return o.error(u)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},e.filter=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Wn(this);return new a(function(o){return i.subscribe({next:function(s){try{if(!n(s))return}catch(u){return o.error(u)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},e.reduce=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Wn(this),o=arguments.length>1,s=!1,u=arguments[1],l=u;return new a(function(p){return i.subscribe({next:function(f){var h=!s;if(s=!0,!h||o)try{l=n(l,f)}catch(d){return p.error(d)}else l=f},error:function(f){p.error(f)},complete:function(){if(!s&&!o)return p.error(new TypeError("Cannot reduce an empty sequence"));p.next(l),p.complete()}})})},e.concat=function(){for(var n=this,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];var s=Wn(this);return new s(function(u){var l,p=0;function f(h){l=h.subscribe({next:function(d){u.next(d)},error:function(d){u.error(d)},complete:function(){p===a.length?(l=void 0,u.complete()):f(s.from(a[p++]))}})}return f(n),function(){l&&(l.unsubscribe(),l=void 0)}})},e.flatMap=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Wn(this);return new a(function(o){var s=[],u=i.subscribe({next:function(p){if(n)try{p=n(p)}catch(h){return o.error(h)}var f=a.from(p).subscribe({next:function(h){o.next(h)},error:function(h){o.error(h)},complete:function(){var h=s.indexOf(f);h>=0&&s.splice(h,1),l()}});s.push(f)},error:function(p){o.error(p)},complete:function(){l()}});function l(){u.closed&&s.length===0&&o.complete()}return function(){s.forEach(function(p){return p.unsubscribe()}),u.unsubscribe()}})},e[Bo]=function(){return this},r.from=function(n){var i=typeof this=="function"?this:r;if(n==null)throw new TypeError(n+" is not an object");var a=Bi(n,Bo);if(a){var o=a.call(n);if(Object(o)!==o)throw new TypeError(o+" is not an object");return Nf(o)&&o.constructor===i?o:new i(function(s){return o.subscribe(s)})}if(Go("iterator")&&(a=Bi(n,Df),a))return new i(function(s){qi(function(){if(!s.closed){for(var u=If(a.call(n)),l;!(l=u()).done;){var p=l.value;if(s.next(p),s.closed)return}s.complete()}})});if(Array.isArray(n))return new i(function(s){qi(function(){if(!s.closed){for(var u=0;u<n.length;++u)if(s.next(n[u]),s.closed)return;s.complete()}})});throw new TypeError(n+" is not observable")},r.of=function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];var o=typeof this=="function"?this:r;return new o(function(s){qi(function(){if(!s.closed){for(var u=0;u<i.length;++u)if(s.next(i[u]),s.closed)return;s.complete()}})})},Qo(r,null,[{key:su,get:function(){return this}}]),r}();Wo()&&Object.defineProperty(W,Symbol("extensions"),{value:{symbol:Bo,hostReportError:rn},configurable:!0});function zo(r){var e,t=r.Symbol;if(typeof t=="function")if(t.observable)e=t.observable;else{typeof t.for=="function"?e=t.for("https://github.com/benlesh/symbol-observable"):e=t("https://github.com/benlesh/symbol-observable");try{t.observable=e}catch{}}else e="@@observable";return e}var nn;typeof self<"u"?nn=self:typeof window<"u"?nn=window:typeof global<"u"?nn=global:typeof module<"u"?nn=module:nn=Function("return this")();var k3=zo(nn);var lu=W.prototype,pu="@@observable";lu[pu]||(lu[pu]=function(){return this});var Ff=Object.prototype.toString;function Vi(r){return Ho(r)}function Ho(r,e){switch(Ff.call(r)){case"[object Array]":{if(e=e||new Map,e.has(r))return e.get(r);var t=r.slice(0);return e.set(r,t),t.forEach(function(i,a){t[a]=Ho(i,e)}),t}case"[object Object]":{if(e=e||new Map,e.has(r))return e.get(r);var n=Object.create(Object.getPrototypeOf(r));return e.set(r,n),Object.keys(r).forEach(function(i){n[i]=Ho(r[i],e)}),n}default:return r}}function $f(r){var e=new Set([r]);return e.forEach(function(t){H(t)&&Mf(t)===t&&Object.getOwnPropertyNames(t).forEach(function(n){H(t[n])&&e.add(t[n])})}),r}function Mf(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__&&$f(r),r}function xr(r,e,t){var n=[];r.forEach(function(i){return i[e]&&n.push(i)}),n.forEach(function(i){return i[e](t)})}function Qi(r,e,t){return new W(function(n){var i=n.next,a=n.error,o=n.complete,s=0,u=!1,l={then:function(d){return new Promise(function(y){return y(d())})}};function p(d,y){return d?function(g){++s;var C=function(){return d(g)};l=l.then(C,C).then(function(_){--s,i&&i.call(n,_),u&&f.complete()},function(_){throw--s,_}).catch(function(_){a&&a.call(n,_)})}:function(g){return y&&y.call(n,g)}}var f={next:p(e,i),error:p(t,a),complete:function(){u=!0,s||o&&o.call(n)}},h=r.subscribe(f);return function(){return h.unsubscribe()}})}var ct=typeof WeakMap=="function"&&ke(function(){return navigator.product})!=="ReactNative",fu=typeof WeakSet=="function",Jo=typeof Symbol=="function"&&typeof Symbol.for=="function",zt=Jo&&Symbol.asyncIterator,V3=typeof ke(function(){return window.document.createElement})=="function",Q3=ke(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1;function Wi(r){function e(t){Object.defineProperty(r,t,{value:W})}return Jo&&Symbol.species&&e(Symbol.species),e("@@species"),r}function du(r){return r&&typeof r.then=="function"}var an=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),xr(n.observers,"next",i))},error:function(i){var a=n.sub;a!==null&&(a&&setTimeout(function(){return a.unsubscribe()}),n.sub=null,n.latest=["error",i],n.reject(i),n.notify("error",i),xr(n.observers,"error",i))},complete:function(){var i=n,a=i.sub,o=i.sources,s=o===void 0?[]:o;if(a!==null){var u=s.shift();u?du(u)?u.then(function(l){return n.sub=l.subscribe(n.handlers)}):n.sub=u.subscribe(n.handlers):(a&&setTimeout(function(){return a.unsubscribe()}),n.sub=null,n.latest&&n.latest[0]==="next"?n.resolve(n.latest[1]):n.resolve(),n.notify("complete"),xr(n.observers,"complete"))}}},n.nextResultListeners=new Set,n.cancel=function(i){n.reject(i),n.sources=[],n.handlers.complete()},n.promise.catch(function(i){}),typeof t=="function"&&(t=[new W(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}(W);Wi(an);function Ht(r){return"incremental"in r}function jf(r){return"hasNext"in r&&"data"in r}function hu(r){return Ht(r)||jf(r)}function Gi(r,e){var t=r,n=new ze;return Ht(e)&&Te(e.incremental)&&e.incremental.forEach(function(i){for(var a=i.data,o=i.path,s=o.length-1;s>=0;--s){var u=o[s],l=!isNaN(+u),p=l?[]:{};p[u]=a,a=p}t=n.merge(t,a)}),t}function on(r){var e=Ki(r);return Te(e)}function Ki(r){var e=Te(r.errors)?r.errors.slice(0):[];return Ht(r)&&Te(r.incremental)&&r.incremental.forEach(function(t){t.errors&&e.push.apply(e,t.errors)}),e}function Jt(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=Object.create(null);return r.forEach(function(n){!n||Object.keys(n).forEach(function(i){var a=n[i];a!==void 0&&(t[i]=a)})}),t}var mu=new Map;function Kn(r){var e=mu.get(r)||1;return mu.set(r,e+1),"".concat(r,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function yu(r){var e=Kn("stringifyForDisplay");return JSON.stringify(r,function(t,n){return n===void 0?e:n}).split(JSON.stringify(e)).join("<undefined>")}function zn(r,e){return Jt(r,e,e.variables&&{variables:m(m({},r&&r.variables),e.variables)})}function zi(r){return new W(function(e){e.error(r)})}var Hn=function(r,e,t){var n=new Error(t);throw n.name="ServerError",n.response=r,n.statusCode=r.status,n.result=e,n};function Yo(r){for(var e=["query","operationName","variables","extensions","context"],t=0,n=Object.keys(r);t<n.length;t++){var i=n[t];if(e.indexOf(i)<0)throw __DEV__?new U("illegal argument: ".concat(i)):new U(27)}return r}function Xo(r,e){var t=m({},r),n=function(a){typeof a=="function"?t=m(m({},t),a(t)):t=m(m({},t),a)},i=function(){return m({},t)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:n}),Object.defineProperty(e,"getContext",{enumerable:!1,value:i}),e}function Zo(r){var e={variables:r.variables||{},extensions:r.extensions||{},operationName:r.operationName,query:r.query};return e.operationName||(e.operationName=typeof e.query!="string"?tn(e.query)||void 0:""),e}function gu(r,e){return e?e(r):W.of()}function Jn(r){return typeof r=="function"?new ut(r):r}function Hi(r){return r.request.length<=1}var Uf=function(r){be(e,r);function e(t,n){var i=r.call(this,t)||this;return i.link=n,i}return e}(Error),ut=function(){function r(e){e&&(this.request=e)}return r.empty=function(){return new r(function(){return W.of()})},r.from=function(e){return e.length===0?r.empty():e.map(Jn).reduce(function(t,n){return t.concat(n)})},r.split=function(e,t,n){var i=Jn(t),a=Jn(n||new r(gu));return Hi(i)&&Hi(a)?new r(function(o){return e(o)?i.request(o)||W.of():a.request(o)||W.of()}):new r(function(o,s){return e(o)?i.request(o,s)||W.of():a.request(o,s)||W.of()})},r.execute=function(e,t){return e.request(Xo(t.context,Zo(Yo(t))))||W.of()},r.concat=function(e,t){var n=Jn(e);if(Hi(n))return __DEV__&&T.warn(new Uf("You are calling concat on a terminating link, which will have no effect",n)),n;var i=Jn(t);return Hi(i)?new r(function(a){return n.request(a,function(o){return i.request(o)||W.of()})||W.of()}):new r(function(a,o){return n.request(a,function(s){return i.request(s,o)||W.of()})||W.of()})},r.prototype.split=function(e,t,n){return this.concat(r.split(e,t,n||new r(gu)))},r.prototype.concat=function(e){return r.concat(this,e)},r.prototype.request=function(e,t){throw __DEV__?new U("request is not implemented"):new U(22)},r.prototype.onError=function(e,t){if(t&&t.error)return t.error(e),!1;throw e},r.prototype.setOnError=function(e){return this.onError=e,this},r}();var sn=ut.execute;var vu="3.7.10";function bu(r){return!!r.body}function Cu(r){return!!r.getReader}function Su(r){return!!(zt&&r[Symbol.asyncIterator])}function wu(r){return!!r.stream}function _u(r){return!!r.arrayBuffer}function Eu(r){return!!r.pipe}function es(r){var e,t=r[Symbol.asyncIterator]();return e={next:function(){return t.next()}},e[Symbol.asyncIterator]=function(){return this},e}function ts(r){var e=null,t=null,n=!1,i=[],a=[];function o(f){if(!t){if(a.length){var h=a.shift();if(Array.isArray(h)&&h[0])return h[0]({value:f,done:!1})}i.push(f)}}function s(f){t=f;var h=a.slice();h.forEach(function(d){d[1](f)}),!e||e()}function u(){n=!0;var f=a.slice();f.forEach(function(h){h[0]({value:void 0,done:!0})}),!e||e()}e=function(){e=null,r.removeListener("data",o),r.removeListener("error",s),r.removeListener("end",u),r.removeListener("finish",u),r.removeListener("close",u)},r.on("data",o),r.on("error",s),r.on("end",u),r.on("finish",u),r.on("close",u);function l(){return new Promise(function(f,h){if(t)return h(t);if(i.length)return f({value:i.shift(),done:!1});if(n)return f({value:void 0,done:!0});a.push([f,h])})}var p={next:function(){return l()}};return zt&&(p[Symbol.asyncIterator]=function(){return this}),p}function rs(r){var e=!1,t={next:function(){return e?Promise.resolve({value:void 0,done:!0}):(e=!0,new Promise(function(n,i){r.then(function(a){n({value:a,done:!1})}).catch(i)}))}};return zt&&(t[Symbol.asyncIterator]=function(){return this}),t}function Ji(r){var e={next:function(){return r.read()}};return zt&&(e[Symbol.asyncIterator]=function(){return this}),e}function xu(r){var e=r;if(bu(r)&&(e=r.body),Su(e))return es(e);if(Cu(e))return Ji(e.getReader());if(wu(e))return Ji(e.stream().getReader());if(_u(e))return rs(e.arrayBuffer());if(Eu(e))return ts(e);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var Ou=Object.prototype.hasOwnProperty;function Tu(r,e){var t,n,i;return pt(this,void 0,void 0,function(){var a,o,s,u,l,p,f,h,d,y,g,C,_,b,S,O,k,N,I,R;return ft(this,function(re){switch(re.label){case 0:if(TextDecoder===void 0)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");a=new TextDecoder("utf-8"),o=(t=r.headers)===null||t===void 0?void 0:t.get("content-type"),s="boundary=",u=o?.includes(s)?o?.substring(o?.indexOf(s)+s.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",l="--".concat(u),p="",f=xu(r),h=!0,re.label=1;case 1:return h?[4,f.next()]:[3,3];case 2:for(d=re.sent(),y=d.value,g=d.done,C=typeof y=="string"?y:a.decode(y),h=!g,p+=C,_=p.indexOf(l);_>-1;){if(b=void 0,R=[p.slice(0,_),p.slice(_+l.length)],b=R[0],p=R[1],b.trim()){if(S=b.indexOf(`\r
|
|
27
27
|
\r
|
|
28
|
-
`),O=
|
|
29
|
-
`,"")),(Object.keys(I).length>1||"data"in I||"incremental"in I||"errors"in I)&&((n=e.next)===null||n===void 0||n.call(e,I))}catch(ee){Yi(ee,e)}}_=p.indexOf(l)}return[3,1];case 3:return(i=e.complete)===null||i===void 0||i.call(e),[2]}})})}function
|
|
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
|
+
`),O=qf(b.slice(0,S)),k=O["content-type"],k&&k.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");N=b.slice(S);try{I=Au(r,N.replace(`\r
|
|
29
|
+
`,"")),(Object.keys(I).length>1||"data"in I||"incremental"in I||"errors"in I)&&((n=e.next)===null||n===void 0||n.call(e,I))}catch(ee){Yi(ee,e)}}_=p.indexOf(l)}return[3,1];case 3:return(i=e.complete)===null||i===void 0||i.call(e),[2]}})})}function qf(r){var e={};return r.split(`
|
|
30
|
+
`).forEach(function(t){var n=t.indexOf(":");if(n>-1){var i=t.slice(0,n).trim().toLowerCase(),a=t.slice(n+1).trim();e[i]=a}}),e}function Au(r,e){if(r.status>=300){var t=function(){try{return JSON.parse(e)}catch{return e}};Hn(r,t(),"Response not successful: Received status code ".concat(r.status))}try{return JSON.parse(e)}catch(i){var n=i;throw n.name="ServerParseError",n.response=r,n.statusCode=r.status,n.bodyText=e,n}}function Yi(r,e){var t,n;r.name!=="AbortError"&&(r.result&&r.result.errors&&r.result.data&&((t=e.next)===null||t===void 0||t.call(e,r.result)),(n=e.error)===null||n===void 0||n.call(e,r))}function Iu(r,e,t){Bf(e)(r).then(function(n){var i,a;(i=t.next)===null||i===void 0||i.call(t,n),(a=t.complete)===null||a===void 0||a.call(t)}).catch(function(n){return Yi(n,t)})}function Bf(r){return function(e){return e.text().then(function(t){return Au(e,t)}).then(function(t){return e.status>=300&&Hn(e,t,"Response not successful: Received status code ".concat(e.status)),!Array.isArray(t)&&!Ou.call(t,"data")&&!Ou.call(t,"errors")&&Hn(e,t,"Server response was missing for query '".concat(Array.isArray(r)?r.map(function(n){return n.operationName}):r.operationName,"'.")),t})}}var Yn=function(r,e){var t;try{t=JSON.stringify(r)}catch(i){var n=__DEV__?new U("Network request failed. ".concat(e," is not serializable: ").concat(i.message)):new U(24);throw n.parseError=i,n}return t};var Vf={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},Qf={accept:"*/*","content-type":"application/json"},Wf={method:"POST"},ku={http:Vf,headers:Qf,options:Wf},Du=function(r,e){return e(r)};function Nu(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var i={},a={};t.forEach(function(f){i=m(m(m({},i),f.options),{headers:m(m({},i.headers),f.headers)}),f.credentials&&(i.credentials=f.credentials),a=m(m({},a),f.http)}),i.headers&&(i.headers=Gf(i.headers,a.preserveHeaderCase));var o=r.operationName,s=r.extensions,u=r.variables,l=r.query,p={operationName:o,variables:u};return a.includeExtensions&&(p.extensions=s),a.includeQuery&&(p.query=e(l,Xr)),{options:i,body:p}}function Gf(r,e){if(!e){var t=Object.create(null);return Object.keys(Object(r)).forEach(function(a){t[a.toLowerCase()]=r[a]}),t}var n=Object.create(null);Object.keys(Object(r)).forEach(function(a){n[a.toLowerCase()]={originalName:a,value:r[a]}});var i=Object.create(null);return Object.keys(n).forEach(function(a){i[n[a].originalName]=n[a].value}),i}var Pu=function(r){if(!r&&typeof fetch>"u")throw __DEV__?new U(`
|
|
31
31
|
"fetch" has not been found globally and no fetcher has been configured. To fix this, install a fetch package (like https://www.npmjs.com/package/cross-fetch), instantiate the fetcher, and pass it into your HttpLink constructor. For example:
|
|
32
32
|
|
|
33
33
|
import fetch from 'cross-fetch';
|
|
@@ -35,7 +35,7 @@ import { ApolloClient, HttpLink } from '@apollo/client';
|
|
|
35
35
|
const client = new ApolloClient({
|
|
36
36
|
link: new HttpLink({ uri: '/graphql', fetch })
|
|
37
37
|
});
|
|
38
|
-
`):new U(23)};var Pu=function(){if(typeof AbortController>"u")return{controller:!1,signal:!1};var r=new AbortController,e=r.signal;return{controller:r,signal:e}};var Ru=function(r,e){var t=r.getContext(),n=t.uri;return n||(typeof e=="function"?e(r):e||"/graphql")};function Lu(r,e){var t=[],n=function(f,h){t.push("".concat(f,"=").concat(encodeURIComponent(h)))};if("query"in e&&n("query",e.query),e.operationName&&n("operationName",e.operationName),e.variables){var i=void 0;try{i=Yn(e.variables,"Variables map")}catch(f){return{parseError:f}}n("variables",i)}if(e.extensions){var a=void 0;try{a=Yn(e.extensions,"Extensions map")}catch(f){return{parseError:f}}n("extensions",a)}var o="",s=r,u=r.indexOf("#");u!==-1&&(o=r.substr(u),s=r.substr(0,u));var l=s.indexOf("?")===-1?"?":"&",p=s+l+t.join("&")+o;return{newURI:p}}var Fu=Ie(function(){return fetch}),$u=function(r){r===void 0&&(r={});var e=r.uri,t=e===void 0?"/graphql":e,n=r.fetch,i=r.print,a=i===void 0?ku:i,o=r.includeExtensions,s=r.preserveHeaderCase,u=r.useGETForQueries,l=r.includeUnusedVariables,p=l===void 0?!1:l,f=St(r,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);__DEV__&&Nu(n||Fu);var h={http:{includeExtensions:o,preserveHeaderCase:s},options:f.fetchOptions,credentials:f.credentials,headers:f.headers};return new st(function(d){var y=Ru(d,t),g=d.getContext(),C={};if(g.clientAwareness){var _=g.clientAwareness,b=_.name,S=_.version;b&&(C["apollographql-client-name"]=b),S&&(C["apollographql-client-version"]=S)}var O=m(m({},C),g.headers),k={http:g.http,options:g.fetchOptions,credentials:g.credentials,headers:O},N=Du(d,a,Iu,h,k),I=N.options,R=N.body;if(R.variables&&!p){var re=new Set(Object.keys(R.variables));Me(d.query,{Variable:function(K,bt,V){V&&V.kind!=="VariableDefinition"&&re.delete(K.name.value)}}),re.size&&(R.variables=m({},R.variables),re.forEach(function(K){delete R.variables[K]}))}var ee;if(!I.signal){var vt=Pu(),It=vt.controller,ke=vt.signal;ee=It,ee&&(I.signal=ke)}var B=function(K){return K.kind==="OperationDefinition"&&K.operation==="mutation"};if(u&&!d.query.definitions.some(B)&&(I.method="GET"),Zr(["defer"],d.query)&&(I.headers=I.headers||{},I.headers.accept="multipart/mixed; deferSpec=20220824, application/json"),I.method==="GET"){var me=Lu(y,R),oe=me.newURI,G=me.parseError;if(G)return zi(G);y=oe}else try{I.body=Yn(R,"Payload")}catch(K){return zi(K)}return new Q(function(K){var bt=n||Ie(function(){return fetch})||Fu;return bt(y,I).then(function(V){var Ct;d.setContext({response:V});var Ut=(Ct=V.headers)===null||Ct===void 0?void 0:Ct.get("content-type");return Ut!==null&&/^multipart\/mixed/i.test(Ut)?Ou(V,K):Au(V,d,K)}).catch(function(V){return Yi(V,K)}),function(){ee&&ee.abort()}})})};var ns=function(r){ge(e,r);function e(t){t===void 0&&(t={});var n=r.call(this,$u(t).request)||this;return n.options=t,n}return e}(st);var{toString:Mu,hasOwnProperty:Gf}=Object.prototype,ju=Function.prototype.toString,is=new Map;function ue(r,e){try{return as(r,e)}finally{is.clear()}}function as(r,e){if(r===e)return!0;let t=Mu.call(r),n=Mu.call(e);if(t!==n)return!1;switch(t){case"[object Array]":if(r.length!==e.length)return!1;case"[object Object]":{if(qu(r,e))return!0;let i=Uu(r),a=Uu(e),o=i.length;if(o!==a.length)return!1;for(let s=0;s<o;++s)if(!Gf.call(e,i[s]))return!1;for(let s=0;s<o;++s){let u=i[s];if(!as(r[u],e[u]))return!1}return!0}case"[object Error]":return r.name===e.name&&r.message===e.message;case"[object Number]":if(r!==r)return e!==e;case"[object Boolean]":case"[object Date]":return+r==+e;case"[object RegExp]":case"[object String]":return r==`${e}`;case"[object Map]":case"[object Set]":{if(r.size!==e.size)return!1;if(qu(r,e))return!0;let i=r.entries(),a=t==="[object Map]";for(;;){let o=i.next();if(o.done)break;let[s,u]=o.value;if(!e.has(s)||a&&!as(u,e.get(s)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":r=new Uint8Array(r),e=new Uint8Array(e);case"[object DataView]":{let i=r.byteLength;if(i===e.byteLength)for(;i--&&r[i]===e[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{let i=ju.call(r);return i!==ju.call(e)?!1:!Hf(i,zf)}}return!1}function Uu(r){return Object.keys(r).filter(Kf,r)}function Kf(r){return this[r]!==void 0}var zf="{ [native code] }";function Hf(r,e){let t=r.length-e.length;return t>=0&&r.indexOf(e,t)===t}function qu(r,e){let t=is.get(r);if(t){if(t.has(e))return!0}else is.set(r,t=new Set);return t.add(e),!1}var Jf=function(){return Object.create(null)},Bu=Array.prototype,Yf=Bu.forEach,Xf=Bu.slice,Et=function(){function r(e,t){e===void 0&&(e=!0),t===void 0&&(t=Jf),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 Yf.call(e,function(n){return t=t.getChildTrie(n)}),t.data||(t.data=this.makeData(Xf.call(e)))},r.prototype.getChildTrie=function(e){var t=this.weakness&&Zf(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 Zf(r){switch(typeof r){case"object":if(r===null)break;case"function":return!0}return!1}var Re=null,Vu={},ed=1,td=()=>class{constructor(){this.id=["slot",ed++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=Re;e;e=e.parent)if(this.id in e.slots){let t=e.slots[this.id];if(t===Vu)break;return e!==Re&&(Re.slots[this.id]=t),!0}return Re&&(Re.slots[this.id]=Vu),!1}getValue(){if(this.hasValue())return Re.slots[this.id]}withValue(e,t,n,i){let a={__proto__:null,[this.id]:e},o=Re;Re={parent:o,slots:a};try{return t.apply(i,n)}finally{Re=o}}static bind(e){let t=Re;return function(){let n=Re;try{return Re=t,e.apply(this,arguments)}finally{Re=n}}}static noContext(e,t,n){if(Re){let i=Re;try{return Re=null,e.apply(n,t)}finally{Re=i}}else return e.apply(n,t)}};function Qu(r){try{return r()}catch{}}var os="@wry/context:Slot",rd=Qu(()=>globalThis)||Qu(()=>global)||Object.create(null),Wu=rd,cn=Wu[os]||Array[os]||function(r){try{Object.defineProperty(Wu,os,{value:r,enumerable:!1,writable:!1,configurable:!0})}finally{return r}}(td());var{bind:nd,noContext:ad}=cn;function od(){}var sd=function(){function r(e,t){e===void 0&&(e=1/0),t===void 0&&(t=od),this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}return r.prototype.has=function(e){return this.map.has(e)},r.prototype.get=function(e){var t=this.getNode(e);return t&&t.value},r.prototype.getNode=function(e){var t=this.map.get(e);if(t&&t!==this.newest){var n=t.older,i=t.newer;i&&(i.older=n),n&&(n.newer=i),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=i)}return t},r.prototype.set=function(e,t){var n=this.getNode(e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)},r.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},r.prototype.delete=function(e){var t=this.map.get(e);return t?(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0):!1},r}(),Zi=new cn,ss,cd=Object.prototype.hasOwnProperty,us=(ss=Array.from,ss===void 0?function(r){var e=[];return r.forEach(function(t){return e.push(t)}),e}:ss);function Xi(r){var e=r.unsubscribe;typeof e=="function"&&(r.unsubscribe=void 0,e())}var Xn=[],ud=100;function un(r,e){if(!r)throw new Error(e||"assertion failure")}function ld(r,e){var t=r.length;return t>0&&t===e.length&&r[t-1]===e[t-1]}function Ku(r){switch(r.length){case 0:throw new Error("unknown value");case 1:return r[0];case 2:throw r[1]}}function pd(r){return r.slice(0)}var fd=function(){function r(e){this.fn=e,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++r.count}return r.prototype.peek=function(){if(this.value.length===1&&!Yt(this))return Gu(this),this.value[0]},r.prototype.recompute=function(e){return un(!this.recomputing,"already recomputing"),Gu(this),Yt(this)?dd(this,e):Ku(this.value)},r.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,zu(this),Xi(this))},r.prototype.dispose=function(){var e=this;this.setDirty(),Zu(this),ls(this,function(t,n){t.setDirty(),el(t,e)})},r.prototype.forget=function(){this.dispose()},r.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=Xn.pop()||new Set),this.deps.add(e)},r.prototype.forgetDeps=function(){var e=this;this.deps&&(us(this.deps).forEach(function(t){return t.delete(e)}),this.deps.clear(),Xn.push(this.deps),this.deps=null)},r.count=0,r}();function Gu(r){var e=Zi.getValue();if(e)return r.parents.add(e),e.childValues.has(r)||e.childValues.set(r,[]),Yt(r)?Ju(e,r):Yu(e,r),e}function dd(r,e){return Zu(r),Zi.withValue(r,hd,[r,e]),yd(r,e)&&md(r),Ku(r.value)}function hd(r,e){r.recomputing=!0,r.value.length=0;try{r.value[0]=r.fn.apply(null,e)}catch(t){r.value[1]=t}r.recomputing=!1}function Yt(r){return r.dirty||!!(r.dirtyChildren&&r.dirtyChildren.size)}function md(r){r.dirty=!1,!Yt(r)&&Hu(r)}function zu(r){ls(r,Ju)}function Hu(r){ls(r,Yu)}function ls(r,e){var t=r.parents.size;if(t)for(var n=us(r.parents),i=0;i<t;++i)e(n[i],r)}function Ju(r,e){un(r.childValues.has(e)),un(Yt(e));var t=!Yt(r);if(!r.dirtyChildren)r.dirtyChildren=Xn.pop()||new Set;else if(r.dirtyChildren.has(e))return;r.dirtyChildren.add(e),t&&zu(r)}function Yu(r,e){un(r.childValues.has(e)),un(!Yt(e));var t=r.childValues.get(e);t.length===0?r.childValues.set(e,pd(e.value)):ld(t,e.value)||r.setDirty(),Xu(r,e),!Yt(r)&&Hu(r)}function Xu(r,e){var t=r.dirtyChildren;t&&(t.delete(e),t.size===0&&(Xn.length<ud&&Xn.push(t),r.dirtyChildren=null))}function Zu(r){r.childValues.size>0&&r.childValues.forEach(function(e,t){el(r,t)}),r.forgetDeps(),un(r.dirtyChildren===null)}function el(r,e){e.parents.delete(r),r.childValues.delete(e),Xu(r,e)}function yd(r,e){if(typeof r.subscribe=="function")try{Xi(r),r.unsubscribe=r.subscribe.apply(null,e)}catch{return r.setDirty(),!1}return!0}var gd={setDirty:!0,dispose:!0,forget:!0};function ea(r){var e=new Map,t=r&&r.subscribe;function n(i){var a=Zi.getValue();if(a){var o=e.get(i);o||e.set(i,o=new Set),a.dependOn(o),typeof t=="function"&&(Xi(o),o.unsubscribe=t(i))}}return n.dirty=function(a,o){var s=e.get(a);if(s){var u=o&&cd.call(gd,o)?o:"setDirty";us(s).forEach(function(l){return l[u]()}),e.delete(a),Xi(s)}},n}function tl(){var r=new Et(typeof WeakMap=="function");return function(){return r.lookupArray(arguments)}}var E4=tl(),cs=new Set;function Or(r,e){e===void 0&&(e=Object.create(null));var t=new sd(e.max||Math.pow(2,16),function(l){return l.dispose()}),n=e.keyArgs,i=e.makeCacheKey||tl(),a=function(){var l=i.apply(null,n?n.apply(null,arguments):arguments);if(l===void 0)return r.apply(null,arguments);var p=t.get(l);p||(t.set(l,p=new fd(r)),p.subscribe=e.subscribe,p.forget=function(){return t.delete(l)});var f=p.recompute(Array.prototype.slice.call(arguments));return t.set(l,p),cs.add(t),Zi.hasValue()||(cs.forEach(function(h){return h.clean()}),cs.clear()),f};Object.defineProperty(a,"size",{get:function(){return t.map.size},configurable:!1,enumerable:!1});function o(l){var p=t.get(l);p&&p.setDirty()}a.dirtyKey=o,a.dirty=function(){o(i.apply(null,arguments))};function s(l){var p=t.get(l);if(p)return p.peek()}a.peekKey=s,a.peek=function(){return s(i.apply(null,arguments))};function u(l){return t.delete(l)}return a.forgetKey=u,a.forget=function(){return u(i.apply(null,arguments))},a.makeCacheKey=i,a.getKey=n?function(){return i.apply(null,n.apply(null,arguments))}:i,Object.freeze(a)}var ps=function(){function r(){this.getFragmentDoc=Or(Do)}return r.prototype.batch=function(e){var t=this,n=typeof e.optimistic=="string"?e.optimistic:e.optimistic===!1?null:void 0,i;return this.performTransaction(function(){return i=e.update(t)},n),i},r.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},r.prototype.transformDocument=function(e){return e},r.prototype.transformForLink=function(e){return e},r.prototype.identify=function(e){},r.prototype.gc=function(){return[]},r.prototype.modify=function(e){return!1},r.prototype.readQuery=function(e,t){return t===void 0&&(t=!!e.optimistic),this.read(m(m({},e),{rootId:e.id||"ROOT_QUERY",optimistic:t}))},r.prototype.readFragment=function(e,t){return t===void 0&&(t=!!e.optimistic),this.read(m(m({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:t}))},r.prototype.writeQuery=function(e){var t=e.id,n=e.data,i=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(m(m({},e),{data:a})),a)}})},r.prototype.updateFragment=function(e,t){return this.batch({update:function(n){var i=n.readFragment(e),a=t(i);return a==null?i:(n.writeFragment(m(m({},e),{data:a})),a)}})},r}();var Zn=function(r){ge(e,r);function e(t,n,i,a){var o,s=r.call(this,t)||this;if(s.message=t,s.path=n,s.query=i,s.variables=a,Array.isArray(s.path)){s.missing=s.message;for(var u=s.path.length-1;u>=0;--u)s.missing=(o={},o[s.path[u]]=s.missing,o)}else s.missing=s.path;return s.__proto__=e.prototype,s}return e}(Error);var ve=Object.prototype.hasOwnProperty;function ei(r){return r==null}function ra(r,e){var t=r.__typename,n=r.id,i=r._id;if(typeof t=="string"&&(e&&(e.keyObject=ei(n)?ei(i)?void 0:{_id:i}:{id:n}),ei(n)&&!ei(i)&&(n=i),!ei(n)))return"".concat(t,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var rl={dataIdFromObject:ra,addTypename:!0,resultCaching:!0,canonizeResults:!1};function nl(r){return Jt(rl,r)}function na(r){var e=r.canonizeResults;return e===void 0?rl.canonizeResults:e}function il(r,e){return W(e)?r.get(e.__ref,"__typename"):e&&e.__typename}var fs=/^[_a-z][_0-9a-z]*/i;function ht(r){var e=r.match(fs);return e?e[0]:r}function ta(r,e,t){return z(e)?ne(e)?e.every(function(n){return ta(r,n,t)}):r.selections.every(function(n){if(et(n)&&Dt(n,t)){var i=at(n);return ve.call(e,i)&&(!n.selectionSet||ta(n.selectionSet,e[i],t))}return!0}):!1}function Xt(r){return z(r)&&!W(r)&&!ne(r)}function al(){return new ze}function ia(r,e){var t=br(Sr(r));return{fragmentMap:t,lookupFragment:function(n){var i=t[n];return!i&&e&&(i=e.lookup(n)),i||null}}}var aa=Object.create(null),ds=function(){return aa},ol=Object.create(null),ln=function(){function r(e,t){var n=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(i,a){return Gn(W(i)?n.get(i.__ref,a):i&&i[a])},this.canRead=function(i){return W(i)?n.has(i.__ref):typeof i=="object"},this.toReference=function(i,a){if(typeof i=="string")return 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 m({},this.data)},r.prototype.has=function(e){return this.lookup(e,!0)!==void 0},r.prototype.get=function(e,t){if(this.group.depend(e,t),ve.call(this.data,e)){var n=this.data[e];if(n&&ve.call(n,t))return n[t]}if(t==="__typename"&&ve.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof Zt)return this.parent.get(e,t)},r.prototype.lookup=function(e,t){if(t&&this.group.depend(e,"__exists"),ve.call(this.data,e))return this.data[e];if(this instanceof Zt)return this.parent.lookup(e,t);if(this.policies.rootTypenamesById[e])return Object.create(null)},r.prototype.merge=function(e,t){var n=this,i;W(e)&&(e=e.__ref),W(t)&&(t=t.__ref);var a=typeof e=="string"?this.lookup(i=e):e,o=typeof t=="string"?this.lookup(i=t):t;if(!!o){__DEV__?T(typeof i=="string","store.merge expects a string ID"):T(typeof i=="string",1);var s=new ze(bd).merge(a,o);if(this.data[i]=s,s!==a&&(delete this.refs[i],this.group.caching)){var u=Object.create(null);a||(u.__exists=1),Object.keys(o).forEach(function(l){if(!a||a[l]!==s[l]){u[l]=1;var p=ht(l);p!==l&&!n.policies.hasKeyArgs(s.__typename,p)&&(u[p]=1),s[l]===void 0&&!(n instanceof Zt)&&delete s[l]}}),u.__typename&&!(a&&a.__typename)&&this.policies.rootTypenamesById[i]===s.__typename&&delete u.__typename,Object.keys(u).forEach(function(l){return n.group.dirty(i,l)})}}},r.prototype.modify=function(e,t){var n=this,i=this.lookup(e);if(i){var a=Object.create(null),o=!1,s=!0,u={DELETE:aa,INVALIDATE:ol,isReference:W,toReference:this.toReference,canRead:this.canRead,readField:function(l,p){return n.policies.readField(typeof l=="string"?{fieldName:l,from:p||wt(e)}:l,{store:n})}};if(Object.keys(i).forEach(function(l){var p=ht(l),f=i[l];if(f!==void 0){var h=typeof t=="function"?t:t[l]||t[p];if(h){var d=h===ds?aa:h(Gn(f),m(m({},u),{fieldName:p,storeFieldName:l,storage:n.getStorage(e,l)}));d===ol?n.group.dirty(e,l):(d===aa&&(d=void 0),d!==f&&(a[l]=d,o=!0,f=d))}f!==void 0&&(s=!1)}}),o)return this.merge(e,a),s&&(this instanceof Zt?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},r.prototype.delete=function(e,t,n){var i,a=this.lookup(e);if(a){var o=this.getFieldValue(a,"__typename"),s=t&&n?this.policies.getStoreFieldName({typename:o,fieldName:t,args:n}):t;return this.modify(e,s?(i={},i[s]=ds,i):ds)}return!1},r.prototype.evict=function(e,t){var n=!1;return e.id&&(ve.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof Zt&&this!==t&&(n=this.parent.evict(e,t)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n},r.prototype.clear=function(){this.replace(null)},r.prototype.extract=function(){var e=this,t=this.toObject(),n=[];return this.getRootIdSet().forEach(function(i){ve.call(e.policies.rootTypenamesById,i)||n.push(i)}),n.length&&(t.__META={extraRootIds:n.sort()}),t},r.prototype.replace=function(e){var t=this;if(Object.keys(this.data).forEach(function(a){e&&ve.call(e,a)||t.delete(a)}),e){var n=e.__META,i=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 Zt?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},r.prototype.gc=function(){var e=this,t=this.getRootIdSet(),n=this.toObject();t.forEach(function(o){ve.call(n,o)&&(Object.keys(e.findChildRefIds(o)).forEach(t.add,t),delete n[o])});var i=Object.keys(n);if(i.length){for(var a=this;a instanceof Zt;)a=a.parent;i.forEach(function(o){return a.delete(o)})}return i},r.prototype.findChildRefIds=function(e){if(!ve.call(this.refs,e)){var t=this.refs[e]=Object.create(null),n=this.data[e];if(!n)return t;var i=new Set([n]);i.forEach(function(a){W(a)&&(t[a.__ref]=!0),z(a)&&Object.keys(a).forEach(function(o){var s=a[o];z(s)&&i.add(s)})})}return this.refs[e]},r.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},r}();var sl=function(){function r(e,t){t===void 0&&(t=null),this.caching=e,this.parent=t,this.d=null,this.resetCaching()}return r.prototype.resetCaching=function(){this.d=this.caching?ea():null,this.keyMaker=new Et(ot)},r.prototype.depend=function(e,t){if(this.d){this.d(hs(e,t));var n=ht(t);n!==t&&this.d(hs(e,n)),this.parent&&this.parent.depend(e,t)}},r.prototype.dirty=function(e,t){this.d&&this.d.dirty(hs(e,t),t==="__exists"?"forget":"setDirty")},r}();function hs(r,e){return e+"#"+r}function ms(r,e){Tr(r)&&r.group.depend(e,"__exists")}(function(r){var e=function(t){ge(n,t);function n(i){var a=i.policies,o=i.resultCaching,s=o===void 0?!0:o,u=i.seed,l=t.call(this,a,new sl(s))||this;return l.stump=new vd(l),l.storageTrie=new Et(ot),u&&l.replace(u),l}return n.prototype.addLayer=function(i,a){return this.stump.addLayer(i,a)},n.prototype.removeLayer=function(){return this},n.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},n}(r);r.Root=e})(ln||(ln={}));var Zt=function(r){ge(e,r);function e(t,n,i,a){var o=r.call(this,n.policies,a)||this;return o.id=t,o.parent=n,o.replay=i,o.group=a,i(o),o}return e.prototype.addLayer=function(t,n){return new e(t,this,n,this.group)},e.prototype.removeLayer=function(t){var n=this,i=this.parent.removeLayer(t);return t===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(a){var o=n.data[a],s=i.lookup(a);s?o?o!==s&&Object.keys(o).forEach(function(u){ue(o[u],s[u])||n.group.dirty(a,u)}):(n.group.dirty(a,"__exists"),Object.keys(s).forEach(function(u){n.group.dirty(a,u)})):n.delete(a)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return m(m({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(t){var n=this.parent.findChildRefIds(t);return ve.call(this.data,t)?m(m({},n),r.prototype.findChildRefIds.call(this,t)):n},e.prototype.getStorage=function(){for(var t=this.parent;t.parent;)t=t.parent;return t.getStorage.apply(t,arguments)},e}(ln),vd=function(r){ge(e,r);function e(t){return r.call(this,"EntityStore.Stump",t,function(){},new sl(t.group.caching,t.group))||this}return e.prototype.removeLayer=function(){return this},e.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},e}(Zt);function bd(r,e,t){var n=r[t],i=e[t];return ue(n,i)?n:i}function Tr(r){return!!(r instanceof ln&&r.group.caching)}function Cd(r){return z(r)?ne(r)?r.slice(0):m({__proto__:Object.getPrototypeOf(r)},r):r}var oa=function(){function r(){this.known=new(pu?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 z(e)&&this.known.has(e)},r.prototype.pass=function(e){if(z(e)){var t=Cd(e);return this.passes.set(t,e),t}return e},r.prototype.admit=function(e){var t=this;if(z(e)){var n=this.passes.get(e);if(n)return n;var i=Object.getPrototypeOf(e);switch(i){case Array.prototype:{if(this.known.has(e))return e;var a=e.map(this.admit,this),o=this.pool.lookupArray(a);return o.array||(this.known.add(o.array=a),__DEV__&&Object.freeze(a)),o.array}case null:case Object.prototype:{if(this.known.has(e))return e;var s=Object.getPrototypeOf(e),u=[s],l=this.sortedKeys(e);u.push(l.json);var p=u.length;l.sorted.forEach(function(d){u.push(t.admit(e[d]))});var o=this.pool.lookupArray(u);if(!o.object){var f=o.object=Object.create(s);this.known.add(f),l.sorted.forEach(function(d,y){f[d]=u[p+y]}),__DEV__&&Object.freeze(f)}return o.object}}}return e},r.prototype.sortedKeys=function(e){var t=Object.keys(e),n=this.pool.lookupArray(t);if(!n.keys){t.sort();var i=JSON.stringify(t);(n.keys=this.keysByJSON.get(i))||this.keysByJSON.set(i,n.keys={sorted:t,json:i})}return n.keys},r}();var tt=Object.assign(function(r){if(z(r)){ys===void 0&&cl();var e=ys.admit(r),t=gs.get(e);return t===void 0&&gs.set(e,t=JSON.stringify(e)),t}return JSON.stringify(r)},{reset:cl}),ys,gs;function cl(){ys=new oa,gs=new(ot?WeakMap:Map)}function ul(r){return[r.selectionSet,r.objectOrReference,r.context,r.context.canonizeResults]}var ll=function(){function r(e){var t=this;this.knownResults=new(ot?WeakMap:Map),this.config=Jt(e,{addTypename:e.addTypename!==!1,canonizeResults:na(e)}),this.canon=e.canon||new oa,this.executeSelectionSet=Or(function(n){var i,a=n.context.canonizeResults,o=ul(n);o[3]=!a;var s=(i=t.executeSelectionSet).peek.apply(i,o);return s?a?m(m({},s),{result:t.canon.admit(s.result)}):s:(ms(n.context.store,n.enclosingRef.__ref),t.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize,keyArgs:ul,makeCacheKey:function(n,i,a,o){if(Tr(a.store))return a.store.makeCacheKey(n,W(i)?i.__ref:i,a.varString,o)}}),this.executeSubSelectedArray=Or(function(n){return ms(n.context.store,n.enclosingRef.__ref),t.execSubSelectedArrayImpl(n)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(n){var i=n.field,a=n.array,o=n.context;if(Tr(o.store))return o.store.makeCacheKey(i,a,o.varString)}})}return r.prototype.resetCanon=function(){this.canon=new oa},r.prototype.diffQueryAgainstStore=function(e){var t=e.store,n=e.query,i=e.rootId,a=i===void 0?"ROOT_QUERY":i,o=e.variables,s=e.returnPartialData,u=s===void 0?!0:s,l=e.canonizeResults,p=l===void 0?this.config.canonizeResults:l,f=this.config.cache.policies;o=m(m({},_r(Vn(n))),o);var h=wt(a),d=this.executeSelectionSet({selectionSet:wr(n).selectionSet,objectOrReference:h,enclosingRef:h,context:m({store:t,query:n,policies:f,variables:o,varString:tt(o),canonizeResults:p},ia(n,this.config.fragments))}),y;if(d.missing&&(y=[new Zn(Sd(d.missing),d.missing,n,o)],!u))throw y[0];return{result:d.result,complete:!y,missing:y}},r.prototype.isFresh=function(e,t,n,i){if(Tr(i.store)&&this.knownResults.get(e)===n){var a=this.executeSelectionSet.peek(n,t,i,this.canon.isKnown(e));if(a&&e===a.result)return!0}return!1},r.prototype.execSelectionSetImpl=function(e){var t=this,n=e.selectionSet,i=e.objectOrReference,a=e.enclosingRef,o=e.context;if(W(i)&&!o.policies.rootTypenamesById[i.__ref]&&!o.store.has(i.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(i.__ref," object")};var s=o.variables,u=o.policies,l=o.store,p=l.getFieldValue(i,"__typename"),f=[],h,d=new ze;this.config.addTypename&&typeof p=="string"&&!u.rootIdsByTypename[p]&&f.push({__typename:p});function y(S,O){var k;return S.missing&&(h=d.merge(h,(k={},k[O]=S.missing,k))),S.result}var g=new Set(n.selections);g.forEach(function(S){var O,k;if(!!Dt(S,s))if(et(S)){var N=u.readField({fieldName:S.name.value,field:S,variables:o.variables,from:i},o),I=at(S);N===void 0?Er.added(S)||(h=d.merge(h,(O={},O[I]="Can't find field '".concat(S.name.value,"' on ").concat(W(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),O))):ne(N)?N=y(t.executeSubSelectedArray({field:S,array:N,enclosingRef:a,context:o}),I):S.selectionSet?N!=null&&(N=y(t.executeSelectionSet({selectionSet:S.selectionSet,objectOrReference:N,enclosingRef:W(N)?N:a,context:o}),I)):o.canonizeResults&&(N=t.canon.pass(N)),N!==void 0&&f.push((k={},k[I]=N,k))}else{var R=Cr(S,o.lookupFragment);if(!R&&S.kind===we.FRAGMENT_SPREAD)throw __DEV__?new U("No fragment named ".concat(S.name.value)):new U(5);R&&u.fragmentMatches(R,p)&&R.selectionSet.selections.forEach(g.add,g)}});var C=Qn(f),_={result:C,missing:h},b=o.canonizeResults?this.canon.admit(_):Gn(_);return b.result&&this.knownResults.set(b.result,n),b},r.prototype.execSubSelectedArrayImpl=function(e){var t=this,n=e.field,i=e.array,a=e.enclosingRef,o=e.context,s,u=new ze;function l(p,f){var h;return p.missing&&(s=u.merge(s,(h={},h[f]=p.missing,h))),p.result}return n.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(p,f){return p===null?null:ne(p)?l(t.executeSubSelectedArray({field:n,array:p,enclosingRef:a,context:o}),f):n.selectionSet?l(t.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:p,enclosingRef:W(p)?p:a,context:o}),f):(__DEV__&&wd(o.store,n,p),p)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:s}},r}();function Sd(r){try{JSON.stringify(r,function(e,t){if(typeof t=="string")throw t;return t})}catch(e){return e}}function wd(r,e,t){if(!e.selectionSet){var n=new Set([t]);n.forEach(function(i){z(i)&&(__DEV__?T(!W(i),"Missing selection set for object of type ".concat(il(r,i)," returned for query field ").concat(e.name.value)):T(!W(i),6),Object.values(i).forEach(n.add,n))})}}var pn=new cn,pl=new WeakMap;function ti(r){var e=pl.get(r);return e||pl.set(r,e={vars:new Set,dep:ea()}),e}function vs(r){ti(r).vars.forEach(function(e){return e.forgetCache(r)})}function fl(r){ti(r).vars.forEach(function(e){return e.attachCache(r)})}function sa(r){var e=new Set,t=new Set,n=function(a){if(arguments.length>0){if(r!==a){r=a,e.forEach(function(u){ti(u).dep.dirty(n),_d(u)});var o=Array.from(t);t.clear(),o.forEach(function(u){return u(r)})}}else{var s=pn.getValue();s&&(i(s),ti(s).dep(n))}return r};n.onNextChange=function(a){return t.add(a),function(){t.delete(a)}};var i=n.attachCache=function(a){return e.add(a),ti(a).vars.add(n),n};return n.forgetCache=function(a){return e.delete(a)},n}function _d(r){r.broadcastWatches&&r.broadcastWatches()}var dl=Object.create(null);function bs(r){var e=JSON.stringify(r);return dl[e]||(dl[e]=Object.create(null))}function Cs(r){var e=bs(r);return e.keyFieldsFn||(e.keyFieldsFn=function(t,n){var i=function(o,s){return n.readField(s,o)},a=n.keyObject=ws(r,function(o){var s=fn(n.storeObject,o,i);return s===void 0&&t!==n.storeObject&&ve.call(t,o[0])&&(s=fn(t,o,ml)),__DEV__?T(s!==void 0,"Missing field '".concat(o.join("."),"' while extracting keyFields from ").concat(JSON.stringify(t))):T(s!==void 0,2),s});return"".concat(n.typename,":").concat(JSON.stringify(a))})}function Ss(r){var e=bs(r);return e.keyArgsFn||(e.keyArgsFn=function(t,n){var i=n.field,a=n.variables,o=n.fieldName,s=ws(r,function(l){var p=l[0],f=p.charAt(0);if(f==="@"){if(i&&Oe(i.directives)){var h=p.slice(1),d=i.directives.find(function(_){return _.name.value===h}),y=d&&Nt(d,a);return y&&fn(y,l.slice(1))}return}if(f==="$"){var g=p.slice(1);if(a&&ve.call(a,g)){var C=l.slice(0);return C[0]=g,fn(a,C)}return}if(t)return fn(t,l)}),u=JSON.stringify(s);return(t||u!=="{}")&&(o+=":"+u),o})}function ws(r,e){var t=new ze;return hl(r).reduce(function(n,i){var a,o=e(i);if(o!==void 0){for(var s=i.length-1;s>=0;--s)o=(a={},a[i[s]]=o,a);n=t.merge(n,o)}return n},Object.create(null))}function hl(r){var e=bs(r);if(!e.paths){var t=e.paths=[],n=[];r.forEach(function(i,a){ne(i)?(hl(i).forEach(function(o){return t.push(n.concat(o))}),n.length=0):(n.push(i),ne(r[a+1])||(t.push(n.slice(0)),n.length=0))})}return e.paths}function ml(r,e){return r[e]}function fn(r,e,t){return t=t||ml,yl(e.reduce(function n(i,a){return ne(i)?i.map(function(o){return n(o,a)}):i&&t(i,a)},r))}function yl(r){return z(r)?ne(r)?r.map(yl):ws(Object.keys(r).sort(),function(e){return fn(r,e)}):r}qn.setStringify(tt);function _s(r){return r.args!==void 0?r.args:r.field?Nt(r.field,r.variables):null}var Ed=function(){},gl=function(r,e){return e.fieldName},vl=function(r,e,t){var n=t.mergeObjects;return n(r,e)},bl=function(r,e){return e},Sl=function(){function r(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=m({dataIdFromObject:ra},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return r.prototype.identify=function(e,t){var n,i=this,a=t&&(t.typename||((n=t.storeObject)===null||n===void 0?void 0:n.__typename))||e.__typename;if(a===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=t&&t.storeObject||e,s=m(m({},t),{typename:a,storeObject:o,readField:t&&t.readField||function(){var h=ca(arguments,o);return i.readField(h,{store:i.cache.data,variables:h.variables})}}),u,l=a&&this.getTypePolicy(a),p=l&&l.keyFn||this.config.dataIdFromObject;p;){var f=p(e,s);if(ne(f))p=Cs(f);else{u=f;break}}return u=u?String(u):void 0,s.keyObject?[u,s.keyObject]:[u]},r.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach(function(n){var i=e[n],a=i.queryType,o=i.mutationType,s=i.subscriptionType,u=St(i,["queryType","mutationType","subscriptionType"]);a&&t.setRootTypename("Query",n),o&&t.setRootTypename("Mutation",n),s&&t.setRootTypename("Subscription",n),ve.call(t.toBeAdded,n)?t.toBeAdded[n].push(u):t.toBeAdded[n]=[u]})},r.prototype.updateTypePolicy=function(e,t){var n=this,i=this.getTypePolicy(e),a=t.keyFields,o=t.fields;function s(u,l){u.merge=typeof l=="function"?l:l===!0?vl:l===!1?bl:u.merge}s(i,t.merge),i.keyFn=a===!1?Ed:ne(a)?Cs(a):typeof a=="function"?a:i.keyFn,o&&Object.keys(o).forEach(function(u){var l=n.getFieldPolicy(e,u,!0),p=o[u];if(typeof p=="function")l.read=p;else{var f=p.keyArgs,h=p.read,d=p.merge;l.keyFn=f===!1?gl:ne(f)?Ss(f):typeof f=="function"?f:l.keyFn,typeof h=="function"&&(l.read=h),s(l,d)}l.read&&l.merge&&(l.keyFn=l.keyFn||gl)})},r.prototype.setRootTypename=function(e,t){t===void 0&&(t=e);var n="ROOT_"+e.toUpperCase(),i=this.rootTypenamesById[n];t!==i&&(__DEV__?T(!i||i===e,"Cannot change root ".concat(e," __typename more than once")):T(!i||i===e,3),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[t]=n,this.rootTypenamesById[n]=t)},r.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(n){t.getSupertypeSet(n,!0),e[n].forEach(function(i){t.getSupertypeSet(i,!0).add(n);var a=i.match(fs);(!a||a[0]!==i)&&t.fuzzySubtypes.set(i,new RegExp(i))})})},r.prototype.getTypePolicy=function(e){var t=this;if(!ve.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var i=this.supertypeMap.get(e);i&&i.size&&i.forEach(function(o){var s=t.getTypePolicy(o),u=s.fields,l=St(s,["fields"]);Object.assign(n,l),Object.assign(n.fields,u)})}var a=this.toBeAdded[e];return a&&a.length&&a.splice(0).forEach(function(o){t.updateTypePolicy(e,o)}),this.typePolicies[e]},r.prototype.getFieldPolicy=function(e,t,n){if(e){var i=this.getTypePolicy(e).fields;return i[t]||n&&(i[t]=Object.create(null))}},r.prototype.getSupertypeSet=function(e,t){var n=this.supertypeMap.get(e);return!n&&t&&this.supertypeMap.set(e,n=new Set),n},r.prototype.fragmentMatches=function(e,t,n,i){var a=this;if(!e.typeCondition)return!0;if(!t)return!1;var o=e.typeCondition.name.value;if(t===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(t,!0),u=[s],l=function(y){var g=a.getSupertypeSet(y,!1);g&&g.size&&u.indexOf(g)<0&&u.push(g)},p=!!(n&&this.fuzzySubtypes.size),f=!1,h=0;h<u.length;++h){var d=u[h];if(d.has(o))return s.has(o)||(f&&__DEV__&&T.warn("Inferring subtype ".concat(t," of supertype ").concat(o)),s.add(o)),!0;d.forEach(l),p&&h===u.length-1&&ta(e.selectionSet,n,i)&&(p=!1,f=!0,this.fuzzySubtypes.forEach(function(y,g){var C=t.match(y);C&&C[0]===t&&l(g)}))}return!1},r.prototype.hasKeyArgs=function(e,t){var n=this.getFieldPolicy(e,t,!1);return!!(n&&n.keyFn)},r.prototype.getStoreFieldName=function(e){var t=e.typename,n=e.fieldName,i=this.getFieldPolicy(t,n,!1),a,o=i&&i.keyFn;if(o&&t)for(var s={typename:t,fieldName:n,field:e.field||null,variables:e.variables},u=_s(e);o;){var l=o(u,s);if(ne(l))o=Ss(l);else{a=l||n;break}}return a===void 0&&(a=e.field?Po(e.field,e.variables):qn(n,_s(e))),a===!1?n:n===ht(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=ht(o),u=t.store.getFieldValue(n,o),l=this.getFieldPolicy(e.typename,s,!1),p=l&&l.read;if(p){var f=Cl(this,n,e,t,t.store.getStorage(W(n)?n.__ref:n,o));return pn.withValue(this.cache,p,[u,f])}return u}}},r.prototype.getReadFunction=function(e,t){var n=this.getFieldPolicy(e,t,!1);return n&&n.read},r.prototype.getMergeFunction=function(e,t,n){var i=this.getFieldPolicy(e,t,!1),a=i&&i.merge;return!a&&n&&(i=this.getTypePolicy(n),a=i&&i.merge),a},r.prototype.runMergeFunction=function(e,t,n,i,a){var o=n.field,s=n.typename,u=n.merge;return u===vl?wl(i.store)(e,t):u===bl?t:(i.overwrite&&(e=void 0),u(e,t,Cl(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:i.variables},i,a||Object.create(null))))},r}();function Cl(r,e,t,n,i){var a=r.getStoreFieldName(t),o=ht(a),s=t.variables||n.variables,u=n.store,l=u.toReference,p=u.canRead;return{args:_s(t),field:t.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:W,toReference:l,storage:i,cache:r.cache,canRead:p,readField:function(){return r.readField(ca(arguments,e,s),n)},mergeObjects:wl(n.store)}}function ca(r,e,t){var n=r[0],i=r[1],a=r.length,o;return typeof n=="string"?o={fieldName:n,from:a>1?i:e}:(o=m({},n),ve.call(o,"from")||(o.from=e)),__DEV__&&o.from===void 0&&__DEV__&&T.warn("Undefined 'from' passed to readField with arguments ".concat(mu(Array.from(r)))),o.variables===void 0&&(o.variables=t),o}function wl(r){return function(t,n){if(ne(t)||ne(n))throw __DEV__?new U("Cannot automatically merge arrays"):new U(4);if(z(t)&&z(n)){var i=r.getFieldValue(t,"__typename"),a=r.getFieldValue(n,"__typename"),o=i&&a&&i!==a;if(o)return n;if(W(t)&&Xt(n))return r.merge(t.__ref,n),t;if(Xt(t)&&W(n))return r.merge(t,n.__ref),n;if(Xt(t)&&Xt(n))return m(m({},t),n)}return n}}function Es(r,e,t){var n="".concat(e).concat(t),i=r.flavors.get(n);return i||r.flavors.set(n,i=r.clientOnly===e&&r.deferred===t?r:m(m({},r),{clientOnly:e,deferred:t})),i}var Ol=function(){function r(e,t,n){this.cache=e,this.reader=t,this.fragments=n}return r.prototype.writeToStore=function(e,t){var n=this,i=t.query,a=t.result,o=t.dataId,s=t.variables,u=t.overwrite,l=_t(i),p=al();s=m(m({},_r(l)),s);var f=m(m({store:e,written:Object.create(null),merge:function(d,y){return p.merge(d,y)},variables:s,varString:tt(s)},ia(i,this.fragments)),{overwrite:!!u,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),h=this.processSelectionSet({result:a||Object.create(null),dataId:o,selectionSet:l.selectionSet,mergeTree:{map:new Map},context:f});if(!W(h))throw __DEV__?new U("Could not identify object ".concat(JSON.stringify(a))):new U(7);return f.incomingById.forEach(function(d,y){var g=d.storeObject,C=d.mergeTree,_=d.fieldNodeSet,b=wt(y);if(C&&C.map.size){var S=n.applyMerges(C,b,g,f);if(W(S))return;g=S}if(__DEV__&&!f.overwrite){var O=Object.create(null);_.forEach(function(I){I.selectionSet&&(O[I.name.value]=!0)});var k=function(I){return O[ht(I)]===!0},N=function(I){var R=C&&C.map.get(I);return Boolean(R&&R.info&&R.info.merge)};Object.keys(g).forEach(function(I){k(I)&&!N(I)&&xd(b,g,I,f.store)})}e.merge(y,g)}),e.retain(h.__ref),h},r.prototype.processSelectionSet=function(e){var t=this,n=e.dataId,i=e.result,a=e.selectionSet,o=e.context,s=e.mergeTree,u=this.cache.policies,l=Object.create(null),p=n&&u.rootTypenamesById[n]||Bn(i,a,o.fragmentMap)||n&&o.store.get(n,"__typename");typeof p=="string"&&(l.__typename=p);var f=function(){var S=ca(arguments,l,o.variables);if(W(S.from)){var O=o.incomingById.get(S.from.__ref);if(O){var k=u.readField(m(m({},S),{from:O.storeObject}),o);if(k!==void 0)return k}}return u.readField(S,o)},h=new Set;this.flattenFields(a,i,o,p).forEach(function(S,O){var k,N=at(O),I=i[N];if(h.add(O),I!==void 0){var R=u.getStoreFieldName({typename:p,fieldName:O.name.value,field:O,variables:S.variables}),re=_l(s,R),ee=t.processFieldValue(I,O,O.selectionSet?Es(S,!1,!1):S,re),vt=void 0;O.selectionSet&&(W(ee)||Xt(ee))&&(vt=f("__typename",ee));var It=u.getMergeFunction(p,O.name.value,vt);It?re.info={field:O,typename:p,merge:It}:El(s,R),l=S.merge(l,(k={},k[R]=ee,k))}else __DEV__&&!S.clientOnly&&!S.deferred&&!Er.added(O)&&!u.getReadFunction(p,O.name.value)&&__DEV__&&T.error("Missing field '".concat(at(O),"' while writing result ").concat(JSON.stringify(i,null,2)).substring(0,1e3))});try{var d=u.identify(i,{typename:p,selectionSet:a,fragmentMap:o.fragmentMap,storeObject:l,readField:f}),y=d[0],g=d[1];n=n||y,g&&(l=o.merge(l,g))}catch(S){if(!n)throw S}if(typeof n=="string"){var C=wt(n),_=o.written[n]||(o.written[n]=[]);if(_.indexOf(a)>=0||(_.push(a),this.reader&&this.reader.isFresh(i,C,a,o)))return C;var b=o.incomingById.get(n);return b?(b.storeObject=o.merge(b.storeObject,l),b.mergeTree=xs(b.mergeTree,s),h.forEach(function(S){return b.fieldNodeSet.add(S)})):o.incomingById.set(n,{storeObject:l,mergeTree:ua(s)?void 0:s,fieldNodeSet:h}),C}return l},r.prototype.processFieldValue=function(e,t,n,i){var a=this;return!t.selectionSet||e===null?__DEV__?Vi(e):e:ne(e)?e.map(function(o,s){var u=a.processFieldValue(o,t,n,_l(i,s));return El(i,s),u}):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:i})},r.prototype.flattenFields=function(e,t,n,i){i===void 0&&(i=Bn(t,e,n.fragmentMap));var a=new Map,o=this.cache.policies,s=new Et(!1);return function u(l,p){var f=s.lookup(l,p.clientOnly,p.deferred);f.visited||(f.visited=!0,l.selections.forEach(function(h){if(!!Dt(h,n.variables)){var d=p.clientOnly,y=p.deferred;if(!(d&&y)&&Oe(h.directives)&&h.directives.forEach(function(_){var b=_.name.value;if(b==="client"&&(d=!0),b==="defer"){var S=Nt(_,n.variables);(!S||S.if!==!1)&&(y=!0)}}),et(h)){var g=a.get(h);g&&(d=d&&g.clientOnly,y=y&&g.deferred),a.set(h,Es(n,d,y))}else{var C=Cr(h,n.lookupFragment);if(!C&&h.kind===we.FRAGMENT_SPREAD)throw __DEV__?new U("No fragment named ".concat(h.name.value)):new U(8);C&&o.fragmentMatches(C,i,t,n.variables)&&u(C.selectionSet,Es(n,d,y))}}}))}(e,n),a},r.prototype.applyMerges=function(e,t,n,i,a){var o,s=this;if(e.map.size&&!W(n)){var u=!ne(n)&&(W(t)||Xt(t))?t:void 0,l=n;u&&!a&&(a=[W(u)?u.__ref:u]);var p,f=function(h,d){return ne(h)?typeof d=="number"?h[d]:void 0:i.store.getFieldValue(h,String(d))};e.map.forEach(function(h,d){var y=f(u,d),g=f(l,d);if(g!==void 0){a&&a.push(d);var C=s.applyMerges(h,y,g,i,a);C!==g&&(p=p||new Map,p.set(d,C)),a&&T(a.pop()===d)}}),p&&(n=ne(l)?l.slice(0):m({},l),p.forEach(function(h,d){n[d]=h}))}return e.info?this.cache.policies.runMergeFunction(t,n,e.info,i,a&&(o=i.store).getStorage.apply(o,a)):n},r}();var Tl=[];function _l(r,e){var t=r.map;return t.has(e)||t.set(e,Tl.pop()||{map:new Map}),t.get(e)}function xs(r,e){if(r===e||!e||ua(e))return r;if(!r||ua(r))return e;var t=r.info&&e.info?m(m({},r.info),e.info):r.info||e.info,n=r.map.size&&e.map.size,i=n?new Map:r.map.size?r.map:e.map,a={info:t,map:i};if(n){var o=new Set(e.map.keys());r.map.forEach(function(s,u){a.map.set(u,xs(s,e.map.get(u))),o.delete(u)}),o.forEach(function(s){a.map.set(s,xs(e.map.get(s),r.map.get(s)))})}return a}function ua(r){return!r||!(r.info||r.map.size)}function El(r,e){var t=r.map,n=t.get(e);n&&ua(n)&&(Tl.push(n),t.delete(e))}var xl=new Set;function xd(r,e,t,n){var i=function(f){var h=n.getFieldValue(f,t);return typeof h=="object"&&h},a=i(r);if(!!a){var o=i(e);if(!!o&&!W(a)&&!ue(a,o)&&!Object.keys(a).every(function(f){return n.getFieldValue(o,f)!==void 0})){var s=n.getFieldValue(r,"__typename")||n.getFieldValue(e,"__typename"),u=ht(t),l="".concat(s,".").concat(u);if(!xl.has(l)){xl.add(l);var p=[];!ne(a)&&!ne(o)&&[a,o].forEach(function(f){var h=n.getFieldValue(f,"__typename");typeof h=="string"&&!p.includes(h)&&p.push(h)}),__DEV__&&T.warn("Cache data may be lost when replacing the ".concat(u," field of a ").concat(s,` object.
|
|
38
|
+
`):new U(23)};var 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(f,h){t.push("".concat(f,"=").concat(encodeURIComponent(h)))};if("query"in e&&n("query",e.query),e.operationName&&n("operationName",e.operationName),e.variables){var i=void 0;try{i=Yn(e.variables,"Variables map")}catch(f){return{parseError:f}}n("variables",i)}if(e.extensions){var a=void 0;try{a=Yn(e.extensions,"Extensions map")}catch(f){return{parseError:f}}n("extensions",a)}var o="",s=r,u=r.indexOf("#");u!==-1&&(o=r.substr(u),s=r.substr(0,u));var l=s.indexOf("?")===-1?"?":"&",p=s+l+t.join("&")+o;return{newURI:p}}var $u=ke(function(){return fetch}),Mu=function(r){r===void 0&&(r={});var e=r.uri,t=e===void 0?"/graphql":e,n=r.fetch,i=r.print,a=i===void 0?Du:i,o=r.includeExtensions,s=r.preserveHeaderCase,u=r.useGETForQueries,l=r.includeUnusedVariables,p=l===void 0?!1:l,f=wt(r,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);__DEV__&&Pu(n||$u);var h={http:{includeExtensions:o,preserveHeaderCase:s},options:f.fetchOptions,credentials:f.credentials,headers:f.headers};return new ut(function(d){var y=Lu(d,t),g=d.getContext(),C={};if(g.clientAwareness){var _=g.clientAwareness,b=_.name,S=_.version;b&&(C["apollographql-client-name"]=b),S&&(C["apollographql-client-version"]=S)}var O=m(m({},C),g.headers),k={http:g.http,options:g.fetchOptions,credentials:g.credentials,headers:O},N=Nu(d,a,ku,h,k),I=N.options,R=N.body;if(R.variables&&!p){var re=new Set(Object.keys(R.variables));Me(d.query,{Variable:function(z,Ct,Q){Q&&Q.kind!=="VariableDefinition"&&re.delete(z.name.value)}}),re.size&&(R.variables=m({},R.variables),re.forEach(function(z){delete R.variables[z]}))}var ee;if(!I.signal){var bt=Ru(),kt=bt.controller,De=bt.signal;ee=kt,ee&&(I.signal=De)}var B=function(z){return z.kind==="OperationDefinition"&&z.operation==="mutation"};if(u&&!d.query.definitions.some(B)&&(I.method="GET"),Zr(["defer"],d.query)&&(I.headers=I.headers||{},I.headers.accept="multipart/mixed; deferSpec=20220824, application/json"),I.method==="GET"){var ve=Fu(y,R),oe=ve.newURI,K=ve.parseError;if(K)return zi(K);y=oe}else try{I.body=Yn(R,"Payload")}catch(z){return zi(z)}return new W(function(z){var Ct=n||ke(function(){return fetch})||$u;return Ct(y,I).then(function(Q){var St;d.setContext({response:Q});var qt=(St=Q.headers)===null||St===void 0?void 0:St.get("content-type");return qt!==null&&/^multipart\/mixed/i.test(qt)?Tu(Q,z):Iu(Q,d,z)}).catch(function(Q){return Yi(Q,z)}),function(){ee&&ee.abort()}})})};var ns=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}(ut);var{toString:ju,hasOwnProperty:Kf}=Object.prototype,Uu=Function.prototype.toString,is=new Map;function pe(r,e){try{return as(r,e)}finally{is.clear()}}function as(r,e){if(r===e)return!0;let t=ju.call(r),n=ju.call(e);if(t!==n)return!1;switch(t){case"[object Array]":if(r.length!==e.length)return!1;case"[object Object]":{if(Bu(r,e))return!0;let i=qu(r),a=qu(e),o=i.length;if(o!==a.length)return!1;for(let s=0;s<o;++s)if(!Kf.call(e,i[s]))return!1;for(let s=0;s<o;++s){let u=i[s];if(!as(r[u],e[u]))return!1}return!0}case"[object Error]":return r.name===e.name&&r.message===e.message;case"[object Number]":if(r!==r)return e!==e;case"[object Boolean]":case"[object Date]":return+r==+e;case"[object RegExp]":case"[object String]":return r==`${e}`;case"[object Map]":case"[object Set]":{if(r.size!==e.size)return!1;if(Bu(r,e))return!0;let i=r.entries(),a=t==="[object Map]";for(;;){let o=i.next();if(o.done)break;let[s,u]=o.value;if(!e.has(s)||a&&!as(u,e.get(s)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":r=new Uint8Array(r),e=new Uint8Array(e);case"[object DataView]":{let i=r.byteLength;if(i===e.byteLength)for(;i--&&r[i]===e[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{let i=Uu.call(r);return i!==Uu.call(e)?!1:!Jf(i,Hf)}}return!1}function qu(r){return Object.keys(r).filter(zf,r)}function zf(r){return this[r]!==void 0}var Hf="{ [native code] }";function Jf(r,e){let t=r.length-e.length;return t>=0&&r.indexOf(e,t)===t}function Bu(r,e){let t=is.get(r);if(t){if(t.has(e))return!0}else is.set(r,t=new Set);return t.add(e),!1}var Yf=function(){return Object.create(null)},Vu=Array.prototype,Xf=Vu.forEach,Zf=Vu.slice,xt=function(){function r(e,t){e===void 0&&(e=!0),t===void 0&&(t=Yf),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 Xf.call(e,function(n){return t=t.getChildTrie(n)}),t.data||(t.data=this.makeData(Zf.call(e)))},r.prototype.getChildTrie=function(e){var t=this.weakness&&ed(e)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),n=t.get(e);return n||t.set(e,n=new r(this.weakness,this.makeData)),n},r}();function ed(r){switch(typeof r){case"object":if(r===null)break;case"function":return!0}return!1}var Re=null,Qu={},td=1,rd=()=>class{constructor(){this.id=["slot",td++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=Re;e;e=e.parent)if(this.id in e.slots){let t=e.slots[this.id];if(t===Qu)break;return e!==Re&&(Re.slots[this.id]=t),!0}return Re&&(Re.slots[this.id]=Qu),!1}getValue(){if(this.hasValue())return Re.slots[this.id]}withValue(e,t,n,i){let a={__proto__:null,[this.id]:e},o=Re;Re={parent:o,slots:a};try{return t.apply(i,n)}finally{Re=o}}static bind(e){let t=Re;return function(){let n=Re;try{return Re=t,e.apply(this,arguments)}finally{Re=n}}}static noContext(e,t,n){if(Re){let i=Re;try{return Re=null,e.apply(n,t)}finally{Re=i}}else return e.apply(n,t)}};function Wu(r){try{return r()}catch{}}var os="@wry/context:Slot",nd=Wu(()=>globalThis)||Wu(()=>global)||Object.create(null),Gu=nd,cn=Gu[os]||Array[os]||function(r){try{Object.defineProperty(Gu,os,{value:r,enumerable:!1,writable:!1,configurable:!0})}finally{return r}}(rd());var{bind:ad,noContext:od}=cn;function sd(){}var cd=function(){function r(e,t){e===void 0&&(e=1/0),t===void 0&&(t=sd),this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}return r.prototype.has=function(e){return this.map.has(e)},r.prototype.get=function(e){var t=this.getNode(e);return t&&t.value},r.prototype.getNode=function(e){var t=this.map.get(e);if(t&&t!==this.newest){var n=t.older,i=t.newer;i&&(i.older=n),n&&(n.newer=i),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=i)}return t},r.prototype.set=function(e,t){var n=this.getNode(e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)},r.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},r.prototype.delete=function(e){var t=this.map.get(e);return t?(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0):!1},r}(),Zi=new cn,ss,ud=Object.prototype.hasOwnProperty,us=(ss=Array.from,ss===void 0?function(r){var e=[];return r.forEach(function(t){return e.push(t)}),e}:ss);function Xi(r){var e=r.unsubscribe;typeof e=="function"&&(r.unsubscribe=void 0,e())}var Xn=[],ld=100;function un(r,e){if(!r)throw new Error(e||"assertion failure")}function pd(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 fd(r){return r.slice(0)}var dd=function(){function r(e){this.fn=e,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++r.count}return r.prototype.peek=function(){if(this.value.length===1&&!Yt(this))return Ku(this),this.value[0]},r.prototype.recompute=function(e){return un(!this.recomputing,"already recomputing"),Ku(this),Yt(this)?hd(this,e):zu(this.value)},r.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,Hu(this),Xi(this))},r.prototype.dispose=function(){var e=this;this.setDirty(),el(this),ls(this,function(t,n){t.setDirty(),tl(t,e)})},r.prototype.forget=function(){this.dispose()},r.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=Xn.pop()||new Set),this.deps.add(e)},r.prototype.forgetDeps=function(){var e=this;this.deps&&(us(this.deps).forEach(function(t){return t.delete(e)}),this.deps.clear(),Xn.push(this.deps),this.deps=null)},r.count=0,r}();function Ku(r){var e=Zi.getValue();if(e)return r.parents.add(e),e.childValues.has(r)||e.childValues.set(r,[]),Yt(r)?Yu(e,r):Xu(e,r),e}function hd(r,e){return el(r),Zi.withValue(r,md,[r,e]),gd(r,e)&&yd(r),zu(r.value)}function md(r,e){r.recomputing=!0,r.value.length=0;try{r.value[0]=r.fn.apply(null,e)}catch(t){r.value[1]=t}r.recomputing=!1}function Yt(r){return r.dirty||!!(r.dirtyChildren&&r.dirtyChildren.size)}function yd(r){r.dirty=!1,!Yt(r)&&Ju(r)}function Hu(r){ls(r,Yu)}function Ju(r){ls(r,Xu)}function ls(r,e){var t=r.parents.size;if(t)for(var n=us(r.parents),i=0;i<t;++i)e(n[i],r)}function Yu(r,e){un(r.childValues.has(e)),un(Yt(e));var t=!Yt(r);if(!r.dirtyChildren)r.dirtyChildren=Xn.pop()||new Set;else if(r.dirtyChildren.has(e))return;r.dirtyChildren.add(e),t&&Hu(r)}function Xu(r,e){un(r.childValues.has(e)),un(!Yt(e));var t=r.childValues.get(e);t.length===0?r.childValues.set(e,fd(e.value)):pd(t,e.value)||r.setDirty(),Zu(r,e),!Yt(r)&&Ju(r)}function Zu(r,e){var t=r.dirtyChildren;t&&(t.delete(e),t.size===0&&(Xn.length<ld&&Xn.push(t),r.dirtyChildren=null))}function el(r){r.childValues.size>0&&r.childValues.forEach(function(e,t){tl(r,t)}),r.forgetDeps(),un(r.dirtyChildren===null)}function tl(r,e){e.parents.delete(r),r.childValues.delete(e),Zu(r,e)}function gd(r,e){if(typeof r.subscribe=="function")try{Xi(r),r.unsubscribe=r.subscribe.apply(null,e)}catch{return r.setDirty(),!1}return!0}var vd={setDirty:!0,dispose:!0,forget:!0};function ea(r){var e=new Map,t=r&&r.subscribe;function n(i){var a=Zi.getValue();if(a){var o=e.get(i);o||e.set(i,o=new Set),a.dependOn(o),typeof t=="function"&&(Xi(o),o.unsubscribe=t(i))}}return n.dirty=function(a,o){var s=e.get(a);if(s){var u=o&&ud.call(vd,o)?o:"setDirty";us(s).forEach(function(l){return l[u]()}),e.delete(a),Xi(s)}},n}function rl(){var r=new xt(typeof WeakMap=="function");return function(){return r.lookupArray(arguments)}}var x4=rl(),cs=new Set;function Or(r,e){e===void 0&&(e=Object.create(null));var t=new cd(e.max||Math.pow(2,16),function(l){return l.dispose()}),n=e.keyArgs,i=e.makeCacheKey||rl(),a=function(){var l=i.apply(null,n?n.apply(null,arguments):arguments);if(l===void 0)return r.apply(null,arguments);var p=t.get(l);p||(t.set(l,p=new dd(r)),p.subscribe=e.subscribe,p.forget=function(){return t.delete(l)});var f=p.recompute(Array.prototype.slice.call(arguments));return t.set(l,p),cs.add(t),Zi.hasValue()||(cs.forEach(function(h){return h.clean()}),cs.clear()),f};Object.defineProperty(a,"size",{get:function(){return t.map.size},configurable:!1,enumerable:!1});function o(l){var p=t.get(l);p&&p.setDirty()}a.dirtyKey=o,a.dirty=function(){o(i.apply(null,arguments))};function s(l){var p=t.get(l);if(p)return p.peek()}a.peekKey=s,a.peek=function(){return s(i.apply(null,arguments))};function u(l){return t.delete(l)}return a.forgetKey=u,a.forget=function(){return u(i.apply(null,arguments))},a.makeCacheKey=i,a.getKey=n?function(){return i.apply(null,n.apply(null,arguments))}:i,Object.freeze(a)}var ps=function(){function r(){this.getFragmentDoc=Or(Do)}return r.prototype.batch=function(e){var t=this,n=typeof e.optimistic=="string"?e.optimistic:e.optimistic===!1?null:void 0,i;return this.performTransaction(function(){return i=e.update(t)},n),i},r.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},r.prototype.transformDocument=function(e){return e},r.prototype.transformForLink=function(e){return e},r.prototype.identify=function(e){},r.prototype.gc=function(){return[]},r.prototype.modify=function(e){return!1},r.prototype.readQuery=function(e,t){return t===void 0&&(t=!!e.optimistic),this.read(m(m({},e),{rootId:e.id||"ROOT_QUERY",optimistic:t}))},r.prototype.readFragment=function(e,t){return t===void 0&&(t=!!e.optimistic),this.read(m(m({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:t}))},r.prototype.writeQuery=function(e){var t=e.id,n=e.data,i=wt(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=wt(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(i,a),dataId:t,result:n}))},r.prototype.updateQuery=function(e,t){return this.batch({update:function(n){var i=n.readQuery(e),a=t(i);return a==null?i:(n.writeQuery(m(m({},e),{data:a})),a)}})},r.prototype.updateFragment=function(e,t){return this.batch({update:function(n){var i=n.readFragment(e),a=t(i);return a==null?i:(n.writeFragment(m(m({},e),{data:a})),a)}})},r}();var Zn=function(r){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 u=s.path.length-1;u>=0;--u)s.missing=(o={},o[s.path[u]]=s.missing,o)}else s.missing=s.path;return s.__proto__=e.prototype,s}return e}(Error);var Ce=Object.prototype.hasOwnProperty;function ei(r){return r==null}function ra(r,e){var t=r.__typename,n=r.id,i=r._id;if(typeof t=="string"&&(e&&(e.keyObject=ei(n)?ei(i)?void 0:{_id:i}:{id:n}),ei(n)&&!ei(i)&&(n=i),!ei(n)))return"".concat(t,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var nl={dataIdFromObject:ra,addTypename:!0,resultCaching:!0,canonizeResults:!1};function il(r){return Jt(nl,r)}function na(r){var e=r.canonizeResults;return e===void 0?nl.canonizeResults:e}function al(r,e){return G(e)?r.get(e.__ref,"__typename"):e&&e.__typename}var fs=/^[_a-z][_0-9a-z]*/i;function mt(r){var e=r.match(fs);return e?e[0]:r}function ta(r,e,t){return H(e)?ne(e)?e.every(function(n){return ta(r,n,t)}):r.selections.every(function(n){if(tt(n)&&Nt(n,t)){var i=st(n);return Ce.call(e,i)&&(!n.selectionSet||ta(n.selectionSet,e[i],t))}return!0}):!1}function Xt(r){return H(r)&&!G(r)&&!ne(r)}function ol(){return new ze}function ia(r,e){var t=br(Sr(r));return{fragmentMap:t,lookupFragment:function(n){var i=t[n];return!i&&e&&(i=e.lookup(n)),i||null}}}var aa=Object.create(null),ds=function(){return aa},sl=Object.create(null),ln=function(){function r(e,t){var n=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(i,a){return Gn(G(i)?n.get(i.__ref,a):i&&i[a])},this.canRead=function(i){return G(i)?n.has(i.__ref):typeof i=="object"},this.toReference=function(i,a){if(typeof i=="string")return _t(i);if(G(i))return i;var o=n.policies.identify(i)[0];if(o){var s=_t(o);return a&&n.merge(o,i),s}}}return r.prototype.toObject=function(){return m({},this.data)},r.prototype.has=function(e){return this.lookup(e,!0)!==void 0},r.prototype.get=function(e,t){if(this.group.depend(e,t),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 Zt)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 Zt)return this.parent.lookup(e,t);if(this.policies.rootTypenamesById[e])return Object.create(null)},r.prototype.merge=function(e,t){var n=this,i;G(e)&&(e=e.__ref),G(t)&&(t=t.__ref);var a=typeof e=="string"?this.lookup(i=e):e,o=typeof t=="string"?this.lookup(i=t):t;if(!!o){__DEV__?T(typeof i=="string","store.merge expects a string ID"):T(typeof i=="string",1);var s=new ze(Cd).merge(a,o);if(this.data[i]=s,s!==a&&(delete this.refs[i],this.group.caching)){var u=Object.create(null);a||(u.__exists=1),Object.keys(o).forEach(function(l){if(!a||a[l]!==s[l]){u[l]=1;var p=mt(l);p!==l&&!n.policies.hasKeyArgs(s.__typename,p)&&(u[p]=1),s[l]===void 0&&!(n instanceof Zt)&&delete s[l]}}),u.__typename&&!(a&&a.__typename)&&this.policies.rootTypenamesById[i]===s.__typename&&delete u.__typename,Object.keys(u).forEach(function(l){return n.group.dirty(i,l)})}}},r.prototype.modify=function(e,t){var n=this,i=this.lookup(e);if(i){var a=Object.create(null),o=!1,s=!0,u={DELETE:aa,INVALIDATE:sl,isReference:G,toReference:this.toReference,canRead:this.canRead,readField:function(l,p){return n.policies.readField(typeof l=="string"?{fieldName:l,from:p||_t(e)}:l,{store:n})}};if(Object.keys(i).forEach(function(l){var p=mt(l),f=i[l];if(f!==void 0){var h=typeof t=="function"?t:t[l]||t[p];if(h){var d=h===ds?aa:h(Gn(f),m(m({},u),{fieldName:p,storeFieldName:l,storage:n.getStorage(e,l)}));d===sl?n.group.dirty(e,l):(d===aa&&(d=void 0),d!==f&&(a[l]=d,o=!0,f=d))}f!==void 0&&(s=!1)}}),o)return this.merge(e,a),s&&(this instanceof Zt?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},r.prototype.delete=function(e,t,n){var i,a=this.lookup(e);if(a){var o=this.getFieldValue(a,"__typename"),s=t&&n?this.policies.getStoreFieldName({typename:o,fieldName:t,args:n}):t;return this.modify(e,s?(i={},i[s]=ds,i):ds)}return!1},r.prototype.evict=function(e,t){var n=!1;return e.id&&(Ce.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof Zt&&this!==t&&(n=this.parent.evict(e,t)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n},r.prototype.clear=function(){this.replace(null)},r.prototype.extract=function(){var e=this,t=this.toObject(),n=[];return this.getRootIdSet().forEach(function(i){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=wt(e,["__META"]);Object.keys(i).forEach(function(a){t.merge(a,i[a])}),n&&n.extraRootIds.forEach(this.retain,this)}},r.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},r.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},r.prototype.getRootIdSet=function(e){return e===void 0&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof Zt?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},r.prototype.gc=function(){var e=this,t=this.getRootIdSet(),n=this.toObject();t.forEach(function(o){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 Zt;)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){G(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 xt(ct)},r.prototype.depend=function(e,t){if(this.d){this.d(hs(e,t));var n=mt(t);n!==t&&this.d(hs(e,n)),this.parent&&this.parent.depend(e,t)}},r.prototype.dirty=function(e,t){this.d&&this.d.dirty(hs(e,t),t==="__exists"?"forget":"setDirty")},r}();function hs(r,e){return e+"#"+r}function ms(r,e){Tr(r)&&r.group.depend(e,"__exists")}(function(r){var e=function(t){be(n,t);function n(i){var a=i.policies,o=i.resultCaching,s=o===void 0?!0:o,u=i.seed,l=t.call(this,a,new cl(s))||this;return l.stump=new bd(l),l.storageTrie=new xt(ct),u&&l.replace(u),l}return n.prototype.addLayer=function(i,a){return this.stump.addLayer(i,a)},n.prototype.removeLayer=function(){return this},n.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},n}(r);r.Root=e})(ln||(ln={}));var Zt=function(r){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(u){pe(o[u],s[u])||n.group.dirty(a,u)}):(n.group.dirty(a,"__exists"),Object.keys(s).forEach(function(u){n.group.dirty(a,u)})):n.delete(a)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return m(m({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(t){var n=this.parent.findChildRefIds(t);return Ce.call(this.data,t)?m(m({},n),r.prototype.findChildRefIds.call(this,t)):n},e.prototype.getStorage=function(){for(var t=this.parent;t.parent;)t=t.parent;return t.getStorage.apply(t,arguments)},e}(ln),bd=function(r){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}(Zt);function Cd(r,e,t){var n=r[t],i=e[t];return pe(n,i)?n:i}function Tr(r){return!!(r instanceof ln&&r.group.caching)}function Sd(r){return H(r)?ne(r)?r.slice(0):m({__proto__:Object.getPrototypeOf(r)},r):r}var oa=function(){function r(){this.known=new(fu?WeakSet:Set),this.pool=new xt(ct),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=Sd(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),u=[s],l=this.sortedKeys(e);u.push(l.json);var p=u.length;l.sorted.forEach(function(d){u.push(t.admit(e[d]))});var o=this.pool.lookupArray(u);if(!o.object){var f=o.object=Object.create(s);this.known.add(f),l.sorted.forEach(function(d,y){f[d]=u[p+y]}),__DEV__&&Object.freeze(f)}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 rt=Object.assign(function(r){if(H(r)){ys===void 0&&ul();var e=ys.admit(r),t=gs.get(e);return t===void 0&&gs.set(e,t=JSON.stringify(e)),t}return JSON.stringify(r)},{reset:ul}),ys,gs;function ul(){ys=new oa,gs=new(ct?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(ct?WeakMap:Map),this.config=Jt(e,{addTypename:e.addTypename!==!1,canonizeResults:na(e)}),this.canon=e.canon||new oa,this.executeSelectionSet=Or(function(n){var i,a=n.context.canonizeResults,o=ll(n);o[3]=!a;var s=(i=t.executeSelectionSet).peek.apply(i,o);return s?a?m(m({},s),{result:t.canon.admit(s.result)}):s:(ms(n.context.store,n.enclosingRef.__ref),t.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize,keyArgs:ll,makeCacheKey:function(n,i,a,o){if(Tr(a.store))return a.store.makeCacheKey(n,G(i)?i.__ref:i,a.varString,o)}}),this.executeSubSelectedArray=Or(function(n){return ms(n.context.store,n.enclosingRef.__ref),t.execSubSelectedArrayImpl(n)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(n){var i=n.field,a=n.array,o=n.context;if(Tr(o.store))return o.store.makeCacheKey(i,a,o.varString)}})}return r.prototype.resetCanon=function(){this.canon=new oa},r.prototype.diffQueryAgainstStore=function(e){var t=e.store,n=e.query,i=e.rootId,a=i===void 0?"ROOT_QUERY":i,o=e.variables,s=e.returnPartialData,u=s===void 0?!0:s,l=e.canonizeResults,p=l===void 0?this.config.canonizeResults:l,f=this.config.cache.policies;o=m(m({},_r(Vn(n))),o);var h=_t(a),d=this.executeSelectionSet({selectionSet:wr(n).selectionSet,objectOrReference:h,enclosingRef:h,context:m({store:t,query:n,policies:f,variables:o,varString:rt(o),canonizeResults:p},ia(n,this.config.fragments))}),y;if(d.missing&&(y=[new Zn(wd(d.missing),d.missing,n,o)],!u))throw y[0];return{result:d.result,complete:!y,missing:y}},r.prototype.isFresh=function(e,t,n,i){if(Tr(i.store)&&this.knownResults.get(e)===n){var a=this.executeSelectionSet.peek(n,t,i,this.canon.isKnown(e));if(a&&e===a.result)return!0}return!1},r.prototype.execSelectionSetImpl=function(e){var t=this,n=e.selectionSet,i=e.objectOrReference,a=e.enclosingRef,o=e.context;if(G(i)&&!o.policies.rootTypenamesById[i.__ref]&&!o.store.has(i.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(i.__ref," object")};var s=o.variables,u=o.policies,l=o.store,p=l.getFieldValue(i,"__typename"),f=[],h,d=new ze;this.config.addTypename&&typeof p=="string"&&!u.rootIdsByTypename[p]&&f.push({__typename:p});function y(S,O){var k;return S.missing&&(h=d.merge(h,(k={},k[O]=S.missing,k))),S.result}var g=new Set(n.selections);g.forEach(function(S){var O,k;if(!!Nt(S,s))if(tt(S)){var N=u.readField({fieldName:S.name.value,field:S,variables:o.variables,from:i},o),I=st(S);N===void 0?Er.added(S)||(h=d.merge(h,(O={},O[I]="Can't find field '".concat(S.name.value,"' on ").concat(G(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),O))):ne(N)?N=y(t.executeSubSelectedArray({field:S,array:N,enclosingRef:a,context:o}),I):S.selectionSet?N!=null&&(N=y(t.executeSelectionSet({selectionSet:S.selectionSet,objectOrReference:N,enclosingRef:G(N)?N:a,context:o}),I)):o.canonizeResults&&(N=t.canon.pass(N)),N!==void 0&&f.push((k={},k[I]=N,k))}else{var R=Cr(S,o.lookupFragment);if(!R&&S.kind===Ee.FRAGMENT_SPREAD)throw __DEV__?new U("No fragment named ".concat(S.name.value)):new U(5);R&&u.fragmentMatches(R,p)&&R.selectionSet.selections.forEach(g.add,g)}});var C=Qn(f),_={result:C,missing:h},b=o.canonizeResults?this.canon.admit(_):Gn(_);return b.result&&this.knownResults.set(b.result,n),b},r.prototype.execSubSelectedArrayImpl=function(e){var t=this,n=e.field,i=e.array,a=e.enclosingRef,o=e.context,s,u=new ze;function l(p,f){var h;return p.missing&&(s=u.merge(s,(h={},h[f]=p.missing,h))),p.result}return n.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(p,f){return p===null?null:ne(p)?l(t.executeSubSelectedArray({field:n,array:p,enclosingRef:a,context:o}),f):n.selectionSet?l(t.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:p,enclosingRef:G(p)?p:a,context:o}),f):(__DEV__&&_d(o.store,n,p),p)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:s}},r}();function wd(r){try{JSON.stringify(r,function(e,t){if(typeof t=="string")throw t;return t})}catch(e){return e}}function _d(r,e,t){if(!e.selectionSet){var n=new Set([t]);n.forEach(function(i){H(i)&&(__DEV__?T(!G(i),"Missing selection set for object of type ".concat(al(r,i)," returned for query field ").concat(e.name.value)):T(!G(i),6),Object.values(i).forEach(n.add,n))})}}var pn=new cn,fl=new WeakMap;function ti(r){var e=fl.get(r);return e||fl.set(r,e={vars:new Set,dep:ea()}),e}function vs(r){ti(r).vars.forEach(function(e){return e.forgetCache(r)})}function dl(r){ti(r).vars.forEach(function(e){return e.attachCache(r)})}function sa(r){var e=new Set,t=new Set,n=function(a){if(arguments.length>0){if(r!==a){r=a,e.forEach(function(u){ti(u).dep.dirty(n),Ed(u)});var o=Array.from(t);t.clear(),o.forEach(function(u){return u(r)})}}else{var s=pn.getValue();s&&(i(s),ti(s).dep(n))}return r};n.onNextChange=function(a){return t.add(a),function(){t.delete(a)}};var i=n.attachCache=function(a){return e.add(a),ti(a).vars.add(n),n};return n.forgetCache=function(a){return e.delete(a)},n}function Ed(r){r.broadcastWatches&&r.broadcastWatches()}var hl=Object.create(null);function bs(r){var e=JSON.stringify(r);return hl[e]||(hl[e]=Object.create(null))}function Cs(r){var e=bs(r);return e.keyFieldsFn||(e.keyFieldsFn=function(t,n){var i=function(o,s){return n.readField(s,o)},a=n.keyObject=ws(r,function(o){var s=fn(n.storeObject,o,i);return s===void 0&&t!==n.storeObject&&Ce.call(t,o[0])&&(s=fn(t,o,yl)),__DEV__?T(s!==void 0,"Missing field '".concat(o.join("."),"' while extracting keyFields from ").concat(JSON.stringify(t))):T(s!==void 0,2),s});return"".concat(n.typename,":").concat(JSON.stringify(a))})}function Ss(r){var e=bs(r);return e.keyArgsFn||(e.keyArgsFn=function(t,n){var i=n.field,a=n.variables,o=n.fieldName,s=ws(r,function(l){var p=l[0],f=p.charAt(0);if(f==="@"){if(i&&Te(i.directives)){var h=p.slice(1),d=i.directives.find(function(_){return _.name.value===h}),y=d&&Pt(d,a);return y&&fn(y,l.slice(1))}return}if(f==="$"){var g=p.slice(1);if(a&&Ce.call(a,g)){var C=l.slice(0);return C[0]=g,fn(a,C)}return}if(t)return fn(t,l)}),u=JSON.stringify(s);return(t||u!=="{}")&&(o+=":"+u),o})}function ws(r,e){var t=new ze;return ml(r).reduce(function(n,i){var a,o=e(i);if(o!==void 0){for(var s=i.length-1;s>=0;--s)o=(a={},a[i[s]]=o,a);n=t.merge(n,o)}return n},Object.create(null))}function ml(r){var e=bs(r);if(!e.paths){var t=e.paths=[],n=[];r.forEach(function(i,a){ne(i)?(ml(i).forEach(function(o){return t.push(n.concat(o))}),n.length=0):(n.push(i),ne(r[a+1])||(t.push(n.slice(0)),n.length=0))})}return e.paths}function yl(r,e){return r[e]}function fn(r,e,t){return t=t||yl,gl(e.reduce(function n(i,a){return ne(i)?i.map(function(o){return n(o,a)}):i&&t(i,a)},r))}function gl(r){return H(r)?ne(r)?r.map(gl):ws(Object.keys(r).sort(),function(e){return fn(r,e)}):r}qn.setStringify(rt);function _s(r){return r.args!==void 0?r.args:r.field?Pt(r.field,r.variables):null}var xd=function(){},vl=function(r,e){return e.fieldName},bl=function(r,e,t){var n=t.mergeObjects;return n(r,e)},Cl=function(r,e){return e},wl=function(){function r(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=m({dataIdFromObject:ra},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return r.prototype.identify=function(e,t){var n,i=this,a=t&&(t.typename||((n=t.storeObject)===null||n===void 0?void 0:n.__typename))||e.__typename;if(a===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=t&&t.storeObject||e,s=m(m({},t),{typename:a,storeObject:o,readField:t&&t.readField||function(){var h=ca(arguments,o);return i.readField(h,{store:i.cache.data,variables:h.variables})}}),u,l=a&&this.getTypePolicy(a),p=l&&l.keyFn||this.config.dataIdFromObject;p;){var f=p(e,s);if(ne(f))p=Cs(f);else{u=f;break}}return u=u?String(u):void 0,s.keyObject?[u,s.keyObject]:[u]},r.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach(function(n){var i=e[n],a=i.queryType,o=i.mutationType,s=i.subscriptionType,u=wt(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(u):t.toBeAdded[n]=[u]})},r.prototype.updateTypePolicy=function(e,t){var n=this,i=this.getTypePolicy(e),a=t.keyFields,o=t.fields;function s(u,l){u.merge=typeof l=="function"?l:l===!0?bl:l===!1?Cl:u.merge}s(i,t.merge),i.keyFn=a===!1?xd:ne(a)?Cs(a):typeof a=="function"?a:i.keyFn,o&&Object.keys(o).forEach(function(u){var l=n.getFieldPolicy(e,u,!0),p=o[u];if(typeof p=="function")l.read=p;else{var f=p.keyArgs,h=p.read,d=p.merge;l.keyFn=f===!1?vl:ne(f)?Ss(f):typeof f=="function"?f:l.keyFn,typeof h=="function"&&(l.read=h),s(l,d)}l.read&&l.merge&&(l.keyFn=l.keyFn||vl)})},r.prototype.setRootTypename=function(e,t){t===void 0&&(t=e);var n="ROOT_"+e.toUpperCase(),i=this.rootTypenamesById[n];t!==i&&(__DEV__?T(!i||i===e,"Cannot change root ".concat(e," __typename more than once")):T(!i||i===e,3),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[t]=n,this.rootTypenamesById[n]=t)},r.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(n){t.getSupertypeSet(n,!0),e[n].forEach(function(i){t.getSupertypeSet(i,!0).add(n);var a=i.match(fs);(!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),u=s.fields,l=wt(s,["fields"]);Object.assign(n,l),Object.assign(n.fields,u)})}var a=this.toBeAdded[e];return a&&a.length&&a.splice(0).forEach(function(o){t.updateTypePolicy(e,o)}),this.typePolicies[e]},r.prototype.getFieldPolicy=function(e,t,n){if(e){var i=this.getTypePolicy(e).fields;return i[t]||n&&(i[t]=Object.create(null))}},r.prototype.getSupertypeSet=function(e,t){var n=this.supertypeMap.get(e);return!n&&t&&this.supertypeMap.set(e,n=new Set),n},r.prototype.fragmentMatches=function(e,t,n,i){var a=this;if(!e.typeCondition)return!0;if(!t)return!1;var o=e.typeCondition.name.value;if(t===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(t,!0),u=[s],l=function(y){var g=a.getSupertypeSet(y,!1);g&&g.size&&u.indexOf(g)<0&&u.push(g)},p=!!(n&&this.fuzzySubtypes.size),f=!1,h=0;h<u.length;++h){var d=u[h];if(d.has(o))return s.has(o)||(f&&__DEV__&&T.warn("Inferring subtype ".concat(t," of supertype ").concat(o)),s.add(o)),!0;d.forEach(l),p&&h===u.length-1&&ta(e.selectionSet,n,i)&&(p=!1,f=!0,this.fuzzySubtypes.forEach(function(y,g){var C=t.match(y);C&&C[0]===t&&l(g)}))}return!1},r.prototype.hasKeyArgs=function(e,t){var n=this.getFieldPolicy(e,t,!1);return!!(n&&n.keyFn)},r.prototype.getStoreFieldName=function(e){var t=e.typename,n=e.fieldName,i=this.getFieldPolicy(t,n,!1),a,o=i&&i.keyFn;if(o&&t)for(var s={typename:t,fieldName:n,field:e.field||null,variables:e.variables},u=_s(e);o;){var l=o(u,s);if(ne(l))o=Ss(l);else{a=l||n;break}}return a===void 0&&(a=e.field?Po(e.field,e.variables):qn(n,_s(e))),a===!1?n:n===mt(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=mt(o),u=t.store.getFieldValue(n,o),l=this.getFieldPolicy(e.typename,s,!1),p=l&&l.read;if(p){var f=Sl(this,n,e,t,t.store.getStorage(G(n)?n.__ref:n,o));return pn.withValue(this.cache,p,[u,f])}return u}}},r.prototype.getReadFunction=function(e,t){var n=this.getFieldPolicy(e,t,!1);return n&&n.read},r.prototype.getMergeFunction=function(e,t,n){var i=this.getFieldPolicy(e,t,!1),a=i&&i.merge;return!a&&n&&(i=this.getTypePolicy(n),a=i&&i.merge),a},r.prototype.runMergeFunction=function(e,t,n,i,a){var o=n.field,s=n.typename,u=n.merge;return u===bl?_l(i.store)(e,t):u===Cl?t:(i.overwrite&&(e=void 0),u(e,t,Sl(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:i.variables},i,a||Object.create(null))))},r}();function Sl(r,e,t,n,i){var a=r.getStoreFieldName(t),o=mt(a),s=t.variables||n.variables,u=n.store,l=u.toReference,p=u.canRead;return{args:_s(t),field:t.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:G,toReference:l,storage:i,cache:r.cache,canRead:p,readField:function(){return r.readField(ca(arguments,e,s),n)},mergeObjects:_l(n.store)}}function ca(r,e,t){var n=r[0],i=r[1],a=r.length,o;return typeof n=="string"?o={fieldName:n,from:a>1?i:e}:(o=m({},n),Ce.call(o,"from")||(o.from=e)),__DEV__&&o.from===void 0&&__DEV__&&T.warn("Undefined 'from' passed to readField with arguments ".concat(yu(Array.from(r)))),o.variables===void 0&&(o.variables=t),o}function _l(r){return function(t,n){if(ne(t)||ne(n))throw __DEV__?new U("Cannot automatically merge arrays"):new U(4);if(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(G(t)&&Xt(n))return r.merge(t.__ref,n),t;if(Xt(t)&&G(n))return r.merge(t,n.__ref),n;if(Xt(t)&&Xt(n))return m(m({},t),n)}return n}}function Es(r,e,t){var n="".concat(e).concat(t),i=r.flavors.get(n);return i||r.flavors.set(n,i=r.clientOnly===e&&r.deferred===t?r:m(m({},r),{clientOnly:e,deferred:t})),i}var Tl=function(){function r(e,t,n){this.cache=e,this.reader=t,this.fragments=n}return r.prototype.writeToStore=function(e,t){var n=this,i=t.query,a=t.result,o=t.dataId,s=t.variables,u=t.overwrite,l=Et(i),p=ol();s=m(m({},_r(l)),s);var f=m(m({store:e,written:Object.create(null),merge:function(d,y){return p.merge(d,y)},variables:s,varString:rt(s)},ia(i,this.fragments)),{overwrite:!!u,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),h=this.processSelectionSet({result:a||Object.create(null),dataId:o,selectionSet:l.selectionSet,mergeTree:{map:new Map},context:f});if(!G(h))throw __DEV__?new U("Could not identify object ".concat(JSON.stringify(a))):new U(7);return f.incomingById.forEach(function(d,y){var g=d.storeObject,C=d.mergeTree,_=d.fieldNodeSet,b=_t(y);if(C&&C.map.size){var S=n.applyMerges(C,b,g,f);if(G(S))return;g=S}if(__DEV__&&!f.overwrite){var O=Object.create(null);_.forEach(function(I){I.selectionSet&&(O[I.name.value]=!0)});var k=function(I){return O[mt(I)]===!0},N=function(I){var R=C&&C.map.get(I);return Boolean(R&&R.info&&R.info.merge)};Object.keys(g).forEach(function(I){k(I)&&!N(I)&&Od(b,g,I,f.store)})}e.merge(y,g)}),e.retain(h.__ref),h},r.prototype.processSelectionSet=function(e){var t=this,n=e.dataId,i=e.result,a=e.selectionSet,o=e.context,s=e.mergeTree,u=this.cache.policies,l=Object.create(null),p=n&&u.rootTypenamesById[n]||Bn(i,a,o.fragmentMap)||n&&o.store.get(n,"__typename");typeof p=="string"&&(l.__typename=p);var f=function(){var S=ca(arguments,l,o.variables);if(G(S.from)){var O=o.incomingById.get(S.from.__ref);if(O){var k=u.readField(m(m({},S),{from:O.storeObject}),o);if(k!==void 0)return k}}return u.readField(S,o)},h=new Set;this.flattenFields(a,i,o,p).forEach(function(S,O){var k,N=st(O),I=i[N];if(h.add(O),I!==void 0){var R=u.getStoreFieldName({typename:p,fieldName:O.name.value,field:O,variables:S.variables}),re=El(s,R),ee=t.processFieldValue(I,O,O.selectionSet?Es(S,!1,!1):S,re),bt=void 0;O.selectionSet&&(G(ee)||Xt(ee))&&(bt=f("__typename",ee));var kt=u.getMergeFunction(p,O.name.value,bt);kt?re.info={field:O,typename:p,merge:kt}:xl(s,R),l=S.merge(l,(k={},k[R]=ee,k))}else __DEV__&&!S.clientOnly&&!S.deferred&&!Er.added(O)&&!u.getReadFunction(p,O.name.value)&&__DEV__&&T.error("Missing field '".concat(st(O),"' while writing result ").concat(JSON.stringify(i,null,2)).substring(0,1e3))});try{var d=u.identify(i,{typename:p,selectionSet:a,fragmentMap:o.fragmentMap,storeObject:l,readField:f}),y=d[0],g=d[1];n=n||y,g&&(l=o.merge(l,g))}catch(S){if(!n)throw S}if(typeof n=="string"){var C=_t(n),_=o.written[n]||(o.written[n]=[]);if(_.indexOf(a)>=0||(_.push(a),this.reader&&this.reader.isFresh(i,C,a,o)))return C;var b=o.incomingById.get(n);return b?(b.storeObject=o.merge(b.storeObject,l),b.mergeTree=xs(b.mergeTree,s),h.forEach(function(S){return b.fieldNodeSet.add(S)})):o.incomingById.set(n,{storeObject:l,mergeTree:ua(s)?void 0:s,fieldNodeSet:h}),C}return l},r.prototype.processFieldValue=function(e,t,n,i){var a=this;return!t.selectionSet||e===null?__DEV__?Vi(e):e:ne(e)?e.map(function(o,s){var u=a.processFieldValue(o,t,n,El(i,s));return xl(i,s),u}):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:i})},r.prototype.flattenFields=function(e,t,n,i){i===void 0&&(i=Bn(t,e,n.fragmentMap));var a=new Map,o=this.cache.policies,s=new xt(!1);return function u(l,p){var f=s.lookup(l,p.clientOnly,p.deferred);f.visited||(f.visited=!0,l.selections.forEach(function(h){if(!!Nt(h,n.variables)){var d=p.clientOnly,y=p.deferred;if(!(d&&y)&&Te(h.directives)&&h.directives.forEach(function(_){var b=_.name.value;if(b==="client"&&(d=!0),b==="defer"){var S=Pt(_,n.variables);(!S||S.if!==!1)&&(y=!0)}}),tt(h)){var g=a.get(h);g&&(d=d&&g.clientOnly,y=y&&g.deferred),a.set(h,Es(n,d,y))}else{var C=Cr(h,n.lookupFragment);if(!C&&h.kind===Ee.FRAGMENT_SPREAD)throw __DEV__?new U("No fragment named ".concat(h.name.value)):new U(8);C&&o.fragmentMatches(C,i,t,n.variables)&&u(C.selectionSet,Es(n,d,y))}}}))}(e,n),a},r.prototype.applyMerges=function(e,t,n,i,a){var o,s=this;if(e.map.size&&!G(n)){var u=!ne(n)&&(G(t)||Xt(t))?t:void 0,l=n;u&&!a&&(a=[G(u)?u.__ref:u]);var p,f=function(h,d){return ne(h)?typeof d=="number"?h[d]:void 0:i.store.getFieldValue(h,String(d))};e.map.forEach(function(h,d){var y=f(u,d),g=f(l,d);if(g!==void 0){a&&a.push(d);var C=s.applyMerges(h,y,g,i,a);C!==g&&(p=p||new Map,p.set(d,C)),a&&T(a.pop()===d)}}),p&&(n=ne(l)?l.slice(0):m({},l),p.forEach(function(h,d){n[d]=h}))}return e.info?this.cache.policies.runMergeFunction(t,n,e.info,i,a&&(o=i.store).getStorage.apply(o,a)):n},r}();var Al=[];function El(r,e){var t=r.map;return t.has(e)||t.set(e,Al.pop()||{map:new Map}),t.get(e)}function xs(r,e){if(r===e||!e||ua(e))return r;if(!r||ua(r))return e;var t=r.info&&e.info?m(m({},r.info),e.info):r.info||e.info,n=r.map.size&&e.map.size,i=n?new Map:r.map.size?r.map:e.map,a={info:t,map:i};if(n){var o=new Set(e.map.keys());r.map.forEach(function(s,u){a.map.set(u,xs(s,e.map.get(u))),o.delete(u)}),o.forEach(function(s){a.map.set(s,xs(e.map.get(s),r.map.get(s)))})}return a}function ua(r){return!r||!(r.info||r.map.size)}function xl(r,e){var t=r.map,n=t.get(e);n&&ua(n)&&(Al.push(n),t.delete(e))}var Ol=new Set;function Od(r,e,t,n){var i=function(f){var h=n.getFieldValue(f,t);return typeof h=="object"&&h},a=i(r);if(!!a){var o=i(e);if(!!o&&!G(a)&&!pe(a,o)&&!Object.keys(a).every(function(f){return n.getFieldValue(o,f)!==void 0})){var s=n.getFieldValue(r,"__typename")||n.getFieldValue(e,"__typename"),u=mt(t),l="".concat(s,".").concat(u);if(!Ol.has(l)){Ol.add(l);var p=[];!ne(a)&&!ne(o)&&[a,o].forEach(function(f){var h=n.getFieldValue(f,"__typename");typeof h=="string"&&!p.includes(h)&&p.push(h)}),__DEV__&&T.warn("Cache data may be lost when replacing the ".concat(u," field of a ").concat(s,` object.
|
|
39
39
|
|
|
40
40
|
To address this problem (which is not a bug in Apollo Client), `).concat(p.length?"either ensure all objects of type "+p.join(" and ")+" have an ID or a custom merge function, or ":"","define a custom merge function for the ").concat(l,` field, so InMemoryCache can safely merge these objects:
|
|
41
41
|
|
|
@@ -46,21 +46,21 @@ For more information about these options, please refer to the documentation:
|
|
|
46
46
|
|
|
47
47
|
* Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers
|
|
48
48
|
* Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects
|
|
49
|
-
`))}}}}var la=function(r){
|
|
49
|
+
`))}}}}var la=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=sa,n.txCount=0,n.config=il(t),n.addTypename=!!n.config.addTypename,n.policies=new wl({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return e.prototype.init=function(){var t=this.data=new ln.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=t.stump,this.resetResultCache()},e.prototype.resetResultCache=function(t){var n=this,i=this.storeReader,a=this.config.fragments;this.storeWriter=new Tl(this,this.storeReader=new pl({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:na(this.config),canon:t?void 0:i&&i.canon,fragments:a}),a),this.maybeBroadcastWatch=Or(function(o,s){return n.broadcastWatch(o,s)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(o){var s=o.optimistic?n.optimisticData:n.data;if(Tr(s)){var u=o.optimistic,l=o.id,p=o.variables;return s.makeCacheKey(o.query,o.callback,rt({optimistic:u,id:l,variables:p}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(o){return o.resetCaching()})},e.prototype.restore=function(t){return this.init(),t&&this.data.replace(t),this},e.prototype.extract=function(t){return t===void 0&&(t=!1),(t?this.optimisticData:this.data).extract()},e.prototype.read=function(t){var n=t.returnPartialData,i=n===void 0?!1:n;try{return this.storeReader.diffQueryAgainstStore(m(m({},t),{store:t.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:i})).result||null}catch(a){if(a instanceof Zn)return null;throw a}},e.prototype.write=function(t){try{return++this.txCount,this.storeWriter.writeToStore(this.data,t)}finally{!--this.txCount&&t.broadcast!==!1&&this.broadcastWatches()}},e.prototype.modify=function(t){if(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(m(m({},t),{store:t.optimistic?this.optimisticData:this.data,rootId:t.id||"ROOT_QUERY",config:this.config}))},e.prototype.watch=function(t){var n=this;return this.watches.size||dl(this),this.watches.add(t),t.immediate&&this.maybeBroadcastWatch(t),function(){n.watches.delete(t)&&!n.watches.size&&vs(n),n.maybeBroadcastWatch.forget(t)}},e.prototype.gc=function(t){rt.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(G(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=m(m({},t),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(t,this.data)}finally{!--this.txCount&&t.broadcast!==!1&&this.broadcastWatches()}},e.prototype.reset=function(t){var n=this;return this.init(),rt.reset(),t&&t.discardWatches?(this.watches.forEach(function(i){return n.maybeBroadcastWatch.forget(i)}),this.watches.clear(),vs(this)):this.broadcastWatches(),Promise.resolve()},e.prototype.removeOptimistic=function(t){var n=this.optimisticData.removeLayer(t);n!==this.optimisticData&&(this.optimisticData=n,this.broadcastWatches())},e.prototype.batch=function(t){var n=this,i=t.update,a=t.optimistic,o=a===void 0?!0:a,s=t.removeOptimistic,u=t.onWatchUpdated,l,p=function(h){var d=n,y=d.data,g=d.optimisticData;++n.txCount,h&&(n.data=n.optimisticData=h);try{return l=i(n)}finally{--n.txCount,n.data=y,n.optimisticData=g}},f=new Set;return u&&!this.txCount&&this.broadcastWatches(m(m({},t),{onWatchUpdated:function(h){return f.add(h),!1}})),typeof o=="string"?this.optimisticData=this.optimisticData.addLayer(o,p):o===!1?p(this.data):p(),typeof s=="string"&&(this.optimisticData=this.optimisticData.removeLayer(s)),u&&f.size?(this.broadcastWatches(m(m({},t),{onWatchUpdated:function(h,d){var y=u.call(this,h,d);return y!==!1&&f.delete(h),y}})),f.size&&f.forEach(function(h){return n.maybeBroadcastWatch.dirty(h)})):this.broadcastWatches(t),l},e.prototype.performTransaction=function(t,n){return this.batch({update:t,optimistic:n||n!==null})},e.prototype.transformDocument=function(t){if(this.addTypename){var n=this.typenameDocumentCache.get(t);return n||(n=Er(t),this.typenameDocumentCache.set(t,n),this.typenameDocumentCache.set(n,n)),n}return t},e.prototype.transformForLink=function(t){var n=this.config.fragments;return n?n.transform(t):t},e.prototype.broadcastWatches=function(t){var n=this;this.txCount||this.watches.forEach(function(i){return n.maybeBroadcastWatch(i,t)})},e.prototype.broadcastWatch=function(t,n){var i=t.lastDiff,a=this.diff(t);n&&(t.optimistic&&typeof n.optimistic=="string"&&(a.fromOptimisticTransaction=!0),n.onWatchUpdated&&n.onWatchUpdated.call(this,t,a,i)===!1)||(!i||!pe(i.result,a.result))&&t.callback(t.lastDiff=a,i)},e}(ps);function Il(r){return r.hasOwnProperty("graphQLErrors")}var Td=function(r){var e="";if(Te(r.graphQLErrors)||Te(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},
|
|
52
|
-
Did you mean to call refetch(variables) instead of refetch({ variables })?`))}return t&&!ue(this.options.variables,t)&&(i.variables=this.options.variables=m(m({},this.options.variables),t)),this.queryInfo.resetLastWrite(),this.reobserve(i,te.refetch)},e.prototype.fetchMore=function(t){var n=this,i=m(m({},t.query?t:m(m(m(m({},this.options),{query:this.query}),t),{variables:m(m({},this.options.variables),t.variables)})),{fetchPolicy:"no-cache"}),a=this.queryManager.generateQueryId(),o=this.queryInfo,s=o.networkStatus;o.networkStatus=te.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var u=new Set;return this.queryManager.fetchQuery(a,i,te.fetchMore).then(function(l){return n.queryManager.removeQuery(a),o.networkStatus===te.fetchMore&&(o.networkStatus=s),n.queryManager.cache.batch({update:function(p){var f=t.updateQuery;f?p.updateQuery({query:n.query,variables:n.variables,returnPartialData:!0,optimistic:!1},function(h){return f(h,{fetchMoreResult:l.data,variables:i.variables})}):p.writeQuery({query:i.query,variables:i.variables,data:l.data})},onWatchUpdated:function(p){u.add(p.query)}}),l}).finally(function(){u.has(n.query)||Os(n)})},e.prototype.subscribeToMore=function(t){var n=this,i=this.queryManager.startGraphQLSubscription({query:t.document,variables:t.variables,context:t.context}).subscribe({next:function(a){var o=t.updateQuery;o&&n.updateQuery(function(s,u){var l=u.variables;return o(s,{subscriptionData:a,variables:l})})},error:function(a){if(t.onError){t.onError(a);return}__DEV__&&T.error("Unhandled GraphQL subscription error",a)}});return this.subscriptions.add(i),function(){n.subscriptions.delete(i)&&i.unsubscribe()}},e.prototype.setOptions=function(t){return this.reobserve(t)},e.prototype.setVariables=function(t){return ue(this.variables,t)?this.observers.size?this.result():Promise.resolve():(this.options.variables=t,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:t},te.setVariables):Promise.resolve())},e.prototype.updateQuery=function(t){var n=this.queryManager,i=n.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,a=t(i,{variables:this.variables});a&&(n.cache.writeQuery({query:this.options.query,data:a,variables:this.variables}),n.broadcastQueries())},e.prototype.startPolling=function(t){this.options.pollInterval=t,this.updatePolling()},e.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},e.prototype.applyNextFetchPolicy=function(t,n){if(n.nextFetchPolicy){var i=n.fetchPolicy,a=i===void 0?"cache-first":i,o=n.initialFetchPolicy,s=o===void 0?a:o;a==="standby"||(typeof n.nextFetchPolicy=="function"?n.fetchPolicy=n.nextFetchPolicy(a,{reason:t,options:n,observable:this,initialFetchPolicy:s}):t==="variables-changed"?n.fetchPolicy=s:n.fetchPolicy=n.nextFetchPolicy)}return n.fetchPolicy},e.prototype.fetch=function(t,n){return this.queryManager.setObservableQuery(this),this.queryManager.fetchQueryObservable(this.queryId,t,n)},e.prototype.updatePolling=function(){var t=this;if(!this.queryManager.ssrMode){var n=this,i=n.pollingInfo,a=n.options.pollInterval;if(!a){i&&(clearTimeout(i.timeout),delete this.pollingInfo);return}if(!(i&&i.interval===a)){__DEV__?T(a,"Attempted to start a polling query without a polling interval."):T(a,13);var o=i||(this.pollingInfo={});o.interval=a;var s=function(){t.pollingInfo&&(er(t.queryInfo.networkStatus)?u():t.reobserve({fetchPolicy:t.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},te.poll).then(u,u))},u=function(){var l=t.pollingInfo;l&&(clearTimeout(l.timeout),l.timeout=setTimeout(s,l.interval))};u()}}},e.prototype.updateLastResult=function(t,n){return n===void 0&&(n=this.variables),this.last=m(m({},this.last),{result:this.queryManager.assumeImmutableResults?t:Vi(t),variables:n}),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,u=Jt(this.options,t||{}),l=a?u:Td(this.options,u);a||(this.updatePolling(),t&&t.variables&&!ue(t.variables,o)&&l.fetchPolicy!=="standby"&&l.fetchPolicy===s&&(this.applyNextFetchPolicy("variables-changed",l),n===void 0&&(n=te.setVariables)));var p=l.variables&&m({},l.variables),f=this.fetch(l,n),h={next:function(d){i.reportResult(d,p)},error:function(d){i.reportError(d,p)}};return a||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=f,this.observer=h),f.addObserver(h),f.promise},e.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},e.prototype.reportResult=function(t,n){var i=this.getLastError();(i||this.isDifferentFromLastResult(t,n))&&((i||!t.partial||this.options.returnPartialData)&&this.updateLastResult(t,n),xr(this.observers,"next",t))},e.prototype.reportError=function(t,n){var i=m(m({},this.getLastResult()),{error:t,errors:t.graphQLErrors,networkStatus:te.error,loading:!1});this.updateLastResult(i,n),xr(this.observers,"error",this.last.error=t)},e.prototype.hasObservers=function(){return this.observers.size>0},e.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach(function(t){return t.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},e}(Q);Wi(pa);function Os(r){var e=r.options,t=e.fetchPolicy,n=e.nextFetchPolicy;return t==="cache-and-network"||t==="network-only"?r.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(){return this.nextFetchPolicy=n,typeof n=="function"?n.apply(this,arguments):t}}):r.reobserve()}function Id(r){__DEV__&&T.error("Unhandled error",r.message,r.stack)}function Ts(r){__DEV__&&r&&__DEV__&&T.debug("Missing cache result fields: ".concat(JSON.stringify(r)),r)}var 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=Uo(t.resolvers,n)}):this.resolvers=Uo(this.resolvers,e)},r.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},r.prototype.getResolvers=function(){return this.resolvers||{}},r.prototype.runResolvers=function(e){var t=e.document,n=e.remoteResult,i=e.context,a=e.variables,o=e.onlyRunForcedResolvers,s=o===void 0?!1:o;return lt(this,void 0,void 0,function(){return pt(this,function(u){return t?[2,this.resolveDocument(t,n.data,i,a,this.fragmentMatcher,s).then(function(l){return m(m({},n),{data:l.result})})]:[2,n]})})},r.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},r.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},r.prototype.clientQuery=function(e){return Zr(["client"],e)&&this.resolvers?e:null},r.prototype.serverQuery=function(e){return jo(e)},r.prototype.prepareContext=function(e){var t=this.cache;return m(m({},e),{cache:t,getCacheKey:function(n){return t.identify(n)}})},r.prototype.addExportedVariables=function(e,t,n){return t===void 0&&(t={}),n===void 0&&(n={}),lt(this,void 0,void 0,function(){return pt(this,function(i){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(n),t).then(function(a){return m(m({},t),a.exportedVariables)})]:[2,m({},t)]})})},r.prototype.shouldForceResolvers=function(e){var t=!1;return Me(e,{Directive:{enter:function(n){if(n.name.value==="client"&&n.arguments&&(t=n.arguments.some(function(i){return i.name.value==="always"&&i.value.kind==="BooleanValue"&&i.value.value===!0}),t))return vr}}}),t},r.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:Mo(e),variables:t,returnPartialData:!0,optimistic:!1}).result},r.prototype.resolveDocument=function(e,t,n,i,a,o){return n===void 0&&(n={}),i===void 0&&(i={}),a===void 0&&(a=function(){return!0}),o===void 0&&(o=!1),lt(this,void 0,void 0,function(){var s,u,l,p,f,h,d,y,g,C,_;return pt(this,function(b){return s=wr(e),u=Sr(e),l=br(u),p=this.collectSelectionsToResolve(s,l),f=s.operation,h=f?f.charAt(0).toUpperCase()+f.slice(1):"Query",d=this,y=d.cache,g=d.client,C={fragmentMap:l,context:m(m({},n),{cache:y,client:g}),variables:i,fragmentMatcher:a,defaultOperationType:h,exportedVariables:{},selectionsToResolve:p,onlyRunForcedResolvers:o},_=!1,[2,this.resolveSelectionSet(s.selectionSet,_,t,C).then(function(S){return{result:S,exportedVariables:C.exportedVariables}})]})})},r.prototype.resolveSelectionSet=function(e,t,n,i){return lt(this,void 0,void 0,function(){var a,o,s,u,l,p=this;return pt(this,function(f){return a=i.fragmentMap,o=i.context,s=i.variables,u=[n],l=function(h){return lt(p,void 0,void 0,function(){var d,y;return pt(this,function(g){return!t&&!i.selectionsToResolve.has(h)?[2]:Dt(h,s)?et(h)?[2,this.resolveField(h,t,n,i).then(function(C){var _;typeof C<"u"&&u.push((_={},_[at(h)]=C,_))})]:(Ro(h)?d=h:(d=a[h.name.value],__DEV__?T(d,"No fragment named ".concat(h.name.value)):T(d,11)),d&&d.typeCondition&&(y=d.typeCondition.name.value,i.fragmentMatcher(n,y,o))?[2,this.resolveSelectionSet(d.selectionSet,t,n,i).then(function(C){u.push(C)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(l)).then(function(){return Qn(u)})]})})},r.prototype.resolveField=function(e,t,n,i){return lt(this,void 0,void 0,function(){var a,o,s,u,l,p,f,h,d,y=this;return pt(this,function(g){return n?(a=i.variables,o=e.name.value,s=at(e),u=o!==s,l=n[s]||n[o],p=Promise.resolve(l),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(f=n.__typename||i.defaultOperationType,h=this.resolvers&&this.resolvers[f],h&&(d=h[u?o:s],d&&(p=Promise.resolve(pn.withValue(this.cache,d,[n,Nt(e,a),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,p.then(function(C){var _,b;if(C===void 0&&(C=l),e.directives&&e.directives.forEach(function(O){O.name.value==="export"&&O.arguments&&O.arguments.forEach(function(k){k.name.value==="as"&&k.value.kind==="StringValue"&&(i.exportedVariables[k.value.value]=C)})}),!e.selectionSet||C==null)return C;var S=(b=(_=e.directives)===null||_===void 0?void 0:_.some(function(O){return O.name.value==="client"}))!==null&&b!==void 0?b:!1;if(Array.isArray(C))return y.resolveSubSelectedArray(e,t||S,C,i);if(e.selectionSet)return y.resolveSelectionSet(e.selectionSet,t||S,C,i)})]):[2,null]})})},r.prototype.resolveSubSelectedArray=function(e,t,n,i){var a=this;return Promise.all(n.map(function(o){if(o===null)return null;if(Array.isArray(o))return a.resolveSubSelectedArray(e,t,o,i);if(e.selectionSet)return a.resolveSelectionSet(e.selectionSet,t,o,i)}))},r.prototype.collectSelectionsToResolve=function(e,t){var n=function(o){return!Array.isArray(o)},i=this.selectionsToResolveCache;function a(o){if(!i.has(o)){var s=new Set;i.set(o,s),Me(o,{Directive:function(u,l,p,f,h){u.name.value==="client"&&h.forEach(function(d){n(d)&&jn(d)&&s.add(d)})},FragmentSpread:function(u,l,p,f,h){var d=t[u.name.value];__DEV__?T(d,"No fragment named ".concat(u.name.value)):T(d,12);var y=a(d);y.size>0&&(h.forEach(function(g){n(g)&&jn(g)&&s.add(g)}),s.add(u),y.forEach(function(g){s.add(g)}))}})}return i.get(o)}return a(e)},r}();var dn=new(ot?WeakMap:Map);function As(r,e){var t=r[e];typeof t=="function"&&(r[e]=function(){return dn.set(r,(dn.get(r)+1)%1e15),t.apply(this,arguments)})}function Il(r){r.notifyTimeout&&(clearTimeout(r.notifyTimeout),r.notifyTimeout=void 0)}var da=function(){function r(e,t){t===void 0&&(t=e.generateQueryId()),this.queryId=t,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=e.cache;dn.has(n)||(dn.set(n,0),As(n,"evict"),As(n,"modify"),As(n,"reset"))}return r.prototype.init=function(e){var t=e.networkStatus||te.loading;return this.variables&&this.networkStatus!==te.loading&&!ue(this.variables,e.variables)&&(t=te.setVariables),ue(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},r.prototype.reset=function(){Il(this),this.dirty=!1},r.prototype.getDiff=function(e){e===void 0&&(e=this.variables);var t=this.getDiffOptions(e);if(this.lastDiff&&ue(t,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=e);var n=this.observableQuery;if(n&&n.options.fetchPolicy==="no-cache")return{complete:!1};var i=this.cache.diff(t);return this.updateLastDiff(i,t),i},r.prototype.updateLastDiff=function(e,t){this.lastDiff=e?{diff:e,options:t||this.getDiffOptions()}:void 0},r.prototype.getDiffOptions=function(e){var t;return e===void 0&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:(t=this.observableQuery)===null||t===void 0?void 0:t.options.canonizeResults}},r.prototype.setDiff=function(e){var t=this,n=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),!this.dirty&&!ue(n&&n.result,e&&e.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return t.notify()},0)))},r.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){var n=t.getDiff();n.fromOptimisticTransaction?e.observe():Os(e)})):delete this.oqListener)},r.prototype.notify=function(){var e=this;Il(this),this.shouldNotify()&&this.listeners.forEach(function(t){return t(e)}),this.dirty=!1},r.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(er(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if(e!=="cache-only"&&e!=="cache-and-network")return!1}return!0},r.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=r.prototype.cancel,this.subscriptions.forEach(function(t){return t.unsubscribe()});var e=this.observableQuery;e&&e.stopPolling()}},r.prototype.cancel=function(){},r.prototype.updateWatch=function(e){var t=this;e===void 0&&(e=this.variables);var n=this.observableQuery;if(!(n&&n.options.fetchPolicy==="no-cache")){var i=m(m({},this.getDiffOptions(e)),{watcher:this,callback:function(a){return t.setDiff(a)}});(!this.lastWatch||!ue(i,this.lastWatch))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=i))}},r.prototype.resetLastWrite=function(){this.lastWrite=void 0},r.prototype.shouldWrite=function(e,t){var n=this.lastWrite;return!(n&&n.dmCount===dn.get(this.cache)&&ue(t,n.variables)&&ue(e.data,n.result.data))},r.prototype.markResult=function(e,t,n,i){var a=this,o=new ze,s=Oe(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Oe(e.incremental)){var u=Gi(this.getDiff().result,e);e.data=u}else if("hasNext"in e&&e.hasNext){var l=this.getDiff();e.data=o.merge(l.result,e.data)}this.graphQLErrors=s,n.fetchPolicy==="no-cache"?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):i!==0&&(ha(e,n.errorPolicy)?this.cache.performTransaction(function(p){if(a.shouldWrite(e,n.variables))p.writeQuery({query:t,data:e.data,variables:n.variables,overwrite:i===1}),a.lastWrite={result:e,variables:n.variables,dmCount:dn.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){e.data=a.lastDiff.diff.result;return}var f=a.getDiffOptions(n.variables),h=p.diff(f);a.stopped||a.updateWatch(n.variables),a.updateLastDiff(h,f),h.complete&&(e.data=h.result)}):this.lastWrite=void 0)},r.prototype.markReady=function(){return this.networkError=null,this.networkStatus=te.ready},r.prototype.markError=function(e){return this.networkStatus=te.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},r}();function ha(r,e){e===void 0&&(e="none");var t=e==="ignore"||e==="all",n=!on(r);return!n&&t&&r.data&&(n=!0),n}var kd=Object.prototype.hasOwnProperty,kl=function(){function r(e){var t=e.cache,n=e.link,i=e.defaultOptions,a=e.queryDeduplication,o=a===void 0?!1:a,s=e.onBroadcast,u=e.ssrMode,l=u===void 0?!1:u,p=e.clientAwareness,f=p===void 0?{}:p,h=e.localState,d=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(ot?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=t,this.link=n,this.defaultOptions=i||Object.create(null),this.queryDeduplication=o,this.clientAwareness=f,this.localState=h||new fa({cache:t}),this.ssrMode=l,this.assumeImmutableResults=!!d,(this.onBroadcast=s)&&(this.mutationStore=Object.create(null))}return r.prototype.stop=function(){var e=this;this.queries.forEach(function(t,n){e.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(__DEV__?new U("QueryManager stopped while query was in flight"):new U(14))},r.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(t){return t(e)}),this.fetchCancelFns.clear()},r.prototype.mutate=function(e){var t,n,i=e.mutation,a=e.variables,o=e.optimisticResponse,s=e.updateQueries,u=e.refetchQueries,l=u===void 0?[]:u,p=e.awaitRefetchQueries,f=p===void 0?!1:p,h=e.update,d=e.onQueryUpdated,y=e.fetchPolicy,g=y===void 0?((t=this.defaultOptions.mutate)===null||t===void 0?void 0:t.fetchPolicy)||"network-only":y,C=e.errorPolicy,_=C===void 0?((n=this.defaultOptions.mutate)===null||n===void 0?void 0:n.errorPolicy)||"none":C,b=e.keepRootFields,S=e.context;return lt(this,void 0,void 0,function(){var O,k,N,I,R,re;return pt(this,function(ee){switch(ee.label){case 0:return __DEV__?T(i,"mutation option is required. You must specify your GraphQL document in the mutation option."):T(i,15),__DEV__?T(g==="network-only"||g==="no-cache","Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):T(g==="network-only"||g==="no-cache",16),O=this.generateMutationId(),k=this.transform(i),N=k.document,I=k.hasClientExports,i=this.cache.transformForLink(N),a=this.getVariables(i,a),I?[4,this.localState.addExportedVariables(i,a,S)]:[3,2];case 1:a=ee.sent(),ee.label=2;case 2:return R=this.mutationStore&&(this.mutationStore[O]={mutation:i,variables:a,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:O,document:i,variables:a,fetchPolicy:g,errorPolicy:_,context:S,updateQueries:s,update:h,keepRootFields:b}),this.broadcastQueries(),re=this,[2,new Promise(function(vt,It){return Qi(re.getObservableFromLink(i,m(m({},S),{optimisticResponse:o}),a,!1),function(ke){if(on(ke)&&_==="none")throw new Pt({graphQLErrors:Ki(ke)});R&&(R.loading=!1,R.error=null);var B=m({},ke);return typeof l=="function"&&(l=l(B)),_==="ignore"&&on(B)&&delete B.errors,re.markMutationResult({mutationId:O,result:B,document:i,variables:a,fetchPolicy:g,errorPolicy:_,context:S,update:h,updateQueries:s,awaitRefetchQueries:f,refetchQueries:l,removeOptimistic:o?O:void 0,onQueryUpdated:d,keepRootFields:b})}).subscribe({next:function(ke){re.broadcastQueries(),(!("hasNext"in ke)||ke.hasNext===!1)&&vt(ke)},error:function(ke){R&&(R.loading=!1,R.error=ke),o&&re.cache.removeOptimistic(O),re.broadcastQueries(),It(ke instanceof Pt?ke:new Pt({networkError:ke}))}})})]}})})},r.prototype.markMutationResult=function(e,t){var n=this;t===void 0&&(t=this.cache);var i=e.result,a=[],o=e.fetchPolicy==="no-cache";if(!o&&ha(i,e.errorPolicy)){if(Ht(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),Ht(i)&&Oe(i.incremental)){var s=t.diff({id:"ROOT_MUTATION",query:this.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),u=void 0;s.result&&(u=Gi(s.result,i)),typeof u<"u"&&(i.data=u,a.push({result:u,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var l=e.updateQueries;l&&this.queries.forEach(function(f,h){var d=f.observableQuery,y=d&&d.queryName;if(!(!y||!kd.call(l,y))){var g=l[y],C=n.queries.get(h),_=C.document,b=C.variables,S=t.diff({query:_,variables:b,returnPartialData:!0,optimistic:!1}),O=S.result,k=S.complete;if(k&&O){var N=g(O,{mutationResult:i,queryName:_&&tn(_)||void 0,queryVariables:b});N&&a.push({result:N,dataId:"ROOT_QUERY",query:_,variables:b})}}})}if(a.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var p=[];if(this.refetchQueries({updateCache:function(f){o||a.forEach(function(g){return f.write(g)});var h=e.update,d=!du(i)||Ht(i)&&!i.hasNext;if(h){if(!o){var y=f.diff({id:"ROOT_MUTATION",query:n.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});y.complete&&(i=m(m({},i),{data:y.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}d&&h(f,i,{context:e.context,variables:e.variables})}!o&&!e.keepRootFields&&d&&f.modify({id:"ROOT_MUTATION",fields:function(g,C){var _=C.fieldName,b=C.DELETE;return _==="__typename"?g:b}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(f){return p.push(f)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(p).then(function(){return i})}return Promise.resolve(i)},r.prototype.markMutationOptimistic=function(e,t){var n=this,i=typeof e=="function"?e(t.variables):e;return this.cache.recordOptimisticTransaction(function(a){try{n.markMutationResult(m(m({},t),{result:{data:i}}),a)}catch(o){__DEV__&&T.error(o)}},t.mutationId)},r.prototype.fetchQuery=function(e,t,n){return this.fetchQueryObservable(e,t,n).promise},r.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(t,n){e[n]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}}),e},r.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},r.prototype.transform=function(e){var t=this.transformCache;if(!t.has(e)){var n=this.cache.transformDocument(e),i=$o(n),a=this.localState.clientQuery(n),o=i&&this.localState.serverQuery(i),s={document:n,hasClientExports:ko(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:a,serverQuery:o,defaultVars:_r(_t(n)),asQuery:m(m({},n),{definitions:n.definitions.map(function(l){return l.kind==="OperationDefinition"&&l.operation!=="query"?m(m({},l),{operation:"query"}):l})})},u=function(l){l&&!t.has(l)&&t.set(l,s)};u(e),u(n),u(a),u(o)}return t.get(e)},r.prototype.getVariables=function(e,t){return m(m({},this.transform(e).defaultVars),t)},r.prototype.watchQuery=function(e){e=m(m({},e),{variables:this.getVariables(e.query,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var t=new da(this),n=new 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 U("Store reset while query was in flight (not completed in link chain)"):new U(21)),this.queries.forEach(function(t){t.observableQuery?t.networkStatus=te.loading:t.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},r.prototype.getObservableQueries=function(e){var t=this;e===void 0&&(e="active");var n=new Map,i=new Map,a=new Set;return Array.isArray(e)&&e.forEach(function(o){typeof o=="string"?i.set(o,!1):No(o)?i.set(t.transform(o).document,!1):z(o)&&o.query&&a.add(o)}),this.queries.forEach(function(o,s){var u=o.observableQuery,l=o.document;if(u){if(e==="all"){n.set(s,u);return}var p=u.queryName,f=u.options.fetchPolicy;if(f==="standby"||e==="active"&&!u.hasObservers())return;(e==="active"||p&&i.has(p)||l&&i.has(l))&&(n.set(s,u),p&&i.set(p,!0),l&&i.set(l,!0))}}),a.size&&a.forEach(function(o){var s=Kn("legacyOneTimeQuery"),u=t.getQuery(s).init({document:o.query,variables:o.variables}),l=new pa({queryManager:t,queryInfo:u,options:m(m({},o),{fetchPolicy:"network-only"})});T(l.queryId===s),u.setObservableQuery(l),n.set(s,l)}),__DEV__&&i.size&&i.forEach(function(o,s){o||__DEV__&&T.warn("Unknown query ".concat(typeof s=="string"?"named ":"").concat(JSON.stringify(s,null,2)," requested in refetchQueries options.include array"))}),n},r.prototype.reFetchObservableQueries=function(e){var t=this;e===void 0&&(e=!1);var n=[];return this.getObservableQueries(e?"all":"active").forEach(function(i,a){var o=i.options.fetchPolicy;i.resetLastResults(),(e||o!=="standby"&&o!=="cache-only")&&n.push(i.refetch()),t.getQuery(a).setDiff(null)}),this.broadcastQueries(),Promise.all(n)},r.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},r.prototype.startGraphQLSubscription=function(e){var t=this,n=e.query,i=e.fetchPolicy,a=e.errorPolicy,o=e.variables,s=e.context,u=s===void 0?{}:s;n=this.transform(n).document,o=this.getVariables(n,o);var l=function(f){return t.getObservableFromLink(n,u,f).map(function(h){if(i!=="no-cache"&&(ha(h,a)&&t.cache.write({query:n,result:h.data,dataId:"ROOT_SUBSCRIPTION",variables:f}),t.broadcastQueries()),on(h))throw new Pt({graphQLErrors:h.errors});return h})};if(this.transform(n).hasClientExports){var p=this.localState.addExportedVariables(n,o,u).then(l);return new Q(function(f){var h=null;return p.then(function(d){return h=d.subscribe(f)},f.error),function(){return h&&h.unsubscribe()}})}return l(o)},r.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},r.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},r.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},r.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){return e.notify()})},r.prototype.getLocalState=function(){return this.localState},r.prototype.getObservableFromLink=function(e,t,n,i){var a=this,o;i===void 0&&(i=(o=t?.queryDeduplication)!==null&&o!==void 0?o:this.queryDeduplication);var s,u=this.transform(e).serverQuery;if(u){var l=this,p=l.inFlightLinkObservables,f=l.link,h={query:u,variables:n,operationName:tn(u)||void 0,context:this.prepareContext(m(m({},t),{forceFetch:!i}))};if(t=h.context,i){var d=p.get(u)||new Map;p.set(u,d);var y=tt(n);if(s=d.get(y),!s){var g=new an([sn(f,h)]);d.set(y,s=g),g.beforeNext(function(){d.delete(y)&&d.size<1&&p.delete(u)})}}else s=new an([sn(f,h)])}else s=new an([Q.of({data:{}})]),t=this.prepareContext(t);var C=this.transform(e).clientQuery;return C&&(s=Qi(s,function(_){return a.localState.runResolvers({document:C,remoteResult:_,context:t,variables:n})})),s},r.prototype.getResultsFromLink=function(e,t,n){var i=e.lastRequestId=this.generateRequestId(),a=this.cache.transformForLink(this.transform(e.document).document);return Qi(this.getObservableFromLink(a,n.context,n.variables),function(o){var s=Ki(o),u=s.length>0;if(i>=e.lastRequestId){if(u&&n.errorPolicy==="none")throw e.markError(new Pt({graphQLErrors:s}));e.markResult(o,a,n,t),e.markReady()}var l={data:o.data,loading:!1,networkStatus:te.ready};return u&&n.errorPolicy!=="ignore"&&(l.errors=s,l.networkStatus=te.error),l},function(o){var s=Al(o)?o:new Pt({networkError:o});throw i>=e.lastRequestId&&e.markError(s),s})},r.prototype.fetchQueryObservable=function(e,t,n){var i=this;n===void 0&&(n=te.loading);var a=this.transform(t.query).document,o=this.getVariables(a,t.variables),s=this.getQuery(e),u=this.defaultOptions.watchQuery,l=t.fetchPolicy,p=l===void 0?u&&u.fetchPolicy||"cache-first":l,f=t.errorPolicy,h=f===void 0?u&&u.errorPolicy||"none":f,d=t.returnPartialData,y=d===void 0?!1:d,g=t.notifyOnNetworkStatusChange,C=g===void 0?!1:g,_=t.context,b=_===void 0?{}:_,S=Object.assign({},t,{query:a,variables:o,fetchPolicy:p,errorPolicy:h,returnPartialData:y,notifyOnNetworkStatusChange:C,context:b}),O=function(I){S.variables=I;var R=i.fetchQueryByPolicy(s,S,n);return S.fetchPolicy!=="standby"&&R.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",t),R},k=function(){return i.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,function(I){k(),setTimeout(function(){return N.cancel(I)})});var N=new an(this.transform(S.query).hasClientExports?this.localState.addExportedVariables(S.query,S.variables,S.context).then(O):O(S.variables));return N.promise.then(k,k),N},r.prototype.refetchQueries=function(e){var t=this,n=e.updateCache,i=e.include,a=e.optimistic,o=a===void 0?!1:a,s=e.removeOptimistic,u=s===void 0?o?Kn("refetchQueries"):void 0:s,l=e.onQueryUpdated,p=new Map;i&&this.getObservableQueries(i).forEach(function(h,d){p.set(d,{oq:h,lastDiff:t.getQuery(d).getDiff()})});var f=new Map;return n&&this.cache.batch({update:n,optimistic:o&&u||!1,removeOptimistic:u,onWatchUpdated:function(h,d,y){var g=h.watcher instanceof da&&h.watcher.observableQuery;if(g){if(l){p.delete(g.queryId);var C=l(g,d,y);return C===!0&&(C=g.refetch()),C!==!1&&f.set(g,C),C}l!==null&&p.set(g.queryId,{oq:g,lastDiff:y,diff:d})}}}),p.size&&p.forEach(function(h,d){var y=h.oq,g=h.lastDiff,C=h.diff,_;if(l){if(!C){var b=y.queryInfo;b.reset(),C=b.getDiff()}_=l(y,C,g)}(!l||_===!0)&&(_=y.refetch()),_!==!1&&f.set(y,_),d.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(d)}),u&&this.cache.removeOptimistic(u),f},r.prototype.fetchQueryByPolicy=function(e,t,n){var i=this,a=t.query,o=t.variables,s=t.fetchPolicy,u=t.refetchWritePolicy,l=t.errorPolicy,p=t.returnPartialData,f=t.context,h=t.notifyOnNetworkStatusChange,d=e.networkStatus;e.init({document:this.transform(a).document,variables:o,networkStatus:n});var y=function(){return e.getDiff(o)},g=function(O,k){k===void 0&&(k=e.networkStatus||te.loading);var N=O.result;__DEV__&&!p&&!ue(N,{})&&Ts(O.missing);var I=function(R){return Q.of(m({data:R,loading:er(k),networkStatus:k},O.complete?null:{partial:!0}))};return N&&i.transform(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:N},context:f,variables:o,onlyRunForcedResolvers:!0}).then(function(R){return I(R.data||void 0)}):l==="none"&&k===te.refetch&&Array.isArray(O.missing)?I(void 0):I(N)},C=s==="no-cache"?0:n===te.refetch&&u!=="merge"?1:2,_=function(){return i.getResultsFromLink(e,C,{variables:o,context:f,fetchPolicy:s,errorPolicy:l})},b=h&&typeof d=="number"&&d!==n&&er(n);switch(s){default:case"cache-first":{var S=y();return S.complete?[g(S,e.markReady())]:p||b?[g(S),_()]:[_()]}case"cache-and-network":{var S=y();return S.complete||p||b?[g(S),_()]:[_()]}case"cache-only":return[g(y(),e.markReady())];case"network-only":return b?[g(y()),_()]:[_()];case"no-cache":return b?[g(e.getDiff()),_()]:[_()];case"standby":return[]}},r.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new da(this,e)),this.queries.get(e)},r.prototype.prepareContext=function(e){e===void 0&&(e={});var t=this.localState.prepareContext(e);return m(m({},t),{clientAwareness:this.clientAwareness})},r}();var Dl=!1;var Is=function(){function r(e){var t=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=e.uri,i=e.credentials,a=e.headers,o=e.cache,s=e.ssrMode,u=s===void 0?!1:s,l=e.ssrForceFetchDelay,p=l===void 0?0:l,f=e.connectToDevTools,h=f===void 0?typeof window=="object"&&!window.__APOLLO_CLIENT__&&__DEV__:f,d=e.queryDeduplication,y=d===void 0?!0:d,g=e.defaultOptions,C=e.assumeImmutableResults,_=C===void 0?!1:C,b=e.resolvers,S=e.typeDefs,O=e.fragmentMatcher,k=e.name,N=e.version,I=e.link;if(I||(I=n?new ns({uri:n,credentials:i,headers:a}):st.empty()),!o)throw __DEV__?new U(`To initialize Apollo Client, you must specify a 'cache' property in the options object.
|
|
53
|
-
For more information, please visit: https://go.apollo.dev/c/docs`):new U(9);if(this.link=I,this.cache=o,this.disableNetworkFetches=u||p>0,this.queryDeduplication=y,this.defaultOptions=g||Object.create(null),this.typeDefs=S,p&&setTimeout(function(){return t.disableNetworkFetches=!1},p),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),h&&typeof window=="object"&&(window.__APOLLO_CLIENT__=this),!Dl&&h&&__DEV__&&(Dl=!0,typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var R=window.navigator,re=R&&R.userAgent,ee=void 0;typeof re=="string"&&(re.indexOf("Chrome/")>-1?ee="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":re.indexOf("Firefox/")>-1&&(ee="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),ee&&__DEV__&&T.log("Download the Apollo DevTools for a better development experience: "+ee)}this.version=gu,this.localState=new fa({cache:o,client:this,resolvers:b,fragmentMatcher:O}),this.queryManager=new kl({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:y,ssrMode:u,clientAwareness:{name:k,version:N},localState:this.localState,assumeImmutableResults:_,onBroadcast:h?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return r.prototype.stop=function(){this.queryManager.stop()},r.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=zn(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=m(m({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},r.prototype.query=function(e){return this.defaultOptions.query&&(e=zn(this.defaultOptions.query,e)),__DEV__?T(e.fetchPolicy!=="cache-and-network","The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):T(e.fetchPolicy!=="cache-and-network",10),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=m(m({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},r.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=zn(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},r.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},r.prototype.readQuery=function(e,t){return t===void 0&&(t=!1),this.cache.readQuery(e,t)},r.prototype.readFragment=function(e,t){return t===void 0&&(t=!1),this.cache.readFragment(e,t)},r.prototype.writeQuery=function(e){var t=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),t},r.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),t},r.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},r.prototype.__requestRaw=function(e){return sn(this.link,e)},r.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(t){return t()}))}).then(function(){return e.reFetchObservableQueries()})},r.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(t){return t()}))})},r.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter(function(n){return n!==e})}},r.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter(function(n){return n!==e})}},r.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},r.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),n=[],i=[];t.forEach(function(o,s){n.push(s),i.push(o)});var a=Promise.all(i);return a.queries=n,a.results=i,a.catch(function(o){__DEV__&&T.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(o))}),a},r.prototype.getObservableQueries=function(e){return e===void 0&&(e="active"),this.queryManager.getObservableQueries(e)},r.prototype.extract=function(e){return this.cache.extract(e)},r.prototype.restore=function(e){return this.cache.restore(e)},r.prototype.addResolvers=function(e){this.localState.addResolvers(e)},r.prototype.setResolvers=function(e){this.localState.setResolvers(e)},r.prototype.getResolvers=function(){return this.localState.getResolvers()},r.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},r.prototype.setLink=function(e){this.link=this.queryManager.link=e},r}();Vc(gr?"log":"silent");function Ue(r){return r===null?"null":Array.isArray(r)?"array":typeof r}function Rt(r){return Ue(r)==="object"}function Nl(r){return Array.isArray(r)&&r.length>0&&r.every(e=>"message"in e)}function ks(r,e){return r.length<124?r:e}var Pl="graphql-transport-ws";var He;(function(r){r[r.InternalServerError=4500]="InternalServerError",r[r.InternalClientError=4005]="InternalClientError",r[r.BadRequest=4400]="BadRequest",r[r.BadResponse=4004]="BadResponse",r[r.Unauthorized=4401]="Unauthorized",r[r.Forbidden=4403]="Forbidden",r[r.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",r[r.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",r[r.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",r[r.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",r[r.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(He||(He={}));var be;(function(r){r.ConnectionInit="connection_init",r.ConnectionAck="connection_ack",r.Ping="ping",r.Pong="pong",r.Subscribe="subscribe",r.Next="next",r.Error="error",r.Complete="complete"})(be||(be={}));function Rl(r){if(!Rt(r))throw new Error(`Message is expected to be an object, but got ${Ue(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 ${Ue(r.type)}`);switch(r.type){case be.ConnectionInit:case be.ConnectionAck:case be.Ping:case be.Pong:{if(r.payload!=null&&!Rt(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${r.payload}"`);break}case be.Subscribe:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${Ue(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!Rt(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an object, but got ${Ue(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 ${Ue(r.payload.query)}`);if(r.payload.variables!=null&&!Rt(r.payload.variables))throw new Error(`"${r.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${Ue(r.payload.variables)}`);if(r.payload.operationName!=null&&Ue(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 ${Ue(r.payload.operationName)}`);if(r.payload.extensions!=null&&!Rt(r.payload.extensions))throw new Error(`"${r.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${Ue(r.payload.extensions)}`);break}case be.Next:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${Ue(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!Rt(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an object, but got ${Ue(r.payload)}`);break}case be.Error:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${Ue(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!Nl(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(r.payload)}`);break}case be.Complete:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${Ue(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${r.type}"`)}return r}function Ll(r,e){return Rl(typeof r=="string"?JSON.parse(r,e):r)}function hn(r,e){return Rl(r),JSON.stringify(r,e)}function Fl(r){let{url:e,connectionParams:t,lazy:n=!0,onNonLazyError:i=console.error,lazyCloseTimeout:a=0,keepAlive:o=0,disablePong:s,connectionAckWaitTimeout:u=0,retryAttempts:l=5,retryWait:p=async function(me){let oe=1e3;for(let G=0;G<me;G++)oe*=2;await new Promise(G=>setTimeout(G,oe+Math.floor(Math.random()*(3e3-300)+300)))},shouldRetry:f=ma,isFatalConnectionProblem:h,on:d,webSocketImpl:y,generateID:g=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,me=>{let oe=Math.random()*16|0;return(me=="x"?oe:oe&3|8).toString(16)})},jsonMessageReplacer:C,jsonMessageReviver:_}=r,b;if(y){if(!Nd(y))throw new Error("Invalid WebSocket implementation provided");b=y}else typeof WebSocket<"u"?b=WebSocket:typeof global<"u"?b=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(b=window.WebSocket||window.MozWebSocket);if(!b)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let S=b,O=(()=>{let B=(()=>{let oe={};return{on(G,K){return oe[G]=K,()=>{delete oe[G]}},emit(G){var K;"id"in G&&((K=oe[G.id])===null||K===void 0||K.call(oe,G))}}})(),me={connecting:d?.connecting?[d.connecting]:[],opened:d?.opened?[d.opened]:[],connected:d?.connected?[d.connected]:[],ping:d?.ping?[d.ping]:[],pong:d?.pong?[d.pong]:[],message:d?.message?[B.emit,d.message]:[B.emit],closed:d?.closed?[d.closed]:[],error:d?.error?[d.error]:[]};return{onMessage:B.on,on(oe,G){let K=me[oe];return K.push(G),()=>{K.splice(K.indexOf(G),1)}},emit(oe,...G){for(let K of[...me[oe]])K(...G)}}})();function k(B){let me=[O.on("error",oe=>{me.forEach(G=>G()),B(oe)}),O.on("closed",oe=>{me.forEach(G=>G()),B(oe)})]}let N,I=0,R,re=!1,ee=0,vt=!1;async function It(){clearTimeout(R);let[B,me]=await(N??(N=new Promise((K,bt)=>(async()=>{if(re){if(await p(ee),!I)return N=void 0,bt({code:1e3,reason:"All Subscriptions Gone"});ee++}O.emit("connecting");let V=new S(typeof e=="function"?await e():e,Pl),Ct,Ut;function Ti(){isFinite(o)&&o>0&&(clearTimeout(Ut),Ut=setTimeout(()=>{V.readyState===S.OPEN&&(V.send(hn({type:be.Ping})),O.emit("ping",!1,void 0))},o))}k(De=>{N=void 0,clearTimeout(Ct),clearTimeout(Ut),bt(De),ma(De)&&De.code===4499&&(V.close(4499,"Terminated"),V.onerror=null,V.onclose=null)}),V.onerror=De=>O.emit("error",De),V.onclose=De=>O.emit("closed",De),V.onopen=async()=>{try{O.emit("opened",V);let De=typeof t=="function"?await t():t;if(V.readyState!==S.OPEN)return;V.send(hn(De?{type:be.ConnectionInit,payload:De}:{type:be.ConnectionInit},C)),isFinite(u)&&u>0&&(Ct=setTimeout(()=>{V.close(He.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},u)),Ti()}catch(De){O.emit("error",De),V.close(He.InternalClientError,ks(De instanceof Error?De.message:new Error(De).message,"Internal client error"))}};let zr=!1;V.onmessage=({data:De})=>{try{let Ne=Ll(De,_);if(O.emit("message",Ne),Ne.type==="ping"||Ne.type==="pong"){O.emit(Ne.type,!0,Ne.payload),Ne.type==="pong"?Ti():s||(V.send(hn(Ne.payload?{type:be.Pong,payload:Ne.payload}:{type:be.Pong})),O.emit("pong",!1,Ne.payload));return}if(zr)return;if(Ne.type!==be.ConnectionAck)throw new Error(`First message cannot be of type ${Ne.type}`);clearTimeout(Ct),zr=!0,O.emit("connected",V,Ne.payload),re=!1,ee=0,K([V,new Promise((z1,xp)=>k(xp))])}catch(Ne){V.onmessage=null,O.emit("error",Ne),V.close(He.BadResponse,ks(Ne instanceof Error?Ne.message:new Error(Ne).message,"Bad response"))}}})())));B.readyState===S.CLOSING&&await me;let oe=()=>{},G=new Promise(K=>oe=K);return[B,oe,Promise.race([G.then(()=>{if(!I){let K=()=>B.close(1e3,"Normal Closure");isFinite(a)&&a>0?R=setTimeout(()=>{B.readyState===S.OPEN&&K()},a):K()}}),me])]}function ke(B){if(ma(B)&&(Dd(B.code)||[He.InternalServerError,He.InternalClientError,He.BadRequest,He.BadResponse,He.Unauthorized,He.SubprotocolNotAcceptable,He.SubscriberAlreadyExists,He.TooManyInitialisationRequests].includes(B.code)))throw B;if(vt)return!1;if(ma(B)&&B.code===1e3)return I>0;if(!l||ee>=l||!f(B)||h?.(B))throw B;return re=!0}return n||(async()=>{for(I++;;)try{let[,,B]=await It();await B}catch(B){try{if(!ke(B))return}catch(me){return i?.(me)}}})(),{on:O.on,subscribe(B,me){let oe=g(B),G=!1,K=!1,bt=()=>{I--,G=!0};return(async()=>{for(I++;;)try{let[V,Ct,Ut]=await It();if(G)return Ct();let Ti=O.onMessage(oe,zr=>{switch(zr.type){case be.Next:{me.next(zr.payload);return}case be.Error:{K=!0,G=!0,me.error(zr.payload),bt();return}case be.Complete:{G=!0,bt();return}}});V.send(hn({id:oe,type:be.Subscribe,payload:B},C)),bt=()=>{!G&&V.readyState===S.OPEN&&V.send(hn({id:oe,type:be.Complete},C)),I--,G=!0,Ct()},await Ut.finally(Ti);return}catch(V){if(!ke(V))return}})().then(()=>{K||me.complete()}).catch(V=>{me.error(V)}),()=>{G||bt()}},async dispose(){if(vt=!0,N){let[B]=await N;B.close(1e3,"Normal Closure")}},terminate(){N&&O.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}function ma(r){return Rt(r)&&"code"in r&&"reason"in r}function Dd(r){return[1e3,1001,1006,1005,1012,1013,1013].includes(r)?!1:r>=1e3&&r<=1999}function Nd(r){return typeof r=="function"&&"constructor"in r&&"CLOSED"in r&&"CLOSING"in r&&"CONNECTING"in r&&"OPEN"in r}function Pd(r){return z(r)&&"code"in r&&"reason"in r}var $l=function(r){ge(e,r);function e(t){var n=r.call(this)||this;return n.client=t,n}return e.prototype.request=function(t){var n=this;return new Q(function(i){return n.client.subscribe(m(m({},t),{query:Xr(t.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(a){return a instanceof Error?i.error(a):Pd(a)?i.error(new Error("Socket closed with event ".concat(a.code," ").concat(a.reason||""))):i.error(new Pt({graphQLErrors:Array.isArray(a)?a:[a]}))}})})},e}(st);var Ra=function(){return Ra=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Ra.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function wa(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?wa=function(t){return typeof t}:wa=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wa(r)}function Rd(r){return wa(r)=="object"&&r!==null}var op=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function $s(r,e){for(var t=/\r\n|[\n\r]/g,n=1,i=e+1,a;(a=t.exec(r.body))&&a.index<e;)n+=1,i=e+1-(a.index+a[0].length);return{line:n,column:i}}function Ld(r){return sp(r.source,$s(r.source,r.start))}function sp(r,e){var t=r.locationOffset.column-1,n=_a(t)+r.body,i=e.line-1,a=r.locationOffset.line-1,o=e.line+a,s=e.line===1?t:0,u=e.column+s,l="".concat(r.name,":").concat(o,":").concat(u,`
|
|
54
|
-
`),p=n.split(/\r\n|[\n\r]/g),f=p[i];if(f.length>120){for(var h=Math.floor(u/80),d=u%80,y=[],g=0;g<f.length;g+=80)y.push(f.slice(g,g+80));return l+
|
|
55
|
-
`)}function _a(r){return Array(r+1).join(" ")}function
|
|
51
|
+
`)),e=e.replace(/\n$/,""),e},Rt=function(r){be(e,r);function e(t){var n=t.graphQLErrors,i=t.clientErrors,a=t.networkError,o=t.errorMessage,s=t.extraInfo,u=r.call(this,o)||this;return u.name="ApolloError",u.graphQLErrors=n||[],u.clientErrors=i||[],u.networkError=a||null,u.message=o||Td(u),u.extraInfo=s,u.__proto__=e.prototype,u}return e}(Error);var te;(function(r){r[r.loading=1]="loading",r[r.setVariables=2]="setVariables",r[r.fetchMore=3]="fetchMore",r[r.refetch=4]="refetch",r[r.poll=6]="poll",r[r.ready=7]="ready",r[r.error=8]="error"})(te||(te={}));function er(r){return r?r<7:!1}var Ad=Object.assign,Id=Object.hasOwnProperty,pa=function(r){be(e,r);function e(t){var n=t.queryManager,i=t.queryInfo,a=t.options,o=r.call(this,function(C){try{var _=C._subscription._observer;_&&!_.error&&(_.error=kd)}catch{}var b=!o.observers.size;o.observers.add(C);var S=o.last;return S&&S.error?C.error&&C.error(S.error):S&&S.result&&C.next&&C.next(S.result),b&&o.reobserve().catch(function(){}),function(){o.observers.delete(C)&&!o.observers.size&&o.tearDownQuery()}})||this;o.observers=new Set,o.subscriptions=new Set,o.queryInfo=i,o.queryManager=n,o.isTornDown=!1;var s=n.defaultOptions.watchQuery,u=s===void 0?{}:s,l=u.fetchPolicy,p=l===void 0?"cache-first":l,f=a.fetchPolicy,h=f===void 0?p:f,d=a.initialFetchPolicy,y=d===void 0?h==="standby"?p:h:d;o.options=m(m({},a),{initialFetchPolicy:y,fetchPolicy:h}),o.queryId=i.queryId||n.generateQueryId();var g=Et(o.query);return o.queryName=g&&g.name&&g.name.value,o}return Object.defineProperty(e.prototype,"query",{get:function(){return this.queryManager.transform(this.options.query).document},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),e.prototype.result=function(){var t=this;return new Promise(function(n,i){var a={next:function(s){n(s),t.observers.delete(a),t.observers.size||t.queryManager.removeQuery(t.queryId),setTimeout(function(){o.unsubscribe()},0)},error:i},o=t.subscribe(a)})},e.prototype.getCurrentResult=function(t){t===void 0&&(t=!0);var n=this.getLastResult(!0),i=this.queryInfo.networkStatus||n&&n.networkStatus||te.ready,a=m(m({},n),{loading:er(i),networkStatus:i}),o=this.options.fetchPolicy,s=o===void 0?"cache-first":o;if(!(s==="network-only"||s==="no-cache"||s==="standby"||this.queryManager.transform(this.options.query).hasForcedResolvers)){var u=this.queryInfo.getDiff();(u.complete||this.options.returnPartialData)&&(a.data=u.result),pe(a.data,{})&&(a.data=void 0),u.complete?(delete a.partial,u.complete&&a.networkStatus===te.loading&&(s==="cache-first"||s==="cache-only")&&(a.networkStatus=te.ready,a.loading=!1)):a.partial=!0,__DEV__&&!u.complete&&!this.options.partialRefetch&&!a.loading&&!a.data&&!a.error&&Ts(u.missing)}return t&&this.updateLastResult(a),a},e.prototype.isDifferentFromLastResult=function(t,n){return!this.last||!pe(this.last.result,t)||n&&!pe(this.last.variables,n)},e.prototype.getLast=function(t,n){var i=this.last;if(i&&i[t]&&(!n||pe(i.variables,this.variables)))return i[t]},e.prototype.getLastResult=function(t){return this.getLast("result",t)},e.prototype.getLastError=function(t){return this.getLast("error",t)},e.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},e.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},e.prototype.refetch=function(t){var n,i={pollInterval:0},a=this.options.fetchPolicy;if(a==="cache-and-network"?i.fetchPolicy=a:a==="no-cache"?i.fetchPolicy="no-cache":i.fetchPolicy="network-only",__DEV__&&t&&Id.call(t,"variables")){var o=Vn(this.query),s=o.variableDefinitions;(!s||!s.some(function(u){return u.variable.name.value==="variables"}))&&__DEV__&&T.warn("Called refetch(".concat(JSON.stringify(t),") for query ").concat(((n=o.name)===null||n===void 0?void 0:n.value)||JSON.stringify(o),`, which does not declare a $variables variable.
|
|
52
|
+
Did you mean to call refetch(variables) instead of refetch({ variables })?`))}return t&&!pe(this.options.variables,t)&&(i.variables=this.options.variables=m(m({},this.options.variables),t)),this.queryInfo.resetLastWrite(),this.reobserve(i,te.refetch)},e.prototype.fetchMore=function(t){var n=this,i=m(m({},t.query?t:m(m(m(m({},this.options),{query:this.query}),t),{variables:m(m({},this.options.variables),t.variables)})),{fetchPolicy:"no-cache"}),a=this.queryManager.generateQueryId(),o=this.queryInfo,s=o.networkStatus;o.networkStatus=te.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var u=new Set;return this.queryManager.fetchQuery(a,i,te.fetchMore).then(function(l){return n.queryManager.removeQuery(a),o.networkStatus===te.fetchMore&&(o.networkStatus=s),n.queryManager.cache.batch({update:function(p){var f=t.updateQuery;f?p.updateQuery({query:n.query,variables:n.variables,returnPartialData:!0,optimistic:!1},function(h){return f(h,{fetchMoreResult:l.data,variables:i.variables})}):p.writeQuery({query:i.query,variables:i.variables,data:l.data})},onWatchUpdated:function(p){u.add(p.query)}}),l}).finally(function(){u.has(n.query)||Os(n)})},e.prototype.subscribeToMore=function(t){var n=this,i=this.queryManager.startGraphQLSubscription({query:t.document,variables:t.variables,context:t.context}).subscribe({next:function(a){var o=t.updateQuery;o&&n.updateQuery(function(s,u){var l=u.variables;return o(s,{subscriptionData:a,variables:l})})},error:function(a){if(t.onError){t.onError(a);return}__DEV__&&T.error("Unhandled GraphQL subscription error",a)}});return this.subscriptions.add(i),function(){n.subscriptions.delete(i)&&i.unsubscribe()}},e.prototype.setOptions=function(t){return this.reobserve(t)},e.prototype.setVariables=function(t){return pe(this.variables,t)?this.observers.size?this.result():Promise.resolve():(this.options.variables=t,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:t},te.setVariables):Promise.resolve())},e.prototype.updateQuery=function(t){var n=this.queryManager,i=n.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,a=t(i,{variables:this.variables});a&&(n.cache.writeQuery({query:this.options.query,data:a,variables:this.variables}),n.broadcastQueries())},e.prototype.startPolling=function(t){this.options.pollInterval=t,this.updatePolling()},e.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},e.prototype.applyNextFetchPolicy=function(t,n){if(n.nextFetchPolicy){var i=n.fetchPolicy,a=i===void 0?"cache-first":i,o=n.initialFetchPolicy,s=o===void 0?a:o;a==="standby"||(typeof n.nextFetchPolicy=="function"?n.fetchPolicy=n.nextFetchPolicy(a,{reason:t,options:n,observable:this,initialFetchPolicy:s}):t==="variables-changed"?n.fetchPolicy=s:n.fetchPolicy=n.nextFetchPolicy)}return n.fetchPolicy},e.prototype.fetch=function(t,n){return this.queryManager.setObservableQuery(this),this.queryManager.fetchQueryObservable(this.queryId,t,n)},e.prototype.updatePolling=function(){var t=this;if(!this.queryManager.ssrMode){var n=this,i=n.pollingInfo,a=n.options.pollInterval;if(!a){i&&(clearTimeout(i.timeout),delete this.pollingInfo);return}if(!(i&&i.interval===a)){__DEV__?T(a,"Attempted to start a polling query without a polling interval."):T(a,13);var o=i||(this.pollingInfo={});o.interval=a;var s=function(){t.pollingInfo&&(er(t.queryInfo.networkStatus)?u():t.reobserve({fetchPolicy:t.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},te.poll).then(u,u))},u=function(){var l=t.pollingInfo;l&&(clearTimeout(l.timeout),l.timeout=setTimeout(s,l.interval))};u()}}},e.prototype.updateLastResult=function(t,n){return n===void 0&&(n=this.variables),this.last=m(m({},this.last),{result:this.queryManager.assumeImmutableResults?t:Vi(t),variables:n}),Te(t.errors)||delete this.last.error,this.last},e.prototype.reobserve=function(t,n){var i=this;this.isTornDown=!1;var a=n===te.refetch||n===te.fetchMore||n===te.poll,o=this.options.variables,s=this.options.fetchPolicy,u=Jt(this.options,t||{}),l=a?u:Ad(this.options,u);a||(this.updatePolling(),t&&t.variables&&!pe(t.variables,o)&&l.fetchPolicy!=="standby"&&l.fetchPolicy===s&&(this.applyNextFetchPolicy("variables-changed",l),n===void 0&&(n=te.setVariables)));var p=l.variables&&m({},l.variables),f=this.fetch(l,n),h={next:function(d){i.reportResult(d,p)},error:function(d){i.reportError(d,p)}};return a||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=f,this.observer=h),f.addObserver(h),f.promise},e.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},e.prototype.reportResult=function(t,n){var i=this.getLastError();(i||this.isDifferentFromLastResult(t,n))&&((i||!t.partial||this.options.returnPartialData)&&this.updateLastResult(t,n),xr(this.observers,"next",t))},e.prototype.reportError=function(t,n){var i=m(m({},this.getLastResult()),{error:t,errors:t.graphQLErrors,networkStatus:te.error,loading:!1});this.updateLastResult(i,n),xr(this.observers,"error",this.last.error=t)},e.prototype.hasObservers=function(){return this.observers.size>0},e.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach(function(t){return t.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},e}(W);Wi(pa);function Os(r){var e=r.options,t=e.fetchPolicy,n=e.nextFetchPolicy;return t==="cache-and-network"||t==="network-only"?r.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(){return this.nextFetchPolicy=n,typeof n=="function"?n.apply(this,arguments):t}}):r.reobserve()}function kd(r){__DEV__&&T.error("Unhandled error",r.message,r.stack)}function Ts(r){__DEV__&&r&&__DEV__&&T.debug("Missing cache result fields: ".concat(JSON.stringify(r)),r)}var 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=Uo(t.resolvers,n)}):this.resolvers=Uo(this.resolvers,e)},r.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},r.prototype.getResolvers=function(){return this.resolvers||{}},r.prototype.runResolvers=function(e){var t=e.document,n=e.remoteResult,i=e.context,a=e.variables,o=e.onlyRunForcedResolvers,s=o===void 0?!1:o;return pt(this,void 0,void 0,function(){return ft(this,function(u){return t?[2,this.resolveDocument(t,n.data,i,a,this.fragmentMatcher,s).then(function(l){return m(m({},n),{data:l.result})})]:[2,n]})})},r.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},r.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},r.prototype.clientQuery=function(e){return Zr(["client"],e)&&this.resolvers?e:null},r.prototype.serverQuery=function(e){return jo(e)},r.prototype.prepareContext=function(e){var t=this.cache;return m(m({},e),{cache:t,getCacheKey:function(n){return t.identify(n)}})},r.prototype.addExportedVariables=function(e,t,n){return t===void 0&&(t={}),n===void 0&&(n={}),pt(this,void 0,void 0,function(){return ft(this,function(i){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(n),t).then(function(a){return m(m({},t),a.exportedVariables)})]:[2,m({},t)]})})},r.prototype.shouldForceResolvers=function(e){var t=!1;return Me(e,{Directive:{enter:function(n){if(n.name.value==="client"&&n.arguments&&(t=n.arguments.some(function(i){return i.name.value==="always"&&i.value.kind==="BooleanValue"&&i.value.value===!0}),t))return vr}}}),t},r.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:Mo(e),variables:t,returnPartialData:!0,optimistic:!1}).result},r.prototype.resolveDocument=function(e,t,n,i,a,o){return n===void 0&&(n={}),i===void 0&&(i={}),a===void 0&&(a=function(){return!0}),o===void 0&&(o=!1),pt(this,void 0,void 0,function(){var s,u,l,p,f,h,d,y,g,C,_;return ft(this,function(b){return s=wr(e),u=Sr(e),l=br(u),p=this.collectSelectionsToResolve(s,l),f=s.operation,h=f?f.charAt(0).toUpperCase()+f.slice(1):"Query",d=this,y=d.cache,g=d.client,C={fragmentMap:l,context:m(m({},n),{cache:y,client:g}),variables:i,fragmentMatcher:a,defaultOperationType:h,exportedVariables:{},selectionsToResolve:p,onlyRunForcedResolvers:o},_=!1,[2,this.resolveSelectionSet(s.selectionSet,_,t,C).then(function(S){return{result:S,exportedVariables:C.exportedVariables}})]})})},r.prototype.resolveSelectionSet=function(e,t,n,i){return pt(this,void 0,void 0,function(){var a,o,s,u,l,p=this;return ft(this,function(f){return a=i.fragmentMap,o=i.context,s=i.variables,u=[n],l=function(h){return pt(p,void 0,void 0,function(){var d,y;return ft(this,function(g){return!t&&!i.selectionsToResolve.has(h)?[2]:Nt(h,s)?tt(h)?[2,this.resolveField(h,t,n,i).then(function(C){var _;typeof C<"u"&&u.push((_={},_[st(h)]=C,_))})]:(Ro(h)?d=h:(d=a[h.name.value],__DEV__?T(d,"No fragment named ".concat(h.name.value)):T(d,11)),d&&d.typeCondition&&(y=d.typeCondition.name.value,i.fragmentMatcher(n,y,o))?[2,this.resolveSelectionSet(d.selectionSet,t,n,i).then(function(C){u.push(C)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(l)).then(function(){return Qn(u)})]})})},r.prototype.resolveField=function(e,t,n,i){return pt(this,void 0,void 0,function(){var a,o,s,u,l,p,f,h,d,y=this;return ft(this,function(g){return n?(a=i.variables,o=e.name.value,s=st(e),u=o!==s,l=n[s]||n[o],p=Promise.resolve(l),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(f=n.__typename||i.defaultOperationType,h=this.resolvers&&this.resolvers[f],h&&(d=h[u?o:s],d&&(p=Promise.resolve(pn.withValue(this.cache,d,[n,Pt(e,a),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,p.then(function(C){var _,b;if(C===void 0&&(C=l),e.directives&&e.directives.forEach(function(O){O.name.value==="export"&&O.arguments&&O.arguments.forEach(function(k){k.name.value==="as"&&k.value.kind==="StringValue"&&(i.exportedVariables[k.value.value]=C)})}),!e.selectionSet||C==null)return C;var S=(b=(_=e.directives)===null||_===void 0?void 0:_.some(function(O){return O.name.value==="client"}))!==null&&b!==void 0?b:!1;if(Array.isArray(C))return y.resolveSubSelectedArray(e,t||S,C,i);if(e.selectionSet)return y.resolveSelectionSet(e.selectionSet,t||S,C,i)})]):[2,null]})})},r.prototype.resolveSubSelectedArray=function(e,t,n,i){var a=this;return Promise.all(n.map(function(o){if(o===null)return null;if(Array.isArray(o))return a.resolveSubSelectedArray(e,t,o,i);if(e.selectionSet)return a.resolveSelectionSet(e.selectionSet,t,o,i)}))},r.prototype.collectSelectionsToResolve=function(e,t){var n=function(o){return!Array.isArray(o)},i=this.selectionsToResolveCache;function a(o){if(!i.has(o)){var s=new Set;i.set(o,s),Me(o,{Directive:function(u,l,p,f,h){u.name.value==="client"&&h.forEach(function(d){n(d)&&jn(d)&&s.add(d)})},FragmentSpread:function(u,l,p,f,h){var d=t[u.name.value];__DEV__?T(d,"No fragment named ".concat(u.name.value)):T(d,12);var y=a(d);y.size>0&&(h.forEach(function(g){n(g)&&jn(g)&&s.add(g)}),s.add(u),y.forEach(function(g){s.add(g)}))}})}return i.get(o)}return a(e)},r}();var dn=new(ct?WeakMap:Map);function As(r,e){var t=r[e];typeof t=="function"&&(r[e]=function(){return dn.set(r,(dn.get(r)+1)%1e15),t.apply(this,arguments)})}function kl(r){r.notifyTimeout&&(clearTimeout(r.notifyTimeout),r.notifyTimeout=void 0)}var da=function(){function r(e,t){t===void 0&&(t=e.generateQueryId()),this.queryId=t,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=e.cache;dn.has(n)||(dn.set(n,0),As(n,"evict"),As(n,"modify"),As(n,"reset"))}return r.prototype.init=function(e){var t=e.networkStatus||te.loading;return this.variables&&this.networkStatus!==te.loading&&!pe(this.variables,e.variables)&&(t=te.setVariables),pe(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&&pe(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&&!pe(n&&n.result,e&&e.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return t.notify()},0)))},r.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){var n=t.getDiff();n.fromOptimisticTransaction?e.observe():Os(e)})):delete this.oqListener)},r.prototype.notify=function(){var e=this;kl(this),this.shouldNotify()&&this.listeners.forEach(function(t){return t(e)}),this.dirty=!1},r.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(er(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if(e!=="cache-only"&&e!=="cache-and-network")return!1}return!0},r.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=r.prototype.cancel,this.subscriptions.forEach(function(t){return t.unsubscribe()});var e=this.observableQuery;e&&e.stopPolling()}},r.prototype.cancel=function(){},r.prototype.updateWatch=function(e){var t=this;e===void 0&&(e=this.variables);var n=this.observableQuery;if(!(n&&n.options.fetchPolicy==="no-cache")){var i=m(m({},this.getDiffOptions(e)),{watcher:this,callback:function(a){return t.setDiff(a)}});(!this.lastWatch||!pe(i,this.lastWatch))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=i))}},r.prototype.resetLastWrite=function(){this.lastWrite=void 0},r.prototype.shouldWrite=function(e,t){var n=this.lastWrite;return!(n&&n.dmCount===dn.get(this.cache)&&pe(t,n.variables)&&pe(e.data,n.result.data))},r.prototype.markResult=function(e,t,n,i){var a=this,o=new ze,s=Te(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Te(e.incremental)){var u=Gi(this.getDiff().result,e);e.data=u}else if("hasNext"in e&&e.hasNext){var l=this.getDiff();e.data=o.merge(l.result,e.data)}this.graphQLErrors=s,n.fetchPolicy==="no-cache"?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):i!==0&&(ha(e,n.errorPolicy)?this.cache.performTransaction(function(p){if(a.shouldWrite(e,n.variables))p.writeQuery({query:t,data:e.data,variables:n.variables,overwrite:i===1}),a.lastWrite={result:e,variables:n.variables,dmCount:dn.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){e.data=a.lastDiff.diff.result;return}var f=a.getDiffOptions(n.variables),h=p.diff(f);a.stopped||a.updateWatch(n.variables),a.updateLastDiff(h,f),h.complete&&(e.data=h.result)}):this.lastWrite=void 0)},r.prototype.markReady=function(){return this.networkError=null,this.networkStatus=te.ready},r.prototype.markError=function(e){return this.networkStatus=te.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},r}();function ha(r,e){e===void 0&&(e="none");var t=e==="ignore"||e==="all",n=!on(r);return!n&&t&&r.data&&(n=!0),n}var Dd=Object.prototype.hasOwnProperty,Dl=function(){function r(e){var t=e.cache,n=e.link,i=e.defaultOptions,a=e.queryDeduplication,o=a===void 0?!1:a,s=e.onBroadcast,u=e.ssrMode,l=u===void 0?!1:u,p=e.clientAwareness,f=p===void 0?{}:p,h=e.localState,d=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(ct?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=f,this.localState=h||new fa({cache:t}),this.ssrMode=l,this.assumeImmutableResults=!!d,(this.onBroadcast=s)&&(this.mutationStore=Object.create(null))}return r.prototype.stop=function(){var e=this;this.queries.forEach(function(t,n){e.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(__DEV__?new U("QueryManager stopped while query was in flight"):new U(14))},r.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(t){return t(e)}),this.fetchCancelFns.clear()},r.prototype.mutate=function(e){var t,n,i=e.mutation,a=e.variables,o=e.optimisticResponse,s=e.updateQueries,u=e.refetchQueries,l=u===void 0?[]:u,p=e.awaitRefetchQueries,f=p===void 0?!1:p,h=e.update,d=e.onQueryUpdated,y=e.fetchPolicy,g=y===void 0?((t=this.defaultOptions.mutate)===null||t===void 0?void 0:t.fetchPolicy)||"network-only":y,C=e.errorPolicy,_=C===void 0?((n=this.defaultOptions.mutate)===null||n===void 0?void 0:n.errorPolicy)||"none":C,b=e.keepRootFields,S=e.context;return pt(this,void 0,void 0,function(){var O,k,N,I,R,re;return ft(this,function(ee){switch(ee.label){case 0:return __DEV__?T(i,"mutation option is required. You must specify your GraphQL document in the mutation option."):T(i,15),__DEV__?T(g==="network-only"||g==="no-cache","Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):T(g==="network-only"||g==="no-cache",16),O=this.generateMutationId(),k=this.transform(i),N=k.document,I=k.hasClientExports,i=this.cache.transformForLink(N),a=this.getVariables(i,a),I?[4,this.localState.addExportedVariables(i,a,S)]:[3,2];case 1:a=ee.sent(),ee.label=2;case 2:return R=this.mutationStore&&(this.mutationStore[O]={mutation:i,variables:a,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:O,document:i,variables:a,fetchPolicy:g,errorPolicy:_,context:S,updateQueries:s,update:h,keepRootFields:b}),this.broadcastQueries(),re=this,[2,new Promise(function(bt,kt){return Qi(re.getObservableFromLink(i,m(m({},S),{optimisticResponse:o}),a,!1),function(De){if(on(De)&&_==="none")throw new Rt({graphQLErrors:Ki(De)});R&&(R.loading=!1,R.error=null);var B=m({},De);return typeof l=="function"&&(l=l(B)),_==="ignore"&&on(B)&&delete B.errors,re.markMutationResult({mutationId:O,result:B,document:i,variables:a,fetchPolicy:g,errorPolicy:_,context:S,update:h,updateQueries:s,awaitRefetchQueries:f,refetchQueries:l,removeOptimistic:o?O:void 0,onQueryUpdated:d,keepRootFields:b})}).subscribe({next:function(De){re.broadcastQueries(),(!("hasNext"in De)||De.hasNext===!1)&&bt(De)},error:function(De){R&&(R.loading=!1,R.error=De),o&&re.cache.removeOptimistic(O),re.broadcastQueries(),kt(De instanceof Rt?De:new Rt({networkError:De}))}})})]}})})},r.prototype.markMutationResult=function(e,t){var n=this;t===void 0&&(t=this.cache);var i=e.result,a=[],o=e.fetchPolicy==="no-cache";if(!o&&ha(i,e.errorPolicy)){if(Ht(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),Ht(i)&&Te(i.incremental)){var s=t.diff({id:"ROOT_MUTATION",query:this.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),u=void 0;s.result&&(u=Gi(s.result,i)),typeof u<"u"&&(i.data=u,a.push({result:u,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var l=e.updateQueries;l&&this.queries.forEach(function(f,h){var d=f.observableQuery,y=d&&d.queryName;if(!(!y||!Dd.call(l,y))){var g=l[y],C=n.queries.get(h),_=C.document,b=C.variables,S=t.diff({query:_,variables:b,returnPartialData:!0,optimistic:!1}),O=S.result,k=S.complete;if(k&&O){var N=g(O,{mutationResult:i,queryName:_&&tn(_)||void 0,queryVariables:b});N&&a.push({result:N,dataId:"ROOT_QUERY",query:_,variables:b})}}})}if(a.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var p=[];if(this.refetchQueries({updateCache:function(f){o||a.forEach(function(g){return f.write(g)});var h=e.update,d=!hu(i)||Ht(i)&&!i.hasNext;if(h){if(!o){var y=f.diff({id:"ROOT_MUTATION",query:n.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});y.complete&&(i=m(m({},i),{data:y.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}d&&h(f,i,{context:e.context,variables:e.variables})}!o&&!e.keepRootFields&&d&&f.modify({id:"ROOT_MUTATION",fields:function(g,C){var _=C.fieldName,b=C.DELETE;return _==="__typename"?g:b}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(f){return p.push(f)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(p).then(function(){return i})}return Promise.resolve(i)},r.prototype.markMutationOptimistic=function(e,t){var n=this,i=typeof e=="function"?e(t.variables):e;return this.cache.recordOptimisticTransaction(function(a){try{n.markMutationResult(m(m({},t),{result:{data:i}}),a)}catch(o){__DEV__&&T.error(o)}},t.mutationId)},r.prototype.fetchQuery=function(e,t,n){return this.fetchQueryObservable(e,t,n).promise},r.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(t,n){e[n]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}}),e},r.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},r.prototype.transform=function(e){var t=this.transformCache;if(!t.has(e)){var n=this.cache.transformDocument(e),i=$o(n),a=this.localState.clientQuery(n),o=i&&this.localState.serverQuery(i),s={document:n,hasClientExports:ko(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:a,serverQuery:o,defaultVars:_r(Et(n)),asQuery:m(m({},n),{definitions:n.definitions.map(function(l){return l.kind==="OperationDefinition"&&l.operation!=="query"?m(m({},l),{operation:"query"}):l})})},u=function(l){l&&!t.has(l)&&t.set(l,s)};u(e),u(n),u(a),u(o)}return t.get(e)},r.prototype.getVariables=function(e,t){return m(m({},this.transform(e).defaultVars),t)},r.prototype.watchQuery=function(e){e=m(m({},e),{variables:this.getVariables(e.query,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var t=new da(this),n=new 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 U("Store reset while query was in flight (not completed in link chain)"):new U(21)),this.queries.forEach(function(t){t.observableQuery?t.networkStatus=te.loading:t.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},r.prototype.getObservableQueries=function(e){var t=this;e===void 0&&(e="active");var n=new Map,i=new Map,a=new Set;return Array.isArray(e)&&e.forEach(function(o){typeof o=="string"?i.set(o,!1):No(o)?i.set(t.transform(o).document,!1):H(o)&&o.query&&a.add(o)}),this.queries.forEach(function(o,s){var u=o.observableQuery,l=o.document;if(u){if(e==="all"){n.set(s,u);return}var p=u.queryName,f=u.options.fetchPolicy;if(f==="standby"||e==="active"&&!u.hasObservers())return;(e==="active"||p&&i.has(p)||l&&i.has(l))&&(n.set(s,u),p&&i.set(p,!0),l&&i.set(l,!0))}}),a.size&&a.forEach(function(o){var s=Kn("legacyOneTimeQuery"),u=t.getQuery(s).init({document:o.query,variables:o.variables}),l=new pa({queryManager:t,queryInfo:u,options:m(m({},o),{fetchPolicy:"network-only"})});T(l.queryId===s),u.setObservableQuery(l),n.set(s,l)}),__DEV__&&i.size&&i.forEach(function(o,s){o||__DEV__&&T.warn("Unknown query ".concat(typeof s=="string"?"named ":"").concat(JSON.stringify(s,null,2)," requested in refetchQueries options.include array"))}),n},r.prototype.reFetchObservableQueries=function(e){var t=this;e===void 0&&(e=!1);var n=[];return this.getObservableQueries(e?"all":"active").forEach(function(i,a){var o=i.options.fetchPolicy;i.resetLastResults(),(e||o!=="standby"&&o!=="cache-only")&&n.push(i.refetch()),t.getQuery(a).setDiff(null)}),this.broadcastQueries(),Promise.all(n)},r.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},r.prototype.startGraphQLSubscription=function(e){var t=this,n=e.query,i=e.fetchPolicy,a=e.errorPolicy,o=e.variables,s=e.context,u=s===void 0?{}:s;n=this.transform(n).document,o=this.getVariables(n,o);var l=function(f){return t.getObservableFromLink(n,u,f).map(function(h){if(i!=="no-cache"&&(ha(h,a)&&t.cache.write({query:n,result:h.data,dataId:"ROOT_SUBSCRIPTION",variables:f}),t.broadcastQueries()),on(h))throw new Rt({graphQLErrors:h.errors});return h})};if(this.transform(n).hasClientExports){var p=this.localState.addExportedVariables(n,o,u).then(l);return new W(function(f){var h=null;return p.then(function(d){return h=d.subscribe(f)},f.error),function(){return h&&h.unsubscribe()}})}return l(o)},r.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},r.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},r.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},r.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){return e.notify()})},r.prototype.getLocalState=function(){return this.localState},r.prototype.getObservableFromLink=function(e,t,n,i){var a=this,o;i===void 0&&(i=(o=t?.queryDeduplication)!==null&&o!==void 0?o:this.queryDeduplication);var s,u=this.transform(e).serverQuery;if(u){var l=this,p=l.inFlightLinkObservables,f=l.link,h={query:u,variables:n,operationName:tn(u)||void 0,context:this.prepareContext(m(m({},t),{forceFetch:!i}))};if(t=h.context,i){var d=p.get(u)||new Map;p.set(u,d);var y=rt(n);if(s=d.get(y),!s){var g=new an([sn(f,h)]);d.set(y,s=g),g.beforeNext(function(){d.delete(y)&&d.size<1&&p.delete(u)})}}else s=new an([sn(f,h)])}else s=new an([W.of({data:{}})]),t=this.prepareContext(t);var C=this.transform(e).clientQuery;return C&&(s=Qi(s,function(_){return a.localState.runResolvers({document:C,remoteResult:_,context:t,variables:n})})),s},r.prototype.getResultsFromLink=function(e,t,n){var i=e.lastRequestId=this.generateRequestId(),a=this.cache.transformForLink(this.transform(e.document).document);return Qi(this.getObservableFromLink(a,n.context,n.variables),function(o){var s=Ki(o),u=s.length>0;if(i>=e.lastRequestId){if(u&&n.errorPolicy==="none")throw e.markError(new Rt({graphQLErrors:s}));e.markResult(o,a,n,t),e.markReady()}var l={data:o.data,loading:!1,networkStatus:te.ready};return u&&n.errorPolicy!=="ignore"&&(l.errors=s,l.networkStatus=te.error),l},function(o){var s=Il(o)?o:new Rt({networkError:o});throw i>=e.lastRequestId&&e.markError(s),s})},r.prototype.fetchQueryObservable=function(e,t,n){var i=this;n===void 0&&(n=te.loading);var a=this.transform(t.query).document,o=this.getVariables(a,t.variables),s=this.getQuery(e),u=this.defaultOptions.watchQuery,l=t.fetchPolicy,p=l===void 0?u&&u.fetchPolicy||"cache-first":l,f=t.errorPolicy,h=f===void 0?u&&u.errorPolicy||"none":f,d=t.returnPartialData,y=d===void 0?!1:d,g=t.notifyOnNetworkStatusChange,C=g===void 0?!1:g,_=t.context,b=_===void 0?{}:_,S=Object.assign({},t,{query:a,variables:o,fetchPolicy:p,errorPolicy:h,returnPartialData:y,notifyOnNetworkStatusChange:C,context:b}),O=function(I){S.variables=I;var R=i.fetchQueryByPolicy(s,S,n);return S.fetchPolicy!=="standby"&&R.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",t),R},k=function(){return i.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,function(I){k(),setTimeout(function(){return N.cancel(I)})});var N=new an(this.transform(S.query).hasClientExports?this.localState.addExportedVariables(S.query,S.variables,S.context).then(O):O(S.variables));return N.promise.then(k,k),N},r.prototype.refetchQueries=function(e){var t=this,n=e.updateCache,i=e.include,a=e.optimistic,o=a===void 0?!1:a,s=e.removeOptimistic,u=s===void 0?o?Kn("refetchQueries"):void 0:s,l=e.onQueryUpdated,p=new Map;i&&this.getObservableQueries(i).forEach(function(h,d){p.set(d,{oq:h,lastDiff:t.getQuery(d).getDiff()})});var f=new Map;return n&&this.cache.batch({update:n,optimistic:o&&u||!1,removeOptimistic:u,onWatchUpdated:function(h,d,y){var g=h.watcher instanceof da&&h.watcher.observableQuery;if(g){if(l){p.delete(g.queryId);var C=l(g,d,y);return C===!0&&(C=g.refetch()),C!==!1&&f.set(g,C),C}l!==null&&p.set(g.queryId,{oq:g,lastDiff:y,diff:d})}}}),p.size&&p.forEach(function(h,d){var y=h.oq,g=h.lastDiff,C=h.diff,_;if(l){if(!C){var b=y.queryInfo;b.reset(),C=b.getDiff()}_=l(y,C,g)}(!l||_===!0)&&(_=y.refetch()),_!==!1&&f.set(y,_),d.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(d)}),u&&this.cache.removeOptimistic(u),f},r.prototype.fetchQueryByPolicy=function(e,t,n){var i=this,a=t.query,o=t.variables,s=t.fetchPolicy,u=t.refetchWritePolicy,l=t.errorPolicy,p=t.returnPartialData,f=t.context,h=t.notifyOnNetworkStatusChange,d=e.networkStatus;e.init({document:this.transform(a).document,variables:o,networkStatus:n});var y=function(){return e.getDiff(o)},g=function(O,k){k===void 0&&(k=e.networkStatus||te.loading);var N=O.result;__DEV__&&!p&&!pe(N,{})&&Ts(O.missing);var I=function(R){return W.of(m({data:R,loading:er(k),networkStatus:k},O.complete?null:{partial:!0}))};return N&&i.transform(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:N},context:f,variables:o,onlyRunForcedResolvers:!0}).then(function(R){return I(R.data||void 0)}):l==="none"&&k===te.refetch&&Array.isArray(O.missing)?I(void 0):I(N)},C=s==="no-cache"?0:n===te.refetch&&u!=="merge"?1:2,_=function(){return i.getResultsFromLink(e,C,{variables:o,context:f,fetchPolicy:s,errorPolicy:l})},b=h&&typeof d=="number"&&d!==n&&er(n);switch(s){default:case"cache-first":{var S=y();return S.complete?[g(S,e.markReady())]:p||b?[g(S),_()]:[_()]}case"cache-and-network":{var S=y();return S.complete||p||b?[g(S),_()]:[_()]}case"cache-only":return[g(y(),e.markReady())];case"network-only":return b?[g(y()),_()]:[_()];case"no-cache":return b?[g(e.getDiff()),_()]:[_()];case"standby":return[]}},r.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new da(this,e)),this.queries.get(e)},r.prototype.prepareContext=function(e){e===void 0&&(e={});var t=this.localState.prepareContext(e);return m(m({},t),{clientAwareness:this.clientAwareness})},r}();var Nl=!1;var Is=function(){function r(e){var t=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=e.uri,i=e.credentials,a=e.headers,o=e.cache,s=e.ssrMode,u=s===void 0?!1:s,l=e.ssrForceFetchDelay,p=l===void 0?0:l,f=e.connectToDevTools,h=f===void 0?typeof window=="object"&&!window.__APOLLO_CLIENT__&&__DEV__:f,d=e.queryDeduplication,y=d===void 0?!0:d,g=e.defaultOptions,C=e.assumeImmutableResults,_=C===void 0?!1:C,b=e.resolvers,S=e.typeDefs,O=e.fragmentMatcher,k=e.name,N=e.version,I=e.link;if(I||(I=n?new ns({uri:n,credentials:i,headers:a}):ut.empty()),!o)throw __DEV__?new U(`To initialize Apollo Client, you must specify a 'cache' property in the options object.
|
|
53
|
+
For more information, please visit: https://go.apollo.dev/c/docs`):new U(9);if(this.link=I,this.cache=o,this.disableNetworkFetches=u||p>0,this.queryDeduplication=y,this.defaultOptions=g||Object.create(null),this.typeDefs=S,p&&setTimeout(function(){return t.disableNetworkFetches=!1},p),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),h&&typeof window=="object"&&(window.__APOLLO_CLIENT__=this),!Nl&&h&&__DEV__&&(Nl=!0,typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var R=window.navigator,re=R&&R.userAgent,ee=void 0;typeof re=="string"&&(re.indexOf("Chrome/")>-1?ee="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":re.indexOf("Firefox/")>-1&&(ee="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),ee&&__DEV__&&T.log("Download the Apollo DevTools for a better development experience: "+ee)}this.version=vu,this.localState=new fa({cache:o,client:this,resolvers:b,fragmentMatcher:O}),this.queryManager=new Dl({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:y,ssrMode:u,clientAwareness:{name:k,version:N},localState:this.localState,assumeImmutableResults:_,onBroadcast:h?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return r.prototype.stop=function(){this.queryManager.stop()},r.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=zn(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=m(m({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},r.prototype.query=function(e){return this.defaultOptions.query&&(e=zn(this.defaultOptions.query,e)),__DEV__?T(e.fetchPolicy!=="cache-and-network","The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):T(e.fetchPolicy!=="cache-and-network",10),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=m(m({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},r.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=zn(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},r.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},r.prototype.readQuery=function(e,t){return t===void 0&&(t=!1),this.cache.readQuery(e,t)},r.prototype.readFragment=function(e,t){return t===void 0&&(t=!1),this.cache.readFragment(e,t)},r.prototype.writeQuery=function(e){var t=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),t},r.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),t},r.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},r.prototype.__requestRaw=function(e){return sn(this.link,e)},r.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(t){return t()}))}).then(function(){return e.reFetchObservableQueries()})},r.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(t){return t()}))})},r.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter(function(n){return n!==e})}},r.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter(function(n){return n!==e})}},r.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},r.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),n=[],i=[];t.forEach(function(o,s){n.push(s),i.push(o)});var a=Promise.all(i);return a.queries=n,a.results=i,a.catch(function(o){__DEV__&&T.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(o))}),a},r.prototype.getObservableQueries=function(e){return e===void 0&&(e="active"),this.queryManager.getObservableQueries(e)},r.prototype.extract=function(e){return this.cache.extract(e)},r.prototype.restore=function(e){return this.cache.restore(e)},r.prototype.addResolvers=function(e){this.localState.addResolvers(e)},r.prototype.setResolvers=function(e){this.localState.setResolvers(e)},r.prototype.getResolvers=function(){return this.localState.getResolvers()},r.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},r.prototype.setLink=function(e){this.link=this.queryManager.link=e},r}();Qc(gr?"log":"silent");function Ue(r){return r===null?"null":Array.isArray(r)?"array":typeof r}function Lt(r){return Ue(r)==="object"}function Pl(r){return Array.isArray(r)&&r.length>0&&r.every(e=>"message"in e)}function ks(r,e){return r.length<124?r:e}var Rl="graphql-transport-ws";var He;(function(r){r[r.InternalServerError=4500]="InternalServerError",r[r.InternalClientError=4005]="InternalClientError",r[r.BadRequest=4400]="BadRequest",r[r.BadResponse=4004]="BadResponse",r[r.Unauthorized=4401]="Unauthorized",r[r.Forbidden=4403]="Forbidden",r[r.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",r[r.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",r[r.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",r[r.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",r[r.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(He||(He={}));var 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(!Lt(r))throw new Error(`Message is expected to be an object, but got ${Ue(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 ${Ue(r.type)}`);switch(r.type){case Se.ConnectionInit:case Se.ConnectionAck:case Se.Ping:case Se.Pong:{if(r.payload!=null&&!Lt(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 ${Ue(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!Lt(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an object, but got ${Ue(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 ${Ue(r.payload.query)}`);if(r.payload.variables!=null&&!Lt(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 ${Ue(r.payload.variables)}`);if(r.payload.operationName!=null&&Ue(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 ${Ue(r.payload.operationName)}`);if(r.payload.extensions!=null&&!Lt(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 ${Ue(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 ${Ue(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!Lt(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an object, but got ${Ue(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 ${Ue(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 ${Ue(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${r.type}"`)}return r}function Fl(r,e){return Ll(typeof r=="string"?JSON.parse(r,e):r)}function hn(r,e){return Ll(r),JSON.stringify(r,e)}function $l(r){let{url:e,connectionParams:t,lazy:n=!0,onNonLazyError:i=console.error,lazyCloseTimeout:a=0,keepAlive:o=0,disablePong:s,connectionAckWaitTimeout:u=0,retryAttempts:l=5,retryWait:p=async function(ve){let oe=1e3;for(let K=0;K<ve;K++)oe*=2;await new Promise(K=>setTimeout(K,oe+Math.floor(Math.random()*(3e3-300)+300)))},shouldRetry:f=ma,isFatalConnectionProblem:h,on:d,webSocketImpl:y,generateID:g=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,ve=>{let oe=Math.random()*16|0;return(ve=="x"?oe:oe&3|8).toString(16)})},jsonMessageReplacer:C,jsonMessageReviver:_}=r,b;if(y){if(!Pd(y))throw new Error("Invalid WebSocket implementation provided");b=y}else typeof WebSocket<"u"?b=WebSocket:typeof global<"u"?b=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(b=window.WebSocket||window.MozWebSocket);if(!b)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let S=b,O=(()=>{let B=(()=>{let oe={};return{on(K,z){return oe[K]=z,()=>{delete oe[K]}},emit(K){var z;"id"in K&&((z=oe[K.id])===null||z===void 0||z.call(oe,K))}}})(),ve={connecting:d?.connecting?[d.connecting]:[],opened:d?.opened?[d.opened]:[],connected:d?.connected?[d.connected]:[],ping:d?.ping?[d.ping]:[],pong:d?.pong?[d.pong]:[],message:d?.message?[B.emit,d.message]:[B.emit],closed:d?.closed?[d.closed]:[],error:d?.error?[d.error]:[]};return{onMessage:B.on,on(oe,K){let z=ve[oe];return z.push(K),()=>{z.splice(z.indexOf(K),1)}},emit(oe,...K){for(let z of[...ve[oe]])z(...K)}}})();function k(B){let ve=[O.on("error",oe=>{ve.forEach(K=>K()),B(oe)}),O.on("closed",oe=>{ve.forEach(K=>K()),B(oe)})]}let N,I=0,R,re=!1,ee=0,bt=!1;async function kt(){clearTimeout(R);let[B,ve]=await(N??(N=new Promise((z,Ct)=>(async()=>{if(re){if(await p(ee),!I)return N=void 0,Ct({code:1e3,reason:"All Subscriptions Gone"});ee++}O.emit("connecting");let Q=new S(typeof e=="function"?await e():e,Rl),St,qt;function Ti(){isFinite(o)&&o>0&&(clearTimeout(qt),qt=setTimeout(()=>{Q.readyState===S.OPEN&&(Q.send(hn({type:Se.Ping})),O.emit("ping",!1,void 0))},o))}k(Ne=>{N=void 0,clearTimeout(St),clearTimeout(qt),Ct(Ne),ma(Ne)&&Ne.code===4499&&(Q.close(4499,"Terminated"),Q.onerror=null,Q.onclose=null)}),Q.onerror=Ne=>O.emit("error",Ne),Q.onclose=Ne=>O.emit("closed",Ne),Q.onopen=async()=>{try{O.emit("opened",Q);let Ne=typeof t=="function"?await t():t;if(Q.readyState!==S.OPEN)return;Q.send(hn(Ne?{type:Se.ConnectionInit,payload:Ne}:{type:Se.ConnectionInit},C)),isFinite(u)&&u>0&&(St=setTimeout(()=>{Q.close(He.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},u)),Ti()}catch(Ne){O.emit("error",Ne),Q.close(He.InternalClientError,ks(Ne instanceof Error?Ne.message:new Error(Ne).message,"Internal client error"))}};let zr=!1;Q.onmessage=({data:Ne})=>{try{let Pe=Fl(Ne,_);if(O.emit("message",Pe),Pe.type==="ping"||Pe.type==="pong"){O.emit(Pe.type,!0,Pe.payload),Pe.type==="pong"?Ti():s||(Q.send(hn(Pe.payload?{type:Se.Pong,payload:Pe.payload}:{type:Se.Pong})),O.emit("pong",!1,Pe.payload));return}if(zr)return;if(Pe.type!==Se.ConnectionAck)throw new Error(`First message cannot be of type ${Pe.type}`);clearTimeout(St),zr=!0,O.emit("connected",Q,Pe.payload),re=!1,ee=0,z([Q,new Promise((H1,Op)=>k(Op))])}catch(Pe){Q.onmessage=null,O.emit("error",Pe),Q.close(He.BadResponse,ks(Pe instanceof Error?Pe.message:new Error(Pe).message,"Bad response"))}}})())));B.readyState===S.CLOSING&&await ve;let oe=()=>{},K=new Promise(z=>oe=z);return[B,oe,Promise.race([K.then(()=>{if(!I){let z=()=>B.close(1e3,"Normal Closure");isFinite(a)&&a>0?R=setTimeout(()=>{B.readyState===S.OPEN&&z()},a):z()}}),ve])]}function De(B){if(ma(B)&&(Nd(B.code)||[He.InternalServerError,He.InternalClientError,He.BadRequest,He.BadResponse,He.Unauthorized,He.SubprotocolNotAcceptable,He.SubscriberAlreadyExists,He.TooManyInitialisationRequests].includes(B.code)))throw B;if(bt)return!1;if(ma(B)&&B.code===1e3)return I>0;if(!l||ee>=l||!f(B)||h?.(B))throw B;return re=!0}return n||(async()=>{for(I++;;)try{let[,,B]=await kt();await B}catch(B){try{if(!De(B))return}catch(ve){return i?.(ve)}}})(),{on:O.on,subscribe(B,ve){let oe=g(B),K=!1,z=!1,Ct=()=>{I--,K=!0};return(async()=>{for(I++;;)try{let[Q,St,qt]=await kt();if(K)return St();let Ti=O.onMessage(oe,zr=>{switch(zr.type){case Se.Next:{ve.next(zr.payload);return}case Se.Error:{z=!0,K=!0,ve.error(zr.payload),Ct();return}case Se.Complete:{K=!0,Ct();return}}});Q.send(hn({id:oe,type:Se.Subscribe,payload:B},C)),Ct=()=>{!K&&Q.readyState===S.OPEN&&Q.send(hn({id:oe,type:Se.Complete},C)),I--,K=!0,St()},await qt.finally(Ti);return}catch(Q){if(!De(Q))return}})().then(()=>{z||ve.complete()}).catch(Q=>{ve.error(Q)}),()=>{K||Ct()}},async dispose(){if(bt=!0,N){let[B]=await N;B.close(1e3,"Normal Closure")}},terminate(){N&&O.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}function ma(r){return Lt(r)&&"code"in r&&"reason"in r}function Nd(r){return[1e3,1001,1006,1005,1012,1013,1013].includes(r)?!1:r>=1e3&&r<=1999}function Pd(r){return typeof r=="function"&&"constructor"in r&&"CLOSED"in r&&"CLOSING"in r&&"CONNECTING"in r&&"OPEN"in r}function Rd(r){return 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 W(function(i){return n.client.subscribe(m(m({},t),{query:Xr(t.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(a){return a instanceof Error?i.error(a):Rd(a)?i.error(new Error("Socket closed with event ".concat(a.code," ").concat(a.reason||""))):i.error(new Rt({graphQLErrors:Array.isArray(a)?a:[a]}))}})})},e}(ut);var Ra=function(){return Ra=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Ra.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function wa(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?wa=function(t){return typeof t}:wa=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wa(r)}function Ld(r){return wa(r)=="object"&&r!==null}var 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 Fd(r){return cp(r.source,$s(r.source,r.start))}function cp(r,e){var t=r.locationOffset.column-1,n=_a(t)+r.body,i=e.line-1,a=r.locationOffset.line-1,o=e.line+a,s=e.line===1?t:0,u=e.column+s,l="".concat(r.name,":").concat(o,":").concat(u,`
|
|
54
|
+
`),p=n.split(/\r\n|[\n\r]/g),f=p[i];if(f.length>120){for(var h=Math.floor(u/80),d=u%80,y=[],g=0;g<f.length;g+=80)y.push(f.slice(g,g+80));return l+jl([["".concat(o),y[0]]].concat(y.slice(1,h+1).map(function(C){return["",C]}),[[" ",_a(d-1)+"^"],["",y[h+1]]]))}return l+jl([["".concat(o-1),p[i-1]],["".concat(o),f],["",_a(u-1)+"^"],["".concat(o+1),p[i+1]]])}function jl(r){var e=r.filter(function(n){n[0];var i=n[1];return i!==void 0}),t=Math.max.apply(Math,e.map(function(n){var i=n[0];return i.length}));return e.map(function(n){var i=n[0],a=n[1];return $d(t,i)+(a?" | "+a:" |")}).join(`
|
|
55
|
+
`)}function _a(r){return Array(r+1).join(" ")}function $d(r,e){return _a(r-e.length)+e}function Ea(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ea=function(t){return typeof t}:Ea=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ea(r)}function Ul(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Md(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ul(Object(t),!0).forEach(function(n){jd(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ul(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function jd(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ud(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function ql(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function qd(r,e,t){return e&&ql(r.prototype,e),t&&ql(r,t),r}function Bd(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&vi(r,e)}function Vd(r){var e=lp();return function(){var n=bi(r),i;if(e){var a=bi(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return up(this,i)}}function up(r,e){return e&&(Ea(e)==="object"||typeof e=="function")?e:ii(r)}function ii(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Ms(r){var e=typeof Map=="function"?new Map:void 0;return Ms=function(n){if(n===null||!Qd(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return xa(n,arguments,bi(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),vi(i,n)},Ms(r)}function xa(r,e,t){return lp()?xa=Reflect.construct:xa=function(i,a,o){var s=[null];s.push.apply(s,a);var u=Function.bind.apply(i,s),l=new u;return o&&vi(l,o.prototype),l},xa.apply(null,arguments)}function lp(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Qd(r){return Function.toString.call(r).indexOf("[native code]")!==-1}function vi(r,e){return vi=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},vi(r,e)}function bi(r){return bi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},bi(r)}var Wd=function(r){Bd(t,r);var e=Vd(t);function t(n,i,a,o,s,u,l){var p,f,h,d;Ud(this,t),d=e.call(this,n),d.name="GraphQLError",d.originalError=u??void 0,d.nodes=Bl(Array.isArray(i)?i:i?[i]:void 0);for(var y=[],g=0,C=(_=d.nodes)!==null&&_!==void 0?_:[];g<C.length;g++){var _,b=C[g],S=b.loc;S!=null&&y.push(S)}y=Bl(y),d.source=a??((p=y)===null||p===void 0?void 0:p[0].source),d.positions=o??((f=y)===null||f===void 0?void 0:f.map(function(k){return k.start})),d.locations=o&&a?o.map(function(k){return $s(a,k)}):(h=y)===null||h===void 0?void 0:h.map(function(k){return $s(k.source,k.start)}),d.path=s??void 0;var O=u?.extensions;return l==null&&Ld(O)?d.extensions=Md({},O):d.extensions=l??{},Object.defineProperties(ii(d),{message:{enumerable:!0},locations:{enumerable:d.locations!=null},path:{enumerable:d.path!=null},extensions:{enumerable:d.extensions!=null&&Object.keys(d.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),u!=null&&u.stack?(Object.defineProperty(ii(d),"stack",{value:u.stack,writable:!0,configurable:!0}),up(d)):(Error.captureStackTrace?Error.captureStackTrace(ii(d),t):Object.defineProperty(ii(d),"stack",{value:Error().stack,writable:!0,configurable:!0}),d)}return qd(t,[{key:"toString",value:function(){return Gd(this)}},{key:sp,get:function(){return"Object"}}]),t}(Ms(Error));function Bl(r){return r===void 0||r.length===0?void 0:r}function Gd(r){var e=r.message;if(r.nodes)for(var t=0,n=r.nodes;t<n.length;t++){var i=n[t];i.loc&&(e+=`
|
|
56
56
|
|
|
57
|
-
`+
|
|
57
|
+
`+Fd(i.loc))}else if(r.source&&r.locations)for(var a=0,o=r.locations;a<o.length;a++){var s=o[a];e+=`
|
|
58
58
|
|
|
59
|
-
`+
|
|
60
|
-
`)}function
|
|
61
|
-
`;break;case 114:l+="\r";break;case 116:l+=" ";break;case 117:{var p=m1(a.charCodeAt(o+1),a.charCodeAt(o+2),a.charCodeAt(o+3),a.charCodeAt(o+4));if(p<0){var f=a.slice(o+1,o+5);throw nt(r,o,"Invalid character escape sequence: \\u".concat(f,"."))}l+=String.fromCharCode(p),o+=4;break}default:throw nt(r,o,"Invalid character escape sequence: \\".concat(String.fromCharCode(u),"."))}++o,s=o}}throw nt(r,o,"Unterminated string.")}function h1(r,e,t,n,i,a){for(var o=r.body,s=e+3,u=s,l=0,p="";s<o.length&&!isNaN(l=o.charCodeAt(s));){if(l===34&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34)return p+=o.slice(u,s),new Se(w.BLOCK_STRING,e,s+3,t,n,i,a1(p));if(l<32&&l!==9&&l!==10&&l!==13)throw nt(r,s,"Invalid character within String: ".concat(Mr(l),"."));l===10?(++s,++a.line,a.lineStart=s):l===13?(o.charCodeAt(s+1)===10?s+=2:++s,++a.line,a.lineStart=s):l===92&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34&&o.charCodeAt(s+3)===34?(p+=o.slice(u,s)+'"""',s+=4,u=s):++s}throw nt(r,s,"Unterminated string.")}function m1(r,e,t,n){return ya(r)<<12|ya(e)<<8|ya(t)<<4|ya(n)}function ya(r){return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1}function y1(r,e,t,n,i){for(var a=r.body,o=a.length,s=e+1,u=0;s!==o&&!isNaN(u=a.charCodeAt(s))&&(u===95||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new Se(w.NAME,e,s,t,n,i,a.slice(e,s))}function g1(r){return r===95||r>=65&&r<=90||r>=97&&r<=122}function v1(r,e){var t=new b1(r,e);return t.parseDocument()}var b1=function(){function r(t,n){var i=n1(t)?t:new dp(t);this._lexer=new s1(i),this._options=n}var e=r.prototype;return e.parseName=function(){var n=this.expectToken(w.NAME);return{kind:j.NAME,value:n.value,loc:this.loc(n)}},e.parseDocument=function(){var n=this._lexer.token;return{kind:j.DOCUMENT,definitions:this.many(w.SOF,this.parseDefinition,w.EOF),loc:this.loc(n)}},e.parseDefinition=function(){if(this.peek(w.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(w.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},e.parseOperationDefinition=function(){var n=this._lexer.token;if(this.peek(w.BRACE_L))return{kind:j.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(n)};var i=this.parseOperationType(),a;return this.peek(w.NAME)&&(a=this.parseName()),{kind:j.OPERATION_DEFINITION,operation:i,name:a,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},e.parseOperationType=function(){var n=this.expectToken(w.NAME);switch(n.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(n)},e.parseVariableDefinitions=function(){return this.optionalMany(w.PAREN_L,this.parseVariableDefinition,w.PAREN_R)},e.parseVariableDefinition=function(){var n=this._lexer.token;return{kind:j.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(w.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(w.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(n)}},e.parseVariable=function(){var n=this._lexer.token;return this.expectToken(w.DOLLAR),{kind:j.VARIABLE,name:this.parseName(),loc:this.loc(n)}},e.parseSelectionSet=function(){var n=this._lexer.token;return{kind:j.SELECTION_SET,selections:this.many(w.BRACE_L,this.parseSelection,w.BRACE_R),loc:this.loc(n)}},e.parseSelection=function(){return this.peek(w.SPREAD)?this.parseFragment():this.parseField()},e.parseField=function(){var n=this._lexer.token,i=this.parseName(),a,o;return this.expectOptionalToken(w.COLON)?(a=i,o=this.parseName()):o=i,{kind:j.FIELD,alias:a,name:o,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(w.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},e.parseArguments=function(n){var i=n?this.parseConstArgument:this.parseArgument;return this.optionalMany(w.PAREN_L,i,w.PAREN_R)},e.parseArgument=function(){var n=this._lexer.token,i=this.parseName();return this.expectToken(w.COLON),{kind:j.ARGUMENT,name:i,value:this.parseValueLiteral(!1),loc:this.loc(n)}},e.parseConstArgument=function(){var n=this._lexer.token;return{kind:j.ARGUMENT,name:this.parseName(),value:(this.expectToken(w.COLON),this.parseValueLiteral(!0)),loc:this.loc(n)}},e.parseFragment=function(){var n=this._lexer.token;this.expectToken(w.SPREAD);var i=this.expectOptionalKeyword("on");return!i&&this.peek(w.NAME)?{kind:j.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(n)}:{kind:j.INLINE_FRAGMENT,typeCondition:i?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},e.parseFragmentDefinition=function(){var n,i=this._lexer.token;return this.expectKeyword("fragment"),((n=this._options)===null||n===void 0?void 0:n.experimentalFragmentVariables)===!0?{kind:j.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}:{kind:j.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}},e.parseFragmentName=function(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()},e.parseValueLiteral=function(n){var i=this._lexer.token;switch(i.kind){case w.BRACKET_L:return this.parseList(n);case w.BRACE_L:return this.parseObject(n);case w.INT:return this._lexer.advance(),{kind:j.INT,value:i.value,loc:this.loc(i)};case w.FLOAT:return this._lexer.advance(),{kind:j.FLOAT,value:i.value,loc:this.loc(i)};case w.STRING:case w.BLOCK_STRING:return this.parseStringLiteral();case w.NAME:switch(this._lexer.advance(),i.value){case"true":return{kind:j.BOOLEAN,value:!0,loc:this.loc(i)};case"false":return{kind:j.BOOLEAN,value:!1,loc:this.loc(i)};case"null":return{kind:j.NULL,loc:this.loc(i)};default:return{kind:j.ENUM,value:i.value,loc:this.loc(i)}}case w.DOLLAR:if(!n)return this.parseVariable();break}throw this.unexpected()},e.parseStringLiteral=function(){var n=this._lexer.token;return this._lexer.advance(),{kind:j.STRING,value:n.value,block:n.kind===w.BLOCK_STRING,loc:this.loc(n)}},e.parseList=function(n){var i=this,a=this._lexer.token,o=function(){return i.parseValueLiteral(n)};return{kind:j.LIST,values:this.any(w.BRACKET_L,o,w.BRACKET_R),loc:this.loc(a)}},e.parseObject=function(n){var i=this,a=this._lexer.token,o=function(){return i.parseObjectField(n)};return{kind:j.OBJECT,fields:this.any(w.BRACE_L,o,w.BRACE_R),loc:this.loc(a)}},e.parseObjectField=function(n){var i=this._lexer.token,a=this.parseName();return this.expectToken(w.COLON),{kind:j.OBJECT_FIELD,name:a,value:this.parseValueLiteral(n),loc:this.loc(i)}},e.parseDirectives=function(n){for(var i=[];this.peek(w.AT);)i.push(this.parseDirective(n));return i},e.parseDirective=function(n){var i=this._lexer.token;return this.expectToken(w.AT),{kind:j.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(n),loc:this.loc(i)}},e.parseTypeReference=function(){var n=this._lexer.token,i;return this.expectOptionalToken(w.BRACKET_L)?(i=this.parseTypeReference(),this.expectToken(w.BRACKET_R),i={kind:j.LIST_TYPE,type:i,loc:this.loc(n)}):i=this.parseNamedType(),this.expectOptionalToken(w.BANG)?{kind:j.NON_NULL_TYPE,type:i,loc:this.loc(n)}:i},e.parseNamedType=function(){var n=this._lexer.token;return{kind:j.NAMED_TYPE,name:this.parseName(),loc:this.loc(n)}},e.parseTypeSystemDefinition=function(){var n=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(n.kind===w.NAME)switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(n)},e.peekDescription=function(){return this.peek(w.STRING)||this.peek(w.BLOCK_STRING)},e.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},e.parseSchemaDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("schema");var a=this.parseDirectives(!0),o=this.many(w.BRACE_L,this.parseOperationTypeDefinition,w.BRACE_R);return{kind:j.SCHEMA_DEFINITION,description:i,directives:a,operationTypes:o,loc:this.loc(n)}},e.parseOperationTypeDefinition=function(){var n=this._lexer.token,i=this.parseOperationType();this.expectToken(w.COLON);var a=this.parseNamedType();return{kind:j.OPERATION_TYPE_DEFINITION,operation:i,type:a,loc:this.loc(n)}},e.parseScalarTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("scalar");var a=this.parseName(),o=this.parseDirectives(!0);return{kind:j.SCALAR_TYPE_DEFINITION,description:i,name:a,directives:o,loc:this.loc(n)}},e.parseObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("type");var a=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:j.OBJECT_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:u,loc:this.loc(n)}},e.parseImplementsInterfaces=function(){var n;if(!this.expectOptionalKeyword("implements"))return[];if(((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLImplementsInterfaces)===!0){var i=[];this.expectOptionalToken(w.AMP);do i.push(this.parseNamedType());while(this.expectOptionalToken(w.AMP)||this.peek(w.NAME));return i}return this.delimitedMany(w.AMP,this.parseNamedType)},e.parseFieldsDefinition=function(){var n;return((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLEmptyFields)===!0&&this.peek(w.BRACE_L)&&this._lexer.lookahead().kind===w.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(w.BRACE_L,this.parseFieldDefinition,w.BRACE_R)},e.parseFieldDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseArgumentDefs();this.expectToken(w.COLON);var s=this.parseTypeReference(),u=this.parseDirectives(!0);return{kind:j.FIELD_DEFINITION,description:i,name:a,arguments:o,type:s,directives:u,loc:this.loc(n)}},e.parseArgumentDefs=function(){return this.optionalMany(w.PAREN_L,this.parseInputValueDef,w.PAREN_R)},e.parseInputValueDef=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName();this.expectToken(w.COLON);var o=this.parseTypeReference(),s;this.expectOptionalToken(w.EQUALS)&&(s=this.parseValueLiteral(!0));var u=this.parseDirectives(!0);return{kind:j.INPUT_VALUE_DEFINITION,description:i,name:a,type:o,defaultValue:s,directives:u,loc:this.loc(n)}},e.parseInterfaceTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("interface");var a=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:j.INTERFACE_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:u,loc:this.loc(n)}},e.parseUnionTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("union");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseUnionMemberTypes();return{kind:j.UNION_TYPE_DEFINITION,description:i,name:a,directives:o,types:s,loc:this.loc(n)}},e.parseUnionMemberTypes=function(){return this.expectOptionalToken(w.EQUALS)?this.delimitedMany(w.PIPE,this.parseNamedType):[]},e.parseEnumTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("enum");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseEnumValuesDefinition();return{kind:j.ENUM_TYPE_DEFINITION,description:i,name:a,directives:o,values:s,loc:this.loc(n)}},e.parseEnumValuesDefinition=function(){return this.optionalMany(w.BRACE_L,this.parseEnumValueDefinition,w.BRACE_R)},e.parseEnumValueDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseDirectives(!0);return{kind:j.ENUM_VALUE_DEFINITION,description:i,name:a,directives:o,loc:this.loc(n)}},e.parseInputObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("input");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseInputFieldsDefinition();return{kind:j.INPUT_OBJECT_TYPE_DEFINITION,description:i,name:a,directives:o,fields:s,loc:this.loc(n)}},e.parseInputFieldsDefinition=function(){return this.optionalMany(w.BRACE_L,this.parseInputValueDef,w.BRACE_R)},e.parseTypeSystemExtension=function(){var n=this._lexer.lookahead();if(n.kind===w.NAME)switch(n.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(n)},e.parseSchemaExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var i=this.parseDirectives(!0),a=this.optionalMany(w.BRACE_L,this.parseOperationTypeDefinition,w.BRACE_R);if(i.length===0&&a.length===0)throw this.unexpected();return{kind:j.SCHEMA_EXTENSION,directives:i,operationTypes:a,loc:this.loc(n)}},e.parseScalarTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var i=this.parseName(),a=this.parseDirectives(!0);if(a.length===0)throw this.unexpected();return{kind:j.SCALAR_TYPE_EXTENSION,name:i,directives:a,loc:this.loc(n)}},e.parseObjectTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var i=this.parseName(),a=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),s=this.parseFieldsDefinition();if(a.length===0&&o.length===0&&s.length===0)throw this.unexpected();return{kind:j.OBJECT_TYPE_EXTENSION,name:i,interfaces:a,directives:o,fields:s,loc:this.loc(n)}},e.parseInterfaceTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var i=this.parseName(),a=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),s=this.parseFieldsDefinition();if(a.length===0&&o.length===0&&s.length===0)throw this.unexpected();return{kind:j.INTERFACE_TYPE_EXTENSION,name:i,interfaces:a,directives:o,fields:s,loc:this.loc(n)}},e.parseUnionTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseUnionMemberTypes();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:j.UNION_TYPE_EXTENSION,name:i,directives:a,types:o,loc:this.loc(n)}},e.parseEnumTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseEnumValuesDefinition();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:j.ENUM_TYPE_EXTENSION,name:i,directives:a,values:o,loc:this.loc(n)}},e.parseInputObjectTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseInputFieldsDefinition();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:j.INPUT_OBJECT_TYPE_EXTENSION,name:i,directives:a,fields:o,loc:this.loc(n)}},e.parseDirectiveDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("directive"),this.expectToken(w.AT);var a=this.parseName(),o=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var u=this.parseDirectiveLocations();return{kind:j.DIRECTIVE_DEFINITION,description:i,name:a,arguments:o,repeatable:s,locations:u,loc:this.loc(n)}},e.parseDirectiveLocations=function(){return this.delimitedMany(w.PIPE,this.parseDirectiveLocation)},e.parseDirectiveLocation=function(){var n=this._lexer.token,i=this.parseName();if(i1[i.value]!==void 0)return i;throw this.unexpected(n)},e.loc=function(n){var i;if(((i=this._options)===null||i===void 0?void 0:i.noLocation)!==!0)return new pp(n,this._lexer.lastToken,this._lexer.source)},e.peek=function(n){return this._lexer.token.kind===n},e.expectToken=function(n){var i=this._lexer.token;if(i.kind===n)return this._lexer.advance(),i;throw nt(this._lexer.source,i.start,"Expected ".concat(hp(n),", found ").concat(Ps(i),"."))},e.expectOptionalToken=function(n){var i=this._lexer.token;if(i.kind===n)return this._lexer.advance(),i},e.expectKeyword=function(n){var i=this._lexer.token;if(i.kind===w.NAME&&i.value===n)this._lexer.advance();else throw nt(this._lexer.source,i.start,'Expected "'.concat(n,'", found ').concat(Ps(i),"."))},e.expectOptionalKeyword=function(n){var i=this._lexer.token;return i.kind===w.NAME&&i.value===n?(this._lexer.advance(),!0):!1},e.unexpected=function(n){var i=n??this._lexer.token;return nt(this._lexer.source,i.start,"Unexpected ".concat(Ps(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 Ps(r){var e=r.value;return hp(r.kind)+(e!=null?' "'.concat(e,'"'):"")}function hp(r){return c1(r)?'"'.concat(r,'"'):r}var Ta=new Map,Us=new Map,mp=!0,La=!1;function yp(r){return r.replace(/[\s,]+/g," ").trim()}function C1(r){return yp(r.source.body.substring(r.start,r.end))}function S1(r){var e=new Set,t=[];return r.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,a=C1(n.loc),o=Us.get(i);o&&!o.has(a)?mp&&console.warn("Warning: fragment with name "+i+` already exists.
|
|
59
|
+
`+cp(r.source,s)}return e}function it(r,e,t){return new Wd("Syntax Error: ".concat(t),void 0,r,[e])}var j=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});function Kd(r,e){var t=Boolean(r);if(!t)throw new Error(e??"Unexpected invariant triggered.")}var zd=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,js=zd;function pp(r){var e=r.prototype.toJSON;typeof e=="function"||Kd(0),r.prototype.inspect=e,js&&(r.prototype[js]=e)}var fp=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}();pp(fp);var _e=function(){function r(t,n,i,a,o,s,u){this.kind=t,this.start=n,this.end=i,this.line=a,this.column=o,this.value=u,this.prev=s,this.next=null}var e=r.prototype;return e.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},r}();pp(_e);var w=Object.freeze({SOF:"<SOF>",EOF:"<EOF>",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"});function Oa(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Oa=function(t){return typeof t}:Oa=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oa(r)}var Hd=10,dp=2;function Jd(r){return Ya(r,[])}function Ya(r,e){switch(Oa(r)){case"string":return JSON.stringify(r);case"function":return r.name?"[function ".concat(r.name,"]"):"[function]";case"object":return r===null?"null":Yd(r,e);default:return String(r)}}function Yd(r,e){if(e.indexOf(r)!==-1)return"[Circular]";var t=[].concat(e,[r]),n=e1(r);if(n!==void 0){var i=n.call(r);if(i!==r)return typeof i=="string"?i:Ya(i,t)}else if(Array.isArray(r))return Zd(r,t);return Xd(r,t)}function Xd(r,e){var t=Object.keys(r);if(t.length===0)return"{}";if(e.length>dp)return"["+t1(r)+"]";var n=t.map(function(i){var a=Ya(r[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function Zd(r,e){if(r.length===0)return"[]";if(e.length>dp)return"[Array]";for(var t=Math.min(Hd,r.length),n=r.length-t,i=[],a=0;a<t;++a)i.push(Ya(r[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function e1(r){var e=r[String(js)];if(typeof e=="function")return e;if(typeof r.inspect=="function")return r.inspect}function t1(r){var e=Object.prototype.toString.call(r).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof r.constructor=="function"){var t=r.constructor.name;if(typeof t=="string"&&t!=="")return t}return e}function Ds(r,e){var t=Boolean(r);if(!t)throw new Error(e)}var r1=function(e,t){return e instanceof t};function Vl(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function n1(r,e,t){return e&&Vl(r.prototype,e),t&&Vl(r,t),r}var hp=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GraphQL request",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{line:1,column:1};typeof e=="string"||Ds(0,"Body must be a string. Received: ".concat(Jd(e),".")),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||Ds(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Ds(0,"column in locationOffset is 1-indexed and must be positive.")}return n1(r,[{key:sp,get:function(){return"Source"}}]),r}();function i1(r){return r1(r,hp)}var a1=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});function o1(r){var e=r.split(/\r\n|[\n\r]/g),t=s1(r);if(t!==0)for(var n=1;n<e.length;n++)e[n]=e[n].slice(t);for(var i=0;i<e.length&&Ql(e[i]);)++i;for(var a=e.length;a>i&&Ql(e[a-1]);)--a;return e.slice(i,a).join(`
|
|
60
|
+
`)}function Ql(r){for(var e=0;e<r.length;++e)if(r[e]!==" "&&r[e]!==" ")return!1;return!0}function s1(r){for(var e,t=!0,n=!0,i=0,a=null,o=0;o<r.length;++o)switch(r.charCodeAt(o)){case 13:r.charCodeAt(o+1)===10&&++o;case 10:t=!1,n=!0,i=0;break;case 9:case 32:++i;break;default:n&&!t&&(a===null||i<a)&&(a=i),n=!1}return(e=a)!==null&&e!==void 0?e:0}var c1=function(){function r(t){var n=new _e(w.SOF,0,0,0,0,null);this.source=t,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}var e=r.prototype;return e.advance=function(){this.lastToken=this.token;var n=this.token=this.lookahead();return n},e.lookahead=function(){var n=this.token;if(n.kind!==w.EOF)do{var i;n=(i=n.next)!==null&&i!==void 0?i:n.next=l1(this,n)}while(n.kind===w.COMMENT);return n},r}();function u1(r){return r===w.BANG||r===w.DOLLAR||r===w.AMP||r===w.PAREN_L||r===w.PAREN_R||r===w.SPREAD||r===w.COLON||r===w.EQUALS||r===w.AT||r===w.BRACKET_L||r===w.BRACKET_R||r===w.BRACE_L||r===w.PIPE||r===w.BRACE_R}function Mr(r){return isNaN(r)?w.EOF:r<127?JSON.stringify(String.fromCharCode(r)):'"\\u'.concat(("00"+r.toString(16).toUpperCase()).slice(-4),'"')}function l1(r,e){for(var t=r.source,n=t.body,i=n.length,a=e.end;a<i;){var o=n.charCodeAt(a),s=r.line,u=1+a-r.lineStart;switch(o){case 65279:case 9:case 32:case 44:++a;continue;case 10:++a,++r.line,r.lineStart=a;continue;case 13:n.charCodeAt(a+1)===10?a+=2:++a,++r.line,r.lineStart=a;continue;case 33:return new _e(w.BANG,a,a+1,s,u,e);case 35:return f1(t,a,s,u,e);case 36:return new _e(w.DOLLAR,a,a+1,s,u,e);case 38:return new _e(w.AMP,a,a+1,s,u,e);case 40:return new _e(w.PAREN_L,a,a+1,s,u,e);case 41:return new _e(w.PAREN_R,a,a+1,s,u,e);case 46:if(n.charCodeAt(a+1)===46&&n.charCodeAt(a+2)===46)return new _e(w.SPREAD,a,a+3,s,u,e);break;case 58:return new _e(w.COLON,a,a+1,s,u,e);case 61:return new _e(w.EQUALS,a,a+1,s,u,e);case 64:return new _e(w.AT,a,a+1,s,u,e);case 91:return new _e(w.BRACKET_L,a,a+1,s,u,e);case 93:return new _e(w.BRACKET_R,a,a+1,s,u,e);case 123:return new _e(w.BRACE_L,a,a+1,s,u,e);case 124:return new _e(w.PIPE,a,a+1,s,u,e);case 125:return new _e(w.BRACE_R,a,a+1,s,u,e);case 34:return n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34?m1(t,a,s,u,e,r):h1(t,a,s,u,e);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return d1(t,a,o,s,u,e);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return g1(t,a,s,u,e)}throw it(t,a,p1(o))}var l=r.line,p=1+a-r.lineStart;return new _e(w.EOF,i,i,l,p,e)}function p1(r){return r<32&&r!==9&&r!==10&&r!==13?"Cannot contain the invalid character ".concat(Mr(r),"."):r===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:"Cannot parse the unexpected character ".concat(Mr(r),".")}function f1(r,e,t,n,i){var a=r.body,o,s=e;do o=a.charCodeAt(++s);while(!isNaN(o)&&(o>31||o===9));return new _e(w.COMMENT,e,s,t,n,i,a.slice(e+1,s))}function d1(r,e,t,n,i,a){var o=r.body,s=t,u=e,l=!1;if(s===45&&(s=o.charCodeAt(++u)),s===48){if(s=o.charCodeAt(++u),s>=48&&s<=57)throw it(r,u,"Invalid number, unexpected digit after 0: ".concat(Mr(s),"."))}else u=Ns(r,u,s),s=o.charCodeAt(u);if(s===46&&(l=!0,s=o.charCodeAt(++u),u=Ns(r,u,s),s=o.charCodeAt(u)),(s===69||s===101)&&(l=!0,s=o.charCodeAt(++u),(s===43||s===45)&&(s=o.charCodeAt(++u)),u=Ns(r,u,s),s=o.charCodeAt(u)),s===46||v1(s))throw it(r,u,"Invalid number, expected digit but got: ".concat(Mr(s),"."));return new _e(l?w.FLOAT:w.INT,e,u,n,i,a,o.slice(e,u))}function Ns(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 it(r,i,"Invalid number, expected digit but got: ".concat(Mr(a),"."))}function h1(r,e,t,n,i){for(var a=r.body,o=e+1,s=o,u=0,l="";o<a.length&&!isNaN(u=a.charCodeAt(o))&&u!==10&&u!==13;){if(u===34)return l+=a.slice(s,o),new _e(w.STRING,e,o+1,t,n,i,l);if(u<32&&u!==9)throw it(r,o,"Invalid character within String: ".concat(Mr(u),"."));if(++o,u===92){switch(l+=a.slice(s,o-1),u=a.charCodeAt(o),u){case 34:l+='"';break;case 47:l+="/";break;case 92:l+="\\";break;case 98:l+="\b";break;case 102:l+="\f";break;case 110:l+=`
|
|
61
|
+
`;break;case 114:l+="\r";break;case 116:l+=" ";break;case 117:{var p=y1(a.charCodeAt(o+1),a.charCodeAt(o+2),a.charCodeAt(o+3),a.charCodeAt(o+4));if(p<0){var f=a.slice(o+1,o+5);throw it(r,o,"Invalid character escape sequence: \\u".concat(f,"."))}l+=String.fromCharCode(p),o+=4;break}default:throw it(r,o,"Invalid character escape sequence: \\".concat(String.fromCharCode(u),"."))}++o,s=o}}throw it(r,o,"Unterminated string.")}function m1(r,e,t,n,i,a){for(var o=r.body,s=e+3,u=s,l=0,p="";s<o.length&&!isNaN(l=o.charCodeAt(s));){if(l===34&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34)return p+=o.slice(u,s),new _e(w.BLOCK_STRING,e,s+3,t,n,i,o1(p));if(l<32&&l!==9&&l!==10&&l!==13)throw it(r,s,"Invalid character within String: ".concat(Mr(l),"."));l===10?(++s,++a.line,a.lineStart=s):l===13?(o.charCodeAt(s+1)===10?s+=2:++s,++a.line,a.lineStart=s):l===92&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34&&o.charCodeAt(s+3)===34?(p+=o.slice(u,s)+'"""',s+=4,u=s):++s}throw it(r,s,"Unterminated string.")}function y1(r,e,t,n){return ya(r)<<12|ya(e)<<8|ya(t)<<4|ya(n)}function ya(r){return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1}function g1(r,e,t,n,i){for(var a=r.body,o=a.length,s=e+1,u=0;s!==o&&!isNaN(u=a.charCodeAt(s))&&(u===95||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new _e(w.NAME,e,s,t,n,i,a.slice(e,s))}function v1(r){return r===95||r>=65&&r<=90||r>=97&&r<=122}function b1(r,e){var t=new C1(r,e);return t.parseDocument()}var C1=function(){function r(t,n){var i=i1(t)?t:new hp(t);this._lexer=new c1(i),this._options=n}var e=r.prototype;return e.parseName=function(){var n=this.expectToken(w.NAME);return{kind:j.NAME,value:n.value,loc:this.loc(n)}},e.parseDocument=function(){var n=this._lexer.token;return{kind:j.DOCUMENT,definitions:this.many(w.SOF,this.parseDefinition,w.EOF),loc:this.loc(n)}},e.parseDefinition=function(){if(this.peek(w.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(w.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},e.parseOperationDefinition=function(){var n=this._lexer.token;if(this.peek(w.BRACE_L))return{kind:j.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(n)};var i=this.parseOperationType(),a;return this.peek(w.NAME)&&(a=this.parseName()),{kind:j.OPERATION_DEFINITION,operation:i,name:a,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},e.parseOperationType=function(){var n=this.expectToken(w.NAME);switch(n.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(n)},e.parseVariableDefinitions=function(){return this.optionalMany(w.PAREN_L,this.parseVariableDefinition,w.PAREN_R)},e.parseVariableDefinition=function(){var n=this._lexer.token;return{kind:j.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(w.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(w.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(n)}},e.parseVariable=function(){var n=this._lexer.token;return this.expectToken(w.DOLLAR),{kind:j.VARIABLE,name:this.parseName(),loc:this.loc(n)}},e.parseSelectionSet=function(){var n=this._lexer.token;return{kind:j.SELECTION_SET,selections:this.many(w.BRACE_L,this.parseSelection,w.BRACE_R),loc:this.loc(n)}},e.parseSelection=function(){return this.peek(w.SPREAD)?this.parseFragment():this.parseField()},e.parseField=function(){var n=this._lexer.token,i=this.parseName(),a,o;return this.expectOptionalToken(w.COLON)?(a=i,o=this.parseName()):o=i,{kind:j.FIELD,alias:a,name:o,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(w.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},e.parseArguments=function(n){var i=n?this.parseConstArgument:this.parseArgument;return this.optionalMany(w.PAREN_L,i,w.PAREN_R)},e.parseArgument=function(){var n=this._lexer.token,i=this.parseName();return this.expectToken(w.COLON),{kind:j.ARGUMENT,name:i,value:this.parseValueLiteral(!1),loc:this.loc(n)}},e.parseConstArgument=function(){var n=this._lexer.token;return{kind:j.ARGUMENT,name:this.parseName(),value:(this.expectToken(w.COLON),this.parseValueLiteral(!0)),loc:this.loc(n)}},e.parseFragment=function(){var n=this._lexer.token;this.expectToken(w.SPREAD);var i=this.expectOptionalKeyword("on");return!i&&this.peek(w.NAME)?{kind:j.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(n)}:{kind:j.INLINE_FRAGMENT,typeCondition:i?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},e.parseFragmentDefinition=function(){var n,i=this._lexer.token;return this.expectKeyword("fragment"),((n=this._options)===null||n===void 0?void 0:n.experimentalFragmentVariables)===!0?{kind:j.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}:{kind:j.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}},e.parseFragmentName=function(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()},e.parseValueLiteral=function(n){var i=this._lexer.token;switch(i.kind){case w.BRACKET_L:return this.parseList(n);case w.BRACE_L:return this.parseObject(n);case w.INT:return this._lexer.advance(),{kind:j.INT,value:i.value,loc:this.loc(i)};case w.FLOAT:return this._lexer.advance(),{kind:j.FLOAT,value:i.value,loc:this.loc(i)};case w.STRING:case w.BLOCK_STRING:return this.parseStringLiteral();case w.NAME:switch(this._lexer.advance(),i.value){case"true":return{kind:j.BOOLEAN,value:!0,loc:this.loc(i)};case"false":return{kind:j.BOOLEAN,value:!1,loc:this.loc(i)};case"null":return{kind:j.NULL,loc:this.loc(i)};default:return{kind:j.ENUM,value:i.value,loc:this.loc(i)}}case w.DOLLAR:if(!n)return this.parseVariable();break}throw this.unexpected()},e.parseStringLiteral=function(){var n=this._lexer.token;return this._lexer.advance(),{kind:j.STRING,value:n.value,block:n.kind===w.BLOCK_STRING,loc:this.loc(n)}},e.parseList=function(n){var i=this,a=this._lexer.token,o=function(){return i.parseValueLiteral(n)};return{kind:j.LIST,values:this.any(w.BRACKET_L,o,w.BRACKET_R),loc:this.loc(a)}},e.parseObject=function(n){var i=this,a=this._lexer.token,o=function(){return i.parseObjectField(n)};return{kind:j.OBJECT,fields:this.any(w.BRACE_L,o,w.BRACE_R),loc:this.loc(a)}},e.parseObjectField=function(n){var i=this._lexer.token,a=this.parseName();return this.expectToken(w.COLON),{kind:j.OBJECT_FIELD,name:a,value:this.parseValueLiteral(n),loc:this.loc(i)}},e.parseDirectives=function(n){for(var i=[];this.peek(w.AT);)i.push(this.parseDirective(n));return i},e.parseDirective=function(n){var i=this._lexer.token;return this.expectToken(w.AT),{kind:j.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(n),loc:this.loc(i)}},e.parseTypeReference=function(){var n=this._lexer.token,i;return this.expectOptionalToken(w.BRACKET_L)?(i=this.parseTypeReference(),this.expectToken(w.BRACKET_R),i={kind:j.LIST_TYPE,type:i,loc:this.loc(n)}):i=this.parseNamedType(),this.expectOptionalToken(w.BANG)?{kind:j.NON_NULL_TYPE,type:i,loc:this.loc(n)}:i},e.parseNamedType=function(){var n=this._lexer.token;return{kind:j.NAMED_TYPE,name:this.parseName(),loc:this.loc(n)}},e.parseTypeSystemDefinition=function(){var n=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(n.kind===w.NAME)switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(n)},e.peekDescription=function(){return this.peek(w.STRING)||this.peek(w.BLOCK_STRING)},e.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},e.parseSchemaDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("schema");var a=this.parseDirectives(!0),o=this.many(w.BRACE_L,this.parseOperationTypeDefinition,w.BRACE_R);return{kind:j.SCHEMA_DEFINITION,description:i,directives:a,operationTypes:o,loc:this.loc(n)}},e.parseOperationTypeDefinition=function(){var n=this._lexer.token,i=this.parseOperationType();this.expectToken(w.COLON);var a=this.parseNamedType();return{kind:j.OPERATION_TYPE_DEFINITION,operation:i,type:a,loc:this.loc(n)}},e.parseScalarTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("scalar");var a=this.parseName(),o=this.parseDirectives(!0);return{kind:j.SCALAR_TYPE_DEFINITION,description:i,name:a,directives:o,loc:this.loc(n)}},e.parseObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("type");var a=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:j.OBJECT_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:u,loc:this.loc(n)}},e.parseImplementsInterfaces=function(){var n;if(!this.expectOptionalKeyword("implements"))return[];if(((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLImplementsInterfaces)===!0){var i=[];this.expectOptionalToken(w.AMP);do i.push(this.parseNamedType());while(this.expectOptionalToken(w.AMP)||this.peek(w.NAME));return i}return this.delimitedMany(w.AMP,this.parseNamedType)},e.parseFieldsDefinition=function(){var n;return((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLEmptyFields)===!0&&this.peek(w.BRACE_L)&&this._lexer.lookahead().kind===w.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(w.BRACE_L,this.parseFieldDefinition,w.BRACE_R)},e.parseFieldDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseArgumentDefs();this.expectToken(w.COLON);var s=this.parseTypeReference(),u=this.parseDirectives(!0);return{kind:j.FIELD_DEFINITION,description:i,name:a,arguments:o,type:s,directives:u,loc:this.loc(n)}},e.parseArgumentDefs=function(){return this.optionalMany(w.PAREN_L,this.parseInputValueDef,w.PAREN_R)},e.parseInputValueDef=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName();this.expectToken(w.COLON);var o=this.parseTypeReference(),s;this.expectOptionalToken(w.EQUALS)&&(s=this.parseValueLiteral(!0));var u=this.parseDirectives(!0);return{kind:j.INPUT_VALUE_DEFINITION,description:i,name:a,type:o,defaultValue:s,directives:u,loc:this.loc(n)}},e.parseInterfaceTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("interface");var a=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:j.INTERFACE_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:u,loc:this.loc(n)}},e.parseUnionTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("union");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseUnionMemberTypes();return{kind:j.UNION_TYPE_DEFINITION,description:i,name:a,directives:o,types:s,loc:this.loc(n)}},e.parseUnionMemberTypes=function(){return this.expectOptionalToken(w.EQUALS)?this.delimitedMany(w.PIPE,this.parseNamedType):[]},e.parseEnumTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("enum");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseEnumValuesDefinition();return{kind:j.ENUM_TYPE_DEFINITION,description:i,name:a,directives:o,values:s,loc:this.loc(n)}},e.parseEnumValuesDefinition=function(){return this.optionalMany(w.BRACE_L,this.parseEnumValueDefinition,w.BRACE_R)},e.parseEnumValueDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseDirectives(!0);return{kind:j.ENUM_VALUE_DEFINITION,description:i,name:a,directives:o,loc:this.loc(n)}},e.parseInputObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("input");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseInputFieldsDefinition();return{kind:j.INPUT_OBJECT_TYPE_DEFINITION,description:i,name:a,directives:o,fields:s,loc:this.loc(n)}},e.parseInputFieldsDefinition=function(){return this.optionalMany(w.BRACE_L,this.parseInputValueDef,w.BRACE_R)},e.parseTypeSystemExtension=function(){var n=this._lexer.lookahead();if(n.kind===w.NAME)switch(n.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(n)},e.parseSchemaExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var i=this.parseDirectives(!0),a=this.optionalMany(w.BRACE_L,this.parseOperationTypeDefinition,w.BRACE_R);if(i.length===0&&a.length===0)throw this.unexpected();return{kind:j.SCHEMA_EXTENSION,directives:i,operationTypes:a,loc:this.loc(n)}},e.parseScalarTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var i=this.parseName(),a=this.parseDirectives(!0);if(a.length===0)throw this.unexpected();return{kind:j.SCALAR_TYPE_EXTENSION,name:i,directives:a,loc:this.loc(n)}},e.parseObjectTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var i=this.parseName(),a=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),s=this.parseFieldsDefinition();if(a.length===0&&o.length===0&&s.length===0)throw this.unexpected();return{kind:j.OBJECT_TYPE_EXTENSION,name:i,interfaces:a,directives:o,fields:s,loc:this.loc(n)}},e.parseInterfaceTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var i=this.parseName(),a=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),s=this.parseFieldsDefinition();if(a.length===0&&o.length===0&&s.length===0)throw this.unexpected();return{kind:j.INTERFACE_TYPE_EXTENSION,name:i,interfaces:a,directives:o,fields:s,loc:this.loc(n)}},e.parseUnionTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseUnionMemberTypes();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:j.UNION_TYPE_EXTENSION,name:i,directives:a,types:o,loc:this.loc(n)}},e.parseEnumTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseEnumValuesDefinition();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:j.ENUM_TYPE_EXTENSION,name:i,directives:a,values:o,loc:this.loc(n)}},e.parseInputObjectTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseInputFieldsDefinition();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:j.INPUT_OBJECT_TYPE_EXTENSION,name:i,directives:a,fields:o,loc:this.loc(n)}},e.parseDirectiveDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("directive"),this.expectToken(w.AT);var a=this.parseName(),o=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var u=this.parseDirectiveLocations();return{kind:j.DIRECTIVE_DEFINITION,description:i,name:a,arguments:o,repeatable:s,locations:u,loc:this.loc(n)}},e.parseDirectiveLocations=function(){return this.delimitedMany(w.PIPE,this.parseDirectiveLocation)},e.parseDirectiveLocation=function(){var n=this._lexer.token,i=this.parseName();if(a1[i.value]!==void 0)return i;throw this.unexpected(n)},e.loc=function(n){var i;if(((i=this._options)===null||i===void 0?void 0:i.noLocation)!==!0)return new 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 it(this._lexer.source,i.start,"Expected ".concat(mp(n),", found ").concat(Ps(i),"."))},e.expectOptionalToken=function(n){var i=this._lexer.token;if(i.kind===n)return this._lexer.advance(),i},e.expectKeyword=function(n){var i=this._lexer.token;if(i.kind===w.NAME&&i.value===n)this._lexer.advance();else throw it(this._lexer.source,i.start,'Expected "'.concat(n,'", found ').concat(Ps(i),"."))},e.expectOptionalKeyword=function(n){var i=this._lexer.token;return i.kind===w.NAME&&i.value===n?(this._lexer.advance(),!0):!1},e.unexpected=function(n){var i=n??this._lexer.token;return it(this._lexer.source,i.start,"Unexpected ".concat(Ps(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 Ps(r){var e=r.value;return mp(r.kind)+(e!=null?' "'.concat(e,'"'):"")}function mp(r){return u1(r)?'"'.concat(r,'"'):r}var Ta=new Map,Us=new Map,yp=!0,La=!1;function gp(r){return r.replace(/[\s,]+/g," ").trim()}function S1(r){return gp(r.source.body.substring(r.start,r.end))}function w1(r){var e=new Set,t=[];return r.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,a=S1(n.loc),o=Us.get(i);o&&!o.has(a)?yp&&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)}),Ra(Ra({},r),{definitions:t})}function w1(r){var e=new Set(r.definitions);e.forEach(function(n){n.loc&&delete n.loc,Object.keys(n).forEach(function(i){var a=n[i];a&&typeof a=="object"&&e.add(a)})});var t=r.loc;return t&&(delete t.startToken,delete t.endToken),r}function _1(r){var e=yp(r);if(!Ta.has(e)){var t=v1(r,{experimentalFragmentVariables:La,allowLegacyFragmentVariables:La});if(!t||t.kind!=="Document")throw new Error("Not a valid GraphQL document.");Ta.set(e,w1(S1(t)))}return Ta.get(e)}function E(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];typeof r=="string"&&(r=[r]);var n=r[0];return e.forEach(function(i,a){i&&i.kind==="Document"?n+=i.loc.source.body:n+=i,n+=r[a+1]}),_1(n)}function E1(){Ta.clear(),Us.clear()}function x1(){mp=!1}function O1(){La=!0}function T1(){La=!1}var ri={gql:E,resetCaches:E1,disableFragmentWarnings:x1,enableExperimentalFragmentVariables:O1,disableExperimentalFragmentVariables:T1};(function(r){r.gql=ri.gql,r.resetCaches=ri.resetCaches,r.disableFragmentWarnings=ri.disableFragmentWarnings,r.enableExperimentalFragmentVariables=ri.enableExperimentalFragmentVariables,r.disableExperimentalFragmentVariables=ri.disableExperimentalFragmentVariables})(E||(E={}));E.default=E;function A(r){if(!r)throw"Got no result from Apollo";if(r.error)throw r.error;if(r.errors)throw r.errors;return r.data}function A1(){}function Zs(){return A1}var v=Zs,Ge=Zs,J=Zs,gp=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},vp=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},jr=class{constructor(e){this.code=e}};gp([v(),vp("design:type",String)],jr.prototype,"code",void 0);jr=gp([J(),vp("design:paramtypes",[String])],jr);var ec=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},tc=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},xt=class{constructor(e,t){this.address=e,this.name=t}};ec([v(),tc("design:type",String)],xt.prototype,"address",void 0);ec([v(),tc("design:type",String)],xt.prototype,"name",void 0);xt=ec([J(),tc("design:paramtypes",[String,String])],xt);var fe=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},Te=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},ir=class{constructor(e,t){this.key=t,this.signature=e}};fe([v(),Te("design:type",String)],ir.prototype,"signature",void 0);fe([v(),Te("design:type",String)],ir.prototype,"key",void 0);fe([v(),Te("design:type",Boolean)],ir.prototype,"valid",void 0);fe([v(),Te("design:type",Boolean)],ir.prototype,"invalid",void 0);ir=fe([J(),Ge(),Te("design:paramtypes",[String,String])],ir);var Ur=class{};fe([v(),Te("design:type",String)],Ur.prototype,"signature",void 0);fe([v(),Te("design:type",String)],Ur.prototype,"key",void 0);fe([v(),Te("design:type",Boolean)],Ur.prototype,"valid",void 0);fe([v(),Te("design:type",Boolean)],Ur.prototype,"invalid",void 0);Ur=fe([Ge()],Ur);function lr(r){let e=class{constructor(n,i,a,o){this.author=n,this.timestamp=i,this.data=a,this.proof=o}};return fe([v(),Te("design:type",String)],e.prototype,"author",void 0),fe([v(),Te("design:type",String)],e.prototype,"timestamp",void 0),fe([v(),Te("design:type",Object)],e.prototype,"data",void 0),fe([v(),Te("design:type",ir)],e.prototype,"proof",void 0),e=fe([J(),Te("design:paramtypes",[String,String,Object,ir])],e),e}function I1(r){let e=class{};return fe([v(),Te("design:type",String)],e.prototype,"author",void 0),fe([v(),Te("design:type",String)],e.prototype,"timestamp",void 0),fe([v(),Te("design:type",Object)],e.prototype,"data",void 0),fe([v(),Te("design:type",Ur)],e.prototype,"proof",void 0),e=fe([Ge()],e),e}var Ql=class extends lr(){};Ql=fe([J()],Ql);var Fa=class extends lr(){};fe([v(),Te("design:type",xt)],Fa.prototype,"language",void 0);fe([v(),Te("design:type",jr)],Fa.prototype,"icon",void 0);Fa=fe([J()],Fa);function _6(r){return r&&r.author&&r.timestamp&&r.data}var Ee=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},$e=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Ot=class{constructor(e){this.source=e.source?e.source:"",this.target=e.target?e.target:"",this.predicate=e.predicate?e.predicate:""}};Ee([v(),$e("design:type",String)],Ot.prototype,"source",void 0);Ee([v(),$e("design:type",String)],Ot.prototype,"target",void 0);Ee([v(),$e("design:type",String)],Ot.prototype,"predicate",void 0);Ot=Ee([J(),$e("design:paramtypes",[Object])],Ot);var $a=class{};Ee([v(),$e("design:type",Array)],$a.prototype,"additions",void 0);Ee([v(),$e("design:type",Array)],$a.prototype,"removals",void 0);$a=Ee([Ge()],$a);var Ma=class{constructor(e,t){this.additions=e,this.removals=t}};Ee([v(),$e("design:type",Array)],Ma.prototype,"additions",void 0);Ee([v(),$e("design:type",Array)],Ma.prototype,"removals",void 0);Ma=Ee([J(),$e("design:paramtypes",[Array,Array])],Ma);var Ci=class{};Ee([v(),$e("design:type",String)],Ci.prototype,"source",void 0);Ee([v(),$e("design:type",String)],Ci.prototype,"target",void 0);Ee([v(),$e("design:type",String)],Ci.prototype,"predicate",void 0);Ci=Ee([Ge()],Ci);var qr=class extends lr(){hash(){let e=JSON.stringify(this.data,Object.keys(this.data).sort())+JSON.stringify(this.author)+this.timestamp,t=0,n,i;for(n=0;n<e.length;n++)i=e.charCodeAt(n),t=(t<<5)-t+i,t|=0;return t}};Ee([v(),$e("design:type",String)],qr.prototype,"status",void 0);qr=Ee([J()],qr);var qs=class extends I1(){};Ee([v(),$e("design:type",String)],qs.prototype,"status",void 0);qs=Ee([Ge()],qs);function k6(r,e){return r.author==e.author&&r.timestamp==e.timestamp&&r.data.source==e.data.source&&r.data.predicate==e.data.predicate&&r.data.target==e.data.target}function D6(r){return r&&r.source&&r.target}var ja=class{constructor(e,t){this.oldLink=e,this.newLink=t}};Ee([v(),$e("design:type",qr)],ja.prototype,"oldLink",void 0);Ee([v(),$e("design:type",qr)],ja.prototype,"newLink",void 0);ja=Ee([J(),$e("design:paramtypes",[qr,qr])],ja);var Vr=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},Ei=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Bs,ar=class{constructor(e){e?this.links=e:this.links=[]}get(e){if(!e||!e.source&&!e.predicate&&!e.target)return this.links;if(e.source){let n=JSON.parse(JSON.stringify(this.links));return e.target&&(n=n.filter(i=>i.data.target===e.target)),e.predicate&&(n=n.filter(i=>i.data.predicate===e.predicate)),e.fromDate&&(n=n.filter(i=>new Date(i.timestamp)>=e.fromDate)),e.untilDate&&(n=n.filter(i=>new Date(i.timestamp)<=e.untilDate)),e.limit&&(n=n.slice(0,e.limit)),n}if(e.target){let n=JSON.parse(JSON.stringify(this.links));return e.predicate&&(n=n.filter(i=>i.data.predicate===e.predicate)),e.fromDate&&(n=n.filter(i=>new Date(i.timestamp)>=e.fromDate)),e.untilDate&&(n=n.filter(i=>new Date(i.timestamp)<=e.untilDate)),e.limit&&(n=n.slice(0,e.limit)),n}let t=JSON.parse(JSON.stringify(this.links));return t=t.filter(n=>n.data.predicate===e.predicate),e.limit&&(t=t.slice(0,e.limit)),t}getSingleTarget(e){delete e.target;let t=this.get(e);return t.length?t[0].data.target:null}};Vr([v(),Ei("design:type",Array)],ar.prototype,"links",void 0);ar=Vr([J(),Ei("design:paramtypes",[Array])],ar);var Vs=class{};Vr([v(),Ei("design:type",Array)],Vs.prototype,"links",void 0);Vs=Vr([Ge()],Vs);var Qs=Bs=class{constructor(e){e?this.links=e:this.links=[]}static fromLink(e){let t=new Bs;return t.links.push(e),t}};Vr([v(),Ei("design:type",Array)],Qs.prototype,"links",void 0);Qs=Bs=Vr([Ge(),Ei("design:paramtypes",[Array])],Qs);var Ws=class extends lr(){};Ws=Vr([J()],Ws);var F=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},$=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},rr=class{constructor(e,t){this.did=e,t?this.perspective=t:this.perspective=new ar}};F([v(),$("design:type",String)],rr.prototype,"did",void 0);F([v(),$("design:type",ar)],rr.prototype,"perspective",void 0);F([v(),$("design:type",String)],rr.prototype,"directMessageLanguage",void 0);rr=F([J(),$("design:paramtypes",[String,ar])],rr);var Wl=class extends lr(){};Wl=F([J()],Wl);var or=class{constructor(e,t,n,i,a,o){this.did=e,this.didSigningKeyId=t,this.deviceKeyType=n,this.deviceKey=i,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};F([v(),$("design:type",String)],or.prototype,"did",void 0);F([v(),$("design:type",String)],or.prototype,"didSigningKeyId",void 0);F([v(),$("design:type",String)],or.prototype,"deviceKeyType",void 0);F([v(),$("design:type",String)],or.prototype,"deviceKey",void 0);F([v(),$("design:type",String)],or.prototype,"deviceKeySignedByDid",void 0);F([v(),$("design:type",String)],or.prototype,"didSignedByDeviceKey",void 0);or=F([J(),$("design:paramtypes",[String,String,String,String,String,String])],or);var sr=class{constructor(e,t,n,i,a,o){this.did=e,this.didSigningKeyId=t,this.deviceKeyType=n,this.deviceKey=i,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};F([v(),$("design:type",String)],sr.prototype,"did",void 0);F([v(),$("design:type",String)],sr.prototype,"didSigningKeyId",void 0);F([v(),$("design:type",String)],sr.prototype,"deviceKeyType",void 0);F([v(),$("design:type",String)],sr.prototype,"deviceKey",void 0);F([v(),$("design:type",String)],sr.prototype,"deviceKeySignedByDid",void 0);F([v(),$("design:type",String)],sr.prototype,"didSignedByDeviceKey",void 0);sr=F([Ge(),$("design:paramtypes",[String,String,String,String,String,String])],sr);var Ua=class{constructor(e,t){this.signature=e,this.publicKey=t}};F([v(),$("design:type",String)],Ua.prototype,"signature",void 0);F([v(),$("design:type",String)],Ua.prototype,"publicKey",void 0);Ua=F([J(),$("design:paramtypes",[String,String])],Ua);var wn=class{constructor(e,t){this.domain=e,this.pointers=t}};F([v(),$("design:type",String)],wn.prototype,"domain",void 0);F([v(),$("design:type",Array)],wn.prototype,"pointers",void 0);wn=F([J(),$("design:paramtypes",[String,Array])],wn);var qa=class{constructor(e,t){this.with=e,this.can=t}};F([v(),$("design:type",wn)],qa.prototype,"with",void 0);F([v(),$("design:type",Array)],qa.prototype,"can",void 0);qa=F([J(),$("design:paramtypes",[wn,Array])],qa);var jt=class{constructor(e,t,n,i,a){this.appName=e,this.appDesc=t,this.appIconPath=a,this.appUrl=n,this.capabilities=i}};F([v(),$("design:type",String)],jt.prototype,"appName",void 0);F([v(),$("design:type",String)],jt.prototype,"appDesc",void 0);F([v(),$("design:type",String)],jt.prototype,"appUrl",void 0);F([v(),$("design:type",String)],jt.prototype,"appIconPath",void 0);F([v(),$("design:type",Array)],jt.prototype,"capabilities",void 0);jt=F([J(),$("design:paramtypes",[String,String,String,Array,String])],jt);var _n=class{constructor(e,t,n,i){this.requestId=e,this.auth=t,this.token=n,this.revoked=i}};F([v(),$("design:type",String)],_n.prototype,"requestId",void 0);F([v(),$("design:type",String)],_n.prototype,"token",void 0);F([v(),$("design:type",Boolean)],_n.prototype,"revoked",void 0);F([v(),$("design:type",jt)],_n.prototype,"auth",void 0);_n=F([J(),$("design:paramtypes",[String,jt,String,Boolean])],_n);var En=class{constructor(e,t){this.domain=e,this.pointers=t}};F([v(),$("design:type",String)],En.prototype,"domain",void 0);F([v(),$("design:type",Array)],En.prototype,"pointers",void 0);En=F([Ge(),$("design:paramtypes",[String,Array])],En);var Ba=class{constructor(e,t){this.with=e,this.can=t}};F([v(),$("design:type",En)],Ba.prototype,"with",void 0);F([v(),$("design:type",Array)],Ba.prototype,"can",void 0);Ba=F([Ge(),$("design:paramtypes",[En,Array])],Ba);var cr=class{constructor(e,t,n,i,a,o){this.appName=e,this.appDesc=t,this.appUrl=i,this.appDomain=n,this.capabilities=o,this.appIconPath=a}};F([v(),$("design:type",String)],cr.prototype,"appName",void 0);F([v(),$("design:type",String)],cr.prototype,"appDesc",void 0);F([v(),$("design:type",String)],cr.prototype,"appDomain",void 0);F([v(),$("design:type",String)],cr.prototype,"appUrl",void 0);F([v(),$("design:type",String)],cr.prototype,"appIconPath",void 0);F([v(),$("design:type",Array)],cr.prototype,"capabilities",void 0);cr=F([Ge(),$("design:paramtypes",[String,String,String,String,String,Array])],cr);var On=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},Tn=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},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)}};On([v(),Tn("design:type",Boolean)],ct.prototype,"isInitialized",void 0);On([v(),Tn("design:type",Boolean)],ct.prototype,"isUnlocked",void 0);On([v(),Tn("design:type",String)],ct.prototype,"did",void 0);On([v(),Tn("design:type",String)],ct.prototype,"didDocument",void 0);On([v(),Tn("design:type",String)],ct.prototype,"error",void 0);ct=On([J(),Tn("design:paramtypes",[Object])],ct);var Gl=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ce=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Ye,Xe,Gs=class{constructor(e,t){Ye.set(this,void 0),Xe.set(this,void 0),Gl(this,Ye,e,"f"),Gl(this,Xe,t,"f")}async otherAgents(){return await Ce(this,Ye,"f").otherAgents(Ce(this,Xe,"f"))}async hasTelepresenceAdapter(){return await Ce(this,Ye,"f").hasTelepresenceAdapter(Ce(this,Xe,"f"))}async onlineAgents(){return await Ce(this,Ye,"f").onlineAgents(Ce(this,Xe,"f"))}async setOnlineStatus(e){return await Ce(this,Ye,"f").setOnlineStatus(Ce(this,Xe,"f"),e)}async setOnlineStatusU(e){return await Ce(this,Ye,"f").setOnlineStatusU(Ce(this,Xe,"f"),e)}async sendSignal(e,t){return await Ce(this,Ye,"f").sendSignal(Ce(this,Xe,"f"),e,t)}async sendSignalU(e,t){return await Ce(this,Ye,"f").sendSignalU(Ce(this,Xe,"f"),e,t)}async sendBroadcast(e){return await Ce(this,Ye,"f").sendBroadcast(Ce(this,Xe,"f"),e)}async sendBroadcastU(e){return await Ce(this,Ye,"f").sendBroadcastU(Ce(this,Xe,"f"),e)}async addSignalHandler(e){await Ce(this,Ye,"f").addSignalHandler(Ce(this,Xe,"f"),e)}removeSignalHandler(e){Ce(this,Ye,"f").removeSignalHandler(Ce(this,Xe,"f"),e)}};Ye=new WeakMap,Xe=new WeakMap;var Qr=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},Wr=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},We=class{constructor(e){e&&(this.source=e.source,this.predicate=e.predicate,this.target=e.target,e.fromDate&&(this.fromDate=e.fromDate),e.untilDate&&(this.untilDate=e.untilDate),e.limit&&(this.limit=e.limit))}isMatch(e){return!(this.source&&this.source!==e.source||this.predicate&&this.predicate!==e.predicate||this.target&&this.target!==e.target)}};Qr([v(),Wr("design:type",String)],We.prototype,"source",void 0);Qr([v(),Wr("design:type",String)],We.prototype,"target",void 0);Qr([v(),Wr("design:type",String)],We.prototype,"predicate",void 0);Qr([v(),Wr("design:type",Date)],We.prototype,"fromDate",void 0);Qr([v(),Wr("design:type",Date)],We.prototype,"untilDate",void 0);Qr([v(),Wr("design:type",Number)],We.prototype,"limit",void 0);We=Qr([J(),Ge(),Wr("design:paramtypes",[Object])],We);var Kl=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Je=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},mt,Lt;function Rs(r){return encodeURIComponent(r).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}var Tt=class{constructor(){mt.set(this,void 0),Lt.set(this,void 0)}static fromUrl(e){if(!e||!e.startsWith("literal://"))throw new Error("Can't create Literal from non-literal URL");let t=new Tt;return Kl(t,Lt,e,"f"),t}static from(e){let t=new Tt;return Kl(t,mt,e,"f"),t}toUrl(){if(Je(this,Lt,"f")&&!Je(this,mt,"f"))return Je(this,Lt,"f");if(!Je(this,Lt,"f")&&!Je(this,mt,"f"))throw new Error("Can't turn empty Literal into URL");let e;switch(typeof Je(this,mt,"f")){case"string":e=`string:${Rs(Je(this,mt,"f"))}`;break;case"number":e=`number:${Rs(Je(this,mt,"f"))}`;break;case"object":e=`json:${Rs(JSON.stringify(Je(this,mt,"f")))}`;break}return`literal://${e}`}get(){if(Je(this,mt,"f"))return Je(this,mt,"f");if(!Je(this,Lt,"f"))throw new Error("Can't render empty Literal");if(!Je(this,Lt,"f").startsWith("literal://"))throw new Error("Can't render Literal from non-literal URL");let e=Je(this,Lt,"f").substring(10);if(e.startsWith("string:"))return decodeURIComponent(e.substring(7));if(e.startsWith("number:")){let t=e.substring(7);return parseFloat(t)}if(e.startsWith("json:")){let t=e.substring(5);return JSON.parse(decodeURIComponent(t))}throw new Error(`Can't parse unknown literal: ${e}`)}};mt=new WeakMap,Lt=new WeakMap;function nr(r){return r.charAt(0).toUpperCase()+r.slice(1)}function bp(r){return`set${nr(r)}`}function Mt(r){return r.endsWith("y")?r.slice(0,-1)+"ies":r+"s"}function rc(r){return r.endsWith("ies")?r.slice(0,-3)+"y":r.endsWith("s")?r.slice(0,-1):r}function k1(r){return`add${nr(rc(r))}`}function D1(r){let e=r.substring(3),t=Mt(e);return t.charAt(0).toLowerCase()+t.slice(1)}function N1(r){return`remove${nr(rc(r))}`}function P1(r){let e=r.substring(6),t=Mt(e);return t.charAt(0).toLowerCase()+t.slice(1)}function R1(r){let e=r.substring(13),t=Mt(e);return t.charAt(0).toLowerCase()+t.slice(1)}function L1(r){return`setCollection${nr(rc(r))}`}function Dr(r){if(Array.isArray(r))return`[${r.map(Dr).join(", ")}]`;let e=Object.keys(r),t=[];for(let n of e){let i=JSON.stringify(r[n]),a=`${n}: ${i}`;t.push(a)}return`{${t.join(", ")}}`}var Ls=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},q=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},qe,Be,he,Va=class{constructor(r,e,t){qe.set(this,void 0),Be.set(this,void 0),he.set(this,void 0),Ls(this,qe,e,"f"),Ls(this,Be,t,"f"),Ls(this,he,r,"f")}get baseExpression(){return q(this,qe,"f")}async init(){let isInstance=await q(this,he,"f").isSubjectInstance(q(this,qe,"f"),q(this,Be,"f"));if(!isInstance)throw`Not a valid subject instance of ${q(this,Be,"f")} for ${q(this,qe,"f")}`;let results=await q(this,he,"f").infer(`subject_class("${q(this,Be,"f")}", C), property(C, Property)`),properties=results.map(r=>r.Property);for(let r of properties){let e=await q(this,he,"f").infer(`subject_class("${q(this,Be,"f")}", C), property_resolve(C, "${r}")`);Object.defineProperty(this,r,{configurable:!0,get:async()=>{let t=await q(this,he,"f").infer(`subject_class("${q(this,Be,"f")}", C), property_getter(C, "${q(this,qe,"f")}", "${r}", Value)`);if(t&&t.length>0){let n=t[0].Value;if(e)try{if(n){let i=await q(this,he,"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 q(this,he,"f").infer(`subject_class("${q(this,Be,"f")}", C), property_setter(C, Property, Setter)`);for(let setter of setters||[])if(setter){let property=setter.Property,actions=eval(setter.Setter),resolveLanguageResults=await q(this,he,"f").infer(`subject_class("${q(this,Be,"f")}", C), property_resolve_language(C, "${property}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),this[bp(property)]=async r=>{resolveLanguage&&(r=await q(this,he,"f").createExpression(r,resolveLanguage)),await q(this,he,"f").executeAction(actions,q(this,qe,"f"),[{name:"value",value:r}])}}let results2=await q(this,he,"f").infer(`subject_class("${q(this,Be,"f")}", C), collection(C, Collection)`);results2||(results2=[]);let collections=results2.map(r=>r.Collection);for(let r of collections)Object.defineProperty(this,r,{configurable:!0,get:async()=>{let e=await q(this,he,"f").infer(`subject_class("${q(this,Be,"f")}", C), collection_getter(C, "${q(this,qe,"f")}", "${r}", Value)`);return e&&e.length>0&&e[0].Value?e[0].Value.filter(n=>n!==""&&n!==""):[]}});let adders=await q(this,he,"f").infer(`subject_class("${q(this,Be,"f")}", C), collection_adder(C, Collection, Adder)`);adders||(adders=[]);for(let adder of adders)if(adder){let collection=adder.Collection,actions=eval(adder.Adder);this[k1(collection)]=async r=>{Array.isArray(r)?await Promise.all(r.map(e=>q(this,he,"f").executeAction(actions,q(this,qe,"f"),[{name:"value",value:e}]))):await q(this,he,"f").executeAction(actions,q(this,qe,"f"),[{name:"value",value:r}])}}let removers=await q(this,he,"f").infer(`subject_class("${q(this,Be,"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[N1(collection)]=async r=>{Array.isArray(r)?await Promise.all(r.map(e=>q(this,he,"f").executeAction(actions,q(this,qe,"f"),[{name:"value",value:e}]))):await q(this,he,"f").executeAction(actions,q(this,qe,"f"),[{name:"value",value:r}])}}let collectionSetters=await q(this,he,"f").infer(`subject_class("${q(this,Be,"f")}", C), collection_setter(C, Collection, Setter)`);collectionSetters||(collectionSetters=[]);for(let collectionSetter of collectionSetters)if(collectionSetter){let collection=collectionSetter.Collection,actions=eval(collectionSetter.Setter);this[L1(collection)]=async r=>{Array.isArray(r)?await q(this,he,"f").executeAction(actions,q(this,qe,"f"),r.map(e=>({name:"value",value:e}))):await q(this,he,"f").executeAction(actions,q(this,qe,"f"),[{name:"value",value:r}])}}}};qe=new WeakMap,Be=new WeakMap,he=new WeakMap;var mn=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},L=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)},pe,_e,Nr,Pr,Rr,ai,Sn=class{constructor(r,e){pe.set(this,void 0),_e.set(this,void 0),Nr.set(this,void 0),Pr.set(this,void 0),Rr.set(this,void 0),ai.set(this,void 0),mn(this,Nr,[],"f"),mn(this,Pr,[],"f"),mn(this,Rr,[],"f"),mn(this,ai,[],"f"),mn(this,pe,r,"f"),mn(this,_e,e,"f"),this.uuid=L(this,pe,"f").uuid,this.name=L(this,pe,"f").name,this.sharedUrl=L(this,pe,"f").sharedUrl,this.neighbourhood=L(this,pe,"f").neighbourhood,this.state=L(this,pe,"f").state,L(this,_e,"f").addPerspectiveLinkAddedListener(L(this,pe,"f").uuid,L(this,Nr,"f")),L(this,_e,"f").addPerspectiveLinkRemovedListener(L(this,pe,"f").uuid,L(this,Pr,"f")),L(this,_e,"f").addPerspectiveLinkUpdatedListener(L(this,pe,"f").uuid,L(this,Rr,"f")),L(this,_e,"f").addPerspectiveSyncStateChangeListener(L(this,pe,"f").uuid,L(this,ai,"f"))}async executeAction(r,e,t){let n=a=>{if(a)return a==="this"?e:a},i=a=>{if(t){let o=a;for(let s of t)o=o.replace(s.name,s.value);return o}else return a};for(let a of r){let o=n(i(a.source)),s=n(i(a.predicate)),u=n(i(a.target)),l=a?.local??!1;switch(a.action){case"addLink":await this.add(new Ot({source:o,predicate:s,target:u}),l?"local":"shared");break;case"removeLink":let p=await this.get(new We({source:o,predicate:s,target:u}));for(let h of p)await this.remove(h);break;case"setSingleTarget":await this.setSingleTarget(new Ot({source:o,predicate:s,target:u}),l?"local":"shared");break;case"collectionSetter":let f=await this.get(new We({source:o,predicate:s}));await this.removeLinks(f),await this.addLinks(t.map(h=>new Ot({source:o,predicate:s,target:h.value})),l?"local":"shared");break}}}async get(r){return await L(this,_e,"f").queryLinks(L(this,pe,"f").uuid,r)}async infer(r){return await L(this,_e,"f").queryProlog(L(this,pe,"f").uuid,r)}async add(r,e="shared"){return await L(this,_e,"f").addLink(L(this,pe,"f").uuid,r,e)}async addLinks(r,e="shared"){return await L(this,_e,"f").addLinks(L(this,pe,"f").uuid,r,e)}async removeLinks(r){return await L(this,_e,"f").removeLinks(L(this,pe,"f").uuid,r)}async linkMutations(r,e="shared"){return await L(this,_e,"f").linkMutations(L(this,pe,"f").uuid,r,e)}async addLinkExpression(r,e="shared"){return await L(this,_e,"f").addLinkExpression(L(this,pe,"f").uuid,r,e)}async update(r,e){return await L(this,_e,"f").updateLink(L(this,pe,"f").uuid,r,e)}async remove(r){return await L(this,_e,"f").removeLink(L(this,pe,"f").uuid,r)}async getExpression(r){return await L(this,_e,"f").getExpression(r)}async createExpression(r,e){return await L(this,_e,"f").createExpression(r,e)}async addListener(r,e){r==="link-added"?L(this,Nr,"f").push(e):r==="link-removed"?L(this,Pr,"f").push(e):r==="link-updated"&&L(this,Rr,"f").push(e)}async addSyncStateChangeListener(r){L(this,ai,"f").push(r)}async removeListener(r,e){if(r==="link-added"){let t=L(this,Nr,"f").indexOf(e);L(this,Nr,"f").splice(t,1)}else if(r==="link-removed"){let t=L(this,Pr,"f").indexOf(e);L(this,Pr,"f").splice(t,1)}else if(r==="link-updated"){let t=L(this,Rr,"f").indexOf(e);L(this,Rr,"f").splice(t,1)}}async snapshot(){return L(this,_e,"f").snapshotByUUID(L(this,pe,"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 We({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 We({predicate:"ad4m://sdna"}))).map(e=>e.data.target).map(e=>Tt.fromUrl(e).get())}async addSdna(r,e,t){return L(this,_e,"f").addSdna(L(this,pe,"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(subjectClass,exprAddr){let className=await this.stringOrTemplateObjectToSubjectClass(subjectClass),result=await this.infer(`subject_class("${className}", C), constructor(C, Actions)`);if(!result.length)throw"No constructor found for given subject class: "+className;let actions=result.map(x=>eval(x.Actions));return await this.executeAction(actions[0],exprAddr,void 0),this.getSubjectProxy(exprAddr,subjectClass)}async removeSubject(subjectClass,exprAddr){let className=await this.stringOrTemplateObjectToSubjectClass(subjectClass),result=await this.infer(`subject_class("${className}", C), destructor(C, Actions)`);if(!result.length)throw"No constructor found for given subject class: "+className;let actions=result.map(x=>eval(x.Actions));await this.executeAction(actions[0],exprAddr,void 0)}async isSubjectInstance(r,e){let t=await this.stringOrTemplateObjectToSubjectClass(e);return await this.infer(`subject_class("${t}", C), instance(C, "${r}")`)}async getSubjectProxy(r,e){if(!await this.isSubjectInstance(r,e))throw`Expression ${r} is not a subject instance of given class: ${JSON.stringify(e)}`;let t=await this.stringOrTemplateObjectToSubjectClass(e),n=new Va(this,r,t);return await n.init(),n}async getAllSubjectInstances(r){let e=[];typeof r=="string"?e=[r]:e=await this.subjectClassesByTemplate(r);let t=[];for(let n of e){let i=await this.infer(`subject_class("${n}", C), instance(C, X)`),a=await Promise.all(i.map(async o=>await this.getSubjectProxy(o.X,n)));t=t.concat(a)}return t}async getAllSubjectProxies(r){let e=[];typeof r=="string"?e=[r]:e=await this.subjectClassesByTemplate(r);let t=[];for(let n of e)t=await this.infer(`subject_class("${n}", C), instance(C, X)`);return t}async subjectClassesByTemplate(r){let e=[],t=[];Object.getPrototypeOf(r).__properties?Object.keys(Object.getPrototypeOf(r).__properties).forEach(l=>e.push(l)):e.push(...Object.keys(r).filter(l=>!Array.isArray(r[l]))),Object.getPrototypeOf(r).__collections?Object.keys(Object.getPrototypeOf(r).__collections).filter(l=>l!=="isSubjectInstance").forEach(l=>!t.includes(l)):t.push(...Object.keys(r).filter(l=>Array.isArray(r[l])).filter(l=>l!=="isSubjectInstance"));let n=Object.getOwnPropertyNames(r).filter(l=>typeof r[l]=="function"&&l.startsWith("set")&&!l.startsWith("setCollection"));n=n.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>typeof r[l]=="function"&&l.startsWith("set")&&!l.startsWith("setCollection")));let i=Object.getOwnPropertyNames(r).filter(l=>typeof r[l]=="function"&&l.startsWith("add"));i=i.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>typeof r[l]=="function"&&l.startsWith("add")));let a=Object.getOwnPropertyNames(r).filter(l=>typeof r[l]=="function"&&l.startsWith("remove"));a=a.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>typeof r[l]=="function"&&l.startsWith("remove")));let o=Object.getOwnPropertyNames(r).filter(l=>typeof r[l]=="function"&&l.startsWith("setCollection"));o=o.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>typeof r[l]=="function"&&l.startsWith("setCollection")));let s="subject_class(Class, C)";for(let l of e)s+=`, property(C, "${l}")`;for(let l of t)s+=`, collection(C, "${l}")`;for(let l of n){let p=l.substring(3);p=p.charAt(0).toLowerCase()+p.slice(1),s+=`, property_setter(C, "${p}", _)`}for(let l of i)s+=`, collection_adder(C, "${D1(l)}", _)`;for(let l of a)s+=`, collection_remover(C, "${P1(l)}", _)`;for(let l of o)s+=`, collection_setter(C, "${R1(l)}", _)`;s+=".";let u=await this.infer(s);return u?u.map(l=>l.Class):[]}async ensureSDNASubjectClass(r){if((await this.subjectClassesByTemplate(new r)).length>0)return;let{name:t,sdna:n}=r.generateSDNA();await this.addSdna(t,n,"subject_class")}getNeighbourhoodProxy(){return L(this,_e,"f").getNeighbourhoodProxy(L(this,pe,"f").uuid)}};pe=new WeakMap,_e=new WeakMap,Nr=new WeakMap,Pr=new WeakMap,Rr=new WeakMap,ai=new WeakMap;var Ar=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},H=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},se,oi,si,ci,Aa,ui,Ia,rt=`
|
|
63
|
+
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||Us.set(i,o=new Set),o.add(a),e.has(a)||(e.add(a),t.push(n))}else t.push(n)}),Ra(Ra({},r),{definitions:t})}function _1(r){var e=new Set(r.definitions);e.forEach(function(n){n.loc&&delete n.loc,Object.keys(n).forEach(function(i){var a=n[i];a&&typeof a=="object"&&e.add(a)})});var t=r.loc;return t&&(delete t.startToken,delete t.endToken),r}function E1(r){var e=gp(r);if(!Ta.has(e)){var t=b1(r,{experimentalFragmentVariables:La,allowLegacyFragmentVariables:La});if(!t||t.kind!=="Document")throw new Error("Not a valid GraphQL document.");Ta.set(e,_1(w1(t)))}return Ta.get(e)}function E(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];typeof r=="string"&&(r=[r]);var n=r[0];return e.forEach(function(i,a){i&&i.kind==="Document"?n+=i.loc.source.body:n+=i,n+=r[a+1]}),E1(n)}function x1(){Ta.clear(),Us.clear()}function O1(){yp=!1}function T1(){La=!0}function A1(){La=!1}var ri={gql:E,resetCaches:x1,disableFragmentWarnings:O1,enableExperimentalFragmentVariables:T1,disableExperimentalFragmentVariables:A1};(function(r){r.gql=ri.gql,r.resetCaches=ri.resetCaches,r.disableFragmentWarnings=ri.disableFragmentWarnings,r.enableExperimentalFragmentVariables=ri.enableExperimentalFragmentVariables,r.disableExperimentalFragmentVariables=ri.disableExperimentalFragmentVariables})(E||(E={}));E.default=E;function A(r){if(!r)throw"Got no result from Apollo";if(r.error)throw r.error;if(r.errors)throw r.errors;return r.data}function I1(){}function Zs(){return I1}var v=Zs,Ge=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)},jr=class{constructor(e){this.code=e}};vp([v(),bp("design:type",String)],jr.prototype,"code",void 0);jr=vp([Y(),bp("design:paramtypes",[String])],jr);var ec=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},tc=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Ot=class{constructor(e,t){this.address=e,this.name=t}};ec([v(),tc("design:type",String)],Ot.prototype,"address",void 0);ec([v(),tc("design:type",String)],Ot.prototype,"name",void 0);Ot=ec([Y(),tc("design:paramtypes",[String,String])],Ot);var he=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},Ae=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},ir=class{constructor(e,t){this.key=t,this.signature=e}};he([v(),Ae("design:type",String)],ir.prototype,"signature",void 0);he([v(),Ae("design:type",String)],ir.prototype,"key",void 0);he([v(),Ae("design:type",Boolean)],ir.prototype,"valid",void 0);he([v(),Ae("design:type",Boolean)],ir.prototype,"invalid",void 0);ir=he([Y(),Ge(),Ae("design:paramtypes",[String,String])],ir);var Ur=class{};he([v(),Ae("design:type",String)],Ur.prototype,"signature",void 0);he([v(),Ae("design:type",String)],Ur.prototype,"key",void 0);he([v(),Ae("design:type",Boolean)],Ur.prototype,"valid",void 0);he([v(),Ae("design:type",Boolean)],Ur.prototype,"invalid",void 0);Ur=he([Ge()],Ur);function lr(r){let e=class{constructor(n,i,a,o){this.author=n,this.timestamp=i,this.data=a,this.proof=o}};return he([v(),Ae("design:type",String)],e.prototype,"author",void 0),he([v(),Ae("design:type",String)],e.prototype,"timestamp",void 0),he([v(),Ae("design:type",Object)],e.prototype,"data",void 0),he([v(),Ae("design:type",ir)],e.prototype,"proof",void 0),e=he([Y(),Ae("design:paramtypes",[String,String,Object,ir])],e),e}function k1(r){let e=class{};return he([v(),Ae("design:type",String)],e.prototype,"author",void 0),he([v(),Ae("design:type",String)],e.prototype,"timestamp",void 0),he([v(),Ae("design:type",Object)],e.prototype,"data",void 0),he([v(),Ae("design:type",Ur)],e.prototype,"proof",void 0),e=he([Ge()],e),e}var Wl=class extends lr(){};Wl=he([Y()],Wl);var Fa=class extends lr(){};he([v(),Ae("design:type",Ot)],Fa.prototype,"language",void 0);he([v(),Ae("design:type",jr)],Fa.prototype,"icon",void 0);Fa=he([Y()],Fa);function Eg(r){return r&&r.author&&r.timestamp&&r.data}var Oe=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},$e=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Tt=class{constructor(e){this.source=e.source?e.source:"",this.target=e.target?e.target:"",this.predicate=e.predicate?e.predicate:""}};Oe([v(),$e("design:type",String)],Tt.prototype,"source",void 0);Oe([v(),$e("design:type",String)],Tt.prototype,"target",void 0);Oe([v(),$e("design:type",String)],Tt.prototype,"predicate",void 0);Tt=Oe([Y(),$e("design:paramtypes",[Object])],Tt);var $a=class{};Oe([v(),$e("design:type",Array)],$a.prototype,"additions",void 0);Oe([v(),$e("design:type",Array)],$a.prototype,"removals",void 0);$a=Oe([Ge()],$a);var Ma=class{constructor(e,t){this.additions=e,this.removals=t}};Oe([v(),$e("design:type",Array)],Ma.prototype,"additions",void 0);Oe([v(),$e("design:type",Array)],Ma.prototype,"removals",void 0);Ma=Oe([Y(),$e("design:paramtypes",[Array,Array])],Ma);var Ci=class{};Oe([v(),$e("design:type",String)],Ci.prototype,"source",void 0);Oe([v(),$e("design:type",String)],Ci.prototype,"target",void 0);Oe([v(),$e("design:type",String)],Ci.prototype,"predicate",void 0);Ci=Oe([Ge()],Ci);var qr=class extends lr(){hash(){let e=JSON.stringify(this.data,Object.keys(this.data).sort())+JSON.stringify(this.author)+this.timestamp,t=0,n,i;for(n=0;n<e.length;n++)i=e.charCodeAt(n),t=(t<<5)-t+i,t|=0;return t}};Oe([v(),$e("design:type",String)],qr.prototype,"status",void 0);qr=Oe([Y()],qr);var qs=class extends k1(){};Oe([v(),$e("design:type",String)],qs.prototype,"status",void 0);qs=Oe([Ge()],qs);function Dg(r,e){return r.author==e.author&&r.timestamp==e.timestamp&&r.data.source==e.data.source&&r.data.predicate==e.data.predicate&&r.data.target==e.data.target}function Ng(r){return r&&r.source&&r.target}var ja=class{constructor(e,t){this.oldLink=e,this.newLink=t}};Oe([v(),$e("design:type",qr)],ja.prototype,"oldLink",void 0);Oe([v(),$e("design:type",qr)],ja.prototype,"newLink",void 0);ja=Oe([Y(),$e("design:paramtypes",[qr,qr])],ja);var Vr=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},Ei=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Bs,ar=class{constructor(e){e?this.links=e:this.links=[]}get(e){if(!e||!e.source&&!e.predicate&&!e.target)return this.links;if(e.source){let n=JSON.parse(JSON.stringify(this.links));return e.target&&(n=n.filter(i=>i.data.target===e.target)),e.predicate&&(n=n.filter(i=>i.data.predicate===e.predicate)),e.fromDate&&(n=n.filter(i=>new Date(i.timestamp)>=e.fromDate)),e.untilDate&&(n=n.filter(i=>new Date(i.timestamp)<=e.untilDate)),e.limit&&(n=n.slice(0,e.limit)),n}if(e.target){let n=JSON.parse(JSON.stringify(this.links));return e.predicate&&(n=n.filter(i=>i.data.predicate===e.predicate)),e.fromDate&&(n=n.filter(i=>new Date(i.timestamp)>=e.fromDate)),e.untilDate&&(n=n.filter(i=>new Date(i.timestamp)<=e.untilDate)),e.limit&&(n=n.slice(0,e.limit)),n}let t=JSON.parse(JSON.stringify(this.links));return t=t.filter(n=>n.data.predicate===e.predicate),e.limit&&(t=t.slice(0,e.limit)),t}getSingleTarget(e){delete e.target;let t=this.get(e);return t.length?t[0].data.target:null}};Vr([v(),Ei("design:type",Array)],ar.prototype,"links",void 0);ar=Vr([Y(),Ei("design:paramtypes",[Array])],ar);var Vs=class{};Vr([v(),Ei("design:type",Array)],Vs.prototype,"links",void 0);Vs=Vr([Ge()],Vs);var Qs=Bs=class{constructor(e){e?this.links=e:this.links=[]}static fromLink(e){let t=new Bs;return t.links.push(e),t}};Vr([v(),Ei("design:type",Array)],Qs.prototype,"links",void 0);Qs=Bs=Vr([Ge(),Ei("design:paramtypes",[Array])],Qs);var Ws=class extends lr(){};Ws=Vr([Y()],Ws);var F=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},$=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},rr=class{constructor(e,t){this.did=e,t?this.perspective=t:this.perspective=new ar}};F([v(),$("design:type",String)],rr.prototype,"did",void 0);F([v(),$("design:type",ar)],rr.prototype,"perspective",void 0);F([v(),$("design:type",String)],rr.prototype,"directMessageLanguage",void 0);rr=F([Y(),$("design:paramtypes",[String,ar])],rr);var Gl=class extends lr(){};Gl=F([Y()],Gl);var or=class{constructor(e,t,n,i,a,o){this.did=e,this.didSigningKeyId=t,this.deviceKeyType=n,this.deviceKey=i,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};F([v(),$("design:type",String)],or.prototype,"did",void 0);F([v(),$("design:type",String)],or.prototype,"didSigningKeyId",void 0);F([v(),$("design:type",String)],or.prototype,"deviceKeyType",void 0);F([v(),$("design:type",String)],or.prototype,"deviceKey",void 0);F([v(),$("design:type",String)],or.prototype,"deviceKeySignedByDid",void 0);F([v(),$("design:type",String)],or.prototype,"didSignedByDeviceKey",void 0);or=F([Y(),$("design:paramtypes",[String,String,String,String,String,String])],or);var sr=class{constructor(e,t,n,i,a,o){this.did=e,this.didSigningKeyId=t,this.deviceKeyType=n,this.deviceKey=i,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};F([v(),$("design:type",String)],sr.prototype,"did",void 0);F([v(),$("design:type",String)],sr.prototype,"didSigningKeyId",void 0);F([v(),$("design:type",String)],sr.prototype,"deviceKeyType",void 0);F([v(),$("design:type",String)],sr.prototype,"deviceKey",void 0);F([v(),$("design:type",String)],sr.prototype,"deviceKeySignedByDid",void 0);F([v(),$("design:type",String)],sr.prototype,"didSignedByDeviceKey",void 0);sr=F([Ge(),$("design:paramtypes",[String,String,String,String,String,String])],sr);var Ua=class{constructor(e,t){this.signature=e,this.publicKey=t}};F([v(),$("design:type",String)],Ua.prototype,"signature",void 0);F([v(),$("design:type",String)],Ua.prototype,"publicKey",void 0);Ua=F([Y(),$("design:paramtypes",[String,String])],Ua);var wn=class{constructor(e,t){this.domain=e,this.pointers=t}};F([v(),$("design:type",String)],wn.prototype,"domain",void 0);F([v(),$("design:type",Array)],wn.prototype,"pointers",void 0);wn=F([Y(),$("design:paramtypes",[String,Array])],wn);var qa=class{constructor(e,t){this.with=e,this.can=t}};F([v(),$("design:type",wn)],qa.prototype,"with",void 0);F([v(),$("design:type",Array)],qa.prototype,"can",void 0);qa=F([Y(),$("design:paramtypes",[wn,Array])],qa);var Ut=class{constructor(e,t,n,i,a){this.appName=e,this.appDesc=t,this.appIconPath=a,this.appUrl=n,this.capabilities=i}};F([v(),$("design:type",String)],Ut.prototype,"appName",void 0);F([v(),$("design:type",String)],Ut.prototype,"appDesc",void 0);F([v(),$("design:type",String)],Ut.prototype,"appUrl",void 0);F([v(),$("design:type",String)],Ut.prototype,"appIconPath",void 0);F([v(),$("design:type",Array)],Ut.prototype,"capabilities",void 0);Ut=F([Y(),$("design:paramtypes",[String,String,String,Array,String])],Ut);var _n=class{constructor(e,t,n,i){this.requestId=e,this.auth=t,this.token=n,this.revoked=i}};F([v(),$("design:type",String)],_n.prototype,"requestId",void 0);F([v(),$("design:type",String)],_n.prototype,"token",void 0);F([v(),$("design:type",Boolean)],_n.prototype,"revoked",void 0);F([v(),$("design:type",Ut)],_n.prototype,"auth",void 0);_n=F([Y(),$("design:paramtypes",[String,Ut,String,Boolean])],_n);var En=class{constructor(e,t){this.domain=e,this.pointers=t}};F([v(),$("design:type",String)],En.prototype,"domain",void 0);F([v(),$("design:type",Array)],En.prototype,"pointers",void 0);En=F([Ge(),$("design:paramtypes",[String,Array])],En);var Ba=class{constructor(e,t){this.with=e,this.can=t}};F([v(),$("design:type",En)],Ba.prototype,"with",void 0);F([v(),$("design:type",Array)],Ba.prototype,"can",void 0);Ba=F([Ge(),$("design:paramtypes",[En,Array])],Ba);var cr=class{constructor(e,t,n,i,a,o){this.appName=e,this.appDesc=t,this.appUrl=i,this.appDomain=n,this.capabilities=o,this.appIconPath=a}};F([v(),$("design:type",String)],cr.prototype,"appName",void 0);F([v(),$("design:type",String)],cr.prototype,"appDesc",void 0);F([v(),$("design:type",String)],cr.prototype,"appDomain",void 0);F([v(),$("design:type",String)],cr.prototype,"appUrl",void 0);F([v(),$("design:type",String)],cr.prototype,"appIconPath",void 0);F([v(),$("design:type",Array)],cr.prototype,"capabilities",void 0);cr=F([Ge(),$("design:paramtypes",[String,String,String,String,String,Array])],cr);var On=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},Tn=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},lt=class{constructor(e){e?(this.isInitialized=e.isInitialized,this.isInitialized||(this.isInitialized=!1),this.isUnlocked=e.isUnlocked,this.isUnlocked||(this.isUnlocked=!1),this.did=e.did,this.didDocument=e.didDocument,this.error=e.error):(this.isInitialized=!1,this.isUnlocked=!1)}};On([v(),Tn("design:type",Boolean)],lt.prototype,"isInitialized",void 0);On([v(),Tn("design:type",Boolean)],lt.prototype,"isUnlocked",void 0);On([v(),Tn("design:type",String)],lt.prototype,"did",void 0);On([v(),Tn("design:type",String)],lt.prototype,"didDocument",void 0);On([v(),Tn("design:type",String)],lt.prototype,"error",void 0);lt=On([Y(),Tn("design:paramtypes",[Object])],lt);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)},Ye,Xe,Gs=class{constructor(e,t){Ye.set(this,void 0),Xe.set(this,void 0),Kl(this,Ye,e,"f"),Kl(this,Xe,t,"f")}async otherAgents(){return await we(this,Ye,"f").otherAgents(we(this,Xe,"f"))}async hasTelepresenceAdapter(){return await we(this,Ye,"f").hasTelepresenceAdapter(we(this,Xe,"f"))}async onlineAgents(){return await we(this,Ye,"f").onlineAgents(we(this,Xe,"f"))}async setOnlineStatus(e){return await we(this,Ye,"f").setOnlineStatus(we(this,Xe,"f"),e)}async setOnlineStatusU(e){return await we(this,Ye,"f").setOnlineStatusU(we(this,Xe,"f"),e)}async sendSignal(e,t){return await we(this,Ye,"f").sendSignal(we(this,Xe,"f"),e,t)}async sendSignalU(e,t){return await we(this,Ye,"f").sendSignalU(we(this,Xe,"f"),e,t)}async sendBroadcast(e){return await we(this,Ye,"f").sendBroadcast(we(this,Xe,"f"),e)}async sendBroadcastU(e){return await we(this,Ye,"f").sendBroadcastU(we(this,Xe,"f"),e)}async addSignalHandler(e){await we(this,Ye,"f").addSignalHandler(we(this,Xe,"f"),e)}removeSignalHandler(e){we(this,Ye,"f").removeSignalHandler(we(this,Xe,"f"),e)}};Ye=new WeakMap,Xe=new WeakMap;var Qr=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},Wr=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},We=class{constructor(e){e&&(this.source=e.source,this.predicate=e.predicate,this.target=e.target,e.fromDate&&(this.fromDate=e.fromDate),e.untilDate&&(this.untilDate=e.untilDate),e.limit&&(this.limit=e.limit))}isMatch(e){return!(this.source&&this.source!==e.source||this.predicate&&this.predicate!==e.predicate||this.target&&this.target!==e.target)}};Qr([v(),Wr("design:type",String)],We.prototype,"source",void 0);Qr([v(),Wr("design:type",String)],We.prototype,"target",void 0);Qr([v(),Wr("design:type",String)],We.prototype,"predicate",void 0);Qr([v(),Wr("design:type",Date)],We.prototype,"fromDate",void 0);Qr([v(),Wr("design:type",Date)],We.prototype,"untilDate",void 0);Qr([v(),Wr("design:type",Number)],We.prototype,"limit",void 0);We=Qr([Y(),Ge(),Wr("design:paramtypes",[Object])],We);var zl=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Je=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},yt,Ft;function Rs(r){return encodeURIComponent(r).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}var At=class{constructor(){yt.set(this,void 0),Ft.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 At;return zl(t,Ft,e,"f"),t}static from(e){let t=new At;return zl(t,yt,e,"f"),t}toUrl(){if(Je(this,Ft,"f")&&!Je(this,yt,"f"))return Je(this,Ft,"f");if(!Je(this,Ft,"f")&&!Je(this,yt,"f"))throw new Error("Can't turn empty Literal into URL");let e;switch(typeof Je(this,yt,"f")){case"string":e=`string:${Rs(Je(this,yt,"f"))}`;break;case"number":e=`number:${Rs(Je(this,yt,"f"))}`;break;case"object":e=`json:${Rs(JSON.stringify(Je(this,yt,"f")))}`;break}return`literal://${e}`}get(){if(Je(this,yt,"f"))return Je(this,yt,"f");if(!Je(this,Ft,"f"))throw new Error("Can't render empty Literal");if(!Je(this,Ft,"f").startsWith("literal://"))throw new Error("Can't render Literal from non-literal URL");let e=Je(this,Ft,"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}`)}};yt=new WeakMap,Ft=new WeakMap;function nr(r){return r.charAt(0).toUpperCase()+r.slice(1)}function Cp(r){return`set${nr(r)}`}function jt(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 D1(r){return`add${nr(rc(r))}`}function N1(r){let e=r.substring(3),t=jt(e);return t.charAt(0).toLowerCase()+t.slice(1)}function P1(r){return`remove${nr(rc(r))}`}function R1(r){let e=r.substring(6),t=jt(e);return t.charAt(0).toLowerCase()+t.slice(1)}function L1(r){let e=r.substring(13),t=jt(e);return t.charAt(0).toLowerCase()+t.slice(1)}function F1(r){return`setCollection${nr(rc(r))}`}function Dr(r){if(Array.isArray(r))return`[${r.map(Dr).join(", ")}]`;let e=Object.keys(r),t=[];for(let n of e){let i=JSON.stringify(r[n]),a=`${n}: ${i}`;t.push(a)}return`{${t.join(", ")}}`}var Ls=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},q=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},qe,Be,ge,Va=class{constructor(r,e,t){qe.set(this,void 0),Be.set(this,void 0),ge.set(this,void 0),Ls(this,qe,e,"f"),Ls(this,Be,t,"f"),Ls(this,ge,r,"f")}get baseExpression(){return q(this,qe,"f")}async init(){let isInstance=await q(this,ge,"f").isSubjectInstance(q(this,qe,"f"),q(this,Be,"f"));if(!isInstance)throw`Not a valid subject instance of ${q(this,Be,"f")} for ${q(this,qe,"f")}`;let results=await q(this,ge,"f").infer(`subject_class("${q(this,Be,"f")}", C), property(C, Property)`),properties=results.map(r=>r.Property);for(let r of properties){let e=await q(this,ge,"f").infer(`subject_class("${q(this,Be,"f")}", C), property_resolve(C, "${r}")`);Object.defineProperty(this,r,{configurable:!0,get:async()=>{let t=await q(this,ge,"f").infer(`subject_class("${q(this,Be,"f")}", C), property_getter(C, "${q(this,qe,"f")}", "${r}", Value)`);if(t&&t.length>0){let n=t[0].Value;if(e)try{if(n){let i=await q(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 q(this,ge,"f").infer(`subject_class("${q(this,Be,"f")}", C), property_setter(C, Property, Setter)`);for(let setter of setters||[])if(setter){let property=setter.Property,actions=eval(setter.Setter),resolveLanguageResults=await q(this,ge,"f").infer(`subject_class("${q(this,Be,"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 q(this,ge,"f").createExpression(r,resolveLanguage)),await q(this,ge,"f").executeAction(actions,q(this,qe,"f"),[{name:"value",value:r}])}}let results2=await q(this,ge,"f").infer(`subject_class("${q(this,Be,"f")}", C), collection(C, Collection)`);results2||(results2=[]);let collections=results2.map(r=>r.Collection);for(let r of collections)Object.defineProperty(this,r,{configurable:!0,get:async()=>{let e=await q(this,ge,"f").infer(`subject_class("${q(this,Be,"f")}", C), collection_getter(C, "${q(this,qe,"f")}", "${r}", Value)`);return e&&e.length>0&&e[0].Value?e[0].Value.filter(n=>n!==""&&n!==""):[]}});let adders=await q(this,ge,"f").infer(`subject_class("${q(this,Be,"f")}", C), collection_adder(C, Collection, Adder)`);adders||(adders=[]);for(let adder of adders)if(adder){let collection=adder.Collection,actions=eval(adder.Adder);this[D1(collection)]=async r=>{Array.isArray(r)?await Promise.all(r.map(e=>q(this,ge,"f").executeAction(actions,q(this,qe,"f"),[{name:"value",value:e}]))):await q(this,ge,"f").executeAction(actions,q(this,qe,"f"),[{name:"value",value:r}])}}let removers=await q(this,ge,"f").infer(`subject_class("${q(this,Be,"f")}", C), collection_remover(C, Collection, Remover)`);removers||(removers=[]);for(let remover of removers)if(remover){let collection=remover.Collection,actions=eval(remover.Remover);this[P1(collection)]=async r=>{Array.isArray(r)?await Promise.all(r.map(e=>q(this,ge,"f").executeAction(actions,q(this,qe,"f"),[{name:"value",value:e}]))):await q(this,ge,"f").executeAction(actions,q(this,qe,"f"),[{name:"value",value:r}])}}let collectionSetters=await q(this,ge,"f").infer(`subject_class("${q(this,Be,"f")}", C), collection_setter(C, Collection, Setter)`);collectionSetters||(collectionSetters=[]);for(let collectionSetter of collectionSetters)if(collectionSetter){let collection=collectionSetter.Collection,actions=eval(collectionSetter.Setter);this[F1(collection)]=async r=>{Array.isArray(r)?await q(this,ge,"f").executeAction(actions,q(this,qe,"f"),r.map(e=>({name:"value",value:e}))):await q(this,ge,"f").executeAction(actions,q(this,qe,"f"),[{name:"value",value:r}])}}}};qe=new WeakMap,Be=new WeakMap,ge=new WeakMap;var mn=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},L=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)},de,xe,Nr,Pr,Rr,ai,Sn=class{constructor(r,e){de.set(this,void 0),xe.set(this,void 0),Nr.set(this,void 0),Pr.set(this,void 0),Rr.set(this,void 0),ai.set(this,void 0),mn(this,Nr,[],"f"),mn(this,Pr,[],"f"),mn(this,Rr,[],"f"),mn(this,ai,[],"f"),mn(this,de,r,"f"),mn(this,xe,e,"f"),this.uuid=L(this,de,"f").uuid,this.name=L(this,de,"f").name,this.sharedUrl=L(this,de,"f").sharedUrl,this.neighbourhood=L(this,de,"f").neighbourhood,this.state=L(this,de,"f").state,L(this,xe,"f").addPerspectiveLinkAddedListener(L(this,de,"f").uuid,L(this,Nr,"f")),L(this,xe,"f").addPerspectiveLinkRemovedListener(L(this,de,"f").uuid,L(this,Pr,"f")),L(this,xe,"f").addPerspectiveLinkUpdatedListener(L(this,de,"f").uuid,L(this,Rr,"f")),L(this,xe,"f").addPerspectiveSyncStateChangeListener(L(this,de,"f").uuid,L(this,ai,"f"))}async executeAction(r,e,t){let n=a=>{if(a)return a==="this"?e:a},i=a=>{if(t){let o=a;for(let s of t)o=o.replace(s.name,s.value);return o}else return a};for(let a of r){let o=n(i(a.source)),s=n(i(a.predicate)),u=n(i(a.target)),l=a?.local??!1;switch(a.action){case"addLink":await this.add(new Tt({source:o,predicate:s,target:u}),l?"local":"shared");break;case"removeLink":let p=await this.get(new We({source:o,predicate:s,target:u}));for(let h of p)await this.remove(h);break;case"setSingleTarget":await this.setSingleTarget(new Tt({source:o,predicate:s,target:u}),l?"local":"shared");break;case"collectionSetter":let f=await this.get(new We({source:o,predicate:s}));await this.removeLinks(f),await this.addLinks(t.map(h=>new Tt({source:o,predicate:s,target:h.value})),l?"local":"shared");break}}}async get(r){return await L(this,xe,"f").queryLinks(L(this,de,"f").uuid,r)}async infer(r){return await L(this,xe,"f").queryProlog(L(this,de,"f").uuid,r)}async add(r,e="shared"){return await L(this,xe,"f").addLink(L(this,de,"f").uuid,r,e)}async addLinks(r,e="shared"){return await L(this,xe,"f").addLinks(L(this,de,"f").uuid,r,e)}async removeLinks(r){return await L(this,xe,"f").removeLinks(L(this,de,"f").uuid,r)}async linkMutations(r,e="shared"){return await L(this,xe,"f").linkMutations(L(this,de,"f").uuid,r,e)}async addLinkExpression(r,e="shared"){return await L(this,xe,"f").addLinkExpression(L(this,de,"f").uuid,r,e)}async update(r,e){return await L(this,xe,"f").updateLink(L(this,de,"f").uuid,r,e)}async remove(r){return await L(this,xe,"f").removeLink(L(this,de,"f").uuid,r)}async getExpression(r){return await L(this,xe,"f").getExpression(r)}async createExpression(r,e){return await L(this,xe,"f").createExpression(r,e)}async addListener(r,e){r==="link-added"?L(this,Nr,"f").push(e):r==="link-removed"?L(this,Pr,"f").push(e):r==="link-updated"&&L(this,Rr,"f").push(e)}async addSyncStateChangeListener(r){L(this,ai,"f").push(r)}async removeListener(r,e){if(r==="link-added"){let t=L(this,Nr,"f").indexOf(e);L(this,Nr,"f").splice(t,1)}else if(r==="link-removed"){let t=L(this,Pr,"f").indexOf(e);L(this,Pr,"f").splice(t,1)}else if(r==="link-updated"){let t=L(this,Rr,"f").indexOf(e);L(this,Rr,"f").splice(t,1)}}async snapshot(){return L(this,xe,"f").snapshotByUUID(L(this,de,"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 We({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 We({predicate:"ad4m://sdna"}))).map(e=>e.data.target).map(e=>At.fromUrl(e).get())}async addSdna(r,e,t){return L(this,xe,"f").addSdna(L(this,de,"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(subjectClass,exprAddr){let className=await this.stringOrTemplateObjectToSubjectClass(subjectClass),result=await this.infer(`subject_class("${className}", C), constructor(C, Actions)`);if(!result.length)throw"No constructor found for given subject class: "+className;let actions=result.map(x=>eval(x.Actions));return await this.executeAction(actions[0],exprAddr,void 0),this.getSubjectProxy(exprAddr,subjectClass)}async removeSubject(subjectClass,exprAddr){let className=await this.stringOrTemplateObjectToSubjectClass(subjectClass),result=await this.infer(`subject_class("${className}", C), destructor(C, Actions)`);if(!result.length)throw"No constructor found for given subject class: "+className;let actions=result.map(x=>eval(x.Actions));await this.executeAction(actions[0],exprAddr,void 0)}async isSubjectInstance(r,e){let t=await this.stringOrTemplateObjectToSubjectClass(e);return await this.infer(`subject_class("${t}", C), instance(C, "${r}")`)}async getSubjectProxy(r,e){if(!await this.isSubjectInstance(r,e))throw`Expression ${r} is not a subject instance of given class: ${JSON.stringify(e)}`;let t=await this.stringOrTemplateObjectToSubjectClass(e),n=new Va(this,r,t);return await n.init(),n}async getAllSubjectInstances(r){let e=[];typeof r=="string"?e=[r]:e=await this.subjectClassesByTemplate(r);let t=[];for(let n of e){let i=await this.infer(`subject_class("${n}", C), instance(C, X)`),a=await Promise.all(i.map(async o=>await this.getSubjectProxy(o.X,n)));t=t.concat(a)}return t}async getAllSubjectProxies(r){let e=[];typeof r=="string"?e=[r]:e=await this.subjectClassesByTemplate(r);let t=[];for(let n of e)t=await this.infer(`subject_class("${n}", C), instance(C, X)`);return t}async subjectClassesByTemplate(r){let e=[],t=[];Object.getPrototypeOf(r).__properties?Object.keys(Object.getPrototypeOf(r).__properties).forEach(l=>e.push(l)):e.push(...Object.keys(r).filter(l=>!Array.isArray(r[l]))),Object.getPrototypeOf(r).__collections?Object.keys(Object.getPrototypeOf(r).__collections).filter(l=>l!=="isSubjectInstance").forEach(l=>!t.includes(l)):t.push(...Object.keys(r).filter(l=>Array.isArray(r[l])).filter(l=>l!=="isSubjectInstance"));let n=Object.getOwnPropertyNames(r).filter(l=>typeof r[l]=="function"&&l.startsWith("set")&&!l.startsWith("setCollection"));n=n.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>typeof r[l]=="function"&&l.startsWith("set")&&!l.startsWith("setCollection")));let i=Object.getOwnPropertyNames(r).filter(l=>typeof r[l]=="function"&&l.startsWith("add"));i=i.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>typeof r[l]=="function"&&l.startsWith("add")));let a=Object.getOwnPropertyNames(r).filter(l=>typeof r[l]=="function"&&l.startsWith("remove"));a=a.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>typeof r[l]=="function"&&l.startsWith("remove")));let o=Object.getOwnPropertyNames(r).filter(l=>typeof r[l]=="function"&&l.startsWith("setCollection"));o=o.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>typeof r[l]=="function"&&l.startsWith("setCollection")));let s="subject_class(Class, C)";for(let l of e)s+=`, property(C, "${l}")`;for(let l of t)s+=`, collection(C, "${l}")`;for(let l of n){let p=l.substring(3);p=p.charAt(0).toLowerCase()+p.slice(1),s+=`, property_setter(C, "${p}", _)`}for(let l of i)s+=`, collection_adder(C, "${N1(l)}", _)`;for(let l of a)s+=`, collection_remover(C, "${R1(l)}", _)`;for(let l of o)s+=`, collection_setter(C, "${L1(l)}", _)`;s+=".";let u=await this.infer(s);return u?u.map(l=>l.Class):[]}async ensureSDNASubjectClass(r){if((await this.subjectClassesByTemplate(new r)).length>0)return;let{name:t,sdna:n}=r.generateSDNA();await this.addSdna(t,n,"subject_class")}getNeighbourhoodProxy(){return L(this,xe,"f").getNeighbourhoodProxy(L(this,de,"f").uuid)}};de=new WeakMap,xe=new WeakMap,Nr=new WeakMap,Pr=new WeakMap,Rr=new WeakMap,ai=new WeakMap;var Ar=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},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)},se,oi,si,ci,Aa,ui,Ia,nt=`
|
|
64
64
|
author
|
|
65
65
|
timestamp
|
|
66
66
|
status
|
|
@@ -86,62 +86,62 @@ neighbourhood {
|
|
|
86
86
|
}
|
|
87
87
|
author
|
|
88
88
|
}
|
|
89
|
-
`,Qa=class{constructor(e,t=!0){se.set(this,void 0),oi.set(this,void 0),si.set(this,void 0),ci.set(this,void 0),Aa.set(this,void 0),ui.set(this,void 0),Ia.set(this,void 0),Ar(this,se,e,"f"),Ar(this,oi,[],"f"),Ar(this,si,[],"f"),Ar(this,ci,[],"f"),Ar(this,Aa,[],"f"),t&&(this.subscribePerspectiveAdded(),this.subscribePerspectiveUpdated(),this.subscribePerspectiveRemoved())}setExpressionClient(e){Ar(this,ui,e,"f")}setNeighbourhoodClient(e){Ar(this,Ia,e,"f")}async all(){let{perspectives:e}=A(await
|
|
89
|
+
`,Qa=class{constructor(e,t=!0){se.set(this,void 0),oi.set(this,void 0),si.set(this,void 0),ci.set(this,void 0),Aa.set(this,void 0),ui.set(this,void 0),Ia.set(this,void 0),Ar(this,se,e,"f"),Ar(this,oi,[],"f"),Ar(this,si,[],"f"),Ar(this,ci,[],"f"),Ar(this,Aa,[],"f"),t&&(this.subscribePerspectiveAdded(),this.subscribePerspectiveUpdated(),this.subscribePerspectiveRemoved())}setExpressionClient(e){Ar(this,ui,e,"f")}setNeighbourhoodClient(e){Ar(this,Ia,e,"f")}async all(){let{perspectives:e}=A(await J(this,se,"f").query({query:E`query perspectives {
|
|
90
90
|
perspectives {
|
|
91
91
|
${yn}
|
|
92
92
|
}
|
|
93
|
-
}`}));return e.map(t=>new Sn(t,this))}async byUUID(e){let{perspective:t}=A(await
|
|
93
|
+
}`}));return e.map(t=>new Sn(t,this))}async byUUID(e){let{perspective:t}=A(await J(this,se,"f").query({query:E`query perspective($uuid: String!) {
|
|
94
94
|
perspective(uuid: $uuid) {
|
|
95
95
|
${yn}
|
|
96
96
|
}
|
|
97
|
-
}`,variables:{uuid:e}}));return t?new Sn(t,this):null}async snapshotByUUID(e){let{perspectiveSnapshot:t}=A(await
|
|
97
|
+
}`,variables:{uuid:e}}));return t?new Sn(t,this):null}async snapshotByUUID(e){let{perspectiveSnapshot:t}=A(await J(this,se,"f").query({query:E`query perspectiveSnapshot($uuid: String!) {
|
|
98
98
|
perspectiveSnapshot(uuid: $uuid) {
|
|
99
|
-
links { ${
|
|
99
|
+
links { ${nt} }
|
|
100
100
|
}
|
|
101
|
-
}`,variables:{uuid:e}}));return t}async publishSnapshotByUUID(e){let{perspectivePublishSnapshot:t}=A(await
|
|
101
|
+
}`,variables:{uuid:e}}));return t}async publishSnapshotByUUID(e){let{perspectivePublishSnapshot:t}=A(await J(this,se,"f").mutate({mutation:E`mutation perspectivePublishSnapshot($uuid: String!) {
|
|
102
102
|
perspectivePublishSnapshot(uuid: $uuid)
|
|
103
|
-
}`,variables:{uuid:e}}));return t}async queryLinks(e,t){let{perspectiveQueryLinks:n}=A(await
|
|
103
|
+
}`,variables:{uuid:e}}));return t}async queryLinks(e,t){let{perspectiveQueryLinks:n}=A(await J(this,se,"f").query({query:E`query perspectiveQueryLinks($uuid: String!, $query: LinkQuery!) {
|
|
104
104
|
perspectiveQueryLinks(query: $query, uuid: $uuid) {
|
|
105
|
-
${
|
|
105
|
+
${nt}
|
|
106
106
|
}
|
|
107
|
-
}`,variables:{uuid:e,query:t}}));return n}async queryProlog(e,t){let{perspectiveQueryProlog:n}=A(await
|
|
107
|
+
}`,variables:{uuid:e,query:t}}));return n}async queryProlog(e,t){let{perspectiveQueryProlog:n}=A(await J(this,se,"f").query({query:E`query perspectiveQueryProlog($uuid: String!, $query: String!) {
|
|
108
108
|
perspectiveQueryProlog(uuid: $uuid, query: $query)
|
|
109
|
-
}`,variables:{uuid:e,query:t}}));return JSON.parse(n)}async add(e){let{perspectiveAdd:t}=A(await
|
|
109
|
+
}`,variables:{uuid:e,query:t}}));return JSON.parse(n)}async add(e){let{perspectiveAdd:t}=A(await J(this,se,"f").mutate({mutation:E`mutation perspectiveAdd($name: String!) {
|
|
110
110
|
perspectiveAdd(name: $name) {
|
|
111
111
|
${yn}
|
|
112
112
|
}
|
|
113
|
-
}`,variables:{name:e}}));return new Sn(t,this)}async update(e,t){let{perspectiveUpdate:n}=A(await
|
|
113
|
+
}`,variables:{name:e}}));return new Sn(t,this)}async update(e,t){let{perspectiveUpdate:n}=A(await J(this,se,"f").mutate({mutation:E`mutation perspectiveUpdate($uuid: String!, $name: String!) {
|
|
114
114
|
perspectiveUpdate(uuid: $uuid, name: $name) {
|
|
115
115
|
${yn}
|
|
116
116
|
}
|
|
117
|
-
}`,variables:{uuid:e,name:t}}));return new Sn(n,this)}async remove(e){return A(await
|
|
117
|
+
}`,variables:{uuid:e,name:t}}));return new Sn(n,this)}async remove(e){return A(await J(this,se,"f").mutate({mutation:E`mutation perspectiveRemove($uuid: String!) {
|
|
118
118
|
perspectiveRemove(uuid: $uuid)
|
|
119
|
-
}`,variables:{uuid:e}}))}async addLink(e,t,n){let{perspectiveAddLink:i}=A(await
|
|
119
|
+
}`,variables:{uuid:e}}))}async addLink(e,t,n){let{perspectiveAddLink:i}=A(await J(this,se,"f").mutate({mutation:E`mutation perspectiveAddLink($uuid: String!, $link: LinkInput!, $status: String){
|
|
120
120
|
perspectiveAddLink(link: $link, uuid: $uuid, status: $status) {
|
|
121
|
-
${
|
|
121
|
+
${nt}
|
|
122
122
|
}
|
|
123
|
-
}`,variables:{uuid:e,link:t,status:n}}));return i}async addLinks(e,t,n){let{perspectiveAddLinks:i}=A(await
|
|
123
|
+
}`,variables:{uuid:e,link:t,status:n}}));return i}async addLinks(e,t,n){let{perspectiveAddLinks:i}=A(await J(this,se,"f").mutate({mutation:E`mutation perspectiveAddLinks($uuid: String!, $links: [LinkInput!]!, $status: String){
|
|
124
124
|
perspectiveAddLinks(links: $links, uuid: $uuid, status: $status) {
|
|
125
|
-
${
|
|
125
|
+
${nt}
|
|
126
126
|
}
|
|
127
|
-
}`,variables:{uuid:e,links:t,status:n}}));return i}async removeLinks(e,t){let{perspectiveRemoveLinks:n}=A(await
|
|
127
|
+
}`,variables:{uuid:e,links:t,status:n}}));return i}async removeLinks(e,t){let{perspectiveRemoveLinks:n}=A(await J(this,se,"f").mutate({mutation:E`mutation perspectiveRemoveLinks($uuid: String!, $links: [LinkExpressionInput!]!){
|
|
128
128
|
perspectiveRemoveLinks(links: $links, uuid: $uuid) {
|
|
129
|
-
${
|
|
129
|
+
${nt}
|
|
130
130
|
}
|
|
131
|
-
}`,variables:{uuid:e,links:t}}));return n}async linkMutations(e,t,n){let{perspectiveLinkMutations:i}=A(await
|
|
131
|
+
}`,variables:{uuid:e,links:t}}));return n}async linkMutations(e,t,n){let{perspectiveLinkMutations:i}=A(await J(this,se,"f").mutate({mutation:E`mutation perspectiveLinkMutations($uuid: String!, $mutations: LinkMutations!, $status: String){
|
|
132
132
|
perspectiveLinkMutations(mutations: $mutations, uuid: $uuid, status: $status) {
|
|
133
133
|
additions {
|
|
134
|
-
${
|
|
134
|
+
${nt}
|
|
135
135
|
}
|
|
136
136
|
removals {
|
|
137
|
-
${
|
|
137
|
+
${nt}
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
}`,variables:{uuid:e,mutations:t,status:n}}));return i}async addLinkExpression(e,t,n){let{perspectiveAddLinkExpression:i}=A(await
|
|
140
|
+
}`,variables:{uuid:e,mutations:t,status:n}}));return i}async addLinkExpression(e,t,n){let{perspectiveAddLinkExpression:i}=A(await J(this,se,"f").mutate({mutation:E`mutation perspectiveAddLinkExpression($uuid: String!, $link: LinkExpressionInput!, $status: String){
|
|
141
141
|
perspectiveAddLinkExpression(link: $link, uuid: $uuid, status: $status) {
|
|
142
|
-
${
|
|
142
|
+
${nt}
|
|
143
143
|
}
|
|
144
|
-
}`,variables:{uuid:e,link:t}}));return i}async updateLink(e,t,n){delete t.__typename,delete t.data.__typename,delete t.proof.__typename;let{perspectiveUpdateLink:i}=A(await
|
|
144
|
+
}`,variables:{uuid:e,link:t}}));return i}async updateLink(e,t,n){delete t.__typename,delete t.data.__typename,delete t.proof.__typename;let{perspectiveUpdateLink:i}=A(await J(this,se,"f").mutate({mutation:E`mutation perspectiveUpdateLink(
|
|
145
145
|
$uuid: String!,
|
|
146
146
|
$newLink: LinkInput!
|
|
147
147
|
$oldLink: LinkExpressionInput!
|
|
@@ -151,41 +151,41 @@ neighbourhood {
|
|
|
151
151
|
oldLink: $oldLink,
|
|
152
152
|
uuid: $uuid
|
|
153
153
|
) {
|
|
154
|
-
${
|
|
154
|
+
${nt}
|
|
155
155
|
}
|
|
156
|
-
}`,variables:{uuid:e,oldLink:t,newLink:n}}));return i.status||delete i.status,i}async removeLink(e,t){return delete t.__typename,delete t.data.__typename,delete t.proof.__typename,delete t.status,A(await
|
|
156
|
+
}`,variables:{uuid:e,oldLink:t,newLink:n}}));return i.status||delete i.status,i}async removeLink(e,t){return delete t.__typename,delete t.data.__typename,delete t.proof.__typename,delete t.status,A(await J(this,se,"f").mutate({mutation:E`mutation perspectiveRemoveLink($link: LinkExpressionInput!, $uuid: String!) {
|
|
157
157
|
perspectiveRemoveLink(link: $link, uuid: $uuid)
|
|
158
|
-
}`,variables:{uuid:e,link:t}}))}async addSdna(e,t,n,i){return A(await
|
|
158
|
+
}`,variables:{uuid:e,link:t}}))}async addSdna(e,t,n,i){return A(await J(this,se,"f").mutate({mutation:E`mutation perspectiveAddSdna($uuid: String!, $name: String!, $sdnaCode: String!, $sdnaType: String!) {
|
|
159
159
|
perspectiveAddSdna(uuid: $uuid, name: $name, sdnaCode: $sdnaCode, sdnaType: $sdnaType)
|
|
160
|
-
}`,variables:{uuid:e,name:t,sdnaCode:n,sdnaType:i}})).perspectiveAddSdna}async getExpression(e){return await
|
|
160
|
+
}`,variables:{uuid:e,name:t,sdnaCode:n,sdnaType:i}})).perspectiveAddSdna}async getExpression(e){return await J(this,ui,"f").get(e)}async createExpression(e,t){return await J(this,ui,"f").create(e,t)}addPerspectiveAddedListener(e){J(this,oi,"f").push(e)}subscribePerspectiveAdded(){J(this,se,"f").subscribe({query:E` subscription {
|
|
161
161
|
perspectiveAdded { ${yn} }
|
|
162
162
|
}
|
|
163
|
-
`}).subscribe({next:e=>{
|
|
163
|
+
`}).subscribe({next:e=>{J(this,oi,"f").forEach(t=>{t(e.data.perspectiveAdded)})},error:e=>console.error(e)})}addPerspectiveUpdatedListener(e){J(this,si,"f").push(e)}subscribePerspectiveUpdated(){J(this,se,"f").subscribe({query:E` subscription {
|
|
164
164
|
perspectiveUpdated { ${yn} }
|
|
165
165
|
}
|
|
166
|
-
`}).subscribe({next:e=>{
|
|
166
|
+
`}).subscribe({next:e=>{J(this,si,"f").forEach(t=>{t(e.data.perspectiveUpdated)})},error:e=>console.error(e)})}addPerspectiveSyncedListener(e){J(this,Aa,"f").push(e)}async addPerspectiveSyncStateChangeListener(e,t){J(this,se,"f").subscribe({query:E` subscription {
|
|
167
167
|
perspectiveSyncStateChange(uuid: "${e}")
|
|
168
168
|
}
|
|
169
|
-
`}).subscribe({next:n=>{t.forEach(i=>{i(n.data.perspectiveSyncStateChange)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}addPerspectiveRemovedListener(e){
|
|
169
|
+
`}).subscribe({next:n=>{t.forEach(i=>{i(n.data.perspectiveSyncStateChange)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}addPerspectiveRemovedListener(e){J(this,ci,"f").push(e)}subscribePerspectiveRemoved(){J(this,se,"f").subscribe({query:E` subscription {
|
|
170
170
|
perspectiveRemoved
|
|
171
171
|
}
|
|
172
|
-
`}).subscribe({next:e=>{
|
|
173
|
-
perspectiveLinkAdded(uuid: "${e}") { ${
|
|
172
|
+
`}).subscribe({next:e=>{J(this,ci,"f").forEach(t=>{t(e.data.perspectiveRemoved)})},error:e=>console.error(e)})}async addPerspectiveLinkAddedListener(e,t){J(this,se,"f").subscribe({query:E` subscription {
|
|
173
|
+
perspectiveLinkAdded(uuid: "${e}") { ${nt} }
|
|
174
174
|
}
|
|
175
|
-
`}).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){
|
|
176
|
-
perspectiveLinkRemoved(uuid: "${e}") { ${
|
|
175
|
+
`}).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){J(this,se,"f").subscribe({query:E` subscription {
|
|
176
|
+
perspectiveLinkRemoved(uuid: "${e}") { ${nt} }
|
|
177
177
|
}
|
|
178
|
-
`}).subscribe({next:n=>{t.forEach(i=>{n.data.perspectiveLinkRemoved.status||delete n.data.perspectiveLinkRemoved.status,i(n.data.perspectiveLinkRemoved)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}async addPerspectiveLinkUpdatedListener(e,t){
|
|
178
|
+
`}).subscribe({next:n=>{t.forEach(i=>{n.data.perspectiveLinkRemoved.status||delete n.data.perspectiveLinkRemoved.status,i(n.data.perspectiveLinkRemoved)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}async addPerspectiveLinkUpdatedListener(e,t){J(this,se,"f").subscribe({query:E` subscription {
|
|
179
179
|
perspectiveLinkUpdated(uuid: "${e}") {
|
|
180
180
|
oldLink {
|
|
181
|
-
${
|
|
181
|
+
${nt}
|
|
182
182
|
}
|
|
183
183
|
newLink {
|
|
184
|
-
${
|
|
184
|
+
${nt}
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
`}).subscribe({next:n=>{t.forEach(i=>{n.data.perspectiveLinkUpdated.newLink.status||delete n.data.perspectiveLinkUpdated.newLink.status,n.data.perspectiveLinkUpdated.oldLink.status||delete n.data.perspectiveLinkUpdated.oldLink.status,i(n.data.perspectiveLinkUpdated)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}getNeighbourhoodProxy(e){return new Gs(
|
|
188
|
+
`}).subscribe({next:n=>{t.forEach(i=>{n.data.perspectiveLinkUpdated.newLink.status||delete n.data.perspectiveLinkUpdated.newLink.status,n.data.perspectiveLinkUpdated.oldLink.status||delete n.data.perspectiveLinkUpdated.oldLink.status,i(n.data.perspectiveLinkUpdated)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}getNeighbourhoodProxy(e){return new Gs(J(this,Ia,"f"),e)}};se=new WeakMap,oi=new WeakMap,si=new WeakMap,ci=new WeakMap,Aa=new WeakMap,ui=new WeakMap,Ia=new WeakMap;var ga=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Z=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ie,li,pi,fi,ni=`
|
|
189
189
|
did
|
|
190
190
|
directMessageLanguage
|
|
191
191
|
perspective {
|
|
@@ -228,20 +228,20 @@ neighbourhood {
|
|
|
228
228
|
deviceKey
|
|
229
229
|
deviceKeySignedByDid
|
|
230
230
|
didSignedByDeviceKey
|
|
231
|
-
|
|
231
|
+
`,$1=`
|
|
232
232
|
signature
|
|
233
233
|
publicKey
|
|
234
234
|
`,Si=class{constructor(e,t=!0){ie.set(this,void 0),li.set(this,void 0),pi.set(this,void 0),fi.set(this,void 0),ga(this,ie,e,"f"),ga(this,pi,[],"f"),ga(this,fi,[],"f"),ga(this,li,[],"f"),t&&(this.subscribeAgentUpdated(),this.subscribeAgentStatusChanged(),this.subscribeAppsChanged())}async me(){let{agent:e}=A(await Z(this,ie,"f").query({query:E`query agent { agent { ${ni} } }`})),t=new rr(e.did,e.perspective);return t.directMessageLanguage=e.directMessageLanguage,t}async status(){let{agentStatus:e}=A(await Z(this,ie,"f").query({query:E`query agentStatus {
|
|
235
235
|
agentStatus {
|
|
236
236
|
${gn}
|
|
237
237
|
}
|
|
238
|
-
}`}));return new
|
|
238
|
+
}`}));return new lt(e)}async generate(e){let{agentGenerate:t}=A(await Z(this,ie,"f").mutate({mutation:E`mutation agentGenerate(
|
|
239
239
|
$passphrase: String!
|
|
240
240
|
) {
|
|
241
241
|
agentGenerate(passphrase: $passphrase) {
|
|
242
242
|
${gn}
|
|
243
243
|
}
|
|
244
|
-
}`,variables:{passphrase:e}}));return new
|
|
244
|
+
}`,variables:{passphrase:e}}));return new lt(t)}async import(e){let{did:t,didDocument:n,keystore:i,passphrase:a}=e,{agentImport:o}=A(await Z(this,ie,"f").mutate({mutation:E`mutation agentImport(
|
|
245
245
|
$did: String!,
|
|
246
246
|
$didDocument: String!,
|
|
247
247
|
$keystore: String!,
|
|
@@ -250,15 +250,15 @@ neighbourhood {
|
|
|
250
250
|
agentImport(did: $did, didDocument: $didDocument, keystore: $keystore, passphrase: $passphrase) {
|
|
251
251
|
${gn}
|
|
252
252
|
}
|
|
253
|
-
}`,variables:{did:t,didDocument:n,keystore:i,passphrase:a}}));return new
|
|
253
|
+
}`,variables:{did:t,didDocument:n,keystore:i,passphrase:a}}));return new lt(o)}async lock(e){let{agentLock:t}=A(await Z(this,ie,"f").mutate({mutation:E`mutation agentLock($passphrase: String!) {
|
|
254
254
|
agentLock(passphrase: $passphrase) {
|
|
255
255
|
${gn}
|
|
256
256
|
}
|
|
257
|
-
}`,variables:{passphrase:e}}));return new
|
|
257
|
+
}`,variables:{passphrase:e}}));return new lt(t)}async unlock(e,t=!0){let{agentUnlock:n}=A(await Z(this,ie,"f").mutate({mutation:E`mutation agentUnlock($passphrase: String!, $holochain: Boolean!) {
|
|
258
258
|
agentUnlock(passphrase: $passphrase, holochain: $holochain) {
|
|
259
259
|
${gn}
|
|
260
260
|
}
|
|
261
|
-
}`,variables:{passphrase:e,holochain:t}}));return new
|
|
261
|
+
}`,variables:{passphrase:e,holochain:t}}));return new lt(n)}async byDID(e){let{agentByDID:t}=A(await Z(this,ie,"f").query({query:E`query agentByDID($did: String!) {
|
|
262
262
|
agentByDID(did: $did) {
|
|
263
263
|
${ni}
|
|
264
264
|
}
|
|
@@ -327,16 +327,16 @@ neighbourhood {
|
|
|
327
327
|
}
|
|
328
328
|
`}));return e}async signMessage(e){let{agentSignMessage:t}=A(await Z(this,ie,"f").mutate({mutation:E`mutation agentSignMessage($message: String!) {
|
|
329
329
|
agentSignMessage(message: $message) {
|
|
330
|
-
${
|
|
330
|
+
${$1}
|
|
331
331
|
}
|
|
332
|
-
}`,variables:{message:e}}));return t}};ie=new WeakMap,li=new WeakMap,pi=new WeakMap,fi=new WeakMap;var
|
|
332
|
+
}`,variables:{message:e}}));return t}};ie=new WeakMap,li=new WeakMap,pi=new WeakMap,fi=new WeakMap;var M1=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},tr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},gt,Hl=`
|
|
333
333
|
name
|
|
334
334
|
address
|
|
335
335
|
settings
|
|
336
336
|
icon { code }
|
|
337
337
|
constructorIcon { code }
|
|
338
338
|
settingsIcon { code }
|
|
339
|
-
`,
|
|
339
|
+
`,Jl=`
|
|
340
340
|
name
|
|
341
341
|
address
|
|
342
342
|
description
|
|
@@ -346,45 +346,45 @@ neighbourhood {
|
|
|
346
346
|
templateAppliedParams
|
|
347
347
|
possibleTemplateParams
|
|
348
348
|
sourceCodeLink
|
|
349
|
-
`,Ks=class{constructor(e){
|
|
349
|
+
`,Ks=class{constructor(e){gt.set(this,void 0),M1(this,gt,e,"f")}async byAddress(e){let{language:t}=A(await tr(this,gt,"f").query({query:E`query byAddress($address: String!) {
|
|
350
350
|
language(address: $address) {
|
|
351
|
-
${
|
|
351
|
+
${Hl}
|
|
352
352
|
}
|
|
353
|
-
}`,variables:{address:e}}));return t}async byFilter(e){let{languages:t}=A(await tr(this,
|
|
353
|
+
}`,variables:{address:e}}));return t}async byFilter(e){let{languages:t}=A(await tr(this,gt,"f").query({query:E`query byFilter($filter: String!) {
|
|
354
354
|
languages(filter: $filter) {
|
|
355
|
-
${
|
|
355
|
+
${Hl}
|
|
356
356
|
}
|
|
357
|
-
}`,variables:{filter:e}}));return t}async all(){return this.byFilter("")}async writeSettings(e,t){let{languageWriteSettings:n}=A(await tr(this,
|
|
357
|
+
}`,variables:{filter:e}}));return t}async all(){return this.byFilter("")}async writeSettings(e,t){let{languageWriteSettings:n}=A(await tr(this,gt,"f").mutate({mutation:E`mutation writeSettings($languageAddress: String!, $settings: String!) {
|
|
358
358
|
languageWriteSettings(languageAddress: $languageAddress, settings: $settings)
|
|
359
|
-
}`,variables:{languageAddress:e,settings:t}}));return n}async applyTemplateAndPublish(e,t){let{languageApplyTemplateAndPublish:n}=A(await tr(this,
|
|
359
|
+
}`,variables:{languageAddress:e,settings:t}}));return n}async applyTemplateAndPublish(e,t){let{languageApplyTemplateAndPublish:n}=A(await tr(this,gt,"f").mutate({mutation:E`mutation languageApplyTemplateAndPublish(
|
|
360
360
|
$sourceLanguageHash: String!,
|
|
361
361
|
$templateData: String!,
|
|
362
362
|
) {
|
|
363
363
|
languageApplyTemplateAndPublish(sourceLanguageHash: $sourceLanguageHash, templateData: $templateData) {
|
|
364
364
|
name, address
|
|
365
365
|
}
|
|
366
|
-
}`,variables:{sourceLanguageHash:e,templateData:t}}));return n}async publish(e,t){let{languagePublish:n}=A(await tr(this,
|
|
366
|
+
}`,variables:{sourceLanguageHash:e,templateData:t}}));return n}async publish(e,t){let{languagePublish:n}=A(await tr(this,gt,"f").mutate({mutation:E`mutation languagePublish(
|
|
367
367
|
$languagePath: String!,
|
|
368
368
|
$languageMeta: LanguageMetaInput!,
|
|
369
369
|
) {
|
|
370
370
|
languagePublish(languagePath: $languagePath, languageMeta: $languageMeta) {
|
|
371
|
-
${
|
|
371
|
+
${Jl}
|
|
372
372
|
}
|
|
373
|
-
}`,variables:{languagePath:e,languageMeta:t}}));return n}async meta(e){let{languageMeta:t}=A(await tr(this,
|
|
373
|
+
}`,variables:{languagePath:e,languageMeta:t}}));return n}async meta(e){let{languageMeta:t}=A(await tr(this,gt,"f").query({query:E`query languageMeta(
|
|
374
374
|
$address: String!,
|
|
375
375
|
) {
|
|
376
376
|
languageMeta(address: $address) {
|
|
377
|
-
${
|
|
377
|
+
${Jl}
|
|
378
378
|
}
|
|
379
|
-
}`,variables:{address:e}}));return t}async source(e){let{languageSource:t}=A(await tr(this,
|
|
379
|
+
}`,variables:{address:e}}));return t}async source(e){let{languageSource:t}=A(await tr(this,gt,"f").query({query:E`query languageSource(
|
|
380
380
|
$address: String!,
|
|
381
381
|
) {
|
|
382
382
|
languageSource(address: $address)
|
|
383
|
-
}`,variables:{address:e}}));return t}async remove(e){let{languageRemove:t}=A(await tr(this,
|
|
383
|
+
}`,variables:{address:e}}));return t}async remove(e){let{languageRemove:t}=A(await tr(this,gt,"f").mutate({mutation:E`mutation languageRemove(
|
|
384
384
|
$address: String!,
|
|
385
385
|
) {
|
|
386
386
|
languageRemove(address: $address)
|
|
387
|
-
}`,variables:{address:e}}));return t}};
|
|
387
|
+
}`,variables:{address:e}}));return t}};gt=new WeakMap;var j1=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Le=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Ve,Lr,zs=class{constructor(e){Ve.set(this,void 0),Lr.set(this,new Map),j1(this,Ve,e,"f")}async publishFromPerspective(e,t,n){let{neighbourhoodPublishFromPerspective:i}=A(await Le(this,Ve,"f").mutate({mutation:E`mutation neighbourhoodPublishFromPerspective(
|
|
388
388
|
$linkLanguage: String!,
|
|
389
389
|
$meta: PerspectiveInput!,
|
|
390
390
|
$perspectiveUUID: String!
|
|
@@ -504,7 +504,7 @@ neighbourhood {
|
|
|
504
504
|
}
|
|
505
505
|
proof { valid, invalid, signature, key }
|
|
506
506
|
}
|
|
507
|
-
}`,variables:{perspectiveUUID:e}}).subscribe({next:n=>{let{neighbourhoodSignal:i}=A(n);t.dispatchSignal(e,i)}})}async addSignalHandler(e,t){let n=Le(this,Lr,"f").get(e);n||(n=[],await this.subscribeToSignals(e)),n.push(t),Le(this,Lr,"f").set(e,n)}removeSignalHandler(e,t){let n=Le(this,Lr,"f").get(e);if(n){let i=n.indexOf(t);i>-1&&n.splice(i,1)}Le(this,Lr,"f").set(e,n)}};Ve=new WeakMap,Lr=new WeakMap;var Fs=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},
|
|
507
|
+
}`,variables:{perspectiveUUID:e}}).subscribe({next:n=>{let{neighbourhoodSignal:i}=A(n);t.dispatchSignal(e,i)}})}async addSignalHandler(e,t){let n=Le(this,Lr,"f").get(e);n||(n=[],await this.subscribeToSignals(e)),n.push(t),Le(this,Lr,"f").set(e,n)}removeSignalHandler(e,t){let n=Le(this,Lr,"f").get(e);if(n){let i=n.indexOf(t);i>-1&&n.splice(i,1)}Le(this,Lr,"f").set(e,n)}};Ve=new WeakMap,Lr=new WeakMap;var Fs=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},le=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},fe,di,hi,Ca=`
|
|
508
508
|
author
|
|
509
509
|
timestamp
|
|
510
510
|
data {
|
|
@@ -516,64 +516,64 @@ data {
|
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
518
|
proof { valid, invalid, signature, key }
|
|
519
|
-
`,Hs=class{constructor(e,t=!0){
|
|
519
|
+
`,Hs=class{constructor(e,t=!0){fe.set(this,void 0),di.set(this,void 0),hi.set(this,void 0),Fs(this,fe,e,"f"),Fs(this,di,[],"f"),Fs(this,hi,[],"f"),t&&(this.subscribeMessageReceived(),this.subscribeExceptionOccurred())}async info(){let{runtimeInfo:e}=A(await le(this,fe,"f").query({query:E`query runtimeInfo {
|
|
520
520
|
runtimeInfo {
|
|
521
521
|
ad4mExecutorVersion,
|
|
522
522
|
isInitialized,
|
|
523
523
|
isUnlocked
|
|
524
524
|
}
|
|
525
|
-
}`}));return e}async quit(){return A(await
|
|
525
|
+
}`}));return e}async quit(){return A(await le(this,fe,"f").mutate({mutation:E`mutation runtimeQuit { runtimeQuit }`})).runtimeQuit}async openLink(e){let{runtimeOpenLink:t}=A(await le(this,fe,"f").mutate({mutation:E`mutation runtimeOpenLink($url: String!) {
|
|
526
526
|
runtimeOpenLink(url: $url)
|
|
527
|
-
}`,variables:{url:e}}));return t}async addTrustedAgents(e){let{addTrustedAgents:t}=A(await
|
|
527
|
+
}`,variables:{url:e}}));return t}async addTrustedAgents(e){let{addTrustedAgents:t}=A(await le(this,fe,"f").mutate({mutation:E`mutation addTrustedAgents($agents: [String!]!) {
|
|
528
528
|
addTrustedAgents(agents: $agents)
|
|
529
|
-
}`,variables:{agents:e}}));return t}async deleteTrustedAgents(e){let{deleteTrustedAgents:t}=A(await
|
|
529
|
+
}`,variables:{agents:e}}));return t}async deleteTrustedAgents(e){let{deleteTrustedAgents:t}=A(await le(this,fe,"f").mutate({mutation:E`mutation deleteTrustedAgents($agents: [String!]!) {
|
|
530
530
|
deleteTrustedAgents(agents: $agents)
|
|
531
|
-
}`,variables:{agents:e}}));return t}async getTrustedAgents(){let{getTrustedAgents:e}=A(await
|
|
531
|
+
}`,variables:{agents:e}}));return t}async getTrustedAgents(){let{getTrustedAgents:e}=A(await le(this,fe,"f").query({query:E`query getTrustedAgents {
|
|
532
532
|
getTrustedAgents
|
|
533
|
-
}`}));return e}async addKnownLinkLanguageTemplates(e){let{runtimeAddKnownLinkLanguageTemplates:t}=A(await
|
|
533
|
+
}`}));return e}async addKnownLinkLanguageTemplates(e){let{runtimeAddKnownLinkLanguageTemplates:t}=A(await le(this,fe,"f").mutate({mutation:E`mutation runtimeAddKnownLinkLanguageTemplates($addresses: [String!]!) {
|
|
534
534
|
runtimeAddKnownLinkLanguageTemplates(addresses: $addresses)
|
|
535
|
-
}`,variables:{addresses:e}}));return t}async removeKnownLinkLanguageTemplates(e){let{runtimeRemoveKnownLinkLanguageTemplates:t}=A(await
|
|
535
|
+
}`,variables:{addresses:e}}));return t}async removeKnownLinkLanguageTemplates(e){let{runtimeRemoveKnownLinkLanguageTemplates:t}=A(await le(this,fe,"f").mutate({mutation:E`mutation runtimeRemoveKnownLinkLanguageTemplates($addresses: [String!]!) {
|
|
536
536
|
runtimeRemoveKnownLinkLanguageTemplates(addresses: $addresses)
|
|
537
|
-
}`,variables:{addresses:e}}));return t}async knownLinkLanguageTemplates(){let{runtimeKnownLinkLanguageTemplates:e}=A(await
|
|
537
|
+
}`,variables:{addresses:e}}));return t}async knownLinkLanguageTemplates(){let{runtimeKnownLinkLanguageTemplates:e}=A(await le(this,fe,"f").query({query:E`query runtimeKnownLinkLanguageTemplates {
|
|
538
538
|
runtimeKnownLinkLanguageTemplates
|
|
539
|
-
}`}));return e}async addFriends(e){let{runtimeAddFriends:t}=A(await
|
|
539
|
+
}`}));return e}async addFriends(e){let{runtimeAddFriends:t}=A(await le(this,fe,"f").mutate({mutation:E`mutation runtimeAddFriends($dids: [String!]!) {
|
|
540
540
|
runtimeAddFriends(dids: $dids)
|
|
541
|
-
}`,variables:{dids:e}}));return t}async removeFriends(e){let{runtimeRemoveFriends:t}=A(await
|
|
541
|
+
}`,variables:{dids:e}}));return t}async removeFriends(e){let{runtimeRemoveFriends:t}=A(await le(this,fe,"f").mutate({mutation:E`mutation runtimeRemoveFriends($dids: [String!]!) {
|
|
542
542
|
runtimeRemoveFriends(dids: $dids)
|
|
543
|
-
}`,variables:{dids:e}}));return t}async friends(){let{runtimeFriends:e}=A(await
|
|
543
|
+
}`,variables:{dids:e}}));return t}async friends(){let{runtimeFriends:e}=A(await le(this,fe,"f").query({query:E`query runtimeFriends {
|
|
544
544
|
runtimeFriends
|
|
545
|
-
}`}));return e}async hcAgentInfos(){let{runtimeHcAgentInfos:e}=A(await
|
|
545
|
+
}`}));return e}async hcAgentInfos(){let{runtimeHcAgentInfos:e}=A(await le(this,fe,"f").query({query:E`query runtimeHcAgentInfos {
|
|
546
546
|
runtimeHcAgentInfos
|
|
547
|
-
}`}));return e}async hcAddAgentInfos(e){let{runtimeHcAddAgentInfos:t}=A(await
|
|
547
|
+
}`}));return e}async hcAddAgentInfos(e){let{runtimeHcAddAgentInfos:t}=A(await le(this,fe,"f").mutate({mutation:E`mutation runtimeHcAddAgentInfos($agentInfos: String!) {
|
|
548
548
|
runtimeHcAddAgentInfos(agentInfos: $agentInfos)
|
|
549
|
-
}`,variables:{agentInfos:e}}));return t}async verifyStringSignedByDid(e,t,n,i){let{runtimeVerifyStringSignedByDid:a}=A(await
|
|
549
|
+
}`,variables:{agentInfos:e}}));return t}async verifyStringSignedByDid(e,t,n,i){let{runtimeVerifyStringSignedByDid:a}=A(await le(this,fe,"f").mutate({mutation:E`query runtimeVerifyStringSignedByDid($did: String!, $didSigningKeyId: String!, $data: String!, $signedData: String!) {
|
|
550
550
|
runtimeVerifyStringSignedByDid(did: $did, didSigningKeyId: $didSigningKeyId, data: $data, signedData: $signedData)
|
|
551
|
-
}`,variables:{did:e,didSigningKeyId:t,data:n,signedData:i}}));return a}async setStatus(e){let{runtimeSetStatus:t}=A(await
|
|
551
|
+
}`,variables:{did:e,didSigningKeyId:t,data:n,signedData:i}}));return a}async setStatus(e){let{runtimeSetStatus:t}=A(await le(this,fe,"f").mutate({mutation:E`mutation runtimeSetStatus($status: PerspectiveInput!) {
|
|
552
552
|
runtimeSetStatus(status: $status)
|
|
553
|
-
}`,variables:{status:e}}));return t}async friendStatus(e){let{runtimeFriendStatus:t}=A(await
|
|
553
|
+
}`,variables:{status:e}}));return t}async friendStatus(e){let{runtimeFriendStatus:t}=A(await le(this,fe,"f").query({query:E`query runtimeFriendStatus($did: String!) {
|
|
554
554
|
runtimeFriendStatus(did: $did) { ${Ca} }
|
|
555
|
-
}`,variables:{did:e}}));return t}async friendSendMessage(e,t){let{runtimeFriendSendMessage:n}=A(await
|
|
555
|
+
}`,variables:{did:e}}));return t}async friendSendMessage(e,t){let{runtimeFriendSendMessage:n}=A(await le(this,fe,"f").mutate({mutation:E`mutation runtimeFriendSendMessage($did: String!, $message: PerspectiveInput!) {
|
|
556
556
|
runtimeFriendSendMessage(did: $did, message: $message)
|
|
557
|
-
}`,variables:{did:e,message:t}}));return n}async messageInbox(e){let{runtimeMessageInbox:t}=A(await
|
|
557
|
+
}`,variables:{did:e,message:t}}));return n}async messageInbox(e){let{runtimeMessageInbox:t}=A(await le(this,fe,"f").query({query:E`query runtimeMessageInbox($filter: String) {
|
|
558
558
|
runtimeMessageInbox(filter: $filter) { ${Ca} }
|
|
559
|
-
}`,variables:{filter:e}}));return t}async messageOutbox(e){let{runtimeMessageOutbox:t}=A(await
|
|
559
|
+
}`,variables:{filter:e}}));return t}async messageOutbox(e){let{runtimeMessageOutbox:t}=A(await le(this,fe,"f").query({query:E`query runtimeMessageOutbox($filter: String) {
|
|
560
560
|
runtimeMessageOutbox(filter: $filter) {
|
|
561
561
|
recipient,
|
|
562
562
|
message {
|
|
563
563
|
${Ca}
|
|
564
564
|
}
|
|
565
565
|
}
|
|
566
|
-
}`,variables:{filter:e}}));return t}addMessageCallback(e){
|
|
566
|
+
}`,variables:{filter:e}}));return t}addMessageCallback(e){le(this,di,"f").push(e)}subscribeMessageReceived(){le(this,fe,"f").subscribe({query:E` subscription {
|
|
567
567
|
runtimeMessageReceived { ${Ca} }
|
|
568
568
|
}
|
|
569
|
-
`}).subscribe({next:e=>{
|
|
569
|
+
`}).subscribe({next:e=>{le(this,di,"f").forEach(t=>{t(e.data.runtimeMessageReceived)})},error:e=>console.error(e)})}addExceptionCallback(e){le(this,hi,"f").push(e)}subscribeExceptionOccurred(){le(this,fe,"f").subscribe({query:E` subscription {
|
|
570
570
|
exceptionOccurred {
|
|
571
571
|
title
|
|
572
572
|
message
|
|
573
573
|
type
|
|
574
574
|
addon
|
|
575
575
|
}
|
|
576
|
-
}`}).subscribe({next:e=>{
|
|
576
|
+
}`}).subscribe({next:e=>{le(this,hi,"f").forEach(t=>{t(e.data.exceptionOccurred)})},error:e=>console.error(e)})}};fe=new WeakMap,di=new WeakMap,hi=new WeakMap;var U1=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},vn=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},$t,Js=class{constructor(e){$t.set(this,void 0),U1(this,$t,e,"f")}async get(e){let{expression:t}=A(await vn(this,$t,"f").query({query:E`query expression($url: String!) {
|
|
577
577
|
expression(url: $url) {
|
|
578
578
|
author
|
|
579
579
|
timestamp
|
|
@@ -586,7 +586,7 @@ proof { valid, invalid, signature, key }
|
|
|
586
586
|
invalid
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
|
-
}`,variables:{url:e}}));return t}async getMany(e){let{expressionMany:t}=A(await vn(this,
|
|
589
|
+
}`,variables:{url:e}}));return t}async getMany(e){let{expressionMany:t}=A(await vn(this,$t,"f").query({query:E`query expressionMany($urls: [String!]!) {
|
|
590
590
|
expressionMany(urls: $urls) {
|
|
591
591
|
author
|
|
592
592
|
timestamp
|
|
@@ -599,32 +599,32 @@ proof { valid, invalid, signature, key }
|
|
|
599
599
|
invalid
|
|
600
600
|
}
|
|
601
601
|
}
|
|
602
|
-
}`,variables:{urls:e}}));return t}async getRaw(e){let{expressionRaw:t}=A(await vn(this,
|
|
602
|
+
}`,variables:{urls:e}}));return t}async getRaw(e){let{expressionRaw:t}=A(await vn(this,$t,"f").query({query:E`query expressionRaw($url: String!) {
|
|
603
603
|
expressionRaw(url: $url)
|
|
604
|
-
}`,variables:{url:e}}));return t}async create(e,t){e=JSON.stringify(e);let{expressionCreate:n}=A(await vn(this,
|
|
604
|
+
}`,variables:{url:e}}));return t}async create(e,t){e=JSON.stringify(e);let{expressionCreate:n}=A(await vn(this,$t,"f").mutate({mutation:E`mutation expressionCreate($content: String!, $languageAddress: String!){
|
|
605
605
|
expressionCreate(content: $content, languageAddress: $languageAddress)
|
|
606
|
-
}`,variables:{content:e,languageAddress:t}}));return n}async interactions(e){let{expressionInteractions:t}=A(await vn(this,
|
|
606
|
+
}`,variables:{content:e,languageAddress:t}}));return n}async interactions(e){let{expressionInteractions:t}=A(await vn(this,$t,"f").query({query:E`query expressionInteractions($url: String!) {
|
|
607
607
|
expressionInteractions(url: $url) {
|
|
608
608
|
label
|
|
609
609
|
name
|
|
610
610
|
parameters { name, type }
|
|
611
611
|
}
|
|
612
|
-
}`,variables:{url:e}}));return t}async interact(e,t){let{expressionInteract:n}=A(await vn(this,
|
|
612
|
+
}`,variables:{url:e}}));return t}async interact(e,t){let{expressionInteract:n}=A(await vn(this,$t,"f").mutate({mutation:E`mutation expressionInteract($url: String!, $interactionCall: InteractionCall!){
|
|
613
613
|
expressionInteract(url: $url, interactionCall: $interactionCall)
|
|
614
|
-
}`,variables:{url:e,interactionCall:t}}));return n}};Ft=new WeakMap;var Ir=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},je=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},$t,ka,mi,Da,yi,Cn,Na,Wa=class{constructor(e,t=!0){$t.set(this,void 0),ka.set(this,void 0),mi.set(this,void 0),Da.set(this,void 0),yi.set(this,void 0),Cn.set(this,void 0),Na.set(this,void 0),Ir(this,$t,e,"f"),Ir(this,ka,new Si(je(this,$t,"f"),t),"f"),Ir(this,mi,new Js(je(this,$t,"f")),"f"),Ir(this,Da,new Ks(je(this,$t,"f")),"f"),Ir(this,yi,new zs(je(this,$t,"f")),"f"),Ir(this,Cn,new Qa(je(this,$t,"f"),t),"f"),je(this,Cn,"f").setExpressionClient(je(this,mi,"f")),je(this,Cn,"f").setNeighbourhoodClient(je(this,yi,"f")),Ir(this,Na,new Hs(je(this,$t,"f"),t),"f")}get agent(){return je(this,ka,"f")}get expression(){return je(this,mi,"f")}get languages(){return je(this,Da,"f")}get neighbourhood(){return je(this,yi,"f")}get perspective(){return je(this,Cn,"f")}get runtime(){return je(this,Na,"f")}};$t=new WeakMap,ka=new WeakMap,mi=new WeakMap,Da=new WeakMap,yi=new WeakMap,Cn=new WeakMap,Na=new WeakMap;var Jl;(function(r){r.LanguageIsNotLoaded="LANGUAGE_IS_NOT_LOADED",r.ExpressionIsNotVerified="EXPRESSION_IS_NOT_VERIFIED",r.AgentIsUntrusted="AGENT_IS_UNTRUSTED",r.CapabilityRequested="CAPABILITY_REQUESTED"})(Jl||(Jl={}));var nc=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},ic=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},$r=class{constructor(e,t){this.language=e,this.expression=t}};nc([v(),ic("design:type",xt)],$r.prototype,"language",void 0);nc([v(),ic("design:type",String)],$r.prototype,"expression",void 0);$r=nc([J(),ic("design:paramtypes",[xt,String])],$r);function X6(r){return r.language.address==="did"?r.expression.toString():`${r.language.address}://${r.expression}`}function Z6(r){if(r.startsWith("literal://")){let a=new xt;a.address="literal",a.name="literal";let o=r.substring(10);return new $r(a,o)}let t=/^([^:^\s]+):\/\/([\s\S]+)$/.exec(r);if(t&&t.length==3){let a=t[1],o=t[2],s=new xt;return s.address=a,new $r(s,o)}let i=/^did:([^\s]+)$/.exec(r);if(i&&i.length==2){let a=new xt;return a.address="did",new $r(a,r)}throw new Error("Couldn't parse string as expression URL or DID: "+r)}var it=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},At=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Ga=class{};it([v(),At("design:type",String)],Ga.prototype,"name",void 0);it([v(),At("design:type",String)],Ga.prototype,"type",void 0);Ga=it([J()],Ga);var wi=class{};it([v(),At("design:type",String)],wi.prototype,"label",void 0);it([v(),At("design:type",String)],wi.prototype,"name",void 0);it([v(),At("design:type",Array)],wi.prototype,"parameters",void 0);wi=it([J()],wi);var Ka=class{get parameters(){return JSON.parse(this.parametersStringified)}constructor(e,t){this.name=e,this.parametersStringified=JSON.stringify(t)}};it([v(),At("design:type",String)],Ka.prototype,"name",void 0);it([v(),At("design:type",String)],Ka.prototype,"parametersStringified",void 0);Ka=it([Ge(),At("design:paramtypes",[String,Object])],Ka);var za=class{};it([v(),At("design:type",String)],za.prototype,"did",void 0);it([v(),At("design:type",Ws)],za.prototype,"status",void 0);za=it([J()],za);var Yl=class{},Gr=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},An=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},ur=class{};Gr([v(),An("design:type",String)],ur.prototype,"name",void 0);Gr([v(),An("design:type",String)],ur.prototype,"address",void 0);Gr([v(),An("design:type",String)],ur.prototype,"settings",void 0);Gr([v(),An("design:type",jr)],ur.prototype,"icon",void 0);Gr([v(),An("design:type",jr)],ur.prototype,"constructorIcon",void 0);Gr([v(),An("design:type",jr)],ur.prototype,"settingsIcon",void 0);ur=Gr([J()],ur);var Ke=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},Ze=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},gt=class{};Ke([v(),Ze("design:type",String)],gt.prototype,"name",void 0);Ke([v(),Ze("design:type",String)],gt.prototype,"address",void 0);Ke([v(),Ze("design:type",String)],gt.prototype,"description",void 0);Ke([v(),Ze("design:type",String)],gt.prototype,"author",void 0);Ke([v(),Ze("design:type",Boolean)],gt.prototype,"templated",void 0);Ke([v(),Ze("design:type",String)],gt.prototype,"templateSourceLanguageAddress",void 0);Ke([v(),Ze("design:type",String)],gt.prototype,"templateAppliedParams",void 0);Ke([v(),Ze("design:type",Array)],gt.prototype,"possibleTemplateParams",void 0);Ke([v(),Ze("design:type",String)],gt.prototype,"sourceCodeLink",void 0);gt=Ke([J()],gt);var xn=class{constructor(e,t){this.name=e,this.description=t,this.description||(this.description="")}};Ke([v(),Ze("design:type",String)],xn.prototype,"name",void 0);Ke([v(),Ze("design:type",String)],xn.prototype,"description",void 0);Ke([v(),Ze("design:type",Array)],xn.prototype,"possibleTemplateParams",void 0);Ke([v(),Ze("design:type",String)],xn.prototype,"sourceCodeLink",void 0);xn=Ke([Ge(),Ze("design:paramtypes",[String,String])],xn);var Xl=class{},Zl=class extends lr(){},ep=class{},Xa=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},ac=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Ha=class{constructor(e,t){this.linkLanguage=e,this.meta=t}};Xa([v(),ac("design:type",String)],Ha.prototype,"linkLanguage",void 0);Xa([v(),ac("design:type",ar)],Ha.prototype,"meta",void 0);Ha=Xa([J(),ac("design:paramtypes",[String,ar])],Ha);var Ys=class extends lr(){};Ys=Xa([J()],Ys);var In=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},kn=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Xs;(function(r){r.Private="PRIVATE",r.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 Br=class{constructor(e,t,n){this.uuid=e,this.name=t,n?this.state=n:this.state=Xs.Private}};In([v(),kn("design:type",String)],Br.prototype,"uuid",void 0);In([v(),kn("design:type",String)],Br.prototype,"name",void 0);In([v(),kn("design:type",String)],Br.prototype,"state",void 0);In([v(),kn("design:type",String)],Br.prototype,"sharedUrl",void 0);In([v(),kn("design:type",Ys)],Br.prototype,"neighbourhood",void 0);Br=In([J(),kn("design:paramtypes",[String,String,String])],Br);var Za=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},Cp=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Ja=class{};Za([v(),Cp("design:type",Array)],Ja.prototype,"additions",void 0);Za([v(),Cp("design:type",Array)],Ja.prototype,"removals",void 0);Ja=Za([J()],Ja);var tp=class extends lr(){};tp=Za([J()],tp);var rp=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},bn=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},gi,Fr,Sa="smart_literal://content";function U1(r){let e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=t.length;for(let i=0;i<r;i++)e+=t.charAt(Math.floor(Math.random()*n));return e}var _i=class{constructor(e,t){gi.set(this,void 0),Fr.set(this,void 0),rp(this,gi,e,"f"),rp(this,Fr,t,"f")}get base(){return bn(this,Fr,"f")}static async create(e,t){let n=Tt.from(U1(10)).toUrl(),i=new _i(e,n);return await i.set(t),i}static async isSmartLiteralBase(e,t){return(await e.get(new We({source:t,predicate:Sa}))).length>0}static async getAllSmartLiterals(e){return(await e.get(new We({predicate:Sa}))).map(n=>new _i(e,n.data.source))}async get(){let e=await bn(this,gi,"f").getSingleTarget(new We({source:bn(this,Fr,"f"),predicate:Sa}));if(!e)throw`No content for smart literal ${bn(this,Fr,"f")}`;return Tt.fromUrl(e).get()}async set(e){let t=Tt.from(e);await bn(this,gi,"f").setSingleTarget(new Ot({source:bn(this,Fr,"f"),predicate:Sa,target:t.toUrl()}))}};gi=new WeakMap,Fr=new WeakMap;var np=class{};function fg(r,e,t){return{action:"addLink",source:r,predicate:e,target:t}}function dg(r){return`triple(this, "${r}", _)`}function hg(r){return function(e,t,n){if(typeof n.value!="function")throw new Error("InstanceQuery decorator can only be applied to methods");n.value=async function(a){let o=[],s=e.name,u=`subject_class("${s}", C), instance(C, Instance)`;if(r&&r.where)for(let p in r.where){let f=r.where[p];u+=`, property_getter(C, Instance, "${p}", "${f}")`}r&&r.condition&&(u+=", "+r.condition);let l=await a.infer(u);if(l==!1)return o;if(typeof l=="string")throw l;for(let p of l){let f=p.Instance,h=new Va(a,f,s);await h.init(),o.push(h)}return o}}}function mg(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${nr(n)}`]=()=>{}}Object.defineProperty(e,t,{configurable:!0,writable:!0})}}function yg(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 gg(r){return function(e,t){e.__collections=e.__collections||{},e.__collections[t]=r;let n=t;e[`add${nr(n)}`]=()=>{},e[`remove${nr(n)}`]=()=>{},e[`setCollection${nr(n)}`]=()=>{},Object.defineProperty(e,t,{configurable:!0,writable:!0})}}function Sp(r){let e="",t="abcdefghijklmnopqrstuvwxyz",n=t.length;for(let i=0;i<r;i++)e+=t.charAt(Math.floor(Math.random()*n));return e}function vg(r){return function(e){e.prototype.className=r.name,e.className=r.name,e.generateSDNA=function(){let t="",n=r.name,i=e.prototype,a=Sp(8);t+=`subject_class("${n}", ${a}).
|
|
614
|
+
}`,variables:{url:e,interactionCall:t}}));return n}};$t=new WeakMap;var Ir=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},je=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Mt,ka,mi,Da,yi,Cn,Na,Wa=class{constructor(e,t=!0){Mt.set(this,void 0),ka.set(this,void 0),mi.set(this,void 0),Da.set(this,void 0),yi.set(this,void 0),Cn.set(this,void 0),Na.set(this,void 0),Ir(this,Mt,e,"f"),Ir(this,ka,new Si(je(this,Mt,"f"),t),"f"),Ir(this,mi,new Js(je(this,Mt,"f")),"f"),Ir(this,Da,new Ks(je(this,Mt,"f")),"f"),Ir(this,yi,new zs(je(this,Mt,"f")),"f"),Ir(this,Cn,new Qa(je(this,Mt,"f"),t),"f"),je(this,Cn,"f").setExpressionClient(je(this,mi,"f")),je(this,Cn,"f").setNeighbourhoodClient(je(this,yi,"f")),Ir(this,Na,new Hs(je(this,Mt,"f"),t),"f")}get agent(){return je(this,ka,"f")}get expression(){return je(this,mi,"f")}get languages(){return je(this,Da,"f")}get neighbourhood(){return je(this,yi,"f")}get perspective(){return je(this,Cn,"f")}get runtime(){return je(this,Na,"f")}};Mt=new WeakMap,ka=new WeakMap,mi=new WeakMap,Da=new WeakMap,yi=new WeakMap,Cn=new WeakMap,Na=new WeakMap;var Yl;(function(r){r.LanguageIsNotLoaded="LANGUAGE_IS_NOT_LOADED",r.ExpressionIsNotVerified="EXPRESSION_IS_NOT_VERIFIED",r.AgentIsUntrusted="AGENT_IS_UNTRUSTED",r.CapabilityRequested="CAPABILITY_REQUESTED"})(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)},$r=class{constructor(e,t){this.language=e,this.expression=t}};nc([v(),ic("design:type",Ot)],$r.prototype,"language",void 0);nc([v(),ic("design:type",String)],$r.prototype,"expression",void 0);$r=nc([Y(),ic("design:paramtypes",[Ot,String])],$r);function Zg(r){return r.language.address==="did"?r.expression.toString():`${r.language.address}://${r.expression}`}function ev(r){if(r.startsWith("literal://")){let a=new Ot;a.address="literal",a.name="literal";let o=r.substring(10);return new $r(a,o)}let t=/^([^:^\s]+):\/\/([\s\S]+)$/.exec(r);if(t&&t.length==3){let a=t[1],o=t[2],s=new Ot;return s.address=a,new $r(s,o)}let i=/^did:([^\s]+)$/.exec(r);if(i&&i.length==2){let a=new Ot;return a.address="did",new $r(a,r)}throw new Error("Couldn't parse string as expression URL or DID: "+r)}var at=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},It=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Ga=class{};at([v(),It("design:type",String)],Ga.prototype,"name",void 0);at([v(),It("design:type",String)],Ga.prototype,"type",void 0);Ga=at([Y()],Ga);var wi=class{};at([v(),It("design:type",String)],wi.prototype,"label",void 0);at([v(),It("design:type",String)],wi.prototype,"name",void 0);at([v(),It("design:type",Array)],wi.prototype,"parameters",void 0);wi=at([Y()],wi);var Ka=class{get parameters(){return JSON.parse(this.parametersStringified)}constructor(e,t){this.name=e,this.parametersStringified=JSON.stringify(t)}};at([v(),It("design:type",String)],Ka.prototype,"name",void 0);at([v(),It("design:type",String)],Ka.prototype,"parametersStringified",void 0);Ka=at([Ge(),It("design:paramtypes",[String,Object])],Ka);var za=class{};at([v(),It("design:type",String)],za.prototype,"did",void 0);at([v(),It("design:type",Ws)],za.prototype,"status",void 0);za=at([Y()],za);var Xl=class{},Gr=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},An=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},ur=class{};Gr([v(),An("design:type",String)],ur.prototype,"name",void 0);Gr([v(),An("design:type",String)],ur.prototype,"address",void 0);Gr([v(),An("design:type",String)],ur.prototype,"settings",void 0);Gr([v(),An("design:type",jr)],ur.prototype,"icon",void 0);Gr([v(),An("design:type",jr)],ur.prototype,"constructorIcon",void 0);Gr([v(),An("design:type",jr)],ur.prototype,"settingsIcon",void 0);ur=Gr([Y()],ur);var Ke=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},Ze=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},vt=class{};Ke([v(),Ze("design:type",String)],vt.prototype,"name",void 0);Ke([v(),Ze("design:type",String)],vt.prototype,"address",void 0);Ke([v(),Ze("design:type",String)],vt.prototype,"description",void 0);Ke([v(),Ze("design:type",String)],vt.prototype,"author",void 0);Ke([v(),Ze("design:type",Boolean)],vt.prototype,"templated",void 0);Ke([v(),Ze("design:type",String)],vt.prototype,"templateSourceLanguageAddress",void 0);Ke([v(),Ze("design:type",String)],vt.prototype,"templateAppliedParams",void 0);Ke([v(),Ze("design:type",Array)],vt.prototype,"possibleTemplateParams",void 0);Ke([v(),Ze("design:type",String)],vt.prototype,"sourceCodeLink",void 0);vt=Ke([Y()],vt);var xn=class{constructor(e,t){this.name=e,this.description=t,this.description||(this.description="")}};Ke([v(),Ze("design:type",String)],xn.prototype,"name",void 0);Ke([v(),Ze("design:type",String)],xn.prototype,"description",void 0);Ke([v(),Ze("design:type",Array)],xn.prototype,"possibleTemplateParams",void 0);Ke([v(),Ze("design:type",String)],xn.prototype,"sourceCodeLink",void 0);xn=Ke([Ge(),Ze("design:paramtypes",[String,String])],xn);var Zl=class{},ep=class extends lr(){},tp=class{},Xa=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},ac=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Ha=class{constructor(e,t){this.linkLanguage=e,this.meta=t}};Xa([v(),ac("design:type",String)],Ha.prototype,"linkLanguage",void 0);Xa([v(),ac("design:type",ar)],Ha.prototype,"meta",void 0);Ha=Xa([Y(),ac("design:paramtypes",[String,ar])],Ha);var Ys=class extends lr(){};Ys=Xa([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},kn=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 Br=class{constructor(e,t,n){this.uuid=e,this.name=t,n?this.state=n:this.state=Xs.Private}};In([v(),kn("design:type",String)],Br.prototype,"uuid",void 0);In([v(),kn("design:type",String)],Br.prototype,"name",void 0);In([v(),kn("design:type",String)],Br.prototype,"state",void 0);In([v(),kn("design:type",String)],Br.prototype,"sharedUrl",void 0);In([v(),kn("design:type",Ys)],Br.prototype,"neighbourhood",void 0);Br=In([Y(),kn("design:paramtypes",[String,String,String])],Br);var Za=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},Sp=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Ja=class{};Za([v(),Sp("design:type",Array)],Ja.prototype,"additions",void 0);Za([v(),Sp("design:type",Array)],Ja.prototype,"removals",void 0);Ja=Za([Y()],Ja);var rp=class extends lr(){};rp=Za([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},bn=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},gi,Fr,Sa="smart_literal://content";function q1(r){let e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=t.length;for(let i=0;i<r;i++)e+=t.charAt(Math.floor(Math.random()*n));return e}var _i=class{constructor(e,t){gi.set(this,void 0),Fr.set(this,void 0),np(this,gi,e,"f"),np(this,Fr,t,"f")}get base(){return bn(this,Fr,"f")}static async create(e,t){let n=At.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 We({source:t,predicate:Sa}))).length>0}static async getAllSmartLiterals(e){return(await e.get(new We({predicate:Sa}))).map(n=>new _i(e,n.data.source))}async get(){let e=await bn(this,gi,"f").getSingleTarget(new We({source:bn(this,Fr,"f"),predicate:Sa}));if(!e)throw`No content for smart literal ${bn(this,Fr,"f")}`;return At.fromUrl(e).get()}async set(e){let t=At.from(e);await bn(this,gi,"f").setSingleTarget(new Tt({source:bn(this,Fr,"f"),predicate:Sa,target:t.toUrl()}))}};gi=new WeakMap,Fr=new WeakMap;var ip=class{};function dv(r,e,t){return{action:"addLink",source:r,predicate:e,target:t}}function hv(r){return`triple(this, "${r}", _)`}function mv(r){return function(e,t,n){if(typeof n.value!="function")throw new Error("InstanceQuery decorator can only be applied to methods");n.value=async function(a){let o=[],s=e.name,u=`subject_class("${s}", C), instance(C, Instance)`;if(r&&r.where)for(let p in r.where){let f=r.where[p];u+=`, property_getter(C, Instance, "${p}", "${f}")`}r&&r.condition&&(u+=", "+r.condition);let l=await a.infer(u);if(l==!1)return o;if(typeof l=="string")throw l;for(let p of l){let f=p.Instance,h=new Va(a,f,s);await h.init(),o.push(h)}return o}}}function yv(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${nr(n)}`]=()=>{}}Object.defineProperty(e,t,{configurable:!0,writable:!0})}}function gv(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 vv(r){return function(e,t){e.__collections=e.__collections||{},e.__collections[t]=r;let n=t;e[`add${nr(n)}`]=()=>{},e[`remove${nr(n)}`]=()=>{},e[`setCollection${nr(n)}`]=()=>{},Object.defineProperty(e,t,{configurable:!0,writable:!0})}}function wp(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 bv(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=wp(8);t+=`subject_class("${n}", ${a}).
|
|
615
615
|
`;let o=[],s=[];i.subjectConstructor&&i.subjectConstructor.length&&(s=s.concat(i.subjectConstructor));let u=[];i.isSubjectInstance&&i.isSubjectInstance.length&&(u=u.concat(i.isSubjectInstance));let l=[],p=i.__properties||{};for(let y in p){let g=`property(${a}, "${y}").
|
|
616
616
|
`,{through:C,initial:_,required:b,resolveLanguage:S,writable:O,flag:k,getter:N,setter:I,local:R}=p[y];if(S&&(g+=`property_resolve(${a}, "${y}").
|
|
617
617
|
`,g+=`property_resolve_language(${a}, "${y}", "${S}").
|
|
618
618
|
`),N?g+=`property_getter(${a}, Base, "${y}", Value) :- ${N}.
|
|
619
619
|
`:C&&(g+=`property_getter(${a}, Base, "${y}", Value) :- triple(Base, "${C}", Value).
|
|
620
620
|
`,b&&(k?u.push(`triple(Base, "${C}", "${_}")`):u.push(`triple(Base, "${C}", _)`))),I)g+=`property_setter(${a}, "${y}", Actions) :- ${I}.
|
|
621
|
-
`;else if(O&&typeof i[
|
|
621
|
+
`;else if(O&&typeof i[Cp(y)]=="function"){let ee=[{action:"setSingleTarget",source:"this",predicate:C,target:"value",...R&&{local:!0}}];g+=`property_setter(${a}, "${y}", '${Dr(ee)}').
|
|
622
622
|
`}l.push(g),_&&(s.push({action:"addLink",source:"this",predicate:C,target:_}),o.push({action:"removeLink",source:"this",predicate:C,target:_}))}let f=[],h=i.__collections||{};for(let y in h){let g=`collection(${a}, "${y}").
|
|
623
623
|
`,{through:C,where:_,local:b}=h[y];if(C){if(_){if(!_.isInstance&&!_.condition)throw"'where' needs one of 'isInstance' or 'condition'";let N=[];if(_.isInstance){let R;_.isInstance.name?R=_.isInstance.name:R=_.isInstance,N.push(`instance(OtherClass, Target), subject_class("${R}", OtherClass)`)}_.condition&&N.push(_.condition);let I=N.join(", ");g+=`collection_getter(${a}, Base, "${y}", List) :- setof(Target, (triple(Base, "${C}", Target), ${I}), List).
|
|
624
624
|
`}else g+=`collection_getter(${a}, Base, "${y}", List) :- findall(C, triple(Base, "${C}", C), List).
|
|
625
|
-
`;let S=[{action:"addLink",source:"this",predicate:C,target:"value",...b&&{local:!0}}],O=[{action:"removeLink",source:"this",predicate:C,target:"value"}],k=[{action:"collectionSetter",source:"this",predicate:C,target:"value",...b&&{local:!0}}];g+=`collection_adder(${a}, "${
|
|
626
|
-
`,g+=`collection_remover(${a}, "${
|
|
627
|
-
`,g+=`collection_setter(${a}, "${
|
|
625
|
+
`;let S=[{action:"addLink",source:"this",predicate:C,target:"value",...b&&{local:!0}}],O=[{action:"removeLink",source:"this",predicate:C,target:"value"}],k=[{action:"collectionSetter",source:"this",predicate:C,target:"value",...b&&{local:!0}}];g+=`collection_adder(${a}, "${jt(y)}", '${Dr(S)}').
|
|
626
|
+
`,g+=`collection_remover(${a}, "${jt(y)}", '${Dr(O)}').
|
|
627
|
+
`,g+=`collection_setter(${a}, "${jt(y)}", '${Dr(k)}').
|
|
628
628
|
`}f.push(g)}let d=Dr(s);if(t+=`constructor(${a}, '${d}').
|
|
629
629
|
`,u.length>0){let y=u.join(", ");t+=`instance(${a}, Base) :- ${y}.
|
|
630
630
|
`,t+=`
|
|
@@ -633,7 +633,7 @@ proof { valid, invalid, signature, key }
|
|
|
633
633
|
`,t+=l.join(`
|
|
634
634
|
`),t+=`
|
|
635
635
|
`,t+=f.join(`
|
|
636
|
-
`),{sdna:t,name:n}},Object.defineProperty(e,"type",{configurable:!0})}}var
|
|
636
|
+
`),{sdna:t,name:n}},Object.defineProperty(e,"type",{configurable:!0})}}var Cv=`
|
|
637
637
|
type Agent {
|
|
638
638
|
did: String!
|
|
639
639
|
directMessageLanguage: String
|
|
@@ -1011,7 +1011,7 @@ type Subscription {
|
|
|
1011
1011
|
perspectiveUpdated: PerspectiveHandle
|
|
1012
1012
|
runtimeMessageReceived: PerspectiveExpression
|
|
1013
1013
|
}
|
|
1014
|
-
`;function ip(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 wp(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`${ip(e)} your ${t} actions, with access to ${ip(n)}`}var kr=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},M=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Qe,Fe,Pa,ae,ap=class{constructor(r,e,t){Qe.set(this,void 0),Fe.set(this,void 0),Pa.set(this,void 0),ae.set(this,void 0),kr(this,Qe,e||Tt.from(Sp(24)).toUrl(),"f"),kr(this,ae,r,"f"),kr(this,Pa,t||"ad4m://self","f")}get baseExpression(){return M(this,Qe,"f")}async getData(id){let tempId=id??M(this,Qe,"f"),isInstance=await M(this,ae,"f").isSubjectInstance(tempId,M(this,Fe,"f"));if(!isInstance)throw`Not a valid subject instance of ${M(this,Fe,"f")} for ${tempId}`;let results=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), property(C, Property)`),properties=results.map(r=>r.Property);for(let r of properties){let e=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), property_resolve(C, "${r}")`),t=async()=>{let n=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), property_getter(C, "${tempId}", "${r}", Value)`);if(n&&n.length>0){let i=n[0].Value;if(e)try{let a=await M(this,ae,"f").getExpression(i);try{return JSON.parse(a.data)}catch{return a.data}}catch{return i}else return i}else return n||void 0};this[r]=await t()}let results2=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), collection(C, Collection)`);results2||(results2=[]);let collections=results2.map(r=>r.Collection);for(let c of collections){let getProperty=async()=>{let results=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), collection_getter(C, "${tempId}", "${c}", Value)`);return results&&results.length>0&&results[0].Value?eval(results[0].Value):[]};this[c]=await getProperty()}return kr(this,Qe,tempId,"f"),this}async setProperty(key,value){let setters=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), property_setter(C, "${key}", Setter)`);if(setters&&setters.length>0){let actions=eval(setters[0].Setter),resolveLanguageResults=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), property_resolve_language(C, "${key}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),resolveLanguage&&(value=await M(this,ae,"f").createExpression(value,resolveLanguage)),await M(this,ae,"f").executeAction(actions,M(this,Qe,"f"),[{name:"value",value}])}}async setCollectionSetter(key,value){let collectionSetters=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), collection_setter(C, "${Mt(key)}", Setter)`);if(collectionSetters||(collectionSetters=[]),collectionSetters.length>0){let actions=eval(collectionSetters[0].Setter);value&&(Array.isArray(value)?await M(this,ae,"f").executeAction(actions,M(this,Qe,"f"),value.map(r=>({name:"value",value:r}))):await M(this,ae,"f").executeAction(actions,M(this,Qe,"f"),[{name:"value",value}]))}}async setCollectionAdder(key,value){let adders=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), collection_adder(C, "${Mt(key)}", Adder)`);if(adders||(adders=[]),adders.length>0){let actions=eval(adders[0].Adder);value&&(Array.isArray(value)?await Promise.all(value.map(r=>M(this,ae,"f").executeAction(actions,M(this,Qe,"f"),[{name:"value",value:r}]))):await M(this,ae,"f").executeAction(actions,M(this,Qe,"f"),[{name:"value",value}]))}}async setCollectionRemover(key,value){let removers=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), collection_remover(C, "${Mt(key)}", Remover)`);if(removers||(removers=[]),removers.length>0){let actions=eval(removers[0].Remover);value&&(Array.isArray(value)?await Promise.all(value.map(r=>M(this,ae,"f").executeAction(actions,M(this,Qe,"f"),[{name:"value",value:r}]))):await M(this,ae,"f").executeAction(actions,M(this,Qe,"f"),[{name:"value",value}]))}}async save(){kr(this,Fe,await M(this,ae,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await M(this,ae,"f").createSubject(this,M(this,Qe,"f")),await M(this,ae,"f").add(new Ot({source:M(this,Pa,"f"),predicate:"ad4m://has_child",target:this.baseExpression})),await this.update()}async update(){kr(this,Fe,await M(this,ae,"f").stringOrTemplateObjectToSubjectClass(this),"f");let r=Object.entries(this);for(let[e,t]of r)if(t!=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 kr(this,Fe,await M(this,ae,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await this.getData()}async delete(){await M(this,ae,"f").removeSubject(this,M(this,Qe,"f"))}static async all(r){let e=await r.stringOrTemplateObjectToSubjectClass(this),t=await r.getAllSubjectProxies(e),n=[];if(t){for(let i of t){let a=new this(r,i.X);n.push(await a.get())}return n}return[]}static async query(r,e){let t=e?.source||"ad4m://self",n=await r.stringOrTemplateObjectToSubjectClass(this),i=[];if(e)try{if((await r.infer(`findall([Timestamp, Base], (subject_class("${n}", C), instance(C, Base), link("${t}", Predicate, Base, Timestamp, Author)), AllData), sort(AllData, SortedData), length(SortedData, DataLength).`))[0].DataLength>=e.size){let s=`findall([Timestamp, Base], (subject_class("${n}", C), instance(C, Base), link("${t}", Predicate, Base, Timestamp, Author)), AllData), sort(AllData, SortedData), reverse(SortedData, ReverseSortedData), paginate(ReverseSortedData, ${e.page}, ${e.size}, PageData).`;i=await r.infer(s),i=i[0].PageData.map(u=>({Base:u[1],Timestamp:u[0]}))}else i=await r.infer(`subject_class("${n}", C), instance(C, Base), triple("${t}", Predicate, Base).`)}catch(o){console.log("Query failed",o)}else i=await r.infer(`subject_class("${n}", C), instance(C, Base), triple("${t}", Predicate, Base).`);return i?await Promise.all(i.map(async o=>await new this(r,o.Base).get())):[]}};Qe=new WeakMap,Fe=new WeakMap,Pa=new WeakMap,ae=new WeakMap;var eo="0.9.0";function B1(){let r=new AbortController;return setTimeout(()=>r.abort(),20),r}function oc(r,e=1e4){return ye(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 ye(this,null,function*(){try{let e=yield fetch(`http://localhost:${r}/graphql/`,{signal:B1().signal,mode:"no-cors"});if(e.status===400||e.status===0)return r;throw new Error(`Could not connect to port ${r}`)}catch(e){throw new Error(`Could not connect to port ${r}`)}})}function V1(){return new Promise((r,e)=>{let t=document.querySelector("ad4m-connect"),n=t==null?void 0:t.getAd4mClient();n?r(n):e("No Ad4mClient found")})}function cc(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(r){return!1}return!0}function _p(r,e){cc()&&localStorage.setItem(`${eo}/${r}`,e)}function Kr(r){return cc()?localStorage.getItem(`${eo}/${r}`):null}function Ep(r){cc()&&localStorage.removeItem(`${eo}/${r}`)}var Q1=r=>{let e=new Set;do for(let t of Reflect.ownKeys(r))e.add([r,t]);while((r=Reflect.getPrototypeOf(r))&&r!==Object.prototype);return e};function xi(r,{include:e,exclude:t}={}){let n=i=>{let a=o=>typeof o=="string"?i===o:o.test(i);return e?e.some(a):t?!t.some(a):!0};for(let[i,a]of Q1(r.constructor.prototype)){if(a==="constructor"||!n(a))continue;let o=Reflect.getOwnPropertyDescriptor(i,a);o&&typeof o.value=="function"&&(r[a]=r[a].bind(r))}return r}var Oi=class{constructor({appName:e,appDesc:t,appIconPath:n,appUrl:i,appDomain:a,capabilities:o,port:s,token:u,url:l}){this.activeSocket=null;this.requestedRestart=!1;this.authState="unauthenticated";this.connectionState="not_connected";this.port=12e3;this.capabilities=[];this.listeners={authstatechange:[],configstatechange:[],connectionstatechange:[]};xi(this);this.appName=e,this.appDesc=t,this.appDomain=a,this.appUrl=i,this.appIconPath=n,this.capabilities=o,this.port=s||this.port,this.url=l||`ws://localhost:${this.port}/graphql`,this.token=u||this.token,this.buildClient()}notifyConfigChange(e,t){this.listeners.configstatechange.forEach(n=>{n(e,t)})}notifyConnectionChange(e){this.connectionState!==e&&(this.connectionState=e,this.listeners.connectionstatechange.forEach(t=>{t(e)}))}notifyAuthChange(e){this.authState!==e&&(this.authState=e,this.listeners.authstatechange.forEach(t=>{t(e)}))}setPort(e){this.port!==e&&(this.port=e,this.setUrl(`ws://localhost:${this.port}/graphql`),this.notifyConfigChange("port",e))}setUrl(e){this.url!==e&&(this.url=e,this.notifyConfigChange("url",e))}setToken(e){this.token!==e&&(this.token=e,this.notifyConfigChange("token",e))}on(e,t){this.listeners[e].push(t)}connect(e){return ye(this,null,function*(){try{if(e){yield oc(e,1e4),this.setUrl(e);let t=this.buildClient();return yield this.checkAuth(),t}else{let t=yield this.ensureConnection();return yield this.checkAuth(),t}}catch(t){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}connectToPort(e){return ye(this,null,function*(){try{if(e){let t=yield sc(e);this.setPort(t)}else{let t=yield this.findPort();this.setPort(t)}return this.buildClient()}catch(t){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}ensureConnection(){return ye(this,null,function*(){var t,n;if(((t=this.activeSocket)==null?void 0:t.readyState)===WebSocket.OPEN&&((n=this.activeSocket)==null?void 0:n.url)===this.url&&this.ad4mClient)return this.ad4mClient;try{return yield oc(this.url,1e4),this.buildClient()}catch(i){return this.connectToPort()}})}findPort(){return ye(this,null,function*(){let e=[...Array(10).keys()].map((i,a)=>sc(12e3+a)),n=(yield Promise.allSettled(e)).find(i=>i.status==="fulfilled");if(n)return n.value;throw Error("Couldn't find an open port")})}buildClient(){this.notifyConnectionChange("connecting");try{new WebSocket(this.url)}catch(e){this.notifyConnectionChange("not_connected")}return this.apolloClient&&this.wsClient&&(this.requestedRestart=!0,this.wsClient.dispose(),this.apolloClient.stop()),this.wsClient=Fl({url:this.url,connectionParams:()=>ye(this,null,function*(){return{headers:{authorization:this.token}}}),on:{connecting:()=>{this.requestedRestart||this.notifyConnectionChange("connecting")},opened:e=>{this.activeSocket=e},error:e=>{this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")},connected:()=>{this.notifyConnectionChange("connected")},closed:()=>{this.requestedRestart||(this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1)}}}),this.apolloClient=new Is({link:new $l(this.wsClient),cache:new la({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"},mutate:{fetchPolicy:"no-cache"}}}),this.ad4mClient=new Wa(this.apolloClient),this.ad4mClient}checkAuth(){return ye(this,null,function*(){try{return(yield this.ad4mClient.agent.isLocked())?this.notifyAuthChange("locked"):(yield this.ad4mClient.agent.status(),this.notifyAuthChange("authenticated")),!0}catch(e){return e.message==="Socket closed with event 4500 Cannot extractByTags from a ciphered wallet. You must unlock first."?(this.notifyAuthChange("locked"),!0):(this.notifyAuthChange("unauthenticated"),!1)}})}requestCapability(e=!1){return ye(this,null,function*(){var t;return e&&this.setToken(null),this.requestId=yield(t=this.ad4mClient)==null?void 0:t.agent.requestCapability({appName:this.appName,appDesc:this.appDesc,appUrl:this.appUrl,appIconPath:this.appIconPath,appDomain:this.appDomain,capabilities:this.capabilities}),this.requestId})}verifyCode(e){return ye(this,null,function*(){var n;let t=yield(n=this.ad4mClient)==null?void 0:n.agent.generateJwt(this.requestId,e);return this.setToken(t),yield this.buildClient(),yield this.checkAuth(),this.token})}};function uc(){return Y`
|
|
1014
|
+
`;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 _p(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 kr=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},M=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Qe,Fe,Pa,ae,op=class{constructor(r,e,t){Qe.set(this,void 0),Fe.set(this,void 0),Pa.set(this,void 0),ae.set(this,void 0),kr(this,Qe,e||At.from(wp(24)).toUrl(),"f"),kr(this,ae,r,"f"),kr(this,Pa,t||"ad4m://self","f")}get baseExpression(){return M(this,Qe,"f")}async getData(id){let tempId=id??M(this,Qe,"f"),isInstance=await M(this,ae,"f").isSubjectInstance(tempId,M(this,Fe,"f"));if(!isInstance)throw`Not a valid subject instance of ${M(this,Fe,"f")} for ${tempId}`;let results=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), property(C, Property)`),properties=results.map(r=>r.Property);for(let r of properties){let e=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), property_resolve(C, "${r}")`),t=async()=>{let n=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), property_getter(C, "${tempId}", "${r}", Value)`);if(n&&n.length>0){let i=n[0].Value;if(e)try{let a=await M(this,ae,"f").getExpression(i);try{return JSON.parse(a.data)}catch{return a.data}}catch{return i}else return i}else return n||void 0};this[r]=await t()}let results2=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), collection(C, Collection)`);results2||(results2=[]);let collections=results2.map(r=>r.Collection);for(let c of collections){let getProperty=async()=>{let results=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), collection_getter(C, "${tempId}", "${c}", Value)`);return results&&results.length>0&&results[0].Value?eval(results[0].Value):[]};this[c]=await getProperty()}return kr(this,Qe,tempId,"f"),this}async setProperty(key,value){let setters=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), property_setter(C, "${key}", Setter)`);if(setters&&setters.length>0){let actions=eval(setters[0].Setter),resolveLanguageResults=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), property_resolve_language(C, "${key}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),resolveLanguage&&(value=await M(this,ae,"f").createExpression(value,resolveLanguage)),await M(this,ae,"f").executeAction(actions,M(this,Qe,"f"),[{name:"value",value}])}}async setCollectionSetter(key,value){let collectionSetters=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), collection_setter(C, "${jt(key)}", Setter)`);if(collectionSetters||(collectionSetters=[]),collectionSetters.length>0){let actions=eval(collectionSetters[0].Setter);value&&(Array.isArray(value)?await M(this,ae,"f").executeAction(actions,M(this,Qe,"f"),value.map(r=>({name:"value",value:r}))):await M(this,ae,"f").executeAction(actions,M(this,Qe,"f"),[{name:"value",value}]))}}async setCollectionAdder(key,value){let adders=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), collection_adder(C, "${jt(key)}", Adder)`);if(adders||(adders=[]),adders.length>0){let actions=eval(adders[0].Adder);value&&(Array.isArray(value)?await Promise.all(value.map(r=>M(this,ae,"f").executeAction(actions,M(this,Qe,"f"),[{name:"value",value:r}]))):await M(this,ae,"f").executeAction(actions,M(this,Qe,"f"),[{name:"value",value}]))}}async setCollectionRemover(key,value){let removers=await M(this,ae,"f").infer(`subject_class("${M(this,Fe,"f")}", C), collection_remover(C, "${jt(key)}", Remover)`);if(removers||(removers=[]),removers.length>0){let actions=eval(removers[0].Remover);value&&(Array.isArray(value)?await Promise.all(value.map(r=>M(this,ae,"f").executeAction(actions,M(this,Qe,"f"),[{name:"value",value:r}]))):await M(this,ae,"f").executeAction(actions,M(this,Qe,"f"),[{name:"value",value}]))}}async save(){kr(this,Fe,await M(this,ae,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await M(this,ae,"f").createSubject(this,M(this,Qe,"f")),await M(this,ae,"f").add(new Tt({source:M(this,Pa,"f"),predicate:"ad4m://has_child",target:this.baseExpression})),await this.update()}async update(){kr(this,Fe,await M(this,ae,"f").stringOrTemplateObjectToSubjectClass(this),"f");let r=Object.entries(this);for(let[e,t]of r)if(t!=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 kr(this,Fe,await M(this,ae,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await this.getData()}async delete(){await M(this,ae,"f").removeSubject(this,M(this,Qe,"f"))}static async all(r){let e=await r.stringOrTemplateObjectToSubjectClass(this),t=await r.getAllSubjectProxies(e),n=[];if(t){for(let i of t){let a=new this(r,i.X);n.push(await a.get())}return n}return[]}static async query(r,e){let t=e?.source||"ad4m://self",n=await r.stringOrTemplateObjectToSubjectClass(this),i=[];if(e)try{if((await r.infer(`findall([Timestamp, Base], (subject_class("${n}", C), instance(C, Base), link("${t}", Predicate, Base, Timestamp, Author)), AllData), sort(AllData, SortedData), length(SortedData, DataLength).`))[0].DataLength>=e.size){let s=`findall([Timestamp, Base], (subject_class("${n}", C), instance(C, Base), link("${t}", Predicate, Base, Timestamp, Author)), AllData), sort(AllData, SortedData), reverse(SortedData, ReverseSortedData), paginate(ReverseSortedData, ${e.page}, ${e.size}, PageData).`;i=await r.infer(s),i=i[0].PageData.map(u=>({Base:u[1],Timestamp:u[0]}))}else i=await r.infer(`subject_class("${n}", C), instance(C, Base), triple("${t}", Predicate, Base).`)}catch(o){console.log("Query failed",o)}else i=await r.infer(`subject_class("${n}", C), instance(C, Base), triple("${t}", Predicate, Base).`);return i?await Promise.all(i.map(async o=>await new this(r,o.Base).get())):[]}};Qe=new WeakMap,Fe=new WeakMap,Pa=new WeakMap,ae=new WeakMap;var eo="0.9.1-prerelease";function V1(){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:V1().signal,mode:"no-cors"});if(e.status===400||e.status===0)return r;throw new Error(`Could not connect to port ${r}`)}catch(e){throw new Error(`Could not connect to port ${r}`)}})}function Q1(){return new Promise((r,e)=>{let t=document.querySelector("ad4m-connect"),n=t==null?void 0:t.getAd4mClient();n?r(n):e("No Ad4mClient found")})}function cc(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(r){return!1}return!0}function Ep(r,e){cc()&&localStorage.setItem(`${eo}/${r}`,e)}function Kr(r){return cc()?localStorage.getItem(`${eo}/${r}`):null}function xp(r){cc()&&localStorage.removeItem(`${eo}/${r}`)}var W1=r=>{let e=new Set;do for(let t of Reflect.ownKeys(r))e.add([r,t]);while((r=Reflect.getPrototypeOf(r))&&r!==Object.prototype);return e};function xi(r,{include:e,exclude:t}={}){let n=i=>{let a=o=>typeof o=="string"?i===o:o.test(i);return e?e.some(a):t?!t.some(a):!0};for(let[i,a]of W1(r.constructor.prototype)){if(a==="constructor"||!n(a))continue;let o=Reflect.getOwnPropertyDescriptor(i,a);o&&typeof o.value=="function"&&(r[a]=r[a].bind(r))}return r}var Oi=class{constructor({appName:e,appDesc:t,appIconPath:n,appUrl:i,appDomain:a,capabilities:o,port:s,token:u,url:l}){this.activeSocket=null;this.requestedRestart=!1;this.authState="unauthenticated";this.connectionState="not_connected";this.port=12e3;this.capabilities=[];this.listeners={authstatechange:[],configstatechange:[],connectionstatechange:[]};xi(this);this.appName=e,this.appDesc=t,this.appDomain=a,this.appUrl=i,this.appIconPath=n,this.capabilities=o,this.port=s||this.port,this.url=l||`ws://localhost:${this.port}/graphql`,this.token=u||this.token,this.buildClient()}notifyConfigChange(e,t){this.listeners.configstatechange.forEach(n=>{n(e,t)})}notifyConnectionChange(e){this.connectionState!==e&&(this.connectionState=e,this.listeners.connectionstatechange.forEach(t=>{t(e)}))}notifyAuthChange(e){this.authState!==e&&(this.authState=e,this.listeners.authstatechange.forEach(t=>{t(e)}))}setPort(e){this.port!==e&&(this.port=e,this.setUrl(`ws://localhost:${this.port}/graphql`),this.notifyConfigChange("port",e))}setUrl(e){this.url!==e&&(this.url=e,this.notifyConfigChange("url",e))}setToken(e){this.token!==e&&(this.token=e,this.notifyConfigChange("token",e))}on(e,t){this.listeners[e].push(t)}connect(e){return ue(this,null,function*(){try{if(e){yield oc(e,1e4),this.setUrl(e);let t=this.buildClient();return yield this.checkAuth(),t}else{let t=yield this.ensureConnection();return yield this.checkAuth(),t}}catch(t){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}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(){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 oc(this.url,1e4),this.buildClient()}catch(i){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||(this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1)}}}),this.apolloClient=new Is({link:new Ml(this.wsClient),cache:new la({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"},mutate:{fetchPolicy:"no-cache"}}}),this.ad4mClient=new Wa(this.apolloClient),this.ad4mClient}checkAuth(){return 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 V`
|
|
1015
1015
|
<div>
|
|
1016
1016
|
<div class="lds-ring">
|
|
1017
1017
|
<div></div>
|
|
@@ -1020,7 +1020,7 @@ type Subscription {
|
|
|
1020
1020
|
<div></div>
|
|
1021
1021
|
</div>
|
|
1022
1022
|
</div>
|
|
1023
|
-
`}function lc({port:r,url:e,isRemote:t,connectToPort:n,changeIsRemote:i,connectRemote:a,changeState:o,changeUrl:s,changePort:u}){return
|
|
1023
|
+
`}function lc({port:r,url:e,isRemote:t,connectToPort:n,changeIsRemote:i,connectRemote:a,changeState:o,changeUrl:s,changePort:u}){return V`
|
|
1024
1024
|
<div class="items items--small">
|
|
1025
1025
|
<div class="text-center">
|
|
1026
1026
|
<h1 class="heading">Connection Settings</h1>
|
|
@@ -1034,7 +1034,7 @@ type Subscription {
|
|
|
1034
1034
|
Proxy
|
|
1035
1035
|
</button>
|
|
1036
1036
|
</div>
|
|
1037
|
-
${t?
|
|
1037
|
+
${t?V`<div class="input">
|
|
1038
1038
|
<label class="input__label">URL</label>
|
|
1039
1039
|
<input
|
|
1040
1040
|
class="input__field"
|
|
@@ -1055,7 +1055,7 @@ type Subscription {
|
|
|
1055
1055
|
>
|
|
1056
1056
|
Connect
|
|
1057
1057
|
</button>
|
|
1058
|
-
</div>`:
|
|
1058
|
+
</div>`:V`<div class="input">
|
|
1059
1059
|
<label class="input__label">PORT</label>
|
|
1060
1060
|
<input
|
|
1061
1061
|
class="input__field"
|
|
@@ -1079,9 +1079,9 @@ type Subscription {
|
|
|
1079
1079
|
</button>
|
|
1080
1080
|
</div>`}
|
|
1081
1081
|
</div>
|
|
1082
|
-
`}function pc({connect:r,isMobile:e,hasClickedDownload:t,changeState:n,onDownloaded:i,scanQrcode:a}){function
|
|
1082
|
+
`}function pc({connect:r,isMobile:e,hasClickedDownload:t,changeState:n,onDownloaded:i,scanQrcode:a,hosting:o}){function s(u){u.preventDefault();let l=u.currentTarget;window.open(l.href,"_blank"),this.onDownloaded()}return V`
|
|
1083
1083
|
<div class="items">
|
|
1084
|
-
${t?
|
|
1084
|
+
${t?V`<div class="text-center">
|
|
1085
1085
|
<a class="button" target="_blank" @click=${()=>r()}>
|
|
1086
1086
|
Connect to ADAM
|
|
1087
1087
|
</a>
|
|
@@ -1089,18 +1089,21 @@ type Subscription {
|
|
|
1089
1089
|
Please connect to ADAM once you have downloaded and setup your
|
|
1090
1090
|
ADAM agent
|
|
1091
1091
|
</p>
|
|
1092
|
-
</div>`:
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1092
|
+
</div>`:V`
|
|
1093
|
+
<div class="text-center">
|
|
1094
|
+
${e?V`<button class="button" @click=${()=>a()}>
|
|
1095
|
+
Connect with QR
|
|
1096
|
+
</button> `:V`<a
|
|
1097
|
+
class="button"
|
|
1098
|
+
target="_blank"
|
|
1099
|
+
@click=${s}
|
|
1100
|
+
href="https://ad4m.dev/download"
|
|
1101
|
+
>
|
|
1102
|
+
Download AD4M
|
|
1103
|
+
</a>`}
|
|
1104
|
+
${o?V`<p>Or</p>`:""}
|
|
1105
|
+
${o?V`<button class="button" @click=${()=>n("hosting")}>Use hosted AD4M (alpha)</button>`:""}
|
|
1106
|
+
</div>
|
|
1104
1107
|
<div class="text-center">
|
|
1105
1108
|
<button class="button button--link " @click=${()=>r()}>
|
|
1106
1109
|
Try again
|
|
@@ -1112,9 +1115,10 @@ type Subscription {
|
|
|
1112
1115
|
>
|
|
1113
1116
|
Change connection settings
|
|
1114
1117
|
</button>
|
|
1118
|
+
|
|
1115
1119
|
</div>`}
|
|
1116
1120
|
|
|
1117
|
-
<p style="height:
|
|
1121
|
+
<p style="height: 60px; color: red; font-size: 14px; text-align: center; margin: 0; margin-top: -30px;">
|
|
1118
1122
|
Please make sure you have the ADAM Launcher running on your computer and there are no browser restrictions ("Shields") blocking your connection to ADAM on localhost.
|
|
1119
1123
|
(Safari users: please use a different browser for now. Safari is very strict about this and we are working on a solution.)
|
|
1120
1124
|
</p>
|
|
@@ -1125,7 +1129,7 @@ type Subscription {
|
|
|
1125
1129
|
>
|
|
1126
1130
|
</div>
|
|
1127
1131
|
</div>
|
|
1128
|
-
`}function fc({reconnect:r}){return
|
|
1132
|
+
`}function fc({reconnect:r}){return V`
|
|
1129
1133
|
<div class="items items--small">
|
|
1130
1134
|
<div class="text-center">
|
|
1131
1135
|
<h1 class="heading">Could not connect to AD4M</h1>
|
|
@@ -1134,7 +1138,7 @@ type Subscription {
|
|
|
1134
1138
|
<button class="button" @click=${()=>r()}>Try again</button>
|
|
1135
1139
|
</div>
|
|
1136
1140
|
</div>
|
|
1137
|
-
`}function dc({unlockAgent:r,reconnect:e}){return
|
|
1141
|
+
`}function dc({unlockAgent:r,reconnect:e}){return V`
|
|
1138
1142
|
<div class="text-center">
|
|
1139
1143
|
<div class="items">
|
|
1140
1144
|
<div>
|
|
@@ -1146,7 +1150,7 @@ type Subscription {
|
|
|
1146
1150
|
<button class="button" @click=${e}>Reconnect</button>
|
|
1147
1151
|
</div>
|
|
1148
1152
|
</div>
|
|
1149
|
-
`}function hc(){return
|
|
1153
|
+
`}function hc(){return V`
|
|
1150
1154
|
<svg viewBox="0 0 692 670" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1151
1155
|
<defs>
|
|
1152
1156
|
<linearGradient id="gradient" x1="0" x2="1" y1="0" y2="0">
|
|
@@ -1159,14 +1163,14 @@ type Subscription {
|
|
|
1159
1163
|
fill="url(#gradient)"
|
|
1160
1164
|
/>
|
|
1161
1165
|
</svg>
|
|
1162
|
-
`}function mc({capabilities:r,appname:e,appiconpath:t,changeState:n,setOpen:i,requestCapability:a}){return
|
|
1166
|
+
`}function mc({capabilities:r,appname:e,appiconpath:t,changeState:n,setOpen:i,requestCapability:a}){return V`
|
|
1163
1167
|
<div class="items">
|
|
1164
1168
|
<div class="text-center">
|
|
1165
1169
|
<p class="body">An external application</p>
|
|
1166
1170
|
<h1 class="heading nomargin">${e}</h1>
|
|
1167
1171
|
<p class="body">wants to access your AD4M data</p>
|
|
1168
1172
|
</div>
|
|
1169
|
-
${t&&
|
|
1173
|
+
${t&&V`<div class="dialog__connect">
|
|
1170
1174
|
<img class="dialog__connect-app" src=${t} alt="Logo" />
|
|
1171
1175
|
<div class="dialog__connect-check"></div>
|
|
1172
1176
|
<div class="dialog__connect-ad4m">${hc()}</div>
|
|
@@ -1174,7 +1178,7 @@ type Subscription {
|
|
|
1174
1178
|
<div>
|
|
1175
1179
|
<p class="text-center"><b>This will allow the developer to:</b></p>
|
|
1176
1180
|
<ul class="check-list">
|
|
1177
|
-
${r.map(o=>
|
|
1181
|
+
${r.map(o=>V`<li>
|
|
1178
1182
|
<span>
|
|
1179
1183
|
<svg
|
|
1180
1184
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -1188,7 +1192,7 @@ type Subscription {
|
|
|
1188
1192
|
/>
|
|
1189
1193
|
</svg>
|
|
1190
1194
|
</span>
|
|
1191
|
-
<span>${
|
|
1195
|
+
<span>${_p(o)}</span>
|
|
1192
1196
|
</li>`)}
|
|
1193
1197
|
</ul>
|
|
1194
1198
|
</div>
|
|
@@ -1213,7 +1217,7 @@ type Subscription {
|
|
|
1213
1217
|
Connection settings
|
|
1214
1218
|
</button>
|
|
1215
1219
|
</div>
|
|
1216
|
-
`}function yc({code:r,changeState:e,verifyCode:t,changeCode:n}){return
|
|
1220
|
+
`}function yc({code:r,changeState:e,verifyCode:t,changeCode:n}){return V`
|
|
1217
1221
|
<div class="items">
|
|
1218
1222
|
<div class="text-center">
|
|
1219
1223
|
<div class="heading">Please check Ad4m</div>
|
|
@@ -1244,7 +1248,7 @@ type Subscription {
|
|
|
1244
1248
|
</button>
|
|
1245
1249
|
</div>
|
|
1246
1250
|
</div>
|
|
1247
|
-
`}function gc(){return
|
|
1251
|
+
`}function gc(){return V`
|
|
1248
1252
|
<div class="items">
|
|
1249
1253
|
<div class="text-center">
|
|
1250
1254
|
<h1 class="heading">Request to AD4M blocked</h1>
|
|
@@ -1265,7 +1269,7 @@ type Subscription {
|
|
|
1265
1269
|
</button>
|
|
1266
1270
|
</div>
|
|
1267
1271
|
</div>
|
|
1268
|
-
`}function vc({changeState:r,onSuccess:e,uiState:t}){function n(i){let a=new BarcodeDetector,o=i.currentTarget,s=()=>
|
|
1272
|
+
`}function vc({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 l=(yield a.detect(o)).find(p=>p.format==="qr_code");if(l!=null&&l.rawValue){r("requestcap"),e(l.rawValue);return}else requestAnimationFrame(s)}catch(u){console.error(u)}});s()}return V`
|
|
1269
1273
|
<div class="qr-scanner">
|
|
1270
1274
|
<div class="qr-content">
|
|
1271
1275
|
<button
|
|
@@ -1284,7 +1288,7 @@ type Subscription {
|
|
|
1284
1288
|
></video>
|
|
1285
1289
|
</div>
|
|
1286
1290
|
</div>
|
|
1287
|
-
`}function bc(){return
|
|
1291
|
+
`}function bc(){return V`<header class="dialog__header">
|
|
1288
1292
|
<div class="dialog__logo">
|
|
1289
1293
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 37" fill="none">
|
|
1290
1294
|
<path
|
|
@@ -1293,7 +1297,70 @@ type Subscription {
|
|
|
1293
1297
|
/>
|
|
1294
1298
|
</svg>
|
|
1295
1299
|
</div>
|
|
1296
|
-
</header>`}function
|
|
1300
|
+
</header>`}function Cc({step:r,email:e,changeEmail:t,changeState:n,password:i,changePassword:a,login:o,checkEmail:s,passwordError:u,setHostingStep:l}){if(r===0)return V`
|
|
1301
|
+
<div class="input">
|
|
1302
|
+
<label class="input__label">EMAIL</label>
|
|
1303
|
+
<input
|
|
1304
|
+
class="input__field"
|
|
1305
|
+
value=${e}
|
|
1306
|
+
@input=${p=>t(p.target.value)}
|
|
1307
|
+
/>
|
|
1308
|
+
<div class="buttons">
|
|
1309
|
+
<button
|
|
1310
|
+
class="button button--full button-secondary"
|
|
1311
|
+
@click=${()=>n("start")}
|
|
1312
|
+
>
|
|
1313
|
+
Back
|
|
1314
|
+
</button>
|
|
1315
|
+
<button
|
|
1316
|
+
class="button button--full button-secondary"
|
|
1317
|
+
@click=${()=>s()}
|
|
1318
|
+
>
|
|
1319
|
+
Next
|
|
1320
|
+
</button>
|
|
1321
|
+
</div>
|
|
1322
|
+
</div>
|
|
1323
|
+
`;if(r===1)return V`
|
|
1324
|
+
<div class="input">
|
|
1325
|
+
<label class="input__label">PASSWORD</label>
|
|
1326
|
+
<input
|
|
1327
|
+
class="input__field"
|
|
1328
|
+
value=${i}
|
|
1329
|
+
@input=${p=>a(p.target.value)}
|
|
1330
|
+
type="password"
|
|
1331
|
+
errortext={passwordError}
|
|
1332
|
+
error={passwordError}
|
|
1333
|
+
/>
|
|
1334
|
+
${u?V`<p class="error">${u}</p>`:""}
|
|
1335
|
+
<div class="buttons">
|
|
1336
|
+
<button
|
|
1337
|
+
class="button button--full button-secondary"
|
|
1338
|
+
@click=${()=>n("start")}
|
|
1339
|
+
>
|
|
1340
|
+
Back
|
|
1341
|
+
</button>
|
|
1342
|
+
<button
|
|
1343
|
+
class="button button--full button-secondary"
|
|
1344
|
+
@click=${()=>o()}
|
|
1345
|
+
>
|
|
1346
|
+
|
|
1347
|
+
Login
|
|
1348
|
+
</button>
|
|
1349
|
+
</div>
|
|
1350
|
+
</div>
|
|
1351
|
+
`;if(r===2)return V`
|
|
1352
|
+
<div class="text-center">
|
|
1353
|
+
<p>
|
|
1354
|
+
Email is not registered. Please follow the <a target="_blank" href="https://hosting.ad4m.dev/">link</a> to register.
|
|
1355
|
+
</p>
|
|
1356
|
+
<button
|
|
1357
|
+
class="button button--full button-secondary"
|
|
1358
|
+
@click=${()=>{l(0),n("start")}}
|
|
1359
|
+
>
|
|
1360
|
+
Back
|
|
1361
|
+
</button>
|
|
1362
|
+
</div>
|
|
1363
|
+
`}function G1(){return[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i].some(e=>navigator.userAgent.match(e))}var K1=ro`
|
|
1297
1364
|
:host {
|
|
1298
1365
|
--primary-color: #fff;
|
|
1299
1366
|
--heading-color: #fff;
|
|
@@ -1618,6 +1685,43 @@ type Subscription {
|
|
|
1618
1685
|
}
|
|
1619
1686
|
}
|
|
1620
1687
|
|
|
1688
|
+
.md-ring {
|
|
1689
|
+
display: block;
|
|
1690
|
+
position: relative;
|
|
1691
|
+
width: 30px;
|
|
1692
|
+
height: 30px;
|
|
1693
|
+
margin-right: 10px;
|
|
1694
|
+
}
|
|
1695
|
+
.md-ring div {
|
|
1696
|
+
box-sizing: border-box;
|
|
1697
|
+
display: block;
|
|
1698
|
+
position: absolute;
|
|
1699
|
+
width: 24px;
|
|
1700
|
+
height: 24px;
|
|
1701
|
+
margin: 4px;
|
|
1702
|
+
border: 2px solid var(--primary-color);
|
|
1703
|
+
border-radius: 50%;
|
|
1704
|
+
animation: md-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
|
|
1705
|
+
border-color: var(--primary-color) transparent transparent transparent;
|
|
1706
|
+
}
|
|
1707
|
+
.md-ring div:nth-child(1) {
|
|
1708
|
+
animation-delay: -0.45s;
|
|
1709
|
+
}
|
|
1710
|
+
.md-ring div:nth-child(2) {
|
|
1711
|
+
animation-delay: -0.3s;
|
|
1712
|
+
}
|
|
1713
|
+
.md-ring div:nth-child(3) {
|
|
1714
|
+
animation-delay: -0.15s;
|
|
1715
|
+
}
|
|
1716
|
+
@keyframes md-ring {
|
|
1717
|
+
0% {
|
|
1718
|
+
transform: rotate(0deg);
|
|
1719
|
+
}
|
|
1720
|
+
100% {
|
|
1721
|
+
transform: rotate(360deg);
|
|
1722
|
+
}
|
|
1723
|
+
}
|
|
1724
|
+
|
|
1621
1725
|
.disconnected {
|
|
1622
1726
|
position: fixed;
|
|
1623
1727
|
top: 0;
|
|
@@ -1653,7 +1757,7 @@ type Subscription {
|
|
|
1653
1757
|
width: 100vw;
|
|
1654
1758
|
object-fit: cover;
|
|
1655
1759
|
}
|
|
1656
|
-
`,
|
|
1760
|
+
`,ce=class extends Vt{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=Kr("ad4mToken")||"";this.port=parseInt(Kr("ad4mport"))||12e3;this.url=Kr("ad4murl")||""}get authState(){return this._client.authState}get connectionState(){return this._client.connectionState}connectedCallback(){super.connectedCallback(),xi(this),this._isMobile=G1(),this._client=new Oi({appName:this.appName,appDesc:this.appDesc,appDomain:this.appDomain,appUrl:window.location.origin,appIconPath:this.appIconPath,capabilities:Array.isArray(this.capabilities)?this.capabilities:JSON.parse(this.capabilities),port:this.port||parseInt(Kr("ad4mport"))||12e3,token:this.token||Kr("ad4mtoken"),url:this.url||Kr("ad4murl")}),this._client.on("configstatechange",this.handleConfigChange),this._client.on("authstatechange",this.handleAuthChange),this._client.on("connectionstatechange",this.handleConnectionChange),this.loadFont()}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?Ep("ad4m"+t,n):xp("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=Qt}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 uc();if(this.uiState==="hosting")return Cc({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 vc({changeState:this.changeUIState,onSuccess:t=>{this.changeUrl(t),this._client.connect(t)},uiState:this.uiState});if(this.authState==="locked")return dc({unlockAgent:this.unlockAgent,reconnect:this.connect});if(this.uiState==="settings")return lc({port:this.port,changePort:this.changePort,isRemote:this._isRemote,changeIsRemote:this.changeIsRemote,url:this.url,changeState:this.changeUIState,changeUrl:this.changeUrl,connectToPort:this._client.connectToPort,connectRemote:this.connectRemote});if(this.connectionState==="not_connected")return pc({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"?yc({code:this._code,changeCode:this.changeCode,changeState:this.changeUIState,verifyCode:this.verifyCode}):mc({changeState:this.changeUIState,requestCapability:this.requestCapability,capabilities:this.capabilities,appname:this.appName,setOpen:this.setOpen,appiconpath:this.appIconPath});if(this.connectionState==="disconnected")return fc({reconnect:this.connect});if(this.connectionState==="port_not_found")return gc()}render(){return this._isOpen===!1||this.authState==="authenticated"?null:V`
|
|
1657
1761
|
<div class="wrapper">
|
|
1658
1762
|
<div class="dialog">
|
|
1659
1763
|
${bc()}
|
|
@@ -1661,7 +1765,7 @@ type Subscription {
|
|
|
1661
1765
|
</div>
|
|
1662
1766
|
<div class="ad4mConnect__backdrop" />
|
|
1663
1767
|
</div>
|
|
1664
|
-
`}};
|
|
1768
|
+
`}};ce.styles=[K1],me([et()],ce.prototype,"_code",2),me([et()],ce.prototype,"_isMobile",2),me([et()],ce.prototype,"_hasClickedDownload",2),me([et()],ce.prototype,"_isRemote",2),me([et()],ce.prototype,"_client",2),me([et()],ce.prototype,"_isOpen",2),me([et()],ce.prototype,"_hostingStep",2),me([et()],ce.prototype,"_email",2),me([et()],ce.prototype,"_passowrd",2),me([et()],ce.prototype,"_passwordError",2),me([et()],ce.prototype,"_isHostingLoading",2),me([et()],ce.prototype,"uiState",2),me([ot({type:String,reflect:!0})],ce.prototype,"appName",2),me([ot({type:String,reflect:!0})],ce.prototype,"appDesc",2),me([ot({type:String,reflect:!0})],ce.prototype,"appDomain",2),me([ot({type:String,reflect:!0})],ce.prototype,"appIconPath",2),me([ot({type:String,reflect:!0})],ce.prototype,"capabilities",2),me([ot({type:Boolean,reflect:!0})],ce.prototype,"hosting",2),me([ot({type:String})],ce.prototype,"token",2),me([ot({type:String,reflect:!0})],ce.prototype,"port",2),me([ot({type:String,reflect:!0})],ce.prototype,"url",2),ce=me([Uc("ad4m-connect")],ce);function z1(r){let e=new ce;return Object.entries(r).forEach(([t,n])=>{e[t]=n}),document.body.appendChild(e),e}export{ce as Ad4mConnectElement,z1 as default,Q1 as getAd4mClient};
|
|
1665
1769
|
/*!
|
|
1666
1770
|
* @undecaf/barcode-detector-polyfill v0.9.20
|
|
1667
1771
|
* A WebAssembly polyfill for the Barcode Detection API
|