@coasys/ad4m-connect 0.10.0 → 0.10.1-multi-user-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +163 -34
- package/dist/components/ConnectionOverview.d.ts +13 -0
- package/dist/components/MultiUserAuth.d.ts +15 -0
- package/dist/components/RemoteConnection.d.ts +13 -0
- package/dist/core.d.ts +9 -2
- package/dist/core.js +449 -287
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +1 -1
- package/dist/web.d.ts +25 -0
- package/dist/web.js +1169 -400
- package/package.json +2 -3
package/dist/web.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
var cm=Object.defineProperty;var um=Object.getOwnPropertyDescriptor;var ye=(t,e,r,n)=>{for(var i=n>1?void 0:n?um(e,r):e,a=t.length-1,o;a>=0;a--)(o=t[a])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&cm(e,r,i),i};var pe=(t,e,r)=>new Promise((n,i)=>{var a=u=>{try{s(r.next(u))}catch(c){i(c)}},o=u=>{try{s(r.throw(u))}catch(c){i(c)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(a,o);s((r=r.apply(t,e)).next())});import{ZBarSymbolType as re,ZBarConfigType as Rl,scanRGBABuffer as lm,getDefaultScanner as fm}from"https://cdn.jsdelivr.net/npm/@undecaf/zbar-wasm@0.9.15/dist/main.js";function pm(t,e,r,n){return new(r||(r=Promise))(function(i,a){function o(c){try{u(n.next(c))}catch(l){a(l)}}function s(c){try{u(n.throw(c))}catch(l){a(l)}}function u(c){var l;c.done?i(c.value):(l=c.value,l instanceof r?l:new r(function(d){d(l)})).then(o,s)}u((n=n.apply(t,e||[])).next())})}var R=class{constructor(e,r=Rl.ZBAR_CFG_ENABLE,n=1){this.symbolType=e,this.configType=r,this.number=n,this.configSteps=[this]}static register(e,r,n=r.symbolType){return R.formatsToConfigs[e]=r,R.typesToFormats[n]=R.typesToFormats[n]||e,r}static formats(){return Object.keys(R.formatsToConfigs)}static toFormat(e){return R.typesToFormats[e]}static configure(e,r){var n;(n=R.formatsToConfigs[r])===null||n===void 0||n.configSteps.forEach(i=>e.setConfig(i.symbolType,i.configType,i.number))}add(e){return this.configSteps.push(e),this}},Nl;R.formatsToConfigs={},R.typesToFormats={},R.register("codabar",new R(re.ZBAR_CODABAR)),R.register("code_39",new R(re.ZBAR_CODE39)),R.register("code_93",new R(re.ZBAR_CODE93)),R.register("code_128",new R(re.ZBAR_CODE128)),R.register("databar",new R(re.ZBAR_DATABAR)),R.register("databar_exp",new R(re.ZBAR_DATABAR_EXP)),R.register("ean_2",new R(re.ZBAR_EAN2)),R.register("ean_5",new R(re.ZBAR_EAN5)),R.register("ean_8",new R(re.ZBAR_EAN8)),R.register("ean_13",new R(re.ZBAR_EAN13)),R.register("ean_13+2",new R(re.ZBAR_EAN13)).add(new R(re.ZBAR_EAN2)),R.register("ean_13+5",new R(re.ZBAR_EAN13)).add(new R(re.ZBAR_EAN5)),R.register("isbn_10",new R(re.ZBAR_ISBN10)).add(new R(re.ZBAR_EAN13)),R.register("isbn_13",new R(re.ZBAR_ISBN13)).add(new R(re.ZBAR_EAN13)),R.register("isbn_13+2",new R(re.ZBAR_ISBN13)).add(new R(re.ZBAR_EAN13)).add(new R(re.ZBAR_EAN2)),R.register("isbn_13+5",new R(re.ZBAR_ISBN13)).add(new R(re.ZBAR_EAN13)).add(new R(re.ZBAR_EAN5)),R.register("itf",new R(re.ZBAR_I25)),R.register("qr_code",new R(re.ZBAR_QRCODE)),R.register("sq_code",new R(re.ZBAR_SQCODE)),R.register("upc_a",new R(re.ZBAR_UPCA)).add(new R(re.ZBAR_EAN13)),R.register("upc_e",new R(re.ZBAR_UPCE)).add(new R(re.ZBAR_EAN13)),function(t){t[t.UNKNOWN=-1]="UNKNOWN",t[t.UPRIGHT=0]="UPRIGHT",t[t.ROTATED_RIGHT=1]="ROTATED_RIGHT",t[t.UPSIDE_DOWN=2]="UPSIDE_DOWN",t[t.ROTATED_LEFT=3]="ROTATED_LEFT"}(Nl||(Nl={}));var Ls=class{},dm=(()=>{try{return new OffscreenCanvas(1,1).getContext("2d")instanceof OffscreenCanvasRenderingContext2D}catch{return!1}})(),pr=class{constructor(e={}){if(e.formats!==void 0){if(!Array.isArray(e.formats)||!e.formats.length)throw new TypeError(`Barcode formats should be a non-empty array of strings but are: ${JSON.stringify(e)}`);let r=e.formats.filter(n=>!R.formats().includes(n));if(r.length)throw new TypeError(`Unsupported barcode format(s): ${r.join(", ")}`)}this.formats=e.formats||R.formats(),this.zbarConfig=e.zbar||new Ls}static getSupportedFormats(){return Promise.resolve(R.formats())}detect(e){if(!pr.isImageBitmapSource(e))throw new TypeError("BarcodeDetector.detect() argument is not an ImageBitmapSource");let r=pr.intrinsicDimensions(e);if(r.width===0||r.height===0)return Promise.resolve([]);try{return Promise.all([this.toImageData(e),this.getScanner()]).then(n=>{let i=n[0],a=n[1];return this.zbarConfig.enableCache!==void 0&&a.enableCache(this.zbarConfig.enableCache),lm(i.data,i.width,i.height,a)}).then(n=>n.map(i=>this.toBarcodeDetectorResult(i)))}catch(n){return Promise.reject(n)}}getScanner(){return new Promise((e,r)=>pm(this,void 0,void 0,function*(){if(!this.scanner){let n=yield fm();this.formats.length>0&&(n.setConfig(re.ZBAR_NONE,Rl.ZBAR_CFG_ENABLE,0),this.formats.forEach(i=>R.configure(n,i))),this.scanner=n}e(this.scanner)}))}toImageData(e){let r=n=>{let i=pr.intrinsicDimensions(n);this.canvas&&this.canvas.width===i.width&&this.canvas.height===i.height||(this.canvas=function(s,u){if(dm)return new OffscreenCanvas(s,u);{let c=document.createElement("canvas");return c.width=s,c.height=u,c}}(i.width,i.height));let a=this.canvas,o=a.getContext("2d");return o.drawImage(n,0,0),o.getImageData(0,0,a.width,a.height)};if(e instanceof ImageData)return Promise.resolve(e);if(e instanceof Blob){let n=document.createElement("img");return n.src=URL.createObjectURL(e),n.decode().then(()=>r(n)).finally(()=>URL.revokeObjectURL(n.src))}return e instanceof CanvasRenderingContext2D?Promise.resolve(e.getImageData(0,0,e.canvas.width,e.canvas.height)):Promise.resolve(r(e))}toBarcodeDetectorResult(e){let r={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0};return e.points.forEach(n=>{r.minX=Math.min(r.minX,n.x),r.maxX=Math.max(r.maxX,n.x),r.minY=Math.min(r.minY,n.y),r.maxY=Math.max(r.maxY,n.y)}),{format:R.toFormat(e.type),rawValue:e.decode(this.zbarConfig.encoding),orientation:e.orientation,quality:e.quality,boundingBox:DOMRectReadOnly.fromRect({x:r.minX,y:r.minY,width:r.maxX-r.minX,height:r.maxY-r.minY}),cornerPoints:[{x:r.minX,y:r.minY},{x:r.maxX,y:r.minY},{x:r.maxX,y:r.maxY},{x:r.minX,y:r.maxY}]}}static isImageBitmapSource(e){return e instanceof HTMLImageElement||e instanceof HTMLVideoElement||e instanceof HTMLCanvasElement||e instanceof Blob||e instanceof ImageData||e instanceof CanvasRenderingContext2D||e instanceof ImageBitmap||e&&e.width==0||e&&e.height==0}static intrinsicDimensions(e){return{width:Number(e.naturalWidth||e.videoWidth||e.width),height:Number(e.naturalHeight||e.videoHeight||e.height)}}};var Ba=window,Va=Ba.ShadowRoot&&(Ba.ShadyCSS===void 0||Ba.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,$s=Symbol(),Pl=new WeakMap,xi=class{constructor(e,r,n){if(this._$cssResult$=!0,n!==$s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o,r=this.t;if(Va&&e===void 0){let n=r!==void 0&&r.length===1;n&&(e=Pl.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Pl.set(r,e))}return e}toString(){return this.cssText}},Ll=t=>new xi(typeof t=="string"?t:t+"",void 0,$s),Fs=(t,...e)=>{let r=t.length===1?t[0]:e.reduce((n,i,a)=>n+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[a+1],t[0]);return new xi(r,t,$s)},Ms=(t,e)=>{Va?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{let n=document.createElement("style"),i=Ba.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)})},za=Va?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let n of e.cssRules)r+=n.cssText;return Ll(r)})(t):t;var js,Qa=window,$l=Qa.trustedTypes,hm=$l?$l.emptyScript:"",Fl=Qa.reactiveElementPolyfillSupport,qs={toAttribute(t,e){switch(e){case Boolean:t=t?hm:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},Ml=(t,e)=>e!==t&&(e==e||t==t),Us={attribute:!0,type:String,converter:qs,reflect:!1,hasChanged:Ml},Bs="finalized",Xt=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var r;this.finalize(),((r=this.h)!==null&&r!==void 0?r:this.h=[]).push(e)}static get observedAttributes(){this.finalize();let e=[];return this.elementProperties.forEach((r,n)=>{let i=this._$Ep(n,r);i!==void 0&&(this._$Ev.set(i,n),e.push(i))}),e}static createProperty(e,r=Us){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(e,r),!r.noAccessor&&!this.prototype.hasOwnProperty(e)){let n=typeof e=="symbol"?Symbol():"__"+e,i=this.getPropertyDescriptor(e,n,r);i!==void 0&&Object.defineProperty(this.prototype,e,i)}}static getPropertyDescriptor(e,r,n){return{get(){return this[r]},set(i){let a=this[e];this[r]=i,this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||Us}static finalize(){if(this.hasOwnProperty(Bs))return!1;this[Bs]=!0;let e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let r=this.properties,n=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let i of n)this.createProperty(i,r[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){let r=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let i of n)r.unshift(za(i))}else e!==void 0&&r.push(za(e));return r}static _$Ep(e,r){let n=r.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(r=>r(this))}addController(e){var r,n;((r=this._$ES)!==null&&r!==void 0?r:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((n=e.hostConnected)===null||n===void 0||n.call(e))}removeController(e){var r;(r=this._$ES)===null||r===void 0||r.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,r)=>{this.hasOwnProperty(r)&&(this._$Ei.set(r,this[r]),delete this[r])})}createRenderRoot(){var e;let r=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return Ms(r,this.constructor.elementStyles),r}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(r=>{var n;return(n=r.hostConnected)===null||n===void 0?void 0:n.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(r=>{var n;return(n=r.hostDisconnected)===null||n===void 0?void 0:n.call(r)})}attributeChangedCallback(e,r,n){this._$AK(e,n)}_$EO(e,r,n=Us){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:qs).toAttribute(r,n.type);this._$El=e,o==null?this.removeAttribute(a):this.setAttribute(a,o),this._$El=null}}_$AK(e,r){var n;let i=this.constructor,a=i._$Ev.get(e);if(a!==void 0&&this._$El!==a){let o=i.getPropertyOptions(a),s=typeof o.converter=="function"?{fromAttribute:o.converter}:((n=o.converter)===null||n===void 0?void 0:n.fromAttribute)!==void 0?o.converter:qs;this._$El=a,this[a]=s.fromAttribute(r,o.type),this._$El=null}}requestUpdate(e,r,n){let i=!0;e!==void 0&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||Ml)(this[e],r)?(this._$AL.has(e)||this._$AL.set(e,r),n.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,n))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(r){Promise.reject(r)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((i,a)=>this[a]=i),this._$Ei=void 0);let r=!1,n=this._$AL;try{r=this.shouldUpdate(n),r?(this.willUpdate(n),(e=this._$ES)===null||e===void 0||e.forEach(i=>{var a;return(a=i.hostUpdate)===null||a===void 0?void 0:a.call(i)}),this.update(n)):this._$Ek()}catch(i){throw r=!1,this._$Ek(),i}r&&this._$AE(n)}willUpdate(e){}_$AE(e){var r;(r=this._$ES)===null||r===void 0||r.forEach(n=>{var i;return(i=n.hostUpdated)===null||i===void 0?void 0:i.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((r,n)=>this._$EO(n,this[n],r)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};Xt[Bs]=!0,Xt.elementProperties=new Map,Xt.elementStyles=[],Xt.shadowRootOptions={mode:"open"},Fl?.({ReactiveElement:Xt}),((js=Qa.reactiveElementVersions)!==null&&js!==void 0?js:Qa.reactiveElementVersions=[]).push("1.6.3");var Vs,Ga=window,$n=Ga.trustedTypes,jl=$n?$n.createPolicy("lit-html",{createHTML:t=>t}):void 0,Qs="$lit$",dr=`lit$${(Math.random()+"").slice(9)}$`,Gl="?"+dr,mm=`<${Gl}>`,zr=document,Ti=()=>zr.createComment(""),Ai=t=>t===null||typeof t!="object"&&typeof t!="function",Hl=Array.isArray,gm=t=>Hl(t)||typeof t?.[Symbol.iterator]=="function",zs=`[
|
|
2
|
-
\f\r]`,
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Bl=/'/g,Vl=/"/g,Wl=/^(?:script|style|textarea|title)$/i,Kl=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),B=Kl(1),z2=Kl(2),Qr=Symbol.for("lit-noChange"),Fe=Symbol.for("lit-nothing"),zl=new WeakMap,Vr=zr.createTreeWalker(zr,129,null,!1);function Zl(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return jl!==void 0?jl.createHTML(e):e}var ym=(t,e)=>{let r=t.length-1,n=[],i,a=e===2?"<svg>":"",o=ki;for(let s=0;s<r;s++){let u=t[s],c,l,d=-1,p=0;for(;p<u.length&&(o.lastIndex=p,l=o.exec(u),l!==null);)p=o.lastIndex,o===ki?l[1]==="!--"?o=Ul:l[1]!==void 0?o=ql:l[2]!==void 0?(Wl.test(l[2])&&(i=RegExp("</"+l[2],"g")),o=Br):l[3]!==void 0&&(o=Br):o===Br?l[0]===">"?(o=i??ki,d=-1):l[1]===void 0?d=-2:(d=o.lastIndex-l[2].length,c=l[1],o=l[3]===void 0?Br:l[3]==='"'?Vl:Bl):o===Vl||o===Bl?o=Br:o===Ul||o===ql?o=ki:(o=Br,i=void 0);let f=o===Br&&t[s+1].startsWith("/>")?" ":"";a+=o===ki?u+mm:d>=0?(n.push(c),u.slice(0,d)+Qs+u.slice(d)+dr+f):u+dr+(d===-2?(n.push(void 0),s):f)}return[Zl(t,a+(t[r]||"<?>")+(e===2?"</svg>":"")),n]},Gr=class{constructor({strings:e,_$litType$:r},n){let i;this.parts=[];let a=0,o=0,s=e.length-1,u=this.parts,[c,l]=ym(e,r);if(this.el=Gr.createElement(c,n),Vr.currentNode=this.el.content,r===2){let d=this.el.content,p=d.firstChild;p.remove(),d.append(...p.childNodes)}for(;(i=Vr.nextNode())!==null&&u.length<s;){if(i.nodeType===1){if(i.hasAttributes()){let d=[];for(let p of i.getAttributeNames())if(p.endsWith(Qs)||p.startsWith(dr)){let f=l[o++];if(d.push(p),f!==void 0){let h=i.getAttribute(f.toLowerCase()+Qs).split(dr),g=/([.?@])?(.*)/.exec(f);u.push({type:1,index:a,name:g[2],strings:h,ctor:g[1]==="."?Hs:g[1]==="?"?Ws:g[1]==="@"?Ks:Mn})}else u.push({type:6,index:a})}for(let p of d)i.removeAttribute(p)}if(Wl.test(i.tagName)){let d=i.textContent.split(dr),p=d.length-1;if(p>0){i.textContent=$n?$n.emptyScript:"";for(let f=0;f<p;f++)i.append(d[f],Ti()),Vr.nextNode(),u.push({type:2,index:++a});i.append(d[p],Ti())}}}else if(i.nodeType===8)if(i.data===Gl)u.push({type:2,index:a});else{let d=-1;for(;(d=i.data.indexOf(dr,d+1))!==-1;)u.push({type:7,index:a}),d+=dr.length-1}a++}}static createElement(e,r){let n=zr.createElement("template");return n.innerHTML=e,n}};function Fn(t,e,r=t,n){var i,a,o,s;if(e===Qr)return e;let u=n!==void 0?(i=r._$Co)===null||i===void 0?void 0:i[n]:r._$Cl,c=Ai(e)?void 0:e._$litDirective$;return u?.constructor!==c&&((a=u?._$AO)===null||a===void 0||a.call(u,!1),c===void 0?u=void 0:(u=new c(t),u._$AT(t,r,n)),n!==void 0?((o=(s=r)._$Co)!==null&&o!==void 0?o:s._$Co=[])[n]=u:r._$Cl=u),u!==void 0&&(e=Fn(t,u._$AS(t,e.values),u,n)),e}var Gs=class{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var r;let{el:{content:n},parts:i}=this._$AD,a=((r=e?.creationScope)!==null&&r!==void 0?r:zr).importNode(n,!0);Vr.currentNode=a;let o=Vr.nextNode(),s=0,u=0,c=i[0];for(;c!==void 0;){if(s===c.index){let l;c.type===2?l=new Hr(o,o.nextSibling,this,e):c.type===1?l=new c.ctor(o,c.name,c.strings,this,e):c.type===6&&(l=new Zs(o,this,e)),this._$AV.push(l),c=i[++u]}s!==c?.index&&(o=Vr.nextNode(),s++)}return Vr.currentNode=zr,a}v(e){let r=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,r),r+=n.strings.length-2):n._$AI(e[r])),r++}},Hr=class{constructor(e,r,n,i){var a;this.type=2,this._$AH=Fe,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=n,this.options=i,this._$Cp=(a=i?.isConnected)===null||a===void 0||a}get _$AU(){var e,r;return(r=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&r!==void 0?r:this._$Cp}get parentNode(){let e=this._$AA.parentNode,r=this._$AM;return r!==void 0&&e?.nodeType===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=Fn(this,e,r),Ai(e)?e===Fe||e==null||e===""?(this._$AH!==Fe&&this._$AR(),this._$AH=Fe):e!==this._$AH&&e!==Qr&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):gm(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!==Fe&&Ai(this._$AH)?this._$AA.nextSibling.data=e:this.$(zr.createTextNode(e)),this._$AH=e}g(e){var r;let{values:n,_$litType$:i}=e,a=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Gr.createElement(Zl(i.h,i.h[0]),this.options)),i);if(((r=this._$AH)===null||r===void 0?void 0:r._$AD)===a)this._$AH.v(n);else{let o=new Gs(a,this),s=o.u(this.options);o.v(n),this.$(s),this._$AH=o}}_$AC(e){let r=zl.get(e.strings);return r===void 0&&zl.set(e.strings,r=new Gr(e)),r}T(e){Hl(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,n,i=0;for(let a of e)i===r.length?r.push(n=new Hr(this.k(Ti()),this.k(Ti()),this,this.options)):n=r[i],n._$AI(a),i++;i<r.length&&(this._$AR(n&&n._$AB.nextSibling,i),r.length=i)}_$AR(e=this._$AA.nextSibling,r){var n;for((n=this._$AP)===null||n===void 0||n.call(this,!1,!0,r);e&&e!==this._$AB;){let i=e.nextSibling;e.remove(),e=i}}setConnected(e){var r;this._$AM===void 0&&(this._$Cp=e,(r=this._$AP)===null||r===void 0||r.call(this,e))}},Mn=class{constructor(e,r,n,i,a){this.type=1,this._$AH=Fe,this._$AN=void 0,this.element=e,this.name=r,this._$AM=i,this.options=a,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=Fe}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,r=this,n,i){let a=this.strings,o=!1;if(a===void 0)e=Fn(this,e,r,0),o=!Ai(e)||e!==this._$AH&&e!==Qr,o&&(this._$AH=e);else{let s=e,u,c;for(e=a[0],u=0;u<a.length-1;u++)c=Fn(this,s[n+u],r,u),c===Qr&&(c=this._$AH[u]),o||(o=!Ai(c)||c!==this._$AH[u]),c===Fe?e=Fe:e!==Fe&&(e+=(c??"")+a[u+1]),this._$AH[u]=c}o&&!i&&this.j(e)}j(e){e===Fe?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Hs=class extends Mn{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Fe?void 0:e}},vm=$n?$n.emptyScript:"",Ws=class extends Mn{constructor(){super(...arguments),this.type=4}j(e){e&&e!==Fe?this.element.setAttribute(this.name,vm):this.element.removeAttribute(this.name)}},Ks=class extends Mn{constructor(e,r,n,i,a){super(e,r,n,i,a),this.type=5}_$AI(e,r=this){var n;if((e=(n=Fn(this,e,r,0))!==null&&n!==void 0?n:Fe)===Qr)return;let i=this._$AH,a=e===Fe&&i!==Fe||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,o=e!==Fe&&(i===Fe||a);a&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var r,n;typeof this._$AH=="function"?this._$AH.call((n=(r=this.options)===null||r===void 0?void 0:r.host)!==null&&n!==void 0?n:this.element,e):this._$AH.handleEvent(e)}},Zs=class{constructor(e,r,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){Fn(this,e)}};var Ql=Ga.litHtmlPolyfillSupport;Ql?.(Gr,Hr),((Vs=Ga.litHtmlVersions)!==null&&Vs!==void 0?Vs:Ga.litHtmlVersions=[]).push("2.8.0");var Yl=(t,e,r)=>{var n,i;let a=(n=r?.renderBefore)!==null&&n!==void 0?n:e,o=a._$litPart$;if(o===void 0){let s=(i=r?.renderBefore)!==null&&i!==void 0?i:null;a._$litPart$=o=new Hr(e.insertBefore(Ti(),s),s,void 0,r??{})}return o._$AI(t),o};var Ys,Js;var hr=class extends Xt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,r;let n=super.createRenderRoot();return(e=(r=this.renderOptions).renderBefore)!==null&&e!==void 0||(r.renderBefore=n.firstChild),n}update(e){let r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Yl(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return Qr}};hr.finalized=!0,hr._$litElement$=!0,(Ys=globalThis.litElementHydrateSupport)===null||Ys===void 0||Ys.call(globalThis,{LitElement:hr});var Jl=globalThis.litElementPolyfillSupport;Jl?.({LitElement:hr});((Js=globalThis.litElementVersions)!==null&&Js!==void 0?Js:globalThis.litElementVersions=[]).push("3.3.3");var Xl=t=>e=>typeof e=="function"?((r,n)=>(customElements.define(r,n),n))(t,e):((r,n)=>{let{kind:i,elements:a}=n;return{kind:i,elements:a,finisher(o){customElements.define(r,o)}}})(t,e);var bm=(t,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(r){r.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(r){r.createProperty(e.key,t)}},_m=(t,e,r)=>{e.constructor.createProperty(r,t)};function ft(t){return(e,r)=>r!==void 0?_m(t,e,r):bm(t,e)}function Ze(t){return ft({...t,state:!0})}var Xs,y3=((Xs=window.HTMLSlotElement)===null||Xs===void 0?void 0:Xs.prototype.assignedElements)!=null?(t,e)=>t.assignedElements(e):(t,e)=>t.assignedNodes(e).filter(r=>r.nodeType===Node.ELEMENT_NODE);var ec=function(t,e){return ec=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},ec(t,e)};function xe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");ec(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var _=function(){return _=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},_.apply(this,arguments)};function jt(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function Tt(t,e,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(l){try{c(n.next(l))}catch(d){o(d)}}function u(l){try{c(n.throw(l))}catch(d){o(d)}}function c(l){l.done?a(l.value):i(l.value).then(s,u)}c((n=n.apply(t,e||[])).next())})}function At(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(a=c[0]&2?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){r.label=c[1];break}if(c[0]===6&&r.label<a[1]){r.label=a[1],a=c;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(c);break}a[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function mr(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))}var tc="Invariant Violation",ef=Object.setPrototypeOf,wm=ef===void 0?function(t,e){return t.__proto__=e,t}:ef,V=function(t){xe(e,t);function e(r){r===void 0&&(r=tc);var n=t.call(this,typeof r=="number"?tc+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=tc,wm(n,e.prototype),n}return e}(Error);function I(t,e){if(!t)throw new V(e)}var Wa=["debug","log","warn","error","silent"],rc=Wa.indexOf("log");function Ha(t){return function(){if(Wa.indexOf(t)>=rc){var e=console[t]||console.log;return e.apply(console,arguments)}}}(function(t){t.debug=Ha("debug"),t.log=Ha("log"),t.warn=Ha("warn"),t.error=Ha("error")})(I||(I={}));function tf(t){var e=Wa[rc];return rc=Math.max(0,Wa.indexOf(t)),e}function Me(t){try{return t()}catch{}}var Ka=Me(function(){return globalThis})||Me(function(){return window})||Me(function(){return self})||Me(function(){return global})||Me(function(){return Me.constructor("return this")()});var rf="__",nf=[rf,rf].join("DEV");function Sm(){try{return Boolean(__DEV__)}catch{return Object.defineProperty(Ka,nf,{value:Me(function(){return"production"})!=="production",enumerable:!1,configurable:!0,writable:!0}),Ka[nf]}}var Wr=Sm();function gr(t){try{return t()}catch{}}var nc=gr(function(){return globalThis})||gr(function(){return window})||gr(function(){return self})||gr(function(){return global})||gr(function(){return gr.constructor("return this")()}),ic=!1;function Em(){nc&&!gr(function(){return"production"})&&!gr(function(){return process})&&(Object.defineProperty(nc,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),ic=!0)}Em();function ac(){ic&&(delete nc.process,ic=!1)}var V3=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",z3=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator",af=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";var Oe=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});function oc(t,e){var r=Boolean(t);if(!r)throw new Error(e??"Unexpected invariant triggered.")}var Cm=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,Oi=Cm;function Za(t){var e=t.prototype.toJSON;typeof e=="function"||oc(0),t.prototype.inspect=e,Oi&&(t.prototype[Oi]=e)}var of=function(){function t(r,n,i){this.start=r.start,this.end=n.end,this.startToken=r,this.endToken=n,this.source=i}var e=t.prototype;return e.toJSON=function(){return{start:this.start,end:this.end}},t}();Za(of);var sf=function(){function t(r,n,i,a,o,s,u){this.kind=r,this.start=n,this.end=i,this.line=a,this.column=o,this.value=u,this.prev=s,this.next=null}var e=t.prototype;return e.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},t}();Za(sf);function sc(t){return t!=null&&typeof t.kind=="string"}function Ya(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ya=function(r){return typeof r}:Ya=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ya(t)}var xm=10,cf=2;function Di(t){return Ja(t,[])}function Ja(t,e){switch(Ya(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return t===null?"null":km(t,e);default:return String(t)}}function km(t,e){if(e.indexOf(t)!==-1)return"[Circular]";var r=[].concat(e,[t]),n=Im(t);if(n!==void 0){var i=n.call(t);if(i!==t)return typeof i=="string"?i:Ja(i,r)}else if(Array.isArray(t))return Am(t,r);return Tm(t,r)}function Tm(t,e){var r=Object.keys(t);if(r.length===0)return"{}";if(e.length>cf)return"["+Om(t)+"]";var n=r.map(function(i){var a=Ja(t[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function Am(t,e){if(t.length===0)return"[]";if(e.length>cf)return"[Array]";for(var r=Math.min(xm,t.length),n=t.length-r,i=[],a=0;a<r;++a)i.push(Ja(t[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function Im(t){var e=t[String(Oi)];if(typeof e=="function")return e;if(typeof t.inspect=="function")return t.inspect}function Om(t){var e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof t.constructor=="function"){var r=t.constructor.name;if(typeof r=="string"&&r!=="")return r}return e}function Ni(t,e){var r=Boolean(t);if(!r)throw new Error(e)}function uf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Dm(t,e,r){return e&&uf(t.prototype,e),r&&uf(t,r),t}var Xa=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GraphQL request",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{line:1,column:1};typeof e=="string"||Ni(0,"Body must be a string. Received: ".concat(Di(e),".")),this.body=e,this.name=r,this.locationOffset=n,this.locationOffset.line>0||Ni(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Ni(0,"column in locationOffset is 1-indexed and must be positive.")}return Dm(t,[{key:af,get:function(){return"Source"}}]),t}();function lf(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=t.indexOf(`
|
|
1
|
+
var im=Object.defineProperty;var am=Object.getOwnPropertyDescriptor;var X=(t,e,r,n)=>{for(var i=n>1?void 0:n?am(e,r):e,a=t.length-1,o;a>=0;a--)(o=t[a])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&im(e,r,i),i};var ee=(t,e,r)=>new Promise((n,i)=>{var a=u=>{try{s(r.next(u))}catch(c){i(c)}},o=u=>{try{s(r.throw(u))}catch(c){i(c)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(a,o);s((r=r.apply(t,e)).next())});import{ZBarSymbolType as pe,ZBarConfigType as Cp,scanRGBABuffer as om,getDefaultScanner as sm}from"https://cdn.jsdelivr.net/npm/@undecaf/zbar-wasm@0.9.15/dist/main.js";function cm(t,e,r,n){return new(r||(r=Promise))(function(i,a){function o(c){try{u(n.next(c))}catch(l){a(l)}}function s(c){try{u(n.throw(c))}catch(l){a(l)}}function u(c){var l;c.done?i(c.value):(l=c.value,l instanceof r?l:new r(function(d){d(l)})).then(o,s)}u((n=n.apply(t,e||[])).next())})}var F=class{constructor(e,r=Cp.ZBAR_CFG_ENABLE,n=1){this.symbolType=e,this.configType=r,this.number=n,this.configSteps=[this]}static register(e,r,n=r.symbolType){return F.formatsToConfigs[e]=r,F.typesToFormats[n]=F.typesToFormats[n]||e,r}static formats(){return Object.keys(F.formatsToConfigs)}static toFormat(e){return F.typesToFormats[e]}static configure(e,r){var n;(n=F.formatsToConfigs[r])===null||n===void 0||n.configSteps.forEach(i=>e.setConfig(i.symbolType,i.configType,i.number))}add(e){return this.configSteps.push(e),this}},Sp;F.formatsToConfigs={},F.typesToFormats={},F.register("codabar",new F(pe.ZBAR_CODABAR)),F.register("code_39",new F(pe.ZBAR_CODE39)),F.register("code_93",new F(pe.ZBAR_CODE93)),F.register("code_128",new F(pe.ZBAR_CODE128)),F.register("databar",new F(pe.ZBAR_DATABAR)),F.register("databar_exp",new F(pe.ZBAR_DATABAR_EXP)),F.register("ean_2",new F(pe.ZBAR_EAN2)),F.register("ean_5",new F(pe.ZBAR_EAN5)),F.register("ean_8",new F(pe.ZBAR_EAN8)),F.register("ean_13",new F(pe.ZBAR_EAN13)),F.register("ean_13+2",new F(pe.ZBAR_EAN13)).add(new F(pe.ZBAR_EAN2)),F.register("ean_13+5",new F(pe.ZBAR_EAN13)).add(new F(pe.ZBAR_EAN5)),F.register("isbn_10",new F(pe.ZBAR_ISBN10)).add(new F(pe.ZBAR_EAN13)),F.register("isbn_13",new F(pe.ZBAR_ISBN13)).add(new F(pe.ZBAR_EAN13)),F.register("isbn_13+2",new F(pe.ZBAR_ISBN13)).add(new F(pe.ZBAR_EAN13)).add(new F(pe.ZBAR_EAN2)),F.register("isbn_13+5",new F(pe.ZBAR_ISBN13)).add(new F(pe.ZBAR_EAN13)).add(new F(pe.ZBAR_EAN5)),F.register("itf",new F(pe.ZBAR_I25)),F.register("qr_code",new F(pe.ZBAR_QRCODE)),F.register("sq_code",new F(pe.ZBAR_SQCODE)),F.register("upc_a",new F(pe.ZBAR_UPCA)).add(new F(pe.ZBAR_EAN13)),F.register("upc_e",new F(pe.ZBAR_UPCE)).add(new F(pe.ZBAR_EAN13)),function(t){t[t.UNKNOWN=-1]="UNKNOWN",t[t.UPRIGHT=0]="UPRIGHT",t[t.ROTATED_RIGHT=1]="ROTATED_RIGHT",t[t.UPSIDE_DOWN=2]="UPSIDE_DOWN",t[t.ROTATED_LEFT=3]="ROTATED_LEFT"}(Sp||(Sp={}));var _c=class{},um=(()=>{try{return new OffscreenCanvas(1,1).getContext("2d")instanceof OffscreenCanvasRenderingContext2D}catch{return!1}})(),Ir=class{constructor(e={}){if(e.formats!==void 0){if(!Array.isArray(e.formats)||!e.formats.length)throw new TypeError(`Barcode formats should be a non-empty array of strings but are: ${JSON.stringify(e)}`);let r=e.formats.filter(n=>!F.formats().includes(n));if(r.length)throw new TypeError(`Unsupported barcode format(s): ${r.join(", ")}`)}this.formats=e.formats||F.formats(),this.zbarConfig=e.zbar||new _c}static getSupportedFormats(){return Promise.resolve(F.formats())}detect(e){if(!Ir.isImageBitmapSource(e))throw new TypeError("BarcodeDetector.detect() argument is not an ImageBitmapSource");let r=Ir.intrinsicDimensions(e);if(r.width===0||r.height===0)return Promise.resolve([]);try{return Promise.all([this.toImageData(e),this.getScanner()]).then(n=>{let i=n[0],a=n[1];return this.zbarConfig.enableCache!==void 0&&a.enableCache(this.zbarConfig.enableCache),om(i.data,i.width,i.height,a)}).then(n=>n.map(i=>this.toBarcodeDetectorResult(i)))}catch(n){return Promise.reject(n)}}getScanner(){return new Promise((e,r)=>cm(this,void 0,void 0,function*(){if(!this.scanner){let n=yield sm();this.formats.length>0&&(n.setConfig(pe.ZBAR_NONE,Cp.ZBAR_CFG_ENABLE,0),this.formats.forEach(i=>F.configure(n,i))),this.scanner=n}e(this.scanner)}))}toImageData(e){let r=n=>{let i=Ir.intrinsicDimensions(n);this.canvas&&this.canvas.width===i.width&&this.canvas.height===i.height||(this.canvas=function(s,u){if(um)return new OffscreenCanvas(s,u);{let c=document.createElement("canvas");return c.width=s,c.height=u,c}}(i.width,i.height));let a=this.canvas,o=a.getContext("2d");return o.drawImage(n,0,0),o.getImageData(0,0,a.width,a.height)};if(e instanceof ImageData)return Promise.resolve(e);if(e instanceof Blob){let n=document.createElement("img");return n.src=URL.createObjectURL(e),n.decode().then(()=>r(n)).finally(()=>URL.revokeObjectURL(n.src))}return e instanceof CanvasRenderingContext2D?Promise.resolve(e.getImageData(0,0,e.canvas.width,e.canvas.height)):Promise.resolve(r(e))}toBarcodeDetectorResult(e){let r={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0};return e.points.forEach(n=>{r.minX=Math.min(r.minX,n.x),r.maxX=Math.max(r.maxX,n.x),r.minY=Math.min(r.minY,n.y),r.maxY=Math.max(r.maxY,n.y)}),{format:F.toFormat(e.type),rawValue:e.decode(this.zbarConfig.encoding),orientation:e.orientation,quality:e.quality,boundingBox:DOMRectReadOnly.fromRect({x:r.minX,y:r.minY,width:r.maxX-r.minX,height:r.maxY-r.minY}),cornerPoints:[{x:r.minX,y:r.minY},{x:r.maxX,y:r.minY},{x:r.maxX,y:r.maxY},{x:r.minX,y:r.maxY}]}}static isImageBitmapSource(e){return e instanceof HTMLImageElement||e instanceof HTMLVideoElement||e instanceof HTMLCanvasElement||e instanceof Blob||e instanceof ImageData||e instanceof CanvasRenderingContext2D||e instanceof ImageBitmap||e&&e.width==0||e&&e.height==0}static intrinsicDimensions(e){return{width:Number(e.naturalWidth||e.videoWidth||e.width),height:Number(e.naturalHeight||e.videoHeight||e.height)}}};var Eo=window,ko=Eo.ShadowRoot&&(Eo.ShadyCSS===void 0||Eo.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,wc=Symbol(),xp=new WeakMap,Zi=class{constructor(e,r,n){if(this._$cssResult$=!0,n!==wc)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o,r=this.t;if(ko&&e===void 0){let n=r!==void 0&&r.length===1;n&&(e=xp.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&xp.set(r,e))}return e}toString(){return this.cssText}},Ep=t=>new Zi(typeof t=="string"?t:t+"",void 0,wc),Sc=(t,...e)=>{let r=t.length===1?t[0]:e.reduce((n,i,a)=>n+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[a+1],t[0]);return new Zi(r,t,wc)},Cc=(t,e)=>{ko?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{let n=document.createElement("style"),i=Eo.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)})},Ao=ko?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let n of e.cssRules)r+=n.cssText;return Ep(r)})(t):t;var xc,Io=window,kp=Io.trustedTypes,lm=kp?kp.emptyScript:"",Ap=Io.reactiveElementPolyfillSupport,kc={toAttribute(t,e){switch(e){case Boolean:t=t?lm:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},Ip=(t,e)=>e!==t&&(e==e||t==t),Ec={attribute:!0,type:String,converter:kc,reflect:!1,hasChanged:Ip},Ac="finalized",fr=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var r;this.finalize(),((r=this.h)!==null&&r!==void 0?r:this.h=[]).push(e)}static get observedAttributes(){this.finalize();let e=[];return this.elementProperties.forEach((r,n)=>{let i=this._$Ep(n,r);i!==void 0&&(this._$Ev.set(i,n),e.push(i))}),e}static createProperty(e,r=Ec){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(e,r),!r.noAccessor&&!this.prototype.hasOwnProperty(e)){let n=typeof e=="symbol"?Symbol():"__"+e,i=this.getPropertyDescriptor(e,n,r);i!==void 0&&Object.defineProperty(this.prototype,e,i)}}static getPropertyDescriptor(e,r,n){return{get(){return this[r]},set(i){let a=this[e];this[r]=i,this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||Ec}static finalize(){if(this.hasOwnProperty(Ac))return!1;this[Ac]=!0;let e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let r=this.properties,n=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let i of n)this.createProperty(i,r[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){let r=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let i of n)r.unshift(Ao(i))}else e!==void 0&&r.push(Ao(e));return r}static _$Ep(e,r){let n=r.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(r=>r(this))}addController(e){var r,n;((r=this._$ES)!==null&&r!==void 0?r:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((n=e.hostConnected)===null||n===void 0||n.call(e))}removeController(e){var r;(r=this._$ES)===null||r===void 0||r.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,r)=>{this.hasOwnProperty(r)&&(this._$Ei.set(r,this[r]),delete this[r])})}createRenderRoot(){var e;let r=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return Cc(r,this.constructor.elementStyles),r}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(r=>{var n;return(n=r.hostConnected)===null||n===void 0?void 0:n.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(r=>{var n;return(n=r.hostDisconnected)===null||n===void 0?void 0:n.call(r)})}attributeChangedCallback(e,r,n){this._$AK(e,n)}_$EO(e,r,n=Ec){var i;let a=this.constructor._$Ep(e,n);if(a!==void 0&&n.reflect===!0){let o=(((i=n.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?n.converter:kc).toAttribute(r,n.type);this._$El=e,o==null?this.removeAttribute(a):this.setAttribute(a,o),this._$El=null}}_$AK(e,r){var n;let i=this.constructor,a=i._$Ev.get(e);if(a!==void 0&&this._$El!==a){let o=i.getPropertyOptions(a),s=typeof o.converter=="function"?{fromAttribute:o.converter}:((n=o.converter)===null||n===void 0?void 0:n.fromAttribute)!==void 0?o.converter:kc;this._$El=a,this[a]=s.fromAttribute(r,o.type),this._$El=null}}requestUpdate(e,r,n){let i=!0;e!==void 0&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||Ip)(this[e],r)?(this._$AL.has(e)||this._$AL.set(e,r),n.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,n))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(r){Promise.reject(r)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((i,a)=>this[a]=i),this._$Ei=void 0);let r=!1,n=this._$AL;try{r=this.shouldUpdate(n),r?(this.willUpdate(n),(e=this._$ES)===null||e===void 0||e.forEach(i=>{var a;return(a=i.hostUpdate)===null||a===void 0?void 0:a.call(i)}),this.update(n)):this._$Ek()}catch(i){throw r=!1,this._$Ek(),i}r&&this._$AE(n)}willUpdate(e){}_$AE(e){var r;(r=this._$ES)===null||r===void 0||r.forEach(n=>{var i;return(i=n.hostUpdated)===null||i===void 0?void 0:i.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((r,n)=>this._$EO(n,this[n],r)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};fr[Ac]=!0,fr.elementProperties=new Map,fr.elementStyles=[],fr.shadowRootOptions={mode:"open"},Ap?.({ReactiveElement:fr}),((xc=Io.reactiveElementVersions)!==null&&xc!==void 0?xc:Io.reactiveElementVersions=[]).push("1.6.3");var Ic,To=window,ni=To.trustedTypes,Tp=ni?ni.createPolicy("lit-html",{createHTML:t=>t}):void 0,Oc="$lit$",Tr=`lit$${(Math.random()+"").slice(9)}$`,Lp="?"+Tr,pm=`<${Lp}>`,ln=document,Yi=()=>ln.createComment(""),Xi=t=>t===null||typeof t!="object"&&typeof t!="function",Fp=Array.isArray,fm=t=>Fp(t)||typeof t?.[Symbol.iterator]=="function",Tc=`[
|
|
2
|
+
\f\r]`,Ji=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Op=/-->/g,Dp=/>/g,cn=RegExp(`>|${Tc}(?:([^\\s"'>=/]+)(${Tc}*=${Tc}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Np=/'/g,Pp=/"/g,Mp=/^(?:script|style|textarea|title)$/i,Up=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),L=Up(1),q3=Up(2),pn=Symbol.for("lit-noChange"),He=Symbol.for("lit-nothing"),Rp=new WeakMap,un=ln.createTreeWalker(ln,129,null,!1);function jp(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Tp!==void 0?Tp.createHTML(e):e}var dm=(t,e)=>{let r=t.length-1,n=[],i,a=e===2?"<svg>":"",o=Ji;for(let s=0;s<r;s++){let u=t[s],c,l,d=-1,f=0;for(;f<u.length&&(o.lastIndex=f,l=o.exec(u),l!==null);)f=o.lastIndex,o===Ji?l[1]==="!--"?o=Op:l[1]!==void 0?o=Dp:l[2]!==void 0?(Mp.test(l[2])&&(i=RegExp("</"+l[2],"g")),o=cn):l[3]!==void 0&&(o=cn):o===cn?l[0]===">"?(o=i??Ji,d=-1):l[1]===void 0?d=-2:(d=o.lastIndex-l[2].length,c=l[1],o=l[3]===void 0?cn:l[3]==='"'?Pp:Np):o===Pp||o===Np?o=cn:o===Op||o===Dp?o=Ji:(o=cn,i=void 0);let p=o===cn&&t[s+1].startsWith("/>")?" ":"";a+=o===Ji?u+pm:d>=0?(n.push(c),u.slice(0,d)+Oc+u.slice(d)+Tr+p):u+Tr+(d===-2?(n.push(void 0),s):p)}return[jp(t,a+(t[r]||"<?>")+(e===2?"</svg>":"")),n]},fn=class{constructor({strings:e,_$litType$:r},n){let i;this.parts=[];let a=0,o=0,s=e.length-1,u=this.parts,[c,l]=dm(e,r);if(this.el=fn.createElement(c,n),un.currentNode=this.el.content,r===2){let d=this.el.content,f=d.firstChild;f.remove(),d.append(...f.childNodes)}for(;(i=un.nextNode())!==null&&u.length<s;){if(i.nodeType===1){if(i.hasAttributes()){let d=[];for(let f of i.getAttributeNames())if(f.endsWith(Oc)||f.startsWith(Tr)){let p=l[o++];if(d.push(f),p!==void 0){let h=i.getAttribute(p.toLowerCase()+Oc).split(Tr),g=/([.?@])?(.*)/.exec(p);u.push({type:1,index:a,name:g[2],strings:h,ctor:g[1]==="."?Nc:g[1]==="?"?Pc:g[1]==="@"?Rc:ai})}else u.push({type:6,index:a})}for(let f of d)i.removeAttribute(f)}if(Mp.test(i.tagName)){let d=i.textContent.split(Tr),f=d.length-1;if(f>0){i.textContent=ni?ni.emptyScript:"";for(let p=0;p<f;p++)i.append(d[p],Yi()),un.nextNode(),u.push({type:2,index:++a});i.append(d[f],Yi())}}}else if(i.nodeType===8)if(i.data===Lp)u.push({type:2,index:a});else{let d=-1;for(;(d=i.data.indexOf(Tr,d+1))!==-1;)u.push({type:7,index:a}),d+=Tr.length-1}a++}}static createElement(e,r){let n=ln.createElement("template");return n.innerHTML=e,n}};function ii(t,e,r=t,n){var i,a,o,s;if(e===pn)return e;let u=n!==void 0?(i=r._$Co)===null||i===void 0?void 0:i[n]:r._$Cl,c=Xi(e)?void 0:e._$litDirective$;return u?.constructor!==c&&((a=u?._$AO)===null||a===void 0||a.call(u,!1),c===void 0?u=void 0:(u=new c(t),u._$AT(t,r,n)),n!==void 0?((o=(s=r)._$Co)!==null&&o!==void 0?o:s._$Co=[])[n]=u:r._$Cl=u),u!==void 0&&(e=ii(t,u._$AS(t,e.values),u,n)),e}var Dc=class{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var r;let{el:{content:n},parts:i}=this._$AD,a=((r=e?.creationScope)!==null&&r!==void 0?r:ln).importNode(n,!0);un.currentNode=a;let o=un.nextNode(),s=0,u=0,c=i[0];for(;c!==void 0;){if(s===c.index){let l;c.type===2?l=new dn(o,o.nextSibling,this,e):c.type===1?l=new c.ctor(o,c.name,c.strings,this,e):c.type===6&&(l=new $c(o,this,e)),this._$AV.push(l),c=i[++u]}s!==c?.index&&(o=un.nextNode(),s++)}return un.currentNode=ln,a}v(e){let r=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,r),r+=n.strings.length-2):n._$AI(e[r])),r++}},dn=class{constructor(e,r,n,i){var a;this.type=2,this._$AH=He,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=n,this.options=i,this._$Cp=(a=i?.isConnected)===null||a===void 0||a}get _$AU(){var e,r;return(r=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&r!==void 0?r:this._$Cp}get parentNode(){let e=this._$AA.parentNode,r=this._$AM;return r!==void 0&&e?.nodeType===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=ii(this,e,r),Xi(e)?e===He||e==null||e===""?(this._$AH!==He&&this._$AR(),this._$AH=He):e!==this._$AH&&e!==pn&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):fm(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==He&&Xi(this._$AH)?this._$AA.nextSibling.data=e:this.$(ln.createTextNode(e)),this._$AH=e}g(e){var r;let{values:n,_$litType$:i}=e,a=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=fn.createElement(jp(i.h,i.h[0]),this.options)),i);if(((r=this._$AH)===null||r===void 0?void 0:r._$AD)===a)this._$AH.v(n);else{let o=new Dc(a,this),s=o.u(this.options);o.v(n),this.$(s),this._$AH=o}}_$AC(e){let r=Rp.get(e.strings);return r===void 0&&Rp.set(e.strings,r=new fn(e)),r}T(e){Fp(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,n,i=0;for(let a of e)i===r.length?r.push(n=new dn(this.k(Yi()),this.k(Yi()),this,this.options)):n=r[i],n._$AI(a),i++;i<r.length&&(this._$AR(n&&n._$AB.nextSibling,i),r.length=i)}_$AR(e=this._$AA.nextSibling,r){var n;for((n=this._$AP)===null||n===void 0||n.call(this,!1,!0,r);e&&e!==this._$AB;){let i=e.nextSibling;e.remove(),e=i}}setConnected(e){var r;this._$AM===void 0&&(this._$Cp=e,(r=this._$AP)===null||r===void 0||r.call(this,e))}},ai=class{constructor(e,r,n,i,a){this.type=1,this._$AH=He,this._$AN=void 0,this.element=e,this.name=r,this._$AM=i,this.options=a,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=He}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,r=this,n,i){let a=this.strings,o=!1;if(a===void 0)e=ii(this,e,r,0),o=!Xi(e)||e!==this._$AH&&e!==pn,o&&(this._$AH=e);else{let s=e,u,c;for(e=a[0],u=0;u<a.length-1;u++)c=ii(this,s[n+u],r,u),c===pn&&(c=this._$AH[u]),o||(o=!Xi(c)||c!==this._$AH[u]),c===He?e=He:e!==He&&(e+=(c??"")+a[u+1]),this._$AH[u]=c}o&&!i&&this.j(e)}j(e){e===He?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Nc=class extends ai{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===He?void 0:e}},hm=ni?ni.emptyScript:"",Pc=class extends ai{constructor(){super(...arguments),this.type=4}j(e){e&&e!==He?this.element.setAttribute(this.name,hm):this.element.removeAttribute(this.name)}},Rc=class extends ai{constructor(e,r,n,i,a){super(e,r,n,i,a),this.type=5}_$AI(e,r=this){var n;if((e=(n=ii(this,e,r,0))!==null&&n!==void 0?n:He)===pn)return;let i=this._$AH,a=e===He&&i!==He||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,o=e!==He&&(i===He||a);a&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var r,n;typeof this._$AH=="function"?this._$AH.call((n=(r=this.options)===null||r===void 0?void 0:r.host)!==null&&n!==void 0?n:this.element,e):this._$AH.handleEvent(e)}},$c=class{constructor(e,r,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){ii(this,e)}};var $p=To.litHtmlPolyfillSupport;$p?.(fn,dn),((Ic=To.litHtmlVersions)!==null&&Ic!==void 0?Ic:To.litHtmlVersions=[]).push("2.8.0");var Bp=(t,e,r)=>{var n,i;let a=(n=r?.renderBefore)!==null&&n!==void 0?n:e,o=a._$litPart$;if(o===void 0){let s=(i=r?.renderBefore)!==null&&i!==void 0?i:null;a._$litPart$=o=new dn(e.insertBefore(Yi(),s),s,void 0,r??{})}return o._$AI(t),o};var Lc,Fc;var Or=class extends fr{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,r;let n=super.createRenderRoot();return(e=(r=this.renderOptions).renderBefore)!==null&&e!==void 0||(r.renderBefore=n.firstChild),n}update(e){let r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Bp(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return pn}};Or.finalized=!0,Or._$litElement$=!0,(Lc=globalThis.litElementHydrateSupport)===null||Lc===void 0||Lc.call(globalThis,{LitElement:Or});var qp=globalThis.litElementPolyfillSupport;qp?.({LitElement:Or});((Fc=globalThis.litElementVersions)!==null&&Fc!==void 0?Fc:globalThis.litElementVersions=[]).push("3.3.3");var Vp=t=>e=>typeof e=="function"?((r,n)=>(customElements.define(r,n),n))(t,e):((r,n)=>{let{kind:i,elements:a}=n;return{kind:i,elements:a,finisher(o){customElements.define(r,o)}}})(t,e);var mm=(t,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(r){r.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(r){r.createProperty(e.key,t)}},gm=(t,e,r)=>{e.constructor.createProperty(r,t)};function st(t){return(e,r)=>r!==void 0?gm(t,e,r):mm(t,e)}function xe(t){return st({...t,state:!0})}var Mc,mb=((Mc=window.HTMLSlotElement)===null||Mc===void 0?void 0:Mc.prototype.assignedElements)!=null?(t,e)=>t.assignedElements(e):(t,e)=>t.assignedNodes(e).filter(r=>r.nodeType===Node.ELEMENT_NODE);var Uc=function(t,e){return Uc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Uc(t,e)};function De(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Uc(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var S=function(){return S=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},S.apply(this,arguments)};function Jt(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function Bt(t,e,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(l){try{c(n.next(l))}catch(d){o(d)}}function u(l){try{c(n.throw(l))}catch(d){o(d)}}function c(l){l.done?a(l.value):i(l.value).then(s,u)}c((n=n.apply(t,e||[])).next())})}function qt(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(a=c[0]&2?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){r.label=c[1];break}if(c[0]===6&&r.label<a[1]){r.label=a[1],a=c;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(c);break}a[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Dr(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))}var jc="Invariant Violation",Qp=Object.setPrototypeOf,ym=Qp===void 0?function(t,e){return t.__proto__=e,t}:Qp,H=function(t){De(e,t);function e(r){r===void 0&&(r=jc);var n=t.call(this,typeof r=="number"?jc+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=jc,ym(n,e.prototype),n}return e}(Error);function N(t,e){if(!t)throw new H(e)}var Do=["debug","log","warn","error","silent"],Bc=Do.indexOf("log");function Oo(t){return function(){if(Do.indexOf(t)>=Bc){var e=console[t]||console.log;return e.apply(console,arguments)}}}(function(t){t.debug=Oo("debug"),t.log=Oo("log"),t.warn=Oo("warn"),t.error=Oo("error")})(N||(N={}));function zp(t){var e=Do[Bc];return Bc=Math.max(0,Do.indexOf(t)),e}function Ge(t){try{return t()}catch{}}var No=Ge(function(){return globalThis})||Ge(function(){return window})||Ge(function(){return self})||Ge(function(){return global})||Ge(function(){return Ge.constructor("return this")()});var Hp="__",Gp=[Hp,Hp].join("DEV");function vm(){try{return Boolean(__DEV__)}catch{return Object.defineProperty(No,Gp,{value:Ge(function(){return"production"})!=="production",enumerable:!1,configurable:!0,writable:!0}),No[Gp]}}var hn=vm();function Nr(t){try{return t()}catch{}}var qc=Nr(function(){return globalThis})||Nr(function(){return window})||Nr(function(){return self})||Nr(function(){return global})||Nr(function(){return Nr.constructor("return this")()}),Vc=!1;function bm(){qc&&!Nr(function(){return"production"})&&!Nr(function(){return process})&&(Object.defineProperty(qc,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),Vc=!0)}bm();function Qc(){Vc&&(delete qc.process,Vc=!1)}var Bb=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",qb=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator",Wp=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";var Le=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});function zc(t,e){var r=Boolean(t);if(!r)throw new Error(e??"Unexpected invariant triggered.")}var _m=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,ta=_m;function Po(t){var e=t.prototype.toJSON;typeof e=="function"||zc(0),t.prototype.inspect=e,ta&&(t.prototype[ta]=e)}var Kp=function(){function t(r,n,i){this.start=r.start,this.end=n.end,this.startToken=r,this.endToken=n,this.source=i}var e=t.prototype;return e.toJSON=function(){return{start:this.start,end:this.end}},t}();Po(Kp);var Zp=function(){function t(r,n,i,a,o,s,u){this.kind=r,this.start=n,this.end=i,this.line=a,this.column=o,this.value=u,this.prev=s,this.next=null}var e=t.prototype;return e.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},t}();Po(Zp);function Hc(t){return t!=null&&typeof t.kind=="string"}function Ro(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ro=function(r){return typeof r}:Ro=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ro(t)}var wm=10,Jp=2;function ra(t){return $o(t,[])}function $o(t,e){switch(Ro(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return t===null?"null":Sm(t,e);default:return String(t)}}function Sm(t,e){if(e.indexOf(t)!==-1)return"[Circular]";var r=[].concat(e,[t]),n=Em(t);if(n!==void 0){var i=n.call(t);if(i!==t)return typeof i=="string"?i:$o(i,r)}else if(Array.isArray(t))return xm(t,r);return Cm(t,r)}function Cm(t,e){var r=Object.keys(t);if(r.length===0)return"{}";if(e.length>Jp)return"["+km(t)+"]";var n=r.map(function(i){var a=$o(t[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function xm(t,e){if(t.length===0)return"[]";if(e.length>Jp)return"[Array]";for(var r=Math.min(wm,t.length),n=t.length-r,i=[],a=0;a<r;++a)i.push($o(t[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function Em(t){var e=t[String(ta)];if(typeof e=="function")return e;if(typeof t.inspect=="function")return t.inspect}function km(t){var e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof t.constructor=="function"){var r=t.constructor.name;if(typeof r=="string"&&r!=="")return r}return e}function na(t,e){var r=Boolean(t);if(!r)throw new Error(e)}function Yp(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Am(t,e,r){return e&&Yp(t.prototype,e),r&&Yp(t,r),t}var Lo=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GraphQL request",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{line:1,column:1};typeof e=="string"||na(0,"Body must be a string. Received: ".concat(ra(e),".")),this.body=e,this.name=r,this.locationOffset=n,this.locationOffset.line>0||na(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||na(0,"column in locationOffset is 1-indexed and must be positive.")}return Am(t,[{key:Wp,get:function(){return"Source"}}]),t}();function Xp(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=t.indexOf(`
|
|
4
4
|
`)===-1,i=t[0]===" "||t[0]===" ",a=t[t.length-1]==='"',o=t[t.length-1]==="\\",s=!n||a||o||r,u="";return s&&!(n&&i)&&(u+=`
|
|
5
5
|
`+e),u+=e?t.replace(/\n/g,`
|
|
6
6
|
`+e):t,s&&(u+=`
|
|
7
|
-
`),'"""'+u.replace(/"""/g,'\\"""')+'"""'}var
|
|
7
|
+
`),'"""'+u.replace(/"""/g,'\\"""')+'"""'}var Im={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},mn=Object.freeze({});function it(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Im,n=void 0,i=Array.isArray(t),a=[t],o=-1,s=[],u=void 0,c=void 0,l=void 0,d=[],f=[],p=t;do{o++;var h=o===a.length,g=h&&s.length!==0;if(h){if(c=f.length===0?void 0:d[d.length-1],u=l,l=f.pop(),g){if(i)u=u.slice();else{for(var b={},C=0,w=Object.keys(u);C<w.length;C++){var _=w[C];b[_]=u[_]}u=b}for(var y=0,T=0;T<s.length;T++){var R=s[T][0],k=s[T][1];i&&(R-=y),i&&k===null?(u.splice(R,1),y++):u[R]=k}}o=n.index,a=n.keys,s=n.edits,i=n.inArray,n=n.prev}else{if(c=l?i?o:a[o]:void 0,u=l?l[c]:p,u==null)continue;l&&d.push(c)}var P=void 0;if(!Array.isArray(u)){if(!Hc(u))throw new Error("Invalid AST Node: ".concat(ra(u),"."));var M=Gc(e,u.kind,h);if(M){if(P=M.call(e,u,c,l,d,f),P===mn)break;if(P===!1){if(!h){d.pop();continue}}else if(P!==void 0&&(s.push([c,P]),!h))if(Hc(P))u=P;else{d.pop();continue}}}if(P===void 0&&g&&s.push([c,u]),h)d.pop();else{var $;n={inArray:i,index:o,keys:a,edits:s,prev:n},i=Array.isArray(u),a=i?u:($=r[u.kind])!==null&&$!==void 0?$:[],o=-1,s=[],l&&f.push(l),l=u}}while(n!==void 0);return s.length!==0&&(p=s[s.length-1][1]),p}function Gc(t,e,r){var n=t[e];if(n){if(!r&&typeof n=="function")return n;var i=r?n.leave:n.enter;if(typeof i=="function")return i}else{var a=r?t.leave:t.enter;if(a){if(typeof a=="function")return a;var o=a[e];if(typeof o=="function")return o}}}function oi(t){return it(t,{leave:Om})}var Tm=80,Om={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return U(e.definitions,`
|
|
8
8
|
|
|
9
9
|
`)+`
|
|
10
|
-
`},OperationDefinition:function(e){var r=e.operation,n=e.name,i=
|
|
11
|
-
`,
|
|
10
|
+
`},OperationDefinition:function(e){var r=e.operation,n=e.name,i=Ie("(",U(e.variableDefinitions,", "),")"),a=U(e.directives," "),o=e.selectionSet;return!n&&!a&&!i&&r==="query"?o:U([r,U([n,i]),a,o]," ")},VariableDefinition:function(e){var r=e.variable,n=e.type,i=e.defaultValue,a=e.directives;return r+": "+n+Ie(" = ",i)+Ie(" ",U(a," "))},SelectionSet:function(e){var r=e.selections;return Qt(r)},Field:function(e){var r=e.alias,n=e.name,i=e.arguments,a=e.directives,o=e.selectionSet,s=Ie("",r,": ")+n,u=s+Ie("(",U(i,", "),")");return u.length>Tm&&(u=s+Ie(`(
|
|
11
|
+
`,Fo(U(i,`
|
|
12
12
|
`)),`
|
|
13
|
-
)`)),
|
|
14
|
-
`,
|
|
13
|
+
)`)),U([u,U(a," "),o]," ")},Argument:function(e){var r=e.name,n=e.value;return r+": "+n},FragmentSpread:function(e){var r=e.name,n=e.directives;return"..."+r+Ie(" ",U(n," "))},InlineFragment:function(e){var r=e.typeCondition,n=e.directives,i=e.selectionSet;return U(["...",Ie("on ",r),U(n," "),i]," ")},FragmentDefinition:function(e){var r=e.name,n=e.typeCondition,i=e.variableDefinitions,a=e.directives,o=e.selectionSet;return"fragment ".concat(r).concat(Ie("(",U(i,", "),")")," ")+"on ".concat(n," ").concat(Ie("",U(a," ")," "))+o},IntValue:function(e){var r=e.value;return r},FloatValue:function(e){var r=e.value;return r},StringValue:function(e,r){var n=e.value,i=e.block;return i?Xp(n,r==="description"?"":" "):JSON.stringify(n)},BooleanValue:function(e){var r=e.value;return r?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){var r=e.value;return r},ListValue:function(e){var r=e.values;return"["+U(r,", ")+"]"},ObjectValue:function(e){var r=e.fields;return"{"+U(r,", ")+"}"},ObjectField:function(e){var r=e.name,n=e.value;return r+": "+n},Directive:function(e){var r=e.name,n=e.arguments;return"@"+r+Ie("(",U(n,", "),")")},NamedType:function(e){var r=e.name;return r},ListType:function(e){var r=e.type;return"["+r+"]"},NonNullType:function(e){var r=e.type;return r+"!"},SchemaDefinition:Vt(function(t){var e=t.directives,r=t.operationTypes;return U(["schema",U(e," "),Qt(r)]," ")}),OperationTypeDefinition:function(e){var r=e.operation,n=e.type;return r+": "+n},ScalarTypeDefinition:Vt(function(t){var e=t.name,r=t.directives;return U(["scalar",e,U(r," ")]," ")}),ObjectTypeDefinition:Vt(function(t){var e=t.name,r=t.interfaces,n=t.directives,i=t.fields;return U(["type",e,Ie("implements ",U(r," & ")),U(n," "),Qt(i)]," ")}),FieldDefinition:Vt(function(t){var e=t.name,r=t.arguments,n=t.type,i=t.directives;return e+(ef(r)?Ie(`(
|
|
14
|
+
`,Fo(U(r,`
|
|
15
15
|
`)),`
|
|
16
|
-
)`):
|
|
17
|
-
`,
|
|
16
|
+
)`):Ie("(",U(r,", "),")"))+": "+n+Ie(" ",U(i," "))}),InputValueDefinition:Vt(function(t){var e=t.name,r=t.type,n=t.defaultValue,i=t.directives;return U([e+": "+r,Ie("= ",n),U(i," ")]," ")}),InterfaceTypeDefinition:Vt(function(t){var e=t.name,r=t.interfaces,n=t.directives,i=t.fields;return U(["interface",e,Ie("implements ",U(r," & ")),U(n," "),Qt(i)]," ")}),UnionTypeDefinition:Vt(function(t){var e=t.name,r=t.directives,n=t.types;return U(["union",e,U(r," "),n&&n.length!==0?"= "+U(n," | "):""]," ")}),EnumTypeDefinition:Vt(function(t){var e=t.name,r=t.directives,n=t.values;return U(["enum",e,U(r," "),Qt(n)]," ")}),EnumValueDefinition:Vt(function(t){var e=t.name,r=t.directives;return U([e,U(r," ")]," ")}),InputObjectTypeDefinition:Vt(function(t){var e=t.name,r=t.directives,n=t.fields;return U(["input",e,U(r," "),Qt(n)]," ")}),DirectiveDefinition:Vt(function(t){var e=t.name,r=t.arguments,n=t.repeatable,i=t.locations;return"directive @"+e+(ef(r)?Ie(`(
|
|
17
|
+
`,Fo(U(r,`
|
|
18
18
|
`)),`
|
|
19
|
-
)`):
|
|
20
|
-
`)}}function
|
|
21
|
-
`,
|
|
19
|
+
)`):Ie("(",U(r,", "),")"))+(n?" repeatable":"")+" on "+U(i," | ")}),SchemaExtension:function(e){var r=e.directives,n=e.operationTypes;return U(["extend schema",U(r," "),Qt(n)]," ")},ScalarTypeExtension:function(e){var r=e.name,n=e.directives;return U(["extend scalar",r,U(n," ")]," ")},ObjectTypeExtension:function(e){var r=e.name,n=e.interfaces,i=e.directives,a=e.fields;return U(["extend type",r,Ie("implements ",U(n," & ")),U(i," "),Qt(a)]," ")},InterfaceTypeExtension:function(e){var r=e.name,n=e.interfaces,i=e.directives,a=e.fields;return U(["extend interface",r,Ie("implements ",U(n," & ")),U(i," "),Qt(a)]," ")},UnionTypeExtension:function(e){var r=e.name,n=e.directives,i=e.types;return U(["extend union",r,U(n," "),i&&i.length!==0?"= "+U(i," | "):""]," ")},EnumTypeExtension:function(e){var r=e.name,n=e.directives,i=e.values;return U(["extend enum",r,U(n," "),Qt(i)]," ")},InputObjectTypeExtension:function(e){var r=e.name,n=e.directives,i=e.fields;return U(["extend input",r,U(n," "),Qt(i)]," ")}};function Vt(t){return function(e){return U([e.description,t(e)],`
|
|
20
|
+
`)}}function U(t){var e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(e=t?.filter(function(n){return n}).join(r))!==null&&e!==void 0?e:""}function Qt(t){return Ie(`{
|
|
21
|
+
`,Fo(U(t,`
|
|
22
22
|
`)),`
|
|
23
|
-
}`)}function
|
|
24
|
-
`))}function
|
|
25
|
-
`)!==-1}function ff(t){return t!=null&&t.some(Lm)}function Ri(t){return t.kind===Oe.FIELD||t.kind===Oe.FRAGMENT_SPREAD||t.kind===Oe.INLINE_FRAGMENT}function pf(){return typeof Xa=="function"?ac():ac()}function Qm(){__DEV__?I(typeof Wr=="boolean",Wr):I(typeof Wr=="boolean",39)}pf();Qm();function er(t,e){var r=t.directives;return!r||!r.length?!0:df(r).every(function(n){var i=n.directive,a=n.ifArgument,o=!1;return a.value.kind==="Variable"?(o=e&&e[a.value.name.value],__DEV__?I(o!==void 0,"Invalid variable referenced in @".concat(i.name.value," directive.")):I(o!==void 0,40)):o=a.value.value,i.name.value==="skip"?!o:o})}function Un(t,e,r){var n=new Set(t),i=n.size;return Ke(e,{Directive:function(a){if(n.delete(a.name.value)&&(!r||!n.size))return Kr}}),r?!n.size:n.size<i}function uc(t){return t&&Un(["client","export"],t,!0)}function Gm(t){var e=t.name.value;return e==="skip"||e==="include"}function df(t){var e=[];return t&&t.length&&t.forEach(function(r){if(!!Gm(r)){var n=r.arguments,i=r.name.value;__DEV__?I(n&&n.length===1,"Incorrect number of arguments for the @".concat(i," directive.")):I(n&&n.length===1,41);var a=n[0];__DEV__?I(a.name&&a.name.value==="if","Invalid argument for the @".concat(i," directive.")):I(a.name&&a.name.value==="if",42);var o=a.value;__DEV__?I(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),"Argument for the @".concat(i," directive must be a variable or a boolean value.")):I(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),43),e.push({directive:r,ifArgument:a})}}),e}function lc(t,e){var r=e,n=[];t.definitions.forEach(function(a){if(a.kind==="OperationDefinition")throw __DEV__?new V("Found a ".concat(a.operation," operation").concat(a.name?" named '".concat(a.name.value,"'"):"",". ")+"No operations are allowed when using a fragment as a query. Only fragments are allowed."):new V(44);a.kind==="FragmentDefinition"&&n.push(a)}),typeof r>"u"&&(__DEV__?I(n.length===1,"Found ".concat(n.length," fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")):I(n.length===1,45),r=n[0].name.value);var i=_(_({},t),{definitions:mr([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],t.definitions,!0)});return i}function Zr(t){t===void 0&&(t=[]);var e={};return t.forEach(function(r){e[r.name.value]=r}),e}function Yr(t,e){switch(t.kind){case"InlineFragment":return t;case"FragmentSpread":{var r=t.name.value;if(typeof e=="function")return e(r);var n=e&&e[r];return __DEV__?I(n,"No fragment named ".concat(r)):I(n,46),n||null}default:return null}}function ee(t){return t!==null&&typeof t=="object"}function Ut(t){return{__ref:String(t)}}function K(t){return Boolean(t&&typeof t=="object"&&typeof t.__ref=="string")}function fc(t){return ee(t)&&t.kind==="Document"&&Array.isArray(t.definitions)}function Hm(t){return t.kind==="StringValue"}function Wm(t){return t.kind==="BooleanValue"}function Km(t){return t.kind==="IntValue"}function Zm(t){return t.kind==="FloatValue"}function Ym(t){return t.kind==="Variable"}function Jm(t){return t.kind==="ObjectValue"}function Xm(t){return t.kind==="ListValue"}function e1(t){return t.kind==="EnumValue"}function t1(t){return t.kind==="NullValue"}function yr(t,e,r,n){if(Km(r)||Zm(r))t[e.value]=Number(r.value);else if(Wm(r)||Hm(r))t[e.value]=r.value;else if(Jm(r)){var i={};r.fields.map(function(o){return yr(i,o.name,o.value,n)}),t[e.value]=i}else if(Ym(r)){var a=(n||{})[r.name.value];t[e.value]=a}else if(Xm(r))t[e.value]=r.values.map(function(o){var s={};return yr(s,e,o,n),s[e.value]});else if(e1(r))t[e.value]=r.value;else if(t1(r))t[e.value]=null;else throw __DEV__?new V('The inline argument "'.concat(e.value,'" of kind "').concat(r.kind,'"')+"is not supported. Use variables instead of inline arguments to overcome this limitation."):new V(55)}function pc(t,e){var r=null;t.directives&&(r={},t.directives.forEach(function(i){r[i.name.value]={},i.arguments&&i.arguments.forEach(function(a){var o=a.name,s=a.value;return yr(r[i.name.value],o,s,e)})}));var n=null;return t.arguments&&t.arguments.length&&(n={},t.arguments.forEach(function(i){var a=i.name,o=i.value;return yr(n,a,o,e)})),Li(t.name.value,n,r)}var r1=["connection","include","skip","client","rest","export"],Li=Object.assign(function(t,e,r){if(e&&r&&r.connection&&r.connection.key)if(r.connection.filter&&r.connection.filter.length>0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i={};return n.forEach(function(s){i[s]=e[s]}),"".concat(r.connection.key,"(").concat(Pi(i),")")}else return r.connection.key;var a=t;if(e){var o=Pi(e);a+="(".concat(o,")")}return r&&Object.keys(r).forEach(function(s){r1.indexOf(s)===-1&&(r[s]&&Object.keys(r[s]).length?a+="@".concat(s,"(").concat(Pi(r[s]),")"):a+="@".concat(s))}),a},{setStringify:function(t){var e=Pi;return Pi=t,e}}),Pi=function(e){return JSON.stringify(e,n1)};function n1(t,e){return ee(e)&&!Array.isArray(e)&&(e=Object.keys(e).sort().reduce(function(r,n){return r[n]=e[n],r},{})),e}function tr(t,e){if(t.arguments&&t.arguments.length){var r={};return t.arguments.forEach(function(n){var i=n.name,a=n.value;return yr(r,i,a,e)}),r}return null}function _t(t){return t.alias?t.alias.value:t.name.value}function $i(t,e,r){if(typeof t.__typename=="string")return t.__typename;for(var n=0,i=e.selections;n<i.length;n++){var a=i[n];if(pt(a)){if(a.name.value==="__typename")return t[_t(a)]}else{var o=$i(t,Yr(a,r).selectionSet,r);if(typeof o=="string")return o}}}function pt(t){return t.kind==="Field"}function dc(t){return t.kind==="InlineFragment"}function qn(t){__DEV__?I(t&&t.kind==="Document",'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):I(t&&t.kind==="Document",47);var e=t.definitions.filter(function(r){return r.kind!=="FragmentDefinition"}).map(function(r){if(r.kind!=="OperationDefinition")throw __DEV__?new V('Schema type definitions not allowed in queries. Found: "'.concat(r.kind,'"')):new V(48);return r});return __DEV__?I(e.length<=1,"Ambiguous GraphQL document: contains ".concat(e.length," operations")):I(e.length<=1,49),t}function qt(t){return qn(t),t.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function Bn(t){return t.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function Jr(t){return t.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function Fi(t){var e=qt(t);return __DEV__?I(e&&e.operation==="query","Must contain a query definition."):I(e&&e.operation==="query",50),e}function hc(t){__DEV__?I(t.kind==="Document",'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):I(t.kind==="Document",51),__DEV__?I(t.definitions.length<=1,"Fragment must have exactly one definition."):I(t.definitions.length<=1,52);var e=t.definitions[0];return __DEV__?I(e.kind==="FragmentDefinition","Must be a fragment definition."):I(e.kind==="FragmentDefinition",53),e}function Xr(t){qn(t);for(var e,r=0,n=t.definitions;r<n.length;r++){var i=n[r];if(i.kind==="OperationDefinition"){var a=i.operation;if(a==="query"||a==="mutation"||a==="subscription")return i}i.kind==="FragmentDefinition"&&!e&&(e=i)}if(e)return e;throw __DEV__?new V("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new V(54)}function en(t){var e=Object.create(null),r=t&&t.variableDefinitions;return r&&r.length&&r.forEach(function(n){n.defaultValue&&yr(e,n.variable.name,n.defaultValue)}),e}var ue=Array.isArray;function Re(t){return Array.isArray(t)&&t.length>0}var hf={kind:Oe.FIELD,name:{kind:Oe.NAME,value:"__typename"}};function gf(t,e){return!t||t.selectionSet.selections.every(function(r){return r.kind===Oe.FRAGMENT_SPREAD&&gf(e[r.name.value],e)})}function i1(t){return gf(qt(t)||hc(t),Zr(Jr(t)))?null:t}function a1(t){var e=new Set,r=[];return t.forEach(function(n){n.name?e.add(n.name):n.test&&r.push(n.test)}),function(n){return e.has(n.name.value)||r.some(function(i){return i(n)})}}function mf(t){var e=new Map;return function(n){n===void 0&&(n=t);var i=e.get(n);return i||e.set(n,i={variables:new Set,fragmentSpreads:new Set}),i}}function mc(t,e){for(var r=mf(""),n=mf(""),i=function(b){for(var v=0,m=void 0;v<b.length&&(m=b[v]);++v)if(!ue(m)){if(m.kind===Oe.OPERATION_DEFINITION)return r(m.name&&m.name.value);if(m.kind===Oe.FRAGMENT_DEFINITION)return n(m.name.value)}return __DEV__&&I.error("Could not find operation or fragment"),null},a=0,o=e.definitions.length-1;o>=0;--o)e.definitions[o].kind===Oe.OPERATION_DEFINITION&&++a;var s=a1(t),u=t.some(function(b){return b.remove}),c=function(b){return u&&b&&b.some(s)},l=new Map,d=!1,p={enter:function(b){if(c(b.directives))return d=!0,null}},f=Ke(e,{Field:p,InlineFragment:p,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(b,v,m,A,D){var C=i(D);C&&C.variables.add(b.name.value)}},FragmentSpread:{enter:function(b,v,m,A,D){if(c(b.directives))return d=!0,null;var C=i(D);C&&C.fragmentSpreads.add(b.name.value)}},FragmentDefinition:{enter:function(b,v,m,A){l.set(JSON.stringify(A),b)},leave:function(b,v,m,A){var D=l.get(JSON.stringify(A));if(b===D)return b;if(a>0&&b.selectionSet.selections.every(function(C){return C.kind===Oe.FIELD&&C.name.value==="__typename"}))return n(b.name.value).removed=!0,d=!0,null}},Directive:{leave:function(b){if(s(b))return d=!0,null}}});if(!d)return e;var h=function(b){return b.transitiveVars||(b.transitiveVars=new Set(b.variables),b.removed||b.fragmentSpreads.forEach(function(v){h(n(v)).transitiveVars.forEach(function(m){b.transitiveVars.add(m)})})),b},g=new Set;f.definitions.forEach(function(b){b.kind===Oe.OPERATION_DEFINITION?h(r(b.name&&b.name.value)).fragmentSpreads.forEach(function(v){g.add(v)}):b.kind===Oe.FRAGMENT_DEFINITION&&a===0&&!n(b.name.value).removed&&g.add(b.name.value)}),g.forEach(function(b){h(n(b)).fragmentSpreads.forEach(function(v){g.add(v)})});var y=function(b){return!!(!g.has(b)||n(b).removed)},S={enter:function(b){if(y(b.name.value))return null}};return i1(Ke(f,{FragmentSpread:S,FragmentDefinition:S,OperationDefinition:{leave:function(b){if(b.variableDefinitions){var v=h(r(b.name&&b.name.value)).transitiveVars;if(v.size<b.variableDefinitions.length)return _(_({},b),{variableDefinitions:b.variableDefinitions.filter(function(m){return v.has(m.variable.name.value)})})}}}}))}var tn=Object.assign(function(t){return Ke(t,{SelectionSet:{enter:function(e,r,n){if(!(n&&n.kind===Oe.OPERATION_DEFINITION)){var i=e.selections;if(!!i){var a=i.some(function(s){return pt(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=n;if(!(pt(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return _(_({},e),{selections:mr(mr([],i,!0),[hf],!1)})}}}}}})},{added:function(t){return t===hf}}),o1={test:function(t){var e=t.name.value==="connection";return e&&(!t.arguments||!t.arguments.some(function(r){return r.name.value==="key"}))&&__DEV__&&I.warn("Removing an @connection directive even though it does not have a key. You may want to use the key parameter to specify a store key."),e}};function gc(t){return mc([o1],qn(t))}function yc(t){var e=Xr(t),r=e.operation;if(r==="query")return t;var n=Ke(t,{OperationDefinition:{enter:function(i){return _(_({},i),{operation:"query"})}}});return n}function vc(t){qn(t);var e=mc([{test:function(r){return r.name.value==="client"},remove:!0}],t);return e}var s1=Object.prototype.hasOwnProperty;function bc(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Mi(t)}function Mi(t){var e=t[0]||{},r=t.length;if(r>1)for(var n=new it,i=1;i<r;++i)e=n.merge(e,t[i]);return e}var c1=function(t,e,r){return this.merge(t[r],e[r])},it=function(){function t(e){e===void 0&&(e=c1),this.reconciler=e,this.isObject=ee,this.pastCopies=new Set}return t.prototype.merge=function(e,r){for(var n=this,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];return ee(r)&&ee(e)?(Object.keys(r).forEach(function(o){if(s1.call(e,o)){var s=e[o];if(r[o]!==s){var u=n.reconciler.apply(n,mr([e,r,o],i,!1));u!==s&&(e=n.shallowCopyForMerge(e),e[o]=u)}}else e=n.shallowCopyForMerge(e),e[o]=r[o]}),e):r},t.prototype.shallowCopyForMerge=function(e){return ee(e)&&(this.pastCopies.has(e)||(Array.isArray(e)?e=e.slice(0):e=_({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},t}();function u1(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=l1(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
26
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function l1(t,e){if(!!t){if(typeof t=="string")return yf(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yf(t,e)}}function yf(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function vf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ec(t,e,r){return e&&vf(t.prototype,e),r&&vf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var Cc=function(){return typeof Symbol=="function"},xc=function(t){return Cc()&&Boolean(Symbol[t])},kc=function(t){return xc(t)?Symbol[t]:"@@"+t};Cc()&&!xc("observable")&&(Symbol.observable=Symbol("observable"));var f1=kc("iterator"),wc=kc("observable"),bf=kc("species");function ro(t,e){var r=t[e];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function ji(t){var e=t.constructor;return e!==void 0&&(e=e[bf],e===null&&(e=void 0)),e!==void 0?e:H}function p1(t){return t instanceof H}function Vn(t){Vn.log?Vn.log(t):setTimeout(function(){throw t})}function to(t){Promise.resolve().then(function(){try{t()}catch(e){Vn(e)}})}function _f(t){var e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var r=ro(e,"unsubscribe");r&&r.call(e)}}catch(n){Vn(n)}}function Sc(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function d1(t){var e=t._queue;if(!!e){t._queue=void 0,t._state="ready";for(var r=0;r<e.length&&(wf(t,e[r].type,e[r].value),t._state!=="closed");++r);}}function wf(t,e,r){t._state="running";var n=t._observer;try{var i=ro(n,e);switch(e){case"next":i&&i.call(n,r);break;case"error":if(Sc(t),i)i.call(n,r);else throw r;break;case"complete":Sc(t),i&&i.call(n);break}}catch(a){Vn(a)}t._state==="closed"?_f(t):t._state==="running"&&(t._state="ready")}function _c(t,e,r){if(t._state!=="closed"){if(t._state==="buffering"){t._queue.push({type:e,value:r});return}if(t._state!=="ready"){t._state="buffering",t._queue=[{type:e,value:r}],to(function(){return d1(t)});return}wf(t,e,r)}}var h1=function(){function t(r,n){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var i=new m1(this);try{this._cleanup=n.call(void 0,i)}catch(a){i.error(a)}this._state==="initializing"&&(this._state="ready")}var e=t.prototype;return e.unsubscribe=function(){this._state!=="closed"&&(Sc(this),_f(this))},Ec(t,[{key:"closed",get:function(){return this._state==="closed"}}]),t}(),m1=function(){function t(r){this._subscription=r}var e=t.prototype;return e.next=function(n){_c(this._subscription,"next",n)},e.error=function(n){_c(this._subscription,"error",n)},e.complete=function(){_c(this._subscription,"complete")},Ec(t,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),t}(),H=function(){function t(r){if(!(this instanceof t))throw new TypeError("Observable cannot be called as a function");if(typeof r!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=r}var e=t.prototype;return e.subscribe=function(n){return(typeof n!="object"||n===null)&&(n={next:n,error:arguments[1],complete:arguments[2]}),new h1(n,this._subscriber)},e.forEach=function(n){var i=this;return new Promise(function(a,o){if(typeof n!="function"){o(new TypeError(n+" is not a function"));return}function s(){u.unsubscribe(),a()}var u=i.subscribe({next:function(c){try{n(c,s)}catch(l){o(l),u.unsubscribe()}},error:o,complete:a})})},e.map=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=ji(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=ji(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=ji(this),o=arguments.length>1,s=!1,u=arguments[1],c=u;return new a(function(l){return i.subscribe({next:function(d){var p=!s;if(s=!0,!p||o)try{c=n(c,d)}catch(f){return l.error(f)}else c=d},error:function(d){l.error(d)},complete:function(){if(!s&&!o)return l.error(new TypeError("Cannot reduce an empty sequence"));l.next(c),l.complete()}})})},e.concat=function(){for(var n=this,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];var s=ji(this);return new s(function(u){var c,l=0;function d(p){c=p.subscribe({next:function(f){u.next(f)},error:function(f){u.error(f)},complete:function(){l===a.length?(c=void 0,u.complete()):d(s.from(a[l++]))}})}return d(n),function(){c&&(c.unsubscribe(),c=void 0)}})},e.flatMap=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=ji(this);return new a(function(o){var s=[],u=i.subscribe({next:function(l){if(n)try{l=n(l)}catch(p){return o.error(p)}var d=a.from(l).subscribe({next:function(p){o.next(p)},error:function(p){o.error(p)},complete:function(){var p=s.indexOf(d);p>=0&&s.splice(p,1),c()}});s.push(d)},error:function(l){o.error(l)},complete:function(){c()}});function c(){u.closed&&s.length===0&&o.complete()}return function(){s.forEach(function(l){return l.unsubscribe()}),u.unsubscribe()}})},e[wc]=function(){return this},t.from=function(n){var i=typeof this=="function"?this:t;if(n==null)throw new TypeError(n+" is not an object");var a=ro(n,wc);if(a){var o=a.call(n);if(Object(o)!==o)throw new TypeError(o+" is not an object");return p1(o)&&o.constructor===i?o:new i(function(s){return o.subscribe(s)})}if(xc("iterator")&&(a=ro(n,f1),a))return new i(function(s){to(function(){if(!s.closed){for(var u=u1(a.call(n)),c;!(c=u()).done;){var l=c.value;if(s.next(l),s.closed)return}s.complete()}})});if(Array.isArray(n))return new i(function(s){to(function(){if(!s.closed){for(var u=0;u<n.length;++u)if(s.next(n[u]),s.closed)return;s.complete()}})});throw new TypeError(n+" is not observable")},t.of=function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];var o=typeof this=="function"?this:t;return new o(function(s){to(function(){if(!s.closed){for(var u=0;u<i.length;++u)if(s.next(i[u]),s.closed)return;s.complete()}})})},Ec(t,null,[{key:bf,get:function(){return this}}]),t}();Cc()&&Object.defineProperty(H,Symbol("extensions"),{value:{symbol:wc,hostReportError:Vn},configurable:!0});function Tc(t){var e,r=t.Symbol;if(typeof r=="function")if(r.observable)e=r.observable;else{typeof r.for=="function"?e=r.for("https://github.com/benlesh/symbol-observable"):e=r("https://github.com/benlesh/symbol-observable");try{r.observable=e}catch{}}else e="@@observable";return e}var zn;typeof self<"u"?zn=self:typeof window<"u"?zn=window:typeof global<"u"?zn=global:typeof module<"u"?zn=module:zn=Function("return this")();var y_=Tc(zn);var Sf=H.prototype,Ef="@@observable";Sf[Ef]||(Sf[Ef]=function(){return this});var g1=Object.prototype.toString;function no(t){return Ac(t)}function Ac(t,e){switch(g1.call(t)){case"[object Array]":{if(e=e||new Map,e.has(t))return e.get(t);var r=t.slice(0);return e.set(t,r),r.forEach(function(i,a){r[a]=Ac(i,e)}),r}case"[object Object]":{if(e=e||new Map,e.has(t))return e.get(t);var n=Object.create(Object.getPrototypeOf(t));return e.set(t,n),Object.keys(t).forEach(function(i){n[i]=Ac(t[i],e)}),n}default:return t}}function y1(t){var e=new Set([t]);return e.forEach(function(r){ee(r)&&v1(r)===r&&Object.getOwnPropertyNames(r).forEach(function(n){ee(r[n])&&e.add(r[n])})}),t}function v1(t){if(__DEV__&&!Object.isFrozen(t))try{Object.freeze(t)}catch(e){if(e instanceof TypeError)return null;throw e}return t}function Ui(t){return __DEV__&&y1(t),t}function rn(t,e,r){var n=[];t.forEach(function(i){return i[e]&&n.push(i)}),n.forEach(function(i){return i[e](r)})}function io(t,e,r){return new H(function(n){var i=n.next,a=n.error,o=n.complete,s=0,u=!1,c={then:function(f){return new Promise(function(h){return h(f())})}};function l(f,h){return f?function(g){++s;var y=function(){return f(g)};c=c.then(y,y).then(function(S){--s,i&&i.call(n,S),u&&d.complete()},function(S){throw--s,S}).catch(function(S){a&&a.call(n,S)})}:function(g){return h&&h.call(n,g)}}var d={next:l(e,i),error:l(r,a),complete:function(){u=!0,s||o&&o.call(n)}},p=t.subscribe(d);return function(){return p.unsubscribe()}})}var wt=typeof WeakMap=="function"&&Me(function(){return navigator.product})!=="ReactNative",Cf=typeof WeakSet=="function",Ic=typeof Symbol=="function"&&typeof Symbol.for=="function",vr=Ic&&Symbol.asyncIterator,O_=typeof Me(function(){return window.document.createElement})=="function",D_=Me(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1;function ao(t){function e(r){Object.defineProperty(t,r,{value:H})}return Ic&&Symbol.species&&e(Symbol.species),e("@@species"),t}function xf(t){return t&&typeof t.then=="function"}var Qn=function(t){xe(e,t);function e(r){var n=t.call(this,function(i){return n.addObserver(i),function(){return n.removeObserver(i)}})||this;return n.observers=new Set,n.promise=new Promise(function(i,a){n.resolve=i,n.reject=a}),n.handlers={next:function(i){n.sub!==null&&(n.latest=["next",i],n.notify("next",i),rn(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),rn(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?xf(u)?u.then(function(c){return n.sub=c.subscribe(n.handlers)}):n.sub=u.subscribe(n.handlers):(a&&setTimeout(function(){return a.unsubscribe()}),n.sub=null,n.latest&&n.latest[0]==="next"?n.resolve(n.latest[1]):n.resolve(),n.notify("complete"),rn(n.observers,"complete"))}}},n.nextResultListeners=new Set,n.cancel=function(i){n.reject(i),n.sources=[],n.handlers.complete()},n.promise.catch(function(i){}),typeof r=="function"&&(r=[new H(r)]),xf(r)?r.then(function(i){return n.start(i)},n.handlers.error):n.start(r),n}return e.prototype.start=function(r){this.sub===void 0&&(this.sources=Array.from(r),this.handlers.complete())},e.prototype.deliverLastMessage=function(r){if(this.latest){var n=this.latest[0],i=r[n];i&&i.call(r,this.latest[1]),this.sub===null&&n==="next"&&r.complete&&r.complete()}},e.prototype.addObserver=function(r){this.observers.has(r)||(this.deliverLastMessage(r),this.observers.add(r))},e.prototype.removeObserver=function(r){this.observers.delete(r)&&this.observers.size<1&&this.handlers.complete()},e.prototype.notify=function(r,n){var i=this.nextResultListeners;i.size&&(this.nextResultListeners=new Set,i.forEach(function(a){return a(r,n)}))},e.prototype.beforeNext=function(r){var n=!1;this.nextResultListeners.add(function(i,a){n||(n=!0,r(i,a))})},e}(H);ao(Qn);function br(t){return"incremental"in t}function b1(t){return"hasNext"in t&&"data"in t}function kf(t){return br(t)||b1(t)}function oo(t,e){var r=t,n=new it;return br(e)&&Re(e.incremental)&&e.incremental.forEach(function(i){for(var a=i.data,o=i.path,s=o.length-1;s>=0;--s){var u=o[s],c=!isNaN(+u),l=c?[]:{};l[u]=a,a=l}r=n.merge(r,a)}),r}function Gn(t){var e=so(t);return Re(e)}function so(t){var e=Re(t.errors)?t.errors.slice(0):[];return br(t)&&Re(t.incremental)&&t.incremental.forEach(function(r){r.errors&&e.push.apply(e,r.errors)}),e}function _r(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Object.create(null);return t.forEach(function(n){!n||Object.keys(n).forEach(function(i){var a=n[i];a!==void 0&&(r[i]=a)})}),r}var Tf=new Map;function qi(t){var e=Tf.get(t)||1;return Tf.set(t,e+1),"".concat(t,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function Af(t){var e=qi("stringifyForDisplay");return JSON.stringify(t,function(r,n){return n===void 0?e:n}).split(JSON.stringify(e)).join("<undefined>")}function Bi(t,e){return _r(t,e,e.variables&&{variables:_(_({},t&&t.variables),e.variables)})}function co(t){return new H(function(e){e.error(t)})}var Vi=function(t,e,r){var n=new Error(r);throw n.name="ServerError",n.response=t,n.statusCode=t.status,n.result=e,n};function Oc(t){for(var e=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(t);r<n.length;r++){var i=n[r];if(e.indexOf(i)<0)throw __DEV__?new V("illegal argument: ".concat(i)):new V(27)}return t}function Dc(t,e){var r=_({},t),n=function(a){typeof a=="function"?r=_(_({},r),a(r)):r=_(_({},r),a)},i=function(){return _({},r)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:n}),Object.defineProperty(e,"getContext",{enumerable:!1,value:i}),e}function Nc(t){var e={variables:t.variables||{},extensions:t.extensions||{},operationName:t.operationName,query:t.query};return e.operationName||(e.operationName=typeof e.query!="string"?Bn(e.query)||void 0:""),e}function If(t,e){return e?e(t):H.of()}function zi(t){return typeof t=="function"?new St(t):t}function uo(t){return t.request.length<=1}var _1=function(t){xe(e,t);function e(r,n){var i=t.call(this,r)||this;return i.link=n,i}return e}(Error),St=function(){function t(e){e&&(this.request=e)}return t.empty=function(){return new t(function(){return H.of()})},t.from=function(e){return e.length===0?t.empty():e.map(zi).reduce(function(r,n){return r.concat(n)})},t.split=function(e,r,n){var i=zi(r),a=zi(n||new t(If));return uo(i)&&uo(a)?new t(function(o){return e(o)?i.request(o)||H.of():a.request(o)||H.of()}):new t(function(o,s){return e(o)?i.request(o,s)||H.of():a.request(o,s)||H.of()})},t.execute=function(e,r){return e.request(Dc(r.context,Nc(Oc(r))))||H.of()},t.concat=function(e,r){var n=zi(e);if(uo(n))return __DEV__&&I.warn(new _1("You are calling concat on a terminating link, which will have no effect",n)),n;var i=zi(r);return uo(i)?new t(function(a){return n.request(a,function(o){return i.request(o)||H.of()})||H.of()}):new t(function(a,o){return n.request(a,function(s){return i.request(s,o)||H.of()})||H.of()})},t.prototype.split=function(e,r,n){return this.concat(t.split(e,r,n||new t(If)))},t.prototype.concat=function(e){return t.concat(this,e)},t.prototype.request=function(e,r){throw __DEV__?new V("request is not implemented"):new V(22)},t.prototype.onError=function(e,r){if(r&&r.error)return r.error(e),!1;throw e},t.prototype.setOnError=function(e){return this.onError=e,this},t}();var Hn=St.execute;var Of="3.7.10";function Df(t){return!!t.body}function Nf(t){return!!t.getReader}function Rf(t){return!!(vr&&t[Symbol.asyncIterator])}function Pf(t){return!!t.stream}function Lf(t){return!!t.arrayBuffer}function $f(t){return!!t.pipe}function Rc(t){var e,r=t[Symbol.asyncIterator]();return e={next:function(){return r.next()}},e[Symbol.asyncIterator]=function(){return this},e}function Pc(t){var e=null,r=null,n=!1,i=[],a=[];function o(d){if(!r){if(a.length){var p=a.shift();if(Array.isArray(p)&&p[0])return p[0]({value:d,done:!1})}i.push(d)}}function s(d){r=d;var p=a.slice();p.forEach(function(f){f[1](d)}),!e||e()}function u(){n=!0;var d=a.slice();d.forEach(function(p){p[0]({value:void 0,done:!0})}),!e||e()}e=function(){e=null,t.removeListener("data",o),t.removeListener("error",s),t.removeListener("end",u),t.removeListener("finish",u),t.removeListener("close",u)},t.on("data",o),t.on("error",s),t.on("end",u),t.on("finish",u),t.on("close",u);function c(){return new Promise(function(d,p){if(r)return p(r);if(i.length)return d({value:i.shift(),done:!1});if(n)return d({value:void 0,done:!0});a.push([d,p])})}var l={next:function(){return c()}};return vr&&(l[Symbol.asyncIterator]=function(){return this}),l}function Lc(t){var e=!1,r={next:function(){return e?Promise.resolve({value:void 0,done:!0}):(e=!0,new Promise(function(n,i){t.then(function(a){n({value:a,done:!1})}).catch(i)}))}};return vr&&(r[Symbol.asyncIterator]=function(){return this}),r}function lo(t){var e={next:function(){return t.read()}};return vr&&(e[Symbol.asyncIterator]=function(){return this}),e}function Ff(t){var e=t;if(Df(t)&&(e=t.body),Rf(e))return Rc(e);if(Nf(e))return lo(e.getReader());if(Pf(e))return lo(e.stream().getReader());if(Lf(e))return Lc(e.arrayBuffer());if($f(e))return Pc(e);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var Mf=Object.prototype.hasOwnProperty;function jf(t,e){var r,n,i;return Tt(this,void 0,void 0,function(){var a,o,s,u,c,l,d,p,f,h,g,y,S,b,v,m,A,D,C,O;return At(this,function(P){switch(P.label){case 0:if(TextDecoder===void 0)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");a=new TextDecoder("utf-8"),o=(r=t.headers)===null||r===void 0?void 0:r.get("content-type"),s="boundary=",u=o?.includes(s)?o?.substring(o?.indexOf(s)+s.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",c="--".concat(u),l="",d=Ff(t),p=!0,P.label=1;case 1:return p?[4,d.next()]:[3,3];case 2:for(f=P.sent(),h=f.value,g=f.done,y=typeof h=="string"?h:a.decode(h),p=!g,l+=y,S=l.indexOf(c);S>-1;){if(b=void 0,O=[l.slice(0,S),l.slice(S+c.length)],b=O[0],l=O[1],b.trim()){if(v=b.indexOf(`\r
|
|
23
|
+
}`)}function Ie(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return e!=null&&e!==""?t+e+r:""}function Fo(t){return Ie(" ",t.replace(/\n/g,`
|
|
24
|
+
`))}function Dm(t){return t.indexOf(`
|
|
25
|
+
`)!==-1}function ef(t){return t!=null&&t.some(Dm)}function ia(t){return t.kind===Le.FIELD||t.kind===Le.FRAGMENT_SPREAD||t.kind===Le.INLINE_FRAGMENT}function tf(){return typeof Lo=="function"?Qc():Qc()}function Bm(){__DEV__?N(typeof hn=="boolean",hn):N(typeof hn=="boolean",39)}tf();Bm();function dr(t,e){var r=t.directives;return!r||!r.length?!0:rf(r).every(function(n){var i=n.directive,a=n.ifArgument,o=!1;return a.value.kind==="Variable"?(o=e&&e[a.value.name.value],__DEV__?N(o!==void 0,"Invalid variable referenced in @".concat(i.name.value," directive.")):N(o!==void 0,40)):o=a.value.value,i.name.value==="skip"?!o:o})}function si(t,e,r){var n=new Set(t),i=n.size;return it(e,{Directive:function(a){if(n.delete(a.name.value)&&(!r||!n.size))return mn}}),r?!n.size:n.size<i}function Wc(t){return t&&si(["client","export"],t,!0)}function qm(t){var e=t.name.value;return e==="skip"||e==="include"}function rf(t){var e=[];return t&&t.length&&t.forEach(function(r){if(!!qm(r)){var n=r.arguments,i=r.name.value;__DEV__?N(n&&n.length===1,"Incorrect number of arguments for the @".concat(i," directive.")):N(n&&n.length===1,41);var a=n[0];__DEV__?N(a.name&&a.name.value==="if","Invalid argument for the @".concat(i," directive.")):N(a.name&&a.name.value==="if",42);var o=a.value;__DEV__?N(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),"Argument for the @".concat(i," directive must be a variable or a boolean value.")):N(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),43),e.push({directive:r,ifArgument:a})}}),e}function Kc(t,e){var r=e,n=[];t.definitions.forEach(function(a){if(a.kind==="OperationDefinition")throw __DEV__?new H("Found a ".concat(a.operation," operation").concat(a.name?" named '".concat(a.name.value,"'"):"",". ")+"No operations are allowed when using a fragment as a query. Only fragments are allowed."):new H(44);a.kind==="FragmentDefinition"&&n.push(a)}),typeof r>"u"&&(__DEV__?N(n.length===1,"Found ".concat(n.length," fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")):N(n.length===1,45),r=n[0].name.value);var i=S(S({},t),{definitions:Dr([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],t.definitions,!0)});return i}function gn(t){t===void 0&&(t=[]);var e={};return t.forEach(function(r){e[r.name.value]=r}),e}function yn(t,e){switch(t.kind){case"InlineFragment":return t;case"FragmentSpread":{var r=t.name.value;if(typeof e=="function")return e(r);var n=e&&e[r];return __DEV__?N(n,"No fragment named ".concat(r)):N(n,46),n||null}default:return null}}function ue(t){return t!==null&&typeof t=="object"}function Yt(t){return{__ref:String(t)}}function ie(t){return Boolean(t&&typeof t=="object"&&typeof t.__ref=="string")}function Zc(t){return ue(t)&&t.kind==="Document"&&Array.isArray(t.definitions)}function Vm(t){return t.kind==="StringValue"}function Qm(t){return t.kind==="BooleanValue"}function zm(t){return t.kind==="IntValue"}function Hm(t){return t.kind==="FloatValue"}function Gm(t){return t.kind==="Variable"}function Wm(t){return t.kind==="ObjectValue"}function Km(t){return t.kind==="ListValue"}function Zm(t){return t.kind==="EnumValue"}function Jm(t){return t.kind==="NullValue"}function Pr(t,e,r,n){if(zm(r)||Hm(r))t[e.value]=Number(r.value);else if(Qm(r)||Vm(r))t[e.value]=r.value;else if(Wm(r)){var i={};r.fields.map(function(o){return Pr(i,o.name,o.value,n)}),t[e.value]=i}else if(Gm(r)){var a=(n||{})[r.name.value];t[e.value]=a}else if(Km(r))t[e.value]=r.values.map(function(o){var s={};return Pr(s,e,o,n),s[e.value]});else if(Zm(r))t[e.value]=r.value;else if(Jm(r))t[e.value]=null;else throw __DEV__?new H('The inline argument "'.concat(e.value,'" of kind "').concat(r.kind,'"')+"is not supported. Use variables instead of inline arguments to overcome this limitation."):new H(55)}function Jc(t,e){var r=null;t.directives&&(r={},t.directives.forEach(function(i){r[i.name.value]={},i.arguments&&i.arguments.forEach(function(a){var o=a.name,s=a.value;return Pr(r[i.name.value],o,s,e)})}));var n=null;return t.arguments&&t.arguments.length&&(n={},t.arguments.forEach(function(i){var a=i.name,o=i.value;return Pr(n,a,o,e)})),oa(t.name.value,n,r)}var Ym=["connection","include","skip","client","rest","export"],oa=Object.assign(function(t,e,r){if(e&&r&&r.connection&&r.connection.key)if(r.connection.filter&&r.connection.filter.length>0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i={};return n.forEach(function(s){i[s]=e[s]}),"".concat(r.connection.key,"(").concat(aa(i),")")}else return r.connection.key;var a=t;if(e){var o=aa(e);a+="(".concat(o,")")}return r&&Object.keys(r).forEach(function(s){Ym.indexOf(s)===-1&&(r[s]&&Object.keys(r[s]).length?a+="@".concat(s,"(").concat(aa(r[s]),")"):a+="@".concat(s))}),a},{setStringify:function(t){var e=aa;return aa=t,e}}),aa=function(e){return JSON.stringify(e,Xm)};function Xm(t,e){return ue(e)&&!Array.isArray(e)&&(e=Object.keys(e).sort().reduce(function(r,n){return r[n]=e[n],r},{})),e}function hr(t,e){if(t.arguments&&t.arguments.length){var r={};return t.arguments.forEach(function(n){var i=n.name,a=n.value;return Pr(r,i,a,e)}),r}return null}function Pt(t){return t.alias?t.alias.value:t.name.value}function sa(t,e,r){if(typeof t.__typename=="string")return t.__typename;for(var n=0,i=e.selections;n<i.length;n++){var a=i[n];if(Ct(a)){if(a.name.value==="__typename")return t[Pt(a)]}else{var o=sa(t,yn(a,r).selectionSet,r);if(typeof o=="string")return o}}}function Ct(t){return t.kind==="Field"}function Yc(t){return t.kind==="InlineFragment"}function ci(t){__DEV__?N(t&&t.kind==="Document",'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):N(t&&t.kind==="Document",47);var e=t.definitions.filter(function(r){return r.kind!=="FragmentDefinition"}).map(function(r){if(r.kind!=="OperationDefinition")throw __DEV__?new H('Schema type definitions not allowed in queries. Found: "'.concat(r.kind,'"')):new H(48);return r});return __DEV__?N(e.length<=1,"Ambiguous GraphQL document: contains ".concat(e.length," operations")):N(e.length<=1,49),t}function Xt(t){return ci(t),t.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function ui(t){return t.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function vn(t){return t.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function ca(t){var e=Xt(t);return __DEV__?N(e&&e.operation==="query","Must contain a query definition."):N(e&&e.operation==="query",50),e}function Xc(t){__DEV__?N(t.kind==="Document",'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):N(t.kind==="Document",51),__DEV__?N(t.definitions.length<=1,"Fragment must have exactly one definition."):N(t.definitions.length<=1,52);var e=t.definitions[0];return __DEV__?N(e.kind==="FragmentDefinition","Must be a fragment definition."):N(e.kind==="FragmentDefinition",53),e}function bn(t){ci(t);for(var e,r=0,n=t.definitions;r<n.length;r++){var i=n[r];if(i.kind==="OperationDefinition"){var a=i.operation;if(a==="query"||a==="mutation"||a==="subscription")return i}i.kind==="FragmentDefinition"&&!e&&(e=i)}if(e)return e;throw __DEV__?new H("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new H(54)}function _n(t){var e=Object.create(null),r=t&&t.variableDefinitions;return r&&r.length&&r.forEach(function(n){n.defaultValue&&Pr(e,n.variable.name,n.defaultValue)}),e}var ye=Array.isArray;function Be(t){return Array.isArray(t)&&t.length>0}var nf={kind:Le.FIELD,name:{kind:Le.NAME,value:"__typename"}};function of(t,e){return!t||t.selectionSet.selections.every(function(r){return r.kind===Le.FRAGMENT_SPREAD&&of(e[r.name.value],e)})}function eg(t){return of(Xt(t)||Xc(t),gn(vn(t)))?null:t}function tg(t){var e=new Set,r=[];return t.forEach(function(n){n.name?e.add(n.name):n.test&&r.push(n.test)}),function(n){return e.has(n.name.value)||r.some(function(i){return i(n)})}}function af(t){var e=new Map;return function(n){n===void 0&&(n=t);var i=e.get(n);return i||e.set(n,i={variables:new Set,fragmentSpreads:new Set}),i}}function eu(t,e){for(var r=af(""),n=af(""),i=function(w){for(var _=0,y=void 0;_<w.length&&(y=w[_]);++_)if(!ye(y)){if(y.kind===Le.OPERATION_DEFINITION)return r(y.name&&y.name.value);if(y.kind===Le.FRAGMENT_DEFINITION)return n(y.name.value)}return __DEV__&&N.error("Could not find operation or fragment"),null},a=0,o=e.definitions.length-1;o>=0;--o)e.definitions[o].kind===Le.OPERATION_DEFINITION&&++a;var s=tg(t),u=t.some(function(w){return w.remove}),c=function(w){return u&&w&&w.some(s)},l=new Map,d=!1,f={enter:function(w){if(c(w.directives))return d=!0,null}},p=it(e,{Field:f,InlineFragment:f,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(w,_,y,T,R){var k=i(R);k&&k.variables.add(w.name.value)}},FragmentSpread:{enter:function(w,_,y,T,R){if(c(w.directives))return d=!0,null;var k=i(R);k&&k.fragmentSpreads.add(w.name.value)}},FragmentDefinition:{enter:function(w,_,y,T){l.set(JSON.stringify(T),w)},leave:function(w,_,y,T){var R=l.get(JSON.stringify(T));if(w===R)return w;if(a>0&&w.selectionSet.selections.every(function(k){return k.kind===Le.FIELD&&k.name.value==="__typename"}))return n(w.name.value).removed=!0,d=!0,null}},Directive:{leave:function(w){if(s(w))return d=!0,null}}});if(!d)return e;var h=function(w){return w.transitiveVars||(w.transitiveVars=new Set(w.variables),w.removed||w.fragmentSpreads.forEach(function(_){h(n(_)).transitiveVars.forEach(function(y){w.transitiveVars.add(y)})})),w},g=new Set;p.definitions.forEach(function(w){w.kind===Le.OPERATION_DEFINITION?h(r(w.name&&w.name.value)).fragmentSpreads.forEach(function(_){g.add(_)}):w.kind===Le.FRAGMENT_DEFINITION&&a===0&&!n(w.name.value).removed&&g.add(w.name.value)}),g.forEach(function(w){h(n(w)).fragmentSpreads.forEach(function(_){g.add(_)})});var b=function(w){return!!(!g.has(w)||n(w).removed)},C={enter:function(w){if(b(w.name.value))return null}};return eg(it(p,{FragmentSpread:C,FragmentDefinition:C,OperationDefinition:{leave:function(w){if(w.variableDefinitions){var _=h(r(w.name&&w.name.value)).transitiveVars;if(_.size<w.variableDefinitions.length)return S(S({},w),{variableDefinitions:w.variableDefinitions.filter(function(y){return _.has(y.variable.name.value)})})}}}}))}var wn=Object.assign(function(t){return it(t,{SelectionSet:{enter:function(e,r,n){if(!(n&&n.kind===Le.OPERATION_DEFINITION)){var i=e.selections;if(!!i){var a=i.some(function(s){return Ct(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=n;if(!(Ct(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return S(S({},e),{selections:Dr(Dr([],i,!0),[nf],!1)})}}}}}})},{added:function(t){return t===nf}}),rg={test:function(t){var e=t.name.value==="connection";return e&&(!t.arguments||!t.arguments.some(function(r){return r.name.value==="key"}))&&__DEV__&&N.warn("Removing an @connection directive even though it does not have a key. You may want to use the key parameter to specify a store key."),e}};function tu(t){return eu([rg],ci(t))}function ru(t){var e=bn(t),r=e.operation;if(r==="query")return t;var n=it(t,{OperationDefinition:{enter:function(i){return S(S({},i),{operation:"query"})}}});return n}function nu(t){ci(t);var e=eu([{test:function(r){return r.name.value==="client"},remove:!0}],t);return e}var ng=Object.prototype.hasOwnProperty;function iu(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ua(t)}function ua(t){var e=t[0]||{},r=t.length;if(r>1)for(var n=new mt,i=1;i<r;++i)e=n.merge(e,t[i]);return e}var ig=function(t,e,r){return this.merge(t[r],e[r])},mt=function(){function t(e){e===void 0&&(e=ig),this.reconciler=e,this.isObject=ue,this.pastCopies=new Set}return t.prototype.merge=function(e,r){for(var n=this,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];return ue(r)&&ue(e)?(Object.keys(r).forEach(function(o){if(ng.call(e,o)){var s=e[o];if(r[o]!==s){var u=n.reconciler.apply(n,Dr([e,r,o],i,!1));u!==s&&(e=n.shallowCopyForMerge(e),e[o]=u)}}else e=n.shallowCopyForMerge(e),e[o]=r[o]}),e):r},t.prototype.shallowCopyForMerge=function(e){return ue(e)&&(this.pastCopies.has(e)||(Array.isArray(e)?e=e.slice(0):e=S({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},t}();function ag(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=og(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
26
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function og(t,e){if(!!t){if(typeof t=="string")return sf(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return sf(t,e)}}function sf(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function cf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function cu(t,e,r){return e&&cf(t.prototype,e),r&&cf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var uu=function(){return typeof Symbol=="function"},lu=function(t){return uu()&&Boolean(Symbol[t])},pu=function(t){return lu(t)?Symbol[t]:"@@"+t};uu()&&!lu("observable")&&(Symbol.observable=Symbol("observable"));var sg=pu("iterator"),ou=pu("observable"),uf=pu("species");function Uo(t,e){var r=t[e];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function la(t){var e=t.constructor;return e!==void 0&&(e=e[uf],e===null&&(e=void 0)),e!==void 0?e:ne}function cg(t){return t instanceof ne}function li(t){li.log?li.log(t):setTimeout(function(){throw t})}function Mo(t){Promise.resolve().then(function(){try{t()}catch(e){li(e)}})}function lf(t){var e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var r=Uo(e,"unsubscribe");r&&r.call(e)}}catch(n){li(n)}}function su(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function ug(t){var e=t._queue;if(!!e){t._queue=void 0,t._state="ready";for(var r=0;r<e.length&&(pf(t,e[r].type,e[r].value),t._state!=="closed");++r);}}function pf(t,e,r){t._state="running";var n=t._observer;try{var i=Uo(n,e);switch(e){case"next":i&&i.call(n,r);break;case"error":if(su(t),i)i.call(n,r);else throw r;break;case"complete":su(t),i&&i.call(n);break}}catch(a){li(a)}t._state==="closed"?lf(t):t._state==="running"&&(t._state="ready")}function au(t,e,r){if(t._state!=="closed"){if(t._state==="buffering"){t._queue.push({type:e,value:r});return}if(t._state!=="ready"){t._state="buffering",t._queue=[{type:e,value:r}],Mo(function(){return ug(t)});return}pf(t,e,r)}}var lg=function(){function t(r,n){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var i=new pg(this);try{this._cleanup=n.call(void 0,i)}catch(a){i.error(a)}this._state==="initializing"&&(this._state="ready")}var e=t.prototype;return e.unsubscribe=function(){this._state!=="closed"&&(su(this),lf(this))},cu(t,[{key:"closed",get:function(){return this._state==="closed"}}]),t}(),pg=function(){function t(r){this._subscription=r}var e=t.prototype;return e.next=function(n){au(this._subscription,"next",n)},e.error=function(n){au(this._subscription,"error",n)},e.complete=function(){au(this._subscription,"complete")},cu(t,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),t}(),ne=function(){function t(r){if(!(this instanceof t))throw new TypeError("Observable cannot be called as a function");if(typeof r!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=r}var e=t.prototype;return e.subscribe=function(n){return(typeof n!="object"||n===null)&&(n={next:n,error:arguments[1],complete:arguments[2]}),new lg(n,this._subscriber)},e.forEach=function(n){var i=this;return new Promise(function(a,o){if(typeof n!="function"){o(new TypeError(n+" is not a function"));return}function s(){u.unsubscribe(),a()}var u=i.subscribe({next:function(c){try{n(c,s)}catch(l){o(l),u.unsubscribe()}},error:o,complete:a})})},e.map=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=la(this);return new a(function(o){return i.subscribe({next:function(s){try{s=n(s)}catch(u){return o.error(u)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},e.filter=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=la(this);return new a(function(o){return i.subscribe({next:function(s){try{if(!n(s))return}catch(u){return o.error(u)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},e.reduce=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=la(this),o=arguments.length>1,s=!1,u=arguments[1],c=u;return new a(function(l){return i.subscribe({next:function(d){var f=!s;if(s=!0,!f||o)try{c=n(c,d)}catch(p){return l.error(p)}else c=d},error:function(d){l.error(d)},complete:function(){if(!s&&!o)return l.error(new TypeError("Cannot reduce an empty sequence"));l.next(c),l.complete()}})})},e.concat=function(){for(var n=this,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];var s=la(this);return new s(function(u){var c,l=0;function d(f){c=f.subscribe({next:function(p){u.next(p)},error:function(p){u.error(p)},complete:function(){l===a.length?(c=void 0,u.complete()):d(s.from(a[l++]))}})}return d(n),function(){c&&(c.unsubscribe(),c=void 0)}})},e.flatMap=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=la(this);return new a(function(o){var s=[],u=i.subscribe({next:function(l){if(n)try{l=n(l)}catch(f){return o.error(f)}var d=a.from(l).subscribe({next:function(f){o.next(f)},error:function(f){o.error(f)},complete:function(){var f=s.indexOf(d);f>=0&&s.splice(f,1),c()}});s.push(d)},error:function(l){o.error(l)},complete:function(){c()}});function c(){u.closed&&s.length===0&&o.complete()}return function(){s.forEach(function(l){return l.unsubscribe()}),u.unsubscribe()}})},e[ou]=function(){return this},t.from=function(n){var i=typeof this=="function"?this:t;if(n==null)throw new TypeError(n+" is not an object");var a=Uo(n,ou);if(a){var o=a.call(n);if(Object(o)!==o)throw new TypeError(o+" is not an object");return cg(o)&&o.constructor===i?o:new i(function(s){return o.subscribe(s)})}if(lu("iterator")&&(a=Uo(n,sg),a))return new i(function(s){Mo(function(){if(!s.closed){for(var u=ag(a.call(n)),c;!(c=u()).done;){var l=c.value;if(s.next(l),s.closed)return}s.complete()}})});if(Array.isArray(n))return new i(function(s){Mo(function(){if(!s.closed){for(var u=0;u<n.length;++u)if(s.next(n[u]),s.closed)return;s.complete()}})});throw new TypeError(n+" is not observable")},t.of=function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];var o=typeof this=="function"?this:t;return new o(function(s){Mo(function(){if(!s.closed){for(var u=0;u<i.length;++u)if(s.next(i[u]),s.closed)return;s.complete()}})})},cu(t,null,[{key:uf,get:function(){return this}}]),t}();uu()&&Object.defineProperty(ne,Symbol("extensions"),{value:{symbol:ou,hostReportError:li},configurable:!0});function fu(t){var e,r=t.Symbol;if(typeof r=="function")if(r.observable)e=r.observable;else{typeof r.for=="function"?e=r.for("https://github.com/benlesh/symbol-observable"):e=r("https://github.com/benlesh/symbol-observable");try{r.observable=e}catch{}}else e="@@observable";return e}var pi;typeof self<"u"?pi=self:typeof window<"u"?pi=window:typeof global<"u"?pi=global:typeof module<"u"?pi=module:pi=Function("return this")();var m_=fu(pi);var ff=ne.prototype,df="@@observable";ff[df]||(ff[df]=function(){return this});var fg=Object.prototype.toString;function jo(t){return du(t)}function du(t,e){switch(fg.call(t)){case"[object Array]":{if(e=e||new Map,e.has(t))return e.get(t);var r=t.slice(0);return e.set(t,r),r.forEach(function(i,a){r[a]=du(i,e)}),r}case"[object Object]":{if(e=e||new Map,e.has(t))return e.get(t);var n=Object.create(Object.getPrototypeOf(t));return e.set(t,n),Object.keys(t).forEach(function(i){n[i]=du(t[i],e)}),n}default:return t}}function dg(t){var e=new Set([t]);return e.forEach(function(r){ue(r)&&hg(r)===r&&Object.getOwnPropertyNames(r).forEach(function(n){ue(r[n])&&e.add(r[n])})}),t}function hg(t){if(__DEV__&&!Object.isFrozen(t))try{Object.freeze(t)}catch(e){if(e instanceof TypeError)return null;throw e}return t}function pa(t){return __DEV__&&dg(t),t}function Sn(t,e,r){var n=[];t.forEach(function(i){return i[e]&&n.push(i)}),n.forEach(function(i){return i[e](r)})}function Bo(t,e,r){return new ne(function(n){var i=n.next,a=n.error,o=n.complete,s=0,u=!1,c={then:function(p){return new Promise(function(h){return h(p())})}};function l(p,h){return p?function(g){++s;var b=function(){return p(g)};c=c.then(b,b).then(function(C){--s,i&&i.call(n,C),u&&d.complete()},function(C){throw--s,C}).catch(function(C){a&&a.call(n,C)})}:function(g){return h&&h.call(n,g)}}var d={next:l(e,i),error:l(r,a),complete:function(){u=!0,s||o&&o.call(n)}},f=t.subscribe(d);return function(){return f.unsubscribe()}})}var Rt=typeof WeakMap=="function"&&Ge(function(){return navigator.product})!=="ReactNative",hf=typeof WeakSet=="function",hu=typeof Symbol=="function"&&typeof Symbol.for=="function",Rr=hu&&Symbol.asyncIterator,I_=typeof Ge(function(){return window.document.createElement})=="function",T_=Ge(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1;function qo(t){function e(r){Object.defineProperty(t,r,{value:ne})}return hu&&Symbol.species&&e(Symbol.species),e("@@species"),t}function mf(t){return t&&typeof t.then=="function"}var fi=function(t){De(e,t);function e(r){var n=t.call(this,function(i){return n.addObserver(i),function(){return n.removeObserver(i)}})||this;return n.observers=new Set,n.promise=new Promise(function(i,a){n.resolve=i,n.reject=a}),n.handlers={next:function(i){n.sub!==null&&(n.latest=["next",i],n.notify("next",i),Sn(n.observers,"next",i))},error:function(i){var a=n.sub;a!==null&&(a&&setTimeout(function(){return a.unsubscribe()}),n.sub=null,n.latest=["error",i],n.reject(i),n.notify("error",i),Sn(n.observers,"error",i))},complete:function(){var i=n,a=i.sub,o=i.sources,s=o===void 0?[]:o;if(a!==null){var u=s.shift();u?mf(u)?u.then(function(c){return n.sub=c.subscribe(n.handlers)}):n.sub=u.subscribe(n.handlers):(a&&setTimeout(function(){return a.unsubscribe()}),n.sub=null,n.latest&&n.latest[0]==="next"?n.resolve(n.latest[1]):n.resolve(),n.notify("complete"),Sn(n.observers,"complete"))}}},n.nextResultListeners=new Set,n.cancel=function(i){n.reject(i),n.sources=[],n.handlers.complete()},n.promise.catch(function(i){}),typeof r=="function"&&(r=[new ne(r)]),mf(r)?r.then(function(i){return n.start(i)},n.handlers.error):n.start(r),n}return e.prototype.start=function(r){this.sub===void 0&&(this.sources=Array.from(r),this.handlers.complete())},e.prototype.deliverLastMessage=function(r){if(this.latest){var n=this.latest[0],i=r[n];i&&i.call(r,this.latest[1]),this.sub===null&&n==="next"&&r.complete&&r.complete()}},e.prototype.addObserver=function(r){this.observers.has(r)||(this.deliverLastMessage(r),this.observers.add(r))},e.prototype.removeObserver=function(r){this.observers.delete(r)&&this.observers.size<1&&this.handlers.complete()},e.prototype.notify=function(r,n){var i=this.nextResultListeners;i.size&&(this.nextResultListeners=new Set,i.forEach(function(a){return a(r,n)}))},e.prototype.beforeNext=function(r){var n=!1;this.nextResultListeners.add(function(i,a){n||(n=!0,r(i,a))})},e}(ne);qo(fi);function $r(t){return"incremental"in t}function mg(t){return"hasNext"in t&&"data"in t}function gf(t){return $r(t)||mg(t)}function Vo(t,e){var r=t,n=new mt;return $r(e)&&Be(e.incremental)&&e.incremental.forEach(function(i){for(var a=i.data,o=i.path,s=o.length-1;s>=0;--s){var u=o[s],c=!isNaN(+u),l=c?[]:{};l[u]=a,a=l}r=n.merge(r,a)}),r}function di(t){var e=Qo(t);return Be(e)}function Qo(t){var e=Be(t.errors)?t.errors.slice(0):[];return $r(t)&&Be(t.incremental)&&t.incremental.forEach(function(r){r.errors&&e.push.apply(e,r.errors)}),e}function Lr(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Object.create(null);return t.forEach(function(n){!n||Object.keys(n).forEach(function(i){var a=n[i];a!==void 0&&(r[i]=a)})}),r}var yf=new Map;function fa(t){var e=yf.get(t)||1;return yf.set(t,e+1),"".concat(t,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function vf(t){var e=fa("stringifyForDisplay");return JSON.stringify(t,function(r,n){return n===void 0?e:n}).split(JSON.stringify(e)).join("<undefined>")}function da(t,e){return Lr(t,e,e.variables&&{variables:S(S({},t&&t.variables),e.variables)})}function zo(t){return new ne(function(e){e.error(t)})}var ha=function(t,e,r){var n=new Error(r);throw n.name="ServerError",n.response=t,n.statusCode=t.status,n.result=e,n};function mu(t){for(var e=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(t);r<n.length;r++){var i=n[r];if(e.indexOf(i)<0)throw __DEV__?new H("illegal argument: ".concat(i)):new H(27)}return t}function gu(t,e){var r=S({},t),n=function(a){typeof a=="function"?r=S(S({},r),a(r)):r=S(S({},r),a)},i=function(){return S({},r)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:n}),Object.defineProperty(e,"getContext",{enumerable:!1,value:i}),e}function yu(t){var e={variables:t.variables||{},extensions:t.extensions||{},operationName:t.operationName,query:t.query};return e.operationName||(e.operationName=typeof e.query!="string"?ui(e.query)||void 0:""),e}function bf(t,e){return e?e(t):ne.of()}function ma(t){return typeof t=="function"?new $t(t):t}function Ho(t){return t.request.length<=1}var gg=function(t){De(e,t);function e(r,n){var i=t.call(this,r)||this;return i.link=n,i}return e}(Error),$t=function(){function t(e){e&&(this.request=e)}return t.empty=function(){return new t(function(){return ne.of()})},t.from=function(e){return e.length===0?t.empty():e.map(ma).reduce(function(r,n){return r.concat(n)})},t.split=function(e,r,n){var i=ma(r),a=ma(n||new t(bf));return Ho(i)&&Ho(a)?new t(function(o){return e(o)?i.request(o)||ne.of():a.request(o)||ne.of()}):new t(function(o,s){return e(o)?i.request(o,s)||ne.of():a.request(o,s)||ne.of()})},t.execute=function(e,r){return e.request(gu(r.context,yu(mu(r))))||ne.of()},t.concat=function(e,r){var n=ma(e);if(Ho(n))return __DEV__&&N.warn(new gg("You are calling concat on a terminating link, which will have no effect",n)),n;var i=ma(r);return Ho(i)?new t(function(a){return n.request(a,function(o){return i.request(o)||ne.of()})||ne.of()}):new t(function(a,o){return n.request(a,function(s){return i.request(s,o)||ne.of()})||ne.of()})},t.prototype.split=function(e,r,n){return this.concat(t.split(e,r,n||new t(bf)))},t.prototype.concat=function(e){return t.concat(this,e)},t.prototype.request=function(e,r){throw __DEV__?new H("request is not implemented"):new H(22)},t.prototype.onError=function(e,r){if(r&&r.error)return r.error(e),!1;throw e},t.prototype.setOnError=function(e){return this.onError=e,this},t}();var hi=$t.execute;var _f="3.7.10";function wf(t){return!!t.body}function Sf(t){return!!t.getReader}function Cf(t){return!!(Rr&&t[Symbol.asyncIterator])}function xf(t){return!!t.stream}function Ef(t){return!!t.arrayBuffer}function kf(t){return!!t.pipe}function vu(t){var e,r=t[Symbol.asyncIterator]();return e={next:function(){return r.next()}},e[Symbol.asyncIterator]=function(){return this},e}function bu(t){var e=null,r=null,n=!1,i=[],a=[];function o(d){if(!r){if(a.length){var f=a.shift();if(Array.isArray(f)&&f[0])return f[0]({value:d,done:!1})}i.push(d)}}function s(d){r=d;var f=a.slice();f.forEach(function(p){p[1](d)}),!e||e()}function u(){n=!0;var d=a.slice();d.forEach(function(f){f[0]({value:void 0,done:!0})}),!e||e()}e=function(){e=null,t.removeListener("data",o),t.removeListener("error",s),t.removeListener("end",u),t.removeListener("finish",u),t.removeListener("close",u)},t.on("data",o),t.on("error",s),t.on("end",u),t.on("finish",u),t.on("close",u);function c(){return new Promise(function(d,f){if(r)return f(r);if(i.length)return d({value:i.shift(),done:!1});if(n)return d({value:void 0,done:!0});a.push([d,f])})}var l={next:function(){return c()}};return Rr&&(l[Symbol.asyncIterator]=function(){return this}),l}function _u(t){var e=!1,r={next:function(){return e?Promise.resolve({value:void 0,done:!0}):(e=!0,new Promise(function(n,i){t.then(function(a){n({value:a,done:!1})}).catch(i)}))}};return Rr&&(r[Symbol.asyncIterator]=function(){return this}),r}function Go(t){var e={next:function(){return t.read()}};return Rr&&(e[Symbol.asyncIterator]=function(){return this}),e}function Af(t){var e=t;if(wf(t)&&(e=t.body),Cf(e))return vu(e);if(Sf(e))return Go(e.getReader());if(xf(e))return Go(e.stream().getReader());if(Ef(e))return _u(e.arrayBuffer());if(kf(e))return bu(e);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var If=Object.prototype.hasOwnProperty;function Tf(t,e){var r,n,i;return Bt(this,void 0,void 0,function(){var a,o,s,u,c,l,d,f,p,h,g,b,C,w,_,y,T,R,k,P;return qt(this,function(M){switch(M.label){case 0:if(TextDecoder===void 0)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");a=new TextDecoder("utf-8"),o=(r=t.headers)===null||r===void 0?void 0:r.get("content-type"),s="boundary=",u=o?.includes(s)?o?.substring(o?.indexOf(s)+s.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",c="--".concat(u),l="",d=Af(t),f=!0,M.label=1;case 1:return f?[4,d.next()]:[3,3];case 2:for(p=M.sent(),h=p.value,g=p.done,b=typeof h=="string"?h:a.decode(h),f=!g,l+=b,C=l.indexOf(c);C>-1;){if(w=void 0,P=[l.slice(0,C),l.slice(C+c.length)],w=P[0],l=P[1],w.trim()){if(_=w.indexOf(`\r
|
|
27
27
|
\r
|
|
28
|
-
`),
|
|
29
|
-
`,"")),(Object.keys(
|
|
30
|
-
`).forEach(function(r){var n=r.indexOf(":");if(n>-1){var i=r.slice(0,n).trim().toLowerCase(),a=r.slice(n+1).trim();e[i]=a}}),e}function
|
|
28
|
+
`),y=yg(w.slice(0,_)),T=y["content-type"],T&&T.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");R=w.slice(_);try{k=Of(t,R.replace(`\r
|
|
29
|
+
`,"")),(Object.keys(k).length>1||"data"in k||"incremental"in k||"errors"in k)&&((n=e.next)===null||n===void 0||n.call(e,k))}catch($){Wo($,e)}}C=l.indexOf(c)}return[3,1];case 3:return(i=e.complete)===null||i===void 0||i.call(e),[2]}})})}function yg(t){var e={};return t.split(`
|
|
30
|
+
`).forEach(function(r){var n=r.indexOf(":");if(n>-1){var i=r.slice(0,n).trim().toLowerCase(),a=r.slice(n+1).trim();e[i]=a}}),e}function Of(t,e){if(t.status>=300){var r=function(){try{return JSON.parse(e)}catch{return e}};ha(t,r(),"Response not successful: Received status code ".concat(t.status))}try{return JSON.parse(e)}catch(i){var n=i;throw n.name="ServerParseError",n.response=t,n.statusCode=t.status,n.bodyText=e,n}}function Wo(t,e){var r,n;t.name!=="AbortError"&&(t.result&&t.result.errors&&t.result.data&&((r=e.next)===null||r===void 0||r.call(e,t.result)),(n=e.error)===null||n===void 0||n.call(e,t))}function Df(t,e,r){vg(e)(t).then(function(n){var i,a;(i=r.next)===null||i===void 0||i.call(r,n),(a=r.complete)===null||a===void 0||a.call(r)}).catch(function(n){return Wo(n,r)})}function vg(t){return function(e){return e.text().then(function(r){return Of(e,r)}).then(function(r){return e.status>=300&&ha(e,r,"Response not successful: Received status code ".concat(e.status)),!Array.isArray(r)&&!If.call(r,"data")&&!If.call(r,"errors")&&ha(e,r,"Server response was missing for query '".concat(Array.isArray(t)?t.map(function(n){return n.operationName}):t.operationName,"'.")),r})}}var ga=function(t,e){var r;try{r=JSON.stringify(t)}catch(i){var n=__DEV__?new H("Network request failed. ".concat(e," is not serializable: ").concat(i.message)):new H(24);throw n.parseError=i,n}return r};var bg={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},_g={accept:"*/*","content-type":"application/json"},wg={method:"POST"},Nf={http:bg,headers:_g,options:wg},Pf=function(t,e){return e(t)};function Rf(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i={},a={};r.forEach(function(d){i=S(S(S({},i),d.options),{headers:S(S({},i.headers),d.headers)}),d.credentials&&(i.credentials=d.credentials),a=S(S({},a),d.http)}),i.headers&&(i.headers=Sg(i.headers,a.preserveHeaderCase));var o=t.operationName,s=t.extensions,u=t.variables,c=t.query,l={operationName:o,variables:u};return a.includeExtensions&&(l.extensions=s),a.includeQuery&&(l.query=e(c,oi)),{options:i,body:l}}function Sg(t,e){if(!e){var r=Object.create(null);return Object.keys(Object(t)).forEach(function(a){r[a.toLowerCase()]=t[a]}),r}var n=Object.create(null);Object.keys(Object(t)).forEach(function(a){n[a.toLowerCase()]={originalName:a,value:t[a]}});var i=Object.create(null);return Object.keys(n).forEach(function(a){i[n[a].originalName]=n[a].value}),i}var $f=function(t){if(!t&&typeof fetch>"u")throw __DEV__?new H(`
|
|
31
31
|
"fetch" has not been found globally and no fetcher has been configured. To fix this, install a fetch package (like https://www.npmjs.com/package/cross-fetch), instantiate the fetcher, and pass it into your HttpLink constructor. For example:
|
|
32
32
|
|
|
33
33
|
import fetch from 'cross-fetch';
|
|
@@ -35,7 +35,7 @@ import { ApolloClient, HttpLink } from '@apollo/client';
|
|
|
35
35
|
const client = new ApolloClient({
|
|
36
36
|
link: new HttpLink({ uri: '/graphql', fetch })
|
|
37
37
|
});
|
|
38
|
-
`):new V(23)};var Gf=function(){if(typeof AbortController>"u")return{controller:!1,signal:!1};var t=new AbortController,e=t.signal;return{controller:t,signal:e}};var Hf=function(t,e){var r=t.getContext(),n=r.uri;return n||(typeof e=="function"?e(t):e||"/graphql")};function Wf(t,e){var r=[],n=function(d,p){r.push("".concat(d,"=").concat(encodeURIComponent(p)))};if("query"in e&&n("query",e.query),e.operationName&&n("operationName",e.operationName),e.variables){var i=void 0;try{i=Qi(e.variables,"Variables map")}catch(d){return{parseError:d}}n("variables",i)}if(e.extensions){var a=void 0;try{a=Qi(e.extensions,"Extensions map")}catch(d){return{parseError:d}}n("extensions",a)}var o="",s=t,u=t.indexOf("#");u!==-1&&(o=t.substr(u),s=t.substr(0,u));var c=s.indexOf("?")===-1?"?":"&",l=s+c+r.join("&")+o;return{newURI:l}}var Kf=Me(function(){return fetch}),Zf=function(t){t===void 0&&(t={});var e=t.uri,r=e===void 0?"/graphql":e,n=t.fetch,i=t.print,a=i===void 0?Vf:i,o=t.includeExtensions,s=t.preserveHeaderCase,u=t.useGETForQueries,c=t.includeUnusedVariables,l=c===void 0?!1:c,d=jt(t,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);__DEV__&&Qf(n||Kf);var p={http:{includeExtensions:o,preserveHeaderCase:s},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new St(function(f){var h=Hf(f,r),g=f.getContext(),y={};if(g.clientAwareness){var S=g.clientAwareness,b=S.name,v=S.version;b&&(y["apollographql-client-name"]=b),v&&(y["apollographql-client-version"]=v)}var m=_(_({},y),g.headers),A={http:g.http,options:g.fetchOptions,credentials:g.credentials,headers:m},D=zf(f,a,Bf,p,A),C=D.options,O=D.body;if(O.variables&&!l){var P=new Set(Object.keys(O.variables));Ke(f.query,{Variable:function(X,Ft,G){G&&G.kind!=="VariableDefinition"&&P.delete(X.name.value)}}),P.size&&(O.variables=_({},O.variables),P.forEach(function(X){delete O.variables[X]}))}var N;if(!C.signal){var U=Gf(),qe=U.controller,Ne=U.signal;N=qe,N&&(C.signal=Ne)}var q=function(X){return X.kind==="OperationDefinition"&&X.operation==="mutation"};if(u&&!f.query.definitions.some(q)&&(C.method="GET"),Un(["defer"],f.query)&&(C.headers=C.headers||{},C.headers.accept="multipart/mixed; deferSpec=20220824, application/json"),C.method==="GET"){var de=Wf(h,O),he=de.newURI,J=de.parseError;if(J)return co(J);h=he}else try{C.body=Qi(O,"Payload")}catch(X){return co(X)}return new H(function(X){var Ft=n||Me(function(){return fetch})||Kf;return Ft(h,C).then(function(G){var Mt;f.setContext({response:G});var fr=(Mt=G.headers)===null||Mt===void 0?void 0:Mt.get("content-type");return fr!==null&&/^multipart\/mixed/i.test(fr)?jf(G,X):qf(G,f,X)}).catch(function(G){return fo(G,X)}),function(){N&&N.abort()}})})};var $c=function(t){xe(e,t);function e(r){r===void 0&&(r={});var n=t.call(this,Zf(r).request)||this;return n.options=r,n}return e}(St);var{toString:Yf,hasOwnProperty:T1}=Object.prototype,Jf=Function.prototype.toString,Fc=new Map;function be(t,e){try{return Mc(t,e)}finally{Fc.clear()}}function Mc(t,e){if(t===e)return!0;let r=Yf.call(t),n=Yf.call(e);if(r!==n)return!1;switch(r){case"[object Array]":if(t.length!==e.length)return!1;case"[object Object]":{if(ep(t,e))return!0;let i=Xf(t),a=Xf(e),o=i.length;if(o!==a.length)return!1;for(let s=0;s<o;++s)if(!T1.call(e,i[s]))return!1;for(let s=0;s<o;++s){let u=i[s];if(!Mc(t[u],e[u]))return!1}return!0}case"[object Error]":return t.name===e.name&&t.message===e.message;case"[object Number]":if(t!==t)return e!==e;case"[object Boolean]":case"[object Date]":return+t==+e;case"[object RegExp]":case"[object String]":return t==`${e}`;case"[object Map]":case"[object Set]":{if(t.size!==e.size)return!1;if(ep(t,e))return!0;let i=t.entries(),a=r==="[object Map]";for(;;){let o=i.next();if(o.done)break;let[s,u]=o.value;if(!e.has(s)||a&&!Mc(u,e.get(s)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":t=new Uint8Array(t),e=new Uint8Array(e);case"[object DataView]":{let i=t.byteLength;if(i===e.byteLength)for(;i--&&t[i]===e[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{let i=Jf.call(t);return i!==Jf.call(e)?!1:!O1(i,I1)}}return!1}function Xf(t){return Object.keys(t).filter(A1,t)}function A1(t){return this[t]!==void 0}var I1="{ [native code] }";function O1(t,e){let r=t.length-e.length;return r>=0&&t.indexOf(e,r)===r}function ep(t,e){let r=Fc.get(t);if(r){if(r.has(e))return!0}else Fc.set(t,r=new Set);return r.add(e),!1}var D1=function(){return Object.create(null)},tp=Array.prototype,N1=tp.forEach,R1=tp.slice,Bt=function(){function t(e,r){e===void 0&&(e=!0),r===void 0&&(r=D1),this.weakness=e,this.makeData=r}return t.prototype.lookup=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return this.lookupArray(e)},t.prototype.lookupArray=function(e){var r=this;return N1.call(e,function(n){return r=r.getChildTrie(n)}),r.data||(r.data=this.makeData(R1.call(e)))},t.prototype.getChildTrie=function(e){var r=this.weakness&&P1(e)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),n=r.get(e);return n||r.set(e,n=new t(this.weakness,this.makeData)),n},t}();function P1(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}var ze=null,rp={},L1=1,$1=()=>class{constructor(){this.id=["slot",L1++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=ze;e;e=e.parent)if(this.id in e.slots){let r=e.slots[this.id];if(r===rp)break;return e!==ze&&(ze.slots[this.id]=r),!0}return ze&&(ze.slots[this.id]=rp),!1}getValue(){if(this.hasValue())return ze.slots[this.id]}withValue(e,r,n,i){let a={__proto__:null,[this.id]:e},o=ze;ze={parent:o,slots:a};try{return r.apply(i,n)}finally{ze=o}}static bind(e){let r=ze;return function(){let n=ze;try{return ze=r,e.apply(this,arguments)}finally{ze=n}}}static noContext(e,r,n){if(ze){let i=ze;try{return ze=null,e.apply(n,r)}finally{ze=i}}else return e.apply(n,r)}};function np(t){try{return t()}catch{}}var jc="@wry/context:Slot",F1=np(()=>globalThis)||np(()=>global)||Object.create(null),ip=F1,Wn=ip[jc]||Array[jc]||function(t){try{Object.defineProperty(ip,jc,{value:t,enumerable:!1,writable:!1,configurable:!0})}finally{return t}}($1());var{bind:M1,noContext:j1}=Wn;function U1(){}var q1=function(){function t(e,r){e===void 0&&(e=1/0),r===void 0&&(r=U1),this.max=e,this.dispose=r,this.map=new Map,this.newest=null,this.oldest=null}return t.prototype.has=function(e){return this.map.has(e)},t.prototype.get=function(e){var r=this.getNode(e);return r&&r.value},t.prototype.getNode=function(e){var r=this.map.get(e);if(r&&r!==this.newest){var n=r.older,i=r.newer;i&&(i.older=n),n&&(n.newer=i),r.older=this.newest,r.older.newer=r,r.newer=null,this.newest=r,r===this.oldest&&(this.oldest=i)}return r},t.prototype.set=function(e,r){var n=this.getNode(e);return n?n.value=r:(n={key:e,value:r,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)},t.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},t.prototype.delete=function(e){var r=this.map.get(e);return r?(r===this.newest&&(this.newest=r.older),r===this.oldest&&(this.oldest=r.newer),r.newer&&(r.newer.older=r.older),r.older&&(r.older.newer=r.newer),this.map.delete(e),this.dispose(r.value,e),!0):!1},t}(),ho=new Wn,Uc,B1=Object.prototype.hasOwnProperty,Bc=(Uc=Array.from,Uc===void 0?function(t){var e=[];return t.forEach(function(r){return e.push(r)}),e}:Uc);function po(t){var e=t.unsubscribe;typeof e=="function"&&(t.unsubscribe=void 0,e())}var Gi=[],V1=100;function Kn(t,e){if(!t)throw new Error(e||"assertion failure")}function z1(t,e){var r=t.length;return r>0&&r===e.length&&t[r-1]===e[r-1]}function op(t){switch(t.length){case 0:throw new Error("unknown value");case 1:return t[0];case 2:throw t[1]}}function Q1(t){return t.slice(0)}var G1=function(){function t(e){this.fn=e,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++t.count}return t.prototype.peek=function(){if(this.value.length===1&&!wr(this))return ap(this),this.value[0]},t.prototype.recompute=function(e){return Kn(!this.recomputing,"already recomputing"),ap(this),wr(this)?H1(this,e):op(this.value)},t.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,sp(this),po(this))},t.prototype.dispose=function(){var e=this;this.setDirty(),pp(this),Vc(this,function(r,n){r.setDirty(),dp(r,e)})},t.prototype.forget=function(){this.dispose()},t.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=Gi.pop()||new Set),this.deps.add(e)},t.prototype.forgetDeps=function(){var e=this;this.deps&&(Bc(this.deps).forEach(function(r){return r.delete(e)}),this.deps.clear(),Gi.push(this.deps),this.deps=null)},t.count=0,t}();function ap(t){var e=ho.getValue();if(e)return t.parents.add(e),e.childValues.has(t)||e.childValues.set(t,[]),wr(t)?up(e,t):lp(e,t),e}function H1(t,e){return pp(t),ho.withValue(t,W1,[t,e]),Z1(t,e)&&K1(t),op(t.value)}function W1(t,e){t.recomputing=!0,t.value.length=0;try{t.value[0]=t.fn.apply(null,e)}catch(r){t.value[1]=r}t.recomputing=!1}function wr(t){return t.dirty||!!(t.dirtyChildren&&t.dirtyChildren.size)}function K1(t){t.dirty=!1,!wr(t)&&cp(t)}function sp(t){Vc(t,up)}function cp(t){Vc(t,lp)}function Vc(t,e){var r=t.parents.size;if(r)for(var n=Bc(t.parents),i=0;i<r;++i)e(n[i],t)}function up(t,e){Kn(t.childValues.has(e)),Kn(wr(e));var r=!wr(t);if(!t.dirtyChildren)t.dirtyChildren=Gi.pop()||new Set;else if(t.dirtyChildren.has(e))return;t.dirtyChildren.add(e),r&&sp(t)}function lp(t,e){Kn(t.childValues.has(e)),Kn(!wr(e));var r=t.childValues.get(e);r.length===0?t.childValues.set(e,Q1(e.value)):z1(r,e.value)||t.setDirty(),fp(t,e),!wr(t)&&cp(t)}function fp(t,e){var r=t.dirtyChildren;r&&(r.delete(e),r.size===0&&(Gi.length<V1&&Gi.push(r),t.dirtyChildren=null))}function pp(t){t.childValues.size>0&&t.childValues.forEach(function(e,r){dp(t,r)}),t.forgetDeps(),Kn(t.dirtyChildren===null)}function dp(t,e){e.parents.delete(t),t.childValues.delete(e),fp(t,e)}function Z1(t,e){if(typeof t.subscribe=="function")try{po(t),t.unsubscribe=t.subscribe.apply(null,e)}catch{return t.setDirty(),!1}return!0}var Y1={setDirty:!0,dispose:!0,forget:!0};function mo(t){var e=new Map,r=t&&t.subscribe;function n(i){var a=ho.getValue();if(a){var o=e.get(i);o||e.set(i,o=new Set),a.dependOn(o),typeof r=="function"&&(po(o),o.unsubscribe=r(i))}}return n.dirty=function(a,o){var s=e.get(a);if(s){var u=o&&B1.call(Y1,o)?o:"setDirty";Bc(s).forEach(function(c){return c[u]()}),e.delete(a),po(s)}},n}function hp(){var t=new Bt(typeof WeakMap=="function");return function(){return t.lookupArray(arguments)}}var p6=hp(),qc=new Set;function nn(t,e){e===void 0&&(e=Object.create(null));var r=new q1(e.max||Math.pow(2,16),function(c){return c.dispose()}),n=e.keyArgs,i=e.makeCacheKey||hp(),a=function(){var c=i.apply(null,n?n.apply(null,arguments):arguments);if(c===void 0)return t.apply(null,arguments);var l=r.get(c);l||(r.set(c,l=new G1(t)),l.subscribe=e.subscribe,l.forget=function(){return r.delete(c)});var d=l.recompute(Array.prototype.slice.call(arguments));return r.set(c,l),qc.add(r),ho.hasValue()||(qc.forEach(function(p){return p.clean()}),qc.clear()),d};Object.defineProperty(a,"size",{get:function(){return r.map.size},configurable:!1,enumerable:!1});function o(c){var l=r.get(c);l&&l.setDirty()}a.dirtyKey=o,a.dirty=function(){o(i.apply(null,arguments))};function s(c){var l=r.get(c);if(l)return l.peek()}a.peekKey=s,a.peek=function(){return s(i.apply(null,arguments))};function u(c){return r.delete(c)}return a.forgetKey=u,a.forget=function(){return u(i.apply(null,arguments))},a.makeCacheKey=i,a.getKey=n?function(){return i.apply(null,n.apply(null,arguments))}:i,Object.freeze(a)}var zc=function(){function t(){this.getFragmentDoc=nn(lc)}return t.prototype.batch=function(e){var r=this,n=typeof e.optimistic=="string"?e.optimistic:e.optimistic===!1?null:void 0,i;return this.performTransaction(function(){return i=e.update(r)},n),i},t.prototype.recordOptimisticTransaction=function(e,r){this.performTransaction(e,r)},t.prototype.transformDocument=function(e){return e},t.prototype.transformForLink=function(e){return e},t.prototype.identify=function(e){},t.prototype.gc=function(){return[]},t.prototype.modify=function(e){return!1},t.prototype.readQuery=function(e,r){return r===void 0&&(r=!!e.optimistic),this.read(_(_({},e),{rootId:e.id||"ROOT_QUERY",optimistic:r}))},t.prototype.readFragment=function(e,r){return r===void 0&&(r=!!e.optimistic),this.read(_(_({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:r}))},t.prototype.writeQuery=function(e){var r=e.id,n=e.data,i=jt(e,["id","data"]);return this.write(Object.assign(i,{dataId:r||"ROOT_QUERY",result:n}))},t.prototype.writeFragment=function(e){var r=e.id,n=e.data,i=e.fragment,a=e.fragmentName,o=jt(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(i,a),dataId:r,result:n}))},t.prototype.updateQuery=function(e,r){return this.batch({update:function(n){var i=n.readQuery(e),a=r(i);return a==null?i:(n.writeQuery(_(_({},e),{data:a})),a)}})},t.prototype.updateFragment=function(e,r){return this.batch({update:function(n){var i=n.readFragment(e),a=r(i);return a==null?i:(n.writeFragment(_(_({},e),{data:a})),a)}})},t}();var Hi=function(t){xe(e,t);function e(r,n,i,a){var o,s=t.call(this,r)||this;if(s.message=r,s.path=n,s.query=i,s.variables=a,Array.isArray(s.path)){s.missing=s.message;for(var u=s.path.length-1;u>=0;--u)s.missing=(o={},o[s.path[u]]=s.missing,o)}else s.missing=s.path;return s.__proto__=e.prototype,s}return e}(Error);var ke=Object.prototype.hasOwnProperty;function Wi(t){return t==null}function yo(t,e){var r=t.__typename,n=t.id,i=t._id;if(typeof r=="string"&&(e&&(e.keyObject=Wi(n)?Wi(i)?void 0:{_id:i}:{id:n}),Wi(n)&&!Wi(i)&&(n=i),!Wi(n)))return"".concat(r,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var mp={dataIdFromObject:yo,addTypename:!0,resultCaching:!0,canonizeResults:!1};function gp(t){return _r(mp,t)}function vo(t){var e=t.canonizeResults;return e===void 0?mp.canonizeResults:e}function yp(t,e){return K(e)?t.get(e.__ref,"__typename"):e&&e.__typename}var Qc=/^[_a-z][_0-9a-z]*/i;function Dt(t){var e=t.match(Qc);return e?e[0]:t}function go(t,e,r){return ee(e)?ue(e)?e.every(function(n){return go(t,n,r)}):t.selections.every(function(n){if(pt(n)&&er(n,r)){var i=_t(n);return ke.call(e,i)&&(!n.selectionSet||go(n.selectionSet,e[i],r))}return!0}):!1}function Sr(t){return ee(t)&&!K(t)&&!ue(t)}function vp(){return new it}function bo(t,e){var r=Zr(Jr(t));return{fragmentMap:r,lookupFragment:function(n){var i=r[n];return!i&&e&&(i=e.lookup(n)),i||null}}}var _o=Object.create(null),Gc=function(){return _o},bp=Object.create(null),Zn=function(){function t(e,r){var n=this;this.policies=e,this.group=r,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(i,a){return Ui(K(i)?n.get(i.__ref,a):i&&i[a])},this.canRead=function(i){return K(i)?n.has(i.__ref):typeof i=="object"},this.toReference=function(i,a){if(typeof i=="string")return Ut(i);if(K(i))return i;var o=n.policies.identify(i)[0];if(o){var s=Ut(o);return a&&n.merge(o,i),s}}}return t.prototype.toObject=function(){return _({},this.data)},t.prototype.has=function(e){return this.lookup(e,!0)!==void 0},t.prototype.get=function(e,r){if(this.group.depend(e,r),ke.call(this.data,e)){var n=this.data[e];if(n&&ke.call(n,r))return n[r]}if(r==="__typename"&&ke.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof Er)return this.parent.get(e,r)},t.prototype.lookup=function(e,r){if(r&&this.group.depend(e,"__exists"),ke.call(this.data,e))return this.data[e];if(this instanceof Er)return this.parent.lookup(e,r);if(this.policies.rootTypenamesById[e])return Object.create(null)},t.prototype.merge=function(e,r){var n=this,i;K(e)&&(e=e.__ref),K(r)&&(r=r.__ref);var a=typeof e=="string"?this.lookup(i=e):e,o=typeof r=="string"?this.lookup(i=r):r;if(!!o){__DEV__?I(typeof i=="string","store.merge expects a string ID"):I(typeof i=="string",1);var s=new it(X1).merge(a,o);if(this.data[i]=s,s!==a&&(delete this.refs[i],this.group.caching)){var u=Object.create(null);a||(u.__exists=1),Object.keys(o).forEach(function(c){if(!a||a[c]!==s[c]){u[c]=1;var l=Dt(c);l!==c&&!n.policies.hasKeyArgs(s.__typename,l)&&(u[l]=1),s[c]===void 0&&!(n instanceof Er)&&delete s[c]}}),u.__typename&&!(a&&a.__typename)&&this.policies.rootTypenamesById[i]===s.__typename&&delete u.__typename,Object.keys(u).forEach(function(c){return n.group.dirty(i,c)})}}},t.prototype.modify=function(e,r){var n=this,i=this.lookup(e);if(i){var a=Object.create(null),o=!1,s=!0,u={DELETE:_o,INVALIDATE:bp,isReference:K,toReference:this.toReference,canRead:this.canRead,readField:function(c,l){return n.policies.readField(typeof c=="string"?{fieldName:c,from:l||Ut(e)}:c,{store:n})}};if(Object.keys(i).forEach(function(c){var l=Dt(c),d=i[c];if(d!==void 0){var p=typeof r=="function"?r:r[c]||r[l];if(p){var f=p===Gc?_o:p(Ui(d),_(_({},u),{fieldName:l,storeFieldName:c,storage:n.getStorage(e,c)}));f===bp?n.group.dirty(e,c):(f===_o&&(f=void 0),f!==d&&(a[c]=f,o=!0,d=f))}d!==void 0&&(s=!1)}}),o)return this.merge(e,a),s&&(this instanceof Er?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},t.prototype.delete=function(e,r,n){var i,a=this.lookup(e);if(a){var o=this.getFieldValue(a,"__typename"),s=r&&n?this.policies.getStoreFieldName({typename:o,fieldName:r,args:n}):r;return this.modify(e,s?(i={},i[s]=Gc,i):Gc)}return!1},t.prototype.evict=function(e,r){var n=!1;return e.id&&(ke.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof Er&&this!==r&&(n=this.parent.evict(e,r)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n},t.prototype.clear=function(){this.replace(null)},t.prototype.extract=function(){var e=this,r=this.toObject(),n=[];return this.getRootIdSet().forEach(function(i){ke.call(e.policies.rootTypenamesById,i)||n.push(i)}),n.length&&(r.__META={extraRootIds:n.sort()}),r},t.prototype.replace=function(e){var r=this;if(Object.keys(this.data).forEach(function(a){e&&ke.call(e,a)||r.delete(a)}),e){var n=e.__META,i=jt(e,["__META"]);Object.keys(i).forEach(function(a){r.merge(a,i[a])}),n&&n.extraRootIds.forEach(this.retain,this)}},t.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},t.prototype.release=function(e){if(this.rootIds[e]>0){var r=--this.rootIds[e];return r||delete this.rootIds[e],r}return 0},t.prototype.getRootIdSet=function(e){return e===void 0&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof Er?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},t.prototype.gc=function(){var e=this,r=this.getRootIdSet(),n=this.toObject();r.forEach(function(o){ke.call(n,o)&&(Object.keys(e.findChildRefIds(o)).forEach(r.add,r),delete n[o])});var i=Object.keys(n);if(i.length){for(var a=this;a instanceof Er;)a=a.parent;i.forEach(function(o){return a.delete(o)})}return i},t.prototype.findChildRefIds=function(e){if(!ke.call(this.refs,e)){var r=this.refs[e]=Object.create(null),n=this.data[e];if(!n)return r;var i=new Set([n]);i.forEach(function(a){K(a)&&(r[a.__ref]=!0),ee(a)&&Object.keys(a).forEach(function(o){var s=a[o];ee(s)&&i.add(s)})})}return this.refs[e]},t.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},t}();var _p=function(){function t(e,r){r===void 0&&(r=null),this.caching=e,this.parent=r,this.d=null,this.resetCaching()}return t.prototype.resetCaching=function(){this.d=this.caching?mo():null,this.keyMaker=new Bt(wt)},t.prototype.depend=function(e,r){if(this.d){this.d(Hc(e,r));var n=Dt(r);n!==r&&this.d(Hc(e,n)),this.parent&&this.parent.depend(e,r)}},t.prototype.dirty=function(e,r){this.d&&this.d.dirty(Hc(e,r),r==="__exists"?"forget":"setDirty")},t}();function Hc(t,e){return e+"#"+t}function Wc(t,e){an(t)&&t.group.depend(e,"__exists")}(function(t){var e=function(r){xe(n,r);function n(i){var a=i.policies,o=i.resultCaching,s=o===void 0?!0:o,u=i.seed,c=r.call(this,a,new _p(s))||this;return c.stump=new J1(c),c.storageTrie=new Bt(wt),u&&c.replace(u),c}return n.prototype.addLayer=function(i,a){return this.stump.addLayer(i,a)},n.prototype.removeLayer=function(){return this},n.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},n}(t);t.Root=e})(Zn||(Zn={}));var Er=function(t){xe(e,t);function e(r,n,i,a){var o=t.call(this,n.policies,a)||this;return o.id=r,o.parent=n,o.replay=i,o.group=a,i(o),o}return e.prototype.addLayer=function(r,n){return new e(r,this,n,this.group)},e.prototype.removeLayer=function(r){var n=this,i=this.parent.removeLayer(r);return r===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(a){var o=n.data[a],s=i.lookup(a);s?o?o!==s&&Object.keys(o).forEach(function(u){be(o[u],s[u])||n.group.dirty(a,u)}):(n.group.dirty(a,"__exists"),Object.keys(s).forEach(function(u){n.group.dirty(a,u)})):n.delete(a)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return _(_({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(r){var n=this.parent.findChildRefIds(r);return ke.call(this.data,r)?_(_({},n),t.prototype.findChildRefIds.call(this,r)):n},e.prototype.getStorage=function(){for(var r=this.parent;r.parent;)r=r.parent;return r.getStorage.apply(r,arguments)},e}(Zn),J1=function(t){xe(e,t);function e(r){return t.call(this,"EntityStore.Stump",r,function(){},new _p(r.group.caching,r.group))||this}return e.prototype.removeLayer=function(){return this},e.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},e}(Er);function X1(t,e,r){var n=t[r],i=e[r];return be(n,i)?n:i}function an(t){return!!(t instanceof Zn&&t.group.caching)}function eg(t){return ee(t)?ue(t)?t.slice(0):_({__proto__:Object.getPrototypeOf(t)},t):t}var wo=function(){function t(){this.known=new(Cf?WeakSet:Set),this.pool=new Bt(wt),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return t.prototype.isKnown=function(e){return ee(e)&&this.known.has(e)},t.prototype.pass=function(e){if(ee(e)){var r=eg(e);return this.passes.set(r,e),r}return e},t.prototype.admit=function(e){var r=this;if(ee(e)){var n=this.passes.get(e);if(n)return n;var i=Object.getPrototypeOf(e);switch(i){case Array.prototype:{if(this.known.has(e))return e;var a=e.map(this.admit,this),o=this.pool.lookupArray(a);return o.array||(this.known.add(o.array=a),__DEV__&&Object.freeze(a)),o.array}case null:case Object.prototype:{if(this.known.has(e))return e;var s=Object.getPrototypeOf(e),u=[s],c=this.sortedKeys(e);u.push(c.json);var l=u.length;c.sorted.forEach(function(f){u.push(r.admit(e[f]))});var o=this.pool.lookupArray(u);if(!o.object){var d=o.object=Object.create(s);this.known.add(d),c.sorted.forEach(function(f,h){d[f]=u[l+h]}),__DEV__&&Object.freeze(d)}return o.object}}}return e},t.prototype.sortedKeys=function(e){var r=Object.keys(e),n=this.pool.lookupArray(r);if(!n.keys){r.sort();var i=JSON.stringify(r);(n.keys=this.keysByJSON.get(i))||this.keysByJSON.set(i,n.keys={sorted:r,json:i})}return n.keys},t}();var dt=Object.assign(function(t){if(ee(t)){Kc===void 0&&wp();var e=Kc.admit(t),r=Zc.get(e);return r===void 0&&Zc.set(e,r=JSON.stringify(e)),r}return JSON.stringify(t)},{reset:wp}),Kc,Zc;function wp(){Kc=new wo,Zc=new(wt?WeakMap:Map)}function Sp(t){return[t.selectionSet,t.objectOrReference,t.context,t.context.canonizeResults]}var Ep=function(){function t(e){var r=this;this.knownResults=new(wt?WeakMap:Map),this.config=_r(e,{addTypename:e.addTypename!==!1,canonizeResults:vo(e)}),this.canon=e.canon||new wo,this.executeSelectionSet=nn(function(n){var i,a=n.context.canonizeResults,o=Sp(n);o[3]=!a;var s=(i=r.executeSelectionSet).peek.apply(i,o);return s?a?_(_({},s),{result:r.canon.admit(s.result)}):s:(Wc(n.context.store,n.enclosingRef.__ref),r.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize,keyArgs:Sp,makeCacheKey:function(n,i,a,o){if(an(a.store))return a.store.makeCacheKey(n,K(i)?i.__ref:i,a.varString,o)}}),this.executeSubSelectedArray=nn(function(n){return Wc(n.context.store,n.enclosingRef.__ref),r.execSubSelectedArrayImpl(n)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(n){var i=n.field,a=n.array,o=n.context;if(an(o.store))return o.store.makeCacheKey(i,a,o.varString)}})}return t.prototype.resetCanon=function(){this.canon=new wo},t.prototype.diffQueryAgainstStore=function(e){var r=e.store,n=e.query,i=e.rootId,a=i===void 0?"ROOT_QUERY":i,o=e.variables,s=e.returnPartialData,u=s===void 0?!0:s,c=e.canonizeResults,l=c===void 0?this.config.canonizeResults:c,d=this.config.cache.policies;o=_(_({},en(Fi(n))),o);var p=Ut(a),f=this.executeSelectionSet({selectionSet:Xr(n).selectionSet,objectOrReference:p,enclosingRef:p,context:_({store:r,query:n,policies:d,variables:o,varString:dt(o),canonizeResults:l},bo(n,this.config.fragments))}),h;if(f.missing&&(h=[new Hi(tg(f.missing),f.missing,n,o)],!u))throw h[0];return{result:f.result,complete:!h,missing:h}},t.prototype.isFresh=function(e,r,n,i){if(an(i.store)&&this.knownResults.get(e)===n){var a=this.executeSelectionSet.peek(n,r,i,this.canon.isKnown(e));if(a&&e===a.result)return!0}return!1},t.prototype.execSelectionSetImpl=function(e){var r=this,n=e.selectionSet,i=e.objectOrReference,a=e.enclosingRef,o=e.context;if(K(i)&&!o.policies.rootTypenamesById[i.__ref]&&!o.store.has(i.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(i.__ref," object")};var s=o.variables,u=o.policies,c=o.store,l=c.getFieldValue(i,"__typename"),d=[],p,f=new it;this.config.addTypename&&typeof l=="string"&&!u.rootIdsByTypename[l]&&d.push({__typename:l});function h(v,m){var A;return v.missing&&(p=f.merge(p,(A={},A[m]=v.missing,A))),v.result}var g=new Set(n.selections);g.forEach(function(v){var m,A;if(!!er(v,s))if(pt(v)){var D=u.readField({fieldName:v.name.value,field:v,variables:o.variables,from:i},o),C=_t(v);D===void 0?tn.added(v)||(p=f.merge(p,(m={},m[C]="Can't find field '".concat(v.name.value,"' on ").concat(K(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),m))):ue(D)?D=h(r.executeSubSelectedArray({field:v,array:D,enclosingRef:a,context:o}),C):v.selectionSet?D!=null&&(D=h(r.executeSelectionSet({selectionSet:v.selectionSet,objectOrReference:D,enclosingRef:K(D)?D:a,context:o}),C)):o.canonizeResults&&(D=r.canon.pass(D)),D!==void 0&&d.push((A={},A[C]=D,A))}else{var O=Yr(v,o.lookupFragment);if(!O&&v.kind===Oe.FRAGMENT_SPREAD)throw __DEV__?new V("No fragment named ".concat(v.name.value)):new V(5);O&&u.fragmentMatches(O,l)&&O.selectionSet.selections.forEach(g.add,g)}});var y=Mi(d),S={result:y,missing:p},b=o.canonizeResults?this.canon.admit(S):Ui(S);return b.result&&this.knownResults.set(b.result,n),b},t.prototype.execSubSelectedArrayImpl=function(e){var r=this,n=e.field,i=e.array,a=e.enclosingRef,o=e.context,s,u=new it;function c(l,d){var p;return l.missing&&(s=u.merge(s,(p={},p[d]=l.missing,p))),l.result}return n.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(l,d){return l===null?null:ue(l)?c(r.executeSubSelectedArray({field:n,array:l,enclosingRef:a,context:o}),d):n.selectionSet?c(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:l,enclosingRef:K(l)?l:a,context:o}),d):(__DEV__&&rg(o.store,n,l),l)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:s}},t}();function tg(t){try{JSON.stringify(t,function(e,r){if(typeof r=="string")throw r;return r})}catch(e){return e}}function rg(t,e,r){if(!e.selectionSet){var n=new Set([r]);n.forEach(function(i){ee(i)&&(__DEV__?I(!K(i),"Missing selection set for object of type ".concat(yp(t,i)," returned for query field ").concat(e.name.value)):I(!K(i),6),Object.values(i).forEach(n.add,n))})}}var Yn=new Wn,Cp=new WeakMap;function Ki(t){var e=Cp.get(t);return e||Cp.set(t,e={vars:new Set,dep:mo()}),e}function Yc(t){Ki(t).vars.forEach(function(e){return e.forgetCache(t)})}function xp(t){Ki(t).vars.forEach(function(e){return e.attachCache(t)})}function So(t){var e=new Set,r=new Set,n=function(a){if(arguments.length>0){if(t!==a){t=a,e.forEach(function(u){Ki(u).dep.dirty(n),ng(u)});var o=Array.from(r);r.clear(),o.forEach(function(u){return u(t)})}}else{var s=Yn.getValue();s&&(i(s),Ki(s).dep(n))}return t};n.onNextChange=function(a){return r.add(a),function(){r.delete(a)}};var i=n.attachCache=function(a){return e.add(a),Ki(a).vars.add(n),n};return n.forgetCache=function(a){return e.delete(a)},n}function ng(t){t.broadcastWatches&&t.broadcastWatches()}var kp=Object.create(null);function Jc(t){var e=JSON.stringify(t);return kp[e]||(kp[e]=Object.create(null))}function Xc(t){var e=Jc(t);return e.keyFieldsFn||(e.keyFieldsFn=function(r,n){var i=function(o,s){return n.readField(s,o)},a=n.keyObject=tu(t,function(o){var s=Jn(n.storeObject,o,i);return s===void 0&&r!==n.storeObject&&ke.call(r,o[0])&&(s=Jn(r,o,Ap)),__DEV__?I(s!==void 0,"Missing field '".concat(o.join("."),"' while extracting keyFields from ").concat(JSON.stringify(r))):I(s!==void 0,2),s});return"".concat(n.typename,":").concat(JSON.stringify(a))})}function eu(t){var e=Jc(t);return e.keyArgsFn||(e.keyArgsFn=function(r,n){var i=n.field,a=n.variables,o=n.fieldName,s=tu(t,function(c){var l=c[0],d=l.charAt(0);if(d==="@"){if(i&&Re(i.directives)){var p=l.slice(1),f=i.directives.find(function(S){return S.name.value===p}),h=f&&tr(f,a);return h&&Jn(h,c.slice(1))}return}if(d==="$"){var g=l.slice(1);if(a&&ke.call(a,g)){var y=c.slice(0);return y[0]=g,Jn(a,y)}return}if(r)return Jn(r,c)}),u=JSON.stringify(s);return(r||u!=="{}")&&(o+=":"+u),o})}function tu(t,e){var r=new it;return Tp(t).reduce(function(n,i){var a,o=e(i);if(o!==void 0){for(var s=i.length-1;s>=0;--s)o=(a={},a[i[s]]=o,a);n=r.merge(n,o)}return n},Object.create(null))}function Tp(t){var e=Jc(t);if(!e.paths){var r=e.paths=[],n=[];t.forEach(function(i,a){ue(i)?(Tp(i).forEach(function(o){return r.push(n.concat(o))}),n.length=0):(n.push(i),ue(t[a+1])||(r.push(n.slice(0)),n.length=0))})}return e.paths}function Ap(t,e){return t[e]}function Jn(t,e,r){return r=r||Ap,Ip(e.reduce(function n(i,a){return ue(i)?i.map(function(o){return n(o,a)}):i&&r(i,a)},t))}function Ip(t){return ee(t)?ue(t)?t.map(Ip):tu(Object.keys(t).sort(),function(e){return Jn(t,e)}):t}Li.setStringify(dt);function ru(t){return t.args!==void 0?t.args:t.field?tr(t.field,t.variables):null}var ig=function(){},Op=function(t,e){return e.fieldName},Dp=function(t,e,r){var n=r.mergeObjects;return n(t,e)},Np=function(t,e){return e},Pp=function(){function t(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=_({dataIdFromObject:yo},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return t.prototype.identify=function(e,r){var n,i=this,a=r&&(r.typename||((n=r.storeObject)===null||n===void 0?void 0:n.__typename))||e.__typename;if(a===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=r&&r.storeObject||e,s=_(_({},r),{typename:a,storeObject:o,readField:r&&r.readField||function(){var p=Eo(arguments,o);return i.readField(p,{store:i.cache.data,variables:p.variables})}}),u,c=a&&this.getTypePolicy(a),l=c&&c.keyFn||this.config.dataIdFromObject;l;){var d=l(e,s);if(ue(d))l=Xc(d);else{u=d;break}}return u=u?String(u):void 0,s.keyObject?[u,s.keyObject]:[u]},t.prototype.addTypePolicies=function(e){var r=this;Object.keys(e).forEach(function(n){var i=e[n],a=i.queryType,o=i.mutationType,s=i.subscriptionType,u=jt(i,["queryType","mutationType","subscriptionType"]);a&&r.setRootTypename("Query",n),o&&r.setRootTypename("Mutation",n),s&&r.setRootTypename("Subscription",n),ke.call(r.toBeAdded,n)?r.toBeAdded[n].push(u):r.toBeAdded[n]=[u]})},t.prototype.updateTypePolicy=function(e,r){var n=this,i=this.getTypePolicy(e),a=r.keyFields,o=r.fields;function s(u,c){u.merge=typeof c=="function"?c:c===!0?Dp:c===!1?Np:u.merge}s(i,r.merge),i.keyFn=a===!1?ig:ue(a)?Xc(a):typeof a=="function"?a:i.keyFn,o&&Object.keys(o).forEach(function(u){var c=n.getFieldPolicy(e,u,!0),l=o[u];if(typeof l=="function")c.read=l;else{var d=l.keyArgs,p=l.read,f=l.merge;c.keyFn=d===!1?Op:ue(d)?eu(d):typeof d=="function"?d:c.keyFn,typeof p=="function"&&(c.read=p),s(c,f)}c.read&&c.merge&&(c.keyFn=c.keyFn||Op)})},t.prototype.setRootTypename=function(e,r){r===void 0&&(r=e);var n="ROOT_"+e.toUpperCase(),i=this.rootTypenamesById[n];r!==i&&(__DEV__?I(!i||i===e,"Cannot change root ".concat(e," __typename more than once")):I(!i||i===e,3),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[r]=n,this.rootTypenamesById[n]=r)},t.prototype.addPossibleTypes=function(e){var r=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(n){r.getSupertypeSet(n,!0),e[n].forEach(function(i){r.getSupertypeSet(i,!0).add(n);var a=i.match(Qc);(!a||a[0]!==i)&&r.fuzzySubtypes.set(i,new RegExp(i))})})},t.prototype.getTypePolicy=function(e){var r=this;if(!ke.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var i=this.supertypeMap.get(e);i&&i.size&&i.forEach(function(o){var s=r.getTypePolicy(o),u=s.fields,c=jt(s,["fields"]);Object.assign(n,c),Object.assign(n.fields,u)})}var a=this.toBeAdded[e];return a&&a.length&&a.splice(0).forEach(function(o){r.updateTypePolicy(e,o)}),this.typePolicies[e]},t.prototype.getFieldPolicy=function(e,r,n){if(e){var i=this.getTypePolicy(e).fields;return i[r]||n&&(i[r]=Object.create(null))}},t.prototype.getSupertypeSet=function(e,r){var n=this.supertypeMap.get(e);return!n&&r&&this.supertypeMap.set(e,n=new Set),n},t.prototype.fragmentMatches=function(e,r,n,i){var a=this;if(!e.typeCondition)return!0;if(!r)return!1;var o=e.typeCondition.name.value;if(r===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(r,!0),u=[s],c=function(h){var g=a.getSupertypeSet(h,!1);g&&g.size&&u.indexOf(g)<0&&u.push(g)},l=!!(n&&this.fuzzySubtypes.size),d=!1,p=0;p<u.length;++p){var f=u[p];if(f.has(o))return s.has(o)||(d&&__DEV__&&I.warn("Inferring subtype ".concat(r," of supertype ").concat(o)),s.add(o)),!0;f.forEach(c),l&&p===u.length-1&&go(e.selectionSet,n,i)&&(l=!1,d=!0,this.fuzzySubtypes.forEach(function(h,g){var y=r.match(h);y&&y[0]===r&&c(g)}))}return!1},t.prototype.hasKeyArgs=function(e,r){var n=this.getFieldPolicy(e,r,!1);return!!(n&&n.keyFn)},t.prototype.getStoreFieldName=function(e){var r=e.typename,n=e.fieldName,i=this.getFieldPolicy(r,n,!1),a,o=i&&i.keyFn;if(o&&r)for(var s={typename:r,fieldName:n,field:e.field||null,variables:e.variables},u=ru(e);o;){var c=o(u,s);if(ue(c))o=eu(c);else{a=c||n;break}}return a===void 0&&(a=e.field?pc(e.field,e.variables):Li(n,ru(e))),a===!1?n:n===Dt(a)?a:n+":"+a},t.prototype.readField=function(e,r){var n=e.from;if(!!n){var i=e.field||e.fieldName;if(!!i){if(e.typename===void 0){var a=r.store.getFieldValue(n,"__typename");a&&(e.typename=a)}var o=this.getStoreFieldName(e),s=Dt(o),u=r.store.getFieldValue(n,o),c=this.getFieldPolicy(e.typename,s,!1),l=c&&c.read;if(l){var d=Rp(this,n,e,r,r.store.getStorage(K(n)?n.__ref:n,o));return Yn.withValue(this.cache,l,[u,d])}return u}}},t.prototype.getReadFunction=function(e,r){var n=this.getFieldPolicy(e,r,!1);return n&&n.read},t.prototype.getMergeFunction=function(e,r,n){var i=this.getFieldPolicy(e,r,!1),a=i&&i.merge;return!a&&n&&(i=this.getTypePolicy(n),a=i&&i.merge),a},t.prototype.runMergeFunction=function(e,r,n,i,a){var o=n.field,s=n.typename,u=n.merge;return u===Dp?Lp(i.store)(e,r):u===Np?r:(i.overwrite&&(e=void 0),u(e,r,Rp(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:i.variables},i,a||Object.create(null))))},t}();function Rp(t,e,r,n,i){var a=t.getStoreFieldName(r),o=Dt(a),s=r.variables||n.variables,u=n.store,c=u.toReference,l=u.canRead;return{args:ru(r),field:r.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:K,toReference:c,storage:i,cache:t.cache,canRead:l,readField:function(){return t.readField(Eo(arguments,e,s),n)},mergeObjects:Lp(n.store)}}function Eo(t,e,r){var n=t[0],i=t[1],a=t.length,o;return typeof n=="string"?o={fieldName:n,from:a>1?i:e}:(o=_({},n),ke.call(o,"from")||(o.from=e)),__DEV__&&o.from===void 0&&__DEV__&&I.warn("Undefined 'from' passed to readField with arguments ".concat(Af(Array.from(t)))),o.variables===void 0&&(o.variables=r),o}function Lp(t){return function(r,n){if(ue(r)||ue(n))throw __DEV__?new V("Cannot automatically merge arrays"):new V(4);if(ee(r)&&ee(n)){var i=t.getFieldValue(r,"__typename"),a=t.getFieldValue(n,"__typename"),o=i&&a&&i!==a;if(o)return n;if(K(r)&&Sr(n))return t.merge(r.__ref,n),r;if(Sr(r)&&K(n))return t.merge(r,n.__ref),n;if(Sr(r)&&Sr(n))return _(_({},r),n)}return n}}function nu(t,e,r){var n="".concat(e).concat(r),i=t.flavors.get(n);return i||t.flavors.set(n,i=t.clientOnly===e&&t.deferred===r?t:_(_({},t),{clientOnly:e,deferred:r})),i}var jp=function(){function t(e,r,n){this.cache=e,this.reader=r,this.fragments=n}return t.prototype.writeToStore=function(e,r){var n=this,i=r.query,a=r.result,o=r.dataId,s=r.variables,u=r.overwrite,c=qt(i),l=vp();s=_(_({},en(c)),s);var d=_(_({store:e,written:Object.create(null),merge:function(f,h){return l.merge(f,h)},variables:s,varString:dt(s)},bo(i,this.fragments)),{overwrite:!!u,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),p=this.processSelectionSet({result:a||Object.create(null),dataId:o,selectionSet:c.selectionSet,mergeTree:{map:new Map},context:d});if(!K(p))throw __DEV__?new V("Could not identify object ".concat(JSON.stringify(a))):new V(7);return d.incomingById.forEach(function(f,h){var g=f.storeObject,y=f.mergeTree,S=f.fieldNodeSet,b=Ut(h);if(y&&y.map.size){var v=n.applyMerges(y,b,g,d);if(K(v))return;g=v}if(__DEV__&&!d.overwrite){var m=Object.create(null);S.forEach(function(C){C.selectionSet&&(m[C.name.value]=!0)});var A=function(C){return m[Dt(C)]===!0},D=function(C){var O=y&&y.map.get(C);return Boolean(O&&O.info&&O.info.merge)};Object.keys(g).forEach(function(C){A(C)&&!D(C)&&ag(b,g,C,d.store)})}e.merge(h,g)}),e.retain(p.__ref),p},t.prototype.processSelectionSet=function(e){var r=this,n=e.dataId,i=e.result,a=e.selectionSet,o=e.context,s=e.mergeTree,u=this.cache.policies,c=Object.create(null),l=n&&u.rootTypenamesById[n]||$i(i,a,o.fragmentMap)||n&&o.store.get(n,"__typename");typeof l=="string"&&(c.__typename=l);var d=function(){var v=Eo(arguments,c,o.variables);if(K(v.from)){var m=o.incomingById.get(v.from.__ref);if(m){var A=u.readField(_(_({},v),{from:m.storeObject}),o);if(A!==void 0)return A}}return u.readField(v,o)},p=new Set;this.flattenFields(a,i,o,l).forEach(function(v,m){var A,D=_t(m),C=i[D];if(p.add(m),C!==void 0){var O=u.getStoreFieldName({typename:l,fieldName:m.name.value,field:m,variables:v.variables}),P=$p(s,O),N=r.processFieldValue(C,m,m.selectionSet?nu(v,!1,!1):v,P),U=void 0;m.selectionSet&&(K(N)||Sr(N))&&(U=d("__typename",N));var qe=u.getMergeFunction(l,m.name.value,U);qe?P.info={field:m,typename:l,merge:qe}:Fp(s,O),c=v.merge(c,(A={},A[O]=N,A))}else __DEV__&&!v.clientOnly&&!v.deferred&&!tn.added(m)&&!u.getReadFunction(l,m.name.value)&&__DEV__&&I.error("Missing field '".concat(_t(m),"' while writing result ").concat(JSON.stringify(i,null,2)).substring(0,1e3))});try{var f=u.identify(i,{typename:l,selectionSet:a,fragmentMap:o.fragmentMap,storeObject:c,readField:d}),h=f[0],g=f[1];n=n||h,g&&(c=o.merge(c,g))}catch(v){if(!n)throw v}if(typeof n=="string"){var y=Ut(n),S=o.written[n]||(o.written[n]=[]);if(S.indexOf(a)>=0||(S.push(a),this.reader&&this.reader.isFresh(i,y,a,o)))return y;var b=o.incomingById.get(n);return b?(b.storeObject=o.merge(b.storeObject,c),b.mergeTree=iu(b.mergeTree,s),p.forEach(function(v){return b.fieldNodeSet.add(v)})):o.incomingById.set(n,{storeObject:c,mergeTree:Co(s)?void 0:s,fieldNodeSet:p}),y}return c},t.prototype.processFieldValue=function(e,r,n,i){var a=this;return!r.selectionSet||e===null?__DEV__?no(e):e:ue(e)?e.map(function(o,s){var u=a.processFieldValue(o,r,n,$p(i,s));return Fp(i,s),u}):this.processSelectionSet({result:e,selectionSet:r.selectionSet,context:n,mergeTree:i})},t.prototype.flattenFields=function(e,r,n,i){i===void 0&&(i=$i(r,e,n.fragmentMap));var a=new Map,o=this.cache.policies,s=new Bt(!1);return function u(c,l){var d=s.lookup(c,l.clientOnly,l.deferred);d.visited||(d.visited=!0,c.selections.forEach(function(p){if(!!er(p,n.variables)){var f=l.clientOnly,h=l.deferred;if(!(f&&h)&&Re(p.directives)&&p.directives.forEach(function(S){var b=S.name.value;if(b==="client"&&(f=!0),b==="defer"){var v=tr(S,n.variables);(!v||v.if!==!1)&&(h=!0)}}),pt(p)){var g=a.get(p);g&&(f=f&&g.clientOnly,h=h&&g.deferred),a.set(p,nu(n,f,h))}else{var y=Yr(p,n.lookupFragment);if(!y&&p.kind===Oe.FRAGMENT_SPREAD)throw __DEV__?new V("No fragment named ".concat(p.name.value)):new V(8);y&&o.fragmentMatches(y,i,r,n.variables)&&u(y.selectionSet,nu(n,f,h))}}}))}(e,n),a},t.prototype.applyMerges=function(e,r,n,i,a){var o,s=this;if(e.map.size&&!K(n)){var u=!ue(n)&&(K(r)||Sr(r))?r:void 0,c=n;u&&!a&&(a=[K(u)?u.__ref:u]);var l,d=function(p,f){return ue(p)?typeof f=="number"?p[f]:void 0:i.store.getFieldValue(p,String(f))};e.map.forEach(function(p,f){var h=d(u,f),g=d(c,f);if(g!==void 0){a&&a.push(f);var y=s.applyMerges(p,h,g,i,a);y!==g&&(l=l||new Map,l.set(f,y)),a&&I(a.pop()===f)}}),l&&(n=ue(c)?c.slice(0):_({},c),l.forEach(function(p,f){n[f]=p}))}return e.info?this.cache.policies.runMergeFunction(r,n,e.info,i,a&&(o=i.store).getStorage.apply(o,a)):n},t}();var Up=[];function $p(t,e){var r=t.map;return r.has(e)||r.set(e,Up.pop()||{map:new Map}),r.get(e)}function iu(t,e){if(t===e||!e||Co(e))return t;if(!t||Co(t))return e;var r=t.info&&e.info?_(_({},t.info),e.info):t.info||e.info,n=t.map.size&&e.map.size,i=n?new Map:t.map.size?t.map:e.map,a={info:r,map:i};if(n){var o=new Set(e.map.keys());t.map.forEach(function(s,u){a.map.set(u,iu(s,e.map.get(u))),o.delete(u)}),o.forEach(function(s){a.map.set(s,iu(e.map.get(s),t.map.get(s)))})}return a}function Co(t){return!t||!(t.info||t.map.size)}function Fp(t,e){var r=t.map,n=r.get(e);n&&Co(n)&&(Up.push(n),r.delete(e))}var Mp=new Set;function ag(t,e,r,n){var i=function(d){var p=n.getFieldValue(d,r);return typeof p=="object"&&p},a=i(t);if(!!a){var o=i(e);if(!!o&&!K(a)&&!be(a,o)&&!Object.keys(a).every(function(d){return n.getFieldValue(o,d)!==void 0})){var s=n.getFieldValue(t,"__typename")||n.getFieldValue(e,"__typename"),u=Dt(r),c="".concat(s,".").concat(u);if(!Mp.has(c)){Mp.add(c);var l=[];!ue(a)&&!ue(o)&&[a,o].forEach(function(d){var p=n.getFieldValue(d,"__typename");typeof p=="string"&&!l.includes(p)&&l.push(p)}),__DEV__&&I.warn("Cache data may be lost when replacing the ".concat(u," field of a ").concat(s,` object.
|
|
38
|
+
`):new H(23)};var Lf=function(){if(typeof AbortController>"u")return{controller:!1,signal:!1};var t=new AbortController,e=t.signal;return{controller:t,signal:e}};var Ff=function(t,e){var r=t.getContext(),n=r.uri;return n||(typeof e=="function"?e(t):e||"/graphql")};function Mf(t,e){var r=[],n=function(d,f){r.push("".concat(d,"=").concat(encodeURIComponent(f)))};if("query"in e&&n("query",e.query),e.operationName&&n("operationName",e.operationName),e.variables){var i=void 0;try{i=ga(e.variables,"Variables map")}catch(d){return{parseError:d}}n("variables",i)}if(e.extensions){var a=void 0;try{a=ga(e.extensions,"Extensions map")}catch(d){return{parseError:d}}n("extensions",a)}var o="",s=t,u=t.indexOf("#");u!==-1&&(o=t.substr(u),s=t.substr(0,u));var c=s.indexOf("?")===-1?"?":"&",l=s+c+r.join("&")+o;return{newURI:l}}var Uf=Ge(function(){return fetch}),jf=function(t){t===void 0&&(t={});var e=t.uri,r=e===void 0?"/graphql":e,n=t.fetch,i=t.print,a=i===void 0?Pf:i,o=t.includeExtensions,s=t.preserveHeaderCase,u=t.useGETForQueries,c=t.includeUnusedVariables,l=c===void 0?!1:c,d=Jt(t,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);__DEV__&&$f(n||Uf);var f={http:{includeExtensions:o,preserveHeaderCase:s},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new $t(function(p){var h=Ff(p,r),g=p.getContext(),b={};if(g.clientAwareness){var C=g.clientAwareness,w=C.name,_=C.version;w&&(b["apollographql-client-name"]=w),_&&(b["apollographql-client-version"]=_)}var y=S(S({},b),g.headers),T={http:g.http,options:g.fetchOptions,credentials:g.credentials,headers:y},R=Rf(p,a,Nf,f,T),k=R.options,P=R.body;if(P.variables&&!l){var M=new Set(Object.keys(P.variables));it(p.query,{Variable:function(ce,Kt,re){re&&re.kind!=="VariableDefinition"&&M.delete(ce.name.value)}}),M.size&&(P.variables=S({},P.variables),M.forEach(function(ce){delete P.variables[ce]}))}var $;if(!k.signal){var V=Lf(),Je=V.controller,je=V.signal;$=Je,$&&(k.signal=je)}var Q=function(ce){return ce.kind==="OperationDefinition"&&ce.operation==="mutation"};if(u&&!p.query.definitions.some(Q)&&(k.method="GET"),si(["defer"],p.query)&&(k.headers=k.headers||{},k.headers.accept="multipart/mixed; deferSpec=20220824, application/json"),k.method==="GET"){var _e=Mf(h,P),we=_e.newURI,se=_e.parseError;if(se)return zo(se);h=we}else try{k.body=ga(P,"Payload")}catch(ce){return zo(ce)}return new ne(function(ce){var Kt=n||Ge(function(){return fetch})||Uf;return Kt(h,k).then(function(re){var Zt;p.setContext({response:re});var Ar=(Zt=re.headers)===null||Zt===void 0?void 0:Zt.get("content-type");return Ar!==null&&/^multipart\/mixed/i.test(Ar)?Tf(re,ce):Df(re,p,ce)}).catch(function(re){return Wo(re,ce)}),function(){$&&$.abort()}})})};var wu=function(t){De(e,t);function e(r){r===void 0&&(r={});var n=t.call(this,jf(r).request)||this;return n.options=r,n}return e}($t);var{toString:Bf,hasOwnProperty:Cg}=Object.prototype,qf=Function.prototype.toString,Su=new Map;function Ee(t,e){try{return Cu(t,e)}finally{Su.clear()}}function Cu(t,e){if(t===e)return!0;let r=Bf.call(t),n=Bf.call(e);if(r!==n)return!1;switch(r){case"[object Array]":if(t.length!==e.length)return!1;case"[object Object]":{if(Qf(t,e))return!0;let i=Vf(t),a=Vf(e),o=i.length;if(o!==a.length)return!1;for(let s=0;s<o;++s)if(!Cg.call(e,i[s]))return!1;for(let s=0;s<o;++s){let u=i[s];if(!Cu(t[u],e[u]))return!1}return!0}case"[object Error]":return t.name===e.name&&t.message===e.message;case"[object Number]":if(t!==t)return e!==e;case"[object Boolean]":case"[object Date]":return+t==+e;case"[object RegExp]":case"[object String]":return t==`${e}`;case"[object Map]":case"[object Set]":{if(t.size!==e.size)return!1;if(Qf(t,e))return!0;let i=t.entries(),a=r==="[object Map]";for(;;){let o=i.next();if(o.done)break;let[s,u]=o.value;if(!e.has(s)||a&&!Cu(u,e.get(s)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":t=new Uint8Array(t),e=new Uint8Array(e);case"[object DataView]":{let i=t.byteLength;if(i===e.byteLength)for(;i--&&t[i]===e[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{let i=qf.call(t);return i!==qf.call(e)?!1:!kg(i,Eg)}}return!1}function Vf(t){return Object.keys(t).filter(xg,t)}function xg(t){return this[t]!==void 0}var Eg="{ [native code] }";function kg(t,e){let r=t.length-e.length;return r>=0&&t.indexOf(e,r)===r}function Qf(t,e){let r=Su.get(t);if(r){if(r.has(e))return!0}else Su.set(t,r=new Set);return r.add(e),!1}var Ag=function(){return Object.create(null)},zf=Array.prototype,Ig=zf.forEach,Tg=zf.slice,er=function(){function t(e,r){e===void 0&&(e=!0),r===void 0&&(r=Ag),this.weakness=e,this.makeData=r}return t.prototype.lookup=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return this.lookupArray(e)},t.prototype.lookupArray=function(e){var r=this;return Ig.call(e,function(n){return r=r.getChildTrie(n)}),r.data||(r.data=this.makeData(Tg.call(e)))},t.prototype.getChildTrie=function(e){var r=this.weakness&&Og(e)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),n=r.get(e);return n||r.set(e,n=new t(this.weakness,this.makeData)),n},t}();function Og(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}var et=null,Hf={},Dg=1,Ng=()=>class{constructor(){this.id=["slot",Dg++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=et;e;e=e.parent)if(this.id in e.slots){let r=e.slots[this.id];if(r===Hf)break;return e!==et&&(et.slots[this.id]=r),!0}return et&&(et.slots[this.id]=Hf),!1}getValue(){if(this.hasValue())return et.slots[this.id]}withValue(e,r,n,i){let a={__proto__:null,[this.id]:e},o=et;et={parent:o,slots:a};try{return r.apply(i,n)}finally{et=o}}static bind(e){let r=et;return function(){let n=et;try{return et=r,e.apply(this,arguments)}finally{et=n}}}static noContext(e,r,n){if(et){let i=et;try{return et=null,e.apply(n,r)}finally{et=i}}else return e.apply(n,r)}};function Gf(t){try{return t()}catch{}}var xu="@wry/context:Slot",Pg=Gf(()=>globalThis)||Gf(()=>global)||Object.create(null),Wf=Pg,mi=Wf[xu]||Array[xu]||function(t){try{Object.defineProperty(Wf,xu,{value:t,enumerable:!1,writable:!1,configurable:!0})}finally{return t}}(Ng());var{bind:Rg,noContext:$g}=mi;function Lg(){}var Fg=function(){function t(e,r){e===void 0&&(e=1/0),r===void 0&&(r=Lg),this.max=e,this.dispose=r,this.map=new Map,this.newest=null,this.oldest=null}return t.prototype.has=function(e){return this.map.has(e)},t.prototype.get=function(e){var r=this.getNode(e);return r&&r.value},t.prototype.getNode=function(e){var r=this.map.get(e);if(r&&r!==this.newest){var n=r.older,i=r.newer;i&&(i.older=n),n&&(n.newer=i),r.older=this.newest,r.older.newer=r,r.newer=null,this.newest=r,r===this.oldest&&(this.oldest=i)}return r},t.prototype.set=function(e,r){var n=this.getNode(e);return n?n.value=r:(n={key:e,value:r,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)},t.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},t.prototype.delete=function(e){var r=this.map.get(e);return r?(r===this.newest&&(this.newest=r.older),r===this.oldest&&(this.oldest=r.newer),r.newer&&(r.newer.older=r.older),r.older&&(r.older.newer=r.newer),this.map.delete(e),this.dispose(r.value,e),!0):!1},t}(),Zo=new mi,Eu,Mg=Object.prototype.hasOwnProperty,Au=(Eu=Array.from,Eu===void 0?function(t){var e=[];return t.forEach(function(r){return e.push(r)}),e}:Eu);function Ko(t){var e=t.unsubscribe;typeof e=="function"&&(t.unsubscribe=void 0,e())}var ya=[],Ug=100;function gi(t,e){if(!t)throw new Error(e||"assertion failure")}function jg(t,e){var r=t.length;return r>0&&r===e.length&&t[r-1]===e[r-1]}function Zf(t){switch(t.length){case 0:throw new Error("unknown value");case 1:return t[0];case 2:throw t[1]}}function Bg(t){return t.slice(0)}var qg=function(){function t(e){this.fn=e,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++t.count}return t.prototype.peek=function(){if(this.value.length===1&&!Fr(this))return Kf(this),this.value[0]},t.prototype.recompute=function(e){return gi(!this.recomputing,"already recomputing"),Kf(this),Fr(this)?Vg(this,e):Zf(this.value)},t.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,Jf(this),Ko(this))},t.prototype.dispose=function(){var e=this;this.setDirty(),rd(this),Iu(this,function(r,n){r.setDirty(),nd(r,e)})},t.prototype.forget=function(){this.dispose()},t.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=ya.pop()||new Set),this.deps.add(e)},t.prototype.forgetDeps=function(){var e=this;this.deps&&(Au(this.deps).forEach(function(r){return r.delete(e)}),this.deps.clear(),ya.push(this.deps),this.deps=null)},t.count=0,t}();function Kf(t){var e=Zo.getValue();if(e)return t.parents.add(e),e.childValues.has(t)||e.childValues.set(t,[]),Fr(t)?Xf(e,t):ed(e,t),e}function Vg(t,e){return rd(t),Zo.withValue(t,Qg,[t,e]),Hg(t,e)&&zg(t),Zf(t.value)}function Qg(t,e){t.recomputing=!0,t.value.length=0;try{t.value[0]=t.fn.apply(null,e)}catch(r){t.value[1]=r}t.recomputing=!1}function Fr(t){return t.dirty||!!(t.dirtyChildren&&t.dirtyChildren.size)}function zg(t){t.dirty=!1,!Fr(t)&&Yf(t)}function Jf(t){Iu(t,Xf)}function Yf(t){Iu(t,ed)}function Iu(t,e){var r=t.parents.size;if(r)for(var n=Au(t.parents),i=0;i<r;++i)e(n[i],t)}function Xf(t,e){gi(t.childValues.has(e)),gi(Fr(e));var r=!Fr(t);if(!t.dirtyChildren)t.dirtyChildren=ya.pop()||new Set;else if(t.dirtyChildren.has(e))return;t.dirtyChildren.add(e),r&&Jf(t)}function ed(t,e){gi(t.childValues.has(e)),gi(!Fr(e));var r=t.childValues.get(e);r.length===0?t.childValues.set(e,Bg(e.value)):jg(r,e.value)||t.setDirty(),td(t,e),!Fr(t)&&Yf(t)}function td(t,e){var r=t.dirtyChildren;r&&(r.delete(e),r.size===0&&(ya.length<Ug&&ya.push(r),t.dirtyChildren=null))}function rd(t){t.childValues.size>0&&t.childValues.forEach(function(e,r){nd(t,r)}),t.forgetDeps(),gi(t.dirtyChildren===null)}function nd(t,e){e.parents.delete(t),t.childValues.delete(e),td(t,e)}function Hg(t,e){if(typeof t.subscribe=="function")try{Ko(t),t.unsubscribe=t.subscribe.apply(null,e)}catch{return t.setDirty(),!1}return!0}var Gg={setDirty:!0,dispose:!0,forget:!0};function Jo(t){var e=new Map,r=t&&t.subscribe;function n(i){var a=Zo.getValue();if(a){var o=e.get(i);o||e.set(i,o=new Set),a.dependOn(o),typeof r=="function"&&(Ko(o),o.unsubscribe=r(i))}}return n.dirty=function(a,o){var s=e.get(a);if(s){var u=o&&Mg.call(Gg,o)?o:"setDirty";Au(s).forEach(function(c){return c[u]()}),e.delete(a),Ko(s)}},n}function id(){var t=new er(typeof WeakMap=="function");return function(){return t.lookupArray(arguments)}}var l9=id(),ku=new Set;function Cn(t,e){e===void 0&&(e=Object.create(null));var r=new Fg(e.max||Math.pow(2,16),function(c){return c.dispose()}),n=e.keyArgs,i=e.makeCacheKey||id(),a=function(){var c=i.apply(null,n?n.apply(null,arguments):arguments);if(c===void 0)return t.apply(null,arguments);var l=r.get(c);l||(r.set(c,l=new qg(t)),l.subscribe=e.subscribe,l.forget=function(){return r.delete(c)});var d=l.recompute(Array.prototype.slice.call(arguments));return r.set(c,l),ku.add(r),Zo.hasValue()||(ku.forEach(function(f){return f.clean()}),ku.clear()),d};Object.defineProperty(a,"size",{get:function(){return r.map.size},configurable:!1,enumerable:!1});function o(c){var l=r.get(c);l&&l.setDirty()}a.dirtyKey=o,a.dirty=function(){o(i.apply(null,arguments))};function s(c){var l=r.get(c);if(l)return l.peek()}a.peekKey=s,a.peek=function(){return s(i.apply(null,arguments))};function u(c){return r.delete(c)}return a.forgetKey=u,a.forget=function(){return u(i.apply(null,arguments))},a.makeCacheKey=i,a.getKey=n?function(){return i.apply(null,n.apply(null,arguments))}:i,Object.freeze(a)}var Tu=function(){function t(){this.getFragmentDoc=Cn(Kc)}return t.prototype.batch=function(e){var r=this,n=typeof e.optimistic=="string"?e.optimistic:e.optimistic===!1?null:void 0,i;return this.performTransaction(function(){return i=e.update(r)},n),i},t.prototype.recordOptimisticTransaction=function(e,r){this.performTransaction(e,r)},t.prototype.transformDocument=function(e){return e},t.prototype.transformForLink=function(e){return e},t.prototype.identify=function(e){},t.prototype.gc=function(){return[]},t.prototype.modify=function(e){return!1},t.prototype.readQuery=function(e,r){return r===void 0&&(r=!!e.optimistic),this.read(S(S({},e),{rootId:e.id||"ROOT_QUERY",optimistic:r}))},t.prototype.readFragment=function(e,r){return r===void 0&&(r=!!e.optimistic),this.read(S(S({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:r}))},t.prototype.writeQuery=function(e){var r=e.id,n=e.data,i=Jt(e,["id","data"]);return this.write(Object.assign(i,{dataId:r||"ROOT_QUERY",result:n}))},t.prototype.writeFragment=function(e){var r=e.id,n=e.data,i=e.fragment,a=e.fragmentName,o=Jt(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(i,a),dataId:r,result:n}))},t.prototype.updateQuery=function(e,r){return this.batch({update:function(n){var i=n.readQuery(e),a=r(i);return a==null?i:(n.writeQuery(S(S({},e),{data:a})),a)}})},t.prototype.updateFragment=function(e,r){return this.batch({update:function(n){var i=n.readFragment(e),a=r(i);return a==null?i:(n.writeFragment(S(S({},e),{data:a})),a)}})},t}();var va=function(t){De(e,t);function e(r,n,i,a){var o,s=t.call(this,r)||this;if(s.message=r,s.path=n,s.query=i,s.variables=a,Array.isArray(s.path)){s.missing=s.message;for(var u=s.path.length-1;u>=0;--u)s.missing=(o={},o[s.path[u]]=s.missing,o)}else s.missing=s.path;return s.__proto__=e.prototype,s}return e}(Error);var Ne=Object.prototype.hasOwnProperty;function ba(t){return t==null}function Xo(t,e){var r=t.__typename,n=t.id,i=t._id;if(typeof r=="string"&&(e&&(e.keyObject=ba(n)?ba(i)?void 0:{_id:i}:{id:n}),ba(n)&&!ba(i)&&(n=i),!ba(n)))return"".concat(r,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var ad={dataIdFromObject:Xo,addTypename:!0,resultCaching:!0,canonizeResults:!1};function od(t){return Lr(ad,t)}function es(t){var e=t.canonizeResults;return e===void 0?ad.canonizeResults:e}function sd(t,e){return ie(e)?t.get(e.__ref,"__typename"):e&&e.__typename}var Ou=/^[_a-z][_0-9a-z]*/i;function zt(t){var e=t.match(Ou);return e?e[0]:t}function Yo(t,e,r){return ue(e)?ye(e)?e.every(function(n){return Yo(t,n,r)}):t.selections.every(function(n){if(Ct(n)&&dr(n,r)){var i=Pt(n);return Ne.call(e,i)&&(!n.selectionSet||Yo(n.selectionSet,e[i],r))}return!0}):!1}function Mr(t){return ue(t)&&!ie(t)&&!ye(t)}function cd(){return new mt}function ts(t,e){var r=gn(vn(t));return{fragmentMap:r,lookupFragment:function(n){var i=r[n];return!i&&e&&(i=e.lookup(n)),i||null}}}var rs=Object.create(null),Du=function(){return rs},ud=Object.create(null),yi=function(){function t(e,r){var n=this;this.policies=e,this.group=r,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(i,a){return pa(ie(i)?n.get(i.__ref,a):i&&i[a])},this.canRead=function(i){return ie(i)?n.has(i.__ref):typeof i=="object"},this.toReference=function(i,a){if(typeof i=="string")return Yt(i);if(ie(i))return i;var o=n.policies.identify(i)[0];if(o){var s=Yt(o);return a&&n.merge(o,i),s}}}return t.prototype.toObject=function(){return S({},this.data)},t.prototype.has=function(e){return this.lookup(e,!0)!==void 0},t.prototype.get=function(e,r){if(this.group.depend(e,r),Ne.call(this.data,e)){var n=this.data[e];if(n&&Ne.call(n,r))return n[r]}if(r==="__typename"&&Ne.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof Ur)return this.parent.get(e,r)},t.prototype.lookup=function(e,r){if(r&&this.group.depend(e,"__exists"),Ne.call(this.data,e))return this.data[e];if(this instanceof Ur)return this.parent.lookup(e,r);if(this.policies.rootTypenamesById[e])return Object.create(null)},t.prototype.merge=function(e,r){var n=this,i;ie(e)&&(e=e.__ref),ie(r)&&(r=r.__ref);var a=typeof e=="string"?this.lookup(i=e):e,o=typeof r=="string"?this.lookup(i=r):r;if(!!o){__DEV__?N(typeof i=="string","store.merge expects a string ID"):N(typeof i=="string",1);var s=new mt(Kg).merge(a,o);if(this.data[i]=s,s!==a&&(delete this.refs[i],this.group.caching)){var u=Object.create(null);a||(u.__exists=1),Object.keys(o).forEach(function(c){if(!a||a[c]!==s[c]){u[c]=1;var l=zt(c);l!==c&&!n.policies.hasKeyArgs(s.__typename,l)&&(u[l]=1),s[c]===void 0&&!(n instanceof Ur)&&delete s[c]}}),u.__typename&&!(a&&a.__typename)&&this.policies.rootTypenamesById[i]===s.__typename&&delete u.__typename,Object.keys(u).forEach(function(c){return n.group.dirty(i,c)})}}},t.prototype.modify=function(e,r){var n=this,i=this.lookup(e);if(i){var a=Object.create(null),o=!1,s=!0,u={DELETE:rs,INVALIDATE:ud,isReference:ie,toReference:this.toReference,canRead:this.canRead,readField:function(c,l){return n.policies.readField(typeof c=="string"?{fieldName:c,from:l||Yt(e)}:c,{store:n})}};if(Object.keys(i).forEach(function(c){var l=zt(c),d=i[c];if(d!==void 0){var f=typeof r=="function"?r:r[c]||r[l];if(f){var p=f===Du?rs:f(pa(d),S(S({},u),{fieldName:l,storeFieldName:c,storage:n.getStorage(e,c)}));p===ud?n.group.dirty(e,c):(p===rs&&(p=void 0),p!==d&&(a[c]=p,o=!0,d=p))}d!==void 0&&(s=!1)}}),o)return this.merge(e,a),s&&(this instanceof Ur?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},t.prototype.delete=function(e,r,n){var i,a=this.lookup(e);if(a){var o=this.getFieldValue(a,"__typename"),s=r&&n?this.policies.getStoreFieldName({typename:o,fieldName:r,args:n}):r;return this.modify(e,s?(i={},i[s]=Du,i):Du)}return!1},t.prototype.evict=function(e,r){var n=!1;return e.id&&(Ne.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof Ur&&this!==r&&(n=this.parent.evict(e,r)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n},t.prototype.clear=function(){this.replace(null)},t.prototype.extract=function(){var e=this,r=this.toObject(),n=[];return this.getRootIdSet().forEach(function(i){Ne.call(e.policies.rootTypenamesById,i)||n.push(i)}),n.length&&(r.__META={extraRootIds:n.sort()}),r},t.prototype.replace=function(e){var r=this;if(Object.keys(this.data).forEach(function(a){e&&Ne.call(e,a)||r.delete(a)}),e){var n=e.__META,i=Jt(e,["__META"]);Object.keys(i).forEach(function(a){r.merge(a,i[a])}),n&&n.extraRootIds.forEach(this.retain,this)}},t.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},t.prototype.release=function(e){if(this.rootIds[e]>0){var r=--this.rootIds[e];return r||delete this.rootIds[e],r}return 0},t.prototype.getRootIdSet=function(e){return e===void 0&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof Ur?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},t.prototype.gc=function(){var e=this,r=this.getRootIdSet(),n=this.toObject();r.forEach(function(o){Ne.call(n,o)&&(Object.keys(e.findChildRefIds(o)).forEach(r.add,r),delete n[o])});var i=Object.keys(n);if(i.length){for(var a=this;a instanceof Ur;)a=a.parent;i.forEach(function(o){return a.delete(o)})}return i},t.prototype.findChildRefIds=function(e){if(!Ne.call(this.refs,e)){var r=this.refs[e]=Object.create(null),n=this.data[e];if(!n)return r;var i=new Set([n]);i.forEach(function(a){ie(a)&&(r[a.__ref]=!0),ue(a)&&Object.keys(a).forEach(function(o){var s=a[o];ue(s)&&i.add(s)})})}return this.refs[e]},t.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},t}();var ld=function(){function t(e,r){r===void 0&&(r=null),this.caching=e,this.parent=r,this.d=null,this.resetCaching()}return t.prototype.resetCaching=function(){this.d=this.caching?Jo():null,this.keyMaker=new er(Rt)},t.prototype.depend=function(e,r){if(this.d){this.d(Nu(e,r));var n=zt(r);n!==r&&this.d(Nu(e,n)),this.parent&&this.parent.depend(e,r)}},t.prototype.dirty=function(e,r){this.d&&this.d.dirty(Nu(e,r),r==="__exists"?"forget":"setDirty")},t}();function Nu(t,e){return e+"#"+t}function Pu(t,e){xn(t)&&t.group.depend(e,"__exists")}(function(t){var e=function(r){De(n,r);function n(i){var a=i.policies,o=i.resultCaching,s=o===void 0?!0:o,u=i.seed,c=r.call(this,a,new ld(s))||this;return c.stump=new Wg(c),c.storageTrie=new er(Rt),u&&c.replace(u),c}return n.prototype.addLayer=function(i,a){return this.stump.addLayer(i,a)},n.prototype.removeLayer=function(){return this},n.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},n}(t);t.Root=e})(yi||(yi={}));var Ur=function(t){De(e,t);function e(r,n,i,a){var o=t.call(this,n.policies,a)||this;return o.id=r,o.parent=n,o.replay=i,o.group=a,i(o),o}return e.prototype.addLayer=function(r,n){return new e(r,this,n,this.group)},e.prototype.removeLayer=function(r){var n=this,i=this.parent.removeLayer(r);return r===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(a){var o=n.data[a],s=i.lookup(a);s?o?o!==s&&Object.keys(o).forEach(function(u){Ee(o[u],s[u])||n.group.dirty(a,u)}):(n.group.dirty(a,"__exists"),Object.keys(s).forEach(function(u){n.group.dirty(a,u)})):n.delete(a)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return S(S({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(r){var n=this.parent.findChildRefIds(r);return Ne.call(this.data,r)?S(S({},n),t.prototype.findChildRefIds.call(this,r)):n},e.prototype.getStorage=function(){for(var r=this.parent;r.parent;)r=r.parent;return r.getStorage.apply(r,arguments)},e}(yi),Wg=function(t){De(e,t);function e(r){return t.call(this,"EntityStore.Stump",r,function(){},new ld(r.group.caching,r.group))||this}return e.prototype.removeLayer=function(){return this},e.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},e}(Ur);function Kg(t,e,r){var n=t[r],i=e[r];return Ee(n,i)?n:i}function xn(t){return!!(t instanceof yi&&t.group.caching)}function Zg(t){return ue(t)?ye(t)?t.slice(0):S({__proto__:Object.getPrototypeOf(t)},t):t}var ns=function(){function t(){this.known=new(hf?WeakSet:Set),this.pool=new er(Rt),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return t.prototype.isKnown=function(e){return ue(e)&&this.known.has(e)},t.prototype.pass=function(e){if(ue(e)){var r=Zg(e);return this.passes.set(r,e),r}return e},t.prototype.admit=function(e){var r=this;if(ue(e)){var n=this.passes.get(e);if(n)return n;var i=Object.getPrototypeOf(e);switch(i){case Array.prototype:{if(this.known.has(e))return e;var a=e.map(this.admit,this),o=this.pool.lookupArray(a);return o.array||(this.known.add(o.array=a),__DEV__&&Object.freeze(a)),o.array}case null:case Object.prototype:{if(this.known.has(e))return e;var s=Object.getPrototypeOf(e),u=[s],c=this.sortedKeys(e);u.push(c.json);var l=u.length;c.sorted.forEach(function(p){u.push(r.admit(e[p]))});var o=this.pool.lookupArray(u);if(!o.object){var d=o.object=Object.create(s);this.known.add(d),c.sorted.forEach(function(p,h){d[p]=u[l+h]}),__DEV__&&Object.freeze(d)}return o.object}}}return e},t.prototype.sortedKeys=function(e){var r=Object.keys(e),n=this.pool.lookupArray(r);if(!n.keys){r.sort();var i=JSON.stringify(r);(n.keys=this.keysByJSON.get(i))||this.keysByJSON.set(i,n.keys={sorted:r,json:i})}return n.keys},t}();var xt=Object.assign(function(t){if(ue(t)){Ru===void 0&&pd();var e=Ru.admit(t),r=$u.get(e);return r===void 0&&$u.set(e,r=JSON.stringify(e)),r}return JSON.stringify(t)},{reset:pd}),Ru,$u;function pd(){Ru=new ns,$u=new(Rt?WeakMap:Map)}function fd(t){return[t.selectionSet,t.objectOrReference,t.context,t.context.canonizeResults]}var dd=function(){function t(e){var r=this;this.knownResults=new(Rt?WeakMap:Map),this.config=Lr(e,{addTypename:e.addTypename!==!1,canonizeResults:es(e)}),this.canon=e.canon||new ns,this.executeSelectionSet=Cn(function(n){var i,a=n.context.canonizeResults,o=fd(n);o[3]=!a;var s=(i=r.executeSelectionSet).peek.apply(i,o);return s?a?S(S({},s),{result:r.canon.admit(s.result)}):s:(Pu(n.context.store,n.enclosingRef.__ref),r.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize,keyArgs:fd,makeCacheKey:function(n,i,a,o){if(xn(a.store))return a.store.makeCacheKey(n,ie(i)?i.__ref:i,a.varString,o)}}),this.executeSubSelectedArray=Cn(function(n){return Pu(n.context.store,n.enclosingRef.__ref),r.execSubSelectedArrayImpl(n)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(n){var i=n.field,a=n.array,o=n.context;if(xn(o.store))return o.store.makeCacheKey(i,a,o.varString)}})}return t.prototype.resetCanon=function(){this.canon=new ns},t.prototype.diffQueryAgainstStore=function(e){var r=e.store,n=e.query,i=e.rootId,a=i===void 0?"ROOT_QUERY":i,o=e.variables,s=e.returnPartialData,u=s===void 0?!0:s,c=e.canonizeResults,l=c===void 0?this.config.canonizeResults:c,d=this.config.cache.policies;o=S(S({},_n(ca(n))),o);var f=Yt(a),p=this.executeSelectionSet({selectionSet:bn(n).selectionSet,objectOrReference:f,enclosingRef:f,context:S({store:r,query:n,policies:d,variables:o,varString:xt(o),canonizeResults:l},ts(n,this.config.fragments))}),h;if(p.missing&&(h=[new va(Jg(p.missing),p.missing,n,o)],!u))throw h[0];return{result:p.result,complete:!h,missing:h}},t.prototype.isFresh=function(e,r,n,i){if(xn(i.store)&&this.knownResults.get(e)===n){var a=this.executeSelectionSet.peek(n,r,i,this.canon.isKnown(e));if(a&&e===a.result)return!0}return!1},t.prototype.execSelectionSetImpl=function(e){var r=this,n=e.selectionSet,i=e.objectOrReference,a=e.enclosingRef,o=e.context;if(ie(i)&&!o.policies.rootTypenamesById[i.__ref]&&!o.store.has(i.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(i.__ref," object")};var s=o.variables,u=o.policies,c=o.store,l=c.getFieldValue(i,"__typename"),d=[],f,p=new mt;this.config.addTypename&&typeof l=="string"&&!u.rootIdsByTypename[l]&&d.push({__typename:l});function h(_,y){var T;return _.missing&&(f=p.merge(f,(T={},T[y]=_.missing,T))),_.result}var g=new Set(n.selections);g.forEach(function(_){var y,T;if(!!dr(_,s))if(Ct(_)){var R=u.readField({fieldName:_.name.value,field:_,variables:o.variables,from:i},o),k=Pt(_);R===void 0?wn.added(_)||(f=p.merge(f,(y={},y[k]="Can't find field '".concat(_.name.value,"' on ").concat(ie(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),y))):ye(R)?R=h(r.executeSubSelectedArray({field:_,array:R,enclosingRef:a,context:o}),k):_.selectionSet?R!=null&&(R=h(r.executeSelectionSet({selectionSet:_.selectionSet,objectOrReference:R,enclosingRef:ie(R)?R:a,context:o}),k)):o.canonizeResults&&(R=r.canon.pass(R)),R!==void 0&&d.push((T={},T[k]=R,T))}else{var P=yn(_,o.lookupFragment);if(!P&&_.kind===Le.FRAGMENT_SPREAD)throw __DEV__?new H("No fragment named ".concat(_.name.value)):new H(5);P&&u.fragmentMatches(P,l)&&P.selectionSet.selections.forEach(g.add,g)}});var b=ua(d),C={result:b,missing:f},w=o.canonizeResults?this.canon.admit(C):pa(C);return w.result&&this.knownResults.set(w.result,n),w},t.prototype.execSubSelectedArrayImpl=function(e){var r=this,n=e.field,i=e.array,a=e.enclosingRef,o=e.context,s,u=new mt;function c(l,d){var f;return l.missing&&(s=u.merge(s,(f={},f[d]=l.missing,f))),l.result}return n.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(l,d){return l===null?null:ye(l)?c(r.executeSubSelectedArray({field:n,array:l,enclosingRef:a,context:o}),d):n.selectionSet?c(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:l,enclosingRef:ie(l)?l:a,context:o}),d):(__DEV__&&Yg(o.store,n,l),l)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:s}},t}();function Jg(t){try{JSON.stringify(t,function(e,r){if(typeof r=="string")throw r;return r})}catch(e){return e}}function Yg(t,e,r){if(!e.selectionSet){var n=new Set([r]);n.forEach(function(i){ue(i)&&(__DEV__?N(!ie(i),"Missing selection set for object of type ".concat(sd(t,i)," returned for query field ").concat(e.name.value)):N(!ie(i),6),Object.values(i).forEach(n.add,n))})}}var vi=new mi,hd=new WeakMap;function _a(t){var e=hd.get(t);return e||hd.set(t,e={vars:new Set,dep:Jo()}),e}function Lu(t){_a(t).vars.forEach(function(e){return e.forgetCache(t)})}function md(t){_a(t).vars.forEach(function(e){return e.attachCache(t)})}function is(t){var e=new Set,r=new Set,n=function(a){if(arguments.length>0){if(t!==a){t=a,e.forEach(function(u){_a(u).dep.dirty(n),Xg(u)});var o=Array.from(r);r.clear(),o.forEach(function(u){return u(t)})}}else{var s=vi.getValue();s&&(i(s),_a(s).dep(n))}return t};n.onNextChange=function(a){return r.add(a),function(){r.delete(a)}};var i=n.attachCache=function(a){return e.add(a),_a(a).vars.add(n),n};return n.forgetCache=function(a){return e.delete(a)},n}function Xg(t){t.broadcastWatches&&t.broadcastWatches()}var gd=Object.create(null);function Fu(t){var e=JSON.stringify(t);return gd[e]||(gd[e]=Object.create(null))}function Mu(t){var e=Fu(t);return e.keyFieldsFn||(e.keyFieldsFn=function(r,n){var i=function(o,s){return n.readField(s,o)},a=n.keyObject=ju(t,function(o){var s=bi(n.storeObject,o,i);return s===void 0&&r!==n.storeObject&&Ne.call(r,o[0])&&(s=bi(r,o,vd)),__DEV__?N(s!==void 0,"Missing field '".concat(o.join("."),"' while extracting keyFields from ").concat(JSON.stringify(r))):N(s!==void 0,2),s});return"".concat(n.typename,":").concat(JSON.stringify(a))})}function Uu(t){var e=Fu(t);return e.keyArgsFn||(e.keyArgsFn=function(r,n){var i=n.field,a=n.variables,o=n.fieldName,s=ju(t,function(c){var l=c[0],d=l.charAt(0);if(d==="@"){if(i&&Be(i.directives)){var f=l.slice(1),p=i.directives.find(function(C){return C.name.value===f}),h=p&&hr(p,a);return h&&bi(h,c.slice(1))}return}if(d==="$"){var g=l.slice(1);if(a&&Ne.call(a,g)){var b=c.slice(0);return b[0]=g,bi(a,b)}return}if(r)return bi(r,c)}),u=JSON.stringify(s);return(r||u!=="{}")&&(o+=":"+u),o})}function ju(t,e){var r=new mt;return yd(t).reduce(function(n,i){var a,o=e(i);if(o!==void 0){for(var s=i.length-1;s>=0;--s)o=(a={},a[i[s]]=o,a);n=r.merge(n,o)}return n},Object.create(null))}function yd(t){var e=Fu(t);if(!e.paths){var r=e.paths=[],n=[];t.forEach(function(i,a){ye(i)?(yd(i).forEach(function(o){return r.push(n.concat(o))}),n.length=0):(n.push(i),ye(t[a+1])||(r.push(n.slice(0)),n.length=0))})}return e.paths}function vd(t,e){return t[e]}function bi(t,e,r){return r=r||vd,bd(e.reduce(function n(i,a){return ye(i)?i.map(function(o){return n(o,a)}):i&&r(i,a)},t))}function bd(t){return ue(t)?ye(t)?t.map(bd):ju(Object.keys(t).sort(),function(e){return bi(t,e)}):t}oa.setStringify(xt);function Bu(t){return t.args!==void 0?t.args:t.field?hr(t.field,t.variables):null}var ey=function(){},_d=function(t,e){return e.fieldName},wd=function(t,e,r){var n=r.mergeObjects;return n(t,e)},Sd=function(t,e){return e},xd=function(){function t(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=S({dataIdFromObject:Xo},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return t.prototype.identify=function(e,r){var n,i=this,a=r&&(r.typename||((n=r.storeObject)===null||n===void 0?void 0:n.__typename))||e.__typename;if(a===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=r&&r.storeObject||e,s=S(S({},r),{typename:a,storeObject:o,readField:r&&r.readField||function(){var f=as(arguments,o);return i.readField(f,{store:i.cache.data,variables:f.variables})}}),u,c=a&&this.getTypePolicy(a),l=c&&c.keyFn||this.config.dataIdFromObject;l;){var d=l(e,s);if(ye(d))l=Mu(d);else{u=d;break}}return u=u?String(u):void 0,s.keyObject?[u,s.keyObject]:[u]},t.prototype.addTypePolicies=function(e){var r=this;Object.keys(e).forEach(function(n){var i=e[n],a=i.queryType,o=i.mutationType,s=i.subscriptionType,u=Jt(i,["queryType","mutationType","subscriptionType"]);a&&r.setRootTypename("Query",n),o&&r.setRootTypename("Mutation",n),s&&r.setRootTypename("Subscription",n),Ne.call(r.toBeAdded,n)?r.toBeAdded[n].push(u):r.toBeAdded[n]=[u]})},t.prototype.updateTypePolicy=function(e,r){var n=this,i=this.getTypePolicy(e),a=r.keyFields,o=r.fields;function s(u,c){u.merge=typeof c=="function"?c:c===!0?wd:c===!1?Sd:u.merge}s(i,r.merge),i.keyFn=a===!1?ey:ye(a)?Mu(a):typeof a=="function"?a:i.keyFn,o&&Object.keys(o).forEach(function(u){var c=n.getFieldPolicy(e,u,!0),l=o[u];if(typeof l=="function")c.read=l;else{var d=l.keyArgs,f=l.read,p=l.merge;c.keyFn=d===!1?_d:ye(d)?Uu(d):typeof d=="function"?d:c.keyFn,typeof f=="function"&&(c.read=f),s(c,p)}c.read&&c.merge&&(c.keyFn=c.keyFn||_d)})},t.prototype.setRootTypename=function(e,r){r===void 0&&(r=e);var n="ROOT_"+e.toUpperCase(),i=this.rootTypenamesById[n];r!==i&&(__DEV__?N(!i||i===e,"Cannot change root ".concat(e," __typename more than once")):N(!i||i===e,3),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[r]=n,this.rootTypenamesById[n]=r)},t.prototype.addPossibleTypes=function(e){var r=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(n){r.getSupertypeSet(n,!0),e[n].forEach(function(i){r.getSupertypeSet(i,!0).add(n);var a=i.match(Ou);(!a||a[0]!==i)&&r.fuzzySubtypes.set(i,new RegExp(i))})})},t.prototype.getTypePolicy=function(e){var r=this;if(!Ne.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var i=this.supertypeMap.get(e);i&&i.size&&i.forEach(function(o){var s=r.getTypePolicy(o),u=s.fields,c=Jt(s,["fields"]);Object.assign(n,c),Object.assign(n.fields,u)})}var a=this.toBeAdded[e];return a&&a.length&&a.splice(0).forEach(function(o){r.updateTypePolicy(e,o)}),this.typePolicies[e]},t.prototype.getFieldPolicy=function(e,r,n){if(e){var i=this.getTypePolicy(e).fields;return i[r]||n&&(i[r]=Object.create(null))}},t.prototype.getSupertypeSet=function(e,r){var n=this.supertypeMap.get(e);return!n&&r&&this.supertypeMap.set(e,n=new Set),n},t.prototype.fragmentMatches=function(e,r,n,i){var a=this;if(!e.typeCondition)return!0;if(!r)return!1;var o=e.typeCondition.name.value;if(r===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(r,!0),u=[s],c=function(h){var g=a.getSupertypeSet(h,!1);g&&g.size&&u.indexOf(g)<0&&u.push(g)},l=!!(n&&this.fuzzySubtypes.size),d=!1,f=0;f<u.length;++f){var p=u[f];if(p.has(o))return s.has(o)||(d&&__DEV__&&N.warn("Inferring subtype ".concat(r," of supertype ").concat(o)),s.add(o)),!0;p.forEach(c),l&&f===u.length-1&&Yo(e.selectionSet,n,i)&&(l=!1,d=!0,this.fuzzySubtypes.forEach(function(h,g){var b=r.match(h);b&&b[0]===r&&c(g)}))}return!1},t.prototype.hasKeyArgs=function(e,r){var n=this.getFieldPolicy(e,r,!1);return!!(n&&n.keyFn)},t.prototype.getStoreFieldName=function(e){var r=e.typename,n=e.fieldName,i=this.getFieldPolicy(r,n,!1),a,o=i&&i.keyFn;if(o&&r)for(var s={typename:r,fieldName:n,field:e.field||null,variables:e.variables},u=Bu(e);o;){var c=o(u,s);if(ye(c))o=Uu(c);else{a=c||n;break}}return a===void 0&&(a=e.field?Jc(e.field,e.variables):oa(n,Bu(e))),a===!1?n:n===zt(a)?a:n+":"+a},t.prototype.readField=function(e,r){var n=e.from;if(!!n){var i=e.field||e.fieldName;if(!!i){if(e.typename===void 0){var a=r.store.getFieldValue(n,"__typename");a&&(e.typename=a)}var o=this.getStoreFieldName(e),s=zt(o),u=r.store.getFieldValue(n,o),c=this.getFieldPolicy(e.typename,s,!1),l=c&&c.read;if(l){var d=Cd(this,n,e,r,r.store.getStorage(ie(n)?n.__ref:n,o));return vi.withValue(this.cache,l,[u,d])}return u}}},t.prototype.getReadFunction=function(e,r){var n=this.getFieldPolicy(e,r,!1);return n&&n.read},t.prototype.getMergeFunction=function(e,r,n){var i=this.getFieldPolicy(e,r,!1),a=i&&i.merge;return!a&&n&&(i=this.getTypePolicy(n),a=i&&i.merge),a},t.prototype.runMergeFunction=function(e,r,n,i,a){var o=n.field,s=n.typename,u=n.merge;return u===wd?Ed(i.store)(e,r):u===Sd?r:(i.overwrite&&(e=void 0),u(e,r,Cd(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:i.variables},i,a||Object.create(null))))},t}();function Cd(t,e,r,n,i){var a=t.getStoreFieldName(r),o=zt(a),s=r.variables||n.variables,u=n.store,c=u.toReference,l=u.canRead;return{args:Bu(r),field:r.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:ie,toReference:c,storage:i,cache:t.cache,canRead:l,readField:function(){return t.readField(as(arguments,e,s),n)},mergeObjects:Ed(n.store)}}function as(t,e,r){var n=t[0],i=t[1],a=t.length,o;return typeof n=="string"?o={fieldName:n,from:a>1?i:e}:(o=S({},n),Ne.call(o,"from")||(o.from=e)),__DEV__&&o.from===void 0&&__DEV__&&N.warn("Undefined 'from' passed to readField with arguments ".concat(vf(Array.from(t)))),o.variables===void 0&&(o.variables=r),o}function Ed(t){return function(r,n){if(ye(r)||ye(n))throw __DEV__?new H("Cannot automatically merge arrays"):new H(4);if(ue(r)&&ue(n)){var i=t.getFieldValue(r,"__typename"),a=t.getFieldValue(n,"__typename"),o=i&&a&&i!==a;if(o)return n;if(ie(r)&&Mr(n))return t.merge(r.__ref,n),r;if(Mr(r)&&ie(n))return t.merge(r,n.__ref),n;if(Mr(r)&&Mr(n))return S(S({},r),n)}return n}}function qu(t,e,r){var n="".concat(e).concat(r),i=t.flavors.get(n);return i||t.flavors.set(n,i=t.clientOnly===e&&t.deferred===r?t:S(S({},t),{clientOnly:e,deferred:r})),i}var Td=function(){function t(e,r,n){this.cache=e,this.reader=r,this.fragments=n}return t.prototype.writeToStore=function(e,r){var n=this,i=r.query,a=r.result,o=r.dataId,s=r.variables,u=r.overwrite,c=Xt(i),l=cd();s=S(S({},_n(c)),s);var d=S(S({store:e,written:Object.create(null),merge:function(p,h){return l.merge(p,h)},variables:s,varString:xt(s)},ts(i,this.fragments)),{overwrite:!!u,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),f=this.processSelectionSet({result:a||Object.create(null),dataId:o,selectionSet:c.selectionSet,mergeTree:{map:new Map},context:d});if(!ie(f))throw __DEV__?new H("Could not identify object ".concat(JSON.stringify(a))):new H(7);return d.incomingById.forEach(function(p,h){var g=p.storeObject,b=p.mergeTree,C=p.fieldNodeSet,w=Yt(h);if(b&&b.map.size){var _=n.applyMerges(b,w,g,d);if(ie(_))return;g=_}if(__DEV__&&!d.overwrite){var y=Object.create(null);C.forEach(function(k){k.selectionSet&&(y[k.name.value]=!0)});var T=function(k){return y[zt(k)]===!0},R=function(k){var P=b&&b.map.get(k);return Boolean(P&&P.info&&P.info.merge)};Object.keys(g).forEach(function(k){T(k)&&!R(k)&&ty(w,g,k,d.store)})}e.merge(h,g)}),e.retain(f.__ref),f},t.prototype.processSelectionSet=function(e){var r=this,n=e.dataId,i=e.result,a=e.selectionSet,o=e.context,s=e.mergeTree,u=this.cache.policies,c=Object.create(null),l=n&&u.rootTypenamesById[n]||sa(i,a,o.fragmentMap)||n&&o.store.get(n,"__typename");typeof l=="string"&&(c.__typename=l);var d=function(){var _=as(arguments,c,o.variables);if(ie(_.from)){var y=o.incomingById.get(_.from.__ref);if(y){var T=u.readField(S(S({},_),{from:y.storeObject}),o);if(T!==void 0)return T}}return u.readField(_,o)},f=new Set;this.flattenFields(a,i,o,l).forEach(function(_,y){var T,R=Pt(y),k=i[R];if(f.add(y),k!==void 0){var P=u.getStoreFieldName({typename:l,fieldName:y.name.value,field:y,variables:_.variables}),M=kd(s,P),$=r.processFieldValue(k,y,y.selectionSet?qu(_,!1,!1):_,M),V=void 0;y.selectionSet&&(ie($)||Mr($))&&(V=d("__typename",$));var Je=u.getMergeFunction(l,y.name.value,V);Je?M.info={field:y,typename:l,merge:Je}:Ad(s,P),c=_.merge(c,(T={},T[P]=$,T))}else __DEV__&&!_.clientOnly&&!_.deferred&&!wn.added(y)&&!u.getReadFunction(l,y.name.value)&&__DEV__&&N.error("Missing field '".concat(Pt(y),"' while writing result ").concat(JSON.stringify(i,null,2)).substring(0,1e3))});try{var p=u.identify(i,{typename:l,selectionSet:a,fragmentMap:o.fragmentMap,storeObject:c,readField:d}),h=p[0],g=p[1];n=n||h,g&&(c=o.merge(c,g))}catch(_){if(!n)throw _}if(typeof n=="string"){var b=Yt(n),C=o.written[n]||(o.written[n]=[]);if(C.indexOf(a)>=0||(C.push(a),this.reader&&this.reader.isFresh(i,b,a,o)))return b;var w=o.incomingById.get(n);return w?(w.storeObject=o.merge(w.storeObject,c),w.mergeTree=Vu(w.mergeTree,s),f.forEach(function(_){return w.fieldNodeSet.add(_)})):o.incomingById.set(n,{storeObject:c,mergeTree:os(s)?void 0:s,fieldNodeSet:f}),b}return c},t.prototype.processFieldValue=function(e,r,n,i){var a=this;return!r.selectionSet||e===null?__DEV__?jo(e):e:ye(e)?e.map(function(o,s){var u=a.processFieldValue(o,r,n,kd(i,s));return Ad(i,s),u}):this.processSelectionSet({result:e,selectionSet:r.selectionSet,context:n,mergeTree:i})},t.prototype.flattenFields=function(e,r,n,i){i===void 0&&(i=sa(r,e,n.fragmentMap));var a=new Map,o=this.cache.policies,s=new er(!1);return function u(c,l){var d=s.lookup(c,l.clientOnly,l.deferred);d.visited||(d.visited=!0,c.selections.forEach(function(f){if(!!dr(f,n.variables)){var p=l.clientOnly,h=l.deferred;if(!(p&&h)&&Be(f.directives)&&f.directives.forEach(function(C){var w=C.name.value;if(w==="client"&&(p=!0),w==="defer"){var _=hr(C,n.variables);(!_||_.if!==!1)&&(h=!0)}}),Ct(f)){var g=a.get(f);g&&(p=p&&g.clientOnly,h=h&&g.deferred),a.set(f,qu(n,p,h))}else{var b=yn(f,n.lookupFragment);if(!b&&f.kind===Le.FRAGMENT_SPREAD)throw __DEV__?new H("No fragment named ".concat(f.name.value)):new H(8);b&&o.fragmentMatches(b,i,r,n.variables)&&u(b.selectionSet,qu(n,p,h))}}}))}(e,n),a},t.prototype.applyMerges=function(e,r,n,i,a){var o,s=this;if(e.map.size&&!ie(n)){var u=!ye(n)&&(ie(r)||Mr(r))?r:void 0,c=n;u&&!a&&(a=[ie(u)?u.__ref:u]);var l,d=function(f,p){return ye(f)?typeof p=="number"?f[p]:void 0:i.store.getFieldValue(f,String(p))};e.map.forEach(function(f,p){var h=d(u,p),g=d(c,p);if(g!==void 0){a&&a.push(p);var b=s.applyMerges(f,h,g,i,a);b!==g&&(l=l||new Map,l.set(p,b)),a&&N(a.pop()===p)}}),l&&(n=ye(c)?c.slice(0):S({},c),l.forEach(function(f,p){n[p]=f}))}return e.info?this.cache.policies.runMergeFunction(r,n,e.info,i,a&&(o=i.store).getStorage.apply(o,a)):n},t}();var Od=[];function kd(t,e){var r=t.map;return r.has(e)||r.set(e,Od.pop()||{map:new Map}),r.get(e)}function Vu(t,e){if(t===e||!e||os(e))return t;if(!t||os(t))return e;var r=t.info&&e.info?S(S({},t.info),e.info):t.info||e.info,n=t.map.size&&e.map.size,i=n?new Map:t.map.size?t.map:e.map,a={info:r,map:i};if(n){var o=new Set(e.map.keys());t.map.forEach(function(s,u){a.map.set(u,Vu(s,e.map.get(u))),o.delete(u)}),o.forEach(function(s){a.map.set(s,Vu(e.map.get(s),t.map.get(s)))})}return a}function os(t){return!t||!(t.info||t.map.size)}function Ad(t,e){var r=t.map,n=r.get(e);n&&os(n)&&(Od.push(n),r.delete(e))}var Id=new Set;function ty(t,e,r,n){var i=function(d){var f=n.getFieldValue(d,r);return typeof f=="object"&&f},a=i(t);if(!!a){var o=i(e);if(!!o&&!ie(a)&&!Ee(a,o)&&!Object.keys(a).every(function(d){return n.getFieldValue(o,d)!==void 0})){var s=n.getFieldValue(t,"__typename")||n.getFieldValue(e,"__typename"),u=zt(r),c="".concat(s,".").concat(u);if(!Id.has(c)){Id.add(c);var l=[];!ye(a)&&!ye(o)&&[a,o].forEach(function(d){var f=n.getFieldValue(d,"__typename");typeof f=="string"&&!l.includes(f)&&l.push(f)}),__DEV__&&N.warn("Cache data may be lost when replacing the ".concat(u," field of a ").concat(s,` object.
|
|
39
39
|
|
|
40
40
|
To address this problem (which is not a bug in Apollo Client), `).concat(l.length?"either ensure all objects of type "+l.join(" and ")+" have an ID or a custom merge function, or ":"","define a custom merge function for the ").concat(c,` field, so InMemoryCache can safely merge these objects:
|
|
41
41
|
|
|
@@ -46,27 +46,27 @@ For more information about these options, please refer to the documentation:
|
|
|
46
46
|
|
|
47
47
|
* Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers
|
|
48
48
|
* Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects
|
|
49
|
-
`))}}}}var
|
|
49
|
+
`))}}}}var wa=function(t){De(e,t);function e(r){r===void 0&&(r={});var n=t.call(this)||this;return n.watches=new Set,n.typenameDocumentCache=new Map,n.makeVar=is,n.txCount=0,n.config=od(r),n.addTypename=!!n.config.addTypename,n.policies=new xd({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return e.prototype.init=function(){var r=this.data=new yi.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=r.stump,this.resetResultCache()},e.prototype.resetResultCache=function(r){var n=this,i=this.storeReader,a=this.config.fragments;this.storeWriter=new Td(this,this.storeReader=new dd({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:es(this.config),canon:r?void 0:i&&i.canon,fragments:a}),a),this.maybeBroadcastWatch=Cn(function(o,s){return n.broadcastWatch(o,s)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(o){var s=o.optimistic?n.optimisticData:n.data;if(xn(s)){var u=o.optimistic,c=o.id,l=o.variables;return s.makeCacheKey(o.query,o.callback,xt({optimistic:u,id:c,variables:l}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(o){return o.resetCaching()})},e.prototype.restore=function(r){return this.init(),r&&this.data.replace(r),this},e.prototype.extract=function(r){return r===void 0&&(r=!1),(r?this.optimisticData:this.data).extract()},e.prototype.read=function(r){var n=r.returnPartialData,i=n===void 0?!1:n;try{return this.storeReader.diffQueryAgainstStore(S(S({},r),{store:r.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:i})).result||null}catch(a){if(a instanceof va)return null;throw a}},e.prototype.write=function(r){try{return++this.txCount,this.storeWriter.writeToStore(this.data,r)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.modify=function(r){if(Ne.call(r,"id")&&!r.id)return!1;var n=r.optimistic?this.optimisticData:this.data;try{return++this.txCount,n.modify(r.id||"ROOT_QUERY",r.fields)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.diff=function(r){return this.storeReader.diffQueryAgainstStore(S(S({},r),{store:r.optimistic?this.optimisticData:this.data,rootId:r.id||"ROOT_QUERY",config:this.config}))},e.prototype.watch=function(r){var n=this;return this.watches.size||md(this),this.watches.add(r),r.immediate&&this.maybeBroadcastWatch(r),function(){n.watches.delete(r)&&!n.watches.size&&Lu(n),n.maybeBroadcastWatch.forget(r)}},e.prototype.gc=function(r){xt.reset();var n=this.optimisticData.gc();return r&&!this.txCount&&(r.resetResultCache?this.resetResultCache(r.resetResultIdentities):r.resetResultIdentities&&this.storeReader.resetCanon()),n},e.prototype.retain=function(r,n){return(n?this.optimisticData:this.data).retain(r)},e.prototype.release=function(r,n){return(n?this.optimisticData:this.data).release(r)},e.prototype.identify=function(r){if(ie(r))return r.__ref;try{return this.policies.identify(r)[0]}catch(n){__DEV__&&N.warn(n)}},e.prototype.evict=function(r){if(!r.id){if(Ne.call(r,"id"))return!1;r=S(S({},r),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(r,this.data)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.reset=function(r){var n=this;return this.init(),xt.reset(),r&&r.discardWatches?(this.watches.forEach(function(i){return n.maybeBroadcastWatch.forget(i)}),this.watches.clear(),Lu(this)):this.broadcastWatches(),Promise.resolve()},e.prototype.removeOptimistic=function(r){var n=this.optimisticData.removeLayer(r);n!==this.optimisticData&&(this.optimisticData=n,this.broadcastWatches())},e.prototype.batch=function(r){var n=this,i=r.update,a=r.optimistic,o=a===void 0?!0:a,s=r.removeOptimistic,u=r.onWatchUpdated,c,l=function(f){var p=n,h=p.data,g=p.optimisticData;++n.txCount,f&&(n.data=n.optimisticData=f);try{return c=i(n)}finally{--n.txCount,n.data=h,n.optimisticData=g}},d=new Set;return u&&!this.txCount&&this.broadcastWatches(S(S({},r),{onWatchUpdated:function(f){return d.add(f),!1}})),typeof o=="string"?this.optimisticData=this.optimisticData.addLayer(o,l):o===!1?l(this.data):l(),typeof s=="string"&&(this.optimisticData=this.optimisticData.removeLayer(s)),u&&d.size?(this.broadcastWatches(S(S({},r),{onWatchUpdated:function(f,p){var h=u.call(this,f,p);return h!==!1&&d.delete(f),h}})),d.size&&d.forEach(function(f){return n.maybeBroadcastWatch.dirty(f)})):this.broadcastWatches(r),c},e.prototype.performTransaction=function(r,n){return this.batch({update:r,optimistic:n||n!==null})},e.prototype.transformDocument=function(r){if(this.addTypename){var n=this.typenameDocumentCache.get(r);return n||(n=wn(r),this.typenameDocumentCache.set(r,n),this.typenameDocumentCache.set(n,n)),n}return r},e.prototype.transformForLink=function(r){var n=this.config.fragments;return n?n.transform(r):r},e.prototype.broadcastWatches=function(r){var n=this;this.txCount||this.watches.forEach(function(i){return n.maybeBroadcastWatch(i,r)})},e.prototype.broadcastWatch=function(r,n){var i=r.lastDiff,a=this.diff(r);n&&(r.optimistic&&typeof n.optimistic=="string"&&(a.fromOptimisticTransaction=!0),n.onWatchUpdated&&n.onWatchUpdated.call(this,r,a,i)===!1)||(!i||!Ee(i.result,a.result))&&r.callback(r.lastDiff=a,i)},e}(Tu);function Dd(t){return t.hasOwnProperty("graphQLErrors")}var ry=function(t){var e="";if(Be(t.graphQLErrors)||Be(t.clientErrors)){var r=(t.graphQLErrors||[]).concat(t.clientErrors||[]);r.forEach(function(n){var i=n?n.message:"Error message not found.";e+="".concat(i,`
|
|
50
50
|
`)})}return t.networkError&&(e+="".concat(t.networkError.message,`
|
|
51
|
-
`)),e=e.replace(/\n$/,""),e},
|
|
52
|
-
Did you mean to call refetch(variables) instead of refetch({ variables })?`))}return r&&!be(this.options.variables,r)&&(i.variables=this.options.variables=_(_({},this.options.variables),r)),this.queryInfo.resetLastWrite(),this.reobserve(i,ie.refetch)},e.prototype.fetchMore=function(r){var n=this,i=_(_({},r.query?r:_(_(_(_({},this.options),{query:this.query}),r),{variables:_(_({},this.options.variables),r.variables)})),{fetchPolicy:"no-cache"}),a=this.queryManager.generateQueryId(),o=this.queryInfo,s=o.networkStatus;o.networkStatus=ie.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var u=new Set;return this.queryManager.fetchQuery(a,i,ie.fetchMore).then(function(c){return n.queryManager.removeQuery(a),o.networkStatus===ie.fetchMore&&(o.networkStatus=s),n.queryManager.cache.batch({update:function(l){var d=r.updateQuery;d?l.updateQuery({query:n.query,variables:n.variables,returnPartialData:!0,optimistic:!1},function(p){return d(p,{fetchMoreResult:c.data,variables:i.variables})}):l.writeQuery({query:i.query,variables:i.variables,data:c.data})},onWatchUpdated:function(l){u.add(l.query)}}),c}).finally(function(){u.has(n.query)||au(n)})},e.prototype.subscribeToMore=function(r){var n=this,i=this.queryManager.startGraphQLSubscription({query:r.document,variables:r.variables,context:r.context}).subscribe({next:function(a){var o=r.updateQuery;o&&n.updateQuery(function(s,u){var c=u.variables;return o(s,{subscriptionData:a,variables:c})})},error:function(a){if(r.onError){r.onError(a);return}__DEV__&&I.error("Unhandled GraphQL subscription error",a)}});return this.subscriptions.add(i),function(){n.subscriptions.delete(i)&&i.unsubscribe()}},e.prototype.setOptions=function(r){return this.reobserve(r)},e.prototype.setVariables=function(r){return be(this.variables,r)?this.observers.size?this.result():Promise.resolve():(this.options.variables=r,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:r},ie.setVariables):Promise.resolve())},e.prototype.updateQuery=function(r){var n=this.queryManager,i=n.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,a=r(i,{variables:this.variables});a&&(n.cache.writeQuery({query:this.options.query,data:a,variables:this.variables}),n.broadcastQueries())},e.prototype.startPolling=function(r){this.options.pollInterval=r,this.updatePolling()},e.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},e.prototype.applyNextFetchPolicy=function(r,n){if(n.nextFetchPolicy){var i=n.fetchPolicy,a=i===void 0?"cache-first":i,o=n.initialFetchPolicy,s=o===void 0?a:o;a==="standby"||(typeof n.nextFetchPolicy=="function"?n.fetchPolicy=n.nextFetchPolicy(a,{reason:r,options:n,observable:this,initialFetchPolicy:s}):r==="variables-changed"?n.fetchPolicy=s:n.fetchPolicy=n.nextFetchPolicy)}return n.fetchPolicy},e.prototype.fetch=function(r,n){return this.queryManager.setObservableQuery(this),this.queryManager.fetchQueryObservable(this.queryId,r,n)},e.prototype.updatePolling=function(){var r=this;if(!this.queryManager.ssrMode){var n=this,i=n.pollingInfo,a=n.options.pollInterval;if(!a){i&&(clearTimeout(i.timeout),delete this.pollingInfo);return}if(!(i&&i.interval===a)){__DEV__?I(a,"Attempted to start a polling query without a polling interval."):I(a,13);var o=i||(this.pollingInfo={});o.interval=a;var s=function(){r.pollingInfo&&(Cr(r.queryInfo.networkStatus)?u():r.reobserve({fetchPolicy:r.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},ie.poll).then(u,u))},u=function(){var c=r.pollingInfo;c&&(clearTimeout(c.timeout),c.timeout=setTimeout(s,c.interval))};u()}}},e.prototype.updateLastResult=function(r,n){return n===void 0&&(n=this.variables),this.last=_(_({},this.last),{result:this.queryManager.assumeImmutableResults?r:no(r),variables:n}),Re(r.errors)||delete this.last.error,this.last},e.prototype.reobserve=function(r,n){var i=this;this.isTornDown=!1;var a=n===ie.refetch||n===ie.fetchMore||n===ie.poll,o=this.options.variables,s=this.options.fetchPolicy,u=_r(this.options,r||{}),c=a?u:sg(this.options,u);a||(this.updatePolling(),r&&r.variables&&!be(r.variables,o)&&c.fetchPolicy!=="standby"&&c.fetchPolicy===s&&(this.applyNextFetchPolicy("variables-changed",c),n===void 0&&(n=ie.setVariables)));var l=c.variables&&_({},c.variables),d=this.fetch(c,n),p={next:function(f){i.reportResult(f,l)},error:function(f){i.reportError(f,l)}};return a||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=d,this.observer=p),d.addObserver(p),d.promise},e.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},e.prototype.reportResult=function(r,n){var i=this.getLastError();(i||this.isDifferentFromLastResult(r,n))&&((i||!r.partial||this.options.returnPartialData)&&this.updateLastResult(r,n),rn(this.observers,"next",r))},e.prototype.reportError=function(r,n){var i=_(_({},this.getLastResult()),{error:r,errors:r.graphQLErrors,networkStatus:ie.error,loading:!1});this.updateLastResult(i,n),rn(this.observers,"error",this.last.error=r)},e.prototype.hasObservers=function(){return this.observers.size>0},e.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach(function(r){return r.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},e}(H);ao(ko);function au(t){var e=t.options,r=e.fetchPolicy,n=e.nextFetchPolicy;return r==="cache-and-network"||r==="network-only"?t.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(){return this.nextFetchPolicy=n,typeof n=="function"?n.apply(this,arguments):r}}):t.reobserve()}function ug(t){__DEV__&&I.error("Unhandled error",t.message,t.stack)}function ou(t){__DEV__&&t&&__DEV__&&I.debug("Missing cache result fields: ".concat(JSON.stringify(t)),t)}var To=function(){function t(e){var r=e.cache,n=e.client,i=e.resolvers,a=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=r,n&&(this.client=n),i&&this.addResolvers(i),a&&this.setFragmentMatcher(a)}return t.prototype.addResolvers=function(e){var r=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(n){r.resolvers=bc(r.resolvers,n)}):this.resolvers=bc(this.resolvers,e)},t.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},t.prototype.getResolvers=function(){return this.resolvers||{}},t.prototype.runResolvers=function(e){var r=e.document,n=e.remoteResult,i=e.context,a=e.variables,o=e.onlyRunForcedResolvers,s=o===void 0?!1:o;return Tt(this,void 0,void 0,function(){return At(this,function(u){return r?[2,this.resolveDocument(r,n.data,i,a,this.fragmentMatcher,s).then(function(c){return _(_({},n),{data:c.result})})]:[2,n]})})},t.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},t.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},t.prototype.clientQuery=function(e){return Un(["client"],e)&&this.resolvers?e:null},t.prototype.serverQuery=function(e){return vc(e)},t.prototype.prepareContext=function(e){var r=this.cache;return _(_({},e),{cache:r,getCacheKey:function(n){return r.identify(n)}})},t.prototype.addExportedVariables=function(e,r,n){return r===void 0&&(r={}),n===void 0&&(n={}),Tt(this,void 0,void 0,function(){return At(this,function(i){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,r)||{},this.prepareContext(n),r).then(function(a){return _(_({},r),a.exportedVariables)})]:[2,_({},r)]})})},t.prototype.shouldForceResolvers=function(e){var r=!1;return Ke(e,{Directive:{enter:function(n){if(n.name.value==="client"&&n.arguments&&(r=n.arguments.some(function(i){return i.name.value==="always"&&i.value.kind==="BooleanValue"&&i.value.value===!0}),r))return Kr}}}),r},t.prototype.buildRootValueFromCache=function(e,r){return this.cache.diff({query:yc(e),variables:r,returnPartialData:!0,optimistic:!1}).result},t.prototype.resolveDocument=function(e,r,n,i,a,o){return n===void 0&&(n={}),i===void 0&&(i={}),a===void 0&&(a=function(){return!0}),o===void 0&&(o=!1),Tt(this,void 0,void 0,function(){var s,u,c,l,d,p,f,h,g,y,S;return At(this,function(b){return s=Xr(e),u=Jr(e),c=Zr(u),l=this.collectSelectionsToResolve(s,c),d=s.operation,p=d?d.charAt(0).toUpperCase()+d.slice(1):"Query",f=this,h=f.cache,g=f.client,y={fragmentMap:c,context:_(_({},n),{cache:h,client:g}),variables:i,fragmentMatcher:a,defaultOperationType:p,exportedVariables:{},selectionsToResolve:l,onlyRunForcedResolvers:o},S=!1,[2,this.resolveSelectionSet(s.selectionSet,S,r,y).then(function(v){return{result:v,exportedVariables:y.exportedVariables}})]})})},t.prototype.resolveSelectionSet=function(e,r,n,i){return Tt(this,void 0,void 0,function(){var a,o,s,u,c,l=this;return At(this,function(d){return a=i.fragmentMap,o=i.context,s=i.variables,u=[n],c=function(p){return Tt(l,void 0,void 0,function(){var f,h;return At(this,function(g){return!r&&!i.selectionsToResolve.has(p)?[2]:er(p,s)?pt(p)?[2,this.resolveField(p,r,n,i).then(function(y){var S;typeof y<"u"&&u.push((S={},S[_t(p)]=y,S))})]:(dc(p)?f=p:(f=a[p.name.value],__DEV__?I(f,"No fragment named ".concat(p.name.value)):I(f,11)),f&&f.typeCondition&&(h=f.typeCondition.name.value,i.fragmentMatcher(n,h,o))?[2,this.resolveSelectionSet(f.selectionSet,r,n,i).then(function(y){u.push(y)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(c)).then(function(){return Mi(u)})]})})},t.prototype.resolveField=function(e,r,n,i){return Tt(this,void 0,void 0,function(){var a,o,s,u,c,l,d,p,f,h=this;return At(this,function(g){return n?(a=i.variables,o=e.name.value,s=_t(e),u=o!==s,c=n[s]||n[o],l=Promise.resolve(c),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(d=n.__typename||i.defaultOperationType,p=this.resolvers&&this.resolvers[d],p&&(f=p[u?o:s],f&&(l=Promise.resolve(Yn.withValue(this.cache,f,[n,tr(e,a),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,l.then(function(y){var S,b;if(y===void 0&&(y=c),e.directives&&e.directives.forEach(function(m){m.name.value==="export"&&m.arguments&&m.arguments.forEach(function(A){A.name.value==="as"&&A.value.kind==="StringValue"&&(i.exportedVariables[A.value.value]=y)})}),!e.selectionSet||y==null)return y;var v=(b=(S=e.directives)===null||S===void 0?void 0:S.some(function(m){return m.name.value==="client"}))!==null&&b!==void 0?b:!1;if(Array.isArray(y))return h.resolveSubSelectedArray(e,r||v,y,i);if(e.selectionSet)return h.resolveSelectionSet(e.selectionSet,r||v,y,i)})]):[2,null]})})},t.prototype.resolveSubSelectedArray=function(e,r,n,i){var a=this;return Promise.all(n.map(function(o){if(o===null)return null;if(Array.isArray(o))return a.resolveSubSelectedArray(e,r,o,i);if(e.selectionSet)return a.resolveSelectionSet(e.selectionSet,r,o,i)}))},t.prototype.collectSelectionsToResolve=function(e,r){var n=function(o){return!Array.isArray(o)},i=this.selectionsToResolveCache;function a(o){if(!i.has(o)){var s=new Set;i.set(o,s),Ke(o,{Directive:function(u,c,l,d,p){u.name.value==="client"&&p.forEach(function(f){n(f)&&Ri(f)&&s.add(f)})},FragmentSpread:function(u,c,l,d,p){var f=r[u.name.value];__DEV__?I(f,"No fragment named ".concat(u.name.value)):I(f,12);var h=a(f);h.size>0&&(p.forEach(function(g){n(g)&&Ri(g)&&s.add(g)}),s.add(u),h.forEach(function(g){s.add(g)}))}})}return i.get(o)}return a(e)},t}();var Xn=new(wt?WeakMap:Map);function su(t,e){var r=t[e];typeof r=="function"&&(t[e]=function(){return Xn.set(t,(Xn.get(t)+1)%1e15),r.apply(this,arguments)})}function Bp(t){t.notifyTimeout&&(clearTimeout(t.notifyTimeout),t.notifyTimeout=void 0)}var Ao=function(){function t(e,r){r===void 0&&(r=e.generateQueryId()),this.queryId=r,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=e.cache;Xn.has(n)||(Xn.set(n,0),su(n,"evict"),su(n,"modify"),su(n,"reset"))}return t.prototype.init=function(e){var r=e.networkStatus||ie.loading;return this.variables&&this.networkStatus!==ie.loading&&!be(this.variables,e.variables)&&(r=ie.setVariables),be(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:r}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},t.prototype.reset=function(){Bp(this),this.dirty=!1},t.prototype.getDiff=function(e){e===void 0&&(e=this.variables);var r=this.getDiffOptions(e);if(this.lastDiff&&be(r,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=e);var n=this.observableQuery;if(n&&n.options.fetchPolicy==="no-cache")return{complete:!1};var i=this.cache.diff(r);return this.updateLastDiff(i,r),i},t.prototype.updateLastDiff=function(e,r){this.lastDiff=e?{diff:e,options:r||this.getDiffOptions()}:void 0},t.prototype.getDiffOptions=function(e){var r;return e===void 0&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:(r=this.observableQuery)===null||r===void 0?void 0:r.options.canonizeResults}},t.prototype.setDiff=function(e){var r=this,n=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),!this.dirty&&!be(n&&n.result,e&&e.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return r.notify()},0)))},t.prototype.setObservableQuery=function(e){var r=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){var n=r.getDiff();n.fromOptimisticTransaction?e.observe():au(e)})):delete this.oqListener)},t.prototype.notify=function(){var e=this;Bp(this),this.shouldNotify()&&this.listeners.forEach(function(r){return r(e)}),this.dirty=!1},t.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(Cr(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if(e!=="cache-only"&&e!=="cache-and-network")return!1}return!0},t.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=t.prototype.cancel,this.subscriptions.forEach(function(r){return r.unsubscribe()});var e=this.observableQuery;e&&e.stopPolling()}},t.prototype.cancel=function(){},t.prototype.updateWatch=function(e){var r=this;e===void 0&&(e=this.variables);var n=this.observableQuery;if(!(n&&n.options.fetchPolicy==="no-cache")){var i=_(_({},this.getDiffOptions(e)),{watcher:this,callback:function(a){return r.setDiff(a)}});(!this.lastWatch||!be(i,this.lastWatch))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=i))}},t.prototype.resetLastWrite=function(){this.lastWrite=void 0},t.prototype.shouldWrite=function(e,r){var n=this.lastWrite;return!(n&&n.dmCount===Xn.get(this.cache)&&be(r,n.variables)&&be(e.data,n.result.data))},t.prototype.markResult=function(e,r,n,i){var a=this,o=new it,s=Re(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Re(e.incremental)){var u=oo(this.getDiff().result,e);e.data=u}else if("hasNext"in e&&e.hasNext){var c=this.getDiff();e.data=o.merge(c.result,e.data)}this.graphQLErrors=s,n.fetchPolicy==="no-cache"?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):i!==0&&(Io(e,n.errorPolicy)?this.cache.performTransaction(function(l){if(a.shouldWrite(e,n.variables))l.writeQuery({query:r,data:e.data,variables:n.variables,overwrite:i===1}),a.lastWrite={result:e,variables:n.variables,dmCount:Xn.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){e.data=a.lastDiff.diff.result;return}var d=a.getDiffOptions(n.variables),p=l.diff(d);a.stopped||a.updateWatch(n.variables),a.updateLastDiff(p,d),p.complete&&(e.data=p.result)}):this.lastWrite=void 0)},t.prototype.markReady=function(){return this.networkError=null,this.networkStatus=ie.ready},t.prototype.markError=function(e){return this.networkStatus=ie.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},t}();function Io(t,e){e===void 0&&(e="none");var r=e==="ignore"||e==="all",n=!Gn(t);return!n&&r&&t.data&&(n=!0),n}var lg=Object.prototype.hasOwnProperty,Vp=function(){function t(e){var r=e.cache,n=e.link,i=e.defaultOptions,a=e.queryDeduplication,o=a===void 0?!1:a,s=e.onBroadcast,u=e.ssrMode,c=u===void 0?!1:u,l=e.clientAwareness,d=l===void 0?{}:l,p=e.localState,f=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(wt?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=r,this.link=n,this.defaultOptions=i||Object.create(null),this.queryDeduplication=o,this.clientAwareness=d,this.localState=p||new To({cache:r}),this.ssrMode=c,this.assumeImmutableResults=!!f,(this.onBroadcast=s)&&(this.mutationStore=Object.create(null))}return t.prototype.stop=function(){var e=this;this.queries.forEach(function(r,n){e.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(__DEV__?new V("QueryManager stopped while query was in flight"):new V(14))},t.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(r){return r(e)}),this.fetchCancelFns.clear()},t.prototype.mutate=function(e){var r,n,i=e.mutation,a=e.variables,o=e.optimisticResponse,s=e.updateQueries,u=e.refetchQueries,c=u===void 0?[]:u,l=e.awaitRefetchQueries,d=l===void 0?!1:l,p=e.update,f=e.onQueryUpdated,h=e.fetchPolicy,g=h===void 0?((r=this.defaultOptions.mutate)===null||r===void 0?void 0:r.fetchPolicy)||"network-only":h,y=e.errorPolicy,S=y===void 0?((n=this.defaultOptions.mutate)===null||n===void 0?void 0:n.errorPolicy)||"none":y,b=e.keepRootFields,v=e.context;return Tt(this,void 0,void 0,function(){var m,A,D,C,O,P;return At(this,function(N){switch(N.label){case 0:return __DEV__?I(i,"mutation option is required. You must specify your GraphQL document in the mutation option."):I(i,15),__DEV__?I(g==="network-only"||g==="no-cache","Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):I(g==="network-only"||g==="no-cache",16),m=this.generateMutationId(),A=this.transform(i),D=A.document,C=A.hasClientExports,i=this.cache.transformForLink(D),a=this.getVariables(i,a),C?[4,this.localState.addExportedVariables(i,a,v)]:[3,2];case 1:a=N.sent(),N.label=2;case 2:return O=this.mutationStore&&(this.mutationStore[m]={mutation:i,variables:a,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:m,document:i,variables:a,fetchPolicy:g,errorPolicy:S,context:v,updateQueries:s,update:p,keepRootFields:b}),this.broadcastQueries(),P=this,[2,new Promise(function(U,qe){return io(P.getObservableFromLink(i,_(_({},v),{optimisticResponse:o}),a,!1),function(Ne){if(Gn(Ne)&&S==="none")throw new rr({graphQLErrors:so(Ne)});O&&(O.loading=!1,O.error=null);var q=_({},Ne);return typeof c=="function"&&(c=c(q)),S==="ignore"&&Gn(q)&&delete q.errors,P.markMutationResult({mutationId:m,result:q,document:i,variables:a,fetchPolicy:g,errorPolicy:S,context:v,update:p,updateQueries:s,awaitRefetchQueries:d,refetchQueries:c,removeOptimistic:o?m:void 0,onQueryUpdated:f,keepRootFields:b})}).subscribe({next:function(Ne){P.broadcastQueries(),(!("hasNext"in Ne)||Ne.hasNext===!1)&&U(Ne)},error:function(Ne){O&&(O.loading=!1,O.error=Ne),o&&P.cache.removeOptimistic(m),P.broadcastQueries(),qe(Ne instanceof rr?Ne:new rr({networkError:Ne}))}})})]}})})},t.prototype.markMutationResult=function(e,r){var n=this;r===void 0&&(r=this.cache);var i=e.result,a=[],o=e.fetchPolicy==="no-cache";if(!o&&Io(i,e.errorPolicy)){if(br(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),br(i)&&Re(i.incremental)){var s=r.diff({id:"ROOT_MUTATION",query:this.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),u=void 0;s.result&&(u=oo(s.result,i)),typeof u<"u"&&(i.data=u,a.push({result:u,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var c=e.updateQueries;c&&this.queries.forEach(function(d,p){var f=d.observableQuery,h=f&&f.queryName;if(!(!h||!lg.call(c,h))){var g=c[h],y=n.queries.get(p),S=y.document,b=y.variables,v=r.diff({query:S,variables:b,returnPartialData:!0,optimistic:!1}),m=v.result,A=v.complete;if(A&&m){var D=g(m,{mutationResult:i,queryName:S&&Bn(S)||void 0,queryVariables:b});D&&a.push({result:D,dataId:"ROOT_QUERY",query:S,variables:b})}}})}if(a.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(d){o||a.forEach(function(g){return d.write(g)});var p=e.update,f=!kf(i)||br(i)&&!i.hasNext;if(p){if(!o){var h=d.diff({id:"ROOT_MUTATION",query:n.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});h.complete&&(i=_(_({},i),{data:h.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}f&&p(d,i,{context:e.context,variables:e.variables})}!o&&!e.keepRootFields&&f&&d.modify({id:"ROOT_MUTATION",fields:function(g,y){var S=y.fieldName,b=y.DELETE;return S==="__typename"?g:b}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(d){return l.push(d)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(l).then(function(){return i})}return Promise.resolve(i)},t.prototype.markMutationOptimistic=function(e,r){var n=this,i=typeof e=="function"?e(r.variables):e;return this.cache.recordOptimisticTransaction(function(a){try{n.markMutationResult(_(_({},r),{result:{data:i}}),a)}catch(o){__DEV__&&I.error(o)}},r.mutationId)},t.prototype.fetchQuery=function(e,r,n){return this.fetchQueryObservable(e,r,n).promise},t.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(r,n){e[n]={variables:r.variables,networkStatus:r.networkStatus,networkError:r.networkError,graphQLErrors:r.graphQLErrors}}),e},t.prototype.resetErrors=function(e){var r=this.queries.get(e);r&&(r.networkError=void 0,r.graphQLErrors=[])},t.prototype.transform=function(e){var r=this.transformCache;if(!r.has(e)){var n=this.cache.transformDocument(e),i=gc(n),a=this.localState.clientQuery(n),o=i&&this.localState.serverQuery(i),s={document:n,hasClientExports:uc(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:a,serverQuery:o,defaultVars:en(qt(n)),asQuery:_(_({},n),{definitions:n.definitions.map(function(c){return c.kind==="OperationDefinition"&&c.operation!=="query"?_(_({},c),{operation:"query"}):c})})},u=function(c){c&&!r.has(c)&&r.set(c,s)};u(e),u(n),u(a),u(o)}return r.get(e)},t.prototype.getVariables=function(e,r){return _(_({},this.transform(e).defaultVars),r)},t.prototype.watchQuery=function(e){e=_(_({},e),{variables:this.getVariables(e.query,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var r=new Ao(this),n=new ko({queryManager:this,queryInfo:r,options:e});return this.queries.set(n.queryId,r),r.init({document:n.query,observableQuery:n,variables:n.variables}),n},t.prototype.query=function(e,r){var n=this;return r===void 0&&(r=this.generateQueryId()),__DEV__?I(e.query,"query option is required. You must specify your GraphQL document in the query option."):I(e.query,17),__DEV__?I(e.query.kind==="Document",'You must wrap the query string in a "gql" tag.'):I(e.query.kind==="Document",18),__DEV__?I(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):I(!e.returnPartialData,19),__DEV__?I(!e.pollInterval,"pollInterval option only supported on watchQuery."):I(!e.pollInterval,20),this.fetchQuery(r,e).finally(function(){return n.stopQuery(r)})},t.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},t.prototype.generateRequestId=function(){return this.requestIdCounter++},t.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},t.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryInStoreNoBroadcast=function(e){var r=this.queries.get(e);r&&r.stop()},t.prototype.clearStore=function(e){return e===void 0&&(e={discardWatches:!0}),this.cancelPendingFetches(__DEV__?new V("Store reset while query was in flight (not completed in link chain)"):new V(21)),this.queries.forEach(function(r){r.observableQuery?r.networkStatus=ie.loading:r.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},t.prototype.getObservableQueries=function(e){var r=this;e===void 0&&(e="active");var n=new Map,i=new Map,a=new Set;return Array.isArray(e)&&e.forEach(function(o){typeof o=="string"?i.set(o,!1):fc(o)?i.set(r.transform(o).document,!1):ee(o)&&o.query&&a.add(o)}),this.queries.forEach(function(o,s){var u=o.observableQuery,c=o.document;if(u){if(e==="all"){n.set(s,u);return}var l=u.queryName,d=u.options.fetchPolicy;if(d==="standby"||e==="active"&&!u.hasObservers())return;(e==="active"||l&&i.has(l)||c&&i.has(c))&&(n.set(s,u),l&&i.set(l,!0),c&&i.set(c,!0))}}),a.size&&a.forEach(function(o){var s=qi("legacyOneTimeQuery"),u=r.getQuery(s).init({document:o.query,variables:o.variables}),c=new ko({queryManager:r,queryInfo:u,options:_(_({},o),{fetchPolicy:"network-only"})});I(c.queryId===s),u.setObservableQuery(c),n.set(s,c)}),__DEV__&&i.size&&i.forEach(function(o,s){o||__DEV__&&I.warn("Unknown query ".concat(typeof s=="string"?"named ":"").concat(JSON.stringify(s,null,2)," requested in refetchQueries options.include array"))}),n},t.prototype.reFetchObservableQueries=function(e){var r=this;e===void 0&&(e=!1);var n=[];return this.getObservableQueries(e?"all":"active").forEach(function(i,a){var o=i.options.fetchPolicy;i.resetLastResults(),(e||o!=="standby"&&o!=="cache-only")&&n.push(i.refetch()),r.getQuery(a).setDiff(null)}),this.broadcastQueries(),Promise.all(n)},t.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},t.prototype.startGraphQLSubscription=function(e){var r=this,n=e.query,i=e.fetchPolicy,a=e.errorPolicy,o=e.variables,s=e.context,u=s===void 0?{}:s;n=this.transform(n).document,o=this.getVariables(n,o);var c=function(d){return r.getObservableFromLink(n,u,d).map(function(p){if(i!=="no-cache"&&(Io(p,a)&&r.cache.write({query:n,result:p.data,dataId:"ROOT_SUBSCRIPTION",variables:d}),r.broadcastQueries()),Gn(p))throw new rr({graphQLErrors:p.errors});return p})};if(this.transform(n).hasClientExports){var l=this.localState.addExportedVariables(n,o,u).then(c);return new H(function(d){var p=null;return l.then(function(f){return p=f.subscribe(d)},d.error),function(){return p&&p.unsubscribe()}})}return c(o)},t.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},t.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},t.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){return e.notify()})},t.prototype.getLocalState=function(){return this.localState},t.prototype.getObservableFromLink=function(e,r,n,i){var a=this,o;i===void 0&&(i=(o=r?.queryDeduplication)!==null&&o!==void 0?o:this.queryDeduplication);var s,u=this.transform(e).serverQuery;if(u){var c=this,l=c.inFlightLinkObservables,d=c.link,p={query:u,variables:n,operationName:Bn(u)||void 0,context:this.prepareContext(_(_({},r),{forceFetch:!i}))};if(r=p.context,i){var f=l.get(u)||new Map;l.set(u,f);var h=dt(n);if(s=f.get(h),!s){var g=new Qn([Hn(d,p)]);f.set(h,s=g),g.beforeNext(function(){f.delete(h)&&f.size<1&&l.delete(u)})}}else s=new Qn([Hn(d,p)])}else s=new Qn([H.of({data:{}})]),r=this.prepareContext(r);var y=this.transform(e).clientQuery;return y&&(s=io(s,function(S){return a.localState.runResolvers({document:y,remoteResult:S,context:r,variables:n})})),s},t.prototype.getResultsFromLink=function(e,r,n){var i=e.lastRequestId=this.generateRequestId(),a=this.cache.transformForLink(this.transform(e.document).document);return io(this.getObservableFromLink(a,n.context,n.variables),function(o){var s=so(o),u=s.length>0;if(i>=e.lastRequestId){if(u&&n.errorPolicy==="none")throw e.markError(new rr({graphQLErrors:s}));e.markResult(o,a,n,r),e.markReady()}var c={data:o.data,loading:!1,networkStatus:ie.ready};return u&&n.errorPolicy!=="ignore"&&(c.errors=s,c.networkStatus=ie.error),c},function(o){var s=qp(o)?o:new rr({networkError:o});throw i>=e.lastRequestId&&e.markError(s),s})},t.prototype.fetchQueryObservable=function(e,r,n){var i=this;n===void 0&&(n=ie.loading);var a=this.transform(r.query).document,o=this.getVariables(a,r.variables),s=this.getQuery(e),u=this.defaultOptions.watchQuery,c=r.fetchPolicy,l=c===void 0?u&&u.fetchPolicy||"cache-first":c,d=r.errorPolicy,p=d===void 0?u&&u.errorPolicy||"none":d,f=r.returnPartialData,h=f===void 0?!1:f,g=r.notifyOnNetworkStatusChange,y=g===void 0?!1:g,S=r.context,b=S===void 0?{}:S,v=Object.assign({},r,{query:a,variables:o,fetchPolicy:l,errorPolicy:p,returnPartialData:h,notifyOnNetworkStatusChange:y,context:b}),m=function(C){v.variables=C;var O=i.fetchQueryByPolicy(s,v,n);return v.fetchPolicy!=="standby"&&O.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",r),O},A=function(){return i.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,function(C){A(),setTimeout(function(){return D.cancel(C)})});var D=new Qn(this.transform(v.query).hasClientExports?this.localState.addExportedVariables(v.query,v.variables,v.context).then(m):m(v.variables));return D.promise.then(A,A),D},t.prototype.refetchQueries=function(e){var r=this,n=e.updateCache,i=e.include,a=e.optimistic,o=a===void 0?!1:a,s=e.removeOptimistic,u=s===void 0?o?qi("refetchQueries"):void 0:s,c=e.onQueryUpdated,l=new Map;i&&this.getObservableQueries(i).forEach(function(p,f){l.set(f,{oq:p,lastDiff:r.getQuery(f).getDiff()})});var d=new Map;return n&&this.cache.batch({update:n,optimistic:o&&u||!1,removeOptimistic:u,onWatchUpdated:function(p,f,h){var g=p.watcher instanceof Ao&&p.watcher.observableQuery;if(g){if(c){l.delete(g.queryId);var y=c(g,f,h);return y===!0&&(y=g.refetch()),y!==!1&&d.set(g,y),y}c!==null&&l.set(g.queryId,{oq:g,lastDiff:h,diff:f})}}}),l.size&&l.forEach(function(p,f){var h=p.oq,g=p.lastDiff,y=p.diff,S;if(c){if(!y){var b=h.queryInfo;b.reset(),y=b.getDiff()}S=c(h,y,g)}(!c||S===!0)&&(S=h.refetch()),S!==!1&&d.set(h,S),f.indexOf("legacyOneTimeQuery")>=0&&r.stopQueryNoBroadcast(f)}),u&&this.cache.removeOptimistic(u),d},t.prototype.fetchQueryByPolicy=function(e,r,n){var i=this,a=r.query,o=r.variables,s=r.fetchPolicy,u=r.refetchWritePolicy,c=r.errorPolicy,l=r.returnPartialData,d=r.context,p=r.notifyOnNetworkStatusChange,f=e.networkStatus;e.init({document:this.transform(a).document,variables:o,networkStatus:n});var h=function(){return e.getDiff(o)},g=function(m,A){A===void 0&&(A=e.networkStatus||ie.loading);var D=m.result;__DEV__&&!l&&!be(D,{})&&ou(m.missing);var C=function(O){return H.of(_({data:O,loading:Cr(A),networkStatus:A},m.complete?null:{partial:!0}))};return D&&i.transform(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:D},context:d,variables:o,onlyRunForcedResolvers:!0}).then(function(O){return C(O.data||void 0)}):c==="none"&&A===ie.refetch&&Array.isArray(m.missing)?C(void 0):C(D)},y=s==="no-cache"?0:n===ie.refetch&&u!=="merge"?1:2,S=function(){return i.getResultsFromLink(e,y,{variables:o,context:d,fetchPolicy:s,errorPolicy:c})},b=p&&typeof f=="number"&&f!==n&&Cr(n);switch(s){default:case"cache-first":{var v=h();return v.complete?[g(v,e.markReady())]:l||b?[g(v),S()]:[S()]}case"cache-and-network":{var v=h();return v.complete||l||b?[g(v),S()]:[S()]}case"cache-only":return[g(h(),e.markReady())];case"network-only":return b?[g(h()),S()]:[S()];case"no-cache":return b?[g(e.getDiff()),S()]:[S()];case"standby":return[]}},t.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new Ao(this,e)),this.queries.get(e)},t.prototype.prepareContext=function(e){e===void 0&&(e={});var r=this.localState.prepareContext(e);return _(_({},r),{clientAwareness:this.clientAwareness})},t}();var zp=!1;var cu=function(){function t(e){var r=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=e.uri,i=e.credentials,a=e.headers,o=e.cache,s=e.ssrMode,u=s===void 0?!1:s,c=e.ssrForceFetchDelay,l=c===void 0?0:c,d=e.connectToDevTools,p=d===void 0?typeof window=="object"&&!window.__APOLLO_CLIENT__&&__DEV__:d,f=e.queryDeduplication,h=f===void 0?!0:f,g=e.defaultOptions,y=e.assumeImmutableResults,S=y===void 0?!1:y,b=e.resolvers,v=e.typeDefs,m=e.fragmentMatcher,A=e.name,D=e.version,C=e.link;if(C||(C=n?new $c({uri:n,credentials:i,headers:a}):St.empty()),!o)throw __DEV__?new V(`To initialize Apollo Client, you must specify a 'cache' property in the options object.
|
|
53
|
-
For more information, please visit: https://go.apollo.dev/c/docs`):new V(9);if(this.link=C,this.cache=o,this.disableNetworkFetches=u||l>0,this.queryDeduplication=h,this.defaultOptions=g||Object.create(null),this.typeDefs=v,l&&setTimeout(function(){return r.disableNetworkFetches=!1},l),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),p&&typeof window=="object"&&(window.__APOLLO_CLIENT__=this),!zp&&p&&__DEV__&&(zp=!0,typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var O=window.navigator,P=O&&O.userAgent,N=void 0;typeof P=="string"&&(P.indexOf("Chrome/")>-1?N="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":P.indexOf("Firefox/")>-1&&(N="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),N&&__DEV__&&I.log("Download the Apollo DevTools for a better development experience: "+N)}this.version=Of,this.localState=new To({cache:o,client:this,resolvers:b,fragmentMatcher:m}),this.queryManager=new Vp({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:h,ssrMode:u,clientAwareness:{name:A,version:D},localState:this.localState,assumeImmutableResults:S,onBroadcast:p?function(){r.devToolsHookCb&&r.devToolsHookCb({action:{},state:{queries:r.queryManager.getQueryStore(),mutations:r.queryManager.mutationStore||{}},dataWithOptimisticResults:r.cache.extract(!0)})}:void 0})}return t.prototype.stop=function(){this.queryManager.stop()},t.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=Bi(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=_(_({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},t.prototype.query=function(e){return this.defaultOptions.query&&(e=Bi(this.defaultOptions.query,e)),__DEV__?I(e.fetchPolicy!=="cache-and-network","The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):I(e.fetchPolicy!=="cache-and-network",10),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=_(_({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},t.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Bi(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},t.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},t.prototype.readQuery=function(e,r){return r===void 0&&(r=!1),this.cache.readQuery(e,r)},t.prototype.readFragment=function(e,r){return r===void 0&&(r=!1),this.cache.readFragment(e,r)},t.prototype.writeQuery=function(e){var r=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),r},t.prototype.writeFragment=function(e){var r=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),r},t.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},t.prototype.__requestRaw=function(e){return Hn(this.link,e)},t.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(r){return r()}))}).then(function(){return e.reFetchObservableQueries()})},t.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(r){return r()}))})},t.prototype.onResetStore=function(e){var r=this;return this.resetStoreCallbacks.push(e),function(){r.resetStoreCallbacks=r.resetStoreCallbacks.filter(function(n){return n!==e})}},t.prototype.onClearStore=function(e){var r=this;return this.clearStoreCallbacks.push(e),function(){r.clearStoreCallbacks=r.clearStoreCallbacks.filter(function(n){return n!==e})}},t.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},t.prototype.refetchQueries=function(e){var r=this.queryManager.refetchQueries(e),n=[],i=[];r.forEach(function(o,s){n.push(s),i.push(o)});var a=Promise.all(i);return a.queries=n,a.results=i,a.catch(function(o){__DEV__&&I.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(o))}),a},t.prototype.getObservableQueries=function(e){return e===void 0&&(e="active"),this.queryManager.getObservableQueries(e)},t.prototype.extract=function(e){return this.cache.extract(e)},t.prototype.restore=function(e){return this.cache.restore(e)},t.prototype.addResolvers=function(e){this.localState.addResolvers(e)},t.prototype.setResolvers=function(e){this.localState.setResolvers(e)},t.prototype.getResolvers=function(){return this.localState.getResolvers()},t.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},t.prototype.setLink=function(e){this.link=this.queryManager.link=e},t}();tf(Wr?"log":"silent");function Ye(t){return t===null?"null":Array.isArray(t)?"array":typeof t}function nr(t){return Ye(t)==="object"}function Qp(t){return Array.isArray(t)&&t.length>0&&t.every(e=>"message"in e)}function uu(t,e){return t.length<124?t:e}var Gp="graphql-transport-ws";var at;(function(t){t[t.InternalServerError=4500]="InternalServerError",t[t.InternalClientError=4005]="InternalClientError",t[t.BadRequest=4400]="BadRequest",t[t.BadResponse=4004]="BadResponse",t[t.Unauthorized=4401]="Unauthorized",t[t.Forbidden=4403]="Forbidden",t[t.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",t[t.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",t[t.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",t[t.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",t[t.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(at||(at={}));var Te;(function(t){t.ConnectionInit="connection_init",t.ConnectionAck="connection_ack",t.Ping="ping",t.Pong="pong",t.Subscribe="subscribe",t.Next="next",t.Error="error",t.Complete="complete"})(Te||(Te={}));function Hp(t){if(!nr(t))throw new Error(`Message is expected to be an object, but got ${Ye(t)}`);if(!t.type)throw new Error("Message is missing the 'type' property");if(typeof t.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${Ye(t.type)}`);switch(t.type){case Te.ConnectionInit:case Te.ConnectionAck:case Te.Ping:case Te.Pong:{if(t.payload!=null&&!nr(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${t.payload}"`);break}case Te.Subscribe:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Ye(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!nr(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${Ye(t.payload)}`);if(typeof t.payload.query!="string")throw new Error(`"${t.type}" message payload expects the 'query' property to be a string, but got ${Ye(t.payload.query)}`);if(t.payload.variables!=null&&!nr(t.payload.variables))throw new Error(`"${t.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${Ye(t.payload.variables)}`);if(t.payload.operationName!=null&&Ye(t.payload.operationName)!=="string")throw new Error(`"${t.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${Ye(t.payload.operationName)}`);if(t.payload.extensions!=null&&!nr(t.payload.extensions))throw new Error(`"${t.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${Ye(t.payload.extensions)}`);break}case Te.Next:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Ye(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!nr(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${Ye(t.payload)}`);break}case Te.Error:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Ye(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!Qp(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(t.payload)}`);break}case Te.Complete:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Ye(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${t.type}"`)}return t}function Wp(t,e){return Hp(typeof t=="string"?JSON.parse(t,e):t)}function ei(t,e){return Hp(t),JSON.stringify(t,e)}function Kp(t){let{url:e,connectionParams:r,lazy:n=!0,onNonLazyError:i=console.error,lazyCloseTimeout:a=0,keepAlive:o=0,disablePong:s,connectionAckWaitTimeout:u=0,retryAttempts:c=5,retryWait:l=async function(de){let he=1e3;for(let J=0;J<de;J++)he*=2;await new Promise(J=>setTimeout(J,he+Math.floor(Math.random()*(3e3-300)+300)))},shouldRetry:d=Oo,isFatalConnectionProblem:p,on:f,webSocketImpl:h,generateID:g=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,de=>{let he=Math.random()*16|0;return(de=="x"?he:he&3|8).toString(16)})},jsonMessageReplacer:y,jsonMessageReviver:S}=t,b;if(h){if(!pg(h))throw new Error("Invalid WebSocket implementation provided");b=h}else typeof WebSocket<"u"?b=WebSocket:typeof global<"u"?b=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(b=window.WebSocket||window.MozWebSocket);if(!b)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let v=b,m=(()=>{let q=(()=>{let he={};return{on(J,X){return he[J]=X,()=>{delete he[J]}},emit(J){var X;"id"in J&&((X=he[J.id])===null||X===void 0||X.call(he,J))}}})(),de={connecting:f?.connecting?[f.connecting]:[],opened:f?.opened?[f.opened]:[],connected:f?.connected?[f.connected]:[],ping:f?.ping?[f.ping]:[],pong:f?.pong?[f.pong]:[],message:f?.message?[q.emit,f.message]:[q.emit],closed:f?.closed?[f.closed]:[],error:f?.error?[f.error]:[]};return{onMessage:q.on,on(he,J){let X=de[he];return X.push(J),()=>{X.splice(X.indexOf(J),1)}},emit(he,...J){for(let X of[...de[he]])X(...J)}}})();function A(q){let de=[m.on("error",he=>{de.forEach(J=>J()),q(he)}),m.on("closed",he=>{de.forEach(J=>J()),q(he)})]}let D,C=0,O,P=!1,N=0,U=!1;async function qe(){clearTimeout(O);let[q,de]=await(D??(D=new Promise((X,Ft)=>(async()=>{if(P){if(await l(N),!C)return D=void 0,Ft({code:1e3,reason:"All Subscriptions Gone"});N++}m.emit("connecting");let G=new v(typeof e=="function"?await e():e,Gp),Mt,fr;function qa(){isFinite(o)&&o>0&&(clearTimeout(fr),fr=setTimeout(()=>{G.readyState===v.OPEN&&(G.send(ei({type:Te.Ping})),m.emit("ping",!1,void 0))},o))}A(Be=>{D=void 0,clearTimeout(Mt),clearTimeout(fr),Ft(Be),Oo(Be)&&Be.code===4499&&(G.close(4499,"Terminated"),G.onerror=null,G.onclose=null)}),G.onerror=Be=>m.emit("error",Be),G.onclose=Be=>m.emit("closed",Be),G.onopen=async()=>{try{m.emit("opened",G);let Be=typeof r=="function"?await r():r;if(G.readyState!==v.OPEN)return;G.send(ei(Be?{type:Te.ConnectionInit,payload:Be}:{type:Te.ConnectionInit},y)),isFinite(u)&&u>0&&(Mt=setTimeout(()=>{G.close(at.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},u)),qa()}catch(Be){m.emit("error",Be),G.close(at.InternalClientError,uu(Be instanceof Error?Be.message:new Error(Be).message,"Internal client error"))}};let Ln=!1;G.onmessage=({data:Be})=>{try{let Ve=Wp(Be,S);if(m.emit("message",Ve),Ve.type==="ping"||Ve.type==="pong"){m.emit(Ve.type,!0,Ve.payload),Ve.type==="pong"?qa():s||(G.send(ei(Ve.payload?{type:Te.Pong,payload:Ve.payload}:{type:Te.Pong})),m.emit("pong",!1,Ve.payload));return}if(Ln)return;if(Ve.type!==Te.ConnectionAck)throw new Error(`First message cannot be of type ${Ve.type}`);clearTimeout(Mt),Ln=!0,m.emit("connected",G,Ve.payload),P=!1,N=0,X([G,new Promise(($2,sm)=>A(sm))])}catch(Ve){G.onmessage=null,m.emit("error",Ve),G.close(at.BadResponse,uu(Ve instanceof Error?Ve.message:new Error(Ve).message,"Bad response"))}}})())));q.readyState===v.CLOSING&&await de;let he=()=>{},J=new Promise(X=>he=X);return[q,he,Promise.race([J.then(()=>{if(!C){let X=()=>q.close(1e3,"Normal Closure");isFinite(a)&&a>0?O=setTimeout(()=>{q.readyState===v.OPEN&&X()},a):X()}}),de])]}function Ne(q){if(Oo(q)&&(fg(q.code)||[at.InternalServerError,at.InternalClientError,at.BadRequest,at.BadResponse,at.Unauthorized,at.SubprotocolNotAcceptable,at.SubscriberAlreadyExists,at.TooManyInitialisationRequests].includes(q.code)))throw q;if(U)return!1;if(Oo(q)&&q.code===1e3)return C>0;if(!c||N>=c||!d(q)||p?.(q))throw q;return P=!0}return n||(async()=>{for(C++;;)try{let[,,q]=await qe();await q}catch(q){try{if(!Ne(q))return}catch(de){return i?.(de)}}})(),{on:m.on,subscribe(q,de){let he=g(q),J=!1,X=!1,Ft=()=>{C--,J=!0};return(async()=>{for(C++;;)try{let[G,Mt,fr]=await qe();if(J)return Mt();let qa=m.onMessage(he,Ln=>{switch(Ln.type){case Te.Next:{de.next(Ln.payload);return}case Te.Error:{X=!0,J=!0,de.error(Ln.payload),Ft();return}case Te.Complete:{J=!0,Ft();return}}});G.send(ei({id:he,type:Te.Subscribe,payload:q},y)),Ft=()=>{!J&&G.readyState===v.OPEN&&G.send(ei({id:he,type:Te.Complete},y)),C--,J=!0,Mt()},await fr.finally(qa);return}catch(G){if(!Ne(G))return}})().then(()=>{X||de.complete()}).catch(G=>{de.error(G)}),()=>{J||Ft()}},async dispose(){if(U=!0,D){let[q]=await D;q.close(1e3,"Normal Closure")}},terminate(){D&&m.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}function Oo(t){return nr(t)&&"code"in t&&"reason"in t}function fg(t){return[1e3,1001,1006,1005,1012,1013,1013].includes(t)?!1:t>=1e3&&t<=1999}function pg(t){return typeof t=="function"&&"constructor"in t&&"CLOSED"in t&&"CLOSING"in t&&"CONNECTING"in t&&"OPEN"in t}function dg(t){return ee(t)&&"code"in t&&"reason"in t}var Zp=function(t){xe(e,t);function e(r){var n=t.call(this)||this;return n.client=r,n}return e.prototype.request=function(r){var n=this;return new H(function(i){return n.client.subscribe(_(_({},r),{query:jn(r.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(a){return a instanceof Error?i.error(a):dg(a)?i.error(new Error("Socket closed with event ".concat(a.code," ").concat(a.reason||""))):i.error(new rr({graphQLErrors:Array.isArray(a)?a:[a]}))}})})},e}(St);var is=function(){return is=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},is.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function Vo(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Vo=function(r){return typeof r}:Vo=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Vo(t)}function hg(t){return Vo(t)=="object"&&t!==null}var oh=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function Ou(t,e){for(var r=/\r\n|[\n\r]/g,n=1,i=e+1,a;(a=r.exec(t.body))&&a.index<e;)n+=1,i=e+1-(a.index+a[0].length);return{line:n,column:i}}function mg(t){return sh(t.source,Ou(t.source,t.start))}function sh(t,e){var r=t.locationOffset.column-1,n=zo(r)+t.body,i=e.line-1,a=t.locationOffset.line-1,o=e.line+a,s=e.line===1?r:0,u=e.column+s,c="".concat(t.name,":").concat(o,":").concat(u,`
|
|
54
|
-
`),l=n.split(/\r\n|[\n\r]/g),d=l[i];if(d.length>120){for(var
|
|
55
|
-
`)}function
|
|
51
|
+
`)),e=e.replace(/\n$/,""),e},mr=function(t){De(e,t);function e(r){var n=r.graphQLErrors,i=r.clientErrors,a=r.networkError,o=r.errorMessage,s=r.extraInfo,u=t.call(this,o)||this;return u.name="ApolloError",u.graphQLErrors=n||[],u.clientErrors=i||[],u.networkError=a||null,u.message=o||ry(u),u.extraInfo=s,u.__proto__=e.prototype,u}return e}(Error);var fe;(function(t){t[t.loading=1]="loading",t[t.setVariables=2]="setVariables",t[t.fetchMore=3]="fetchMore",t[t.refetch=4]="refetch",t[t.poll=6]="poll",t[t.ready=7]="ready",t[t.error=8]="error"})(fe||(fe={}));function jr(t){return t?t<7:!1}var ny=Object.assign,iy=Object.hasOwnProperty,ss=function(t){De(e,t);function e(r){var n=r.queryManager,i=r.queryInfo,a=r.options,o=t.call(this,function(b){try{var C=b._subscription._observer;C&&!C.error&&(C.error=ay)}catch{}var w=!o.observers.size;o.observers.add(b);var _=o.last;return _&&_.error?b.error&&b.error(_.error):_&&_.result&&b.next&&b.next(_.result),w&&o.reobserve().catch(function(){}),function(){o.observers.delete(b)&&!o.observers.size&&o.tearDownQuery()}})||this;o.observers=new Set,o.subscriptions=new Set,o.queryInfo=i,o.queryManager=n,o.isTornDown=!1;var s=n.defaultOptions.watchQuery,u=s===void 0?{}:s,c=u.fetchPolicy,l=c===void 0?"cache-first":c,d=a.fetchPolicy,f=d===void 0?l:d,p=a.initialFetchPolicy,h=p===void 0?f==="standby"?l:f:p;o.options=S(S({},a),{initialFetchPolicy:h,fetchPolicy:f}),o.queryId=i.queryId||n.generateQueryId();var g=Xt(o.query);return o.queryName=g&&g.name&&g.name.value,o}return Object.defineProperty(e.prototype,"query",{get:function(){return this.queryManager.transform(this.options.query).document},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),e.prototype.result=function(){var r=this;return new Promise(function(n,i){var a={next:function(s){n(s),r.observers.delete(a),r.observers.size||r.queryManager.removeQuery(r.queryId),setTimeout(function(){o.unsubscribe()},0)},error:i},o=r.subscribe(a)})},e.prototype.getCurrentResult=function(r){r===void 0&&(r=!0);var n=this.getLastResult(!0),i=this.queryInfo.networkStatus||n&&n.networkStatus||fe.ready,a=S(S({},n),{loading:jr(i),networkStatus:i}),o=this.options.fetchPolicy,s=o===void 0?"cache-first":o;if(!(s==="network-only"||s==="no-cache"||s==="standby"||this.queryManager.transform(this.options.query).hasForcedResolvers)){var u=this.queryInfo.getDiff();(u.complete||this.options.returnPartialData)&&(a.data=u.result),Ee(a.data,{})&&(a.data=void 0),u.complete?(delete a.partial,u.complete&&a.networkStatus===fe.loading&&(s==="cache-first"||s==="cache-only")&&(a.networkStatus=fe.ready,a.loading=!1)):a.partial=!0,__DEV__&&!u.complete&&!this.options.partialRefetch&&!a.loading&&!a.data&&!a.error&&zu(u.missing)}return r&&this.updateLastResult(a),a},e.prototype.isDifferentFromLastResult=function(r,n){return!this.last||!Ee(this.last.result,r)||n&&!Ee(this.last.variables,n)},e.prototype.getLast=function(r,n){var i=this.last;if(i&&i[r]&&(!n||Ee(i.variables,this.variables)))return i[r]},e.prototype.getLastResult=function(r){return this.getLast("result",r)},e.prototype.getLastError=function(r){return this.getLast("error",r)},e.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},e.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},e.prototype.refetch=function(r){var n,i={pollInterval:0},a=this.options.fetchPolicy;if(a==="cache-and-network"?i.fetchPolicy=a:a==="no-cache"?i.fetchPolicy="no-cache":i.fetchPolicy="network-only",__DEV__&&r&&iy.call(r,"variables")){var o=ca(this.query),s=o.variableDefinitions;(!s||!s.some(function(u){return u.variable.name.value==="variables"}))&&__DEV__&&N.warn("Called refetch(".concat(JSON.stringify(r),") for query ").concat(((n=o.name)===null||n===void 0?void 0:n.value)||JSON.stringify(o),`, which does not declare a $variables variable.
|
|
52
|
+
Did you mean to call refetch(variables) instead of refetch({ variables })?`))}return r&&!Ee(this.options.variables,r)&&(i.variables=this.options.variables=S(S({},this.options.variables),r)),this.queryInfo.resetLastWrite(),this.reobserve(i,fe.refetch)},e.prototype.fetchMore=function(r){var n=this,i=S(S({},r.query?r:S(S(S(S({},this.options),{query:this.query}),r),{variables:S(S({},this.options.variables),r.variables)})),{fetchPolicy:"no-cache"}),a=this.queryManager.generateQueryId(),o=this.queryInfo,s=o.networkStatus;o.networkStatus=fe.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var u=new Set;return this.queryManager.fetchQuery(a,i,fe.fetchMore).then(function(c){return n.queryManager.removeQuery(a),o.networkStatus===fe.fetchMore&&(o.networkStatus=s),n.queryManager.cache.batch({update:function(l){var d=r.updateQuery;d?l.updateQuery({query:n.query,variables:n.variables,returnPartialData:!0,optimistic:!1},function(f){return d(f,{fetchMoreResult:c.data,variables:i.variables})}):l.writeQuery({query:i.query,variables:i.variables,data:c.data})},onWatchUpdated:function(l){u.add(l.query)}}),c}).finally(function(){u.has(n.query)||Qu(n)})},e.prototype.subscribeToMore=function(r){var n=this,i=this.queryManager.startGraphQLSubscription({query:r.document,variables:r.variables,context:r.context}).subscribe({next:function(a){var o=r.updateQuery;o&&n.updateQuery(function(s,u){var c=u.variables;return o(s,{subscriptionData:a,variables:c})})},error:function(a){if(r.onError){r.onError(a);return}__DEV__&&N.error("Unhandled GraphQL subscription error",a)}});return this.subscriptions.add(i),function(){n.subscriptions.delete(i)&&i.unsubscribe()}},e.prototype.setOptions=function(r){return this.reobserve(r)},e.prototype.setVariables=function(r){return Ee(this.variables,r)?this.observers.size?this.result():Promise.resolve():(this.options.variables=r,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:r},fe.setVariables):Promise.resolve())},e.prototype.updateQuery=function(r){var n=this.queryManager,i=n.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,a=r(i,{variables:this.variables});a&&(n.cache.writeQuery({query:this.options.query,data:a,variables:this.variables}),n.broadcastQueries())},e.prototype.startPolling=function(r){this.options.pollInterval=r,this.updatePolling()},e.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},e.prototype.applyNextFetchPolicy=function(r,n){if(n.nextFetchPolicy){var i=n.fetchPolicy,a=i===void 0?"cache-first":i,o=n.initialFetchPolicy,s=o===void 0?a:o;a==="standby"||(typeof n.nextFetchPolicy=="function"?n.fetchPolicy=n.nextFetchPolicy(a,{reason:r,options:n,observable:this,initialFetchPolicy:s}):r==="variables-changed"?n.fetchPolicy=s:n.fetchPolicy=n.nextFetchPolicy)}return n.fetchPolicy},e.prototype.fetch=function(r,n){return this.queryManager.setObservableQuery(this),this.queryManager.fetchQueryObservable(this.queryId,r,n)},e.prototype.updatePolling=function(){var r=this;if(!this.queryManager.ssrMode){var n=this,i=n.pollingInfo,a=n.options.pollInterval;if(!a){i&&(clearTimeout(i.timeout),delete this.pollingInfo);return}if(!(i&&i.interval===a)){__DEV__?N(a,"Attempted to start a polling query without a polling interval."):N(a,13);var o=i||(this.pollingInfo={});o.interval=a;var s=function(){r.pollingInfo&&(jr(r.queryInfo.networkStatus)?u():r.reobserve({fetchPolicy:r.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},fe.poll).then(u,u))},u=function(){var c=r.pollingInfo;c&&(clearTimeout(c.timeout),c.timeout=setTimeout(s,c.interval))};u()}}},e.prototype.updateLastResult=function(r,n){return n===void 0&&(n=this.variables),this.last=S(S({},this.last),{result:this.queryManager.assumeImmutableResults?r:jo(r),variables:n}),Be(r.errors)||delete this.last.error,this.last},e.prototype.reobserve=function(r,n){var i=this;this.isTornDown=!1;var a=n===fe.refetch||n===fe.fetchMore||n===fe.poll,o=this.options.variables,s=this.options.fetchPolicy,u=Lr(this.options,r||{}),c=a?u:ny(this.options,u);a||(this.updatePolling(),r&&r.variables&&!Ee(r.variables,o)&&c.fetchPolicy!=="standby"&&c.fetchPolicy===s&&(this.applyNextFetchPolicy("variables-changed",c),n===void 0&&(n=fe.setVariables)));var l=c.variables&&S({},c.variables),d=this.fetch(c,n),f={next:function(p){i.reportResult(p,l)},error:function(p){i.reportError(p,l)}};return a||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=d,this.observer=f),d.addObserver(f),d.promise},e.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},e.prototype.reportResult=function(r,n){var i=this.getLastError();(i||this.isDifferentFromLastResult(r,n))&&((i||!r.partial||this.options.returnPartialData)&&this.updateLastResult(r,n),Sn(this.observers,"next",r))},e.prototype.reportError=function(r,n){var i=S(S({},this.getLastResult()),{error:r,errors:r.graphQLErrors,networkStatus:fe.error,loading:!1});this.updateLastResult(i,n),Sn(this.observers,"error",this.last.error=r)},e.prototype.hasObservers=function(){return this.observers.size>0},e.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach(function(r){return r.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},e}(ne);qo(ss);function Qu(t){var e=t.options,r=e.fetchPolicy,n=e.nextFetchPolicy;return r==="cache-and-network"||r==="network-only"?t.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(){return this.nextFetchPolicy=n,typeof n=="function"?n.apply(this,arguments):r}}):t.reobserve()}function ay(t){__DEV__&&N.error("Unhandled error",t.message,t.stack)}function zu(t){__DEV__&&t&&__DEV__&&N.debug("Missing cache result fields: ".concat(JSON.stringify(t)),t)}var cs=function(){function t(e){var r=e.cache,n=e.client,i=e.resolvers,a=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=r,n&&(this.client=n),i&&this.addResolvers(i),a&&this.setFragmentMatcher(a)}return t.prototype.addResolvers=function(e){var r=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(n){r.resolvers=iu(r.resolvers,n)}):this.resolvers=iu(this.resolvers,e)},t.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},t.prototype.getResolvers=function(){return this.resolvers||{}},t.prototype.runResolvers=function(e){var r=e.document,n=e.remoteResult,i=e.context,a=e.variables,o=e.onlyRunForcedResolvers,s=o===void 0?!1:o;return Bt(this,void 0,void 0,function(){return qt(this,function(u){return r?[2,this.resolveDocument(r,n.data,i,a,this.fragmentMatcher,s).then(function(c){return S(S({},n),{data:c.result})})]:[2,n]})})},t.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},t.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},t.prototype.clientQuery=function(e){return si(["client"],e)&&this.resolvers?e:null},t.prototype.serverQuery=function(e){return nu(e)},t.prototype.prepareContext=function(e){var r=this.cache;return S(S({},e),{cache:r,getCacheKey:function(n){return r.identify(n)}})},t.prototype.addExportedVariables=function(e,r,n){return r===void 0&&(r={}),n===void 0&&(n={}),Bt(this,void 0,void 0,function(){return qt(this,function(i){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,r)||{},this.prepareContext(n),r).then(function(a){return S(S({},r),a.exportedVariables)})]:[2,S({},r)]})})},t.prototype.shouldForceResolvers=function(e){var r=!1;return it(e,{Directive:{enter:function(n){if(n.name.value==="client"&&n.arguments&&(r=n.arguments.some(function(i){return i.name.value==="always"&&i.value.kind==="BooleanValue"&&i.value.value===!0}),r))return mn}}}),r},t.prototype.buildRootValueFromCache=function(e,r){return this.cache.diff({query:ru(e),variables:r,returnPartialData:!0,optimistic:!1}).result},t.prototype.resolveDocument=function(e,r,n,i,a,o){return n===void 0&&(n={}),i===void 0&&(i={}),a===void 0&&(a=function(){return!0}),o===void 0&&(o=!1),Bt(this,void 0,void 0,function(){var s,u,c,l,d,f,p,h,g,b,C;return qt(this,function(w){return s=bn(e),u=vn(e),c=gn(u),l=this.collectSelectionsToResolve(s,c),d=s.operation,f=d?d.charAt(0).toUpperCase()+d.slice(1):"Query",p=this,h=p.cache,g=p.client,b={fragmentMap:c,context:S(S({},n),{cache:h,client:g}),variables:i,fragmentMatcher:a,defaultOperationType:f,exportedVariables:{},selectionsToResolve:l,onlyRunForcedResolvers:o},C=!1,[2,this.resolveSelectionSet(s.selectionSet,C,r,b).then(function(_){return{result:_,exportedVariables:b.exportedVariables}})]})})},t.prototype.resolveSelectionSet=function(e,r,n,i){return Bt(this,void 0,void 0,function(){var a,o,s,u,c,l=this;return qt(this,function(d){return a=i.fragmentMap,o=i.context,s=i.variables,u=[n],c=function(f){return Bt(l,void 0,void 0,function(){var p,h;return qt(this,function(g){return!r&&!i.selectionsToResolve.has(f)?[2]:dr(f,s)?Ct(f)?[2,this.resolveField(f,r,n,i).then(function(b){var C;typeof b<"u"&&u.push((C={},C[Pt(f)]=b,C))})]:(Yc(f)?p=f:(p=a[f.name.value],__DEV__?N(p,"No fragment named ".concat(f.name.value)):N(p,11)),p&&p.typeCondition&&(h=p.typeCondition.name.value,i.fragmentMatcher(n,h,o))?[2,this.resolveSelectionSet(p.selectionSet,r,n,i).then(function(b){u.push(b)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(c)).then(function(){return ua(u)})]})})},t.prototype.resolveField=function(e,r,n,i){return Bt(this,void 0,void 0,function(){var a,o,s,u,c,l,d,f,p,h=this;return qt(this,function(g){return n?(a=i.variables,o=e.name.value,s=Pt(e),u=o!==s,c=n[s]||n[o],l=Promise.resolve(c),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(d=n.__typename||i.defaultOperationType,f=this.resolvers&&this.resolvers[d],f&&(p=f[u?o:s],p&&(l=Promise.resolve(vi.withValue(this.cache,p,[n,hr(e,a),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,l.then(function(b){var C,w;if(b===void 0&&(b=c),e.directives&&e.directives.forEach(function(y){y.name.value==="export"&&y.arguments&&y.arguments.forEach(function(T){T.name.value==="as"&&T.value.kind==="StringValue"&&(i.exportedVariables[T.value.value]=b)})}),!e.selectionSet||b==null)return b;var _=(w=(C=e.directives)===null||C===void 0?void 0:C.some(function(y){return y.name.value==="client"}))!==null&&w!==void 0?w:!1;if(Array.isArray(b))return h.resolveSubSelectedArray(e,r||_,b,i);if(e.selectionSet)return h.resolveSelectionSet(e.selectionSet,r||_,b,i)})]):[2,null]})})},t.prototype.resolveSubSelectedArray=function(e,r,n,i){var a=this;return Promise.all(n.map(function(o){if(o===null)return null;if(Array.isArray(o))return a.resolveSubSelectedArray(e,r,o,i);if(e.selectionSet)return a.resolveSelectionSet(e.selectionSet,r,o,i)}))},t.prototype.collectSelectionsToResolve=function(e,r){var n=function(o){return!Array.isArray(o)},i=this.selectionsToResolveCache;function a(o){if(!i.has(o)){var s=new Set;i.set(o,s),it(o,{Directive:function(u,c,l,d,f){u.name.value==="client"&&f.forEach(function(p){n(p)&&ia(p)&&s.add(p)})},FragmentSpread:function(u,c,l,d,f){var p=r[u.name.value];__DEV__?N(p,"No fragment named ".concat(u.name.value)):N(p,12);var h=a(p);h.size>0&&(f.forEach(function(g){n(g)&&ia(g)&&s.add(g)}),s.add(u),h.forEach(function(g){s.add(g)}))}})}return i.get(o)}return a(e)},t}();var _i=new(Rt?WeakMap:Map);function Hu(t,e){var r=t[e];typeof r=="function"&&(t[e]=function(){return _i.set(t,(_i.get(t)+1)%1e15),r.apply(this,arguments)})}function Nd(t){t.notifyTimeout&&(clearTimeout(t.notifyTimeout),t.notifyTimeout=void 0)}var us=function(){function t(e,r){r===void 0&&(r=e.generateQueryId()),this.queryId=r,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=e.cache;_i.has(n)||(_i.set(n,0),Hu(n,"evict"),Hu(n,"modify"),Hu(n,"reset"))}return t.prototype.init=function(e){var r=e.networkStatus||fe.loading;return this.variables&&this.networkStatus!==fe.loading&&!Ee(this.variables,e.variables)&&(r=fe.setVariables),Ee(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:r}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},t.prototype.reset=function(){Nd(this),this.dirty=!1},t.prototype.getDiff=function(e){e===void 0&&(e=this.variables);var r=this.getDiffOptions(e);if(this.lastDiff&&Ee(r,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=e);var n=this.observableQuery;if(n&&n.options.fetchPolicy==="no-cache")return{complete:!1};var i=this.cache.diff(r);return this.updateLastDiff(i,r),i},t.prototype.updateLastDiff=function(e,r){this.lastDiff=e?{diff:e,options:r||this.getDiffOptions()}:void 0},t.prototype.getDiffOptions=function(e){var r;return e===void 0&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:(r=this.observableQuery)===null||r===void 0?void 0:r.options.canonizeResults}},t.prototype.setDiff=function(e){var r=this,n=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),!this.dirty&&!Ee(n&&n.result,e&&e.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return r.notify()},0)))},t.prototype.setObservableQuery=function(e){var r=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){var n=r.getDiff();n.fromOptimisticTransaction?e.observe():Qu(e)})):delete this.oqListener)},t.prototype.notify=function(){var e=this;Nd(this),this.shouldNotify()&&this.listeners.forEach(function(r){return r(e)}),this.dirty=!1},t.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(jr(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if(e!=="cache-only"&&e!=="cache-and-network")return!1}return!0},t.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=t.prototype.cancel,this.subscriptions.forEach(function(r){return r.unsubscribe()});var e=this.observableQuery;e&&e.stopPolling()}},t.prototype.cancel=function(){},t.prototype.updateWatch=function(e){var r=this;e===void 0&&(e=this.variables);var n=this.observableQuery;if(!(n&&n.options.fetchPolicy==="no-cache")){var i=S(S({},this.getDiffOptions(e)),{watcher:this,callback:function(a){return r.setDiff(a)}});(!this.lastWatch||!Ee(i,this.lastWatch))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=i))}},t.prototype.resetLastWrite=function(){this.lastWrite=void 0},t.prototype.shouldWrite=function(e,r){var n=this.lastWrite;return!(n&&n.dmCount===_i.get(this.cache)&&Ee(r,n.variables)&&Ee(e.data,n.result.data))},t.prototype.markResult=function(e,r,n,i){var a=this,o=new mt,s=Be(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Be(e.incremental)){var u=Vo(this.getDiff().result,e);e.data=u}else if("hasNext"in e&&e.hasNext){var c=this.getDiff();e.data=o.merge(c.result,e.data)}this.graphQLErrors=s,n.fetchPolicy==="no-cache"?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):i!==0&&(ls(e,n.errorPolicy)?this.cache.performTransaction(function(l){if(a.shouldWrite(e,n.variables))l.writeQuery({query:r,data:e.data,variables:n.variables,overwrite:i===1}),a.lastWrite={result:e,variables:n.variables,dmCount:_i.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){e.data=a.lastDiff.diff.result;return}var d=a.getDiffOptions(n.variables),f=l.diff(d);a.stopped||a.updateWatch(n.variables),a.updateLastDiff(f,d),f.complete&&(e.data=f.result)}):this.lastWrite=void 0)},t.prototype.markReady=function(){return this.networkError=null,this.networkStatus=fe.ready},t.prototype.markError=function(e){return this.networkStatus=fe.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},t}();function ls(t,e){e===void 0&&(e="none");var r=e==="ignore"||e==="all",n=!di(t);return!n&&r&&t.data&&(n=!0),n}var oy=Object.prototype.hasOwnProperty,Pd=function(){function t(e){var r=e.cache,n=e.link,i=e.defaultOptions,a=e.queryDeduplication,o=a===void 0?!1:a,s=e.onBroadcast,u=e.ssrMode,c=u===void 0?!1:u,l=e.clientAwareness,d=l===void 0?{}:l,f=e.localState,p=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(Rt?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=r,this.link=n,this.defaultOptions=i||Object.create(null),this.queryDeduplication=o,this.clientAwareness=d,this.localState=f||new cs({cache:r}),this.ssrMode=c,this.assumeImmutableResults=!!p,(this.onBroadcast=s)&&(this.mutationStore=Object.create(null))}return t.prototype.stop=function(){var e=this;this.queries.forEach(function(r,n){e.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(__DEV__?new H("QueryManager stopped while query was in flight"):new H(14))},t.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(r){return r(e)}),this.fetchCancelFns.clear()},t.prototype.mutate=function(e){var r,n,i=e.mutation,a=e.variables,o=e.optimisticResponse,s=e.updateQueries,u=e.refetchQueries,c=u===void 0?[]:u,l=e.awaitRefetchQueries,d=l===void 0?!1:l,f=e.update,p=e.onQueryUpdated,h=e.fetchPolicy,g=h===void 0?((r=this.defaultOptions.mutate)===null||r===void 0?void 0:r.fetchPolicy)||"network-only":h,b=e.errorPolicy,C=b===void 0?((n=this.defaultOptions.mutate)===null||n===void 0?void 0:n.errorPolicy)||"none":b,w=e.keepRootFields,_=e.context;return Bt(this,void 0,void 0,function(){var y,T,R,k,P,M;return qt(this,function($){switch($.label){case 0:return __DEV__?N(i,"mutation option is required. You must specify your GraphQL document in the mutation option."):N(i,15),__DEV__?N(g==="network-only"||g==="no-cache","Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):N(g==="network-only"||g==="no-cache",16),y=this.generateMutationId(),T=this.transform(i),R=T.document,k=T.hasClientExports,i=this.cache.transformForLink(R),a=this.getVariables(i,a),k?[4,this.localState.addExportedVariables(i,a,_)]:[3,2];case 1:a=$.sent(),$.label=2;case 2:return P=this.mutationStore&&(this.mutationStore[y]={mutation:i,variables:a,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:y,document:i,variables:a,fetchPolicy:g,errorPolicy:C,context:_,updateQueries:s,update:f,keepRootFields:w}),this.broadcastQueries(),M=this,[2,new Promise(function(V,Je){return Bo(M.getObservableFromLink(i,S(S({},_),{optimisticResponse:o}),a,!1),function(je){if(di(je)&&C==="none")throw new mr({graphQLErrors:Qo(je)});P&&(P.loading=!1,P.error=null);var Q=S({},je);return typeof c=="function"&&(c=c(Q)),C==="ignore"&&di(Q)&&delete Q.errors,M.markMutationResult({mutationId:y,result:Q,document:i,variables:a,fetchPolicy:g,errorPolicy:C,context:_,update:f,updateQueries:s,awaitRefetchQueries:d,refetchQueries:c,removeOptimistic:o?y:void 0,onQueryUpdated:p,keepRootFields:w})}).subscribe({next:function(je){M.broadcastQueries(),(!("hasNext"in je)||je.hasNext===!1)&&V(je)},error:function(je){P&&(P.loading=!1,P.error=je),o&&M.cache.removeOptimistic(y),M.broadcastQueries(),Je(je instanceof mr?je:new mr({networkError:je}))}})})]}})})},t.prototype.markMutationResult=function(e,r){var n=this;r===void 0&&(r=this.cache);var i=e.result,a=[],o=e.fetchPolicy==="no-cache";if(!o&&ls(i,e.errorPolicy)){if($r(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),$r(i)&&Be(i.incremental)){var s=r.diff({id:"ROOT_MUTATION",query:this.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),u=void 0;s.result&&(u=Vo(s.result,i)),typeof u<"u"&&(i.data=u,a.push({result:u,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var c=e.updateQueries;c&&this.queries.forEach(function(d,f){var p=d.observableQuery,h=p&&p.queryName;if(!(!h||!oy.call(c,h))){var g=c[h],b=n.queries.get(f),C=b.document,w=b.variables,_=r.diff({query:C,variables:w,returnPartialData:!0,optimistic:!1}),y=_.result,T=_.complete;if(T&&y){var R=g(y,{mutationResult:i,queryName:C&&ui(C)||void 0,queryVariables:w});R&&a.push({result:R,dataId:"ROOT_QUERY",query:C,variables:w})}}})}if(a.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(d){o||a.forEach(function(g){return d.write(g)});var f=e.update,p=!gf(i)||$r(i)&&!i.hasNext;if(f){if(!o){var h=d.diff({id:"ROOT_MUTATION",query:n.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});h.complete&&(i=S(S({},i),{data:h.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}p&&f(d,i,{context:e.context,variables:e.variables})}!o&&!e.keepRootFields&&p&&d.modify({id:"ROOT_MUTATION",fields:function(g,b){var C=b.fieldName,w=b.DELETE;return C==="__typename"?g:w}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(d){return l.push(d)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(l).then(function(){return i})}return Promise.resolve(i)},t.prototype.markMutationOptimistic=function(e,r){var n=this,i=typeof e=="function"?e(r.variables):e;return this.cache.recordOptimisticTransaction(function(a){try{n.markMutationResult(S(S({},r),{result:{data:i}}),a)}catch(o){__DEV__&&N.error(o)}},r.mutationId)},t.prototype.fetchQuery=function(e,r,n){return this.fetchQueryObservable(e,r,n).promise},t.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(r,n){e[n]={variables:r.variables,networkStatus:r.networkStatus,networkError:r.networkError,graphQLErrors:r.graphQLErrors}}),e},t.prototype.resetErrors=function(e){var r=this.queries.get(e);r&&(r.networkError=void 0,r.graphQLErrors=[])},t.prototype.transform=function(e){var r=this.transformCache;if(!r.has(e)){var n=this.cache.transformDocument(e),i=tu(n),a=this.localState.clientQuery(n),o=i&&this.localState.serverQuery(i),s={document:n,hasClientExports:Wc(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:a,serverQuery:o,defaultVars:_n(Xt(n)),asQuery:S(S({},n),{definitions:n.definitions.map(function(c){return c.kind==="OperationDefinition"&&c.operation!=="query"?S(S({},c),{operation:"query"}):c})})},u=function(c){c&&!r.has(c)&&r.set(c,s)};u(e),u(n),u(a),u(o)}return r.get(e)},t.prototype.getVariables=function(e,r){return S(S({},this.transform(e).defaultVars),r)},t.prototype.watchQuery=function(e){e=S(S({},e),{variables:this.getVariables(e.query,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var r=new us(this),n=new ss({queryManager:this,queryInfo:r,options:e});return this.queries.set(n.queryId,r),r.init({document:n.query,observableQuery:n,variables:n.variables}),n},t.prototype.query=function(e,r){var n=this;return r===void 0&&(r=this.generateQueryId()),__DEV__?N(e.query,"query option is required. You must specify your GraphQL document in the query option."):N(e.query,17),__DEV__?N(e.query.kind==="Document",'You must wrap the query string in a "gql" tag.'):N(e.query.kind==="Document",18),__DEV__?N(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):N(!e.returnPartialData,19),__DEV__?N(!e.pollInterval,"pollInterval option only supported on watchQuery."):N(!e.pollInterval,20),this.fetchQuery(r,e).finally(function(){return n.stopQuery(r)})},t.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},t.prototype.generateRequestId=function(){return this.requestIdCounter++},t.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},t.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryInStoreNoBroadcast=function(e){var r=this.queries.get(e);r&&r.stop()},t.prototype.clearStore=function(e){return e===void 0&&(e={discardWatches:!0}),this.cancelPendingFetches(__DEV__?new H("Store reset while query was in flight (not completed in link chain)"):new H(21)),this.queries.forEach(function(r){r.observableQuery?r.networkStatus=fe.loading:r.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},t.prototype.getObservableQueries=function(e){var r=this;e===void 0&&(e="active");var n=new Map,i=new Map,a=new Set;return Array.isArray(e)&&e.forEach(function(o){typeof o=="string"?i.set(o,!1):Zc(o)?i.set(r.transform(o).document,!1):ue(o)&&o.query&&a.add(o)}),this.queries.forEach(function(o,s){var u=o.observableQuery,c=o.document;if(u){if(e==="all"){n.set(s,u);return}var l=u.queryName,d=u.options.fetchPolicy;if(d==="standby"||e==="active"&&!u.hasObservers())return;(e==="active"||l&&i.has(l)||c&&i.has(c))&&(n.set(s,u),l&&i.set(l,!0),c&&i.set(c,!0))}}),a.size&&a.forEach(function(o){var s=fa("legacyOneTimeQuery"),u=r.getQuery(s).init({document:o.query,variables:o.variables}),c=new ss({queryManager:r,queryInfo:u,options:S(S({},o),{fetchPolicy:"network-only"})});N(c.queryId===s),u.setObservableQuery(c),n.set(s,c)}),__DEV__&&i.size&&i.forEach(function(o,s){o||__DEV__&&N.warn("Unknown query ".concat(typeof s=="string"?"named ":"").concat(JSON.stringify(s,null,2)," requested in refetchQueries options.include array"))}),n},t.prototype.reFetchObservableQueries=function(e){var r=this;e===void 0&&(e=!1);var n=[];return this.getObservableQueries(e?"all":"active").forEach(function(i,a){var o=i.options.fetchPolicy;i.resetLastResults(),(e||o!=="standby"&&o!=="cache-only")&&n.push(i.refetch()),r.getQuery(a).setDiff(null)}),this.broadcastQueries(),Promise.all(n)},t.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},t.prototype.startGraphQLSubscription=function(e){var r=this,n=e.query,i=e.fetchPolicy,a=e.errorPolicy,o=e.variables,s=e.context,u=s===void 0?{}:s;n=this.transform(n).document,o=this.getVariables(n,o);var c=function(d){return r.getObservableFromLink(n,u,d).map(function(f){if(i!=="no-cache"&&(ls(f,a)&&r.cache.write({query:n,result:f.data,dataId:"ROOT_SUBSCRIPTION",variables:d}),r.broadcastQueries()),di(f))throw new mr({graphQLErrors:f.errors});return f})};if(this.transform(n).hasClientExports){var l=this.localState.addExportedVariables(n,o,u).then(c);return new ne(function(d){var f=null;return l.then(function(p){return f=p.subscribe(d)},d.error),function(){return f&&f.unsubscribe()}})}return c(o)},t.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},t.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},t.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){return e.notify()})},t.prototype.getLocalState=function(){return this.localState},t.prototype.getObservableFromLink=function(e,r,n,i){var a=this,o;i===void 0&&(i=(o=r?.queryDeduplication)!==null&&o!==void 0?o:this.queryDeduplication);var s,u=this.transform(e).serverQuery;if(u){var c=this,l=c.inFlightLinkObservables,d=c.link,f={query:u,variables:n,operationName:ui(u)||void 0,context:this.prepareContext(S(S({},r),{forceFetch:!i}))};if(r=f.context,i){var p=l.get(u)||new Map;l.set(u,p);var h=xt(n);if(s=p.get(h),!s){var g=new fi([hi(d,f)]);p.set(h,s=g),g.beforeNext(function(){p.delete(h)&&p.size<1&&l.delete(u)})}}else s=new fi([hi(d,f)])}else s=new fi([ne.of({data:{}})]),r=this.prepareContext(r);var b=this.transform(e).clientQuery;return b&&(s=Bo(s,function(C){return a.localState.runResolvers({document:b,remoteResult:C,context:r,variables:n})})),s},t.prototype.getResultsFromLink=function(e,r,n){var i=e.lastRequestId=this.generateRequestId(),a=this.cache.transformForLink(this.transform(e.document).document);return Bo(this.getObservableFromLink(a,n.context,n.variables),function(o){var s=Qo(o),u=s.length>0;if(i>=e.lastRequestId){if(u&&n.errorPolicy==="none")throw e.markError(new mr({graphQLErrors:s}));e.markResult(o,a,n,r),e.markReady()}var c={data:o.data,loading:!1,networkStatus:fe.ready};return u&&n.errorPolicy!=="ignore"&&(c.errors=s,c.networkStatus=fe.error),c},function(o){var s=Dd(o)?o:new mr({networkError:o});throw i>=e.lastRequestId&&e.markError(s),s})},t.prototype.fetchQueryObservable=function(e,r,n){var i=this;n===void 0&&(n=fe.loading);var a=this.transform(r.query).document,o=this.getVariables(a,r.variables),s=this.getQuery(e),u=this.defaultOptions.watchQuery,c=r.fetchPolicy,l=c===void 0?u&&u.fetchPolicy||"cache-first":c,d=r.errorPolicy,f=d===void 0?u&&u.errorPolicy||"none":d,p=r.returnPartialData,h=p===void 0?!1:p,g=r.notifyOnNetworkStatusChange,b=g===void 0?!1:g,C=r.context,w=C===void 0?{}:C,_=Object.assign({},r,{query:a,variables:o,fetchPolicy:l,errorPolicy:f,returnPartialData:h,notifyOnNetworkStatusChange:b,context:w}),y=function(k){_.variables=k;var P=i.fetchQueryByPolicy(s,_,n);return _.fetchPolicy!=="standby"&&P.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",r),P},T=function(){return i.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,function(k){T(),setTimeout(function(){return R.cancel(k)})});var R=new fi(this.transform(_.query).hasClientExports?this.localState.addExportedVariables(_.query,_.variables,_.context).then(y):y(_.variables));return R.promise.then(T,T),R},t.prototype.refetchQueries=function(e){var r=this,n=e.updateCache,i=e.include,a=e.optimistic,o=a===void 0?!1:a,s=e.removeOptimistic,u=s===void 0?o?fa("refetchQueries"):void 0:s,c=e.onQueryUpdated,l=new Map;i&&this.getObservableQueries(i).forEach(function(f,p){l.set(p,{oq:f,lastDiff:r.getQuery(p).getDiff()})});var d=new Map;return n&&this.cache.batch({update:n,optimistic:o&&u||!1,removeOptimistic:u,onWatchUpdated:function(f,p,h){var g=f.watcher instanceof us&&f.watcher.observableQuery;if(g){if(c){l.delete(g.queryId);var b=c(g,p,h);return b===!0&&(b=g.refetch()),b!==!1&&d.set(g,b),b}c!==null&&l.set(g.queryId,{oq:g,lastDiff:h,diff:p})}}}),l.size&&l.forEach(function(f,p){var h=f.oq,g=f.lastDiff,b=f.diff,C;if(c){if(!b){var w=h.queryInfo;w.reset(),b=w.getDiff()}C=c(h,b,g)}(!c||C===!0)&&(C=h.refetch()),C!==!1&&d.set(h,C),p.indexOf("legacyOneTimeQuery")>=0&&r.stopQueryNoBroadcast(p)}),u&&this.cache.removeOptimistic(u),d},t.prototype.fetchQueryByPolicy=function(e,r,n){var i=this,a=r.query,o=r.variables,s=r.fetchPolicy,u=r.refetchWritePolicy,c=r.errorPolicy,l=r.returnPartialData,d=r.context,f=r.notifyOnNetworkStatusChange,p=e.networkStatus;e.init({document:this.transform(a).document,variables:o,networkStatus:n});var h=function(){return e.getDiff(o)},g=function(y,T){T===void 0&&(T=e.networkStatus||fe.loading);var R=y.result;__DEV__&&!l&&!Ee(R,{})&&zu(y.missing);var k=function(P){return ne.of(S({data:P,loading:jr(T),networkStatus:T},y.complete?null:{partial:!0}))};return R&&i.transform(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:R},context:d,variables:o,onlyRunForcedResolvers:!0}).then(function(P){return k(P.data||void 0)}):c==="none"&&T===fe.refetch&&Array.isArray(y.missing)?k(void 0):k(R)},b=s==="no-cache"?0:n===fe.refetch&&u!=="merge"?1:2,C=function(){return i.getResultsFromLink(e,b,{variables:o,context:d,fetchPolicy:s,errorPolicy:c})},w=f&&typeof p=="number"&&p!==n&&jr(n);switch(s){default:case"cache-first":{var _=h();return _.complete?[g(_,e.markReady())]:l||w?[g(_),C()]:[C()]}case"cache-and-network":{var _=h();return _.complete||l||w?[g(_),C()]:[C()]}case"cache-only":return[g(h(),e.markReady())];case"network-only":return w?[g(h()),C()]:[C()];case"no-cache":return w?[g(e.getDiff()),C()]:[C()];case"standby":return[]}},t.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new us(this,e)),this.queries.get(e)},t.prototype.prepareContext=function(e){e===void 0&&(e={});var r=this.localState.prepareContext(e);return S(S({},r),{clientAwareness:this.clientAwareness})},t}();var Rd=!1;var ps=function(){function t(e){var r=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=e.uri,i=e.credentials,a=e.headers,o=e.cache,s=e.ssrMode,u=s===void 0?!1:s,c=e.ssrForceFetchDelay,l=c===void 0?0:c,d=e.connectToDevTools,f=d===void 0?typeof window=="object"&&!window.__APOLLO_CLIENT__&&__DEV__:d,p=e.queryDeduplication,h=p===void 0?!0:p,g=e.defaultOptions,b=e.assumeImmutableResults,C=b===void 0?!1:b,w=e.resolvers,_=e.typeDefs,y=e.fragmentMatcher,T=e.name,R=e.version,k=e.link;if(k||(k=n?new wu({uri:n,credentials:i,headers:a}):$t.empty()),!o)throw __DEV__?new H(`To initialize Apollo Client, you must specify a 'cache' property in the options object.
|
|
53
|
+
For more information, please visit: https://go.apollo.dev/c/docs`):new H(9);if(this.link=k,this.cache=o,this.disableNetworkFetches=u||l>0,this.queryDeduplication=h,this.defaultOptions=g||Object.create(null),this.typeDefs=_,l&&setTimeout(function(){return r.disableNetworkFetches=!1},l),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),f&&typeof window=="object"&&(window.__APOLLO_CLIENT__=this),!Rd&&f&&__DEV__&&(Rd=!0,typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var P=window.navigator,M=P&&P.userAgent,$=void 0;typeof M=="string"&&(M.indexOf("Chrome/")>-1?$="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":M.indexOf("Firefox/")>-1&&($="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),$&&__DEV__&&N.log("Download the Apollo DevTools for a better development experience: "+$)}this.version=_f,this.localState=new cs({cache:o,client:this,resolvers:w,fragmentMatcher:y}),this.queryManager=new Pd({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:h,ssrMode:u,clientAwareness:{name:T,version:R},localState:this.localState,assumeImmutableResults:C,onBroadcast:f?function(){r.devToolsHookCb&&r.devToolsHookCb({action:{},state:{queries:r.queryManager.getQueryStore(),mutations:r.queryManager.mutationStore||{}},dataWithOptimisticResults:r.cache.extract(!0)})}:void 0})}return t.prototype.stop=function(){this.queryManager.stop()},t.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=da(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=S(S({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},t.prototype.query=function(e){return this.defaultOptions.query&&(e=da(this.defaultOptions.query,e)),__DEV__?N(e.fetchPolicy!=="cache-and-network","The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):N(e.fetchPolicy!=="cache-and-network",10),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=S(S({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},t.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=da(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},t.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},t.prototype.readQuery=function(e,r){return r===void 0&&(r=!1),this.cache.readQuery(e,r)},t.prototype.readFragment=function(e,r){return r===void 0&&(r=!1),this.cache.readFragment(e,r)},t.prototype.writeQuery=function(e){var r=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),r},t.prototype.writeFragment=function(e){var r=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),r},t.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},t.prototype.__requestRaw=function(e){return hi(this.link,e)},t.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(r){return r()}))}).then(function(){return e.reFetchObservableQueries()})},t.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(r){return r()}))})},t.prototype.onResetStore=function(e){var r=this;return this.resetStoreCallbacks.push(e),function(){r.resetStoreCallbacks=r.resetStoreCallbacks.filter(function(n){return n!==e})}},t.prototype.onClearStore=function(e){var r=this;return this.clearStoreCallbacks.push(e),function(){r.clearStoreCallbacks=r.clearStoreCallbacks.filter(function(n){return n!==e})}},t.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},t.prototype.refetchQueries=function(e){var r=this.queryManager.refetchQueries(e),n=[],i=[];r.forEach(function(o,s){n.push(s),i.push(o)});var a=Promise.all(i);return a.queries=n,a.results=i,a.catch(function(o){__DEV__&&N.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(o))}),a},t.prototype.getObservableQueries=function(e){return e===void 0&&(e="active"),this.queryManager.getObservableQueries(e)},t.prototype.extract=function(e){return this.cache.extract(e)},t.prototype.restore=function(e){return this.cache.restore(e)},t.prototype.addResolvers=function(e){this.localState.addResolvers(e)},t.prototype.setResolvers=function(e){this.localState.setResolvers(e)},t.prototype.getResolvers=function(){return this.localState.getResolvers()},t.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},t.prototype.setLink=function(e){this.link=this.queryManager.link=e},t}();zp(hn?"log":"silent");function ct(t){return t===null?"null":Array.isArray(t)?"array":typeof t}function gr(t){return ct(t)==="object"}function $d(t){return Array.isArray(t)&&t.length>0&&t.every(e=>"message"in e)}function Gu(t,e){return t.length<124?t:e}var Ld="graphql-transport-ws";var gt;(function(t){t[t.InternalServerError=4500]="InternalServerError",t[t.InternalClientError=4005]="InternalClientError",t[t.BadRequest=4400]="BadRequest",t[t.BadResponse=4004]="BadResponse",t[t.Unauthorized=4401]="Unauthorized",t[t.Forbidden=4403]="Forbidden",t[t.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",t[t.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",t[t.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",t[t.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",t[t.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(gt||(gt={}));var Pe;(function(t){t.ConnectionInit="connection_init",t.ConnectionAck="connection_ack",t.Ping="ping",t.Pong="pong",t.Subscribe="subscribe",t.Next="next",t.Error="error",t.Complete="complete"})(Pe||(Pe={}));function Fd(t){if(!gr(t))throw new Error(`Message is expected to be an object, but got ${ct(t)}`);if(!t.type)throw new Error("Message is missing the 'type' property");if(typeof t.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${ct(t.type)}`);switch(t.type){case Pe.ConnectionInit:case Pe.ConnectionAck:case Pe.Ping:case Pe.Pong:{if(t.payload!=null&&!gr(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${t.payload}"`);break}case Pe.Subscribe:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${ct(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!gr(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${ct(t.payload)}`);if(typeof t.payload.query!="string")throw new Error(`"${t.type}" message payload expects the 'query' property to be a string, but got ${ct(t.payload.query)}`);if(t.payload.variables!=null&&!gr(t.payload.variables))throw new Error(`"${t.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${ct(t.payload.variables)}`);if(t.payload.operationName!=null&&ct(t.payload.operationName)!=="string")throw new Error(`"${t.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${ct(t.payload.operationName)}`);if(t.payload.extensions!=null&&!gr(t.payload.extensions))throw new Error(`"${t.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${ct(t.payload.extensions)}`);break}case Pe.Next:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${ct(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!gr(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${ct(t.payload)}`);break}case Pe.Error:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${ct(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!$d(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(t.payload)}`);break}case Pe.Complete:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${ct(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${t.type}"`)}return t}function Md(t,e){return Fd(typeof t=="string"?JSON.parse(t,e):t)}function wi(t,e){return Fd(t),JSON.stringify(t,e)}function Wu(t){let{url:e,connectionParams:r,lazy:n=!0,onNonLazyError:i=console.error,lazyCloseTimeout:a=0,keepAlive:o=0,disablePong:s,connectionAckWaitTimeout:u=0,retryAttempts:c=5,retryWait:l=async function(_e){let we=1e3;for(let se=0;se<_e;se++)we*=2;await new Promise(se=>setTimeout(se,we+Math.floor(Math.random()*(3e3-300)+300)))},shouldRetry:d=fs,isFatalConnectionProblem:f,on:p,webSocketImpl:h,generateID:g=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,_e=>{let we=Math.random()*16|0;return(_e=="x"?we:we&3|8).toString(16)})},jsonMessageReplacer:b,jsonMessageReviver:C}=t,w;if(h){if(!cy(h))throw new Error("Invalid WebSocket implementation provided");w=h}else typeof WebSocket<"u"?w=WebSocket:typeof global<"u"?w=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(w=window.WebSocket||window.MozWebSocket);if(!w)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let _=w,y=(()=>{let Q=(()=>{let we={};return{on(se,ce){return we[se]=ce,()=>{delete we[se]}},emit(se){var ce;"id"in se&&((ce=we[se.id])===null||ce===void 0||ce.call(we,se))}}})(),_e={connecting:p?.connecting?[p.connecting]:[],opened:p?.opened?[p.opened]:[],connected:p?.connected?[p.connected]:[],ping:p?.ping?[p.ping]:[],pong:p?.pong?[p.pong]:[],message:p?.message?[Q.emit,p.message]:[Q.emit],closed:p?.closed?[p.closed]:[],error:p?.error?[p.error]:[]};return{onMessage:Q.on,on(we,se){let ce=_e[we];return ce.push(se),()=>{ce.splice(ce.indexOf(se),1)}},emit(we,...se){for(let ce of[..._e[we]])ce(...se)}}})();function T(Q){let _e=[y.on("error",we=>{_e.forEach(se=>se()),Q(we)}),y.on("closed",we=>{_e.forEach(se=>se()),Q(we)})]}let R,k=0,P,M=!1,$=0,V=!1;async function Je(){clearTimeout(P);let[Q,_e]=await(R??(R=new Promise((ce,Kt)=>(async()=>{if(M){if(await l($),!k)return R=void 0,Kt({code:1e3,reason:"All Subscriptions Gone"});$++}y.emit("connecting");let re=new _(typeof e=="function"?await e():e,Ld),Zt,Ar;function xo(){isFinite(o)&&o>0&&(clearTimeout(Ar),Ar=setTimeout(()=>{re.readyState===_.OPEN&&(re.send(wi({type:Pe.Ping})),y.emit("ping",!1,void 0))},o))}T(Ye=>{R=void 0,clearTimeout(Zt),clearTimeout(Ar),Kt(Ye),fs(Ye)&&Ye.code===4499&&(re.close(4499,"Terminated"),re.onerror=null,re.onclose=null)}),re.onerror=Ye=>y.emit("error",Ye),re.onclose=Ye=>y.emit("closed",Ye),re.onopen=async()=>{try{y.emit("opened",re);let Ye=typeof r=="function"?await r():r;if(re.readyState!==_.OPEN)return;re.send(wi(Ye?{type:Pe.ConnectionInit,payload:Ye}:{type:Pe.ConnectionInit},b)),isFinite(u)&&u>0&&(Zt=setTimeout(()=>{re.close(gt.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},u)),xo()}catch(Ye){y.emit("error",Ye),re.close(gt.InternalClientError,Gu(Ye instanceof Error?Ye.message:new Error(Ye).message,"Internal client error"))}};let ri=!1;re.onmessage=({data:Ye})=>{try{let Xe=Md(Ye,C);if(y.emit("message",Xe),Xe.type==="ping"||Xe.type==="pong"){y.emit(Xe.type,!0,Xe.payload),Xe.type==="pong"?xo():s||(re.send(wi(Xe.payload?{type:Pe.Pong,payload:Xe.payload}:{type:Pe.Pong})),y.emit("pong",!1,Xe.payload));return}if(ri)return;if(Xe.type!==Pe.ConnectionAck)throw new Error(`First message cannot be of type ${Xe.type}`);clearTimeout(Zt),ri=!0,y.emit("connected",re,Xe.payload),M=!1,$=0,ce([re,new Promise((R3,nm)=>T(nm))])}catch(Xe){re.onmessage=null,y.emit("error",Xe),re.close(gt.BadResponse,Gu(Xe instanceof Error?Xe.message:new Error(Xe).message,"Bad response"))}}})())));Q.readyState===_.CLOSING&&await _e;let we=()=>{},se=new Promise(ce=>we=ce);return[Q,we,Promise.race([se.then(()=>{if(!k){let ce=()=>Q.close(1e3,"Normal Closure");isFinite(a)&&a>0?P=setTimeout(()=>{Q.readyState===_.OPEN&&ce()},a):ce()}}),_e])]}function je(Q){if(fs(Q)&&(sy(Q.code)||[gt.InternalServerError,gt.InternalClientError,gt.BadRequest,gt.BadResponse,gt.Unauthorized,gt.SubprotocolNotAcceptable,gt.SubscriberAlreadyExists,gt.TooManyInitialisationRequests].includes(Q.code)))throw Q;if(V)return!1;if(fs(Q)&&Q.code===1e3)return k>0;if(!c||$>=c||!d(Q)||f?.(Q))throw Q;return M=!0}return n||(async()=>{for(k++;;)try{let[,,Q]=await Je();await Q}catch(Q){try{if(!je(Q))return}catch(_e){return i?.(_e)}}})(),{on:y.on,subscribe(Q,_e){let we=g(Q),se=!1,ce=!1,Kt=()=>{k--,se=!0};return(async()=>{for(k++;;)try{let[re,Zt,Ar]=await Je();if(se)return Zt();let xo=y.onMessage(we,ri=>{switch(ri.type){case Pe.Next:{_e.next(ri.payload);return}case Pe.Error:{ce=!0,se=!0,_e.error(ri.payload),Kt();return}case Pe.Complete:{se=!0,Kt();return}}});re.send(wi({id:we,type:Pe.Subscribe,payload:Q},b)),Kt=()=>{!se&&re.readyState===_.OPEN&&re.send(wi({id:we,type:Pe.Complete},b)),k--,se=!0,Zt()},await Ar.finally(xo);return}catch(re){if(!je(re))return}})().then(()=>{ce||_e.complete()}).catch(re=>{_e.error(re)}),()=>{se||Kt()}},async dispose(){if(V=!0,R){let[Q]=await R;Q.close(1e3,"Normal Closure")}},terminate(){R&&y.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}function fs(t){return gr(t)&&"code"in t&&"reason"in t}function sy(t){return[1e3,1001,1006,1005,1012,1013,1013].includes(t)?!1:t>=1e3&&t<=1999}function cy(t){return typeof t=="function"&&"constructor"in t&&"CLOSED"in t&&"CLOSING"in t&&"CONNECTING"in t&&"OPEN"in t}function uy(t){return ue(t)&&"code"in t&&"reason"in t}var Ku=function(t){De(e,t);function e(r){var n=t.call(this)||this;return n.client=r,n}return e.prototype.request=function(r){var n=this;return new ne(function(i){return n.client.subscribe(S(S({},r),{query:oi(r.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(a){return a instanceof Error?i.error(a):uy(a)?i.error(new Error("Socket closed with event ".concat(a.code," ").concat(a.reason||""))):i.error(new mr({graphQLErrors:Array.isArray(a)?a:[a]}))}})})},e}($t);var qs=function(){return qs=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},qs.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function ks(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ks=function(r){return typeof r}:ks=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ks(t)}function ly(t){return ks(t)=="object"&&t!==null}var e1=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function gl(t,e){for(var r=/\r\n|[\n\r]/g,n=1,i=e+1,a;(a=r.exec(t.body))&&a.index<e;)n+=1,i=e+1-(a.index+a[0].length);return{line:n,column:i}}function py(t){return t1(t.source,gl(t.source,t.start))}function t1(t,e){var r=t.locationOffset.column-1,n=As(r)+t.body,i=e.line-1,a=t.locationOffset.line-1,o=e.line+a,s=e.line===1?r:0,u=e.column+s,c="".concat(t.name,":").concat(o,":").concat(u,`
|
|
54
|
+
`),l=n.split(/\r\n|[\n\r]/g),d=l[i];if(d.length>120){for(var f=Math.floor(u/80),p=u%80,h=[],g=0;g<d.length;g+=80)h.push(d.slice(g,g+80));return c+Ud([["".concat(o),h[0]]].concat(h.slice(1,f+1).map(function(b){return["",b]}),[[" ",As(p-1)+"^"],["",h[f+1]]]))}return c+Ud([["".concat(o-1),l[i-1]],["".concat(o),d],["",As(u-1)+"^"],["".concat(o+1),l[i+1]]])}function Ud(t){var e=t.filter(function(n){n[0];var i=n[1];return i!==void 0}),r=Math.max.apply(Math,e.map(function(n){var i=n[0];return i.length}));return e.map(function(n){var i=n[0],a=n[1];return fy(r,i)+(a?" | "+a:" |")}).join(`
|
|
55
|
+
`)}function As(t){return Array(t+1).join(" ")}function fy(t,e){return As(t-e.length)+e}function Is(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Is=function(r){return typeof r}:Is=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Is(t)}function jd(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function dy(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?jd(Object(r),!0).forEach(function(n){hy(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):jd(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function hy(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function my(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Bd(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function gy(t,e,r){return e&&Bd(t.prototype,e),r&&Bd(t,r),t}function yy(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ja(t,e)}function vy(t){var e=n1();return function(){var n=Ya(t),i;if(e){var a=Ya(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return r1(this,i)}}function r1(t,e){return e&&(Is(e)==="object"||typeof e=="function")?e:ka(t)}function ka(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function yl(t){var e=typeof Map=="function"?new Map:void 0;return yl=function(n){if(n===null||!by(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return Ts(n,arguments,Ya(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Ja(i,n)},yl(t)}function Ts(t,e,r){return n1()?Ts=Reflect.construct:Ts=function(i,a,o){var s=[null];s.push.apply(s,a);var u=Function.bind.apply(i,s),c=new u;return o&&Ja(c,o.prototype),c},Ts.apply(null,arguments)}function n1(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function by(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function Ja(t,e){return Ja=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Ja(t,e)}function Ya(t){return Ya=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Ya(t)}var _y=function(t){yy(r,t);var e=vy(r);function r(n,i,a,o,s,u,c){var l,d,f,p;my(this,r),p=e.call(this,n),p.name="GraphQLError",p.originalError=u??void 0,p.nodes=qd(Array.isArray(i)?i:i?[i]:void 0);for(var h=[],g=0,b=(C=p.nodes)!==null&&C!==void 0?C:[];g<b.length;g++){var C,w=b[g],_=w.loc;_!=null&&h.push(_)}h=qd(h),p.source=a??((l=h)===null||l===void 0?void 0:l[0].source),p.positions=o??((d=h)===null||d===void 0?void 0:d.map(function(T){return T.start})),p.locations=o&&a?o.map(function(T){return gl(a,T)}):(f=h)===null||f===void 0?void 0:f.map(function(T){return gl(T.source,T.start)}),p.path=s??void 0;var y=u?.extensions;return c==null&&ly(y)?p.extensions=dy({},y):p.extensions=c??{},Object.defineProperties(ka(p),{message:{enumerable:!0},locations:{enumerable:p.locations!=null},path:{enumerable:p.path!=null},extensions:{enumerable:p.extensions!=null&&Object.keys(p.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),u!=null&&u.stack?(Object.defineProperty(ka(p),"stack",{value:u.stack,writable:!0,configurable:!0}),r1(p)):(Error.captureStackTrace?Error.captureStackTrace(ka(p),r):Object.defineProperty(ka(p),"stack",{value:Error().stack,writable:!0,configurable:!0}),p)}return gy(r,[{key:"toString",value:function(){return wy(this)}},{key:e1,get:function(){return"Object"}}]),r}(yl(Error));function qd(t){return t===void 0||t.length===0?void 0:t}function wy(t){var e=t.message;if(t.nodes)for(var r=0,n=t.nodes;r<n.length;r++){var i=n[r];i.loc&&(e+=`
|
|
56
56
|
|
|
57
|
-
`+
|
|
57
|
+
`+py(i.loc))}else if(t.source&&t.locations)for(var a=0,o=t.locations;a<o.length;a++){var s=o[a];e+=`
|
|
58
58
|
|
|
59
|
-
`+
|
|
60
|
-
`)}function
|
|
61
|
-
`;break;case 114:c+="\r";break;case 116:c+=" ";break;case 117:{var l=Kg(a.charCodeAt(o+1),a.charCodeAt(o+2),a.charCodeAt(o+3),a.charCodeAt(o+4));if(l<0){var d=a.slice(o+1,o+5);throw gt(t,o,"Invalid character escape sequence: \\u".concat(d,"."))}c+=String.fromCharCode(l),o+=4;break}default:throw gt(t,o,"Invalid character escape sequence: \\".concat(String.fromCharCode(u),"."))}++o,s=o}}throw gt(t,o,"Unterminated string.")}function Wg(t,e,r,n,i,a){for(var o=t.body,s=e+3,u=s,c=0,l="";s<o.length&&!isNaN(c=o.charCodeAt(s));){if(c===34&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34)return l+=o.slice(u,s),new Ie(k.BLOCK_STRING,e,s+3,r,n,i,jg(l));if(c<32&&c!==9&&c!==10&&c!==13)throw gt(t,s,"Invalid character within String: ".concat(bn(c),"."));c===10?(++s,++a.line,a.lineStart=s):c===13?(o.charCodeAt(s+1)===10?s+=2:++s,++a.line,a.lineStart=s):c===92&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34&&o.charCodeAt(s+3)===34?(l+=o.slice(u,s)+'"""',s+=4,u=s):++s}throw gt(t,s,"Unterminated string.")}function Kg(t,e,r,n){return Do(t)<<12|Do(e)<<8|Do(r)<<4|Do(n)}function Do(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function Zg(t,e,r,n,i){for(var a=t.body,o=a.length,s=e+1,u=0;s!==o&&!isNaN(u=a.charCodeAt(s))&&(u===95||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new Ie(k.NAME,e,s,r,n,i,a.slice(e,s))}function Yg(t){return t===95||t>=65&&t<=90||t>=97&&t<=122}function Jg(t,e){var r=new Xg(t,e);return r.parseDocument()}var Xg=function(){function t(r,n){var i=Fg(r)?r:new dh(r);this._lexer=new qg(i),this._options=n}var e=t.prototype;return e.parseName=function(){var n=this.expectToken(k.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(k.SOF,this.parseDefinition,k.EOF),loc:this.loc(n)}},e.parseDefinition=function(){if(this.peek(k.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(k.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(k.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(k.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(k.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(k.PAREN_L,this.parseVariableDefinition,k.PAREN_R)},e.parseVariableDefinition=function(){var n=this._lexer.token;return{kind:j.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(k.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(k.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(k.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(k.BRACE_L,this.parseSelection,k.BRACE_R),loc:this.loc(n)}},e.parseSelection=function(){return this.peek(k.SPREAD)?this.parseFragment():this.parseField()},e.parseField=function(){var n=this._lexer.token,i=this.parseName(),a,o;return this.expectOptionalToken(k.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(k.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},e.parseArguments=function(n){var i=n?this.parseConstArgument:this.parseArgument;return this.optionalMany(k.PAREN_L,i,k.PAREN_R)},e.parseArgument=function(){var n=this._lexer.token,i=this.parseName();return this.expectToken(k.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(k.COLON),this.parseValueLiteral(!0)),loc:this.loc(n)}},e.parseFragment=function(){var n=this._lexer.token;this.expectToken(k.SPREAD);var i=this.expectOptionalKeyword("on");return!i&&this.peek(k.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 k.BRACKET_L:return this.parseList(n);case k.BRACE_L:return this.parseObject(n);case k.INT:return this._lexer.advance(),{kind:j.INT,value:i.value,loc:this.loc(i)};case k.FLOAT:return this._lexer.advance(),{kind:j.FLOAT,value:i.value,loc:this.loc(i)};case k.STRING:case k.BLOCK_STRING:return this.parseStringLiteral();case k.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 k.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===k.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(k.BRACKET_L,o,k.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(k.BRACE_L,o,k.BRACE_R),loc:this.loc(a)}},e.parseObjectField=function(n){var i=this._lexer.token,a=this.parseName();return this.expectToken(k.COLON),{kind:j.OBJECT_FIELD,name:a,value:this.parseValueLiteral(n),loc:this.loc(i)}},e.parseDirectives=function(n){for(var i=[];this.peek(k.AT);)i.push(this.parseDirective(n));return i},e.parseDirective=function(n){var i=this._lexer.token;return this.expectToken(k.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(k.BRACKET_L)?(i=this.parseTypeReference(),this.expectToken(k.BRACKET_R),i={kind:j.LIST_TYPE,type:i,loc:this.loc(n)}):i=this.parseNamedType(),this.expectOptionalToken(k.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===k.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(k.STRING)||this.peek(k.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(k.BRACE_L,this.parseOperationTypeDefinition,k.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(k.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(k.AMP);do i.push(this.parseNamedType());while(this.expectOptionalToken(k.AMP)||this.peek(k.NAME));return i}return this.delimitedMany(k.AMP,this.parseNamedType)},e.parseFieldsDefinition=function(){var n;return((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLEmptyFields)===!0&&this.peek(k.BRACE_L)&&this._lexer.lookahead().kind===k.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(k.BRACE_L,this.parseFieldDefinition,k.BRACE_R)},e.parseFieldDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseArgumentDefs();this.expectToken(k.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(k.PAREN_L,this.parseInputValueDef,k.PAREN_R)},e.parseInputValueDef=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName();this.expectToken(k.COLON);var o=this.parseTypeReference(),s;this.expectOptionalToken(k.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(k.EQUALS)?this.delimitedMany(k.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(k.BRACE_L,this.parseEnumValueDefinition,k.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(k.BRACE_L,this.parseInputValueDef,k.BRACE_R)},e.parseTypeSystemExtension=function(){var n=this._lexer.lookahead();if(n.kind===k.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(k.BRACE_L,this.parseOperationTypeDefinition,k.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(k.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(k.PIPE,this.parseDirectiveLocation)},e.parseDirectiveLocation=function(){var n=this._lexer.token,i=this.parseName();if(Mg[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 fh(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 gt(this._lexer.source,i.start,"Expected ".concat(hh(n),", found ").concat(pu(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===k.NAME&&i.value===n)this._lexer.advance();else throw gt(this._lexer.source,i.start,'Expected "'.concat(n,'", found ').concat(pu(i),"."))},e.expectOptionalKeyword=function(n){var i=this._lexer.token;return i.kind===k.NAME&&i.value===n?(this._lexer.advance(),!0):!1},e.unexpected=function(n){var i=n??this._lexer.token;return gt(this._lexer.source,i.start,"Unexpected ".concat(pu(i),"."))},e.any=function(n,i,a){this.expectToken(n);for(var o=[];!this.expectOptionalToken(a);)o.push(i.call(this));return o},e.optionalMany=function(n,i,a){if(this.expectOptionalToken(n)){var o=[];do o.push(i.call(this));while(!this.expectOptionalToken(a));return o}return[]},e.many=function(n,i,a){this.expectToken(n);var o=[];do o.push(i.call(this));while(!this.expectOptionalToken(a));return o},e.delimitedMany=function(n,i){this.expectOptionalToken(n);var a=[];do a.push(i.call(this));while(this.expectOptionalToken(n));return a},t}();function pu(t){var e=t.value;return hh(t.kind)+(e!=null?' "'.concat(e,'"'):"")}function hh(t){return Bg(t)?'"'.concat(t,'"'):t}var Wo=new Map,Ru=new Map,mh=!0,as=!1;function gh(t){return t.replace(/[\s,]+/g," ").trim()}function ey(t){return gh(t.source.body.substring(t.start,t.end))}function ty(t){var e=new Set,r=[];return t.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,a=ey(n.loc),o=Ru.get(i);o&&!o.has(a)?mh&&console.warn("Warning: fragment with name "+i+` already exists.
|
|
59
|
+
`+t1(t.source,s)}return e}function kt(t,e,r){return new _y("Syntax Error: ".concat(r),void 0,t,[e])}var q=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});function Sy(t,e){var r=Boolean(t);if(!r)throw new Error(e??"Unexpected invariant triggered.")}var Cy=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,vl=Cy;function i1(t){var e=t.prototype.toJSON;typeof e=="function"||Sy(0),t.prototype.inspect=e,vl&&(t.prototype[vl]=e)}var a1=function(){function t(r,n,i){this.start=r.start,this.end=n.end,this.startToken=r,this.endToken=n,this.source=i}var e=t.prototype;return e.toJSON=function(){return{start:this.start,end:this.end}},t}();i1(a1);var $e=function(){function t(r,n,i,a,o,s,u){this.kind=r,this.start=n,this.end=i,this.line=a,this.column=o,this.value=u,this.prev=s,this.next=null}var e=t.prototype;return e.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},t}();i1($e);var I=Object.freeze({SOF:"<SOF>",EOF:"<EOF>",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"});function Os(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Os=function(r){return typeof r}:Os=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Os(t)}var xy=10,o1=2;function Ey(t){return pc(t,[])}function pc(t,e){switch(Os(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return t===null?"null":ky(t,e);default:return String(t)}}function ky(t,e){if(e.indexOf(t)!==-1)return"[Circular]";var r=[].concat(e,[t]),n=Ty(t);if(n!==void 0){var i=n.call(t);if(i!==t)return typeof i=="string"?i:pc(i,r)}else if(Array.isArray(t))return Iy(t,r);return Ay(t,r)}function Ay(t,e){var r=Object.keys(t);if(r.length===0)return"{}";if(e.length>o1)return"["+Oy(t)+"]";var n=r.map(function(i){var a=pc(t[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function Iy(t,e){if(t.length===0)return"[]";if(e.length>o1)return"[Array]";for(var r=Math.min(xy,t.length),n=t.length-r,i=[],a=0;a<r;++a)i.push(pc(t[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function Ty(t){var e=t[String(vl)];if(typeof e=="function")return e;if(typeof t.inspect=="function")return t.inspect}function Oy(t){var e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof t.constructor=="function"){var r=t.constructor.name;if(typeof r=="string"&&r!=="")return r}return e}function Zu(t,e){var r=Boolean(t);if(!r)throw new Error(e)}var Dy=function(e,r){return e instanceof r};function Vd(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ny(t,e,r){return e&&Vd(t.prototype,e),r&&Vd(t,r),t}var s1=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GraphQL request",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{line:1,column:1};typeof e=="string"||Zu(0,"Body must be a string. Received: ".concat(Ey(e),".")),this.body=e,this.name=r,this.locationOffset=n,this.locationOffset.line>0||Zu(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Zu(0,"column in locationOffset is 1-indexed and must be positive.")}return Ny(t,[{key:e1,get:function(){return"Source"}}]),t}();function Py(t){return Dy(t,s1)}var Ry=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});function $y(t){var e=t.split(/\r\n|[\n\r]/g),r=Ly(t);if(r!==0)for(var n=1;n<e.length;n++)e[n]=e[n].slice(r);for(var i=0;i<e.length&&Qd(e[i]);)++i;for(var a=e.length;a>i&&Qd(e[a-1]);)--a;return e.slice(i,a).join(`
|
|
60
|
+
`)}function Qd(t){for(var e=0;e<t.length;++e)if(t[e]!==" "&&t[e]!==" ")return!1;return!0}function Ly(t){for(var e,r=!0,n=!0,i=0,a=null,o=0;o<t.length;++o)switch(t.charCodeAt(o)){case 13:t.charCodeAt(o+1)===10&&++o;case 10:r=!1,n=!0,i=0;break;case 9:case 32:++i;break;default:n&&!r&&(a===null||i<a)&&(a=i),n=!1}return(e=a)!==null&&e!==void 0?e:0}var Fy=function(){function t(r){var n=new $e(I.SOF,0,0,0,0,null);this.source=r,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}var e=t.prototype;return e.advance=function(){this.lastToken=this.token;var n=this.token=this.lookahead();return n},e.lookahead=function(){var n=this.token;if(n.kind!==I.EOF)do{var i;n=(i=n.next)!==null&&i!==void 0?i:n.next=Uy(this,n)}while(n.kind===I.COMMENT);return n},t}();function My(t){return t===I.BANG||t===I.DOLLAR||t===I.AMP||t===I.PAREN_L||t===I.PAREN_R||t===I.SPREAD||t===I.COLON||t===I.EQUALS||t===I.AT||t===I.BRACKET_L||t===I.BRACKET_R||t===I.BRACE_L||t===I.PIPE||t===I.BRACE_R}function Mn(t){return isNaN(t)?I.EOF:t<127?JSON.stringify(String.fromCharCode(t)):'"\\u'.concat(("00"+t.toString(16).toUpperCase()).slice(-4),'"')}function Uy(t,e){for(var r=t.source,n=r.body,i=n.length,a=e.end;a<i;){var o=n.charCodeAt(a),s=t.line,u=1+a-t.lineStart;switch(o){case 65279:case 9:case 32:case 44:++a;continue;case 10:++a,++t.line,t.lineStart=a;continue;case 13:n.charCodeAt(a+1)===10?a+=2:++a,++t.line,t.lineStart=a;continue;case 33:return new $e(I.BANG,a,a+1,s,u,e);case 35:return By(r,a,s,u,e);case 36:return new $e(I.DOLLAR,a,a+1,s,u,e);case 38:return new $e(I.AMP,a,a+1,s,u,e);case 40:return new $e(I.PAREN_L,a,a+1,s,u,e);case 41:return new $e(I.PAREN_R,a,a+1,s,u,e);case 46:if(n.charCodeAt(a+1)===46&&n.charCodeAt(a+2)===46)return new $e(I.SPREAD,a,a+3,s,u,e);break;case 58:return new $e(I.COLON,a,a+1,s,u,e);case 61:return new $e(I.EQUALS,a,a+1,s,u,e);case 64:return new $e(I.AT,a,a+1,s,u,e);case 91:return new $e(I.BRACKET_L,a,a+1,s,u,e);case 93:return new $e(I.BRACKET_R,a,a+1,s,u,e);case 123:return new $e(I.BRACE_L,a,a+1,s,u,e);case 124:return new $e(I.PIPE,a,a+1,s,u,e);case 125:return new $e(I.BRACE_R,a,a+1,s,u,e);case 34:return n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34?Qy(r,a,s,u,e,t):Vy(r,a,s,u,e);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return qy(r,a,o,s,u,e);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return Hy(r,a,s,u,e)}throw kt(r,a,jy(o))}var c=t.line,l=1+a-t.lineStart;return new $e(I.EOF,i,i,c,l,e)}function jy(t){return t<32&&t!==9&&t!==10&&t!==13?"Cannot contain the invalid character ".concat(Mn(t),"."):t===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:"Cannot parse the unexpected character ".concat(Mn(t),".")}function By(t,e,r,n,i){var a=t.body,o,s=e;do o=a.charCodeAt(++s);while(!isNaN(o)&&(o>31||o===9));return new $e(I.COMMENT,e,s,r,n,i,a.slice(e+1,s))}function qy(t,e,r,n,i,a){var o=t.body,s=r,u=e,c=!1;if(s===45&&(s=o.charCodeAt(++u)),s===48){if(s=o.charCodeAt(++u),s>=48&&s<=57)throw kt(t,u,"Invalid number, unexpected digit after 0: ".concat(Mn(s),"."))}else u=Ju(t,u,s),s=o.charCodeAt(u);if(s===46&&(c=!0,s=o.charCodeAt(++u),u=Ju(t,u,s),s=o.charCodeAt(u)),(s===69||s===101)&&(c=!0,s=o.charCodeAt(++u),(s===43||s===45)&&(s=o.charCodeAt(++u)),u=Ju(t,u,s),s=o.charCodeAt(u)),s===46||Gy(s))throw kt(t,u,"Invalid number, expected digit but got: ".concat(Mn(s),"."));return new $e(c?I.FLOAT:I.INT,e,u,n,i,a,o.slice(e,u))}function Ju(t,e,r){var n=t.body,i=e,a=r;if(a>=48&&a<=57){do a=n.charCodeAt(++i);while(a>=48&&a<=57);return i}throw kt(t,i,"Invalid number, expected digit but got: ".concat(Mn(a),"."))}function Vy(t,e,r,n,i){for(var a=t.body,o=e+1,s=o,u=0,c="";o<a.length&&!isNaN(u=a.charCodeAt(o))&&u!==10&&u!==13;){if(u===34)return c+=a.slice(s,o),new $e(I.STRING,e,o+1,r,n,i,c);if(u<32&&u!==9)throw kt(t,o,"Invalid character within String: ".concat(Mn(u),"."));if(++o,u===92){switch(c+=a.slice(s,o-1),u=a.charCodeAt(o),u){case 34:c+='"';break;case 47:c+="/";break;case 92:c+="\\";break;case 98:c+="\b";break;case 102:c+="\f";break;case 110:c+=`
|
|
61
|
+
`;break;case 114:c+="\r";break;case 116:c+=" ";break;case 117:{var l=zy(a.charCodeAt(o+1),a.charCodeAt(o+2),a.charCodeAt(o+3),a.charCodeAt(o+4));if(l<0){var d=a.slice(o+1,o+5);throw kt(t,o,"Invalid character escape sequence: \\u".concat(d,"."))}c+=String.fromCharCode(l),o+=4;break}default:throw kt(t,o,"Invalid character escape sequence: \\".concat(String.fromCharCode(u),"."))}++o,s=o}}throw kt(t,o,"Unterminated string.")}function Qy(t,e,r,n,i,a){for(var o=t.body,s=e+3,u=s,c=0,l="";s<o.length&&!isNaN(c=o.charCodeAt(s));){if(c===34&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34)return l+=o.slice(u,s),new $e(I.BLOCK_STRING,e,s+3,r,n,i,$y(l));if(c<32&&c!==9&&c!==10&&c!==13)throw kt(t,s,"Invalid character within String: ".concat(Mn(c),"."));c===10?(++s,++a.line,a.lineStart=s):c===13?(o.charCodeAt(s+1)===10?s+=2:++s,++a.line,a.lineStart=s):c===92&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34&&o.charCodeAt(s+3)===34?(l+=o.slice(u,s)+'"""',s+=4,u=s):++s}throw kt(t,s,"Unterminated string.")}function zy(t,e,r,n){return ds(t)<<12|ds(e)<<8|ds(r)<<4|ds(n)}function ds(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function Hy(t,e,r,n,i){for(var a=t.body,o=a.length,s=e+1,u=0;s!==o&&!isNaN(u=a.charCodeAt(s))&&(u===95||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new $e(I.NAME,e,s,r,n,i,a.slice(e,s))}function Gy(t){return t===95||t>=65&&t<=90||t>=97&&t<=122}function Wy(t,e){var r=new Ky(t,e);return r.parseDocument()}var Ky=function(){function t(r,n){var i=Py(r)?r:new s1(r);this._lexer=new Fy(i),this._options=n}var e=t.prototype;return e.parseName=function(){var n=this.expectToken(I.NAME);return{kind:q.NAME,value:n.value,loc:this.loc(n)}},e.parseDocument=function(){var n=this._lexer.token;return{kind:q.DOCUMENT,definitions:this.many(I.SOF,this.parseDefinition,I.EOF),loc:this.loc(n)}},e.parseDefinition=function(){if(this.peek(I.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(I.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},e.parseOperationDefinition=function(){var n=this._lexer.token;if(this.peek(I.BRACE_L))return{kind:q.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(n)};var i=this.parseOperationType(),a;return this.peek(I.NAME)&&(a=this.parseName()),{kind:q.OPERATION_DEFINITION,operation:i,name:a,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},e.parseOperationType=function(){var n=this.expectToken(I.NAME);switch(n.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(n)},e.parseVariableDefinitions=function(){return this.optionalMany(I.PAREN_L,this.parseVariableDefinition,I.PAREN_R)},e.parseVariableDefinition=function(){var n=this._lexer.token;return{kind:q.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(I.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(I.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(n)}},e.parseVariable=function(){var n=this._lexer.token;return this.expectToken(I.DOLLAR),{kind:q.VARIABLE,name:this.parseName(),loc:this.loc(n)}},e.parseSelectionSet=function(){var n=this._lexer.token;return{kind:q.SELECTION_SET,selections:this.many(I.BRACE_L,this.parseSelection,I.BRACE_R),loc:this.loc(n)}},e.parseSelection=function(){return this.peek(I.SPREAD)?this.parseFragment():this.parseField()},e.parseField=function(){var n=this._lexer.token,i=this.parseName(),a,o;return this.expectOptionalToken(I.COLON)?(a=i,o=this.parseName()):o=i,{kind:q.FIELD,alias:a,name:o,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(I.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},e.parseArguments=function(n){var i=n?this.parseConstArgument:this.parseArgument;return this.optionalMany(I.PAREN_L,i,I.PAREN_R)},e.parseArgument=function(){var n=this._lexer.token,i=this.parseName();return this.expectToken(I.COLON),{kind:q.ARGUMENT,name:i,value:this.parseValueLiteral(!1),loc:this.loc(n)}},e.parseConstArgument=function(){var n=this._lexer.token;return{kind:q.ARGUMENT,name:this.parseName(),value:(this.expectToken(I.COLON),this.parseValueLiteral(!0)),loc:this.loc(n)}},e.parseFragment=function(){var n=this._lexer.token;this.expectToken(I.SPREAD);var i=this.expectOptionalKeyword("on");return!i&&this.peek(I.NAME)?{kind:q.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(n)}:{kind:q.INLINE_FRAGMENT,typeCondition:i?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},e.parseFragmentDefinition=function(){var n,i=this._lexer.token;return this.expectKeyword("fragment"),((n=this._options)===null||n===void 0?void 0:n.experimentalFragmentVariables)===!0?{kind:q.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}:{kind:q.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}},e.parseFragmentName=function(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()},e.parseValueLiteral=function(n){var i=this._lexer.token;switch(i.kind){case I.BRACKET_L:return this.parseList(n);case I.BRACE_L:return this.parseObject(n);case I.INT:return this._lexer.advance(),{kind:q.INT,value:i.value,loc:this.loc(i)};case I.FLOAT:return this._lexer.advance(),{kind:q.FLOAT,value:i.value,loc:this.loc(i)};case I.STRING:case I.BLOCK_STRING:return this.parseStringLiteral();case I.NAME:switch(this._lexer.advance(),i.value){case"true":return{kind:q.BOOLEAN,value:!0,loc:this.loc(i)};case"false":return{kind:q.BOOLEAN,value:!1,loc:this.loc(i)};case"null":return{kind:q.NULL,loc:this.loc(i)};default:return{kind:q.ENUM,value:i.value,loc:this.loc(i)}}case I.DOLLAR:if(!n)return this.parseVariable();break}throw this.unexpected()},e.parseStringLiteral=function(){var n=this._lexer.token;return this._lexer.advance(),{kind:q.STRING,value:n.value,block:n.kind===I.BLOCK_STRING,loc:this.loc(n)}},e.parseList=function(n){var i=this,a=this._lexer.token,o=function(){return i.parseValueLiteral(n)};return{kind:q.LIST,values:this.any(I.BRACKET_L,o,I.BRACKET_R),loc:this.loc(a)}},e.parseObject=function(n){var i=this,a=this._lexer.token,o=function(){return i.parseObjectField(n)};return{kind:q.OBJECT,fields:this.any(I.BRACE_L,o,I.BRACE_R),loc:this.loc(a)}},e.parseObjectField=function(n){var i=this._lexer.token,a=this.parseName();return this.expectToken(I.COLON),{kind:q.OBJECT_FIELD,name:a,value:this.parseValueLiteral(n),loc:this.loc(i)}},e.parseDirectives=function(n){for(var i=[];this.peek(I.AT);)i.push(this.parseDirective(n));return i},e.parseDirective=function(n){var i=this._lexer.token;return this.expectToken(I.AT),{kind:q.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(n),loc:this.loc(i)}},e.parseTypeReference=function(){var n=this._lexer.token,i;return this.expectOptionalToken(I.BRACKET_L)?(i=this.parseTypeReference(),this.expectToken(I.BRACKET_R),i={kind:q.LIST_TYPE,type:i,loc:this.loc(n)}):i=this.parseNamedType(),this.expectOptionalToken(I.BANG)?{kind:q.NON_NULL_TYPE,type:i,loc:this.loc(n)}:i},e.parseNamedType=function(){var n=this._lexer.token;return{kind:q.NAMED_TYPE,name:this.parseName(),loc:this.loc(n)}},e.parseTypeSystemDefinition=function(){var n=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(n.kind===I.NAME)switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(n)},e.peekDescription=function(){return this.peek(I.STRING)||this.peek(I.BLOCK_STRING)},e.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},e.parseSchemaDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("schema");var a=this.parseDirectives(!0),o=this.many(I.BRACE_L,this.parseOperationTypeDefinition,I.BRACE_R);return{kind:q.SCHEMA_DEFINITION,description:i,directives:a,operationTypes:o,loc:this.loc(n)}},e.parseOperationTypeDefinition=function(){var n=this._lexer.token,i=this.parseOperationType();this.expectToken(I.COLON);var a=this.parseNamedType();return{kind:q.OPERATION_TYPE_DEFINITION,operation:i,type:a,loc:this.loc(n)}},e.parseScalarTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("scalar");var a=this.parseName(),o=this.parseDirectives(!0);return{kind:q.SCALAR_TYPE_DEFINITION,description:i,name:a,directives:o,loc:this.loc(n)}},e.parseObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("type");var a=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:q.OBJECT_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:u,loc:this.loc(n)}},e.parseImplementsInterfaces=function(){var n;if(!this.expectOptionalKeyword("implements"))return[];if(((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLImplementsInterfaces)===!0){var i=[];this.expectOptionalToken(I.AMP);do i.push(this.parseNamedType());while(this.expectOptionalToken(I.AMP)||this.peek(I.NAME));return i}return this.delimitedMany(I.AMP,this.parseNamedType)},e.parseFieldsDefinition=function(){var n;return((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLEmptyFields)===!0&&this.peek(I.BRACE_L)&&this._lexer.lookahead().kind===I.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(I.BRACE_L,this.parseFieldDefinition,I.BRACE_R)},e.parseFieldDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseArgumentDefs();this.expectToken(I.COLON);var s=this.parseTypeReference(),u=this.parseDirectives(!0);return{kind:q.FIELD_DEFINITION,description:i,name:a,arguments:o,type:s,directives:u,loc:this.loc(n)}},e.parseArgumentDefs=function(){return this.optionalMany(I.PAREN_L,this.parseInputValueDef,I.PAREN_R)},e.parseInputValueDef=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName();this.expectToken(I.COLON);var o=this.parseTypeReference(),s;this.expectOptionalToken(I.EQUALS)&&(s=this.parseValueLiteral(!0));var u=this.parseDirectives(!0);return{kind:q.INPUT_VALUE_DEFINITION,description:i,name:a,type:o,defaultValue:s,directives:u,loc:this.loc(n)}},e.parseInterfaceTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("interface");var a=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:q.INTERFACE_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:u,loc:this.loc(n)}},e.parseUnionTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("union");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseUnionMemberTypes();return{kind:q.UNION_TYPE_DEFINITION,description:i,name:a,directives:o,types:s,loc:this.loc(n)}},e.parseUnionMemberTypes=function(){return this.expectOptionalToken(I.EQUALS)?this.delimitedMany(I.PIPE,this.parseNamedType):[]},e.parseEnumTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("enum");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseEnumValuesDefinition();return{kind:q.ENUM_TYPE_DEFINITION,description:i,name:a,directives:o,values:s,loc:this.loc(n)}},e.parseEnumValuesDefinition=function(){return this.optionalMany(I.BRACE_L,this.parseEnumValueDefinition,I.BRACE_R)},e.parseEnumValueDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseDirectives(!0);return{kind:q.ENUM_VALUE_DEFINITION,description:i,name:a,directives:o,loc:this.loc(n)}},e.parseInputObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("input");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseInputFieldsDefinition();return{kind:q.INPUT_OBJECT_TYPE_DEFINITION,description:i,name:a,directives:o,fields:s,loc:this.loc(n)}},e.parseInputFieldsDefinition=function(){return this.optionalMany(I.BRACE_L,this.parseInputValueDef,I.BRACE_R)},e.parseTypeSystemExtension=function(){var n=this._lexer.lookahead();if(n.kind===I.NAME)switch(n.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(n)},e.parseSchemaExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var i=this.parseDirectives(!0),a=this.optionalMany(I.BRACE_L,this.parseOperationTypeDefinition,I.BRACE_R);if(i.length===0&&a.length===0)throw this.unexpected();return{kind:q.SCHEMA_EXTENSION,directives:i,operationTypes:a,loc:this.loc(n)}},e.parseScalarTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var i=this.parseName(),a=this.parseDirectives(!0);if(a.length===0)throw this.unexpected();return{kind:q.SCALAR_TYPE_EXTENSION,name:i,directives:a,loc:this.loc(n)}},e.parseObjectTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var i=this.parseName(),a=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),s=this.parseFieldsDefinition();if(a.length===0&&o.length===0&&s.length===0)throw this.unexpected();return{kind:q.OBJECT_TYPE_EXTENSION,name:i,interfaces:a,directives:o,fields:s,loc:this.loc(n)}},e.parseInterfaceTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var i=this.parseName(),a=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),s=this.parseFieldsDefinition();if(a.length===0&&o.length===0&&s.length===0)throw this.unexpected();return{kind:q.INTERFACE_TYPE_EXTENSION,name:i,interfaces:a,directives:o,fields:s,loc:this.loc(n)}},e.parseUnionTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseUnionMemberTypes();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:q.UNION_TYPE_EXTENSION,name:i,directives:a,types:o,loc:this.loc(n)}},e.parseEnumTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseEnumValuesDefinition();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:q.ENUM_TYPE_EXTENSION,name:i,directives:a,values:o,loc:this.loc(n)}},e.parseInputObjectTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseInputFieldsDefinition();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:q.INPUT_OBJECT_TYPE_EXTENSION,name:i,directives:a,fields:o,loc:this.loc(n)}},e.parseDirectiveDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("directive"),this.expectToken(I.AT);var a=this.parseName(),o=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var u=this.parseDirectiveLocations();return{kind:q.DIRECTIVE_DEFINITION,description:i,name:a,arguments:o,repeatable:s,locations:u,loc:this.loc(n)}},e.parseDirectiveLocations=function(){return this.delimitedMany(I.PIPE,this.parseDirectiveLocation)},e.parseDirectiveLocation=function(){var n=this._lexer.token,i=this.parseName();if(Ry[i.value]!==void 0)return i;throw this.unexpected(n)},e.loc=function(n){var i;if(((i=this._options)===null||i===void 0?void 0:i.noLocation)!==!0)return new a1(n,this._lexer.lastToken,this._lexer.source)},e.peek=function(n){return this._lexer.token.kind===n},e.expectToken=function(n){var i=this._lexer.token;if(i.kind===n)return this._lexer.advance(),i;throw kt(this._lexer.source,i.start,"Expected ".concat(c1(n),", found ").concat(Yu(i),"."))},e.expectOptionalToken=function(n){var i=this._lexer.token;if(i.kind===n)return this._lexer.advance(),i},e.expectKeyword=function(n){var i=this._lexer.token;if(i.kind===I.NAME&&i.value===n)this._lexer.advance();else throw kt(this._lexer.source,i.start,'Expected "'.concat(n,'", found ').concat(Yu(i),"."))},e.expectOptionalKeyword=function(n){var i=this._lexer.token;return i.kind===I.NAME&&i.value===n?(this._lexer.advance(),!0):!1},e.unexpected=function(n){var i=n??this._lexer.token;return kt(this._lexer.source,i.start,"Unexpected ".concat(Yu(i),"."))},e.any=function(n,i,a){this.expectToken(n);for(var o=[];!this.expectOptionalToken(a);)o.push(i.call(this));return o},e.optionalMany=function(n,i,a){if(this.expectOptionalToken(n)){var o=[];do o.push(i.call(this));while(!this.expectOptionalToken(a));return o}return[]},e.many=function(n,i,a){this.expectToken(n);var o=[];do o.push(i.call(this));while(!this.expectOptionalToken(a));return o},e.delimitedMany=function(n,i){this.expectOptionalToken(n);var a=[];do a.push(i.call(this));while(this.expectOptionalToken(n));return a},t}();function Yu(t){var e=t.value;return c1(t.kind)+(e!=null?' "'.concat(e,'"'):"")}function c1(t){return My(t)?'"'.concat(t,'"'):t}var Ds=new Map,bl=new Map,u1=!0,Vs=!1;function l1(t){return t.replace(/[\s,]+/g," ").trim()}function Zy(t){return l1(t.source.body.substring(t.start,t.end))}function Jy(t){var e=new Set,r=[];return t.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,a=Zy(n.loc),o=bl.get(i);o&&!o.has(a)?u1&&console.warn("Warning: fragment with name "+i+` already exists.
|
|
62
62
|
graphql-tag enforces all fragment names across your application to be unique; read more about
|
|
63
|
-
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||Ru.set(i,o=new Set),o.add(a),e.has(a)||(e.add(a),r.push(n))}else r.push(n)}),is(is({},t),{definitions:r})}function ry(t){var e=new Set(t.definitions);e.forEach(function(n){n.loc&&delete n.loc,Object.keys(n).forEach(function(i){var a=n[i];a&&typeof a=="object"&&e.add(a)})});var r=t.loc;return r&&(delete r.startToken,delete r.endToken),t}function ny(t){var e=gh(t);if(!Wo.has(e)){var r=Jg(t,{experimentalFragmentVariables:as,allowLegacyFragmentVariables:as});if(!r||r.kind!=="Document")throw new Error("Not a valid GraphQL document.");Wo.set(e,ry(ty(r)))}return Wo.get(e)}function E(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];typeof t=="string"&&(t=[t]);var n=t[0];return e.forEach(function(i,a){i&&i.kind==="Document"?n+=i.loc.source.body:n+=i,n+=t[a+1]}),ny(n)}function iy(){Wo.clear(),Ru.clear()}function ay(){mh=!1}function oy(){as=!0}function sy(){as=!1}var Zi={gql:E,resetCaches:iy,disableFragmentWarnings:ay,enableExperimentalFragmentVariables:oy,disableExperimentalFragmentVariables:sy};(function(t){t.gql=Zi.gql,t.resetCaches=Zi.resetCaches,t.disableFragmentWarnings=Zi.disableFragmentWarnings,t.enableExperimentalFragmentVariables=Zi.enableExperimentalFragmentVariables,t.disableExperimentalFragmentVariables=Zi.disableExperimentalFragmentVariables})(E||(E={}));E.default=E;function T(t){if(!t)throw"Got no result from Apollo";if(t.error)throw t.error;if(t.errors)throw t.errors;return t.data}function cy(){}function rl(){return cy}var w=rl,He=rl,Z=rl,yh=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},vh=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},_n=class{constructor(e){this.code=e}};yh([w(),vh("design:type",String)],_n.prototype,"code",void 0);_n=yh([Z(),vh("design:paramtypes",[String])],_n);var nl=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},il=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Ht=class{constructor(e,r){this.address=e,this.name=r}};nl([w(),il("design:type",String)],Ht.prototype,"address",void 0);nl([w(),il("design:type",String)],Ht.prototype,"name",void 0);Ht=nl([Z(),il("design:paramtypes",[String,String])],Ht);var we=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Le=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Pr=class{constructor(e,r){this.key=r,this.signature=e}};we([w(),Le("design:type",String)],Pr.prototype,"signature",void 0);we([w(),Le("design:type",String)],Pr.prototype,"key",void 0);we([w(),Le("design:type",Boolean)],Pr.prototype,"valid",void 0);we([w(),Le("design:type",Boolean)],Pr.prototype,"invalid",void 0);Pr=we([Z(),He(),Le("design:paramtypes",[String,String])],Pr);var wn=class{};we([w(),Le("design:type",String)],wn.prototype,"signature",void 0);we([w(),Le("design:type",String)],wn.prototype,"key",void 0);we([w(),Le("design:type",Boolean)],wn.prototype,"valid",void 0);we([w(),Le("design:type",Boolean)],wn.prototype,"invalid",void 0);wn=we([He()],wn);function qr(t){let e=class{constructor(n,i,a,o){this.author=n,this.timestamp=i,this.data=a,this.proof=o}};return we([w(),Le("design:type",String)],e.prototype,"author",void 0),we([w(),Le("design:type",String)],e.prototype,"timestamp",void 0),we([w(),Le("design:type",Object)],e.prototype,"data",void 0),we([w(),Le("design:type",Pr)],e.prototype,"proof",void 0),e=we([Z(),Le("design:paramtypes",[String,String,Object,Pr])],e),e}function uy(t){let e=class{};return we([w(),Le("design:type",String)],e.prototype,"author",void 0),we([w(),Le("design:type",String)],e.prototype,"timestamp",void 0),we([w(),Le("design:type",Object)],e.prototype,"data",void 0),we([w(),Le("design:type",wn)],e.prototype,"proof",void 0),e=we([He()],e),e}var nd=class extends qr(){};nd=we([Z()],nd);var os=class extends qr(){};we([w(),Le("design:type",Ht)],os.prototype,"language",void 0);we([w(),Le("design:type",_n)],os.prototype,"icon",void 0);os=we([Z()],os);function f9(t){return t&&t.author&&t.timestamp&&t.data}var De=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},We=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Sn=class{constructor(e){this.source=e.source?e.source:"",this.target=e.target?e.target:"",this.predicate=e.predicate?e.predicate:""}};De([w(),We("design:type",String)],Sn.prototype,"source",void 0);De([w(),We("design:type",String)],Sn.prototype,"target",void 0);De([w(),We("design:type",String)],Sn.prototype,"predicate",void 0);Sn=De([Z(),We("design:paramtypes",[Object])],Sn);var ss=class{};De([w(),We("design:type",Array)],ss.prototype,"additions",void 0);De([w(),We("design:type",Array)],ss.prototype,"removals",void 0);ss=De([He()],ss);var cs=class{constructor(e,r){this.additions=e,this.removals=r}};De([w(),We("design:type",Array)],cs.prototype,"additions",void 0);De([w(),We("design:type",Array)],cs.prototype,"removals",void 0);cs=De([Z(),We("design:paramtypes",[Array,Array])],cs);var wa=class{};De([w(),We("design:type",String)],wa.prototype,"source",void 0);De([w(),We("design:type",String)],wa.prototype,"target",void 0);De([w(),We("design:type",String)],wa.prototype,"predicate",void 0);wa=De([He()],wa);var En=class extends qr(){hash(){let e=JSON.stringify(this.data,Object.keys(this.data).sort())+JSON.stringify(this.author)+this.timestamp,r=0,n,i;for(n=0;n<e.length;n++)i=e.charCodeAt(n),r=(r<<5)-r+i,r|=0;return r}};De([w(),We("design:type",String)],En.prototype,"status",void 0);En=De([Z()],En);var Pu=class extends uy(){};De([w(),We("design:type",String)],Pu.prototype,"status",void 0);Pu=De([He()],Pu);function v9(t,e){return t.author==e.author&&t.timestamp==e.timestamp&&t.data.source==e.data.source&&t.data.predicate==e.data.predicate&&t.data.target==e.data.target}function b9(t){return t&&t.source&&t.target}var us=class{constructor(e,r){this.oldLink=e,this.newLink=r}};De([w(),We("design:type",En)],us.prototype,"oldLink",void 0);De([w(),We("design:type",En)],us.prototype,"newLink",void 0);us=De([Z(),We("design:paramtypes",[En,En])],us);var In=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Ra=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Lu,Lr=class{constructor(e){e?this.links=e:this.links=[]}get(e){if(!e||!e.source&&!e.predicate&&!e.target)return this.links;if(e.source){let n=JSON.parse(JSON.stringify(this.links));return e.target&&(n=n.filter(i=>i.data.target===e.target)),e.predicate&&(n=n.filter(i=>i.data.predicate===e.predicate)),e.fromDate&&(n=n.filter(i=>new Date(i.timestamp)>=e.fromDate)),e.untilDate&&(n=n.filter(i=>new Date(i.timestamp)<=e.untilDate)),e.limit&&(n=n.slice(0,e.limit)),n}if(e.target){let n=JSON.parse(JSON.stringify(this.links));return e.predicate&&(n=n.filter(i=>i.data.predicate===e.predicate)),e.fromDate&&(n=n.filter(i=>new Date(i.timestamp)>=e.fromDate)),e.untilDate&&(n=n.filter(i=>new Date(i.timestamp)<=e.untilDate)),e.limit&&(n=n.slice(0,e.limit)),n}let r=JSON.parse(JSON.stringify(this.links));return r=r.filter(n=>n.data.predicate===e.predicate),e.limit&&(r=r.slice(0,e.limit)),r}getSingleTarget(e){delete e.target;let r=this.get(e);return r.length?r[0].data.target:null}};In([w(),Ra("design:type",Array)],Lr.prototype,"links",void 0);Lr=In([Z(),Ra("design:paramtypes",[Array])],Lr);var $u=class{};In([w(),Ra("design:type",Array)],$u.prototype,"links",void 0);$u=In([He()],$u);var Fu=Lu=class{constructor(e){e?this.links=e:this.links=[]}static fromLink(e){let r=new Lu;return r.links.push(e),r}};In([w(),Ra("design:type",Array)],Fu.prototype,"links",void 0);Fu=Lu=In([He(),Ra("design:paramtypes",[Array])],Fu);var Mu=class extends qr(){};Mu=In([Z()],Mu);var F=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},M=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Ir=class{constructor(e,r){this.did=e,r?this.perspective=r:this.perspective=new Lr}};F([w(),M("design:type",String)],Ir.prototype,"did",void 0);F([w(),M("design:type",Lr)],Ir.prototype,"perspective",void 0);F([w(),M("design:type",String)],Ir.prototype,"directMessageLanguage",void 0);Ir=F([Z(),M("design:paramtypes",[String,Lr])],Ir);var id=class extends qr(){};id=F([Z()],id);var $r=class{constructor(e,r,n,i,a,o){this.did=e,this.didSigningKeyId=r,this.deviceKeyType=n,this.deviceKey=i,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};F([w(),M("design:type",String)],$r.prototype,"did",void 0);F([w(),M("design:type",String)],$r.prototype,"didSigningKeyId",void 0);F([w(),M("design:type",String)],$r.prototype,"deviceKeyType",void 0);F([w(),M("design:type",String)],$r.prototype,"deviceKey",void 0);F([w(),M("design:type",String)],$r.prototype,"deviceKeySignedByDid",void 0);F([w(),M("design:type",String)],$r.prototype,"didSignedByDeviceKey",void 0);$r=F([Z(),M("design:paramtypes",[String,String,String,String,String,String])],$r);var Fr=class{constructor(e,r,n,i,a,o){this.did=e,this.didSigningKeyId=r,this.deviceKeyType=n,this.deviceKey=i,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};F([w(),M("design:type",String)],Fr.prototype,"did",void 0);F([w(),M("design:type",String)],Fr.prototype,"didSigningKeyId",void 0);F([w(),M("design:type",String)],Fr.prototype,"deviceKeyType",void 0);F([w(),M("design:type",String)],Fr.prototype,"deviceKey",void 0);F([w(),M("design:type",String)],Fr.prototype,"deviceKeySignedByDid",void 0);F([w(),M("design:type",String)],Fr.prototype,"didSignedByDeviceKey",void 0);Fr=F([He(),M("design:paramtypes",[String,String,String,String,String,String])],Fr);var ls=class{constructor(e,r){this.signature=e,this.publicKey=r}};F([w(),M("design:type",String)],ls.prototype,"signature",void 0);F([w(),M("design:type",String)],ls.prototype,"publicKey",void 0);ls=F([Z(),M("design:paramtypes",[String,String])],ls);var fi=class{constructor(e,r){this.domain=e,this.pointers=r}};F([w(),M("design:type",String)],fi.prototype,"domain",void 0);F([w(),M("design:type",Array)],fi.prototype,"pointers",void 0);fi=F([Z(),M("design:paramtypes",[String,Array])],fi);var fs=class{constructor(e,r){this.with=e,this.can=r}};F([w(),M("design:type",fi)],fs.prototype,"with",void 0);F([w(),M("design:type",Array)],fs.prototype,"can",void 0);fs=F([Z(),M("design:paramtypes",[fi,Array])],fs);var lr=class{constructor(e,r,n,i,a){this.appName=e,this.appDesc=r,this.appIconPath=a,this.appUrl=n,this.capabilities=i}};F([w(),M("design:type",String)],lr.prototype,"appName",void 0);F([w(),M("design:type",String)],lr.prototype,"appDesc",void 0);F([w(),M("design:type",String)],lr.prototype,"appUrl",void 0);F([w(),M("design:type",String)],lr.prototype,"appIconPath",void 0);F([w(),M("design:type",Array)],lr.prototype,"capabilities",void 0);lr=F([Z(),M("design:paramtypes",[String,String,String,Array,String])],lr);var pi=class{constructor(e,r,n,i){this.requestId=e,this.auth=r,this.token=n,this.revoked=i}};F([w(),M("design:type",String)],pi.prototype,"requestId",void 0);F([w(),M("design:type",String)],pi.prototype,"token",void 0);F([w(),M("design:type",Boolean)],pi.prototype,"revoked",void 0);F([w(),M("design:type",lr)],pi.prototype,"auth",void 0);pi=F([Z(),M("design:paramtypes",[String,lr,String,Boolean])],pi);var di=class{constructor(e,r){this.domain=e,this.pointers=r}};F([w(),M("design:type",String)],di.prototype,"domain",void 0);F([w(),M("design:type",Array)],di.prototype,"pointers",void 0);di=F([He(),M("design:paramtypes",[String,Array])],di);var ps=class{constructor(e,r){this.with=e,this.can=r}};F([w(),M("design:type",di)],ps.prototype,"with",void 0);F([w(),M("design:type",Array)],ps.prototype,"can",void 0);ps=F([He(),M("design:paramtypes",[di,Array])],ps);var Mr=class{constructor(e,r,n,i,a,o){this.appName=e,this.appDesc=r,this.appUrl=i,this.appDomain=n,this.capabilities=o,this.appIconPath=a}};F([w(),M("design:type",String)],Mr.prototype,"appName",void 0);F([w(),M("design:type",String)],Mr.prototype,"appDesc",void 0);F([w(),M("design:type",String)],Mr.prototype,"appDomain",void 0);F([w(),M("design:type",String)],Mr.prototype,"appUrl",void 0);F([w(),M("design:type",String)],Mr.prototype,"appIconPath",void 0);F([w(),M("design:type",Array)],Mr.prototype,"capabilities",void 0);Mr=F([He(),M("design:paramtypes",[String,String,String,String,String,Array])],Mr);var yi=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},vi=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},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)}};yi([w(),vi("design:type",Boolean)],Ct.prototype,"isInitialized",void 0);yi([w(),vi("design:type",Boolean)],Ct.prototype,"isUnlocked",void 0);yi([w(),vi("design:type",String)],Ct.prototype,"did",void 0);yi([w(),vi("design:type",String)],Ct.prototype,"didDocument",void 0);yi([w(),vi("design:type",String)],Ct.prototype,"error",void 0);Ct=yi([Z(),vi("design:paramtypes",[Object])],Ct);var ad=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ae=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},st,ct,ju=class{constructor(e,r){st.set(this,void 0),ct.set(this,void 0),ad(this,st,e,"f"),ad(this,ct,r,"f")}async otherAgents(){return await Ae(this,st,"f").otherAgents(Ae(this,ct,"f"))}async hasTelepresenceAdapter(){return await Ae(this,st,"f").hasTelepresenceAdapter(Ae(this,ct,"f"))}async onlineAgents(){return await Ae(this,st,"f").onlineAgents(Ae(this,ct,"f"))}async setOnlineStatus(e){return await Ae(this,st,"f").setOnlineStatus(Ae(this,ct,"f"),e)}async setOnlineStatusU(e){return await Ae(this,st,"f").setOnlineStatusU(Ae(this,ct,"f"),e)}async sendSignal(e,r){return await Ae(this,st,"f").sendSignal(Ae(this,ct,"f"),e,r)}async sendSignalU(e,r){return await Ae(this,st,"f").sendSignalU(Ae(this,ct,"f"),e,r)}async sendBroadcast(e){return await Ae(this,st,"f").sendBroadcast(Ae(this,ct,"f"),e)}async sendBroadcastU(e){return await Ae(this,st,"f").sendBroadcastU(Ae(this,ct,"f"),e)}async addSignalHandler(e){await Ae(this,st,"f").addSignalHandler(Ae(this,ct,"f"),e)}removeSignalHandler(e){Ae(this,st,"f").removeSignalHandler(Ae(this,ct,"f"),e)}};st=new WeakMap,ct=new WeakMap;var On=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Dn=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},vt=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)}};On([w(),Dn("design:type",String)],vt.prototype,"source",void 0);On([w(),Dn("design:type",String)],vt.prototype,"target",void 0);On([w(),Dn("design:type",String)],vt.prototype,"predicate",void 0);On([w(),Dn("design:type",Date)],vt.prototype,"fromDate",void 0);On([w(),Dn("design:type",Date)],vt.prototype,"untilDate",void 0);On([w(),Dn("design:type",Number)],vt.prototype,"limit",void 0);vt=On([Z(),He(),Dn("design:paramtypes",[Object])],vt);var od=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ot=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Nt,ar;function du(t){return encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}var Lt=class{constructor(){Nt.set(this,void 0),ar.set(this,void 0)}static fromUrl(e){if(!e||!e.startsWith("literal://"))throw new Error("Can't create Literal from non-literal URL");let r=new Lt;return od(r,ar,e,"f"),r}static from(e){let r=new Lt;return od(r,Nt,e,"f"),r}toUrl(){if(ot(this,ar,"f")&&!ot(this,Nt,"f"))return ot(this,ar,"f");if(!ot(this,ar,"f")&&!ot(this,Nt,"f"))throw new Error("Can't turn empty Literal into URL");let e;switch(typeof ot(this,Nt,"f")){case"string":e=`string:${du(ot(this,Nt,"f"))}`;break;case"number":e=`number:${du(ot(this,Nt,"f"))}`;break;case"object":e=`json:${du(JSON.stringify(ot(this,Nt,"f")))}`;break}return`literal://${e}`}get(){if(ot(this,Nt,"f"))return ot(this,Nt,"f");if(!ot(this,ar,"f"))throw new Error("Can't render empty Literal");if(!ot(this,ar,"f").startsWith("literal://"))throw new Error("Can't render Literal from non-literal URL");let e=ot(this,ar,"f").substring(10);if(e.startsWith("string:"))return decodeURIComponent(e.substring(7));if(e.startsWith("number:")){let r=e.substring(7);return parseFloat(r)}if(e.startsWith("json:")){let r=e.substring(5);return JSON.parse(decodeURIComponent(r))}throw new Error(`Can't parse unknown literal: ${e}`)}};Nt=new WeakMap,ar=new WeakMap;function Or(t){return t.charAt(0).toUpperCase()+t.slice(1)}function bh(t){return`set${Or(t)}`}function ur(t){return t.endsWith("y")?t.slice(0,-1)+"ies":t+"s"}function al(t){return t.endsWith("ies")?t.slice(0,-3)+"y":t.endsWith("s")?t.slice(0,-1):t}function ly(t){return`add${Or(al(t))}`}function fy(t){let e=t.substring(3),r=ur(e);return r.charAt(0).toLowerCase()+r.slice(1)}function py(t){return`remove${Or(al(t))}`}function dy(t){let e=t.substring(6),r=ur(e);return r.charAt(0).toLowerCase()+r.slice(1)}function hy(t){let e=t.substring(13),r=ur(e);return r.charAt(0).toLowerCase()+r.slice(1)}function my(t){return`setCollection${Or(al(t))}`}function un(t){if(Array.isArray(t))return`[${t.map(un).join(", ")}]`;let e=Object.keys(t),r=[];for(let n of e){let i=JSON.stringify(t[n]),a=`${n}: ${i}`;r.push(a)}return`{${r.join(", ")}}`}var hu=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},z=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Je,Xe,Ee,ds=class{constructor(t,e,r){Je.set(this,void 0),Xe.set(this,void 0),Ee.set(this,void 0),hu(this,Je,e,"f"),hu(this,Xe,r,"f"),hu(this,Ee,t,"f")}get baseExpression(){return z(this,Je,"f")}async init(){let isInstance=await z(this,Ee,"f").isSubjectInstance(z(this,Je,"f"),z(this,Xe,"f"));if(!isInstance)throw`Not a valid subject instance of ${z(this,Xe,"f")} for ${z(this,Je,"f")}`;let results=await z(this,Ee,"f").infer(`subject_class("${z(this,Xe,"f")}", C), property(C, Property)`),properties=results.map(t=>t.Property);for(let t of properties){let e=await z(this,Ee,"f").infer(`subject_class("${z(this,Xe,"f")}", C), property_resolve(C, "${t}")`);Object.defineProperty(this,t,{configurable:!0,get:async()=>{let r=await z(this,Ee,"f").infer(`subject_class("${z(this,Xe,"f")}", C), property_getter(C, "${z(this,Je,"f")}", "${t}", Value)`);if(r&&r.length>0){let n=r[0].Value;if(e)try{if(n){let i=await z(this,Ee,"f").getExpression(n);try{return JSON.parse(i.data)}catch{return i.data}}else return n}catch{return n}else return n}else return r||void 0}})}let setters=await z(this,Ee,"f").infer(`subject_class("${z(this,Xe,"f")}", C), property_setter(C, Property, Setter)`);for(let setter of setters||[])if(setter){let property=setter.Property,actions=eval(setter.Setter),resolveLanguageResults=await z(this,Ee,"f").infer(`subject_class("${z(this,Xe,"f")}", C), property_resolve_language(C, "${property}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),this[bh(property)]=async t=>{resolveLanguage&&(t=await z(this,Ee,"f").createExpression(t,resolveLanguage)),await z(this,Ee,"f").executeAction(actions,z(this,Je,"f"),[{name:"value",value:t}])}}let results2=await z(this,Ee,"f").infer(`subject_class("${z(this,Xe,"f")}", C), collection(C, Collection)`);results2||(results2=[]);let collections=results2.map(t=>t.Collection);for(let t of collections)Object.defineProperty(this,t,{configurable:!0,get:async()=>{let e=await z(this,Ee,"f").infer(`subject_class("${z(this,Xe,"f")}", C), collection_getter(C, "${z(this,Je,"f")}", "${t}", Value)`);return e&&e.length>0&&e[0].Value?e[0].Value.filter(n=>n!==""&&n!==""):[]}});let adders=await z(this,Ee,"f").infer(`subject_class("${z(this,Xe,"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[ly(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>z(this,Ee,"f").executeAction(actions,z(this,Je,"f"),[{name:"value",value:e}]))):await z(this,Ee,"f").executeAction(actions,z(this,Je,"f"),[{name:"value",value:t}])}}let removers=await z(this,Ee,"f").infer(`subject_class("${z(this,Xe,"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[py(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>z(this,Ee,"f").executeAction(actions,z(this,Je,"f"),[{name:"value",value:e}]))):await z(this,Ee,"f").executeAction(actions,z(this,Je,"f"),[{name:"value",value:t}])}}let collectionSetters=await z(this,Ee,"f").infer(`subject_class("${z(this,Xe,"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[my(collection)]=async t=>{Array.isArray(t)?await z(this,Ee,"f").executeAction(actions,z(this,Je,"f"),t.map(e=>({name:"value",value:e}))):await z(this,Ee,"f").executeAction(actions,z(this,Je,"f"),[{name:"value",value:t}])}}}};Je=new WeakMap,Xe=new WeakMap,Ee=new WeakMap;var ti=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},$=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},le,ve,ln,fn,pn,ea,ui=class{constructor(t,e){le.set(this,void 0),ve.set(this,void 0),ln.set(this,void 0),fn.set(this,void 0),pn.set(this,void 0),ea.set(this,void 0),ti(this,ln,[],"f"),ti(this,fn,[],"f"),ti(this,pn,[],"f"),ti(this,ea,[],"f"),ti(this,le,t,"f"),ti(this,ve,e,"f"),this.uuid=$(this,le,"f").uuid,this.name=$(this,le,"f").name,this.sharedUrl=$(this,le,"f").sharedUrl,this.neighbourhood=$(this,le,"f").neighbourhood,this.state=$(this,le,"f").state,$(this,ve,"f").addPerspectiveLinkAddedListener($(this,le,"f").uuid,$(this,ln,"f")),$(this,ve,"f").addPerspectiveLinkRemovedListener($(this,le,"f").uuid,$(this,fn,"f")),$(this,ve,"f").addPerspectiveLinkUpdatedListener($(this,le,"f").uuid,$(this,pn,"f")),$(this,ve,"f").addPerspectiveSyncStateChangeListener($(this,le,"f").uuid,$(this,ea,"f"))}async executeAction(t,e,r){return await $(this,ve,"f").executeCommands($(this,le,"f").uuid,JSON.stringify(t),e,JSON.stringify(r))}async get(t){return await $(this,ve,"f").queryLinks($(this,le,"f").uuid,t)}async infer(t){return await $(this,ve,"f").queryProlog($(this,le,"f").uuid,t)}async add(t,e="shared"){return await $(this,ve,"f").addLink($(this,le,"f").uuid,t,e)}async addLinks(t,e="shared"){return await $(this,ve,"f").addLinks($(this,le,"f").uuid,t,e)}async removeLinks(t){return await $(this,ve,"f").removeLinks($(this,le,"f").uuid,t)}async linkMutations(t,e="shared"){return await $(this,ve,"f").linkMutations($(this,le,"f").uuid,t,e)}async addLinkExpression(t,e="shared"){return await $(this,ve,"f").addLinkExpression($(this,le,"f").uuid,t,e)}async update(t,e){return await $(this,ve,"f").updateLink($(this,le,"f").uuid,t,e)}async remove(t){return await $(this,ve,"f").removeLink($(this,le,"f").uuid,t)}async getExpression(t){return await $(this,ve,"f").getExpression(t)}async createExpression(t,e){return await $(this,ve,"f").createExpression(t,e)}async addListener(t,e){t==="link-added"?$(this,ln,"f").push(e):t==="link-removed"?$(this,fn,"f").push(e):t==="link-updated"&&$(this,pn,"f").push(e)}async addSyncStateChangeListener(t){$(this,ea,"f").push(t)}async removeListener(t,e){if(t==="link-added"){let r=$(this,ln,"f").indexOf(e);$(this,ln,"f").splice(r,1)}else if(t==="link-removed"){let r=$(this,fn,"f").indexOf(e);$(this,fn,"f").splice(r,1)}else if(t==="link-updated"){let r=$(this,pn,"f").indexOf(e);$(this,pn,"f").splice(r,1)}}async snapshot(){return $(this,ve,"f").snapshotByUUID($(this,le,"f").uuid)}async loadSnapshot(t){let e=JSON.parse(JSON.stringify(t));delete e.__typename,e.links.forEach(r=>{delete r.data.__typename});for(let r of e.links)await this.addLinkExpression(r)}async getSingleTarget(t){delete t.target;let e=await this.get(t);return e.length?e[0].data.target:null}async setSingleTarget(t,e="shared"){let r=new vt({source:t.source,predicate:t.predicate}),n=await this.get(r),i=[];for(let o of n)delete o.__typename,delete o.data.__typename,delete o.proof.__typename,i.push(o);let a=[t];await this.linkMutations({additions:a,removals:i},e)}async sdnaFlows(){return(await this.infer("register_sdna_flow(X, _)")).map(e=>e.X)}async availableFlows(t){return(await this.infer(`flowable("${t}", F), register_sdna_flow(X, F)`)).map(r=>r.X)}async startFlow(flowName,exprAddr){let startAction=await this.infer(`start_action(Action, F), register_sdna_flow("${flowName}", F)`);startAction=eval(startAction[0].Action),await this.executeAction(startAction,exprAddr,void 0)}async expressionsInFlowState(t,e){return(await this.infer(`register_sdna_flow("${t}", F), flow_state(X, ${e}, F)`)).map(n=>n.X)}async flowState(t,e){return(await this.infer(`register_sdna_flow("${t}", F), flow_state("${e}", X, F)`))[0].X}async flowActions(t,e){return(await this.infer(`register_sdna_flow("${t}", Flow), flow_state("${e}", State, Flow), action(State, Name, _, _)`)).map(n=>n.Name)}async runFlowAction(flowName,exprAddr,actionName){let action=await this.infer(`register_sdna_flow("${flowName}", Flow), flow_state("${exprAddr}", State, Flow), action(State, "${actionName}", _, Action)`);action=eval(action[0].Action),await this.executeAction(action,exprAddr,void 0)}async getSdna(){return(await this.get(new vt({predicate:"ad4m://sdna"}))).map(e=>e.data.target).map(e=>Lt.fromUrl(e).get())}async addSdna(t,e,r){return $(this,ve,"f").addSdna($(this,le,"f").uuid,t,e,r)}async subjectClasses(){try{return(await this.infer("subject_class(X, _)")).map(t=>t.X)}catch{return[]}}async stringOrTemplateObjectToSubjectClass(t){if(typeof t=="string")return t;{let e=await this.subjectClassesByTemplate(t);return e[0]?e[0]:t.className}}async createSubject(t,e){let r;if(typeof t=="string")r=t,await $(this,ve,"f").createSubject($(this,le,"f").uuid,JSON.stringify({className:r}),e);else{let n=this.buildQueryFromTemplate(t);await $(this,ve,"f").createSubject($(this,le,"f").uuid,JSON.stringify({query:n}),e)}return this.getSubjectProxy(e,t)}async getSubjectData(t,e){if(typeof t=="string")return JSON.parse(await $(this,ve,"f").getSubjectData($(this,le,"f").uuid,JSON.stringify({className:t}),e));let r=this.buildQueryFromTemplate(t);return JSON.parse(await $(this,ve,"f").getSubjectData($(this,le,"f").uuid,JSON.stringify({query:r}),e))}async removeSubject(subjectClass,exprAddr){let className=await this.stringOrTemplateObjectToSubjectClass(subjectClass),result=await this.infer(`subject_class("${className}", C), destructor(C, Actions)`);if(!result.length)throw"No constructor found for given subject class: "+className;let actions=result.map(x=>eval(x.Actions));await this.executeAction(actions[0],exprAddr,void 0)}async isSubjectInstance(t,e){let r=await this.stringOrTemplateObjectToSubjectClass(e),n=!1,i=5,a=0;for(;a<i&&!n;)n=await this.infer(`subject_class("${r}", C), instance(C, "${t}")`),a++;return n}async getSubjectProxy(t,e){if(!await this.isSubjectInstance(t,e))throw`Expression ${t} is not a subject instance of given class: ${JSON.stringify(e)}`;let r=await this.stringOrTemplateObjectToSubjectClass(e),n=new ds(this,t,r);return await n.init(),n}async getAllSubjectInstances(t){let e=[];typeof t=="string"?e=[t]:e=await this.subjectClassesByTemplate(t);let r=[];for(let n of e){let i=await this.infer(`subject_class("${n}", C), instance(C, X)`),a=await Promise.all(i.map(async o=>await this.getSubjectProxy(o.X,n)));r=r.concat(a)}return r}async getAllSubjectProxies(t){let e=[];typeof t=="string"?e=[t]:e=await this.subjectClassesByTemplate(t);let r=[];for(let n of e)r=await this.infer(`subject_class("${n}", C), instance(C, X)`);return r}buildQueryFromTemplate(t){let e;return function(r){let n=[],i=[];Object.getPrototypeOf(r).__properties?Object.keys(Object.getPrototypeOf(r).__properties).forEach(l=>n.push(l)):n.push(...Object.keys(r).filter(l=>!Array.isArray(r[l]))),Object.getPrototypeOf(r).__collections?Object.keys(Object.getPrototypeOf(r).__collections).filter(l=>l!=="isSubjectInstance").forEach(l=>!i.includes(l)):i.push(...Object.keys(r).filter(l=>Array.isArray(r[l])).filter(l=>l!=="isSubjectInstance"));let a=Object.getOwnPropertyNames(r).filter(l=>typeof r[l]=="function"&&l.startsWith("set")&&!l.startsWith("setCollection"));a=a.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("set")&&!l.startsWith("setCollection")}));let o=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("add"));o=o.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("add")}));let s=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("remove"));s=s.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("remove")}));let u=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("setCollection"));u=u.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("setCollection")}));let c="subject_class(Class, C)";for(let l of n)c+=`, property(C, "${l}")`;for(let l of i)c+=`, collection(C, "${l}")`;for(let l of a){let d=l.substring(3);d=d.charAt(0).toLowerCase()+d.slice(1),c+=`, property_setter(C, "${d}", _)`}for(let l of o)c+=`, collection_adder(C, "${fy(l)}", _)`;for(let l of s)c+=`, collection_remover(C, "${dy(l)}", _)`;for(let l of u)c+=`, collection_setter(C, "${hy(l)}", _)`;c+=".",e=c}(t),e}async subjectClassesByTemplate(t){let e=this.buildQueryFromTemplate(t),r=await this.infer(e);return r?r.map(n=>n.Class):[]}async ensureSDNASubjectClass(t){if((await this.subjectClassesByTemplate(new t)).length>0)return;let{name:r,sdna:n}=t.generateSDNA();await this.addSdna(r,n,"subject_class")}getNeighbourhoodProxy(){return $(this,ve,"f").getNeighbourhoodProxy($(this,le,"f").uuid)}};le=new WeakMap,ve=new WeakMap,ln=new WeakMap,fn=new WeakMap,pn=new WeakMap,ea=new WeakMap;var on=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},W=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},se,ta,ra,na,Ko,ia,Zo,ht=`
|
|
63
|
+
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||bl.set(i,o=new Set),o.add(a),e.has(a)||(e.add(a),r.push(n))}else r.push(n)}),qs(qs({},t),{definitions:r})}function Yy(t){var e=new Set(t.definitions);e.forEach(function(n){n.loc&&delete n.loc,Object.keys(n).forEach(function(i){var a=n[i];a&&typeof a=="object"&&e.add(a)})});var r=t.loc;return r&&(delete r.startToken,delete r.endToken),t}function Xy(t){var e=l1(t);if(!Ds.has(e)){var r=Wy(t,{experimentalFragmentVariables:Vs,allowLegacyFragmentVariables:Vs});if(!r||r.kind!=="Document")throw new Error("Not a valid GraphQL document.");Ds.set(e,Yy(Jy(r)))}return Ds.get(e)}function E(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];typeof t=="string"&&(t=[t]);var n=t[0];return e.forEach(function(i,a){i&&i.kind==="Document"?n+=i.loc.source.body:n+=i,n+=t[a+1]}),Xy(n)}function e0(){Ds.clear(),bl.clear()}function t0(){u1=!1}function r0(){Vs=!0}function n0(){Vs=!1}var Sa={gql:E,resetCaches:e0,disableFragmentWarnings:t0,enableExperimentalFragmentVariables:r0,disableExperimentalFragmentVariables:n0};(function(t){t.gql=Sa.gql,t.resetCaches=Sa.resetCaches,t.disableFragmentWarnings=Sa.disableFragmentWarnings,t.enableExperimentalFragmentVariables=Sa.enableExperimentalFragmentVariables,t.disableExperimentalFragmentVariables=Sa.disableExperimentalFragmentVariables})(E||(E={}));E.default=E;function A(t){if(!t)throw"Got no result from Apollo";if(t.error)throw t.error;if(t.errors)throw t.errors;return t.data}function i0(){}function on(){return i0}var ve=on,m=on,Ze=on,Me=on,z=on,Dt=on,a0=on,Ql=on,p1=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},f1=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Un=class{constructor(e){this.code=e}};p1([m(),f1("design:type",String)],Un.prototype,"code",void 0);Un=p1([z(),f1("design:paramtypes",[String])],Un);var zl=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Hl=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},or=class{constructor(e,r){this.address=e,this.name=r}};zl([m(),Hl("design:type",String)],or.prototype,"address",void 0);zl([m(),Hl("design:type",String)],or.prototype,"name",void 0);or=zl([z(),Hl("design:paramtypes",[String,String])],or);var Ae=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Qe=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},xr=class{constructor(e,r){this.key=r,this.signature=e}};Ae([m(),Qe("design:type",String)],xr.prototype,"signature",void 0);Ae([m(),Qe("design:type",String)],xr.prototype,"key",void 0);Ae([m(),Qe("design:type",Boolean)],xr.prototype,"valid",void 0);Ae([m(),Qe("design:type",Boolean)],xr.prototype,"invalid",void 0);xr=Ae([z(),Ze(),Qe("design:paramtypes",[String,String])],xr);var jn=class{};Ae([m(),Qe("design:type",String)],jn.prototype,"signature",void 0);Ae([m(),Qe("design:type",String)],jn.prototype,"key",void 0);Ae([m(),Qe("design:type",Boolean)],jn.prototype,"valid",void 0);Ae([m(),Qe("design:type",Boolean)],jn.prototype,"invalid",void 0);jn=Ae([Ze()],jn);function sn(t){let e=class{constructor(n,i,a,o){this.author=n,this.timestamp=i,this.data=a,this.proof=o}};return Ae([m(),Qe("design:type",String)],e.prototype,"author",void 0),Ae([m(),Qe("design:type",String)],e.prototype,"timestamp",void 0),Ae([m(),Qe("design:type",Object)],e.prototype,"data",void 0),Ae([m(),Qe("design:type",xr)],e.prototype,"proof",void 0),e=Ae([z(),Qe("design:paramtypes",[String,String,Object,xr])],e),e}function o0(t){let e=class{};return Ae([m(),Qe("design:type",String)],e.prototype,"author",void 0),Ae([m(),Qe("design:type",String)],e.prototype,"timestamp",void 0),Ae([m(),Qe("design:type",Object)],e.prototype,"data",void 0),Ae([m(),Qe("design:type",jn)],e.prototype,"proof",void 0),e=Ae([Ze()],e),e}var zd=class extends sn(){};zd=Ae([z()],zd);var Qs=class extends sn(){};Ae([m(),Qe("design:type",or)],Qs.prototype,"language",void 0);Ae([m(),Qe("design:type",Un)],Qs.prototype,"icon",void 0);Qs=Ae([z()],Qs);function uw(t){return t&&t.author&&t.timestamp&&t.data}var Ue=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},nt=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Bn=class{constructor(e){this.source=e.source?e.source:"",this.target=e.target?e.target:"",this.predicate=e.predicate?e.predicate:""}};Ue([m(),nt("design:type",String)],Bn.prototype,"source",void 0);Ue([m(),nt("design:type",String)],Bn.prototype,"target",void 0);Ue([m(),nt("design:type",String)],Bn.prototype,"predicate",void 0);Bn=Ue([z(),nt("design:paramtypes",[Object])],Bn);var zs=class{};Ue([m(),nt("design:type",Array)],zs.prototype,"additions",void 0);Ue([m(),nt("design:type",Array)],zs.prototype,"removals",void 0);zs=Ue([Ze()],zs);var Hs=class{constructor(e,r){this.additions=e,this.removals=r}};Ue([m(),nt("design:type",Array)],Hs.prototype,"additions",void 0);Ue([m(),nt("design:type",Array)],Hs.prototype,"removals",void 0);Hs=Ue([z(),nt("design:paramtypes",[Array,Array])],Hs);var Xa=class{};Ue([m(),nt("design:type",String)],Xa.prototype,"source",void 0);Ue([m(),nt("design:type",String)],Xa.prototype,"target",void 0);Ue([m(),nt("design:type",String)],Xa.prototype,"predicate",void 0);Xa=Ue([Ze()],Xa);var Xr=class extends sn(){hash(){let e=JSON.stringify(this.data,Object.keys(this.data).sort())+JSON.stringify(this.author)+this.timestamp,r=0,n,i;for(n=0;n<e.length;n++)i=e.charCodeAt(n),r=(r<<5)-r+i,r|=0;return r}};Ue([m(),nt("design:type",String)],Xr.prototype,"status",void 0);Xr=Ue([z()],Xr);var _l=class extends o0(){};Ue([m(),nt("design:type",String)],_l.prototype,"status",void 0);_l=Ue([Ze()],_l);function gw(t,e){return t.author==e.author&&t.timestamp==e.timestamp&&t.data.source==e.data.source&&t.data.predicate==e.data.predicate&&t.data.target==e.data.target}function yw(t){return t&&t.source&&t.target}var Gs=class{constructor(e,r){this.oldLink=e,this.newLink=r}};Ue([m(),nt("design:type",Xr)],Gs.prototype,"oldLink",void 0);Ue([m(),nt("design:type",Xr)],Gs.prototype,"newLink",void 0);Gs=Ue([z(),nt("design:paramtypes",[Xr,Xr])],Gs);var Kn=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},mo=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},wl,ur=class{constructor(e){e?this.links=e:this.links=[]}get(e){if(!e||!e.source&&!e.predicate&&!e.target)return this.links;if(e.source){let n=JSON.parse(JSON.stringify(this.links));return e.target&&(n=n.filter(i=>i.data.target===e.target)),e.predicate&&(n=n.filter(i=>i.data.predicate===e.predicate)),e.fromDate&&(n=n.filter(i=>new Date(i.timestamp)>=e.fromDate)),e.untilDate&&(n=n.filter(i=>new Date(i.timestamp)<=e.untilDate)),e.limit&&(n=n.slice(0,e.limit)),n}if(e.target){let n=JSON.parse(JSON.stringify(this.links));return e.predicate&&(n=n.filter(i=>i.data.predicate===e.predicate)),e.fromDate&&(n=n.filter(i=>new Date(i.timestamp)>=e.fromDate)),e.untilDate&&(n=n.filter(i=>new Date(i.timestamp)<=e.untilDate)),e.limit&&(n=n.slice(0,e.limit)),n}let r=JSON.parse(JSON.stringify(this.links));return r=r.filter(n=>n.data.predicate===e.predicate),e.limit&&(r=r.slice(0,e.limit)),r}getSingleTarget(e){delete e.target;let r=this.get(e);return r.length?r[0].data.target:null}};Kn([m(),mo("design:type",Array)],ur.prototype,"links",void 0);ur=Kn([z(),mo("design:paramtypes",[Array])],ur);var Ws=class{};Kn([m(),mo("design:type",Array)],Ws.prototype,"links",void 0);Ws=Kn([Ze()],Ws);var Sl=wl=class{constructor(e){e?this.links=e:this.links=[]}static fromLink(e){let r=new wl;return r.links.push(e),r}};Kn([m(),mo("design:type",Array)],Sl.prototype,"links",void 0);Sl=wl=Kn([Ze(),mo("design:paramtypes",[Array])],Sl);var qn=class extends sn(){};qn=Kn([z()],qn);var j=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},B=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Wr=class{constructor(e,r){this.did=e,r?this.perspective=r:this.perspective=new ur}};j([m(),B("design:type",String)],Wr.prototype,"did",void 0);j([m(),B("design:type",ur)],Wr.prototype,"perspective",void 0);j([m(),B("design:type",String)],Wr.prototype,"directMessageLanguage",void 0);Wr=j([z(),B("design:paramtypes",[String,ur])],Wr);var Hd=class extends sn(){};Hd=j([z()],Hd);var en=class{constructor(e,r,n,i,a,o){this.did=e,this.didSigningKeyId=r,this.deviceKeyType=n,this.deviceKey=i,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};j([m(),B("design:type",String)],en.prototype,"did",void 0);j([m(),B("design:type",String)],en.prototype,"didSigningKeyId",void 0);j([m(),B("design:type",String)],en.prototype,"deviceKeyType",void 0);j([m(),B("design:type",String)],en.prototype,"deviceKey",void 0);j([m(),B("design:type",String)],en.prototype,"deviceKeySignedByDid",void 0);j([m(),B("design:type",String)],en.prototype,"didSignedByDeviceKey",void 0);en=j([z(),B("design:paramtypes",[String,String,String,String,String,String])],en);var tn=class{constructor(e,r,n,i,a,o){this.did=e,this.didSigningKeyId=r,this.deviceKeyType=n,this.deviceKey=i,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};j([m(),B("design:type",String)],tn.prototype,"did",void 0);j([m(),B("design:type",String)],tn.prototype,"didSigningKeyId",void 0);j([m(),B("design:type",String)],tn.prototype,"deviceKeyType",void 0);j([m(),B("design:type",String)],tn.prototype,"deviceKey",void 0);j([m(),B("design:type",String)],tn.prototype,"deviceKeySignedByDid",void 0);j([m(),B("design:type",String)],tn.prototype,"didSignedByDeviceKey",void 0);tn=j([Ze(),B("design:paramtypes",[String,String,String,String,String,String])],tn);var Ks=class{constructor(e,r){this.signature=e,this.publicKey=r}};j([m(),B("design:type",String)],Ks.prototype,"signature",void 0);j([m(),B("design:type",String)],Ks.prototype,"publicKey",void 0);Ks=j([z(),B("design:paramtypes",[String,String])],Ks);var Pi=class{constructor(e,r){this.domain=e,this.pointers=r}};j([m(),B("design:type",String)],Pi.prototype,"domain",void 0);j([m(),B("design:type",Array)],Pi.prototype,"pointers",void 0);Pi=j([z(),B("design:paramtypes",[String,Array])],Pi);var Zs=class{constructor(e,r){this.with=e,this.can=r}};j([m(),B("design:type",Pi)],Zs.prototype,"with",void 0);j([m(),B("design:type",Array)],Zs.prototype,"can",void 0);Zs=j([z(),B("design:paramtypes",[Pi,Array])],Zs);var Er=class{constructor(e,r,n,i,a){this.appName=e,this.appDesc=r,this.appIconPath=a,this.appUrl=n,this.capabilities=i}};j([m(),B("design:type",String)],Er.prototype,"appName",void 0);j([m(),B("design:type",String)],Er.prototype,"appDesc",void 0);j([m(),B("design:type",String)],Er.prototype,"appUrl",void 0);j([m(),B("design:type",String)],Er.prototype,"appIconPath",void 0);j([m(),B("design:type",Array)],Er.prototype,"capabilities",void 0);Er=j([z(),B("design:paramtypes",[String,String,String,Array,String])],Er);var Ri=class{constructor(e,r,n,i){this.requestId=e,this.auth=r,this.token=n,this.revoked=i}};j([m(),B("design:type",String)],Ri.prototype,"requestId",void 0);j([m(),B("design:type",String)],Ri.prototype,"token",void 0);j([m(),B("design:type",Boolean)],Ri.prototype,"revoked",void 0);j([m(),B("design:type",Er)],Ri.prototype,"auth",void 0);Ri=j([z(),B("design:paramtypes",[String,Er,String,Boolean])],Ri);var $i=class{constructor(e,r){this.domain=e,this.pointers=r}};j([m(),B("design:type",String)],$i.prototype,"domain",void 0);j([m(),B("design:type",Array)],$i.prototype,"pointers",void 0);$i=j([Ze(),B("design:paramtypes",[String,Array])],$i);var Js=class{constructor(e,r){this.with=e,this.can=r}};j([m(),B("design:type",$i)],Js.prototype,"with",void 0);j([m(),B("design:type",Array)],Js.prototype,"can",void 0);Js=j([Ze(),B("design:paramtypes",[$i,Array])],Js);var rn=class{constructor(e,r,n,i,a,o){this.appName=e,this.appDesc=r,this.appUrl=i,this.appDomain=n,this.capabilities=o,this.appIconPath=a}};j([m(),B("design:type",String)],rn.prototype,"appName",void 0);j([m(),B("design:type",String)],rn.prototype,"appDesc",void 0);j([m(),B("design:type",String)],rn.prototype,"appDomain",void 0);j([m(),B("design:type",String)],rn.prototype,"appUrl",void 0);j([m(),B("design:type",String)],rn.prototype,"appIconPath",void 0);j([m(),B("design:type",Array)],rn.prototype,"capabilities",void 0);rn=j([Ze(),B("design:paramtypes",[String,String,String,String,String,Array])],rn);var eo=class{constructor(e,r,n){this.username=e,this.did=r,this.password=n}};j([m(),B("design:type",String)],eo.prototype,"username",void 0);j([m(),B("design:type",String)],eo.prototype,"did",void 0);j([m(),B("design:type",String)],eo.prototype,"password",void 0);eo=j([z(),B("design:paramtypes",[String,String,String])],eo);var to=class{constructor(e,r,n){this.did=e,this.success=r,this.error=n}};j([m(),B("design:type",String)],to.prototype,"did",void 0);j([m(),B("design:type",Boolean)],to.prototype,"success",void 0);j([m(),B("design:type",String)],to.prototype,"error",void 0);to=j([z(),B("design:paramtypes",[String,Boolean,String])],to);var qi=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Vi=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Ft=class{constructor(e){e?(this.isInitialized=e.isInitialized,this.isInitialized||(this.isInitialized=!1),this.isUnlocked=e.isUnlocked,this.isUnlocked||(this.isUnlocked=!1),this.did=e.did,this.didDocument=e.didDocument,this.error=e.error):(this.isInitialized=!1,this.isUnlocked=!1)}};qi([m(),Vi("design:type",Boolean)],Ft.prototype,"isInitialized",void 0);qi([m(),Vi("design:type",Boolean)],Ft.prototype,"isUnlocked",void 0);qi([m(),Vi("design:type",String)],Ft.prototype,"did",void 0);qi([m(),Vi("design:type",String)],Ft.prototype,"didDocument",void 0);qi([m(),Vi("design:type",String)],Ft.prototype,"error",void 0);Ft=qi([z(),Vi("design:paramtypes",[Object])],Ft);var Gd=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Re=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},yt,vt,Cl=class{constructor(e,r){yt.set(this,void 0),vt.set(this,void 0),Gd(this,yt,e,"f"),Gd(this,vt,r,"f")}async otherAgents(){return await Re(this,yt,"f").otherAgents(Re(this,vt,"f"))}async hasTelepresenceAdapter(){return await Re(this,yt,"f").hasTelepresenceAdapter(Re(this,vt,"f"))}async onlineAgents(){return await Re(this,yt,"f").onlineAgents(Re(this,vt,"f"))}async setOnlineStatus(e){return await Re(this,yt,"f").setOnlineStatus(Re(this,vt,"f"),e)}async setOnlineStatusU(e){return await Re(this,yt,"f").setOnlineStatusU(Re(this,vt,"f"),e)}async sendSignal(e,r){return await Re(this,yt,"f").sendSignal(Re(this,vt,"f"),e,r)}async sendSignalU(e,r){return await Re(this,yt,"f").sendSignalU(Re(this,vt,"f"),e,r)}async sendBroadcast(e,r=!1){return await Re(this,yt,"f").sendBroadcast(Re(this,vt,"f"),e,r)}async sendBroadcastU(e,r=!1){return await Re(this,yt,"f").sendBroadcastU(Re(this,vt,"f"),e,r)}async addSignalHandler(e){await Re(this,yt,"f").addSignalHandler(Re(this,vt,"f"),e)}removeSignalHandler(e){Re(this,yt,"f").removeSignalHandler(Re(this,vt,"f"),e)}};yt=new WeakMap,vt=new WeakMap;var Zn=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Jn=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ot=class{constructor(e){e&&(this.source=e.source,this.predicate=e.predicate,this.target=e.target,e.fromDate&&(this.fromDate=e.fromDate),e.untilDate&&(this.untilDate=e.untilDate),e.limit&&(this.limit=e.limit))}isMatch(e){return!(this.source&&this.source!==e.source||this.predicate&&this.predicate!==e.predicate||this.target&&this.target!==e.target)}};Zn([m(),Jn("design:type",String)],ot.prototype,"source",void 0);Zn([m(),Jn("design:type",String)],ot.prototype,"target",void 0);Zn([m(),Jn("design:type",String)],ot.prototype,"predicate",void 0);Zn([m(),Jn("design:type",Date)],ot.prototype,"fromDate",void 0);Zn([m(),Jn("design:type",Date)],ot.prototype,"untilDate",void 0);Zn([m(),Jn("design:type",Number)],ot.prototype,"limit",void 0);ot=Zn([z(),Ze(),Jn("design:paramtypes",[Object])],ot);var Wd=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},tt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},bt,vr;function hs(t){return encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}var It=class{constructor(){bt.set(this,void 0),vr.set(this,void 0)}static fromUrl(e){if(!e||!e.startsWith("literal://"))throw new Error("Can't create Literal from non-literal URL");let r=new It;return Wd(r,vr,e,"f"),r}static from(e){let r=new It;return Wd(r,bt,e,"f"),r}toUrl(){if(tt(this,vr,"f")&&!tt(this,bt,"f"))return tt(this,vr,"f");if(!tt(this,vr,"f")&&(tt(this,bt,"f")===void 0||tt(this,bt,"f")===""||tt(this,bt,"f")===null))throw new Error("Can't turn empty Literal into URL");let e;switch(typeof tt(this,bt,"f")){case"string":e=`string:${hs(tt(this,bt,"f"))}`;break;case"number":e=`number:${hs(tt(this,bt,"f"))}`;break;case"boolean":e=`boolean:${hs(tt(this,bt,"f"))}`;break;case"object":e=`json:${hs(JSON.stringify(tt(this,bt,"f")))}`;break}return`literal://${e}`}get(){if(tt(this,bt,"f"))return tt(this,bt,"f");if(!tt(this,vr,"f"))throw new Error("Can't render empty Literal");if(!tt(this,vr,"f").startsWith("literal://"))throw new Error("Can't render Literal from non-literal URL");let e=tt(this,vr,"f").substring(10);if(e.startsWith("string:"))return decodeURIComponent(e.substring(7));if(e.startsWith("number:")){let r=e.substring(7);return parseFloat(r)}if(e.startsWith("json:")){let r=e.substring(5);return JSON.parse(decodeURIComponent(r))}throw new Error(`Can't parse unknown literal: ${e}`)}};bt=new WeakMap,vr=new WeakMap;function Kr(t){return t.charAt(0).toUpperCase()+t.slice(1)}function d1(t){return`set${Kr(t)}`}function Cr(t){return t.endsWith("y")?t.slice(0,-1)+"ies":t+"s"}function Gl(t){return t.endsWith("ies")?t.slice(0,-3)+"y":t.endsWith("s")?t.slice(0,-1):t}function s0(t){return`add${Kr(Gl(t))}`}function c0(t){let e=t.substring(3),r=Cr(e);return r.charAt(0).toLowerCase()+r.slice(1)}function u0(t){return`remove${Kr(Gl(t))}`}function l0(t){let e=t.substring(6),r=Cr(e);return r.charAt(0).toLowerCase()+r.slice(1)}function p0(t){let e=t.substring(13),r=Cr(e);return r.charAt(0).toLowerCase()+r.slice(1)}function f0(t){return`setCollection${Kr(Gl(t))}`}function kn(t){if(Array.isArray(t))return`[${t.map(kn).join(", ")}]`;let e=Object.keys(t),r=[];for(let n of e){let i=JSON.stringify(t[n]),a=`${n}: ${i}`;r.push(a)}return`{${r.join(", ")}}`}var Xu=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},G=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},lt,pt,Te,Ys=class{constructor(t,e,r){lt.set(this,void 0),pt.set(this,void 0),Te.set(this,void 0),Xu(this,lt,e,"f"),Xu(this,pt,r,"f"),Xu(this,Te,t,"f")}get baseExpression(){return G(this,lt,"f")}async init(){let isInstance=await G(this,Te,"f").isSubjectInstance(G(this,lt,"f"),G(this,pt,"f"));if(!isInstance)throw`Not a valid subject instance of ${G(this,pt,"f")} for ${G(this,lt,"f")}`;let results=await G(this,Te,"f").infer(`subject_class("${G(this,pt,"f")}", C), property(C, Property)`),properties=results.map(t=>t.Property);for(let t of properties){let e=await G(this,Te,"f").infer(`subject_class("${G(this,pt,"f")}", C), property_resolve(C, "${t}")`);Object.defineProperty(this,t,{configurable:!0,get:async()=>{let r=await G(this,Te,"f").infer(`subject_class("${G(this,pt,"f")}", C), property_getter(C, "${G(this,lt,"f")}", "${t}", Value)`);if(r&&r.length>0){let n=r[0].Value;if(e)try{if(n){let i=await G(this,Te,"f").getExpression(n);try{return JSON.parse(i.data)}catch{return i.data}}else return n}catch{return n}else return n}else return r||void 0}})}let setters=await G(this,Te,"f").infer(`subject_class("${G(this,pt,"f")}", C), property_setter(C, Property, Setter)`);for(let setter of setters||[])if(setter){let property=setter.Property,actions=eval(setter.Setter),resolveLanguageResults=await G(this,Te,"f").infer(`subject_class("${G(this,pt,"f")}", C), property_resolve_language(C, "${property}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),this[d1(property)]=async t=>{resolveLanguage&&(t=await G(this,Te,"f").createExpression(t,resolveLanguage)),await G(this,Te,"f").executeAction(actions,G(this,lt,"f"),[{name:"value",value:t}])}}let results2=await G(this,Te,"f").infer(`subject_class("${G(this,pt,"f")}", C), collection(C, Collection)`);results2||(results2=[]);let collections=results2.map(t=>t.Collection);for(let t of collections)Object.defineProperty(this,t,{configurable:!0,get:async()=>{let e=await G(this,Te,"f").infer(`subject_class("${G(this,pt,"f")}", C), collection_getter(C, "${G(this,lt,"f")}", "${t}", Value)`);return e&&e.length>0&&e[0].Value?e[0].Value.filter(n=>n!==""&&n!==""):[]}});let adders=await G(this,Te,"f").infer(`subject_class("${G(this,pt,"f")}", C), collection_adder(C, Collection, Adder)`);adders||(adders=[]);for(let adder of adders)if(adder){let collection=adder.Collection,actions=eval(adder.Adder);this[s0(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>G(this,Te,"f").executeAction(actions,G(this,lt,"f"),[{name:"value",value:e}]))):await G(this,Te,"f").executeAction(actions,G(this,lt,"f"),[{name:"value",value:t}])}}let removers=await G(this,Te,"f").infer(`subject_class("${G(this,pt,"f")}", C), collection_remover(C, Collection, Remover)`);removers||(removers=[]);for(let remover of removers)if(remover){let collection=remover.Collection,actions=eval(remover.Remover);this[u0(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>G(this,Te,"f").executeAction(actions,G(this,lt,"f"),[{name:"value",value:e}]))):await G(this,Te,"f").executeAction(actions,G(this,lt,"f"),[{name:"value",value:t}])}}let collectionSetters=await G(this,Te,"f").infer(`subject_class("${G(this,pt,"f")}", C), collection_setter(C, Collection, Setter)`);collectionSetters||(collectionSetters=[]);for(let collectionSetter of collectionSetters)if(collectionSetter){let collection=collectionSetter.Collection,actions=eval(collectionSetter.Setter);this[f0(collection)]=async t=>{Array.isArray(t)?await G(this,Te,"f").executeAction(actions,G(this,lt,"f"),t.map(e=>({name:"value",value:e}))):await G(this,Te,"f").executeAction(actions,G(this,lt,"f"),[{name:"value",value:t}])}}}};lt=new WeakMap,pt=new WeakMap,Te=new WeakMap;var Fe=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},O=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},xl,Ii,Qr,An,Pn,Aa,Ia,Ti,Ta,Ns,br,Oa,h1,he,ge,In,Tn,On,Da,El=class{constructor(e,r,n){xl.add(this),Ii.set(this,void 0),Qr.set(this,void 0),An.set(this,void 0),Pn.set(this,void 0),Aa.set(this,void 0),Ia.set(this,void 0),Ti.set(this,void 0),Ta.set(this,!1),Ns.set(this,void 0),br.set(this,void 0),Oa.set(this,void 0),Fe(this,Ii,e,"f"),Fe(this,Oa,r,"f"),Fe(this,An,n,"f"),Fe(this,Pn,new Set,"f"),Fe(this,Ti,null,"f")}async subscribe(){let e=await O(this,An,"f").subscribeQuery(O(this,Ii,"f"),O(this,Oa,"f"));Fe(this,Qr,e.subscriptionId,"f"),Fe(this,Ns,new Promise((n,i)=>{Fe(this,br,setTimeout(()=>{i(new Error("Subscription initialization timed out after 30 seconds. Resubscribing...")),this.subscribe()},3e4),"f"),Fe(this,Ia,O(this,An,"f").subscribeToQueryUpdates(O(this,Qr,"f"),a=>{O(this,br,"f")&&(clearTimeout(O(this,br,"f")),Fe(this,br,void 0,"f")),n(!0),!(a.isInit&&O(this,Ti,"f"))&&(Fe(this,Ti,a,"f"),O(this,xl,"m",h1).call(this,a))}),"f")}),"f");let r=async()=>{if(!O(this,Ta,"f")){try{await O(this,An,"f").keepAliveQuery(O(this,Ii,"f"),O(this,Qr,"f"))}catch(n){console.error("Error in keepalive:",n),console.log("Reinitializing subscription for query:",O(this,Oa,"f")),await this.subscribe(),console.log("Subscription reinitialized")}O(this,Ta,"f")||Fe(this,Aa,setTimeout(r,3e4),"f")}};Fe(this,Aa,setTimeout(r,3e4),"f")}get id(){return O(this,Qr,"f")}get initialized(){return O(this,Ns,"f")}get result(){return O(this,Ti,"f")}onResult(e){return O(this,Pn,"f").add(e),()=>O(this,Pn,"f").delete(e)}dispose(){Fe(this,Ta,!0,"f"),clearTimeout(O(this,Aa,"f")),O(this,Ia,"f")&&O(this,Ia,"f").call(this),O(this,Pn,"f").clear(),O(this,br,"f")&&(clearTimeout(O(this,br,"f")),Fe(this,br,void 0,"f")),O(this,Qr,"f")&&O(this,An,"f").disposeQuerySubscription(O(this,Ii,"f"),O(this,Qr,"f")).catch(e=>console.error("Error disposing query subscription:",e))}};Ii=new WeakMap,Qr=new WeakMap,An=new WeakMap,Pn=new WeakMap,Aa=new WeakMap,Ia=new WeakMap,Ti=new WeakMap,Ta=new WeakMap,Ns=new WeakMap,br=new WeakMap,Oa=new WeakMap,xl=new WeakSet,h1=function t(e){for(let r of O(this,Pn,"f"))try{r(e)}catch(n){console.error("Error in query subscription callback:",n)}};var Di=class{constructor(t,e){he.set(this,void 0),ge.set(this,void 0),In.set(this,void 0),Tn.set(this,void 0),On.set(this,void 0),Da.set(this,void 0),Fe(this,In,[],"f"),Fe(this,Tn,[],"f"),Fe(this,On,[],"f"),Fe(this,Da,[],"f"),Fe(this,he,t,"f"),Fe(this,ge,e,"f"),this.uuid=O(this,he,"f").uuid,this.name=O(this,he,"f").name,this.sharedUrl=O(this,he,"f").sharedUrl,this.neighbourhood=O(this,he,"f").neighbourhood,this.state=O(this,he,"f").state,O(this,ge,"f").addPerspectiveLinkAddedListener(O(this,he,"f").uuid,O(this,In,"f")),O(this,ge,"f").addPerspectiveLinkRemovedListener(O(this,he,"f").uuid,O(this,Tn,"f")),O(this,ge,"f").addPerspectiveLinkUpdatedListener(O(this,he,"f").uuid,O(this,On,"f")),O(this,ge,"f").addPerspectiveSyncStateChangeListener(O(this,he,"f").uuid,O(this,Da,"f"))}async executeAction(t,e,r,n){return await O(this,ge,"f").executeCommands(O(this,he,"f").uuid,JSON.stringify(t),e,JSON.stringify(r),n)}async get(t){return await O(this,ge,"f").queryLinks(O(this,he,"f").uuid,t)}async infer(t){return await O(this,ge,"f").queryProlog(O(this,he,"f").uuid,t)}async add(t,e="shared",r){return await O(this,ge,"f").addLink(O(this,he,"f").uuid,t,e,r)}async addLinks(t,e="shared",r){return await O(this,ge,"f").addLinks(O(this,he,"f").uuid,t,e,r)}async removeLinks(t,e){return await O(this,ge,"f").removeLinks(O(this,he,"f").uuid,t,e)}async linkMutations(t,e="shared"){return await O(this,ge,"f").linkMutations(O(this,he,"f").uuid,t,e)}async addLinkExpression(t,e="shared",r){return await O(this,ge,"f").addLinkExpression(O(this,he,"f").uuid,t,e,r)}async update(t,e,r){return await O(this,ge,"f").updateLink(O(this,he,"f").uuid,t,e,r)}async remove(t,e){return await O(this,ge,"f").removeLink(O(this,he,"f").uuid,t,e)}async createBatch(){return await O(this,ge,"f").createBatch(O(this,he,"f").uuid)}async commitBatch(t){return await O(this,ge,"f").commitBatch(O(this,he,"f").uuid,t)}async getExpression(t){return await O(this,ge,"f").getExpression(t)}async createExpression(t,e){return await O(this,ge,"f").createExpression(t,e)}async addListener(t,e){t==="link-added"?O(this,In,"f").push(e):t==="link-removed"?O(this,Tn,"f").push(e):t==="link-updated"&&O(this,On,"f").push(e)}async addSyncStateChangeListener(t){O(this,Da,"f").push(t)}async removeListener(t,e){if(t==="link-added"){let r=O(this,In,"f").indexOf(e);O(this,In,"f").splice(r,1)}else if(t==="link-removed"){let r=O(this,Tn,"f").indexOf(e);O(this,Tn,"f").splice(r,1)}else if(t==="link-updated"){let r=O(this,On,"f").indexOf(e);O(this,On,"f").splice(r,1)}}async snapshot(){return O(this,ge,"f").snapshotByUUID(O(this,he,"f").uuid)}async loadSnapshot(t){let e=JSON.parse(JSON.stringify(t));delete e.__typename,e.links.forEach(r=>{delete r.data.__typename});for(let r of e.links)await this.addLinkExpression(r)}async getSingleTarget(t){delete t.target;let e=await this.get(t);return e.length?e[0].data.target:null}async setSingleTarget(t,e="shared"){let r=new ot({source:t.source,predicate:t.predicate}),n=await this.get(r),i=[];for(let o of n)delete o.__typename,delete o.data.__typename,delete o.proof.__typename,i.push(o);let a=[t];await this.linkMutations({additions:a,removals:i},e)}async sdnaFlows(){return(await this.infer("register_sdna_flow(X, _)")).map(e=>e.X)}async availableFlows(t){return(await this.infer(`flowable("${t}", F), register_sdna_flow(X, F)`)).map(r=>r.X)}async startFlow(flowName,exprAddr){let startAction=await this.infer(`start_action(Action, F), register_sdna_flow("${flowName}", F)`);startAction=eval(startAction[0].Action),await this.executeAction(startAction,exprAddr,void 0)}async expressionsInFlowState(t,e){return(await this.infer(`register_sdna_flow("${t}", F), flow_state(X, ${e}, F)`)).map(n=>n.X)}async flowState(t,e){return(await this.infer(`register_sdna_flow("${t}", F), flow_state("${e}", X, F)`))[0].X}async flowActions(t,e){return(await this.infer(`register_sdna_flow("${t}", Flow), flow_state("${e}", State, Flow), action(State, Name, _, _)`)).map(n=>n.Name)}async runFlowAction(flowName,exprAddr,actionName){let action=await this.infer(`register_sdna_flow("${flowName}", Flow), flow_state("${exprAddr}", State, Flow), action(State, "${actionName}", _, Action)`);action=eval(action[0].Action),await this.executeAction(action,exprAddr,void 0)}async getSdna(){let t=["ad4m://has_subject_class","ad4m://has_flow","ad4m://has_custom_sdna"],e=[];for(let r of t){let n=await this.get(new ot({source:"ad4m://self",predicate:r}));for(let i of n){let a=i.data.target,o=await this.get(new ot({source:a,predicate:"ad4m://sdna"}));for(let s of o){let u=It.fromUrl(s.data.target).get();typeof u=="string"&&e.push(u)}}}return e}async getSdnaForClass(t){let e=It.from(t);if((await this.get(new ot({source:"ad4m://self",target:e.toUrl(),predicate:"ad4m://has_subject_class"}))).length===0)return null;let n=await this.get(new ot({source:e.toUrl(),predicate:"ad4m://sdna"}));if(n.length===0)return null;let i=It.fromUrl(n[0].data.target).get();return typeof i=="string"?i:null}async addSdna(t,e,r){return O(this,ge,"f").addSdna(O(this,he,"f").uuid,t,e,r)}async subjectClasses(){try{return(await this.infer("subject_class(X, _)")).map(t=>t.X)}catch{return[]}}async stringOrTemplateObjectToSubjectClassName(t){if(typeof t=="string")return t;{let e=await this.subjectClassesByTemplate(t);return e[0]?e[0]:t.className}}async createSubject(t,e,r,n){let i;if(typeof t=="string")i=t,await O(this,ge,"f").createSubject(O(this,he,"f").uuid,JSON.stringify({className:i,initialValues:r}),e,r?JSON.stringify(r):void 0,n);else{let a=this.buildQueryFromTemplate(t);await O(this,ge,"f").createSubject(O(this,he,"f").uuid,JSON.stringify({query:a,initialValues:r}),e,r?JSON.stringify(r):void 0,n)}return n?e:this.getSubjectProxy(e,t)}async getSubjectData(t,e){if(typeof t=="string")return JSON.parse(await O(this,ge,"f").getSubjectData(O(this,he,"f").uuid,JSON.stringify({className:t}),e));let r=this.buildQueryFromTemplate(t);return JSON.parse(await O(this,ge,"f").getSubjectData(O(this,he,"f").uuid,JSON.stringify({query:r}),e))}async removeSubject(subjectClass,exprAddr,batchId){let className=await this.stringOrTemplateObjectToSubjectClassName(subjectClass),result=await this.infer(`subject_class("${className}", C), destructor(C, Actions)`);if(!result.length)throw"No destructor found for given subject class: "+className;let actions=result.map(x=>eval(x.Actions));await this.executeAction(actions[0],exprAddr,void 0,batchId)}async isSubjectInstance(t,e){let r=await this.stringOrTemplateObjectToSubjectClassName(e),n=!1,i=5,a=0;for(;a<i&&!n;)n=await this.infer(`subject_class("${r}", C), instance(C, "${t}")`),a++;return n}async getSubjectProxy(t,e){if(!await this.isSubjectInstance(t,e))throw`Expression ${t} is not a subject instance of given class: ${JSON.stringify(e)}`;let r=await this.stringOrTemplateObjectToSubjectClassName(e),n=new Ys(this,t,r);return await n.init(),n}async getAllSubjectInstances(t){let e=[];typeof t=="string"?e=[t]:e=await this.subjectClassesByTemplate(t);let r=[];for(let n of e){let i=await this.infer(`subject_class("${n}", C), instance(C, X)`),a=await Promise.all(i.map(async o=>await this.getSubjectProxy(o.X,n)));r=r.concat(a)}return r}async getAllSubjectProxies(t){let e=[];typeof t=="string"?e=[t]:e=await this.subjectClassesByTemplate(t);let r=[];for(let n of e)r=await this.infer(`subject_class("${n}", C), instance(C, X)`);return r}buildQueryFromTemplate(t){let e;return function(r){let n=[],i=[];Object.getPrototypeOf(r).__properties?Object.keys(Object.getPrototypeOf(r).__properties).forEach(l=>n.push(l)):n.push(...Object.keys(r).filter(l=>!Array.isArray(r[l]))),Object.getPrototypeOf(r).__collections?Object.keys(Object.getPrototypeOf(r).__collections).filter(l=>l!=="isSubjectInstance").forEach(l=>{i.includes(l)||i.push(l)}):i.push(...Object.keys(r).filter(l=>Array.isArray(r[l])).filter(l=>l!=="isSubjectInstance"));let a=Object.getOwnPropertyNames(r).filter(l=>typeof r[l]=="function"&&l.startsWith("set")&&!l.startsWith("setCollection"));a=a.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("set")&&!l.startsWith("setCollection")}));let o=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("add"));o=o.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("add")}));let s=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("remove"));s=s.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("remove")}));let u=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("setCollection"));u=u.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("setCollection")}));let c="subject_class(Class, C)";for(let l of n)c+=`, property(C, "${l}")`;for(let l of i)c+=`, collection(C, "${l}")`;for(let l of a){let d=l.substring(3);d=d.charAt(0).toLowerCase()+d.slice(1),c+=`, property_setter(C, "${d}", _)`}for(let l of o)c+=`, collection_adder(C, "${c0(l)}", _)`;for(let l of s)c+=`, collection_remover(C, "${l0(l)}", _)`;for(let l of u)c+=`, collection_setter(C, "${p0(l)}", _)`;c+=".",e=c}(t),e}async subjectClassesByTemplate(t){let e=this.buildQueryFromTemplate(t),r=await this.infer(e);return r?r.map(n=>n.Class):[]}async ensureSDNASubjectClass(t){if((await this.subjectClassesByTemplate(new t)).length>0)return;let{name:r,sdna:n}=t.generateSDNA();await this.addSdna(r,n,"subject_class")}getNeighbourhoodProxy(){return O(this,ge,"f").getNeighbourhoodProxy(O(this,he,"f").uuid)}get ai(){return O(this,ge,"f").aiClient}async subscribeInfer(t){let e=new El(this.uuid,t,O(this,ge,"f"));return await e.subscribe(),await e.initialized,e}};he=new WeakMap,ge=new WeakMap,In=new WeakMap,Tn=new WeakMap,On=new WeakMap,Da=new WeakMap;var Br=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},W=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ae,Na,Pa,Ra,Ps,$a,Rs,$s,ut=`
|
|
64
64
|
author
|
|
65
65
|
timestamp
|
|
66
66
|
status
|
|
67
67
|
data { source, predicate, target }
|
|
68
68
|
proof { valid, invalid, signature, key }
|
|
69
|
-
`,
|
|
69
|
+
`,Si=`
|
|
70
70
|
uuid
|
|
71
71
|
name
|
|
72
72
|
sharedUrl
|
|
@@ -86,112 +86,128 @@ neighbourhood {
|
|
|
86
86
|
}
|
|
87
87
|
author
|
|
88
88
|
}
|
|
89
|
-
`,
|
|
89
|
+
`,Xs=class{constructor(e,r=!0){ae.set(this,void 0),Na.set(this,void 0),Pa.set(this,void 0),Ra.set(this,void 0),Ps.set(this,void 0),$a.set(this,void 0),Rs.set(this,void 0),$s.set(this,void 0),Br(this,ae,e,"f"),Br(this,Na,[],"f"),Br(this,Pa,[],"f"),Br(this,Ra,[],"f"),Br(this,Ps,[],"f"),r&&(this.subscribePerspectiveAdded(),this.subscribePerspectiveUpdated(),this.subscribePerspectiveRemoved())}setExpressionClient(e){Br(this,$a,e,"f")}setNeighbourhoodClient(e){Br(this,Rs,e,"f")}setAIClient(e){Br(this,$s,e,"f")}get aiClient(){return W(this,$s,"f")}async all(){let{perspectives:e}=A(await W(this,ae,"f").query({query:E`query perspectives {
|
|
90
90
|
perspectives {
|
|
91
|
-
${
|
|
91
|
+
${Si}
|
|
92
92
|
}
|
|
93
|
-
}`}));return e.map(r=>new
|
|
93
|
+
}`}));return e.map(r=>new Di(r,this))}async byUUID(e){let{perspective:r}=A(await W(this,ae,"f").query({query:E`query perspective($uuid: String!) {
|
|
94
94
|
perspective(uuid: $uuid) {
|
|
95
|
-
${
|
|
95
|
+
${Si}
|
|
96
96
|
}
|
|
97
|
-
}`,variables:{uuid:e}}));return r?new
|
|
97
|
+
}`,variables:{uuid:e}}));return r?new Di(r,this):null}async snapshotByUUID(e){let{perspectiveSnapshot:r}=A(await W(this,ae,"f").query({query:E`query perspectiveSnapshot($uuid: String!) {
|
|
98
98
|
perspectiveSnapshot(uuid: $uuid) {
|
|
99
|
-
links { ${
|
|
99
|
+
links { ${ut} }
|
|
100
100
|
}
|
|
101
|
-
}`,variables:{uuid:e}}));return r}async publishSnapshotByUUID(e){let{perspectivePublishSnapshot:r}=
|
|
101
|
+
}`,variables:{uuid:e}}));return r}async publishSnapshotByUUID(e){let{perspectivePublishSnapshot:r}=A(await W(this,ae,"f").mutate({mutation:E`mutation perspectivePublishSnapshot($uuid: String!) {
|
|
102
102
|
perspectivePublishSnapshot(uuid: $uuid)
|
|
103
|
-
}`,variables:{uuid:e}}));return r}async queryLinks(e,r){let{perspectiveQueryLinks:n}=
|
|
103
|
+
}`,variables:{uuid:e}}));return r}async queryLinks(e,r){let{perspectiveQueryLinks:n}=A(await W(this,ae,"f").query({query:E`query perspectiveQueryLinks($uuid: String!, $query: LinkQuery!) {
|
|
104
104
|
perspectiveQueryLinks(query: $query, uuid: $uuid) {
|
|
105
|
-
${
|
|
105
|
+
${ut}
|
|
106
106
|
}
|
|
107
|
-
}`,variables:{uuid:e,query:r}}));return n}async queryProlog(e,r){let{perspectiveQueryProlog:n}=
|
|
107
|
+
}`,variables:{uuid:e,query:r}}));return n}async queryProlog(e,r){let{perspectiveQueryProlog:n}=A(await W(this,ae,"f").query({query:E`query perspectiveQueryProlog($uuid: String!, $query: String!) {
|
|
108
108
|
perspectiveQueryProlog(uuid: $uuid, query: $query)
|
|
109
|
-
}`,variables:{uuid:e,query:r}}));return JSON.parse(n)}async
|
|
109
|
+
}`,variables:{uuid:e,query:r}}));return JSON.parse(n)}async subscribeQuery(e,r){let{perspectiveSubscribeQuery:n}=A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveSubscribeQuery($uuid: String!, $query: String!) {
|
|
110
|
+
perspectiveSubscribeQuery(uuid: $uuid, query: $query) {
|
|
111
|
+
subscriptionId
|
|
112
|
+
result
|
|
113
|
+
}
|
|
114
|
+
}`,variables:{uuid:e,query:r}})),{subscriptionId:i,result:a}=n,o=a,s=!1;o.startsWith("#init#")&&(o=o.substring(6),s=!0);try{o=JSON.parse(o)}catch(u){console.error("Error parsing perspectiveSubscribeQuery result:",u)}return{subscriptionId:i,result:o,isInit:s}}subscribeToQueryUpdates(e,r){let n=W(this,ae,"f").subscribe({query:E`
|
|
115
|
+
subscription perspectiveQuerySubscription($subscriptionId: String!) {
|
|
116
|
+
perspectiveQuerySubscription(subscriptionId: $subscriptionId)
|
|
117
|
+
}
|
|
118
|
+
`,variables:{subscriptionId:e}}).subscribe({next:i=>{if(i.data&&i.data.perspectiveQuerySubscription){let a=i.data.perspectiveQuerySubscription,o=!1;a.startsWith("#init#")&&(a=a.substring(6),o=!0);try{a=JSON.parse(a),o&&typeof a=="object"&&(a.isInit=!0)}catch(s){console.error("Error parsing perspectiveQuerySubscription:",s)}r(a)}},error:i=>console.error("Error in query subscription:",i)});return()=>n.unsubscribe()}async keepAliveQuery(e,r){let{perspectiveKeepAliveQuery:n}=A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveKeepAliveQuery($uuid: String!, $subscriptionId: String!) {
|
|
119
|
+
perspectiveKeepAliveQuery(uuid: $uuid, subscriptionId: $subscriptionId)
|
|
120
|
+
}`,variables:{uuid:e,subscriptionId:r}}));return n}async disposeQuerySubscription(e,r){let{perspectiveDisposeQuerySubscription:n}=A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveDisposeQuerySubscription($uuid: String!, $subscriptionId: String!) {
|
|
121
|
+
perspectiveDisposeQuerySubscription(uuid: $uuid, subscriptionId: $subscriptionId)
|
|
122
|
+
}`,variables:{uuid:e,subscriptionId:r}}));return n}async add(e){let{perspectiveAdd:r}=A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveAdd($name: String!) {
|
|
110
123
|
perspectiveAdd(name: $name) {
|
|
111
|
-
${
|
|
124
|
+
${Si}
|
|
112
125
|
}
|
|
113
|
-
}`,variables:{name:e}}));return new
|
|
126
|
+
}`,variables:{name:e}}));return new Di(r,this)}async update(e,r){let{perspectiveUpdate:n}=A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveUpdate($uuid: String!, $name: String!) {
|
|
114
127
|
perspectiveUpdate(uuid: $uuid, name: $name) {
|
|
115
|
-
${
|
|
128
|
+
${Si}
|
|
116
129
|
}
|
|
117
|
-
}`,variables:{uuid:e,name:r}}));return new
|
|
130
|
+
}`,variables:{uuid:e,name:r}}));return new Di(n,this)}async remove(e){return A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveRemove($uuid: String!) {
|
|
118
131
|
perspectiveRemove(uuid: $uuid)
|
|
119
|
-
}`,variables:{uuid:e}}))}async addLink(e,r,n){let{perspectiveAddLink:
|
|
120
|
-
perspectiveAddLink(link: $link,
|
|
121
|
-
${
|
|
132
|
+
}`,variables:{uuid:e}}))}async addLink(e,r,n="shared",i){let{perspectiveAddLink:a}=A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveAddLink($uuid: String!, $link: LinkInput!, $status: String!, $batchId: String) {
|
|
133
|
+
perspectiveAddLink(uuid: $uuid, link: $link, status: $status, batchId: $batchId) {
|
|
134
|
+
${ut}
|
|
122
135
|
}
|
|
123
|
-
}`,variables:{uuid:e,link:r,status:n}}));return
|
|
124
|
-
perspectiveAddLinks(links: $links,
|
|
125
|
-
${
|
|
136
|
+
}`,variables:{uuid:e,link:r,status:n,batchId:i}}));return a}async addLinks(e,r,n="shared",i){let{perspectiveAddLinks:a}=A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveAddLinks($uuid: String!, $links: [LinkInput!]!, $status: String!, $batchId: String) {
|
|
137
|
+
perspectiveAddLinks(uuid: $uuid, links: $links, status: $status, batchId: $batchId) {
|
|
138
|
+
${ut}
|
|
126
139
|
}
|
|
127
|
-
}`,variables:{uuid:e,links:r,status:n}}));return
|
|
128
|
-
perspectiveRemoveLinks(links: $links,
|
|
129
|
-
${
|
|
140
|
+
}`,variables:{uuid:e,links:r,status:n,batchId:i}}));return a}async removeLinks(e,r,n){let{perspectiveRemoveLinks:i}=A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveRemoveLinks($uuid: String!, $links: [LinkExpressionInput!]!, $batchId: String) {
|
|
141
|
+
perspectiveRemoveLinks(uuid: $uuid, links: $links, batchId: $batchId) {
|
|
142
|
+
${ut}
|
|
130
143
|
}
|
|
131
|
-
}`,variables:{uuid:e,links:r}}));return
|
|
144
|
+
}`,variables:{uuid:e,links:r,batchId:n}}));return i}async linkMutations(e,r,n){let{perspectiveLinkMutations:i}=A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveLinkMutations($uuid: String!, $mutations: LinkMutations!, $status: String){
|
|
132
145
|
perspectiveLinkMutations(mutations: $mutations, uuid: $uuid, status: $status) {
|
|
133
146
|
additions {
|
|
134
|
-
${
|
|
147
|
+
${ut}
|
|
135
148
|
}
|
|
136
149
|
removals {
|
|
137
|
-
${
|
|
150
|
+
${ut}
|
|
138
151
|
}
|
|
139
152
|
}
|
|
140
|
-
}`,variables:{uuid:e,mutations:r,status:n}}));return i}async addLinkExpression(e,r,n){let{perspectiveAddLinkExpression:
|
|
141
|
-
perspectiveAddLinkExpression(link: $link,
|
|
142
|
-
${
|
|
143
|
-
}
|
|
144
|
-
}`,variables:{uuid:e,link:r}}));return
|
|
145
|
-
$uuid:
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
){
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
oldLink: $oldLink,
|
|
152
|
-
uuid: $uuid
|
|
153
|
-
) {
|
|
154
|
-
${ht}
|
|
155
|
-
}
|
|
156
|
-
}`,variables:{uuid:e,oldLink:r,newLink:n}}));return i.status||delete i.status,i}async removeLink(e,r){return delete r.__typename,delete r.data.__typename,delete r.proof.__typename,delete r.status,T(await W(this,se,"f").mutate({mutation:E`mutation perspectiveRemoveLink($link: LinkExpressionInput!, $uuid: String!) {
|
|
157
|
-
perspectiveRemoveLink(link: $link, uuid: $uuid)
|
|
158
|
-
}`,variables:{uuid:e,link:r}}))}async addSdna(e,r,n,i){return T(await W(this,se,"f").mutate({mutation:E`mutation perspectiveAddSdna($uuid: String!, $name: String!, $sdnaCode: String!, $sdnaType: String!) {
|
|
153
|
+
}`,variables:{uuid:e,mutations:r,status:n}}));return i}async addLinkExpression(e,r,n="shared",i){let{perspectiveAddLinkExpression:a}=A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveAddLinkExpression($uuid: String!, $link: LinkExpressionInput!, $status: String!, $batchId: String) {
|
|
154
|
+
perspectiveAddLinkExpression(uuid: $uuid, link: $link, status: $status, batchId: $batchId) {
|
|
155
|
+
${ut}
|
|
156
|
+
}
|
|
157
|
+
}`,variables:{uuid:e,link:r,status:n,batchId:i}}));return a}async updateLink(e,r,n,i){let{perspectiveUpdateLink:a}=A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveUpdateLink($uuid: String!, $oldLink: LinkExpressionInput!, $newLink: LinkInput!, $batchId: String) {
|
|
158
|
+
perspectiveUpdateLink(uuid: $uuid, oldLink: $oldLink, newLink: $newLink, batchId: $batchId) {
|
|
159
|
+
${ut}
|
|
160
|
+
}
|
|
161
|
+
}`,variables:{uuid:e,oldLink:r,newLink:n,batchId:i}}));return a}async removeLink(e,r,n){delete r.__typename,delete r.data.__typename,delete r.proof.__typename,delete r.status;let{perspectiveRemoveLink:i}=A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveRemoveLink($link: LinkExpressionInput!, $uuid: String!, $batchId: String) {
|
|
162
|
+
perspectiveRemoveLink(link: $link, uuid: $uuid, batchId: $batchId)
|
|
163
|
+
}`,variables:{uuid:e,link:r,batchId:n}}));return i}async addSdna(e,r,n,i){return A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveAddSdna($uuid: String!, $name: String!, $sdnaCode: String!, $sdnaType: String!) {
|
|
159
164
|
perspectiveAddSdna(uuid: $uuid, name: $name, sdnaCode: $sdnaCode, sdnaType: $sdnaType)
|
|
160
|
-
}`,variables:{uuid:e,name:r,sdnaCode:n,sdnaType:i}})).perspectiveAddSdna}async executeCommands(e,r,n,i){return
|
|
161
|
-
perspectiveExecuteCommands(uuid: $uuid, commands: $commands, expression: $expression, parameters: $parameters)
|
|
162
|
-
}`,variables:{uuid:e,commands:r,expression:n,parameters:i}})).perspectiveExecuteCommands}async createSubject(e,r,n){return
|
|
163
|
-
perspectiveCreateSubject(uuid: $uuid, subjectClass: $subjectClass, expressionAddress: $expressionAddress)
|
|
164
|
-
}`,variables:{uuid:e,subjectClass:r,expressionAddress:n}})).perspectiveCreateSubject}async getSubjectData(e,r,n){return
|
|
165
|
+
}`,variables:{uuid:e,name:r,sdnaCode:n,sdnaType:i}})).perspectiveAddSdna}async executeCommands(e,r,n,i,a){return A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveExecuteCommands($uuid: String!, $commands: String!, $expression: String!, $parameters: String, $batchId: String) {
|
|
166
|
+
perspectiveExecuteCommands(uuid: $uuid, commands: $commands, expression: $expression, parameters: $parameters, batchId: $batchId)
|
|
167
|
+
}`,variables:{uuid:e,commands:r,expression:n,parameters:i,batchId:a}})).perspectiveExecuteCommands}async createSubject(e,r,n,i,a){return A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveCreateSubject($uuid: String!, $subjectClass: String!, $expressionAddress: String!, $initialValues: String, $batchId: String) {
|
|
168
|
+
perspectiveCreateSubject(uuid: $uuid, subjectClass: $subjectClass, expressionAddress: $expressionAddress, initialValues: $initialValues, batchId: $batchId)
|
|
169
|
+
}`,variables:{uuid:e,subjectClass:r,expressionAddress:n,initialValues:i,batchId:a}})).perspectiveCreateSubject}async getSubjectData(e,r,n){return A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveGetSubjectData($uuid: String!, $subjectClass: String!, $expressionAddress: String!) {
|
|
165
170
|
perspectiveGetSubjectData(uuid: $uuid, subjectClass: $subjectClass, expressionAddress: $expressionAddress)
|
|
166
|
-
}`,variables:{uuid:e,subjectClass:r,expressionAddress:n}})).perspectiveGetSubjectData}async getExpression(e){return await W(this,
|
|
167
|
-
perspectiveAdded { ${
|
|
171
|
+
}`,variables:{uuid:e,subjectClass:r,expressionAddress:n}})).perspectiveGetSubjectData}async getExpression(e){return await W(this,$a,"f").get(e)}async createExpression(e,r){return await W(this,$a,"f").create(e,r)}addPerspectiveAddedListener(e){W(this,Na,"f").push(e)}subscribePerspectiveAdded(){W(this,ae,"f").subscribe({query:E` subscription {
|
|
172
|
+
perspectiveAdded { ${Si} }
|
|
168
173
|
}
|
|
169
|
-
`}).subscribe({next:e=>{W(this,
|
|
170
|
-
perspectiveUpdated { ${
|
|
174
|
+
`}).subscribe({next:e=>{W(this,Na,"f").forEach(r=>{r(e.data.perspectiveAdded)})},error:e=>console.error(e)})}addPerspectiveUpdatedListener(e){W(this,Pa,"f").push(e)}subscribePerspectiveUpdated(){W(this,ae,"f").subscribe({query:E` subscription {
|
|
175
|
+
perspectiveUpdated { ${Si} }
|
|
171
176
|
}
|
|
172
|
-
`}).subscribe({next:e=>{W(this,
|
|
177
|
+
`}).subscribe({next:e=>{W(this,Pa,"f").forEach(r=>{r(e.data.perspectiveUpdated)})},error:e=>console.error(e)})}addPerspectiveSyncedListener(e){W(this,Ps,"f").push(e)}async addPerspectiveSyncStateChangeListener(e,r){W(this,ae,"f").subscribe({query:E` subscription {
|
|
173
178
|
perspectiveSyncStateChange(uuid: "${e}")
|
|
174
179
|
}
|
|
175
|
-
`}).subscribe({next:n=>{r.forEach(i=>{i(n.data.perspectiveSyncStateChange)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}addPerspectiveRemovedListener(e){W(this,
|
|
180
|
+
`}).subscribe({next:n=>{r.forEach(i=>{i(n.data.perspectiveSyncStateChange)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}addPerspectiveRemovedListener(e){W(this,Ra,"f").push(e)}subscribePerspectiveRemoved(){W(this,ae,"f").subscribe({query:E` subscription {
|
|
176
181
|
perspectiveRemoved
|
|
177
182
|
}
|
|
178
|
-
`}).subscribe({next:e=>{W(this,
|
|
179
|
-
perspectiveLinkAdded(uuid: "${e}") { ${
|
|
183
|
+
`}).subscribe({next:e=>{W(this,Ra,"f").forEach(r=>{r(e.data.perspectiveRemoved)})},error:e=>console.error(e)})}async addPerspectiveLinkAddedListener(e,r){W(this,ae,"f").subscribe({query:E` subscription {
|
|
184
|
+
perspectiveLinkAdded(uuid: "${e}") { ${ut} }
|
|
180
185
|
}
|
|
181
|
-
`}).subscribe({next:n=>{r.forEach(i=>{i(n.data.perspectiveLinkAdded)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}async addPerspectiveLinkRemovedListener(e,r){W(this,
|
|
182
|
-
perspectiveLinkRemoved(uuid: "${e}") { ${
|
|
186
|
+
`}).subscribe({next:n=>{r.forEach(i=>{i(n.data.perspectiveLinkAdded)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}async addPerspectiveLinkRemovedListener(e,r){W(this,ae,"f").subscribe({query:E` subscription {
|
|
187
|
+
perspectiveLinkRemoved(uuid: "${e}") { ${ut} }
|
|
183
188
|
}
|
|
184
|
-
`}).subscribe({next:n=>{r.forEach(i=>{n.data.perspectiveLinkRemoved.status||delete n.data.perspectiveLinkRemoved.status,i(n.data.perspectiveLinkRemoved)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}async addPerspectiveLinkUpdatedListener(e,r){W(this,
|
|
189
|
+
`}).subscribe({next:n=>{r.forEach(i=>{n.data.perspectiveLinkRemoved.status||delete n.data.perspectiveLinkRemoved.status,i(n.data.perspectiveLinkRemoved)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}async addPerspectiveLinkUpdatedListener(e,r){W(this,ae,"f").subscribe({query:E` subscription {
|
|
185
190
|
perspectiveLinkUpdated(uuid: "${e}") {
|
|
186
191
|
oldLink {
|
|
187
|
-
${
|
|
192
|
+
${ut}
|
|
188
193
|
}
|
|
189
194
|
newLink {
|
|
190
|
-
${
|
|
195
|
+
${ut}
|
|
191
196
|
}
|
|
192
197
|
}
|
|
193
198
|
}
|
|
194
|
-
`}).subscribe({next:n=>{r.forEach(i=>{n.data.perspectiveLinkUpdated.newLink.status||delete n.data.perspectiveLinkUpdated.newLink.status,n.data.perspectiveLinkUpdated.oldLink.status||delete n.data.perspectiveLinkUpdated.oldLink.status,i(n.data.perspectiveLinkUpdated)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}getNeighbourhoodProxy(e){return new
|
|
199
|
+
`}).subscribe({next:n=>{r.forEach(i=>{n.data.perspectiveLinkUpdated.newLink.status||delete n.data.perspectiveLinkUpdated.newLink.status,n.data.perspectiveLinkUpdated.oldLink.status||delete n.data.perspectiveLinkUpdated.oldLink.status,i(n.data.perspectiveLinkUpdated)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}getNeighbourhoodProxy(e){return new Cl(W(this,Rs,"f"),e)}async createBatch(e){let{perspectiveCreateBatch:r}=A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveCreateBatch($uuid: String!) {
|
|
200
|
+
perspectiveCreateBatch(uuid: $uuid)
|
|
201
|
+
}`,variables:{uuid:e}}));return r}async commitBatch(e,r){let{perspectiveCommitBatch:n}=A(await W(this,ae,"f").mutate({mutation:E`mutation perspectiveCommitBatch($uuid: String!, $batchId: String!) {
|
|
202
|
+
perspectiveCommitBatch(uuid: $uuid, batchId: $batchId) {
|
|
203
|
+
additions {
|
|
204
|
+
${ut}
|
|
205
|
+
}
|
|
206
|
+
removals {
|
|
207
|
+
${ut}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}`,variables:{uuid:e,batchId:r}}));return n}};ae=new WeakMap,Na=new WeakMap,Pa=new WeakMap,Ra=new WeakMap,Ps=new WeakMap,$a=new WeakMap,Rs=new WeakMap,$s=new WeakMap;var ms=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},le=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},me,La,Fa,Ma,Ca=`
|
|
195
211
|
did
|
|
196
212
|
directMessageLanguage
|
|
197
213
|
perspective {
|
|
@@ -205,7 +221,7 @@ neighbourhood {
|
|
|
205
221
|
}
|
|
206
222
|
}
|
|
207
223
|
}
|
|
208
|
-
`,
|
|
224
|
+
`,gs=`
|
|
209
225
|
requestId
|
|
210
226
|
revoked
|
|
211
227
|
auth {
|
|
@@ -221,128 +237,136 @@ neighbourhood {
|
|
|
221
237
|
can
|
|
222
238
|
}
|
|
223
239
|
}
|
|
224
|
-
`,
|
|
240
|
+
`,Ci=`
|
|
225
241
|
isInitialized
|
|
226
242
|
isUnlocked
|
|
227
243
|
did
|
|
228
244
|
didDocument
|
|
229
245
|
error
|
|
230
|
-
`,
|
|
246
|
+
`,ys=`
|
|
231
247
|
did
|
|
232
248
|
didSigningKeyId
|
|
233
249
|
deviceKeyType
|
|
234
250
|
deviceKey
|
|
235
251
|
deviceKeySignedByDid
|
|
236
252
|
didSignedByDeviceKey
|
|
237
|
-
`,
|
|
253
|
+
`,d0=`
|
|
238
254
|
signature
|
|
239
255
|
publicKey
|
|
240
|
-
`,
|
|
256
|
+
`,ro=class{constructor(e,r=!0){me.set(this,void 0),La.set(this,void 0),Fa.set(this,void 0),Ma.set(this,void 0),ms(this,me,e,"f"),ms(this,Fa,[],"f"),ms(this,Ma,[],"f"),ms(this,La,[],"f"),r&&(this.subscribeAgentUpdated(),this.subscribeAgentStatusChanged(),this.subscribeAppsChanged())}async me(){let{agent:e}=A(await le(this,me,"f").query({query:E`query agent { agent { ${Ca} } }`})),r=new Wr(e.did,e.perspective);return r.directMessageLanguage=e.directMessageLanguage,r}async status(){let{agentStatus:e}=A(await le(this,me,"f").query({query:E`query agentStatus {
|
|
241
257
|
agentStatus {
|
|
242
|
-
${
|
|
258
|
+
${Ci}
|
|
243
259
|
}
|
|
244
|
-
}`}));return new
|
|
260
|
+
}`}));return new Ft(e)}async generate(e){let{agentGenerate:r}=A(await le(this,me,"f").mutate({mutation:E`mutation agentGenerate(
|
|
245
261
|
$passphrase: String!
|
|
246
262
|
) {
|
|
247
263
|
agentGenerate(passphrase: $passphrase) {
|
|
248
|
-
${
|
|
264
|
+
${Ci}
|
|
249
265
|
}
|
|
250
|
-
}`,variables:{passphrase:e}}));return new
|
|
266
|
+
}`,variables:{passphrase:e}}));return new Ft(r)}async import(e){let{did:r,didDocument:n,keystore:i,passphrase:a}=e,{agentImport:o}=A(await le(this,me,"f").mutate({mutation:E`mutation agentImport(
|
|
251
267
|
$did: String!,
|
|
252
268
|
$didDocument: String!,
|
|
253
269
|
$keystore: String!,
|
|
254
270
|
$passphrase: String!
|
|
255
271
|
) {
|
|
256
272
|
agentImport(did: $did, didDocument: $didDocument, keystore: $keystore, passphrase: $passphrase) {
|
|
257
|
-
${
|
|
273
|
+
${Ci}
|
|
258
274
|
}
|
|
259
|
-
}`,variables:{did:r,didDocument:n,keystore:i,passphrase:a}}));return new
|
|
275
|
+
}`,variables:{did:r,didDocument:n,keystore:i,passphrase:a}}));return new Ft(o)}async lock(e){let{agentLock:r}=A(await le(this,me,"f").mutate({mutation:E`mutation agentLock($passphrase: String!) {
|
|
260
276
|
agentLock(passphrase: $passphrase) {
|
|
261
|
-
${
|
|
277
|
+
${Ci}
|
|
262
278
|
}
|
|
263
|
-
}`,variables:{passphrase:e}}));return new
|
|
279
|
+
}`,variables:{passphrase:e}}));return new Ft(r)}async unlock(e,r=!0){let{agentUnlock:n}=A(await le(this,me,"f").mutate({mutation:E`mutation agentUnlock($passphrase: String!, $holochain: Boolean!) {
|
|
264
280
|
agentUnlock(passphrase: $passphrase, holochain: $holochain) {
|
|
265
|
-
${
|
|
281
|
+
${Ci}
|
|
266
282
|
}
|
|
267
|
-
}`,variables:{passphrase:e,holochain:r}}));return new
|
|
283
|
+
}`,variables:{passphrase:e,holochain:r}}));return new Ft(n)}async byDID(e){let{agentByDID:r}=A(await le(this,me,"f").query({query:E`query agentByDID($did: String!) {
|
|
268
284
|
agentByDID(did: $did) {
|
|
269
|
-
${
|
|
285
|
+
${Ca}
|
|
270
286
|
}
|
|
271
|
-
}`,variables:{did:e}}));return r}async updatePublicPerspective(e){let r=JSON.parse(JSON.stringify(e));delete r.__typename,r.links.forEach(o=>{delete o.__typename,delete o.data.__typename,delete o.proof.__typename,delete o.status});let{agentUpdatePublicPerspective:n}=
|
|
287
|
+
}`,variables:{did:e}}));return r}async updatePublicPerspective(e){let r=JSON.parse(JSON.stringify(e));delete r.__typename,r.links.forEach(o=>{delete o.__typename,delete o.data.__typename,delete o.proof.__typename,delete o.status});let{agentUpdatePublicPerspective:n}=A(await le(this,me,"f").mutate({mutation:E`mutation agentUpdatePublicPerspective($perspective: PerspectiveInput!) {
|
|
272
288
|
agentUpdatePublicPerspective(perspective: $perspective) {
|
|
273
|
-
${
|
|
289
|
+
${Ca}
|
|
274
290
|
}
|
|
275
|
-
}`,variables:{perspective:r}})),i=n,a=new
|
|
291
|
+
}`,variables:{perspective:r}})),i=n,a=new Wr(i.did,i.perspective);return a.directMessageLanguage=i.directMessageLanguage,a}async mutatePublicPerspective(e){let r=new Xs(le(this,me,"f")),n=new ro(le(this,me,"f")),i=await r.add("Agent Perspective Proxy"),a=await n.me();a.perspective&&await i.loadSnapshot(a.perspective);for(let u of e.additions)await i.add(u);for(let u of e.removals)await i.remove(u);let o=await i.snapshot(),s=await this.updatePublicPerspective(o);return await r.remove(i.uuid),s}async updateDirectMessageLanguage(e){let{agentUpdateDirectMessageLanguage:r}=A(await le(this,me,"f").mutate({mutation:E`mutation agentUpdateDirectMessageLanguage($directMessageLanguage: String!) {
|
|
276
292
|
agentUpdateDirectMessageLanguage(directMessageLanguage: $directMessageLanguage) {
|
|
277
|
-
${
|
|
293
|
+
${Ca}
|
|
278
294
|
}
|
|
279
|
-
}`,variables:{directMessageLanguage:e}})),n=r,i=new
|
|
295
|
+
}`,variables:{directMessageLanguage:e}})),n=r,i=new Wr(n.did,n.perspective);return i.directMessageLanguage=n.directMessageLanguage,i}async addEntanglementProofs(e){let{agentAddEntanglementProofs:r}=A(await le(this,me,"f").mutate({mutation:E`mutation agentAddEntanglementProofs($proofs: [EntanglementProofInput!]!) {
|
|
280
296
|
agentAddEntanglementProofs(proofs: $proofs) {
|
|
281
|
-
${
|
|
297
|
+
${ys}
|
|
282
298
|
}
|
|
283
|
-
}`,variables:{proofs:e}}));return r}async deleteEntanglementProofs(e){let{agentDeleteEntanglementProofs:r}=
|
|
299
|
+
}`,variables:{proofs:e}}));return r}async deleteEntanglementProofs(e){let{agentDeleteEntanglementProofs:r}=A(await le(this,me,"f").mutate({mutation:E`mutation agentDeleteEntanglementProofs($proofs: [EntanglementProofInput!]!) {
|
|
284
300
|
agentDeleteEntanglementProofs(proofs: $proofs) {
|
|
285
|
-
${
|
|
301
|
+
${ys}
|
|
286
302
|
}
|
|
287
|
-
}`,variables:{proofs:e}}));return r}async getEntanglementProofs(){let{agentGetEntanglementProofs:e}=
|
|
303
|
+
}`,variables:{proofs:e}}));return r}async getEntanglementProofs(){let{agentGetEntanglementProofs:e}=A(await le(this,me,"f").query({query:E`query agentGetEntanglementProofs {
|
|
288
304
|
agentGetEntanglementProofs {
|
|
289
|
-
${
|
|
305
|
+
${ys}
|
|
290
306
|
}
|
|
291
|
-
}`}));return e}async entanglementProofPreFlight(e,r){let{agentEntanglementProofPreFlight:n}=
|
|
307
|
+
}`}));return e}async entanglementProofPreFlight(e,r){let{agentEntanglementProofPreFlight:n}=A(await le(this,me,"f").mutate({mutation:E`mutation agentEntanglementProofPreFlight($deviceKey: String!, $deviceKeyType: String!) {
|
|
292
308
|
agentEntanglementProofPreFlight(deviceKey: $deviceKey, deviceKeyType: $deviceKeyType) {
|
|
293
|
-
${
|
|
309
|
+
${ys}
|
|
294
310
|
}
|
|
295
|
-
}`,variables:{deviceKey:e,deviceKeyType:r}}));return n}addUpdatedListener(e){
|
|
296
|
-
agentUpdated { ${
|
|
311
|
+
}`,variables:{deviceKey:e,deviceKeyType:r}}));return n}addUpdatedListener(e){le(this,Fa,"f").push(e)}addAppChangedListener(e){le(this,La,"f").push(e)}subscribeAgentUpdated(){le(this,me,"f").subscribe({query:E` subscription {
|
|
312
|
+
agentUpdated { ${Ca} }
|
|
297
313
|
}
|
|
298
|
-
`}).subscribe({next:e=>{let r=e.data.agentUpdated;
|
|
314
|
+
`}).subscribe({next:e=>{let r=e.data.agentUpdated;le(this,Fa,"f").forEach(n=>{n(r)})},error:e=>console.error(e)})}subscribeAppsChanged(){le(this,me,"f").subscribe({query:E` subscription {
|
|
299
315
|
agentAppsChanged {
|
|
300
|
-
${
|
|
316
|
+
${gs}
|
|
301
317
|
}
|
|
302
318
|
}
|
|
303
|
-
`}).subscribe({next:e=>{
|
|
304
|
-
agentStatusChanged { ${
|
|
319
|
+
`}).subscribe({next:e=>{le(this,La,"f").forEach(r=>{r()})},error:e=>console.error(e)})}addAgentStatusChangedListener(e){le(this,Ma,"f").push(e)}subscribeAgentStatusChanged(){le(this,me,"f").subscribe({query:E` subscription {
|
|
320
|
+
agentStatusChanged { ${Ci} }
|
|
305
321
|
}
|
|
306
|
-
`}).subscribe({next:e=>{let r=e.data.agentStatusChanged;
|
|
322
|
+
`}).subscribe({next:e=>{let r=e.data.agentStatusChanged;le(this,Ma,"f").forEach(n=>{n(r)})},error:e=>console.error(e)})}async requestCapability(e){let{agentRequestCapability:r}=A(await le(this,me,"f").mutate({mutation:E`
|
|
307
323
|
mutation agentRequestCapability($authInfo: AuthInfoInput!) {
|
|
308
324
|
agentRequestCapability(authInfo: $authInfo)
|
|
309
325
|
}
|
|
310
|
-
`,variables:{authInfo:e}}));return r}async permitCapability(e){let{agentPermitCapability:r}=
|
|
326
|
+
`,variables:{authInfo:e}}));return r}async permitCapability(e){let{agentPermitCapability:r}=A(await le(this,me,"f").mutate({mutation:E`
|
|
311
327
|
mutation agentPermitCapability($auth: String!) {
|
|
312
328
|
agentPermitCapability(auth: $auth)
|
|
313
329
|
}
|
|
314
|
-
`,variables:{auth:e}}));return r}async generateJwt(e,r){let{agentGenerateJwt:n}=
|
|
330
|
+
`,variables:{auth:e}}));return r}async generateJwt(e,r){let{agentGenerateJwt:n}=A(await le(this,me,"f").mutate({mutation:E`
|
|
315
331
|
mutation agentGenerateJwt($requestId: String!, $rand: String!) {
|
|
316
332
|
agentGenerateJwt(requestId: $requestId, rand: $rand)
|
|
317
333
|
}
|
|
318
|
-
`,variables:{requestId:e,rand:r}}));return n}async getApps(){let{agentGetApps:e}=
|
|
334
|
+
`,variables:{requestId:e,rand:r}}));return n}async getApps(){let{agentGetApps:e}=A(await le(this,me,"f").mutate({mutation:E`query agentGetApps {
|
|
319
335
|
agentGetApps {
|
|
320
|
-
${
|
|
336
|
+
${gs}
|
|
321
337
|
}
|
|
322
|
-
}`}));return e}async removeApp(e){let{agentRemoveApp:r}=
|
|
338
|
+
}`}));return e}async removeApp(e){let{agentRemoveApp:r}=A(await le(this,me,"f").mutate({mutation:E`mutation agentRemoveApp($requestId: String!) {
|
|
323
339
|
agentRemoveApp(requestId: $requestId) {
|
|
324
|
-
${
|
|
340
|
+
${gs}
|
|
325
341
|
}
|
|
326
|
-
}`,variables:{requestId:e}}));return r}async revokeToken(e){let{agentRevokeToken:r}=
|
|
342
|
+
}`,variables:{requestId:e}}));return r}async revokeToken(e){let{agentRevokeToken:r}=A(await le(this,me,"f").mutate({mutation:E`mutation agentRevokeToken($requestId: String!) {
|
|
327
343
|
agentRevokeToken(requestId: $requestId) {
|
|
328
|
-
${
|
|
344
|
+
${gs}
|
|
329
345
|
}
|
|
330
|
-
}`,variables:{requestId:e}}));return r}async isLocked(){let{agentIsLocked:e}=
|
|
346
|
+
}`,variables:{requestId:e}}));return r}async isLocked(){let{agentIsLocked:e}=A(await le(this,me,"f").mutate({mutation:E`
|
|
331
347
|
query agentIsLocked {
|
|
332
348
|
agentIsLocked
|
|
333
349
|
}
|
|
334
|
-
`}));return e}async signMessage(e){let{agentSignMessage:r}=
|
|
350
|
+
`}));return e}async signMessage(e){let{agentSignMessage:r}=A(await le(this,me,"f").mutate({mutation:E`mutation agentSignMessage($message: String!) {
|
|
335
351
|
agentSignMessage(message: $message) {
|
|
336
|
-
${
|
|
352
|
+
${d0}
|
|
353
|
+
}
|
|
354
|
+
}`,variables:{message:e}}));return r}async createUser(e,r){let{runtimeCreateUser:n}=A(await le(this,me,"f").mutate({mutation:E`mutation runtimeCreateUser($email: String!, $password: String!) {
|
|
355
|
+
runtimeCreateUser(email: $email, password: $password) {
|
|
356
|
+
did
|
|
357
|
+
success
|
|
358
|
+
error
|
|
337
359
|
}
|
|
338
|
-
}`,variables:{
|
|
360
|
+
}`,variables:{email:e,password:r}}));return n}async loginUser(e,r){let{runtimeLoginUser:n}=A(await le(this,me,"f").mutate({mutation:E`mutation runtimeLoginUser($email: String!, $password: String!) {
|
|
361
|
+
runtimeLoginUser(email: $email, password: $password)
|
|
362
|
+
}`,variables:{email:e,password:r}}));return n}};me=new WeakMap,La=new WeakMap,Fa=new WeakMap,Ma=new WeakMap;var h0=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},qr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ht,Kd=`
|
|
339
363
|
name
|
|
340
364
|
address
|
|
341
365
|
settings
|
|
342
366
|
icon { code }
|
|
343
367
|
constructorIcon { code }
|
|
344
368
|
settingsIcon { code }
|
|
345
|
-
`,
|
|
369
|
+
`,Zd=`
|
|
346
370
|
name
|
|
347
371
|
address
|
|
348
372
|
description
|
|
@@ -352,45 +376,45 @@ neighbourhood {
|
|
|
352
376
|
templateAppliedParams
|
|
353
377
|
possibleTemplateParams
|
|
354
378
|
sourceCodeLink
|
|
355
|
-
`,
|
|
379
|
+
`,kl=class{constructor(e){Ht.set(this,void 0),h0(this,Ht,e,"f")}async byAddress(e){let{language:r}=A(await qr(this,Ht,"f").query({query:E`query byAddress($address: String!) {
|
|
356
380
|
language(address: $address) {
|
|
357
|
-
${
|
|
381
|
+
${Kd}
|
|
358
382
|
}
|
|
359
|
-
}`,variables:{address:e}}));return r}async byFilter(e){let{languages:r}=
|
|
383
|
+
}`,variables:{address:e}}));return r}async byFilter(e){let{languages:r}=A(await qr(this,Ht,"f").query({query:E`query byFilter($filter: String!) {
|
|
360
384
|
languages(filter: $filter) {
|
|
361
|
-
${
|
|
385
|
+
${Kd}
|
|
362
386
|
}
|
|
363
|
-
}`,variables:{filter:e}}));return r}async all(){return this.byFilter("")}async writeSettings(e,r){let{languageWriteSettings:n}=
|
|
387
|
+
}`,variables:{filter:e}}));return r}async all(){return this.byFilter("")}async writeSettings(e,r){let{languageWriteSettings:n}=A(await qr(this,Ht,"f").mutate({mutation:E`mutation writeSettings($languageAddress: String!, $settings: String!) {
|
|
364
388
|
languageWriteSettings(languageAddress: $languageAddress, settings: $settings)
|
|
365
|
-
}`,variables:{languageAddress:e,settings:r}}));return n}async applyTemplateAndPublish(e,r){let{languageApplyTemplateAndPublish:n}=
|
|
389
|
+
}`,variables:{languageAddress:e,settings:r}}));return n}async applyTemplateAndPublish(e,r){let{languageApplyTemplateAndPublish:n}=A(await qr(this,Ht,"f").mutate({mutation:E`mutation languageApplyTemplateAndPublish(
|
|
366
390
|
$sourceLanguageHash: String!,
|
|
367
391
|
$templateData: String!,
|
|
368
392
|
) {
|
|
369
393
|
languageApplyTemplateAndPublish(sourceLanguageHash: $sourceLanguageHash, templateData: $templateData) {
|
|
370
394
|
name, address
|
|
371
395
|
}
|
|
372
|
-
}`,variables:{sourceLanguageHash:e,templateData:r}}));return n}async publish(e,r){let{languagePublish:n}=
|
|
396
|
+
}`,variables:{sourceLanguageHash:e,templateData:r}}));return n}async publish(e,r){let{languagePublish:n}=A(await qr(this,Ht,"f").mutate({mutation:E`mutation languagePublish(
|
|
373
397
|
$languagePath: String!,
|
|
374
398
|
$languageMeta: LanguageMetaInput!,
|
|
375
399
|
) {
|
|
376
400
|
languagePublish(languagePath: $languagePath, languageMeta: $languageMeta) {
|
|
377
|
-
${
|
|
401
|
+
${Zd}
|
|
378
402
|
}
|
|
379
|
-
}`,variables:{languagePath:e,languageMeta:r}}));return n}async meta(e){let{languageMeta:r}=
|
|
403
|
+
}`,variables:{languagePath:e,languageMeta:r}}));return n}async meta(e){let{languageMeta:r}=A(await qr(this,Ht,"f").query({query:E`query languageMeta(
|
|
380
404
|
$address: String!,
|
|
381
405
|
) {
|
|
382
406
|
languageMeta(address: $address) {
|
|
383
|
-
${
|
|
407
|
+
${Zd}
|
|
384
408
|
}
|
|
385
|
-
}`,variables:{address:e}}));return r}async source(e){let{languageSource:r}=
|
|
409
|
+
}`,variables:{address:e}}));return r}async source(e){let{languageSource:r}=A(await qr(this,Ht,"f").query({query:E`query languageSource(
|
|
386
410
|
$address: String!,
|
|
387
411
|
) {
|
|
388
412
|
languageSource(address: $address)
|
|
389
|
-
}`,variables:{address:e}}));return r}async remove(e){let{languageRemove:r}=
|
|
413
|
+
}`,variables:{address:e}}));return r}async remove(e){let{languageRemove:r}=A(await qr(this,Ht,"f").mutate({mutation:E`mutation languageRemove(
|
|
390
414
|
$address: String!,
|
|
391
415
|
) {
|
|
392
416
|
languageRemove(address: $address)
|
|
393
|
-
}`,variables:{address:e}}));return r}};
|
|
417
|
+
}`,variables:{address:e}}));return r}};Ht=new WeakMap;var m0=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},at=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ft,Oi,Al=class{constructor(e){ft.set(this,void 0),Oi.set(this,new Map),m0(this,ft,e,"f")}async publishFromPerspective(e,r,n){let{neighbourhoodPublishFromPerspective:i}=A(await at(this,ft,"f").mutate({mutation:E`mutation neighbourhoodPublishFromPerspective(
|
|
394
418
|
$linkLanguage: String!,
|
|
395
419
|
$meta: PerspectiveInput!,
|
|
396
420
|
$perspectiveUUID: String!
|
|
@@ -400,7 +424,7 @@ neighbourhood {
|
|
|
400
424
|
meta: $meta,
|
|
401
425
|
perspectiveUUID: $perspectiveUUID
|
|
402
426
|
)
|
|
403
|
-
}`,variables:{perspectiveUUID:e,linkLanguage:r,meta:n}}));return i}async joinFromUrl(e){let{neighbourhoodJoinFromUrl:r}=
|
|
427
|
+
}`,variables:{perspectiveUUID:e,linkLanguage:r,meta:n}}));return i}async joinFromUrl(e){let{neighbourhoodJoinFromUrl:r}=A(await at(this,ft,"f").mutate({mutation:E`mutation neighbourhoodJoinFromUrl($url: String!) {
|
|
404
428
|
neighbourhoodJoinFromUrl(url: $url) {
|
|
405
429
|
uuid
|
|
406
430
|
name
|
|
@@ -422,11 +446,11 @@ neighbourhood {
|
|
|
422
446
|
author
|
|
423
447
|
}
|
|
424
448
|
}
|
|
425
|
-
}`,variables:{url:e}}));return r}async otherAgents(e){let{neighbourhoodOtherAgents:r}=
|
|
449
|
+
}`,variables:{url:e}}));return r}async otherAgents(e){let{neighbourhoodOtherAgents:r}=A(await at(this,ft,"f").query({query:E`query neighbourhoodOtherAgents($perspectiveUUID: String!) {
|
|
426
450
|
neighbourhoodOtherAgents(perspectiveUUID: $perspectiveUUID)
|
|
427
|
-
}`,variables:{perspectiveUUID:e}}));return r}async hasTelepresenceAdapter(e){let{neighbourhoodHasTelepresenceAdapter:r}=
|
|
451
|
+
}`,variables:{perspectiveUUID:e}}));return r}async hasTelepresenceAdapter(e){let{neighbourhoodHasTelepresenceAdapter:r}=A(await at(this,ft,"f").query({query:E`query neighbourhoodHasTelepresenceAdapter($perspectiveUUID: String!) {
|
|
428
452
|
neighbourhoodHasTelepresenceAdapter(perspectiveUUID: $perspectiveUUID)
|
|
429
|
-
}`,variables:{perspectiveUUID:e}}));return r}async onlineAgents(e){let{neighbourhoodOnlineAgents:r}=
|
|
453
|
+
}`,variables:{perspectiveUUID:e}}));return r}async onlineAgents(e){let{neighbourhoodOnlineAgents:r}=A(await at(this,ft,"f").query({query:E`query neighbourhoodOnlineAgents($perspectiveUUID: String!) {
|
|
430
454
|
neighbourhoodOnlineAgents(perspectiveUUID: $perspectiveUUID) {
|
|
431
455
|
did
|
|
432
456
|
status {
|
|
@@ -443,7 +467,7 @@ neighbourhood {
|
|
|
443
467
|
proof { valid, invalid, signature, key }
|
|
444
468
|
}
|
|
445
469
|
}
|
|
446
|
-
}`,variables:{perspectiveUUID:e}}));return r}async setOnlineStatus(e,r){let{neighbourhoodSetOnlineStatus:n}=
|
|
470
|
+
}`,variables:{perspectiveUUID:e}}));return r}async setOnlineStatus(e,r){let{neighbourhoodSetOnlineStatus:n}=A(await at(this,ft,"f").mutate({mutation:E`mutation neighbourhoodSetOnlineStatus(
|
|
447
471
|
$perspectiveUUID: String!,
|
|
448
472
|
$status: PerspectiveInput!
|
|
449
473
|
) {
|
|
@@ -451,7 +475,7 @@ neighbourhood {
|
|
|
451
475
|
perspectiveUUID: $perspectiveUUID,
|
|
452
476
|
status: $status
|
|
453
477
|
)
|
|
454
|
-
}`,variables:{perspectiveUUID:e,status:r}}));return n}async setOnlineStatusU(e,r){let{neighbourhoodSetOnlineStatusU:n}=
|
|
478
|
+
}`,variables:{perspectiveUUID:e,status:r}}));return n}async setOnlineStatusU(e,r){let{neighbourhoodSetOnlineStatusU:n}=A(await at(this,ft,"f").mutate({mutation:E`mutation neighbourhoodSetOnlineStatusU(
|
|
455
479
|
$perspectiveUUID: String!,
|
|
456
480
|
$status: PerspectiveUnsignedInput!
|
|
457
481
|
) {
|
|
@@ -459,7 +483,7 @@ neighbourhood {
|
|
|
459
483
|
perspectiveUUID: $perspectiveUUID,
|
|
460
484
|
status: $status
|
|
461
485
|
)
|
|
462
|
-
}`,variables:{perspectiveUUID:e,status:r}}));return n}async sendSignal(e,r,n){let{neighbourhoodSendSignal:i}=
|
|
486
|
+
}`,variables:{perspectiveUUID:e,status:r}}));return n}async sendSignal(e,r,n){let{neighbourhoodSendSignal:i}=A(await at(this,ft,"f").mutate({mutation:E`mutation neighbourhoodSendSignal(
|
|
463
487
|
$perspectiveUUID: String!,
|
|
464
488
|
$remoteAgentDid: String!,
|
|
465
489
|
$payload: PerspectiveInput!
|
|
@@ -469,7 +493,7 @@ neighbourhood {
|
|
|
469
493
|
remoteAgentDid: $remoteAgentDid,
|
|
470
494
|
payload: $payload
|
|
471
495
|
)
|
|
472
|
-
}`,variables:{perspectiveUUID:e,remoteAgentDid:r,payload:n}}));return i}async sendSignalU(e,r,n){let{neighbourhoodSendSignalU:i}=
|
|
496
|
+
}`,variables:{perspectiveUUID:e,remoteAgentDid:r,payload:n}}));return i}async sendSignalU(e,r,n){let{neighbourhoodSendSignalU:i}=A(await at(this,ft,"f").mutate({mutation:E`mutation neighbourhoodSendSignalU(
|
|
473
497
|
$perspectiveUUID: String!,
|
|
474
498
|
$remoteAgentDid: String!,
|
|
475
499
|
$payload: PerspectiveUnsignedInput!
|
|
@@ -479,23 +503,27 @@ neighbourhood {
|
|
|
479
503
|
remoteAgentDid: $remoteAgentDid,
|
|
480
504
|
payload: $payload
|
|
481
505
|
)
|
|
482
|
-
}`,variables:{perspectiveUUID:e,remoteAgentDid:r,payload:n}}));return i}async sendBroadcast(e,r){let{neighbourhoodSendBroadcast:
|
|
506
|
+
}`,variables:{perspectiveUUID:e,remoteAgentDid:r,payload:n}}));return i}async sendBroadcast(e,r,n=!1){let{neighbourhoodSendBroadcast:i}=A(await at(this,ft,"f").mutate({mutation:E`mutation neighbourhoodSendBroadcast(
|
|
483
507
|
$perspectiveUUID: String!,
|
|
484
|
-
$payload: PerspectiveInput
|
|
508
|
+
$payload: PerspectiveInput!,
|
|
509
|
+
$loopback: Boolean
|
|
485
510
|
) {
|
|
486
511
|
neighbourhoodSendBroadcast(
|
|
487
512
|
perspectiveUUID: $perspectiveUUID,
|
|
488
|
-
payload: $payload
|
|
513
|
+
payload: $payload,
|
|
514
|
+
loopback: $loopback
|
|
489
515
|
)
|
|
490
|
-
}`,variables:{perspectiveUUID:e,payload:r}}));return
|
|
516
|
+
}`,variables:{perspectiveUUID:e,payload:r,loopback:n}}));return i}async sendBroadcastU(e,r,n=!1){let{neighbourhoodSendBroadcastU:i}=A(await at(this,ft,"f").mutate({mutation:E`mutation neighbourhoodSendBroadcastU(
|
|
491
517
|
$perspectiveUUID: String!,
|
|
492
|
-
$payload: PerspectiveUnsignedInput
|
|
518
|
+
$payload: PerspectiveUnsignedInput!,
|
|
519
|
+
$loopback: Boolean
|
|
493
520
|
) {
|
|
494
521
|
neighbourhoodSendBroadcastU(
|
|
495
522
|
perspectiveUUID: $perspectiveUUID,
|
|
496
|
-
payload: $payload
|
|
523
|
+
payload: $payload,
|
|
524
|
+
loopback: $loopback
|
|
497
525
|
)
|
|
498
|
-
}`,variables:{perspectiveUUID:e,payload:r}}));return
|
|
526
|
+
}`,variables:{perspectiveUUID:e,payload:r,loopback:n}}));return i}dispatchSignal(e,r){let n=at(this,Oi,"f").get(e);n&&n.forEach(i=>i(r))}async subscribeToSignals(e){let r=this;await at(this,ft,"f").subscribe({query:E`subscription neighbourhoodSignal($perspectiveUUID: String!) {
|
|
499
527
|
neighbourhoodSignal(perspectiveUUID: $perspectiveUUID) {
|
|
500
528
|
author
|
|
501
529
|
timestamp
|
|
@@ -510,7 +538,7 @@ neighbourhood {
|
|
|
510
538
|
}
|
|
511
539
|
proof { valid, invalid, signature, key }
|
|
512
540
|
}
|
|
513
|
-
}`,variables:{perspectiveUUID:e}}).subscribe({next:n=>{let{neighbourhoodSignal:i}=
|
|
541
|
+
}`,variables:{perspectiveUUID:e}}).subscribe({next:n=>{let{neighbourhoodSignal:i}=A(n);r.dispatchSignal(e,i)}})}async addSignalHandler(e,r){let n=at(this,Oi,"f").get(e);n||(n=[],at(this,Oi,"f").set(e,n),await this.subscribeToSignals(e)),n.push(r)}removeSignalHandler(e,r){let n=at(this,Oi,"f").get(e);if(n){let i=n.indexOf(r);i>-1&&n.splice(i,1)}}};ft=new WeakMap,Oi=new WeakMap;var vs=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},K=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},J,Ua,ja,Ba,m1,bs=`
|
|
514
542
|
author
|
|
515
543
|
timestamp
|
|
516
544
|
data {
|
|
@@ -522,7 +550,7 @@ data {
|
|
|
522
550
|
}
|
|
523
551
|
}
|
|
524
552
|
proof { valid, invalid, signature, key }
|
|
525
|
-
`,
|
|
553
|
+
`,g0=`
|
|
526
554
|
description
|
|
527
555
|
appName
|
|
528
556
|
appUrl
|
|
@@ -531,85 +559,120 @@ trigger
|
|
|
531
559
|
perspectiveIds
|
|
532
560
|
webhookUrl
|
|
533
561
|
webhookAuth
|
|
534
|
-
`,
|
|
562
|
+
`,g1=`
|
|
535
563
|
id
|
|
536
564
|
granted
|
|
537
|
-
${
|
|
538
|
-
`,
|
|
539
|
-
notification { ${
|
|
565
|
+
${g0}
|
|
566
|
+
`,y0=`
|
|
567
|
+
notification { ${g1} }
|
|
540
568
|
perspectiveId
|
|
541
569
|
triggerMatch
|
|
542
|
-
`,
|
|
570
|
+
`,Il=class{constructor(e,r=!0){J.set(this,void 0),Ua.set(this,void 0),ja.set(this,void 0),Ba.set(this,void 0),m1.set(this,void 0),vs(this,J,e,"f"),vs(this,Ua,[],"f"),vs(this,ja,[],"f"),vs(this,Ba,[],"f"),r&&(this.subscribeMessageReceived(),this.subscribeExceptionOccurred(),this.subscribeNotificationTriggered())}async info(){let{runtimeInfo:e}=A(await K(this,J,"f").query({query:E`query runtimeInfo {
|
|
543
571
|
runtimeInfo {
|
|
544
572
|
ad4mExecutorVersion,
|
|
545
573
|
isInitialized,
|
|
546
574
|
isUnlocked
|
|
547
575
|
}
|
|
548
|
-
}`}));return e}async quit(){return
|
|
576
|
+
}`}));return e}async quit(){return A(await K(this,J,"f").mutate({mutation:E`mutation runtimeQuit { runtimeQuit }`})).runtimeQuit}async openLink(e){let{runtimeOpenLink:r}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeOpenLink($url: String!) {
|
|
549
577
|
runtimeOpenLink(url: $url)
|
|
550
|
-
}`,variables:{url:e}}));return r}async addTrustedAgents(e){let{addTrustedAgents:r}=
|
|
578
|
+
}`,variables:{url:e}}));return r}async addTrustedAgents(e){let{addTrustedAgents:r}=A(await K(this,J,"f").mutate({mutation:E`mutation addTrustedAgents($agents: [String!]!) {
|
|
551
579
|
addTrustedAgents(agents: $agents)
|
|
552
|
-
}`,variables:{agents:e}}));return r}async deleteTrustedAgents(e){let{deleteTrustedAgents:r}=
|
|
580
|
+
}`,variables:{agents:e}}));return r}async deleteTrustedAgents(e){let{deleteTrustedAgents:r}=A(await K(this,J,"f").mutate({mutation:E`mutation deleteTrustedAgents($agents: [String!]!) {
|
|
553
581
|
deleteTrustedAgents(agents: $agents)
|
|
554
|
-
}`,variables:{agents:e}}));return r}async getTrustedAgents(){let{getTrustedAgents:e}=
|
|
582
|
+
}`,variables:{agents:e}}));return r}async getTrustedAgents(){let{getTrustedAgents:e}=A(await K(this,J,"f").query({query:E`query getTrustedAgents {
|
|
555
583
|
getTrustedAgents
|
|
556
|
-
}`}));return e}async addKnownLinkLanguageTemplates(e){let{runtimeAddKnownLinkLanguageTemplates:r}=
|
|
584
|
+
}`}));return e}async addKnownLinkLanguageTemplates(e){let{runtimeAddKnownLinkLanguageTemplates:r}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeAddKnownLinkLanguageTemplates($addresses: [String!]!) {
|
|
557
585
|
runtimeAddKnownLinkLanguageTemplates(addresses: $addresses)
|
|
558
|
-
}`,variables:{addresses:e}}));return r}async removeKnownLinkLanguageTemplates(e){let{runtimeRemoveKnownLinkLanguageTemplates:r}=
|
|
586
|
+
}`,variables:{addresses:e}}));return r}async removeKnownLinkLanguageTemplates(e){let{runtimeRemoveKnownLinkLanguageTemplates:r}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeRemoveKnownLinkLanguageTemplates($addresses: [String!]!) {
|
|
559
587
|
runtimeRemoveKnownLinkLanguageTemplates(addresses: $addresses)
|
|
560
|
-
}`,variables:{addresses:e}}));return r}async knownLinkLanguageTemplates(){let{runtimeKnownLinkLanguageTemplates:e}=
|
|
588
|
+
}`,variables:{addresses:e}}));return r}async knownLinkLanguageTemplates(){let{runtimeKnownLinkLanguageTemplates:e}=A(await K(this,J,"f").query({query:E`query runtimeKnownLinkLanguageTemplates {
|
|
561
589
|
runtimeKnownLinkLanguageTemplates
|
|
562
|
-
}`}));return e}async addFriends(e){let{runtimeAddFriends:r}=
|
|
590
|
+
}`}));return e}async addFriends(e){let{runtimeAddFriends:r}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeAddFriends($dids: [String!]!) {
|
|
563
591
|
runtimeAddFriends(dids: $dids)
|
|
564
|
-
}`,variables:{dids:e}}));return r}async removeFriends(e){let{runtimeRemoveFriends:r}=
|
|
592
|
+
}`,variables:{dids:e}}));return r}async removeFriends(e){let{runtimeRemoveFriends:r}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeRemoveFriends($dids: [String!]!) {
|
|
565
593
|
runtimeRemoveFriends(dids: $dids)
|
|
566
|
-
}`,variables:{dids:e}}));return r}async friends(){let{runtimeFriends:e}=
|
|
594
|
+
}`,variables:{dids:e}}));return r}async friends(){let{runtimeFriends:e}=A(await K(this,J,"f").query({query:E`query runtimeFriends {
|
|
567
595
|
runtimeFriends
|
|
568
|
-
}`}));return e}async hcAgentInfos(){let{runtimeHcAgentInfos:e}=
|
|
596
|
+
}`}));return e}async hcAgentInfos(){let{runtimeHcAgentInfos:e}=A(await K(this,J,"f").query({query:E`query runtimeHcAgentInfos {
|
|
569
597
|
runtimeHcAgentInfos
|
|
570
|
-
}`}));return e}async
|
|
598
|
+
}`}));return e}async getNetworkMetrics(){let{runtimeGetNetworkMetrics:e}=A(await K(this,J,"f").query({query:E`query runtimeGetNetworkMetrics {
|
|
599
|
+
runtimeGetNetworkMetrics
|
|
600
|
+
}`}));return e}async restartHolochain(){let{runtimeRestartHolochain:e}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeRestartHolochain {
|
|
601
|
+
runtimeRestartHolochain
|
|
602
|
+
}`}));return e}async hcAddAgentInfos(e){let{runtimeHcAddAgentInfos:r}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeHcAddAgentInfos($agentInfos: String!) {
|
|
571
603
|
runtimeHcAddAgentInfos(agentInfos: $agentInfos)
|
|
572
|
-
}`,variables:{agentInfos:e}}));return r}async verifyStringSignedByDid(e,r,n,i){let{runtimeVerifyStringSignedByDid:a}=
|
|
604
|
+
}`,variables:{agentInfos:e}}));return r}async verifyStringSignedByDid(e,r,n,i){let{runtimeVerifyStringSignedByDid:a}=A(await K(this,J,"f").mutate({mutation:E`query runtimeVerifyStringSignedByDid($did: String!, $didSigningKeyId: String!, $data: String!, $signedData: String!) {
|
|
573
605
|
runtimeVerifyStringSignedByDid(did: $did, didSigningKeyId: $didSigningKeyId, data: $data, signedData: $signedData)
|
|
574
|
-
}`,variables:{did:e,didSigningKeyId:r,data:n,signedData:i}}));return a}async setStatus(e){let{runtimeSetStatus:r}=
|
|
606
|
+
}`,variables:{did:e,didSigningKeyId:r,data:n,signedData:i}}));return a}async setStatus(e){let{runtimeSetStatus:r}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeSetStatus($status: PerspectiveInput!) {
|
|
575
607
|
runtimeSetStatus(status: $status)
|
|
576
|
-
}`,variables:{status:e}}));return r}async friendStatus(e){let{runtimeFriendStatus:r}=
|
|
577
|
-
runtimeFriendStatus(did: $did) { ${
|
|
578
|
-
}`,variables:{did:e}}));return r}async friendSendMessage(e,r){let{runtimeFriendSendMessage:n}=
|
|
608
|
+
}`,variables:{status:e}}));return r}async friendStatus(e){let{runtimeFriendStatus:r}=A(await K(this,J,"f").query({query:E`query runtimeFriendStatus($did: String!) {
|
|
609
|
+
runtimeFriendStatus(did: $did) { ${bs} }
|
|
610
|
+
}`,variables:{did:e}}));return r}async friendSendMessage(e,r){let{runtimeFriendSendMessage:n}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeFriendSendMessage($did: String!, $message: PerspectiveInput!) {
|
|
579
611
|
runtimeFriendSendMessage(did: $did, message: $message)
|
|
580
|
-
}`,variables:{did:e,message:r}}));return n}async messageInbox(e){let{runtimeMessageInbox:r}=
|
|
581
|
-
runtimeMessageInbox(filter: $filter) { ${
|
|
582
|
-
}`,variables:{filter:e}}));return r}async messageOutbox(e){let{runtimeMessageOutbox:r}=
|
|
612
|
+
}`,variables:{did:e,message:r}}));return n}async messageInbox(e){let{runtimeMessageInbox:r}=A(await K(this,J,"f").query({query:E`query runtimeMessageInbox($filter: String) {
|
|
613
|
+
runtimeMessageInbox(filter: $filter) { ${bs} }
|
|
614
|
+
}`,variables:{filter:e}}));return r}async messageOutbox(e){let{runtimeMessageOutbox:r}=A(await K(this,J,"f").query({query:E`query runtimeMessageOutbox($filter: String) {
|
|
583
615
|
runtimeMessageOutbox(filter: $filter) {
|
|
584
616
|
recipient,
|
|
585
617
|
message {
|
|
586
|
-
${
|
|
618
|
+
${bs}
|
|
587
619
|
}
|
|
588
620
|
}
|
|
589
|
-
}`,variables:{filter:e}}));return r}async requestInstallNotification(e){let{runtimeRequestInstallNotification:r}=
|
|
621
|
+
}`,variables:{filter:e}}));return r}async requestInstallNotification(e){let{runtimeRequestInstallNotification:r}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeRequestInstallNotification($notification: NotificationInput!) {
|
|
590
622
|
runtimeRequestInstallNotification(notification: $notification)
|
|
591
|
-
}`,variables:{notification:e}}));return r}async grantNotification(e){let{runtimeGrantNotification:r}=
|
|
623
|
+
}`,variables:{notification:e}}));return r}async grantNotification(e){let{runtimeGrantNotification:r}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeGrantNotification($id: String!) {
|
|
592
624
|
runtimeGrantNotification(id: $id)
|
|
593
|
-
}`,variables:{id:e}}));return r}async
|
|
594
|
-
|
|
595
|
-
}
|
|
625
|
+
}`,variables:{id:e}}));return r}async exportDb(e){let{runtimeExportDb:r}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeExportDb($filePath: String!) {
|
|
626
|
+
runtimeExportDb(filePath: $filePath)
|
|
627
|
+
}`,variables:{filePath:e}}));return r}async importDb(e){let{runtimeImportDb:r}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeImportDb($filePath: String!) {
|
|
628
|
+
runtimeImportDb(filePath: $filePath) {
|
|
629
|
+
perspectives { total imported failed omitted errors }
|
|
630
|
+
links { total imported failed omitted errors }
|
|
631
|
+
expressions { total imported failed omitted errors }
|
|
632
|
+
perspectiveDiffs { total imported failed omitted errors }
|
|
633
|
+
notifications { total imported failed omitted errors }
|
|
634
|
+
models { total imported failed omitted errors }
|
|
635
|
+
defaultModels { total imported failed omitted errors }
|
|
636
|
+
tasks { total imported failed omitted errors }
|
|
637
|
+
friends { total imported failed omitted errors }
|
|
638
|
+
trustedAgents { total imported failed omitted errors }
|
|
639
|
+
knownLinkLanguages { total imported failed omitted errors }
|
|
640
|
+
}
|
|
641
|
+
}`,variables:{filePath:e}}));return r}async notifications(){let{runtimeNotifications:e}=A(await K(this,J,"f").query({query:E`query runtimeNotifications {
|
|
642
|
+
runtimeNotifications { ${g1} }
|
|
643
|
+
}`}));return e}async updateNotification(e,r){let{runtimeUpdateNotification:n}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeUpdateNotification($id: String!, $notification: NotificationInput!) {
|
|
596
644
|
runtimeUpdateNotification(id: $id, notification: $notification)
|
|
597
|
-
}`,variables:{id:e,notification:r}}));return n}async removeNotification(e){let{runtimeRemoveNotification:r}=
|
|
645
|
+
}`,variables:{id:e,notification:r}}));return n}async removeNotification(e){let{runtimeRemoveNotification:r}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeRemoveNotification($id: String!) {
|
|
598
646
|
runtimeRemoveNotification(id: $id)
|
|
599
|
-
}`,variables:{id:e}}));return r}
|
|
600
|
-
|
|
647
|
+
}`,variables:{id:e}}));return r}async exportPerspective(e,r){let{runtimeExportPerspective:n}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeExportPerspective($perspectiveUuid: String!, $filePath: String!) {
|
|
648
|
+
runtimeExportPerspective(perspectiveUuid: $perspectiveUuid, filePath: $filePath)
|
|
649
|
+
}`,variables:{perspectiveUuid:e,filePath:r}}));return n}async importPerspective(e){let{runtimeImportPerspective:r}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeImportPerspective($filePath: String!) {
|
|
650
|
+
runtimeImportPerspective(filePath: $filePath)
|
|
651
|
+
}`,variables:{filePath:e}}));return r}async multiUserEnabled(){let{runtimeMultiUserEnabled:e}=A(await K(this,J,"f").query({query:E`query runtimeMultiUserEnabled {
|
|
652
|
+
runtimeMultiUserEnabled
|
|
653
|
+
}`}));return e}async setMultiUserEnabled(e){let{runtimeSetMultiUserEnabled:r}=A(await K(this,J,"f").mutate({mutation:E`mutation runtimeSetMultiUserEnabled($enabled: Boolean!) {
|
|
654
|
+
runtimeSetMultiUserEnabled(enabled: $enabled)
|
|
655
|
+
}`,variables:{enabled:e}}));return r}async listUsers(){let{runtimeListUsers:e}=A(await K(this,J,"f").query({query:E`query runtimeListUsers {
|
|
656
|
+
runtimeListUsers {
|
|
657
|
+
email
|
|
658
|
+
did
|
|
659
|
+
lastSeen
|
|
660
|
+
perspectiveCount
|
|
661
|
+
}
|
|
662
|
+
}`}));return e}addNotificationTriggeredCallback(e){K(this,Ba,"f").push(e)}subscribeNotificationTriggered(){K(this,J,"f").subscribe({query:E` subscription {
|
|
663
|
+
runtimeNotificationTriggered { ${y0} }
|
|
601
664
|
}
|
|
602
|
-
`}).subscribe({next:e=>{
|
|
603
|
-
runtimeMessageReceived { ${
|
|
665
|
+
`}).subscribe({next:e=>{K(this,Ba,"f").forEach(r=>{r(e.data.runtimeNotificationTriggered)})},error:e=>console.error(e)})}addMessageCallback(e){K(this,Ua,"f").push(e)}subscribeMessageReceived(){K(this,J,"f").subscribe({query:E` subscription {
|
|
666
|
+
runtimeMessageReceived { ${bs} }
|
|
604
667
|
}
|
|
605
|
-
`}).subscribe({next:e=>{
|
|
668
|
+
`}).subscribe({next:e=>{K(this,Ua,"f").forEach(r=>{r(e.data.runtimeMessageReceived)})},error:e=>console.error(e)})}addExceptionCallback(e){K(this,ja,"f").push(e)}subscribeExceptionOccurred(){K(this,J,"f").subscribe({query:E` subscription {
|
|
606
669
|
exceptionOccurred {
|
|
607
670
|
title
|
|
608
671
|
message
|
|
609
672
|
type
|
|
610
673
|
addon
|
|
611
674
|
}
|
|
612
|
-
}`}).subscribe({next:e=>{
|
|
675
|
+
}`}).subscribe({next:e=>{K(this,ja,"f").forEach(r=>{r(e.data.exceptionOccurred)})},error:e=>console.error(e)})}};J=new WeakMap,Ua=new WeakMap,ja=new WeakMap,Ba=new WeakMap,m1=new WeakMap;var v0=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},xi=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},_r,Tl=class{constructor(e){_r.set(this,void 0),v0(this,_r,e,"f")}async get(e,r=!1){if(!r)try{let i=It.fromUrl(e).get();if(typeof i=="object"&&i!==null&&"author"in i&&"timestamp"in i&&"data"in i&&"proof"in i)return i}catch{}let{expression:n}=A(await xi(this,_r,"f").query({query:E`query expression($url: String!) {
|
|
613
676
|
expression(url: $url) {
|
|
614
677
|
author
|
|
615
678
|
timestamp
|
|
@@ -622,7 +685,7 @@ triggerMatch
|
|
|
622
685
|
invalid
|
|
623
686
|
}
|
|
624
687
|
}
|
|
625
|
-
}`,variables:{url:e}}));return n}async getMany(e){let{expressionMany:r}=
|
|
688
|
+
}`,variables:{url:e}}));return n}async getMany(e){let{expressionMany:r}=A(await xi(this,_r,"f").query({query:E`query expressionMany($urls: [String!]!) {
|
|
626
689
|
expressionMany(urls: $urls) {
|
|
627
690
|
author
|
|
628
691
|
timestamp
|
|
@@ -635,19 +698,19 @@ triggerMatch
|
|
|
635
698
|
invalid
|
|
636
699
|
}
|
|
637
700
|
}
|
|
638
|
-
}`,variables:{urls:e}}));return r}async getRaw(e){let{expressionRaw:r}=
|
|
701
|
+
}`,variables:{urls:e}}));return r}async getRaw(e){let{expressionRaw:r}=A(await xi(this,_r,"f").query({query:E`query expressionRaw($url: String!) {
|
|
639
702
|
expressionRaw(url: $url)
|
|
640
|
-
}`,variables:{url:e}}));return r}async create(e,r){e=JSON.stringify(e);let{expressionCreate:n}=
|
|
703
|
+
}`,variables:{url:e}}));return r}async create(e,r){e=JSON.stringify(e);let{expressionCreate:n}=A(await xi(this,_r,"f").mutate({mutation:E`mutation expressionCreate($content: String!, $languageAddress: String!){
|
|
641
704
|
expressionCreate(content: $content, languageAddress: $languageAddress)
|
|
642
|
-
}`,variables:{content:e,languageAddress:r}}));return n}async interactions(e){let{expressionInteractions:r}=
|
|
705
|
+
}`,variables:{content:e,languageAddress:r}}));return n}async interactions(e){let{expressionInteractions:r}=A(await xi(this,_r,"f").query({query:E`query expressionInteractions($url: String!) {
|
|
643
706
|
expressionInteractions(url: $url) {
|
|
644
707
|
label
|
|
645
708
|
name
|
|
646
709
|
parameters { name, type }
|
|
647
710
|
}
|
|
648
|
-
}`,variables:{url:e}}));return r}async interact(e,r){let{expressionInteract:n}=
|
|
711
|
+
}`,variables:{url:e}}));return r}async interact(e,r){let{expressionInteract:n}=A(await xi(this,_r,"f").mutate({mutation:E`mutation expressionInteract($url: String!, $interactionCall: InteractionCall!){
|
|
649
712
|
expressionInteract(url: $url, interactionCall: $interactionCall)
|
|
650
|
-
}`,variables:{url:e,interactionCall:r}}));return n}};or=new WeakMap;var Ts={};Ts.byteLength=Ey;Ts.toByteArray=xy;Ts.fromByteArray=Ay;var Qt=[],Et=[],Sy=typeof Uint8Array<"u"?Uint8Array:Array,mu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(sn=0,ud=mu.length;sn<ud;++sn)Qt[sn]=mu[sn],Et[mu.charCodeAt(sn)]=sn;var sn,ud;Et["-".charCodeAt(0)]=62;Et["_".charCodeAt(0)]=63;function Sh(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function Ey(t){var e=Sh(t),r=e[0],n=e[1];return(r+n)*3/4-n}function Cy(t,e,r){return(e+r)*3/4-r}function xy(t){var e,r=Sh(t),n=r[0],i=r[1],a=new Sy(Cy(t,n,i)),o=0,s=i>0?n-4:n,u;for(u=0;u<s;u+=4)e=Et[t.charCodeAt(u)]<<18|Et[t.charCodeAt(u+1)]<<12|Et[t.charCodeAt(u+2)]<<6|Et[t.charCodeAt(u+3)],a[o++]=e>>16&255,a[o++]=e>>8&255,a[o++]=e&255;return i===2&&(e=Et[t.charCodeAt(u)]<<2|Et[t.charCodeAt(u+1)]>>4,a[o++]=e&255),i===1&&(e=Et[t.charCodeAt(u)]<<10|Et[t.charCodeAt(u+1)]<<4|Et[t.charCodeAt(u+2)]>>2,a[o++]=e>>8&255,a[o++]=e&255),a}function ky(t){return Qt[t>>18&63]+Qt[t>>12&63]+Qt[t>>6&63]+Qt[t&63]}function Ty(t,e,r){for(var n,i=[],a=e;a<r;a+=3)n=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(t[a+2]&255),i.push(ky(n));return i.join("")}function Ay(t){for(var e,r=t.length,n=r%3,i=[],a=16383,o=0,s=r-n;o<s;o+=a)i.push(Ty(t,o,o+a>s?s:o+a));return n===1?(e=t[r-1],i.push(Qt[e>>2]+Qt[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Qt[e>>10]+Qt[e>>4&63]+Qt[e<<2&63]+"=")),i.join("")}var Iy=4,ld=0,fd=1,Oy=2;function bi(t){let e=t.length;for(;--e>=0;)t[e]=0}var Dy=0,Eh=1,Ny=2,Ry=3,Py=258,ol=29,Pa=256,Ea=Pa+1+ol,li=30,sl=19,Ch=2*Ea+1,mn=15,gu=16,Ly=7,cl=256,xh=16,kh=17,Th=18,zu=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Yo=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),$y=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Ah=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Fy=512,sr=new Array((Ea+2)*2);bi(sr);var ga=new Array(li*2);bi(ga);var Ca=new Array(Fy);bi(Ca);var xa=new Array(Py-Ry+1);bi(xa);var ul=new Array(ol);bi(ul);var ms=new Array(li);bi(ms);function yu(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}var Ih,Oh,Dh;function vu(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}var Nh=t=>t<256?Ca[t]:Ca[256+(t>>>7)],ka=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},ut=(t,e,r)=>{t.bi_valid>gu-r?(t.bi_buf|=e<<t.bi_valid&65535,ka(t,t.bi_buf),t.bi_buf=e>>gu-t.bi_valid,t.bi_valid+=r-gu):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)},Gt=(t,e,r)=>{ut(t,r[e*2],r[e*2+1])},Rh=(t,e)=>{let r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1},My=t=>{t.bi_valid===16?(ka(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)},jy=(t,e)=>{let r=e.dyn_tree,n=e.max_code,i=e.stat_desc.static_tree,a=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,s=e.stat_desc.extra_base,u=e.stat_desc.max_length,c,l,d,p,f,h,g=0;for(p=0;p<=mn;p++)t.bl_count[p]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<Ch;c++)l=t.heap[c],p=r[r[l*2+1]*2+1]+1,p>u&&(p=u,g++),r[l*2+1]=p,!(l>n)&&(t.bl_count[p]++,f=0,l>=s&&(f=o[l-s]),h=r[l*2],t.opt_len+=h*(p+f),a&&(t.static_len+=h*(i[l*2+1]+f)));if(g!==0){do{for(p=u-1;t.bl_count[p]===0;)p--;t.bl_count[p]--,t.bl_count[p+1]+=2,t.bl_count[u]--,g-=2}while(g>0);for(p=u;p!==0;p--)for(l=t.bl_count[p];l!==0;)d=t.heap[--c],!(d>n)&&(r[d*2+1]!==p&&(t.opt_len+=(p-r[d*2+1])*r[d*2],r[d*2+1]=p),l--)}},Ph=(t,e,r)=>{let n=new Array(mn+1),i=0,a,o;for(a=1;a<=mn;a++)i=i+r[a-1]<<1,n[a]=i;for(o=0;o<=e;o++){let s=t[o*2+1];s!==0&&(t[o*2]=Rh(n[s]++,s))}},Uy=()=>{let t,e,r,n,i,a=new Array(mn+1);for(r=0,n=0;n<ol-1;n++)for(ul[n]=r,t=0;t<1<<zu[n];t++)xa[r++]=n;for(xa[r-1]=n,i=0,n=0;n<16;n++)for(ms[n]=i,t=0;t<1<<Yo[n];t++)Ca[i++]=n;for(i>>=7;n<li;n++)for(ms[n]=i<<7,t=0;t<1<<Yo[n]-7;t++)Ca[256+i++]=n;for(e=0;e<=mn;e++)a[e]=0;for(t=0;t<=143;)sr[t*2+1]=8,t++,a[8]++;for(;t<=255;)sr[t*2+1]=9,t++,a[9]++;for(;t<=279;)sr[t*2+1]=7,t++,a[7]++;for(;t<=287;)sr[t*2+1]=8,t++,a[8]++;for(Ph(sr,Ea+1,a),t=0;t<li;t++)ga[t*2+1]=5,ga[t*2]=Rh(t,5);Ih=new yu(sr,zu,Pa+1,Ea,mn),Oh=new yu(ga,Yo,0,li,mn),Dh=new yu(new Array(0),$y,0,sl,Ly)},Lh=t=>{let e;for(e=0;e<Ea;e++)t.dyn_ltree[e*2]=0;for(e=0;e<li;e++)t.dyn_dtree[e*2]=0;for(e=0;e<sl;e++)t.bl_tree[e*2]=0;t.dyn_ltree[cl*2]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},$h=t=>{t.bi_valid>8?ka(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},pd=(t,e,r,n)=>{let i=e*2,a=r*2;return t[i]<t[a]||t[i]===t[a]&&n[e]<=n[r]},bu=(t,e,r)=>{let n=t.heap[r],i=r<<1;for(;i<=t.heap_len&&(i<t.heap_len&&pd(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!pd(e,n,t.heap[i],t.depth));)t.heap[r]=t.heap[i],r=i,i<<=1;t.heap[r]=n},dd=(t,e,r)=>{let n,i,a=0,o,s;if(t.sym_next!==0)do n=t.pending_buf[t.sym_buf+a++]&255,n+=(t.pending_buf[t.sym_buf+a++]&255)<<8,i=t.pending_buf[t.sym_buf+a++],n===0?Gt(t,i,e):(o=xa[i],Gt(t,o+Pa+1,e),s=zu[o],s!==0&&(i-=ul[o],ut(t,i,s)),n--,o=Nh(n),Gt(t,o,r),s=Yo[o],s!==0&&(n-=ms[o],ut(t,n,s)));while(a<t.sym_next);Gt(t,cl,e)},Qu=(t,e)=>{let r=e.dyn_tree,n=e.stat_desc.static_tree,i=e.stat_desc.has_stree,a=e.stat_desc.elems,o,s,u=-1,c;for(t.heap_len=0,t.heap_max=Ch,o=0;o<a;o++)r[o*2]!==0?(t.heap[++t.heap_len]=u=o,t.depth[o]=0):r[o*2+1]=0;for(;t.heap_len<2;)c=t.heap[++t.heap_len]=u<2?++u:0,r[c*2]=1,t.depth[c]=0,t.opt_len--,i&&(t.static_len-=n[c*2+1]);for(e.max_code=u,o=t.heap_len>>1;o>=1;o--)bu(t,r,o);c=a;do o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],bu(t,r,1),s=t.heap[1],t.heap[--t.heap_max]=o,t.heap[--t.heap_max]=s,r[c*2]=r[o*2]+r[s*2],t.depth[c]=(t.depth[o]>=t.depth[s]?t.depth[o]:t.depth[s])+1,r[o*2+1]=r[s*2+1]=c,t.heap[1]=c++,bu(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],jy(t,e),Ph(r,u,t.bl_count)},hd=(t,e,r)=>{let n,i=-1,a,o=e[0*2+1],s=0,u=7,c=4;for(o===0&&(u=138,c=3),e[(r+1)*2+1]=65535,n=0;n<=r;n++)a=o,o=e[(n+1)*2+1],!(++s<u&&a===o)&&(s<c?t.bl_tree[a*2]+=s:a!==0?(a!==i&&t.bl_tree[a*2]++,t.bl_tree[xh*2]++):s<=10?t.bl_tree[kh*2]++:t.bl_tree[Th*2]++,s=0,i=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4))},md=(t,e,r)=>{let n,i=-1,a,o=e[0*2+1],s=0,u=7,c=4;for(o===0&&(u=138,c=3),n=0;n<=r;n++)if(a=o,o=e[(n+1)*2+1],!(++s<u&&a===o)){if(s<c)do Gt(t,a,t.bl_tree);while(--s!==0);else a!==0?(a!==i&&(Gt(t,a,t.bl_tree),s--),Gt(t,xh,t.bl_tree),ut(t,s-3,2)):s<=10?(Gt(t,kh,t.bl_tree),ut(t,s-3,3)):(Gt(t,Th,t.bl_tree),ut(t,s-11,7));s=0,i=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4)}},qy=t=>{let e;for(hd(t,t.dyn_ltree,t.l_desc.max_code),hd(t,t.dyn_dtree,t.d_desc.max_code),Qu(t,t.bl_desc),e=sl-1;e>=3&&t.bl_tree[Ah[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},By=(t,e,r,n)=>{let i;for(ut(t,e-257,5),ut(t,r-1,5),ut(t,n-4,4),i=0;i<n;i++)ut(t,t.bl_tree[Ah[i]*2+1],3);md(t,t.dyn_ltree,e-1),md(t,t.dyn_dtree,r-1)},Vy=t=>{let e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return ld;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return fd;for(r=32;r<Pa;r++)if(t.dyn_ltree[r*2]!==0)return fd;return ld},gd=!1,zy=t=>{gd||(Uy(),gd=!0),t.l_desc=new vu(t.dyn_ltree,Ih),t.d_desc=new vu(t.dyn_dtree,Oh),t.bl_desc=new vu(t.bl_tree,Dh),t.bi_buf=0,t.bi_valid=0,Lh(t)},Fh=(t,e,r,n)=>{ut(t,(Dy<<1)+(n?1:0),3),$h(t),ka(t,r),ka(t,~r),r&&t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r},Qy=t=>{ut(t,Eh<<1,3),Gt(t,cl,sr),My(t)},Gy=(t,e,r,n)=>{let i,a,o=0;t.level>0?(t.strm.data_type===Oy&&(t.strm.data_type=Vy(t)),Qu(t,t.l_desc),Qu(t,t.d_desc),o=qy(t),i=t.opt_len+3+7>>>3,a=t.static_len+3+7>>>3,a<=i&&(i=a)):i=a=r+5,r+4<=i&&e!==-1?Fh(t,e,r,n):t.strategy===Iy||a===i?(ut(t,(Eh<<1)+(n?1:0),3),dd(t,sr,ga)):(ut(t,(Ny<<1)+(n?1:0),3),By(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),dd(t,t.dyn_ltree,t.dyn_dtree)),Lh(t),n&&$h(t)},Hy=(t,e,r)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=r,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(xa[r]+Pa+1)*2]++,t.dyn_dtree[Nh(e)*2]++),t.sym_next===t.sym_end),Wy=zy,Ky=Fh,Zy=Gy,Yy=Hy,Jy=Qy,Xy={_tr_init:Wy,_tr_stored_block:Ky,_tr_flush_block:Zy,_tr_tally:Yy,_tr_align:Jy},ev=(t,e,r,n)=>{let i=t&65535|0,a=t>>>16&65535|0,o=0;for(;r!==0;){o=r>2e3?2e3:r,r-=o;do i=i+e[n++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0},Ta=ev,tv=()=>{let t,e=[];for(var r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e},rv=new Uint32Array(tv()),nv=(t,e,r,n)=>{let i=rv,a=n+r;t^=-1;for(let o=n;o<a;o++)t=t>>>8^i[(t^e[o])&255];return t^-1},Ue=nv,Cn={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Nn={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},{_tr_init:iv,_tr_stored_block:Gu,_tr_flush_block:av,_tr_tally:Dr,_tr_align:ov}=Xy,{Z_NO_FLUSH:Nr,Z_PARTIAL_FLUSH:sv,Z_FULL_FLUSH:cv,Z_FINISH:xt,Z_BLOCK:yd,Z_OK:Ge,Z_STREAM_END:vd,Z_STREAM_ERROR:Wt,Z_DATA_ERROR:uv,Z_BUF_ERROR:_u,Z_DEFAULT_COMPRESSION:lv,Z_FILTERED:fv,Z_HUFFMAN_ONLY:Fo,Z_RLE:pv,Z_FIXED:dv,Z_DEFAULT_STRATEGY:hv,Z_UNKNOWN:mv,Z_DEFLATED:As}=Nn,gv=9,yv=15,vv=8,bv=29,_v=256,Hu=_v+1+bv,wv=30,Sv=19,Ev=2*Hu+1,Cv=15,Y=3,Ar=258,Kt=Ar+Y+1,xv=32,hi=42,ll=57,Wu=69,Ku=73,Zu=91,Yu=103,gn=113,fa=666,rt=1,_i=2,xn=3,wi=4,kv=3,yn=(t,e)=>(t.msg=Cn[e],e),bd=t=>t*2-(t>4?9:0),Tr=t=>{let e=t.length;for(;--e>=0;)t[e]=0},Tv=t=>{let e,r,n,i=t.w_size;e=t.hash_size,n=e;do r=t.head[--n],t.head[n]=r>=i?r-i:0;while(--e);e=i,n=e;do r=t.prev[--n],t.prev[n]=r>=i?r-i:0;while(--e)},Av=(t,e,r)=>(e<<t.hash_shift^r)&t.hash_mask,Rr=Av,mt=t=>{let e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))},yt=(t,e)=>{av(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,mt(t.strm)},ae=(t,e)=>{t.pending_buf[t.pending++]=e},Ji=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},Ju=(t,e,r,n)=>{let i=t.avail_in;return i>n&&(i=n),i===0?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),r),t.state.wrap===1?t.adler=Ta(t.adler,e,i,r):t.state.wrap===2&&(t.adler=Ue(t.adler,e,i,r)),t.next_in+=i,t.total_in+=i,i)},Mh=(t,e)=>{let r=t.max_chain_length,n=t.strstart,i,a,o=t.prev_length,s=t.nice_match,u=t.strstart>t.w_size-Kt?t.strstart-(t.w_size-Kt):0,c=t.window,l=t.w_mask,d=t.prev,p=t.strstart+Ar,f=c[n+o-1],h=c[n+o];t.prev_length>=t.good_match&&(r>>=2),s>t.lookahead&&(s=t.lookahead);do if(i=e,!(c[i+o]!==h||c[i+o-1]!==f||c[i]!==c[n]||c[++i]!==c[n+1])){n+=2,i++;do;while(c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&n<p);if(a=Ar-(p-n),n=p-Ar,a>o){if(t.match_start=e,o=a,a>=s)break;f=c[n+o-1],h=c[n+o]}}while((e=d[e&l])>u&&--r!==0);return o<=t.lookahead?o:t.lookahead},mi=t=>{let e=t.w_size,r,n,i;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Kt)&&(t.window.set(t.window.subarray(e,e+e-n),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),Tv(t),n+=e),t.strm.avail_in===0)break;if(r=Ju(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=r,t.lookahead+t.insert>=Y)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=Rr(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=Rr(t,t.ins_h,t.window[i+Y-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<Y)););}while(t.lookahead<Kt&&t.strm.avail_in!==0)},jh=(t,e)=>{let r=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,n,i,a,o=0,s=t.strm.avail_in;do{if(n=65535,a=t.bi_valid+42>>3,t.strm.avail_out<a||(a=t.strm.avail_out-a,i=t.strstart-t.block_start,n>i+t.strm.avail_in&&(n=i+t.strm.avail_in),n>a&&(n=a),n<r&&(n===0&&e!==xt||e===Nr||n!==i+t.strm.avail_in)))break;o=e===xt&&n===i+t.strm.avail_in?1:0,Gu(t,0,0,o),t.pending_buf[t.pending-4]=n,t.pending_buf[t.pending-3]=n>>8,t.pending_buf[t.pending-2]=~n,t.pending_buf[t.pending-1]=~n>>8,mt(t.strm),i&&(i>n&&(i=n),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,n-=i),n&&(Ju(t.strm,t.strm.output,t.strm.next_out,n),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n)}while(o===0);return s-=t.strm.avail_in,s&&(s>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=s&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-s,t.strm.next_in),t.strstart),t.strstart+=s,t.insert+=s>t.w_size-t.insert?t.w_size-t.insert:s),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),o?wi:e!==Nr&&e!==xt&&t.strm.avail_in===0&&t.strstart===t.block_start?_i:(a=t.window_size-t.strstart,t.strm.avail_in>a&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,a+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),a>t.strm.avail_in&&(a=t.strm.avail_in),a&&(Ju(t.strm,t.window,t.strstart,a),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.high_water<t.strstart&&(t.high_water=t.strstart),a=t.bi_valid+42>>3,a=t.pending_buf_size-a>65535?65535:t.pending_buf_size-a,r=a>t.w_size?t.w_size:a,i=t.strstart-t.block_start,(i>=r||(i||e===xt)&&e!==Nr&&t.strm.avail_in===0&&i<=a)&&(n=i>a?a:i,o=e===xt&&t.strm.avail_in===0&&n===i?1:0,Gu(t,t.block_start,n,o),t.block_start+=n,mt(t.strm)),o?xn:rt)},wu=(t,e)=>{let r,n;for(;;){if(t.lookahead<Kt){if(mi(t),t.lookahead<Kt&&e===Nr)return rt;if(t.lookahead===0)break}if(r=0,t.lookahead>=Y&&(t.ins_h=Rr(t,t.ins_h,t.window[t.strstart+Y-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),r!==0&&t.strstart-r<=t.w_size-Kt&&(t.match_length=Mh(t,r)),t.match_length>=Y)if(n=Dr(t,t.strstart-t.match_start,t.match_length-Y),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=Y){t.match_length--;do t.strstart++,t.ins_h=Rr(t,t.ins_h,t.window[t.strstart+Y-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=Rr(t,t.ins_h,t.window[t.strstart+1]);else n=Dr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(yt(t,!1),t.strm.avail_out===0))return rt}return t.insert=t.strstart<Y-1?t.strstart:Y-1,e===xt?(yt(t,!0),t.strm.avail_out===0?xn:wi):t.sym_next&&(yt(t,!1),t.strm.avail_out===0)?rt:_i},ai=(t,e)=>{let r,n,i;for(;;){if(t.lookahead<Kt){if(mi(t),t.lookahead<Kt&&e===Nr)return rt;if(t.lookahead===0)break}if(r=0,t.lookahead>=Y&&(t.ins_h=Rr(t,t.ins_h,t.window[t.strstart+Y-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=Y-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-Kt&&(t.match_length=Mh(t,r),t.match_length<=5&&(t.strategy===fv||t.match_length===Y&&t.strstart-t.match_start>4096)&&(t.match_length=Y-1)),t.prev_length>=Y&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-Y,n=Dr(t,t.strstart-1-t.prev_match,t.prev_length-Y),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=Rr(t,t.ins_h,t.window[t.strstart+Y-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=Y-1,t.strstart++,n&&(yt(t,!1),t.strm.avail_out===0))return rt}else if(t.match_available){if(n=Dr(t,0,t.window[t.strstart-1]),n&&yt(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return rt}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=Dr(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<Y-1?t.strstart:Y-1,e===xt?(yt(t,!0),t.strm.avail_out===0?xn:wi):t.sym_next&&(yt(t,!1),t.strm.avail_out===0)?rt:_i},Iv=(t,e)=>{let r,n,i,a,o=t.window;for(;;){if(t.lookahead<=Ar){if(mi(t),t.lookahead<=Ar&&e===Nr)return rt;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=Y&&t.strstart>0&&(i=t.strstart-1,n=o[i],n===o[++i]&&n===o[++i]&&n===o[++i])){a=t.strstart+Ar;do;while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&i<a);t.match_length=Ar-(a-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=Y?(r=Dr(t,1,t.match_length-Y),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=Dr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(yt(t,!1),t.strm.avail_out===0))return rt}return t.insert=0,e===xt?(yt(t,!0),t.strm.avail_out===0?xn:wi):t.sym_next&&(yt(t,!1),t.strm.avail_out===0)?rt:_i},Ov=(t,e)=>{let r;for(;;){if(t.lookahead===0&&(mi(t),t.lookahead===0)){if(e===Nr)return rt;break}if(t.match_length=0,r=Dr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(yt(t,!1),t.strm.avail_out===0))return rt}return t.insert=0,e===xt?(yt(t,!0),t.strm.avail_out===0?xn:wi):t.sym_next&&(yt(t,!1),t.strm.avail_out===0)?rt:_i};function Vt(t,e,r,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=i}var pa=[new Vt(0,0,0,0,jh),new Vt(4,4,8,4,wu),new Vt(4,5,16,8,wu),new Vt(4,6,32,32,wu),new Vt(4,4,16,16,ai),new Vt(8,16,32,32,ai),new Vt(8,16,128,128,ai),new Vt(8,32,128,256,ai),new Vt(32,128,258,1024,ai),new Vt(32,258,258,4096,ai)],Dv=t=>{t.window_size=2*t.w_size,Tr(t.head),t.max_lazy_match=pa[t.level].max_lazy,t.good_match=pa[t.level].good_length,t.nice_match=pa[t.level].nice_length,t.max_chain_length=pa[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=Y-1,t.match_available=0,t.ins_h=0};function Nv(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=As,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(Ev*2),this.dyn_dtree=new Uint16Array((2*wv+1)*2),this.bl_tree=new Uint16Array((2*Sv+1)*2),Tr(this.dyn_ltree),Tr(this.dyn_dtree),Tr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Cv+1),this.heap=new Uint16Array(2*Hu+1),Tr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Hu+1),Tr(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var La=t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.status!==hi&&e.status!==ll&&e.status!==Wu&&e.status!==Ku&&e.status!==Zu&&e.status!==Yu&&e.status!==gn&&e.status!==fa?1:0},Uh=t=>{if(La(t))return yn(t,Wt);t.total_in=t.total_out=0,t.data_type=mv;let e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?ll:e.wrap?hi:gn,t.adler=e.wrap===2?0:1,e.last_flush=-2,iv(e),Ge},qh=t=>{let e=Uh(t);return e===Ge&&Dv(t.state),e},Rv=(t,e)=>La(t)||t.state.wrap!==2?Wt:(t.state.gzhead=e,Ge),Bh=(t,e,r,n,i,a)=>{if(!t)return Wt;let o=1;if(e===lv&&(e=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>gv||r!==As||n<8||n>15||e<0||e>9||a<0||a>dv||n===8&&o!==1)return yn(t,Wt);n===8&&(n=9);let s=new Nv;return t.state=s,s.strm=t,s.status=hi,s.wrap=o,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+Y-1)/Y),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=e,s.strategy=a,s.method=r,qh(t)},Pv=(t,e)=>Bh(t,e,As,yv,vv,hv),Lv=(t,e)=>{if(La(t)||e>yd||e<0)return t?yn(t,Wt):Wt;let r=t.state;if(!t.output||t.avail_in!==0&&!t.input||r.status===fa&&e!==xt)return yn(t,t.avail_out===0?_u:Wt);let n=r.last_flush;if(r.last_flush=e,r.pending!==0){if(mt(t),t.avail_out===0)return r.last_flush=-1,Ge}else if(t.avail_in===0&&bd(e)<=bd(n)&&e!==xt)return yn(t,_u);if(r.status===fa&&t.avail_in!==0)return yn(t,_u);if(r.status===hi&&r.wrap===0&&(r.status=gn),r.status===hi){let i=As+(r.w_bits-8<<4)<<8,a=-1;if(r.strategy>=Fo||r.level<2?a=0:r.level<6?a=1:r.level===6?a=2:a=3,i|=a<<6,r.strstart!==0&&(i|=xv),i+=31-i%31,Ji(r,i),r.strstart!==0&&(Ji(r,t.adler>>>16),Ji(r,t.adler&65535)),t.adler=1,r.status=gn,mt(t),r.pending!==0)return r.last_flush=-1,Ge}if(r.status===ll){if(t.adler=0,ae(r,31),ae(r,139),ae(r,8),r.gzhead)ae(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),ae(r,r.gzhead.time&255),ae(r,r.gzhead.time>>8&255),ae(r,r.gzhead.time>>16&255),ae(r,r.gzhead.time>>24&255),ae(r,r.level===9?2:r.strategy>=Fo||r.level<2?4:0),ae(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(ae(r,r.gzhead.extra.length&255),ae(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=Ue(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Wu;else if(ae(r,0),ae(r,0),ae(r,0),ae(r,0),ae(r,0),ae(r,r.level===9?2:r.strategy>=Fo||r.level<2?4:0),ae(r,kv),r.status=gn,mt(t),r.pending!==0)return r.last_flush=-1,Ge}if(r.status===Wu){if(r.gzhead.extra){let i=r.pending,a=(r.gzhead.extra.length&65535)-r.gzindex;for(;r.pending+a>r.pending_buf_size;){let s=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+s),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>i&&(t.adler=Ue(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex+=s,mt(t),r.pending!==0)return r.last_flush=-1,Ge;i=0,a-=s}let o=new Uint8Array(r.gzhead.extra);r.pending_buf.set(o.subarray(r.gzindex,r.gzindex+a),r.pending),r.pending+=a,r.gzhead.hcrc&&r.pending>i&&(t.adler=Ue(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=Ku}if(r.status===Ku){if(r.gzhead.name){let i=r.pending,a;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(t.adler=Ue(t.adler,r.pending_buf,r.pending-i,i)),mt(t),r.pending!==0)return r.last_flush=-1,Ge;i=0}r.gzindex<r.gzhead.name.length?a=r.gzhead.name.charCodeAt(r.gzindex++)&255:a=0,ae(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(t.adler=Ue(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=Zu}if(r.status===Zu){if(r.gzhead.comment){let i=r.pending,a;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(t.adler=Ue(t.adler,r.pending_buf,r.pending-i,i)),mt(t),r.pending!==0)return r.last_flush=-1,Ge;i=0}r.gzindex<r.gzhead.comment.length?a=r.gzhead.comment.charCodeAt(r.gzindex++)&255:a=0,ae(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(t.adler=Ue(t.adler,r.pending_buf,r.pending-i,i))}r.status=Yu}if(r.status===Yu){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(mt(t),r.pending!==0))return r.last_flush=-1,Ge;ae(r,t.adler&255),ae(r,t.adler>>8&255),t.adler=0}if(r.status=gn,mt(t),r.pending!==0)return r.last_flush=-1,Ge}if(t.avail_in!==0||r.lookahead!==0||e!==Nr&&r.status!==fa){let i=r.level===0?jh(r,e):r.strategy===Fo?Ov(r,e):r.strategy===pv?Iv(r,e):pa[r.level].func(r,e);if((i===xn||i===wi)&&(r.status=fa),i===rt||i===xn)return t.avail_out===0&&(r.last_flush=-1),Ge;if(i===_i&&(e===sv?ov(r):e!==yd&&(Gu(r,0,0,!1),e===cv&&(Tr(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),mt(t),t.avail_out===0))return r.last_flush=-1,Ge}return e!==xt?Ge:r.wrap<=0?vd:(r.wrap===2?(ae(r,t.adler&255),ae(r,t.adler>>8&255),ae(r,t.adler>>16&255),ae(r,t.adler>>24&255),ae(r,t.total_in&255),ae(r,t.total_in>>8&255),ae(r,t.total_in>>16&255),ae(r,t.total_in>>24&255)):(Ji(r,t.adler>>>16),Ji(r,t.adler&65535)),mt(t),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?Ge:vd)},$v=t=>{if(La(t))return Wt;let e=t.state.status;return t.state=null,e===gn?yn(t,uv):Ge},Fv=(t,e)=>{let r=e.length;if(La(t))return Wt;let n=t.state,i=n.wrap;if(i===2||i===1&&n.status!==hi||n.lookahead)return Wt;if(i===1&&(t.adler=Ta(t.adler,e,r,0)),n.wrap=0,r>=n.w_size){i===0&&(Tr(n.head),n.strstart=0,n.block_start=0,n.insert=0);let u=new Uint8Array(n.w_size);u.set(e.subarray(r-n.w_size,r),0),e=u,r=n.w_size}let a=t.avail_in,o=t.next_in,s=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,mi(n);n.lookahead>=Y;){let u=n.strstart,c=n.lookahead-(Y-1);do n.ins_h=Rr(n,n.ins_h,n.window[u+Y-1]),n.prev[u&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=u,u++;while(--c);n.strstart=u,n.lookahead=Y-1,mi(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=Y-1,n.match_available=0,t.next_in=o,t.input=s,t.avail_in=a,n.wrap=i,Ge},Mv=Pv,jv=Bh,Uv=qh,qv=Uh,Bv=Rv,Vv=Lv,zv=$v,Qv=Fv,Gv="pako deflate (from Nodeca project)",ya={deflateInit:Mv,deflateInit2:jv,deflateReset:Uv,deflateResetKeep:qv,deflateSetHeader:Bv,deflate:Vv,deflateEnd:zv,deflateSetDictionary:Qv,deflateInfo:Gv},Hv=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),Wv=function(t){let e=Array.prototype.slice.call(arguments,1);for(;e.length;){let r=e.shift();if(!!r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(let n in r)Hv(r,n)&&(t[n]=r[n])}}return t},Kv=t=>{let e=0;for(let n=0,i=t.length;n<i;n++)e+=t[n].length;let r=new Uint8Array(e);for(let n=0,i=0,a=t.length;n<a;n++){let o=t[n];r.set(o,i),i+=o.length}return r},Is={assign:Wv,flattenChunks:Kv},Vh=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){Vh=!1}var Aa=new Uint8Array(256);for(let t=0;t<256;t++)Aa[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Aa[254]=Aa[254]=1;var Zv=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,r,n,i,a,o=t.length,s=0;for(i=0;i<o;i++)r=t.charCodeAt(i),(r&64512)===55296&&i+1<o&&(n=t.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Uint8Array(s),a=0,i=0;a<s;i++)r=t.charCodeAt(i),(r&64512)===55296&&i+1<o&&(n=t.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?e[a++]=r:r<2048?(e[a++]=192|r>>>6,e[a++]=128|r&63):r<65536?(e[a++]=224|r>>>12,e[a++]=128|r>>>6&63,e[a++]=128|r&63):(e[a++]=240|r>>>18,e[a++]=128|r>>>12&63,e[a++]=128|r>>>6&63,e[a++]=128|r&63);return e},Yv=(t,e)=>{if(e<65534&&t.subarray&&Vh)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let r="";for(let n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r},Jv=(t,e)=>{let r=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let n,i,a=new Array(r*2);for(i=0,n=0;n<r;){let o=t[n++];if(o<128){a[i++]=o;continue}let s=Aa[o];if(s>4){a[i++]=65533,n+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&n<r;)o=o<<6|t[n++]&63,s--;if(s>1){a[i++]=65533;continue}o<65536?a[i++]=o:(o-=65536,a[i++]=55296|o>>10&1023,a[i++]=56320|o&1023)}return Yv(a,i)},Xv=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let r=e-1;for(;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+Aa[t[r]]>e?r:e},Ia={string2buf:Zv,buf2string:Jv,utf8border:Xv};function e0(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var zh=e0,Qh=Object.prototype.toString,{Z_NO_FLUSH:t0,Z_SYNC_FLUSH:r0,Z_FULL_FLUSH:n0,Z_FINISH:i0,Z_OK:gs,Z_STREAM_END:a0,Z_DEFAULT_COMPRESSION:o0,Z_DEFAULT_STRATEGY:s0,Z_DEFLATED:c0}=Nn;function $a(t){this.options=Is.assign({level:o0,method:c0,chunkSize:16384,windowBits:15,memLevel:8,strategy:s0},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zh,this.strm.avail_out=0;let r=ya.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==gs)throw new Error(Cn[r]);if(e.header&&ya.deflateSetHeader(this.strm,e.header),e.dictionary){let n;if(typeof e.dictionary=="string"?n=Ia.string2buf(e.dictionary):Qh.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,r=ya.deflateSetDictionary(this.strm,n),r!==gs)throw new Error(Cn[r]);this._dict_set=!0}}$a.prototype.push=function(t,e){let r=this.strm,n=this.options.chunkSize,i,a;if(this.ended)return!1;for(e===~~e?a=e:a=e===!0?i0:t0,typeof t=="string"?r.input=Ia.string2buf(t):Qh.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){if(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(a===r0||a===n0)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(i=ya.deflate(r,a),i===a0)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=ya.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===gs;if(r.avail_out===0){this.onData(r.output);continue}if(a>0&&r.next_out>0){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(r.avail_in===0)break}return!0};$a.prototype.onData=function(t){this.chunks.push(t)};$a.prototype.onEnd=function(t){t===gs&&(this.result=Is.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function fl(t,e){let r=new $a(e);if(r.push(t,!0),r.err)throw r.msg||Cn[r.err];return r.result}function u0(t,e){return e=e||{},e.raw=!0,fl(t,e)}function l0(t,e){return e=e||{},e.gzip=!0,fl(t,e)}var f0=$a,p0=fl,d0=u0,h0=l0,m0=Nn,g0={Deflate:f0,deflate:p0,deflateRaw:d0,gzip:h0,constants:m0},Mo=16209,y0=16191,v0=function t(e,r){let n,i,a,o,s,u,c,l,d,p,f,h,g,y,S,b,v,m,A,D,C,O,P,N,U=e.state;n=e.next_in,P=e.input,i=n+(e.avail_in-5),a=e.next_out,N=e.output,o=a-(r-e.avail_out),s=a+(e.avail_out-257),u=U.dmax,c=U.wsize,l=U.whave,d=U.wnext,p=U.window,f=U.hold,h=U.bits,g=U.lencode,y=U.distcode,S=(1<<U.lenbits)-1,b=(1<<U.distbits)-1;e:do{h<15&&(f+=P[n++]<<h,h+=8,f+=P[n++]<<h,h+=8),v=g[f&S];t:for(;;){if(m=v>>>24,f>>>=m,h-=m,m=v>>>16&255,m===0)N[a++]=v&65535;else if(m&16){A=v&65535,m&=15,m&&(h<m&&(f+=P[n++]<<h,h+=8),A+=f&(1<<m)-1,f>>>=m,h-=m),h<15&&(f+=P[n++]<<h,h+=8,f+=P[n++]<<h,h+=8),v=y[f&b];r:for(;;){if(m=v>>>24,f>>>=m,h-=m,m=v>>>16&255,m&16){if(D=v&65535,m&=15,h<m&&(f+=P[n++]<<h,h+=8,h<m&&(f+=P[n++]<<h,h+=8)),D+=f&(1<<m)-1,D>u){e.msg="invalid distance too far back",U.mode=Mo;break e}if(f>>>=m,h-=m,m=a-o,D>m){if(m=D-m,m>l&&U.sane){e.msg="invalid distance too far back",U.mode=Mo;break e}if(C=0,O=p,d===0){if(C+=c-m,m<A){A-=m;do N[a++]=p[C++];while(--m);C=a-D,O=N}}else if(d<m){if(C+=c+d-m,m-=d,m<A){A-=m;do N[a++]=p[C++];while(--m);if(C=0,d<A){m=d,A-=m;do N[a++]=p[C++];while(--m);C=a-D,O=N}}}else if(C+=d-m,m<A){A-=m;do N[a++]=p[C++];while(--m);C=a-D,O=N}for(;A>2;)N[a++]=O[C++],N[a++]=O[C++],N[a++]=O[C++],A-=3;A&&(N[a++]=O[C++],A>1&&(N[a++]=O[C++]))}else{C=a-D;do N[a++]=N[C++],N[a++]=N[C++],N[a++]=N[C++],A-=3;while(A>2);A&&(N[a++]=N[C++],A>1&&(N[a++]=N[C++]))}}else if((m&64)===0){v=y[(v&65535)+(f&(1<<m)-1)];continue r}else{e.msg="invalid distance code",U.mode=Mo;break e}break}}else if((m&64)===0){v=g[(v&65535)+(f&(1<<m)-1)];continue t}else if(m&32){U.mode=y0;break e}else{e.msg="invalid literal/length code",U.mode=Mo;break e}break}}while(n<i&&a<s);A=h>>3,n-=A,h-=A<<3,f&=(1<<h)-1,e.next_in=n,e.next_out=a,e.avail_in=n<i?5+(i-n):5-(n-i),e.avail_out=a<s?257+(s-a):257-(a-s),U.hold=f,U.bits=h},oi=15,_d=852,wd=592,Sd=0,Su=1,Ed=2,b0=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),_0=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),w0=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),S0=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),E0=(t,e,r,n,i,a,o,s)=>{let u=s.bits,c=0,l=0,d=0,p=0,f=0,h=0,g=0,y=0,S=0,b=0,v,m,A,D,C,O=null,P,N=new Uint16Array(oi+1),U=new Uint16Array(oi+1),qe=null,Ne,q,de;for(c=0;c<=oi;c++)N[c]=0;for(l=0;l<n;l++)N[e[r+l]]++;for(f=u,p=oi;p>=1&&N[p]===0;p--);if(f>p&&(f=p),p===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,s.bits=1,0;for(d=1;d<p&&N[d]===0;d++);for(f<d&&(f=d),y=1,c=1;c<=oi;c++)if(y<<=1,y-=N[c],y<0)return-1;if(y>0&&(t===Sd||p!==1))return-1;for(U[1]=0,c=1;c<oi;c++)U[c+1]=U[c]+N[c];for(l=0;l<n;l++)e[r+l]!==0&&(o[U[e[r+l]]++]=l);if(t===Sd?(O=qe=o,P=20):t===Su?(O=b0,qe=_0,P=257):(O=w0,qe=S0,P=0),b=0,l=0,c=d,C=a,h=f,g=0,A=-1,S=1<<f,D=S-1,t===Su&&S>_d||t===Ed&&S>wd)return 1;for(;;){Ne=c-g,o[l]+1<P?(q=0,de=o[l]):o[l]>=P?(q=qe[o[l]-P],de=O[o[l]-P]):(q=32+64,de=0),v=1<<c-g,m=1<<h,d=m;do m-=v,i[C+(b>>g)+m]=Ne<<24|q<<16|de|0;while(m!==0);for(v=1<<c-1;b&v;)v>>=1;if(v!==0?(b&=v-1,b+=v):b=0,l++,--N[c]===0){if(c===p)break;c=e[r+o[l]]}if(c>f&&(b&D)!==A){for(g===0&&(g=f),C+=d,h=c-g,y=1<<h;h+g<p&&(y-=N[h+g],!(y<=0));)h++,y<<=1;if(S+=1<<h,t===Su&&S>_d||t===Ed&&S>wd)return 1;A=b&D,i[A]=f<<24|h<<16|C-a|0}}return b!==0&&(i[C+b]=c-g<<24|64<<16|0),s.bits=f,0},va=E0,C0=0,Gh=1,Hh=2,{Z_FINISH:Cd,Z_BLOCK:x0,Z_TREES:jo,Z_OK:kn,Z_STREAM_END:k0,Z_NEED_DICT:T0,Z_STREAM_ERROR:kt,Z_DATA_ERROR:Wh,Z_MEM_ERROR:Kh,Z_BUF_ERROR:A0,Z_DEFLATED:xd}=Nn,Os=16180,kd=16181,Td=16182,Ad=16183,Id=16184,Od=16185,Dd=16186,Nd=16187,Rd=16188,Pd=16189,ys=16190,ir=16191,Eu=16192,Ld=16193,Cu=16194,$d=16195,Fd=16196,Md=16197,jd=16198,Uo=16199,qo=16200,Ud=16201,qd=16202,Bd=16203,Vd=16204,zd=16205,xu=16206,Qd=16207,Gd=16208,_e=16209,Zh=16210,Yh=16211,I0=852,O0=592,D0=15,N0=D0,Hd=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function R0(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var Rn=t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.mode<Os||e.mode>Yh?1:0},Jh=t=>{if(Rn(t))return kt;let e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=Os,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(I0),e.distcode=e.distdyn=new Int32Array(O0),e.sane=1,e.back=-1,kn},Xh=t=>{if(Rn(t))return kt;let e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,Jh(t)},em=(t,e)=>{let r;if(Rn(t))return kt;let n=t.state;return e<0?(r=0,e=-e):(r=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?kt:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,Xh(t))},tm=(t,e)=>{if(!t)return kt;let r=new R0;t.state=r,r.strm=t,r.window=null,r.mode=Os;let n=em(t,e);return n!==kn&&(t.state=null),n},P0=t=>tm(t,N0),Wd=!0,ku,Tu,L0=t=>{if(Wd){ku=new Int32Array(512),Tu=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(va(Gh,t.lens,0,288,ku,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;va(Hh,t.lens,0,32,Tu,0,t.work,{bits:5}),Wd=!1}t.lencode=ku,t.lenbits=9,t.distcode=Tu,t.distbits=5},rm=(t,e,r,n)=>{let i,a=t.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),n>=a.wsize?(a.window.set(e.subarray(r-a.wsize,r),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>n&&(i=n),a.window.set(e.subarray(r-n,r-n+i),a.wnext),n-=i,n?(a.window.set(e.subarray(r-n,r),0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},$0=(t,e)=>{let r,n,i,a,o,s,u,c,l,d,p,f,h,g,y=0,S,b,v,m,A,D,C,O,P=new Uint8Array(4),N,U,qe=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Rn(t)||!t.output||!t.input&&t.avail_in!==0)return kt;r=t.state,r.mode===ir&&(r.mode=Eu),o=t.next_out,i=t.output,u=t.avail_out,a=t.next_in,n=t.input,s=t.avail_in,c=r.hold,l=r.bits,d=s,p=u,O=kn;e:for(;;)switch(r.mode){case Os:if(r.wrap===0){r.mode=Eu;break}for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.wrap&2&&c===35615){r.wbits===0&&(r.wbits=15),r.check=0,P[0]=c&255,P[1]=c>>>8&255,r.check=Ue(r.check,P,2,0),c=0,l=0,r.mode=kd;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=_e;break}if((c&15)!==xd){t.msg="unknown compression method",r.mode=_e;break}if(c>>>=4,l-=4,C=(c&15)+8,r.wbits===0&&(r.wbits=C),C>15||C>r.wbits){t.msg="invalid window size",r.mode=_e;break}r.dmax=1<<r.wbits,r.flags=0,t.adler=r.check=1,r.mode=c&512?Pd:ir,c=0,l=0;break;case kd:for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.flags=c,(r.flags&255)!==xd){t.msg="unknown compression method",r.mode=_e;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=_e;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&r.wrap&4&&(P[0]=c&255,P[1]=c>>>8&255,r.check=Ue(r.check,P,2,0)),c=0,l=0,r.mode=Td;case Td:for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.head&&(r.head.time=c),r.flags&512&&r.wrap&4&&(P[0]=c&255,P[1]=c>>>8&255,P[2]=c>>>16&255,P[3]=c>>>24&255,r.check=Ue(r.check,P,4,0)),c=0,l=0,r.mode=Ad;case Ad:for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&r.wrap&4&&(P[0]=c&255,P[1]=c>>>8&255,r.check=Ue(r.check,P,2,0)),c=0,l=0,r.mode=Id;case Id:if(r.flags&1024){for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&r.wrap&4&&(P[0]=c&255,P[1]=c>>>8&255,r.check=Ue(r.check,P,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=Od;case Od:if(r.flags&1024&&(f=r.length,f>s&&(f=s),f&&(r.head&&(C=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(a,a+f),C)),r.flags&512&&r.wrap&4&&(r.check=Ue(r.check,n,f,a)),s-=f,a+=f,r.length-=f),r.length))break e;r.length=0,r.mode=Dd;case Dd:if(r.flags&2048){if(s===0)break e;f=0;do C=n[a+f++],r.head&&C&&r.length<65536&&(r.head.name+=String.fromCharCode(C));while(C&&f<s);if(r.flags&512&&r.wrap&4&&(r.check=Ue(r.check,n,f,a)),s-=f,a+=f,C)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=Nd;case Nd:if(r.flags&4096){if(s===0)break e;f=0;do C=n[a+f++],r.head&&C&&r.length<65536&&(r.head.comment+=String.fromCharCode(C));while(C&&f<s);if(r.flags&512&&r.wrap&4&&(r.check=Ue(r.check,n,f,a)),s-=f,a+=f,C)break e}else r.head&&(r.head.comment=null);r.mode=Rd;case Rd:if(r.flags&512){for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.wrap&4&&c!==(r.check&65535)){t.msg="header crc mismatch",r.mode=_e;break}c=0,l=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=ir;break;case Pd:for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}t.adler=r.check=Hd(c),c=0,l=0,r.mode=ys;case ys:if(r.havedict===0)return t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,T0;t.adler=r.check=1,r.mode=ir;case ir:if(e===x0||e===jo)break e;case Eu:if(r.last){c>>>=l&7,l-=l&7,r.mode=xu;break}for(;l<3;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}switch(r.last=c&1,c>>>=1,l-=1,c&3){case 0:r.mode=Ld;break;case 1:if(L0(r),r.mode=Uo,e===jo){c>>>=2,l-=2;break e}break;case 2:r.mode=Fd;break;case 3:t.msg="invalid block type",r.mode=_e}c>>>=2,l-=2;break;case Ld:for(c>>>=l&7,l-=l&7;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if((c&65535)!==(c>>>16^65535)){t.msg="invalid stored block lengths",r.mode=_e;break}if(r.length=c&65535,c=0,l=0,r.mode=Cu,e===jo)break e;case Cu:r.mode=$d;case $d:if(f=r.length,f){if(f>s&&(f=s),f>u&&(f=u),f===0)break e;i.set(n.subarray(a,a+f),o),s-=f,a+=f,u-=f,o+=f,r.length-=f;break}r.mode=ir;break;case Fd:for(;l<14;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.nlen=(c&31)+257,c>>>=5,l-=5,r.ndist=(c&31)+1,c>>>=5,l-=5,r.ncode=(c&15)+4,c>>>=4,l-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=_e;break}r.have=0,r.mode=Md;case Md:for(;r.have<r.ncode;){for(;l<3;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.lens[qe[r.have++]]=c&7,c>>>=3,l-=3}for(;r.have<19;)r.lens[qe[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,N={bits:r.lenbits},O=va(C0,r.lens,0,19,r.lencode,0,r.work,N),r.lenbits=N.bits,O){t.msg="invalid code lengths set",r.mode=_e;break}r.have=0,r.mode=jd;case jd:for(;r.have<r.nlen+r.ndist;){for(;y=r.lencode[c&(1<<r.lenbits)-1],S=y>>>24,b=y>>>16&255,v=y&65535,!(S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(v<16)c>>>=S,l-=S,r.lens[r.have++]=v;else{if(v===16){for(U=S+2;l<U;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(c>>>=S,l-=S,r.have===0){t.msg="invalid bit length repeat",r.mode=_e;break}C=r.lens[r.have-1],f=3+(c&3),c>>>=2,l-=2}else if(v===17){for(U=S+3;l<U;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=S,l-=S,C=0,f=3+(c&7),c>>>=3,l-=3}else{for(U=S+7;l<U;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=S,l-=S,C=0,f=11+(c&127),c>>>=7,l-=7}if(r.have+f>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=_e;break}for(;f--;)r.lens[r.have++]=C}}if(r.mode===_e)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=_e;break}if(r.lenbits=9,N={bits:r.lenbits},O=va(Gh,r.lens,0,r.nlen,r.lencode,0,r.work,N),r.lenbits=N.bits,O){t.msg="invalid literal/lengths set",r.mode=_e;break}if(r.distbits=6,r.distcode=r.distdyn,N={bits:r.distbits},O=va(Hh,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,N),r.distbits=N.bits,O){t.msg="invalid distances set",r.mode=_e;break}if(r.mode=Uo,e===jo)break e;case Uo:r.mode=qo;case qo:if(s>=6&&u>=258){t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,v0(t,p),o=t.next_out,i=t.output,u=t.avail_out,a=t.next_in,n=t.input,s=t.avail_in,c=r.hold,l=r.bits,r.mode===ir&&(r.back=-1);break}for(r.back=0;y=r.lencode[c&(1<<r.lenbits)-1],S=y>>>24,b=y>>>16&255,v=y&65535,!(S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(b&&(b&240)===0){for(m=S,A=b,D=v;y=r.lencode[D+((c&(1<<m+A)-1)>>m)],S=y>>>24,b=y>>>16&255,v=y&65535,!(m+S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=m,l-=m,r.back+=m}if(c>>>=S,l-=S,r.back+=S,r.length=v,b===0){r.mode=zd;break}if(b&32){r.back=-1,r.mode=ir;break}if(b&64){t.msg="invalid literal/length code",r.mode=_e;break}r.extra=b&15,r.mode=Ud;case Ud:if(r.extra){for(U=r.extra;l<U;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=qd;case qd:for(;y=r.distcode[c&(1<<r.distbits)-1],S=y>>>24,b=y>>>16&255,v=y&65535,!(S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if((b&240)===0){for(m=S,A=b,D=v;y=r.distcode[D+((c&(1<<m+A)-1)>>m)],S=y>>>24,b=y>>>16&255,v=y&65535,!(m+S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=m,l-=m,r.back+=m}if(c>>>=S,l-=S,r.back+=S,b&64){t.msg="invalid distance code",r.mode=_e;break}r.offset=v,r.extra=b&15,r.mode=Bd;case Bd:if(r.extra){for(U=r.extra;l<U;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=_e;break}r.mode=Vd;case Vd:if(u===0)break e;if(f=p-u,r.offset>f){if(f=r.offset-f,f>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=_e;break}f>r.wnext?(f-=r.wnext,h=r.wsize-f):h=r.wnext-f,f>r.length&&(f=r.length),g=r.window}else g=i,h=o-r.offset,f=r.length;f>u&&(f=u),u-=f,r.length-=f;do i[o++]=g[h++];while(--f);r.length===0&&(r.mode=qo);break;case zd:if(u===0)break e;i[o++]=r.length,u--,r.mode=qo;break;case xu:if(r.wrap){for(;l<32;){if(s===0)break e;s--,c|=n[a++]<<l,l+=8}if(p-=u,t.total_out+=p,r.total+=p,r.wrap&4&&p&&(t.adler=r.check=r.flags?Ue(r.check,i,p,o-p):Ta(r.check,i,p,o-p)),p=u,r.wrap&4&&(r.flags?c:Hd(c))!==r.check){t.msg="incorrect data check",r.mode=_e;break}c=0,l=0}r.mode=Qd;case Qd:if(r.wrap&&r.flags){for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.wrap&4&&c!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=_e;break}c=0,l=0}r.mode=Gd;case Gd:O=k0;break e;case _e:O=Wh;break e;case Zh:return Kh;case Yh:default:return kt}return t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,(r.wsize||p!==t.avail_out&&r.mode<_e&&(r.mode<xu||e!==Cd))&&rm(t,t.output,t.next_out,p-t.avail_out),d-=t.avail_in,p-=t.avail_out,t.total_in+=d,t.total_out+=p,r.total+=p,r.wrap&4&&p&&(t.adler=r.check=r.flags?Ue(r.check,i,p,t.next_out-p):Ta(r.check,i,p,t.next_out-p)),t.data_type=r.bits+(r.last?64:0)+(r.mode===ir?128:0)+(r.mode===Uo||r.mode===Cu?256:0),(d===0&&p===0||e===Cd)&&O===kn&&(O=A0),O},F0=t=>{if(Rn(t))return kt;let e=t.state;return e.window&&(e.window=null),t.state=null,kn},M0=(t,e)=>{if(Rn(t))return kt;let r=t.state;return(r.wrap&2)===0?kt:(r.head=e,e.done=!1,kn)},j0=(t,e)=>{let r=e.length,n,i,a;return Rn(t)||(n=t.state,n.wrap!==0&&n.mode!==ys)?kt:n.mode===ys&&(i=1,i=Ta(i,e,r,0),i!==n.check)?Wh:(a=rm(t,e,r,r),a?(n.mode=Zh,Kh):(n.havedict=1,kn))},U0=Xh,q0=em,B0=Jh,V0=P0,z0=tm,Q0=$0,G0=F0,H0=M0,W0=j0,K0="pako inflate (from Nodeca project)",cr={inflateReset:U0,inflateReset2:q0,inflateResetKeep:B0,inflateInit:V0,inflateInit2:z0,inflate:Q0,inflateEnd:G0,inflateGetHeader:H0,inflateSetDictionary:W0,inflateInfo:K0};function Z0(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var Y0=Z0,nm=Object.prototype.toString,{Z_NO_FLUSH:J0,Z_FINISH:X0,Z_OK:Oa,Z_STREAM_END:Au,Z_NEED_DICT:Iu,Z_STREAM_ERROR:e2,Z_DATA_ERROR:Kd,Z_MEM_ERROR:t2}=Nn;function Fa(t){this.options=Is.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});let e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15)===0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zh,this.strm.avail_out=0;let r=cr.inflateInit2(this.strm,e.windowBits);if(r!==Oa)throw new Error(Cn[r]);if(this.header=new Y0,cr.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Ia.string2buf(e.dictionary):nm.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=cr.inflateSetDictionary(this.strm,e.dictionary),r!==Oa)))throw new Error(Cn[r])}Fa.prototype.push=function(t,e){let r=this.strm,n=this.options.chunkSize,i=this.options.dictionary,a,o,s;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?X0:J0,nm.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),a=cr.inflate(r,o),a===Iu&&i&&(a=cr.inflateSetDictionary(r,i),a===Oa?a=cr.inflate(r,o):a===Kd&&(a=Iu));r.avail_in>0&&a===Au&&r.state.wrap>0&&t[r.next_in]!==0;)cr.inflateReset(r),a=cr.inflate(r,o);switch(a){case e2:case Kd:case Iu:case t2:return this.onEnd(a),this.ended=!0,!1}if(s=r.avail_out,r.next_out&&(r.avail_out===0||a===Au))if(this.options.to==="string"){let u=Ia.utf8border(r.output,r.next_out),c=r.next_out-u,l=Ia.buf2string(r.output,u);r.next_out=c,r.avail_out=n-c,c&&r.output.set(r.output.subarray(u,u+c),0),this.onData(l)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(!(a===Oa&&s===0)){if(a===Au)return a=cr.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};Fa.prototype.onData=function(t){this.chunks.push(t)};Fa.prototype.onEnd=function(t){t===Oa&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Is.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function pl(t,e){let r=new Fa(e);if(r.push(t),r.err)throw r.msg||Cn[r.err];return r.result}function r2(t,e){return e=e||{},e.raw=!0,pl(t,e)}var n2=Fa,i2=pl,a2=r2,o2=pl,s2=Nn,c2={Inflate:n2,inflate:i2,inflateRaw:a2,ungzip:o2,constants:s2},{Deflate:u2,deflate:l2,deflateRaw:f2,gzip:p2}=g0,{Inflate:d2,inflate:h2,inflateRaw:m2,ungzip:g2}=c2,y2=u2,v2=l2,b2=f2,_2=p2,w2=d2,S2=h2,E2=m2,C2=g2,x2=Nn,k2={Deflate:y2,deflate:v2,deflateRaw:b2,gzip:_2,Inflate:w2,inflate:S2,inflateRaw:E2,ungzip:C2,constants:x2},me=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},ge=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},vs=class{constructor(e,r){this.input=e,this.output=r}};me([w(),ge("design:type",String)],vs.prototype,"input",void 0);me([w(),ge("design:type",String)],vs.prototype,"output",void 0);vs=me([He(),ge("design:paramtypes",[String,String])],vs);var bs=class{constructor(e,r){this.input=e,this.output=r}};me([w(),ge("design:type",String)],bs.prototype,"input",void 0);me([w(),ge("design:type",String)],bs.prototype,"output",void 0);bs=me([Z(),ge("design:paramtypes",[String,String])],bs);var jr=class{constructor(e,r,n,i,a){this.name=e,this.modelId=r,this.systemPrompt=n,this.promptExamples=i,this.metaData=a}};me([w(),ge("design:type",String)],jr.prototype,"name",void 0);me([w(),ge("design:type",String)],jr.prototype,"modelId",void 0);me([w(),ge("design:type",String)],jr.prototype,"systemPrompt",void 0);me([w(),ge("design:type",Array)],jr.prototype,"promptExamples",void 0);me([w(),ge("design:type",String)],jr.prototype,"metaData",void 0);jr=me([He(),ge("design:paramtypes",[String,String,String,Array,String])],jr);var Zt=class{constructor(e,r,n,i,a,o,s,u){this.name=e,this.modelId=r,this.taskId=n,this.systemPrompt=i,this.promptExamples=a,this.metaData=o,this.createdAt=s,this.updatedAt=u}};me([w(),ge("design:type",String)],Zt.prototype,"name",void 0);me([w(),ge("design:type",String)],Zt.prototype,"modelId",void 0);me([w(),ge("design:type",String)],Zt.prototype,"taskId",void 0);me([w(),ge("design:type",String)],Zt.prototype,"systemPrompt",void 0);me([w(),ge("design:type",Array)],Zt.prototype,"promptExamples",void 0);me([w(),ge("design:type",String)],Zt.prototype,"metaData",void 0);me([w(),ge("design:type",String)],Zt.prototype,"createdAt",void 0);me([w(),ge("design:type",String)],Zt.prototype,"updatedAt",void 0);Zt=me([Z(),ge("design:paramtypes",[String,String,String,String,Array,String,String,String])],Zt);var Tn=class{constructor(e,r,n,i,a){this.model=e,this.status=r,this.progress=n,this.downloaded=i,this.loaded=a}};me([w(),ge("design:type",String)],Tn.prototype,"model",void 0);me([w(),ge("design:type",String)],Tn.prototype,"status",void 0);me([w(),ge("design:type",Number)],Tn.prototype,"progress",void 0);me([w(),ge("design:type",Boolean)],Tn.prototype,"downloaded",void 0);me([w(),ge("design:type",Boolean)],Tn.prototype,"loaded",void 0);Tn=me([Z(),ge("design:paramtypes",[String,String,Number,Boolean,Boolean])],Tn);var T2=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},$e=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Pe,Jo,Xu=class{constructor(e,r=!0){Pe.set(this,void 0),Jo.set(this,new Map),T2(this,Pe,e,"f")}async getModels(){let e=await $e(this,Pe,"f").query({query:E`
|
|
713
|
+
}`,variables:{url:e,interactionCall:r}}));return n}};_r=new WeakMap;var fc={};fc.byteLength=_0;fc.toByteArray=S0;fc.fromByteArray=E0;var ir=[],Lt=[],b0=typeof Uint8Array<"u"?Uint8Array:Array,el="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(En=0,Jd=el.length;En<Jd;++En)ir[En]=el[En],Lt[el.charCodeAt(En)]=En;var En,Jd;Lt["-".charCodeAt(0)]=62;Lt["_".charCodeAt(0)]=63;function y1(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function _0(t){var e=y1(t),r=e[0],n=e[1];return(r+n)*3/4-n}function w0(t,e,r){return(e+r)*3/4-r}function S0(t){var e,r=y1(t),n=r[0],i=r[1],a=new b0(w0(t,n,i)),o=0,s=i>0?n-4:n,u;for(u=0;u<s;u+=4)e=Lt[t.charCodeAt(u)]<<18|Lt[t.charCodeAt(u+1)]<<12|Lt[t.charCodeAt(u+2)]<<6|Lt[t.charCodeAt(u+3)],a[o++]=e>>16&255,a[o++]=e>>8&255,a[o++]=e&255;return i===2&&(e=Lt[t.charCodeAt(u)]<<2|Lt[t.charCodeAt(u+1)]>>4,a[o++]=e&255),i===1&&(e=Lt[t.charCodeAt(u)]<<10|Lt[t.charCodeAt(u+1)]<<4|Lt[t.charCodeAt(u+2)]>>2,a[o++]=e>>8&255,a[o++]=e&255),a}function C0(t){return ir[t>>18&63]+ir[t>>12&63]+ir[t>>6&63]+ir[t&63]}function x0(t,e,r){for(var n,i=[],a=e;a<r;a+=3)n=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(t[a+2]&255),i.push(C0(n));return i.join("")}function E0(t){for(var e,r=t.length,n=r%3,i=[],a=16383,o=0,s=r-n;o<s;o+=a)i.push(x0(t,o,o+a>s?s:o+a));return n===1?(e=t[r-1],i.push(ir[e>>2]+ir[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(ir[e>>10]+ir[e>>4&63]+ir[e<<2&63]+"=")),i.join("")}var k0=4,Yd=0,Xd=1,A0=2;function Qi(t){let e=t.length;for(;--e>=0;)t[e]=0}var I0=0,v1=1,T0=2,O0=3,D0=258,Wl=29,go=256,no=go+1+Wl,Ni=30,Kl=19,b1=2*no+1,Rn=15,tl=16,N0=7,Zl=256,_1=16,w1=17,S1=18,Ol=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Ls=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),P0=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),C1=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),R0=512,wr=new Array((no+2)*2);Qi(wr);var Wa=new Array(Ni*2);Qi(Wa);var io=new Array(R0);Qi(io);var ao=new Array(D0-O0+1);Qi(ao);var Jl=new Array(Wl);Qi(Jl);var ec=new Array(Ni);Qi(ec);function rl(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}var x1,E1,k1;function nl(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}var A1=t=>t<256?io[t]:io[256+(t>>>7)],oo=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},wt=(t,e,r)=>{t.bi_valid>tl-r?(t.bi_buf|=e<<t.bi_valid&65535,oo(t,t.bi_buf),t.bi_buf=e>>tl-t.bi_valid,t.bi_valid+=r-tl):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)},ar=(t,e,r)=>{wt(t,r[e*2],r[e*2+1])},I1=(t,e)=>{let r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1},$0=t=>{t.bi_valid===16?(oo(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)},L0=(t,e)=>{let r=e.dyn_tree,n=e.max_code,i=e.stat_desc.static_tree,a=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,s=e.stat_desc.extra_base,u=e.stat_desc.max_length,c,l,d,f,p,h,g=0;for(f=0;f<=Rn;f++)t.bl_count[f]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<b1;c++)l=t.heap[c],f=r[r[l*2+1]*2+1]+1,f>u&&(f=u,g++),r[l*2+1]=f,!(l>n)&&(t.bl_count[f]++,p=0,l>=s&&(p=o[l-s]),h=r[l*2],t.opt_len+=h*(f+p),a&&(t.static_len+=h*(i[l*2+1]+p)));if(g!==0){do{for(f=u-1;t.bl_count[f]===0;)f--;t.bl_count[f]--,t.bl_count[f+1]+=2,t.bl_count[u]--,g-=2}while(g>0);for(f=u;f!==0;f--)for(l=t.bl_count[f];l!==0;)d=t.heap[--c],!(d>n)&&(r[d*2+1]!==f&&(t.opt_len+=(f-r[d*2+1])*r[d*2],r[d*2+1]=f),l--)}},T1=(t,e,r)=>{let n=new Array(Rn+1),i=0,a,o;for(a=1;a<=Rn;a++)i=i+r[a-1]<<1,n[a]=i;for(o=0;o<=e;o++){let s=t[o*2+1];s!==0&&(t[o*2]=I1(n[s]++,s))}},F0=()=>{let t,e,r,n,i,a=new Array(Rn+1);for(r=0,n=0;n<Wl-1;n++)for(Jl[n]=r,t=0;t<1<<Ol[n];t++)ao[r++]=n;for(ao[r-1]=n,i=0,n=0;n<16;n++)for(ec[n]=i,t=0;t<1<<Ls[n];t++)io[i++]=n;for(i>>=7;n<Ni;n++)for(ec[n]=i<<7,t=0;t<1<<Ls[n]-7;t++)io[256+i++]=n;for(e=0;e<=Rn;e++)a[e]=0;for(t=0;t<=143;)wr[t*2+1]=8,t++,a[8]++;for(;t<=255;)wr[t*2+1]=9,t++,a[9]++;for(;t<=279;)wr[t*2+1]=7,t++,a[7]++;for(;t<=287;)wr[t*2+1]=8,t++,a[8]++;for(T1(wr,no+1,a),t=0;t<Ni;t++)Wa[t*2+1]=5,Wa[t*2]=I1(t,5);x1=new rl(wr,Ol,go+1,no,Rn),E1=new rl(Wa,Ls,0,Ni,Rn),k1=new rl(new Array(0),P0,0,Kl,N0)},O1=t=>{let e;for(e=0;e<no;e++)t.dyn_ltree[e*2]=0;for(e=0;e<Ni;e++)t.dyn_dtree[e*2]=0;for(e=0;e<Kl;e++)t.bl_tree[e*2]=0;t.dyn_ltree[Zl*2]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},D1=t=>{t.bi_valid>8?oo(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},eh=(t,e,r,n)=>{let i=e*2,a=r*2;return t[i]<t[a]||t[i]===t[a]&&n[e]<=n[r]},il=(t,e,r)=>{let n=t.heap[r],i=r<<1;for(;i<=t.heap_len&&(i<t.heap_len&&eh(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!eh(e,n,t.heap[i],t.depth));)t.heap[r]=t.heap[i],r=i,i<<=1;t.heap[r]=n},th=(t,e,r)=>{let n,i,a=0,o,s;if(t.sym_next!==0)do n=t.pending_buf[t.sym_buf+a++]&255,n+=(t.pending_buf[t.sym_buf+a++]&255)<<8,i=t.pending_buf[t.sym_buf+a++],n===0?ar(t,i,e):(o=ao[i],ar(t,o+go+1,e),s=Ol[o],s!==0&&(i-=Jl[o],wt(t,i,s)),n--,o=A1(n),ar(t,o,r),s=Ls[o],s!==0&&(n-=ec[o],wt(t,n,s)));while(a<t.sym_next);ar(t,Zl,e)},Dl=(t,e)=>{let r=e.dyn_tree,n=e.stat_desc.static_tree,i=e.stat_desc.has_stree,a=e.stat_desc.elems,o,s,u=-1,c;for(t.heap_len=0,t.heap_max=b1,o=0;o<a;o++)r[o*2]!==0?(t.heap[++t.heap_len]=u=o,t.depth[o]=0):r[o*2+1]=0;for(;t.heap_len<2;)c=t.heap[++t.heap_len]=u<2?++u:0,r[c*2]=1,t.depth[c]=0,t.opt_len--,i&&(t.static_len-=n[c*2+1]);for(e.max_code=u,o=t.heap_len>>1;o>=1;o--)il(t,r,o);c=a;do o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],il(t,r,1),s=t.heap[1],t.heap[--t.heap_max]=o,t.heap[--t.heap_max]=s,r[c*2]=r[o*2]+r[s*2],t.depth[c]=(t.depth[o]>=t.depth[s]?t.depth[o]:t.depth[s])+1,r[o*2+1]=r[s*2+1]=c,t.heap[1]=c++,il(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],L0(t,e),T1(r,u,t.bl_count)},rh=(t,e,r)=>{let n,i=-1,a,o=e[0*2+1],s=0,u=7,c=4;for(o===0&&(u=138,c=3),e[(r+1)*2+1]=65535,n=0;n<=r;n++)a=o,o=e[(n+1)*2+1],!(++s<u&&a===o)&&(s<c?t.bl_tree[a*2]+=s:a!==0?(a!==i&&t.bl_tree[a*2]++,t.bl_tree[_1*2]++):s<=10?t.bl_tree[w1*2]++:t.bl_tree[S1*2]++,s=0,i=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4))},nh=(t,e,r)=>{let n,i=-1,a,o=e[0*2+1],s=0,u=7,c=4;for(o===0&&(u=138,c=3),n=0;n<=r;n++)if(a=o,o=e[(n+1)*2+1],!(++s<u&&a===o)){if(s<c)do ar(t,a,t.bl_tree);while(--s!==0);else a!==0?(a!==i&&(ar(t,a,t.bl_tree),s--),ar(t,_1,t.bl_tree),wt(t,s-3,2)):s<=10?(ar(t,w1,t.bl_tree),wt(t,s-3,3)):(ar(t,S1,t.bl_tree),wt(t,s-11,7));s=0,i=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4)}},M0=t=>{let e;for(rh(t,t.dyn_ltree,t.l_desc.max_code),rh(t,t.dyn_dtree,t.d_desc.max_code),Dl(t,t.bl_desc),e=Kl-1;e>=3&&t.bl_tree[C1[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},U0=(t,e,r,n)=>{let i;for(wt(t,e-257,5),wt(t,r-1,5),wt(t,n-4,4),i=0;i<n;i++)wt(t,t.bl_tree[C1[i]*2+1],3);nh(t,t.dyn_ltree,e-1),nh(t,t.dyn_dtree,r-1)},j0=t=>{let e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return Yd;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return Xd;for(r=32;r<go;r++)if(t.dyn_ltree[r*2]!==0)return Xd;return Yd},ih=!1,B0=t=>{ih||(F0(),ih=!0),t.l_desc=new nl(t.dyn_ltree,x1),t.d_desc=new nl(t.dyn_dtree,E1),t.bl_desc=new nl(t.bl_tree,k1),t.bi_buf=0,t.bi_valid=0,O1(t)},N1=(t,e,r,n)=>{wt(t,(I0<<1)+(n?1:0),3),D1(t),oo(t,r),oo(t,~r),r&&t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r},q0=t=>{wt(t,v1<<1,3),ar(t,Zl,wr),$0(t)},V0=(t,e,r,n)=>{let i,a,o=0;t.level>0?(t.strm.data_type===A0&&(t.strm.data_type=j0(t)),Dl(t,t.l_desc),Dl(t,t.d_desc),o=M0(t),i=t.opt_len+3+7>>>3,a=t.static_len+3+7>>>3,a<=i&&(i=a)):i=a=r+5,r+4<=i&&e!==-1?N1(t,e,r,n):t.strategy===k0||a===i?(wt(t,(v1<<1)+(n?1:0),3),th(t,wr,Wa)):(wt(t,(T0<<1)+(n?1:0),3),U0(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),th(t,t.dyn_ltree,t.dyn_dtree)),O1(t),n&&D1(t)},Q0=(t,e,r)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=r,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(ao[r]+go+1)*2]++,t.dyn_dtree[A1(e)*2]++),t.sym_next===t.sym_end),z0=B0,H0=N1,G0=V0,W0=Q0,K0=q0,Z0={_tr_init:z0,_tr_stored_block:H0,_tr_flush_block:G0,_tr_tally:W0,_tr_align:K0},J0=(t,e,r,n)=>{let i=t&65535|0,a=t>>>16&65535|0,o=0;for(;r!==0;){o=r>2e3?2e3:r,r-=o;do i=i+e[n++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0},so=J0,Y0=()=>{let t,e=[];for(var r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e},X0=new Uint32Array(Y0()),ev=(t,e,r,n)=>{let i=X0,a=n+r;t^=-1;for(let o=n;o<a;o++)t=t>>>8^i[(t^e[o])&255];return t^-1},We=ev,Vn={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Yn={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},{_tr_init:tv,_tr_stored_block:Nl,_tr_flush_block:rv,_tr_tally:Zr,_tr_align:nv}=Z0,{Z_NO_FLUSH:Jr,Z_PARTIAL_FLUSH:iv,Z_FULL_FLUSH:av,Z_FINISH:Mt,Z_BLOCK:ah,Z_OK:rt,Z_STREAM_END:oh,Z_STREAM_ERROR:sr,Z_DATA_ERROR:ov,Z_BUF_ERROR:al,Z_DEFAULT_COMPRESSION:sv,Z_FILTERED:cv,Z_HUFFMAN_ONLY:_s,Z_RLE:uv,Z_FIXED:lv,Z_DEFAULT_STRATEGY:pv,Z_UNKNOWN:fv,Z_DEFLATED:dc}=Yn,dv=9,hv=15,mv=8,gv=29,yv=256,Pl=yv+1+gv,vv=30,bv=19,_v=2*Pl+1,wv=15,oe=3,Hr=258,cr=Hr+oe+1,Sv=32,Li=42,Yl=57,Rl=69,$l=73,Ll=91,Fl=103,$n=113,qa=666,dt=1,zi=2,Qn=3,Hi=4,Cv=3,Ln=(t,e)=>(t.msg=Vn[e],e),sh=t=>t*2-(t>4?9:0),zr=t=>{let e=t.length;for(;--e>=0;)t[e]=0},xv=t=>{let e,r,n,i=t.w_size;e=t.hash_size,n=e;do r=t.head[--n],t.head[n]=r>=i?r-i:0;while(--e);e=i,n=e;do r=t.prev[--n],t.prev[n]=r>=i?r-i:0;while(--e)},Ev=(t,e,r)=>(e<<t.hash_shift^r)&t.hash_mask,Yr=Ev,Et=t=>{let e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))},At=(t,e)=>{rv(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,Et(t.strm)},de=(t,e)=>{t.pending_buf[t.pending++]=e},xa=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},Ml=(t,e,r,n)=>{let i=t.avail_in;return i>n&&(i=n),i===0?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),r),t.state.wrap===1?t.adler=so(t.adler,e,i,r):t.state.wrap===2&&(t.adler=We(t.adler,e,i,r)),t.next_in+=i,t.total_in+=i,i)},P1=(t,e)=>{let r=t.max_chain_length,n=t.strstart,i,a,o=t.prev_length,s=t.nice_match,u=t.strstart>t.w_size-cr?t.strstart-(t.w_size-cr):0,c=t.window,l=t.w_mask,d=t.prev,f=t.strstart+Hr,p=c[n+o-1],h=c[n+o];t.prev_length>=t.good_match&&(r>>=2),s>t.lookahead&&(s=t.lookahead);do if(i=e,!(c[i+o]!==h||c[i+o-1]!==p||c[i]!==c[n]||c[++i]!==c[n+1])){n+=2,i++;do;while(c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&n<f);if(a=Hr-(f-n),n=f-Hr,a>o){if(t.match_start=e,o=a,a>=s)break;p=c[n+o-1],h=c[n+o]}}while((e=d[e&l])>u&&--r!==0);return o<=t.lookahead?o:t.lookahead},Fi=t=>{let e=t.w_size,r,n,i;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-cr)&&(t.window.set(t.window.subarray(e,e+e-n),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),xv(t),n+=e),t.strm.avail_in===0)break;if(r=Ml(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=r,t.lookahead+t.insert>=oe)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=Yr(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=Yr(t,t.ins_h,t.window[i+oe-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<oe)););}while(t.lookahead<cr&&t.strm.avail_in!==0)},R1=(t,e)=>{let r=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,n,i,a,o=0,s=t.strm.avail_in;do{if(n=65535,a=t.bi_valid+42>>3,t.strm.avail_out<a||(a=t.strm.avail_out-a,i=t.strstart-t.block_start,n>i+t.strm.avail_in&&(n=i+t.strm.avail_in),n>a&&(n=a),n<r&&(n===0&&e!==Mt||e===Jr||n!==i+t.strm.avail_in)))break;o=e===Mt&&n===i+t.strm.avail_in?1:0,Nl(t,0,0,o),t.pending_buf[t.pending-4]=n,t.pending_buf[t.pending-3]=n>>8,t.pending_buf[t.pending-2]=~n,t.pending_buf[t.pending-1]=~n>>8,Et(t.strm),i&&(i>n&&(i=n),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,n-=i),n&&(Ml(t.strm,t.strm.output,t.strm.next_out,n),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n)}while(o===0);return s-=t.strm.avail_in,s&&(s>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=s&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-s,t.strm.next_in),t.strstart),t.strstart+=s,t.insert+=s>t.w_size-t.insert?t.w_size-t.insert:s),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),o?Hi:e!==Jr&&e!==Mt&&t.strm.avail_in===0&&t.strstart===t.block_start?zi:(a=t.window_size-t.strstart,t.strm.avail_in>a&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,a+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),a>t.strm.avail_in&&(a=t.strm.avail_in),a&&(Ml(t.strm,t.window,t.strstart,a),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.high_water<t.strstart&&(t.high_water=t.strstart),a=t.bi_valid+42>>3,a=t.pending_buf_size-a>65535?65535:t.pending_buf_size-a,r=a>t.w_size?t.w_size:a,i=t.strstart-t.block_start,(i>=r||(i||e===Mt)&&e!==Jr&&t.strm.avail_in===0&&i<=a)&&(n=i>a?a:i,o=e===Mt&&t.strm.avail_in===0&&n===i?1:0,Nl(t,t.block_start,n,o),t.block_start+=n,Et(t.strm)),o?Qn:dt)},ol=(t,e)=>{let r,n;for(;;){if(t.lookahead<cr){if(Fi(t),t.lookahead<cr&&e===Jr)return dt;if(t.lookahead===0)break}if(r=0,t.lookahead>=oe&&(t.ins_h=Yr(t,t.ins_h,t.window[t.strstart+oe-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),r!==0&&t.strstart-r<=t.w_size-cr&&(t.match_length=P1(t,r)),t.match_length>=oe)if(n=Zr(t,t.strstart-t.match_start,t.match_length-oe),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=oe){t.match_length--;do t.strstart++,t.ins_h=Yr(t,t.ins_h,t.window[t.strstart+oe-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=Yr(t,t.ins_h,t.window[t.strstart+1]);else n=Zr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(At(t,!1),t.strm.avail_out===0))return dt}return t.insert=t.strstart<oe-1?t.strstart:oe-1,e===Mt?(At(t,!0),t.strm.avail_out===0?Qn:Hi):t.sym_next&&(At(t,!1),t.strm.avail_out===0)?dt:zi},Ei=(t,e)=>{let r,n,i;for(;;){if(t.lookahead<cr){if(Fi(t),t.lookahead<cr&&e===Jr)return dt;if(t.lookahead===0)break}if(r=0,t.lookahead>=oe&&(t.ins_h=Yr(t,t.ins_h,t.window[t.strstart+oe-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=oe-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-cr&&(t.match_length=P1(t,r),t.match_length<=5&&(t.strategy===cv||t.match_length===oe&&t.strstart-t.match_start>4096)&&(t.match_length=oe-1)),t.prev_length>=oe&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-oe,n=Zr(t,t.strstart-1-t.prev_match,t.prev_length-oe),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=Yr(t,t.ins_h,t.window[t.strstart+oe-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=oe-1,t.strstart++,n&&(At(t,!1),t.strm.avail_out===0))return dt}else if(t.match_available){if(n=Zr(t,0,t.window[t.strstart-1]),n&&At(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return dt}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=Zr(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<oe-1?t.strstart:oe-1,e===Mt?(At(t,!0),t.strm.avail_out===0?Qn:Hi):t.sym_next&&(At(t,!1),t.strm.avail_out===0)?dt:zi},kv=(t,e)=>{let r,n,i,a,o=t.window;for(;;){if(t.lookahead<=Hr){if(Fi(t),t.lookahead<=Hr&&e===Jr)return dt;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=oe&&t.strstart>0&&(i=t.strstart-1,n=o[i],n===o[++i]&&n===o[++i]&&n===o[++i])){a=t.strstart+Hr;do;while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&i<a);t.match_length=Hr-(a-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=oe?(r=Zr(t,1,t.match_length-oe),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=Zr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(At(t,!1),t.strm.avail_out===0))return dt}return t.insert=0,e===Mt?(At(t,!0),t.strm.avail_out===0?Qn:Hi):t.sym_next&&(At(t,!1),t.strm.avail_out===0)?dt:zi},Av=(t,e)=>{let r;for(;;){if(t.lookahead===0&&(Fi(t),t.lookahead===0)){if(e===Jr)return dt;break}if(t.match_length=0,r=Zr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(At(t,!1),t.strm.avail_out===0))return dt}return t.insert=0,e===Mt?(At(t,!0),t.strm.avail_out===0?Qn:Hi):t.sym_next&&(At(t,!1),t.strm.avail_out===0)?dt:zi};function tr(t,e,r,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=i}var Va=[new tr(0,0,0,0,R1),new tr(4,4,8,4,ol),new tr(4,5,16,8,ol),new tr(4,6,32,32,ol),new tr(4,4,16,16,Ei),new tr(8,16,32,32,Ei),new tr(8,16,128,128,Ei),new tr(8,32,128,256,Ei),new tr(32,128,258,1024,Ei),new tr(32,258,258,4096,Ei)],Iv=t=>{t.window_size=2*t.w_size,zr(t.head),t.max_lazy_match=Va[t.level].max_lazy,t.good_match=Va[t.level].good_length,t.nice_match=Va[t.level].nice_length,t.max_chain_length=Va[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=oe-1,t.match_available=0,t.ins_h=0};function Tv(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=dc,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(_v*2),this.dyn_dtree=new Uint16Array((2*vv+1)*2),this.bl_tree=new Uint16Array((2*bv+1)*2),zr(this.dyn_ltree),zr(this.dyn_dtree),zr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(wv+1),this.heap=new Uint16Array(2*Pl+1),zr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Pl+1),zr(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var yo=t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.status!==Li&&e.status!==Yl&&e.status!==Rl&&e.status!==$l&&e.status!==Ll&&e.status!==Fl&&e.status!==$n&&e.status!==qa?1:0},$1=t=>{if(yo(t))return Ln(t,sr);t.total_in=t.total_out=0,t.data_type=fv;let e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?Yl:e.wrap?Li:$n,t.adler=e.wrap===2?0:1,e.last_flush=-2,tv(e),rt},L1=t=>{let e=$1(t);return e===rt&&Iv(t.state),e},Ov=(t,e)=>yo(t)||t.state.wrap!==2?sr:(t.state.gzhead=e,rt),F1=(t,e,r,n,i,a)=>{if(!t)return sr;let o=1;if(e===sv&&(e=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>dv||r!==dc||n<8||n>15||e<0||e>9||a<0||a>lv||n===8&&o!==1)return Ln(t,sr);n===8&&(n=9);let s=new Tv;return t.state=s,s.strm=t,s.status=Li,s.wrap=o,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+oe-1)/oe),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=e,s.strategy=a,s.method=r,L1(t)},Dv=(t,e)=>F1(t,e,dc,hv,mv,pv),Nv=(t,e)=>{if(yo(t)||e>ah||e<0)return t?Ln(t,sr):sr;let r=t.state;if(!t.output||t.avail_in!==0&&!t.input||r.status===qa&&e!==Mt)return Ln(t,t.avail_out===0?al:sr);let n=r.last_flush;if(r.last_flush=e,r.pending!==0){if(Et(t),t.avail_out===0)return r.last_flush=-1,rt}else if(t.avail_in===0&&sh(e)<=sh(n)&&e!==Mt)return Ln(t,al);if(r.status===qa&&t.avail_in!==0)return Ln(t,al);if(r.status===Li&&r.wrap===0&&(r.status=$n),r.status===Li){let i=dc+(r.w_bits-8<<4)<<8,a=-1;if(r.strategy>=_s||r.level<2?a=0:r.level<6?a=1:r.level===6?a=2:a=3,i|=a<<6,r.strstart!==0&&(i|=Sv),i+=31-i%31,xa(r,i),r.strstart!==0&&(xa(r,t.adler>>>16),xa(r,t.adler&65535)),t.adler=1,r.status=$n,Et(t),r.pending!==0)return r.last_flush=-1,rt}if(r.status===Yl){if(t.adler=0,de(r,31),de(r,139),de(r,8),r.gzhead)de(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),de(r,r.gzhead.time&255),de(r,r.gzhead.time>>8&255),de(r,r.gzhead.time>>16&255),de(r,r.gzhead.time>>24&255),de(r,r.level===9?2:r.strategy>=_s||r.level<2?4:0),de(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(de(r,r.gzhead.extra.length&255),de(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=We(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Rl;else if(de(r,0),de(r,0),de(r,0),de(r,0),de(r,0),de(r,r.level===9?2:r.strategy>=_s||r.level<2?4:0),de(r,Cv),r.status=$n,Et(t),r.pending!==0)return r.last_flush=-1,rt}if(r.status===Rl){if(r.gzhead.extra){let i=r.pending,a=(r.gzhead.extra.length&65535)-r.gzindex;for(;r.pending+a>r.pending_buf_size;){let s=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+s),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>i&&(t.adler=We(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex+=s,Et(t),r.pending!==0)return r.last_flush=-1,rt;i=0,a-=s}let o=new Uint8Array(r.gzhead.extra);r.pending_buf.set(o.subarray(r.gzindex,r.gzindex+a),r.pending),r.pending+=a,r.gzhead.hcrc&&r.pending>i&&(t.adler=We(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=$l}if(r.status===$l){if(r.gzhead.name){let i=r.pending,a;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(t.adler=We(t.adler,r.pending_buf,r.pending-i,i)),Et(t),r.pending!==0)return r.last_flush=-1,rt;i=0}r.gzindex<r.gzhead.name.length?a=r.gzhead.name.charCodeAt(r.gzindex++)&255:a=0,de(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(t.adler=We(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=Ll}if(r.status===Ll){if(r.gzhead.comment){let i=r.pending,a;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(t.adler=We(t.adler,r.pending_buf,r.pending-i,i)),Et(t),r.pending!==0)return r.last_flush=-1,rt;i=0}r.gzindex<r.gzhead.comment.length?a=r.gzhead.comment.charCodeAt(r.gzindex++)&255:a=0,de(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(t.adler=We(t.adler,r.pending_buf,r.pending-i,i))}r.status=Fl}if(r.status===Fl){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(Et(t),r.pending!==0))return r.last_flush=-1,rt;de(r,t.adler&255),de(r,t.adler>>8&255),t.adler=0}if(r.status=$n,Et(t),r.pending!==0)return r.last_flush=-1,rt}if(t.avail_in!==0||r.lookahead!==0||e!==Jr&&r.status!==qa){let i=r.level===0?R1(r,e):r.strategy===_s?Av(r,e):r.strategy===uv?kv(r,e):Va[r.level].func(r,e);if((i===Qn||i===Hi)&&(r.status=qa),i===dt||i===Qn)return t.avail_out===0&&(r.last_flush=-1),rt;if(i===zi&&(e===iv?nv(r):e!==ah&&(Nl(r,0,0,!1),e===av&&(zr(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),Et(t),t.avail_out===0))return r.last_flush=-1,rt}return e!==Mt?rt:r.wrap<=0?oh:(r.wrap===2?(de(r,t.adler&255),de(r,t.adler>>8&255),de(r,t.adler>>16&255),de(r,t.adler>>24&255),de(r,t.total_in&255),de(r,t.total_in>>8&255),de(r,t.total_in>>16&255),de(r,t.total_in>>24&255)):(xa(r,t.adler>>>16),xa(r,t.adler&65535)),Et(t),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?rt:oh)},Pv=t=>{if(yo(t))return sr;let e=t.state.status;return t.state=null,e===$n?Ln(t,ov):rt},Rv=(t,e)=>{let r=e.length;if(yo(t))return sr;let n=t.state,i=n.wrap;if(i===2||i===1&&n.status!==Li||n.lookahead)return sr;if(i===1&&(t.adler=so(t.adler,e,r,0)),n.wrap=0,r>=n.w_size){i===0&&(zr(n.head),n.strstart=0,n.block_start=0,n.insert=0);let u=new Uint8Array(n.w_size);u.set(e.subarray(r-n.w_size,r),0),e=u,r=n.w_size}let a=t.avail_in,o=t.next_in,s=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,Fi(n);n.lookahead>=oe;){let u=n.strstart,c=n.lookahead-(oe-1);do n.ins_h=Yr(n,n.ins_h,n.window[u+oe-1]),n.prev[u&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=u,u++;while(--c);n.strstart=u,n.lookahead=oe-1,Fi(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=oe-1,n.match_available=0,t.next_in=o,t.input=s,t.avail_in=a,n.wrap=i,rt},$v=Dv,Lv=F1,Fv=L1,Mv=$1,Uv=Ov,jv=Nv,Bv=Pv,qv=Rv,Vv="pako deflate (from Nodeca project)",Ka={deflateInit:$v,deflateInit2:Lv,deflateReset:Fv,deflateResetKeep:Mv,deflateSetHeader:Uv,deflate:jv,deflateEnd:Bv,deflateSetDictionary:qv,deflateInfo:Vv},Qv=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),zv=function(t){let e=Array.prototype.slice.call(arguments,1);for(;e.length;){let r=e.shift();if(!!r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(let n in r)Qv(r,n)&&(t[n]=r[n])}}return t},Hv=t=>{let e=0;for(let n=0,i=t.length;n<i;n++)e+=t[n].length;let r=new Uint8Array(e);for(let n=0,i=0,a=t.length;n<a;n++){let o=t[n];r.set(o,i),i+=o.length}return r},hc={assign:zv,flattenChunks:Hv},M1=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){M1=!1}var co=new Uint8Array(256);for(let t=0;t<256;t++)co[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;co[254]=co[254]=1;var Gv=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,r,n,i,a,o=t.length,s=0;for(i=0;i<o;i++)r=t.charCodeAt(i),(r&64512)===55296&&i+1<o&&(n=t.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Uint8Array(s),a=0,i=0;a<s;i++)r=t.charCodeAt(i),(r&64512)===55296&&i+1<o&&(n=t.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?e[a++]=r:r<2048?(e[a++]=192|r>>>6,e[a++]=128|r&63):r<65536?(e[a++]=224|r>>>12,e[a++]=128|r>>>6&63,e[a++]=128|r&63):(e[a++]=240|r>>>18,e[a++]=128|r>>>12&63,e[a++]=128|r>>>6&63,e[a++]=128|r&63);return e},Wv=(t,e)=>{if(e<65534&&t.subarray&&M1)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let r="";for(let n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r},Kv=(t,e)=>{let r=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let n,i,a=new Array(r*2);for(i=0,n=0;n<r;){let o=t[n++];if(o<128){a[i++]=o;continue}let s=co[o];if(s>4){a[i++]=65533,n+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&n<r;)o=o<<6|t[n++]&63,s--;if(s>1){a[i++]=65533;continue}o<65536?a[i++]=o:(o-=65536,a[i++]=55296|o>>10&1023,a[i++]=56320|o&1023)}return Wv(a,i)},Zv=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let r=e-1;for(;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+co[t[r]]>e?r:e},uo={string2buf:Gv,buf2string:Kv,utf8border:Zv};function Jv(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var U1=Jv,j1=Object.prototype.toString,{Z_NO_FLUSH:Yv,Z_SYNC_FLUSH:Xv,Z_FULL_FLUSH:e2,Z_FINISH:t2,Z_OK:tc,Z_STREAM_END:r2,Z_DEFAULT_COMPRESSION:n2,Z_DEFAULT_STRATEGY:i2,Z_DEFLATED:a2}=Yn;function vo(t){this.options=hc.assign({level:n2,method:a2,chunkSize:16384,windowBits:15,memLevel:8,strategy:i2},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new U1,this.strm.avail_out=0;let r=Ka.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==tc)throw new Error(Vn[r]);if(e.header&&Ka.deflateSetHeader(this.strm,e.header),e.dictionary){let n;if(typeof e.dictionary=="string"?n=uo.string2buf(e.dictionary):j1.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,r=Ka.deflateSetDictionary(this.strm,n),r!==tc)throw new Error(Vn[r]);this._dict_set=!0}}vo.prototype.push=function(t,e){let r=this.strm,n=this.options.chunkSize,i,a;if(this.ended)return!1;for(e===~~e?a=e:a=e===!0?t2:Yv,typeof t=="string"?r.input=uo.string2buf(t):j1.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){if(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(a===Xv||a===e2)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(i=Ka.deflate(r,a),i===r2)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=Ka.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===tc;if(r.avail_out===0){this.onData(r.output);continue}if(a>0&&r.next_out>0){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(r.avail_in===0)break}return!0};vo.prototype.onData=function(t){this.chunks.push(t)};vo.prototype.onEnd=function(t){t===tc&&(this.result=hc.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Xl(t,e){let r=new vo(e);if(r.push(t,!0),r.err)throw r.msg||Vn[r.err];return r.result}function o2(t,e){return e=e||{},e.raw=!0,Xl(t,e)}function s2(t,e){return e=e||{},e.gzip=!0,Xl(t,e)}var c2=vo,u2=Xl,l2=o2,p2=s2,f2=Yn,d2={Deflate:c2,deflate:u2,deflateRaw:l2,gzip:p2,constants:f2},ws=16209,h2=16191,m2=function t(e,r){let n,i,a,o,s,u,c,l,d,f,p,h,g,b,C,w,_,y,T,R,k,P,M,$,V=e.state;n=e.next_in,M=e.input,i=n+(e.avail_in-5),a=e.next_out,$=e.output,o=a-(r-e.avail_out),s=a+(e.avail_out-257),u=V.dmax,c=V.wsize,l=V.whave,d=V.wnext,f=V.window,p=V.hold,h=V.bits,g=V.lencode,b=V.distcode,C=(1<<V.lenbits)-1,w=(1<<V.distbits)-1;e:do{h<15&&(p+=M[n++]<<h,h+=8,p+=M[n++]<<h,h+=8),_=g[p&C];t:for(;;){if(y=_>>>24,p>>>=y,h-=y,y=_>>>16&255,y===0)$[a++]=_&65535;else if(y&16){T=_&65535,y&=15,y&&(h<y&&(p+=M[n++]<<h,h+=8),T+=p&(1<<y)-1,p>>>=y,h-=y),h<15&&(p+=M[n++]<<h,h+=8,p+=M[n++]<<h,h+=8),_=b[p&w];r:for(;;){if(y=_>>>24,p>>>=y,h-=y,y=_>>>16&255,y&16){if(R=_&65535,y&=15,h<y&&(p+=M[n++]<<h,h+=8,h<y&&(p+=M[n++]<<h,h+=8)),R+=p&(1<<y)-1,R>u){e.msg="invalid distance too far back",V.mode=ws;break e}if(p>>>=y,h-=y,y=a-o,R>y){if(y=R-y,y>l&&V.sane){e.msg="invalid distance too far back",V.mode=ws;break e}if(k=0,P=f,d===0){if(k+=c-y,y<T){T-=y;do $[a++]=f[k++];while(--y);k=a-R,P=$}}else if(d<y){if(k+=c+d-y,y-=d,y<T){T-=y;do $[a++]=f[k++];while(--y);if(k=0,d<T){y=d,T-=y;do $[a++]=f[k++];while(--y);k=a-R,P=$}}}else if(k+=d-y,y<T){T-=y;do $[a++]=f[k++];while(--y);k=a-R,P=$}for(;T>2;)$[a++]=P[k++],$[a++]=P[k++],$[a++]=P[k++],T-=3;T&&($[a++]=P[k++],T>1&&($[a++]=P[k++]))}else{k=a-R;do $[a++]=$[k++],$[a++]=$[k++],$[a++]=$[k++],T-=3;while(T>2);T&&($[a++]=$[k++],T>1&&($[a++]=$[k++]))}}else if((y&64)===0){_=b[(_&65535)+(p&(1<<y)-1)];continue r}else{e.msg="invalid distance code",V.mode=ws;break e}break}}else if((y&64)===0){_=g[(_&65535)+(p&(1<<y)-1)];continue t}else if(y&32){V.mode=h2;break e}else{e.msg="invalid literal/length code",V.mode=ws;break e}break}}while(n<i&&a<s);T=h>>3,n-=T,h-=T<<3,p&=(1<<h)-1,e.next_in=n,e.next_out=a,e.avail_in=n<i?5+(i-n):5-(n-i),e.avail_out=a<s?257+(s-a):257-(a-s),V.hold=p,V.bits=h},ki=15,ch=852,uh=592,lh=0,sl=1,ph=2,g2=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),y2=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),v2=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),b2=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),_2=(t,e,r,n,i,a,o,s)=>{let u=s.bits,c=0,l=0,d=0,f=0,p=0,h=0,g=0,b=0,C=0,w=0,_,y,T,R,k,P=null,M,$=new Uint16Array(ki+1),V=new Uint16Array(ki+1),Je=null,je,Q,_e;for(c=0;c<=ki;c++)$[c]=0;for(l=0;l<n;l++)$[e[r+l]]++;for(p=u,f=ki;f>=1&&$[f]===0;f--);if(p>f&&(p=f),f===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,s.bits=1,0;for(d=1;d<f&&$[d]===0;d++);for(p<d&&(p=d),b=1,c=1;c<=ki;c++)if(b<<=1,b-=$[c],b<0)return-1;if(b>0&&(t===lh||f!==1))return-1;for(V[1]=0,c=1;c<ki;c++)V[c+1]=V[c]+$[c];for(l=0;l<n;l++)e[r+l]!==0&&(o[V[e[r+l]]++]=l);if(t===lh?(P=Je=o,M=20):t===sl?(P=g2,Je=y2,M=257):(P=v2,Je=b2,M=0),w=0,l=0,c=d,k=a,h=p,g=0,T=-1,C=1<<p,R=C-1,t===sl&&C>ch||t===ph&&C>uh)return 1;for(;;){je=c-g,o[l]+1<M?(Q=0,_e=o[l]):o[l]>=M?(Q=Je[o[l]-M],_e=P[o[l]-M]):(Q=32+64,_e=0),_=1<<c-g,y=1<<h,d=y;do y-=_,i[k+(w>>g)+y]=je<<24|Q<<16|_e|0;while(y!==0);for(_=1<<c-1;w&_;)_>>=1;if(_!==0?(w&=_-1,w+=_):w=0,l++,--$[c]===0){if(c===f)break;c=e[r+o[l]]}if(c>p&&(w&R)!==T){for(g===0&&(g=p),k+=d,h=c-g,b=1<<h;h+g<f&&(b-=$[h+g],!(b<=0));)h++,b<<=1;if(C+=1<<h,t===sl&&C>ch||t===ph&&C>uh)return 1;T=w&R,i[T]=p<<24|h<<16|k-a|0}}return w!==0&&(i[k+w]=c-g<<24|64<<16|0),s.bits=p,0},Za=_2,w2=0,B1=1,q1=2,{Z_FINISH:fh,Z_BLOCK:S2,Z_TREES:Ss,Z_OK:zn,Z_STREAM_END:C2,Z_NEED_DICT:x2,Z_STREAM_ERROR:Ut,Z_DATA_ERROR:V1,Z_MEM_ERROR:Q1,Z_BUF_ERROR:E2,Z_DEFLATED:dh}=Yn,mc=16180,hh=16181,mh=16182,gh=16183,yh=16184,vh=16185,bh=16186,_h=16187,wh=16188,Sh=16189,rc=16190,yr=16191,cl=16192,Ch=16193,ul=16194,xh=16195,Eh=16196,kh=16197,Ah=16198,Cs=16199,xs=16200,Ih=16201,Th=16202,Oh=16203,Dh=16204,Nh=16205,ll=16206,Ph=16207,Rh=16208,ke=16209,z1=16210,H1=16211,k2=852,A2=592,I2=15,T2=I2,$h=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function O2(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var Xn=t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.mode<mc||e.mode>H1?1:0},G1=t=>{if(Xn(t))return Ut;let e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=mc,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(k2),e.distcode=e.distdyn=new Int32Array(A2),e.sane=1,e.back=-1,zn},W1=t=>{if(Xn(t))return Ut;let e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,G1(t)},K1=(t,e)=>{let r;if(Xn(t))return Ut;let n=t.state;return e<0?(r=0,e=-e):(r=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?Ut:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,W1(t))},Z1=(t,e)=>{if(!t)return Ut;let r=new O2;t.state=r,r.strm=t,r.window=null,r.mode=mc;let n=K1(t,e);return n!==zn&&(t.state=null),n},D2=t=>Z1(t,T2),Lh=!0,pl,fl,N2=t=>{if(Lh){pl=new Int32Array(512),fl=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(Za(B1,t.lens,0,288,pl,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Za(q1,t.lens,0,32,fl,0,t.work,{bits:5}),Lh=!1}t.lencode=pl,t.lenbits=9,t.distcode=fl,t.distbits=5},J1=(t,e,r,n)=>{let i,a=t.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),n>=a.wsize?(a.window.set(e.subarray(r-a.wsize,r),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>n&&(i=n),a.window.set(e.subarray(r-n,r-n+i),a.wnext),n-=i,n?(a.window.set(e.subarray(r-n,r),0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},P2=(t,e)=>{let r,n,i,a,o,s,u,c,l,d,f,p,h,g,b=0,C,w,_,y,T,R,k,P,M=new Uint8Array(4),$,V,Je=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Xn(t)||!t.output||!t.input&&t.avail_in!==0)return Ut;r=t.state,r.mode===yr&&(r.mode=cl),o=t.next_out,i=t.output,u=t.avail_out,a=t.next_in,n=t.input,s=t.avail_in,c=r.hold,l=r.bits,d=s,f=u,P=zn;e:for(;;)switch(r.mode){case mc:if(r.wrap===0){r.mode=cl;break}for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.wrap&2&&c===35615){r.wbits===0&&(r.wbits=15),r.check=0,M[0]=c&255,M[1]=c>>>8&255,r.check=We(r.check,M,2,0),c=0,l=0,r.mode=hh;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=ke;break}if((c&15)!==dh){t.msg="unknown compression method",r.mode=ke;break}if(c>>>=4,l-=4,k=(c&15)+8,r.wbits===0&&(r.wbits=k),k>15||k>r.wbits){t.msg="invalid window size",r.mode=ke;break}r.dmax=1<<r.wbits,r.flags=0,t.adler=r.check=1,r.mode=c&512?Sh:yr,c=0,l=0;break;case hh:for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.flags=c,(r.flags&255)!==dh){t.msg="unknown compression method",r.mode=ke;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=ke;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&r.wrap&4&&(M[0]=c&255,M[1]=c>>>8&255,r.check=We(r.check,M,2,0)),c=0,l=0,r.mode=mh;case mh:for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.head&&(r.head.time=c),r.flags&512&&r.wrap&4&&(M[0]=c&255,M[1]=c>>>8&255,M[2]=c>>>16&255,M[3]=c>>>24&255,r.check=We(r.check,M,4,0)),c=0,l=0,r.mode=gh;case gh:for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&r.wrap&4&&(M[0]=c&255,M[1]=c>>>8&255,r.check=We(r.check,M,2,0)),c=0,l=0,r.mode=yh;case yh:if(r.flags&1024){for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&r.wrap&4&&(M[0]=c&255,M[1]=c>>>8&255,r.check=We(r.check,M,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=vh;case vh:if(r.flags&1024&&(p=r.length,p>s&&(p=s),p&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(a,a+p),k)),r.flags&512&&r.wrap&4&&(r.check=We(r.check,n,p,a)),s-=p,a+=p,r.length-=p),r.length))break e;r.length=0,r.mode=bh;case bh:if(r.flags&2048){if(s===0)break e;p=0;do k=n[a+p++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k));while(k&&p<s);if(r.flags&512&&r.wrap&4&&(r.check=We(r.check,n,p,a)),s-=p,a+=p,k)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=_h;case _h:if(r.flags&4096){if(s===0)break e;p=0;do k=n[a+p++],r.head&&k&&r.length<65536&&(r.head.comment+=String.fromCharCode(k));while(k&&p<s);if(r.flags&512&&r.wrap&4&&(r.check=We(r.check,n,p,a)),s-=p,a+=p,k)break e}else r.head&&(r.head.comment=null);r.mode=wh;case wh:if(r.flags&512){for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.wrap&4&&c!==(r.check&65535)){t.msg="header crc mismatch",r.mode=ke;break}c=0,l=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=yr;break;case Sh:for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}t.adler=r.check=$h(c),c=0,l=0,r.mode=rc;case rc:if(r.havedict===0)return t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,x2;t.adler=r.check=1,r.mode=yr;case yr:if(e===S2||e===Ss)break e;case cl:if(r.last){c>>>=l&7,l-=l&7,r.mode=ll;break}for(;l<3;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}switch(r.last=c&1,c>>>=1,l-=1,c&3){case 0:r.mode=Ch;break;case 1:if(N2(r),r.mode=Cs,e===Ss){c>>>=2,l-=2;break e}break;case 2:r.mode=Eh;break;case 3:t.msg="invalid block type",r.mode=ke}c>>>=2,l-=2;break;case Ch:for(c>>>=l&7,l-=l&7;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if((c&65535)!==(c>>>16^65535)){t.msg="invalid stored block lengths",r.mode=ke;break}if(r.length=c&65535,c=0,l=0,r.mode=ul,e===Ss)break e;case ul:r.mode=xh;case xh:if(p=r.length,p){if(p>s&&(p=s),p>u&&(p=u),p===0)break e;i.set(n.subarray(a,a+p),o),s-=p,a+=p,u-=p,o+=p,r.length-=p;break}r.mode=yr;break;case Eh:for(;l<14;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.nlen=(c&31)+257,c>>>=5,l-=5,r.ndist=(c&31)+1,c>>>=5,l-=5,r.ncode=(c&15)+4,c>>>=4,l-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=ke;break}r.have=0,r.mode=kh;case kh:for(;r.have<r.ncode;){for(;l<3;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.lens[Je[r.have++]]=c&7,c>>>=3,l-=3}for(;r.have<19;)r.lens[Je[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,$={bits:r.lenbits},P=Za(w2,r.lens,0,19,r.lencode,0,r.work,$),r.lenbits=$.bits,P){t.msg="invalid code lengths set",r.mode=ke;break}r.have=0,r.mode=Ah;case Ah:for(;r.have<r.nlen+r.ndist;){for(;b=r.lencode[c&(1<<r.lenbits)-1],C=b>>>24,w=b>>>16&255,_=b&65535,!(C<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(_<16)c>>>=C,l-=C,r.lens[r.have++]=_;else{if(_===16){for(V=C+2;l<V;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(c>>>=C,l-=C,r.have===0){t.msg="invalid bit length repeat",r.mode=ke;break}k=r.lens[r.have-1],p=3+(c&3),c>>>=2,l-=2}else if(_===17){for(V=C+3;l<V;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=C,l-=C,k=0,p=3+(c&7),c>>>=3,l-=3}else{for(V=C+7;l<V;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=C,l-=C,k=0,p=11+(c&127),c>>>=7,l-=7}if(r.have+p>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=ke;break}for(;p--;)r.lens[r.have++]=k}}if(r.mode===ke)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=ke;break}if(r.lenbits=9,$={bits:r.lenbits},P=Za(B1,r.lens,0,r.nlen,r.lencode,0,r.work,$),r.lenbits=$.bits,P){t.msg="invalid literal/lengths set",r.mode=ke;break}if(r.distbits=6,r.distcode=r.distdyn,$={bits:r.distbits},P=Za(q1,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,$),r.distbits=$.bits,P){t.msg="invalid distances set",r.mode=ke;break}if(r.mode=Cs,e===Ss)break e;case Cs:r.mode=xs;case xs:if(s>=6&&u>=258){t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,m2(t,f),o=t.next_out,i=t.output,u=t.avail_out,a=t.next_in,n=t.input,s=t.avail_in,c=r.hold,l=r.bits,r.mode===yr&&(r.back=-1);break}for(r.back=0;b=r.lencode[c&(1<<r.lenbits)-1],C=b>>>24,w=b>>>16&255,_=b&65535,!(C<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(w&&(w&240)===0){for(y=C,T=w,R=_;b=r.lencode[R+((c&(1<<y+T)-1)>>y)],C=b>>>24,w=b>>>16&255,_=b&65535,!(y+C<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=y,l-=y,r.back+=y}if(c>>>=C,l-=C,r.back+=C,r.length=_,w===0){r.mode=Nh;break}if(w&32){r.back=-1,r.mode=yr;break}if(w&64){t.msg="invalid literal/length code",r.mode=ke;break}r.extra=w&15,r.mode=Ih;case Ih:if(r.extra){for(V=r.extra;l<V;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=Th;case Th:for(;b=r.distcode[c&(1<<r.distbits)-1],C=b>>>24,w=b>>>16&255,_=b&65535,!(C<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if((w&240)===0){for(y=C,T=w,R=_;b=r.distcode[R+((c&(1<<y+T)-1)>>y)],C=b>>>24,w=b>>>16&255,_=b&65535,!(y+C<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=y,l-=y,r.back+=y}if(c>>>=C,l-=C,r.back+=C,w&64){t.msg="invalid distance code",r.mode=ke;break}r.offset=_,r.extra=w&15,r.mode=Oh;case Oh:if(r.extra){for(V=r.extra;l<V;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=ke;break}r.mode=Dh;case Dh:if(u===0)break e;if(p=f-u,r.offset>p){if(p=r.offset-p,p>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=ke;break}p>r.wnext?(p-=r.wnext,h=r.wsize-p):h=r.wnext-p,p>r.length&&(p=r.length),g=r.window}else g=i,h=o-r.offset,p=r.length;p>u&&(p=u),u-=p,r.length-=p;do i[o++]=g[h++];while(--p);r.length===0&&(r.mode=xs);break;case Nh:if(u===0)break e;i[o++]=r.length,u--,r.mode=xs;break;case ll:if(r.wrap){for(;l<32;){if(s===0)break e;s--,c|=n[a++]<<l,l+=8}if(f-=u,t.total_out+=f,r.total+=f,r.wrap&4&&f&&(t.adler=r.check=r.flags?We(r.check,i,f,o-f):so(r.check,i,f,o-f)),f=u,r.wrap&4&&(r.flags?c:$h(c))!==r.check){t.msg="incorrect data check",r.mode=ke;break}c=0,l=0}r.mode=Ph;case Ph:if(r.wrap&&r.flags){for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.wrap&4&&c!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=ke;break}c=0,l=0}r.mode=Rh;case Rh:P=C2;break e;case ke:P=V1;break e;case z1:return Q1;case H1:default:return Ut}return t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,(r.wsize||f!==t.avail_out&&r.mode<ke&&(r.mode<ll||e!==fh))&&J1(t,t.output,t.next_out,f-t.avail_out),d-=t.avail_in,f-=t.avail_out,t.total_in+=d,t.total_out+=f,r.total+=f,r.wrap&4&&f&&(t.adler=r.check=r.flags?We(r.check,i,f,t.next_out-f):so(r.check,i,f,t.next_out-f)),t.data_type=r.bits+(r.last?64:0)+(r.mode===yr?128:0)+(r.mode===Cs||r.mode===ul?256:0),(d===0&&f===0||e===fh)&&P===zn&&(P=E2),P},R2=t=>{if(Xn(t))return Ut;let e=t.state;return e.window&&(e.window=null),t.state=null,zn},$2=(t,e)=>{if(Xn(t))return Ut;let r=t.state;return(r.wrap&2)===0?Ut:(r.head=e,e.done=!1,zn)},L2=(t,e)=>{let r=e.length,n,i,a;return Xn(t)||(n=t.state,n.wrap!==0&&n.mode!==rc)?Ut:n.mode===rc&&(i=1,i=so(i,e,r,0),i!==n.check)?V1:(a=J1(t,e,r,r),a?(n.mode=z1,Q1):(n.havedict=1,zn))},F2=W1,M2=K1,U2=G1,j2=D2,B2=Z1,q2=P2,V2=R2,Q2=$2,z2=L2,H2="pako inflate (from Nodeca project)",Sr={inflateReset:F2,inflateReset2:M2,inflateResetKeep:U2,inflateInit:j2,inflateInit2:B2,inflate:q2,inflateEnd:V2,inflateGetHeader:Q2,inflateSetDictionary:z2,inflateInfo:H2};function G2(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var W2=G2,Y1=Object.prototype.toString,{Z_NO_FLUSH:K2,Z_FINISH:Z2,Z_OK:lo,Z_STREAM_END:dl,Z_NEED_DICT:hl,Z_STREAM_ERROR:J2,Z_DATA_ERROR:Fh,Z_MEM_ERROR:Y2}=Yn;function bo(t){this.options=hc.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});let e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15)===0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new U1,this.strm.avail_out=0;let r=Sr.inflateInit2(this.strm,e.windowBits);if(r!==lo)throw new Error(Vn[r]);if(this.header=new W2,Sr.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=uo.string2buf(e.dictionary):Y1.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=Sr.inflateSetDictionary(this.strm,e.dictionary),r!==lo)))throw new Error(Vn[r])}bo.prototype.push=function(t,e){let r=this.strm,n=this.options.chunkSize,i=this.options.dictionary,a,o,s;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?Z2:K2,Y1.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),a=Sr.inflate(r,o),a===hl&&i&&(a=Sr.inflateSetDictionary(r,i),a===lo?a=Sr.inflate(r,o):a===Fh&&(a=hl));r.avail_in>0&&a===dl&&r.state.wrap>0&&t[r.next_in]!==0;)Sr.inflateReset(r),a=Sr.inflate(r,o);switch(a){case J2:case Fh:case hl:case Y2:return this.onEnd(a),this.ended=!0,!1}if(s=r.avail_out,r.next_out&&(r.avail_out===0||a===dl))if(this.options.to==="string"){let u=uo.utf8border(r.output,r.next_out),c=r.next_out-u,l=uo.buf2string(r.output,u);r.next_out=c,r.avail_out=n-c,c&&r.output.set(r.output.subarray(u,u+c),0),this.onData(l)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(!(a===lo&&s===0)){if(a===dl)return a=Sr.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};bo.prototype.onData=function(t){this.chunks.push(t)};bo.prototype.onEnd=function(t){t===lo&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=hc.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function ep(t,e){let r=new bo(e);if(r.push(t),r.err)throw r.msg||Vn[r.err];return r.result}function X2(t,e){return e=e||{},e.raw=!0,ep(t,e)}var e3=bo,t3=ep,r3=X2,n3=ep,i3=Yn,a3={Inflate:e3,inflate:t3,inflateRaw:r3,ungzip:n3,constants:i3},{Deflate:o3,deflate:s3,deflateRaw:c3,gzip:u3}=d2,{Inflate:l3,inflate:p3,inflateRaw:f3,ungzip:d3}=a3,h3=o3,m3=s3,g3=c3,y3=u3,v3=l3,b3=p3,_3=f3,w3=d3,S3=Yn,C3={Deflate:h3,deflate:m3,deflateRaw:g3,gzip:y3,Inflate:v3,inflate:b3,inflateRaw:_3,ungzip:w3,constants:S3},Se=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Ce=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},nc=class{constructor(e,r){this.input=e,this.output=r}};Se([m(),Ce("design:type",String)],nc.prototype,"input",void 0);Se([m(),Ce("design:type",String)],nc.prototype,"output",void 0);nc=Se([Ze(),Ce("design:paramtypes",[String,String])],nc);var ic=class{constructor(e,r){this.input=e,this.output=r}};Se([m(),Ce("design:type",String)],ic.prototype,"input",void 0);Se([m(),Ce("design:type",String)],ic.prototype,"output",void 0);ic=Se([z(),Ce("design:paramtypes",[String,String])],ic);var nn=class{constructor(e,r,n,i,a){this.name=e,this.modelId=r,this.systemPrompt=n,this.promptExamples=i,this.metaData=a}};Se([m(),Ce("design:type",String)],nn.prototype,"name",void 0);Se([m(),Ce("design:type",String)],nn.prototype,"modelId",void 0);Se([m(),Ce("design:type",String)],nn.prototype,"systemPrompt",void 0);Se([m(),Ce("design:type",Array)],nn.prototype,"promptExamples",void 0);Se([m(),Ce("design:type",String)],nn.prototype,"metaData",void 0);nn=Se([Ze(),Ce("design:paramtypes",[String,String,String,Array,String])],nn);var lr=class{constructor(e,r,n,i,a,o,s,u){this.name=e,this.modelId=r,this.taskId=n,this.systemPrompt=i,this.promptExamples=a,this.metaData=o,this.createdAt=s,this.updatedAt=u}};Se([m(),Ce("design:type",String)],lr.prototype,"name",void 0);Se([m(),Ce("design:type",String)],lr.prototype,"modelId",void 0);Se([m(),Ce("design:type",String)],lr.prototype,"taskId",void 0);Se([m(),Ce("design:type",String)],lr.prototype,"systemPrompt",void 0);Se([m(),Ce("design:type",Array)],lr.prototype,"promptExamples",void 0);Se([m(),Ce("design:type",String)],lr.prototype,"metaData",void 0);Se([m(),Ce("design:type",String)],lr.prototype,"createdAt",void 0);Se([m(),Ce("design:type",String)],lr.prototype,"updatedAt",void 0);lr=Se([z(),Ce("design:paramtypes",[String,String,String,String,Array,String,String,String])],lr);var Hn=class{constructor(e,r,n,i,a){this.model=e,this.status=r,this.progress=n,this.downloaded=i,this.loaded=a}};Se([m(),Ce("design:type",String)],Hn.prototype,"model",void 0);Se([m(),Ce("design:type",String)],Hn.prototype,"status",void 0);Se([m(),Ce("design:type",Number)],Hn.prototype,"progress",void 0);Se([m(),Ce("design:type",Boolean)],Hn.prototype,"downloaded",void 0);Se([m(),Ce("design:type",Boolean)],Hn.prototype,"loaded",void 0);Hn=Se([z(),Ce("design:paramtypes",[String,String,Number,Boolean,Boolean])],Hn);var x3=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ze=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ve,Fs,Ul=class{constructor(e,r=!0){Ve.set(this,void 0),Fs.set(this,new Map),x3(this,Ve,e,"f")}async getModels(){let e=await ze(this,Ve,"f").query({query:E`
|
|
651
714
|
query {
|
|
652
715
|
aiGetModels {
|
|
653
716
|
id
|
|
@@ -660,29 +723,34 @@ triggerMatch
|
|
|
660
723
|
}
|
|
661
724
|
local {
|
|
662
725
|
fileName
|
|
663
|
-
tokenizerSource
|
|
664
|
-
|
|
726
|
+
tokenizerSource {
|
|
727
|
+
repo
|
|
728
|
+
revision
|
|
729
|
+
fileName
|
|
730
|
+
}
|
|
731
|
+
huggingfaceRepo
|
|
732
|
+
revision
|
|
665
733
|
}
|
|
666
734
|
modelType
|
|
667
735
|
}
|
|
668
736
|
}
|
|
669
|
-
`});return
|
|
737
|
+
`});return A(e).aiGetModels}async addModel(e){let r=await ze(this,Ve,"f").mutate({mutation:E`
|
|
670
738
|
mutation($model: ModelInput!) {
|
|
671
739
|
aiAddModel(model: $model)
|
|
672
740
|
}
|
|
673
|
-
`,variables:{model:e}});return
|
|
741
|
+
`,variables:{model:e}});return A(r).aiAddModel}async updateModel(e,r){let n=await ze(this,Ve,"f").mutate({mutation:E`
|
|
674
742
|
mutation($modelId: String!, $model: ModelInput!) {
|
|
675
743
|
aiUpdateModel(modelId: $modelId, model: $model)
|
|
676
744
|
}
|
|
677
|
-
`,variables:{modelId:e,model:r}});return
|
|
745
|
+
`,variables:{modelId:e,model:r}});return A(n).aiUpdateModel}async removeModel(e){let r=await ze(this,Ve,"f").mutate({mutation:E`
|
|
678
746
|
mutation($modelId: String!) {
|
|
679
747
|
aiRemoveModel(modelId: $modelId)
|
|
680
748
|
}
|
|
681
|
-
`,variables:{modelId:e}});return
|
|
749
|
+
`,variables:{modelId:e}});return A(r).aiRemoveModel}async setDefaultModel(e,r){let n=await ze(this,Ve,"f").mutate({mutation:E`
|
|
682
750
|
mutation($modelType: ModelType!, $modelId: String!) {
|
|
683
751
|
aiSetDefaultModel(modelType: $modelType modelId: $modelId)
|
|
684
752
|
}
|
|
685
|
-
`,variables:{modelId:r,modelType:e}});return
|
|
753
|
+
`,variables:{modelId:r,modelType:e}});return A(n).aiSetDefaultModel}async getDefaultModel(e){let r=await ze(this,Ve,"f").query({query:E`
|
|
686
754
|
query($modelType: ModelType!) {
|
|
687
755
|
aiGetDefaultModel(modelType: $modelType) {
|
|
688
756
|
id
|
|
@@ -695,13 +763,18 @@ triggerMatch
|
|
|
695
763
|
}
|
|
696
764
|
local {
|
|
697
765
|
fileName
|
|
698
|
-
tokenizerSource
|
|
699
|
-
|
|
766
|
+
tokenizerSource {
|
|
767
|
+
repo
|
|
768
|
+
revision
|
|
769
|
+
fileName
|
|
770
|
+
}
|
|
771
|
+
huggingfaceRepo
|
|
772
|
+
revision
|
|
700
773
|
}
|
|
701
774
|
modelType
|
|
702
775
|
}
|
|
703
776
|
}
|
|
704
|
-
`,variables:{modelType:e}});return
|
|
777
|
+
`,variables:{modelType:e}});return A(r).aiGetDefaultModel}async tasks(){let{aiTasks:e}=A(await ze(this,Ve,"f").query({query:E`
|
|
705
778
|
query {
|
|
706
779
|
aiTasks {
|
|
707
780
|
name
|
|
@@ -717,7 +790,7 @@ triggerMatch
|
|
|
717
790
|
updatedAt
|
|
718
791
|
}
|
|
719
792
|
}
|
|
720
|
-
`}));return e}async addTask(e,r,n,i,a){let o=new
|
|
793
|
+
`}));return e}async addTask(e,r,n,i,a){let o=new nn(e,r,n,i,a),{aiAddTask:s}=A(await ze(this,Ve,"f").mutate({mutation:E`
|
|
721
794
|
mutation AiAddTask($task: AITaskInput!) {
|
|
722
795
|
aiAddTask(task: $task) {
|
|
723
796
|
name
|
|
@@ -733,7 +806,7 @@ triggerMatch
|
|
|
733
806
|
updatedAt
|
|
734
807
|
}
|
|
735
808
|
}
|
|
736
|
-
`,variables:{task:o}}));return s}async removeTask(e){let{aiRemoveTask:r}=
|
|
809
|
+
`,variables:{task:o}}));return s}async removeTask(e){let{aiRemoveTask:r}=A(await ze(this,Ve,"f").mutate({mutation:E`
|
|
737
810
|
mutation AiRemoveTask($taskId: String!) {
|
|
738
811
|
aiRemoveTask(taskId: $taskId) {
|
|
739
812
|
name
|
|
@@ -749,7 +822,7 @@ triggerMatch
|
|
|
749
822
|
updatedAt
|
|
750
823
|
}
|
|
751
824
|
}
|
|
752
|
-
`,variables:{taskId:e}}));return r}async updateTask(e,r){let{aiUpdateTask:n}=
|
|
825
|
+
`,variables:{taskId:e}}));return r}async updateTask(e,r){let{aiUpdateTask:n}=A(await ze(this,Ve,"f").mutate({mutation:E`
|
|
753
826
|
mutation AiUpdateTask($taskId: String!, $task: AITaskInput!) {
|
|
754
827
|
aiUpdateTask(taskId: $taskId, task: $task) {
|
|
755
828
|
name
|
|
@@ -765,7 +838,7 @@ triggerMatch
|
|
|
765
838
|
updatedAt
|
|
766
839
|
}
|
|
767
840
|
}
|
|
768
|
-
`,variables:{taskId:e,task:{name:r.name,modelId:r.modelId,systemPrompt:r.systemPrompt,promptExamples:r.promptExamples}}}));return n}async modelLoadingStatus(e){let{aiModelLoadingStatus:r}=
|
|
841
|
+
`,variables:{taskId:e,task:{name:r.name,modelId:r.modelId,systemPrompt:r.systemPrompt,promptExamples:r.promptExamples}}}));return n}async modelLoadingStatus(e){let{aiModelLoadingStatus:r}=A(await ze(this,Ve,"f").query({query:E`
|
|
769
842
|
query AiModelLoadingStatus($model: String!) {
|
|
770
843
|
aiModelLoadingStatus(model: $model) {
|
|
771
844
|
model
|
|
@@ -775,51 +848,51 @@ triggerMatch
|
|
|
775
848
|
downloaded
|
|
776
849
|
}
|
|
777
850
|
}
|
|
778
|
-
`,variables:{model:e}}));return r}async prompt(e,r){let{aiPrompt:n}=
|
|
851
|
+
`,variables:{model:e}}));return r}async prompt(e,r){let{aiPrompt:n}=A(await ze(this,Ve,"f").mutate({mutation:E`
|
|
779
852
|
mutation AiPrompt($taskId: String!, $prompt: String!) {
|
|
780
853
|
aiPrompt(taskId: $taskId, prompt: $prompt)
|
|
781
854
|
}
|
|
782
|
-
`,variables:{taskId:e,prompt:r}}));return n}async embed(e,r){let{aiEmbed:n}=
|
|
855
|
+
`,variables:{taskId:e,prompt:r}}));return n}async embed(e,r){let{aiEmbed:n}=A(await ze(this,Ve,"f").mutate({mutation:E`
|
|
783
856
|
mutation aiEmbed($modelId: String!, $text: String!) {
|
|
784
857
|
aiEmbed(modelId: $modelId, text: $text)
|
|
785
858
|
}
|
|
786
|
-
`,variables:{modelId:e,text:r}})),i=
|
|
787
|
-
mutation AiOpenTranscriptionStream($modelId: String
|
|
788
|
-
aiOpenTranscriptionStream(modelId: $modelId)
|
|
859
|
+
`,variables:{modelId:e,text:r}})),i=fc.toByteArray(n);return JSON.parse(C3.inflate(i,{to:"string"}))}async openTranscriptionStream(e,r,n){let{aiOpenTranscriptionStream:i}=A(await ze(this,Ve,"f").mutate({mutation:E`
|
|
860
|
+
mutation AiOpenTranscriptionStream($modelId: String!, $params: VoiceActivityParamsInput) {
|
|
861
|
+
aiOpenTranscriptionStream(modelId: $modelId, params: $params)
|
|
789
862
|
}
|
|
790
|
-
`,variables:{modelId:e}})),
|
|
791
|
-
aiTranscriptionText(streamId: "${
|
|
792
|
-
}`}).subscribe({next(
|
|
863
|
+
`,variables:{modelId:e,params:n}})),a=ze(this,Ve,"f").subscribe({query:E` subscription {
|
|
864
|
+
aiTranscriptionText(streamId: "${i}")
|
|
865
|
+
}`}).subscribe({next(o){return r(o.data.aiTranscriptionText),o.data.aiTranscriptionText},error(o){console.error(o)}});return ze(this,Fs,"f").set(i,a),i}async closeTranscriptionStream(e){let{aiCloseTranscriptionStream:r}=A(await ze(this,Ve,"f").mutate({mutation:E`
|
|
793
866
|
mutation aiCloseTranscriptionStream($streamId: String!) {
|
|
794
867
|
aiCloseTranscriptionStream(streamId: $streamId)
|
|
795
868
|
}
|
|
796
|
-
`,variables:{streamId:e}})),n
|
|
797
|
-
mutation AiFeedTranscriptionStream($
|
|
798
|
-
aiFeedTranscriptionStream(
|
|
869
|
+
`,variables:{streamId:e}})),n=ze(this,Fs,"f").get(e);return n.closed||n.unsubscribe(),r}async feedTranscriptionStream(e,r){let{aiFeedTranscriptionStream:n}=A(await ze(this,Ve,"f").mutate({mutation:E`
|
|
870
|
+
mutation AiFeedTranscriptionStream($streamIds: [String!]!, $audio: [Float!]!) {
|
|
871
|
+
aiFeedTranscriptionStream(streamIds: $streamIds, audio: $audio)
|
|
799
872
|
}
|
|
800
|
-
`,variables:{streamId:e,audio:r}}));return n}};Pe=new WeakMap,Jo=new WeakMap;var kr=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},je=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},zt,Xo,da,es,ha,ci,ts,rs,_s=class{constructor(e,r=!0){zt.set(this,void 0),Xo.set(this,void 0),da.set(this,void 0),es.set(this,void 0),ha.set(this,void 0),ci.set(this,void 0),ts.set(this,void 0),rs.set(this,void 0),kr(this,zt,e,"f"),kr(this,Xo,new Sa(je(this,zt,"f"),r),"f"),kr(this,da,new Vu(je(this,zt,"f")),"f"),kr(this,es,new Uu(je(this,zt,"f")),"f"),kr(this,ha,new qu(je(this,zt,"f")),"f"),kr(this,ci,new hs(je(this,zt,"f"),r),"f"),je(this,ci,"f").setExpressionClient(je(this,da,"f")),je(this,ci,"f").setNeighbourhoodClient(je(this,ha,"f")),kr(this,ts,new Bu(je(this,zt,"f"),r),"f"),kr(this,rs,new Xu(je(this,zt,"f"),r),"f")}get agent(){return je(this,Xo,"f")}get expression(){return je(this,da,"f")}get languages(){return je(this,es,"f")}get neighbourhood(){return je(this,ha,"f")}get perspective(){return je(this,ci,"f")}get runtime(){return je(this,ts,"f")}get ai(){return je(this,rs,"f")}};zt=new WeakMap,Xo=new WeakMap,da=new WeakMap,es=new WeakMap,ha=new WeakMap,ci=new WeakMap,ts=new WeakMap,rs=new WeakMap;var Zd;(function(t){t.LanguageIsNotLoaded="LANGUAGE_IS_NOT_LOADED",t.ExpressionIsNotVerified="EXPRESSION_IS_NOT_VERIFIED",t.AgentIsUntrusted="AGENT_IS_UNTRUSTED",t.CapabilityRequested="CAPABILITY_REQUESTED",t.InstallNotificationRequest="INSTALL_NOTIFICATION_REQUEST"})(Zd||(Zd={}));var dl=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},hl=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},vn=class{constructor(e,r){this.language=e,this.expression=r}};dl([w(),hl("design:type",Ht)],vn.prototype,"language",void 0);dl([w(),hl("design:type",String)],vn.prototype,"expression",void 0);vn=dl([Z(),hl("design:paramtypes",[Ht,String])],vn);function Q9(t){return t.language.address==="did"?t.expression.toString():`${t.language.address}://${t.expression}`}function G9(t){if(t.startsWith("literal://")){let a=new Ht;a.address="literal",a.name="literal";let o=t.substring(10);return new vn(a,o)}let r=/^([^:^\s]+):\/\/([\s\S]+)$/.exec(t);if(r&&r.length==3){let a=r[1],o=r[2],s=new Ht;return s.address=a,new vn(s,o)}let i=/^did:([^\s]+)$/.exec(t);if(i&&i.length==2){let a=new Ht;return a.address="did",new vn(a,t)}throw new Error("Couldn't parse string as expression URL or DID: "+t)}var bt=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Yt=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ws=class{};bt([w(),Yt("design:type",String)],ws.prototype,"name",void 0);bt([w(),Yt("design:type",String)],ws.prototype,"type",void 0);ws=bt([Z()],ws);var Da=class{};bt([w(),Yt("design:type",String)],Da.prototype,"label",void 0);bt([w(),Yt("design:type",String)],Da.prototype,"name",void 0);bt([w(),Yt("design:type",Array)],Da.prototype,"parameters",void 0);Da=bt([Z()],Da);var Ss=class{get parameters(){return JSON.parse(this.parametersStringified)}constructor(e,r){this.name=e,this.parametersStringified=JSON.stringify(r)}};bt([w(),Yt("design:type",String)],Ss.prototype,"name",void 0);bt([w(),Yt("design:type",String)],Ss.prototype,"parametersStringified",void 0);Ss=bt([He(),Yt("design:paramtypes",[String,Object])],Ss);var Es=class{};bt([w(),Yt("design:type",String)],Es.prototype,"did",void 0);bt([w(),Yt("design:type",Mu)],Es.prototype,"status",void 0);Es=bt([Z()],Es);var Yd=class{},Pn=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Si=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Ur=class{};Pn([w(),Si("design:type",String)],Ur.prototype,"name",void 0);Pn([w(),Si("design:type",String)],Ur.prototype,"address",void 0);Pn([w(),Si("design:type",String)],Ur.prototype,"settings",void 0);Pn([w(),Si("design:type",_n)],Ur.prototype,"icon",void 0);Pn([w(),Si("design:type",_n)],Ur.prototype,"constructorIcon",void 0);Pn([w(),Si("design:type",_n)],Ur.prototype,"settingsIcon",void 0);Ur=Pn([Z()],Ur);var nt=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},lt=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},$t=class{};nt([w(),lt("design:type",String)],$t.prototype,"name",void 0);nt([w(),lt("design:type",String)],$t.prototype,"address",void 0);nt([w(),lt("design:type",String)],$t.prototype,"description",void 0);nt([w(),lt("design:type",String)],$t.prototype,"author",void 0);nt([w(),lt("design:type",Boolean)],$t.prototype,"templated",void 0);nt([w(),lt("design:type",String)],$t.prototype,"templateSourceLanguageAddress",void 0);nt([w(),lt("design:type",String)],$t.prototype,"templateAppliedParams",void 0);nt([w(),lt("design:type",Array)],$t.prototype,"possibleTemplateParams",void 0);nt([w(),lt("design:type",String)],$t.prototype,"sourceCodeLink",void 0);$t=nt([Z()],$t);var gi=class{constructor(e,r){this.name=e,this.description=r,this.description||(this.description="")}};nt([w(),lt("design:type",String)],gi.prototype,"name",void 0);nt([w(),lt("design:type",String)],gi.prototype,"description",void 0);nt([w(),lt("design:type",Array)],gi.prototype,"possibleTemplateParams",void 0);nt([w(),lt("design:type",String)],gi.prototype,"sourceCodeLink",void 0);gi=nt([He(),lt("design:paramtypes",[String,String])],gi);var Jd=class{},Xd=class extends qr(){},eh=class{},Ds=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},ml=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Cs=class{constructor(e,r){this.linkLanguage=e,this.meta=r}};Ds([w(),ml("design:type",String)],Cs.prototype,"linkLanguage",void 0);Ds([w(),ml("design:type",Lr)],Cs.prototype,"meta",void 0);Cs=Ds([Z(),ml("design:paramtypes",[String,Lr])],Cs);var el=class extends qr(){};el=Ds([Z()],el);var Ei=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Ci=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},tl;(function(t){t.Private="PRIVATE",t.NeighboudhoodCreationInitiated="NEIGHBOURHOOD_CREATION_INITIATED",t.NeighbourhoodJoinInitiated="NEIGHBOURHOOD_JOIN_INITIATED",t.LinkLanguageFailedToInstall="LINK_LANGUAGE_FAILED_TO_INSTALL",t.LinkLanguageInstalledButNotSynced="LINK_LANGUAGE_INSTALLED_BUT_NOT_SYNCED",t.Synced="SYNCED"})(tl||(tl={}));var An=class{constructor(e,r,n){this.uuid=e,this.name=r,n?this.state=n:this.state=tl.Private}};Ei([w(),Ci("design:type",String)],An.prototype,"uuid",void 0);Ei([w(),Ci("design:type",String)],An.prototype,"name",void 0);Ei([w(),Ci("design:type",String)],An.prototype,"state",void 0);Ei([w(),Ci("design:type",String)],An.prototype,"sharedUrl",void 0);Ei([w(),Ci("design:type",el)],An.prototype,"neighbourhood",void 0);An=Ei([Z(),Ci("design:paramtypes",[String,String,String])],An);var Ns=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},im=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},xs=class{};Ns([w(),im("design:type",Array)],xs.prototype,"additions",void 0);Ns([w(),im("design:type",Array)],xs.prototype,"removals",void 0);xs=Ns([Z()],xs);var th=class extends qr(){};th=Ns([Z()],th);var rh=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},si=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ma,hn,Bo="smart_literal://content";function A2(t){let e="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=r.length;for(let i=0;i<t;i++)e+=r.charAt(Math.floor(Math.random()*n));return e}var Na=class{constructor(e,r){ma.set(this,void 0),hn.set(this,void 0),rh(this,ma,e,"f"),rh(this,hn,r,"f")}get base(){return si(this,hn,"f")}static async create(e,r){let n=Lt.from(A2(10)).toUrl(),i=new Na(e,n);return await i.set(r),i}static async isSmartLiteralBase(e,r){return(await e.get(new vt({source:r,predicate:Bo}))).length>0}static async getAllSmartLiterals(e){return(await e.get(new vt({predicate:Bo}))).map(n=>new Na(e,n.data.source))}async get(){let e=await si(this,ma,"f").getSingleTarget(new vt({source:si(this,hn,"f"),predicate:Bo}));if(!e)throw`No content for smart literal ${si(this,hn,"f")}`;return Lt.fromUrl(e).get()}async set(e){let r=Lt.from(e);await si(this,ma,"f").setSingleTarget(new Sn({source:si(this,hn,"f"),predicate:Bo,target:r.toUrl()}))}};ma=new WeakMap,hn=new WeakMap;var nh=class{};function a7(t,e,r){return{action:"addLink",source:t,predicate:e,target:r}}function o7(t){return`triple(this, "${t}", _)`}function s7(t){return function(e,r,n){if(typeof n.value!="function")throw new Error("InstanceQuery decorator can only be applied to methods");n.value=async function(a){let o=[],s=e.name,u=`subject_class("${s}", C), instance(C, Instance)`;if(t&&t.where)for(let l in t.where){let d=t.where[l];u+=`, property_getter(C, Instance, "${l}", "${d}")`}t&&t.condition&&(u+=", "+t.condition);let c=await a.infer(u);if(c==!1)return o;if(typeof c=="string")throw c;for(let l of c){let d=l.Instance,p=new ds(a,d,s);await p.init(),o.push(p)}return o}}}function c7(t){return function(e,r){if(t.required&&!t.initial)throw new Error("SubjectProperty requires an 'initial' option if 'required' is true");if(!t.through&&!t.getter)throw new Error("SubjectProperty requires either 'through' or 'getter' option");if(e.__properties=e.__properties||{},e.__properties[r]=e.__properties[r]||{},e.__properties[r]={...e.__properties[r],...t},t.writable){let n=r;e[`set${Or(n)}`]=()=>{}}Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function u7(t){return function(e,r){if(!t.through&&!t.value)throw new Error("SubjectFlag requires a 'through' and 'value' option");if(!t.through)throw new Error("SubjectFlag requires a 'through' option");if(!t.value)throw new Error("SubjectFlag requires a 'value' option");e.__properties=e.__properties||{},e.__properties[r]=e.__properties[r]||{},e.__properties[r]={...e.__properties[r],through:t.through,required:!0,initial:t.value,flag:!0},e[r]=t.value,Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function l7(t){return function(e,r){e.__collections=e.__collections||{},e.__collections[r]=t;let n=r;e[`add${Or(n)}`]=()=>{},e[`remove${Or(n)}`]=()=>{},e[`setCollection${Or(n)}`]=()=>{},Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function am(t){let e="",r="abcdefghijklmnopqrstuvwxyz",n=r.length;for(let i=0;i<t;i++)e+=r.charAt(Math.floor(Math.random()*n));return e}function f7(t){return function(e){e.prototype.className=t.name,e.className=t.name,e.generateSDNA=function(){let r="",n=t.name,i=e.prototype,a=am(8);r+=`subject_class("${n}", ${a}).
|
|
873
|
+
`,variables:{streamIds:Array.isArray(e)?e:[e],audio:r}}));return n}};Ve=new WeakMap,Fs=new WeakMap;var Vr=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},qe=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},rr,Ms,Qa,Us,za,Dn,js,Ha,po=class{constructor(e,r=!0){rr.set(this,void 0),Ms.set(this,void 0),Qa.set(this,void 0),Us.set(this,void 0),za.set(this,void 0),Dn.set(this,void 0),js.set(this,void 0),Ha.set(this,void 0),Vr(this,rr,e,"f"),Vr(this,Ms,new ro(qe(this,rr,"f"),r),"f"),Vr(this,Qa,new Tl(qe(this,rr,"f")),"f"),Vr(this,Us,new kl(qe(this,rr,"f")),"f"),Vr(this,za,new Al(qe(this,rr,"f")),"f"),Vr(this,Ha,new Ul(qe(this,rr,"f"),r),"f"),Vr(this,Dn,new Xs(qe(this,rr,"f"),r),"f"),qe(this,Dn,"f").setExpressionClient(qe(this,Qa,"f")),qe(this,Dn,"f").setNeighbourhoodClient(qe(this,za,"f")),qe(this,Dn,"f").setAIClient(qe(this,Ha,"f")),Vr(this,js,new Il(qe(this,rr,"f"),r),"f")}get agent(){return qe(this,Ms,"f")}get expression(){return qe(this,Qa,"f")}get languages(){return qe(this,Us,"f")}get neighbourhood(){return qe(this,za,"f")}get perspective(){return qe(this,Dn,"f")}get runtime(){return qe(this,js,"f")}get ai(){return qe(this,Ha,"f")}};rr=new WeakMap,Ms=new WeakMap,Qa=new WeakMap,Us=new WeakMap,za=new WeakMap,Dn=new WeakMap,js=new WeakMap,Ha=new WeakMap;var jl;(function(t){t.LanguageIsNotLoaded="LANGUAGE_IS_NOT_LOADED",t.ExpressionIsNotVerified="EXPRESSION_IS_NOT_VERIFIED",t.AgentIsUntrusted="AGENT_IS_UNTRUSTED",t.CapabilityRequested="CAPABILITY_REQUESTED",t.InstallNotificationRequest="INSTALL_NOTIFICATION_REQUEST"})(jl||(jl={}));var tp=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},rp=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Fn=class{constructor(e,r){this.language=e,this.expression=r}};tp([m(),rp("design:type",or)],Fn.prototype,"language",void 0);tp([m(),rp("design:type",String)],Fn.prototype,"expression",void 0);Fn=tp([z(),rp("design:paramtypes",[or,String])],Fn);function zw(t){return t.language.address==="did"?t.expression.toString():`${t.language.address}://${t.expression}`}function Hw(t){if(t.startsWith("literal://")){let a=new or;a.address="literal",a.name="literal";let o=t.substring(10);return new Fn(a,o)}let r=/^([^:^\s]+):\/\/([\s\S]+)$/.exec(t);if(r&&r.length==3){let a=r[1],o=r[2],s=new or;return s.address=a,new Fn(s,o)}let i=/^did:([^\s]+)$/.exec(t);if(i&&i.length==2){let a=new or;return a.address="did",new Fn(a,t)}throw new Error("Couldn't parse string as expression URL or DID: "+t)}var Nt=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},pr=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ac=class{};Nt([m(),pr("design:type",String)],ac.prototype,"name",void 0);Nt([m(),pr("design:type",String)],ac.prototype,"type",void 0);ac=Nt([z()],ac);var fo=class{};Nt([m(),pr("design:type",String)],fo.prototype,"label",void 0);Nt([m(),pr("design:type",String)],fo.prototype,"name",void 0);Nt([m(),pr("design:type",Array)],fo.prototype,"parameters",void 0);fo=Nt([z()],fo);var oc=class{get parameters(){return JSON.parse(this.parametersStringified)}constructor(e,r){this.name=e,this.parametersStringified=JSON.stringify(r)}};Nt([m(),pr("design:type",String)],oc.prototype,"name",void 0);Nt([m(),pr("design:type",String)],oc.prototype,"parametersStringified",void 0);oc=Nt([Ze(),pr("design:paramtypes",[String,Object])],oc);var sc=class{};Nt([m(),pr("design:type",String)],sc.prototype,"did",void 0);Nt([m(),pr("design:type",qn)],sc.prototype,"status",void 0);sc=Nt([z()],sc);var Mh=class{},ei=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Gi=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},an=class{};ei([m(),Gi("design:type",String)],an.prototype,"name",void 0);ei([m(),Gi("design:type",String)],an.prototype,"address",void 0);ei([m(),Gi("design:type",String)],an.prototype,"settings",void 0);ei([m(),Gi("design:type",Un)],an.prototype,"icon",void 0);ei([m(),Gi("design:type",Un)],an.prototype,"constructorIcon",void 0);ei([m(),Gi("design:type",Un)],an.prototype,"settingsIcon",void 0);an=ei([z()],an);var ht=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},St=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Gt=class{};ht([m(),St("design:type",String)],Gt.prototype,"name",void 0);ht([m(),St("design:type",String)],Gt.prototype,"address",void 0);ht([m(),St("design:type",String)],Gt.prototype,"description",void 0);ht([m(),St("design:type",String)],Gt.prototype,"author",void 0);ht([m(),St("design:type",Boolean)],Gt.prototype,"templated",void 0);ht([m(),St("design:type",String)],Gt.prototype,"templateSourceLanguageAddress",void 0);ht([m(),St("design:type",String)],Gt.prototype,"templateAppliedParams",void 0);ht([m(),St("design:type",Array)],Gt.prototype,"possibleTemplateParams",void 0);ht([m(),St("design:type",String)],Gt.prototype,"sourceCodeLink",void 0);Gt=ht([z()],Gt);var Mi=class{constructor(e,r){this.name=e,this.description=r,this.description||(this.description="")}};ht([m(),St("design:type",String)],Mi.prototype,"name",void 0);ht([m(),St("design:type",String)],Mi.prototype,"description",void 0);ht([m(),St("design:type",Array)],Mi.prototype,"possibleTemplateParams",void 0);ht([m(),St("design:type",String)],Mi.prototype,"sourceCodeLink",void 0);Mi=ht([Ze(),St("design:paramtypes",[String,String])],Mi);var Uh=class{},jh=class extends sn(){},Bh=class{},gc=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},np=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},cc=class{constructor(e,r){this.linkLanguage=e,this.meta=r}};gc([m(),np("design:type",String)],cc.prototype,"linkLanguage",void 0);gc([m(),np("design:type",ur)],cc.prototype,"meta",void 0);cc=gc([z(),np("design:paramtypes",[String,ur])],cc);var Bl=class extends sn(){};Bl=gc([z()],Bl);var Wi=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Ki=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ql;(function(t){t.Private="PRIVATE",t.NeighboudhoodCreationInitiated="NEIGHBOURHOOD_CREATION_INITIATED",t.NeighbourhoodJoinInitiated="NEIGHBOURHOOD_JOIN_INITIATED",t.LinkLanguageFailedToInstall="LINK_LANGUAGE_FAILED_TO_INSTALL",t.LinkLanguageInstalledButNotSynced="LINK_LANGUAGE_INSTALLED_BUT_NOT_SYNCED",t.Synced="SYNCED"})(ql||(ql={}));var Gn=class{constructor(e,r,n){this.uuid=e,this.name=r,n?this.state=n:this.state=ql.Private}};Wi([m(),Ki("design:type",String)],Gn.prototype,"uuid",void 0);Wi([m(),Ki("design:type",String)],Gn.prototype,"name",void 0);Wi([m(),Ki("design:type",String)],Gn.prototype,"state",void 0);Wi([m(),Ki("design:type",String)],Gn.prototype,"sharedUrl",void 0);Wi([m(),Ki("design:type",Bl)],Gn.prototype,"neighbourhood",void 0);Gn=Wi([z(),Ki("design:paramtypes",[String,String,String])],Gn);var yc=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},X1=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},uc=class{};yc([m(),X1("design:type",Array)],uc.prototype,"additions",void 0);yc([m(),X1("design:type",Array)],uc.prototype,"removals",void 0);uc=yc([z()],uc);var qh=class extends sn(){};qh=yc([z()],qh);var Vh=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ai=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ga,Nn,Es="smart_literal://content";function E3(t){let e="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=r.length;for(let i=0;i<t;i++)e+=r.charAt(Math.floor(Math.random()*n));return e}var ho=class{constructor(e,r){Ga.set(this,void 0),Nn.set(this,void 0),Vh(this,Ga,e,"f"),Vh(this,Nn,r,"f")}get base(){return Ai(this,Nn,"f")}static async create(e,r){let n=It.from(E3(10)).toUrl(),i=new ho(e,n);return await i.set(r),i}static async isSmartLiteralBase(e,r){return(await e.get(new ot({source:r,predicate:Es}))).length>0}static async getAllSmartLiterals(e){return(await e.get(new ot({predicate:Es}))).map(n=>new ho(e,n.data.source))}async get(){let e=await Ai(this,Ga,"f").getSingleTarget(new ot({source:Ai(this,Nn,"f"),predicate:Es}));if(!e)throw`No content for smart literal ${Ai(this,Nn,"f")}`;return It.fromUrl(e).get()}async set(e){let r=It.from(e);await Ai(this,Ga,"f").setSingleTarget(new Bn({source:Ai(this,Nn,"f"),predicate:Es,target:r.toUrl()}))}};Ga=new WeakMap,Nn=new WeakMap;var Qh=class{};function aS(t,e,r){return{action:"addLink",source:t,predicate:e,target:r}}function oS(t){return`triple(this, "${t}", _)`}function sS(t){return function(e,r,n){if(typeof n.value!="function")throw new Error("InstanceQuery decorator can only be applied to methods");n.value=async function(a){let o=[],s=e.name,u=`subject_class("${s}", C), instance(C, Instance)`;if(t&&t.where)for(let l in t.where){let d=t.where[l];u+=`, property_getter(C, Instance, "${l}", "${d}")`}t&&t.condition&&(u+=", "+t.condition);let c=await a.infer(u);if(c==!1)return o;if(typeof c=="string")throw c;for(let l of c){let d=l.Instance,f=new Ys(a,d,s);await f.init(),o.push(f)}return o}}}function em(t){return function(e,r){if(typeof t.writable>"u"&&t.through&&(t.writable=!0),t.required&&!t.initial)throw new Error("SubjectProperty requires an 'initial' option if 'required' is true");if(!t.through&&!t.getter)throw new Error("SubjectProperty requires either 'through' or 'getter' option");if(e.__properties=e.__properties||{},e.__properties[r]=e.__properties[r]||{},e.__properties[r]={...e.__properties[r],...t},t.writable){let n=r;e[`set${Kr(n)}`]=()=>{}}Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function cS(t){return function(e,r){if(!t.through&&!t.value)throw new Error("SubjectFlag requires a 'through' and 'value' option");if(!t.through)throw new Error("SubjectFlag requires a 'through' option");if(!t.value)throw new Error("SubjectFlag requires a 'value' option");e.__properties=e.__properties||{},e.__properties[r]=e.__properties[r]||{},e.__properties[r]={...e.__properties[r],through:t.through,required:!0,initial:t.value,flag:!0},e[r]=t.value,Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function uS(t){return function(e,r){e.__collections=e.__collections||{},e.__collections[r]=t;let n=r;e[`add${Kr(n)}`]=()=>{},e[`remove${Kr(n)}`]=()=>{},e[`setCollection${Kr(n)}`]=()=>{},Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function tm(t){let e="",r="abcdefghijklmnopqrstuvwxyz",n=r.length;for(let i=0;i<t;i++)e+=r.charAt(Math.floor(Math.random()*n));return e}function lS(t){return function(e){e.prototype.className=t.name,e.className=t.name,e.generateSDNA=function(){let r="",n=t.name,i=e.prototype,a=tm(8);r+=`subject_class("${n}", ${a}).
|
|
801
874
|
`;let o=[],s=[];i.subjectConstructor&&i.subjectConstructor.length&&(s=s.concat(i.subjectConstructor));let u=[];i.isSubjectInstance&&i.isSubjectInstance.length&&(u=u.concat(i.isSubjectInstance));let c=[],l=i.__properties||{};for(let h in l){let g=`property(${a}, "${h}").
|
|
802
|
-
`,{through:
|
|
803
|
-
`,g+=`property_resolve_language(${a}, "${h}", "${
|
|
804
|
-
`),
|
|
805
|
-
`:
|
|
806
|
-
`,
|
|
807
|
-
`;else if(
|
|
808
|
-
`}c.push(g),
|
|
809
|
-
`,{through:
|
|
810
|
-
`}else g+=`collection_getter(${a}, Base, "${h}", List) :- findall(C, triple(Base, "${
|
|
811
|
-
`;let
|
|
812
|
-
`,g+=`collection_remover(${a}, "${
|
|
813
|
-
`,g+=`collection_setter(${a}, "${
|
|
814
|
-
`}d.push(g)}let
|
|
875
|
+
`,{through:b,initial:C,required:w,resolveLanguage:_,writable:y,flag:T,getter:R,setter:k,local:P}=l[h];if(_&&(g+=`property_resolve(${a}, "${h}").
|
|
876
|
+
`,g+=`property_resolve_language(${a}, "${h}", "${_}").
|
|
877
|
+
`),R?g+=`property_getter(${a}, Base, "${h}", Value) :- ${R}.
|
|
878
|
+
`:b&&(g+=`property_getter(${a}, Base, "${h}", Value) :- triple(Base, "${b}", Value).
|
|
879
|
+
`,w&&(T?u.push(`triple(Base, "${b}", "${C}")`):u.push(`triple(Base, "${b}", _)`))),k)g+=`property_setter(${a}, "${h}", Actions) :- ${k}.
|
|
880
|
+
`;else if(y&&b&&typeof i[d1(h)]=="function"){let $=[{action:"setSingleTarget",source:"this",predicate:b,target:"value",...P&&{local:!0}}];g+=`property_setter(${a}, "${h}", '${kn($)}').
|
|
881
|
+
`}c.push(g),C&&(s.push({action:"addLink",source:"this",predicate:b,target:C}),o.push({action:"removeLink",source:"this",predicate:b,target:"*"}))}let d=[],f=i.__collections||{};for(let h in f){let g=`collection(${a}, "${h}").
|
|
882
|
+
`,{through:b,where:C,local:w}=f[h];if(b){if(C){if(!C.isInstance&&!C.condition)throw"'where' needs one of 'isInstance' or 'condition'";let R=[];if(C.isInstance){let P;C.isInstance.name?P=C.isInstance.name:P=C.isInstance,R.push(`instance(OtherClass, Target), subject_class("${P}", OtherClass)`)}C.condition&&R.push(C.condition);let k=R.join(", ");g+=`collection_getter(${a}, Base, "${h}", List) :- setof(Target, (triple(Base, "${b}", Target), ${k}), List).
|
|
883
|
+
`}else g+=`collection_getter(${a}, Base, "${h}", List) :- findall(C, triple(Base, "${b}", C), List).
|
|
884
|
+
`;let _=[{action:"addLink",source:"this",predicate:b,target:"value",...w&&{local:!0}}],y=[{action:"removeLink",source:"this",predicate:b,target:"value"}],T=[{action:"collectionSetter",source:"this",predicate:b,target:"value",...w&&{local:!0}}];g+=`collection_adder(${a}, "${Cr(h)}", '${kn(_)}').
|
|
885
|
+
`,g+=`collection_remover(${a}, "${Cr(h)}", '${kn(y)}').
|
|
886
|
+
`,g+=`collection_setter(${a}, "${Cr(h)}", '${kn(T)}').
|
|
887
|
+
`}d.push(g)}let p=kn(s);if(r+=`constructor(${a}, '${p}').
|
|
815
888
|
`,u.length>0){let h=u.join(", ");r+=`instance(${a}, Base) :- ${h}.
|
|
816
889
|
`,r+=`
|
|
817
|
-
`}return r+=`destructor(${a}, '${
|
|
890
|
+
`}return r+=`destructor(${a}, '${kn(o)}').
|
|
818
891
|
`,r+=`
|
|
819
892
|
`,r+=c.join(`
|
|
820
893
|
`),r+=`
|
|
821
894
|
`,r+=d.join(`
|
|
822
|
-
`),{sdna:r,name:n}},Object.defineProperty(e,"type",{configurable:!0})}}var
|
|
895
|
+
`),{sdna:r,name:n}},Object.defineProperty(e,"type",{configurable:!0})}}function pS(t){return em({...t,required:!0,writable:!0,initial:t.initial||"literal://string:uninitialized"})}function fS(t){return em({...t,writable:!1})}var dS=`
|
|
823
896
|
type AIModelLoadingStatus {
|
|
824
897
|
downloaded: Boolean!
|
|
825
898
|
loaded: Boolean!
|
|
@@ -1067,14 +1140,16 @@ input LinkQuery {
|
|
|
1067
1140
|
|
|
1068
1141
|
type LocalModel {
|
|
1069
1142
|
fileName: String!
|
|
1070
|
-
|
|
1071
|
-
|
|
1143
|
+
huggingfaceRepo: String
|
|
1144
|
+
revision: String
|
|
1145
|
+
tokenizerSource: TokenizerSource
|
|
1072
1146
|
}
|
|
1073
1147
|
|
|
1074
1148
|
input LocalModelInput {
|
|
1075
1149
|
fileName: String!
|
|
1076
|
-
|
|
1077
|
-
|
|
1150
|
+
huggingfaceRepo: String
|
|
1151
|
+
revision: String
|
|
1152
|
+
tokenizerSource: TokenizerSourceInput
|
|
1078
1153
|
}
|
|
1079
1154
|
|
|
1080
1155
|
type Model {
|
|
@@ -1127,8 +1202,8 @@ type Mutation {
|
|
|
1127
1202
|
aiAddTask(task: AITaskInput!): AITask!
|
|
1128
1203
|
aiCloseTranscriptionStream(streamId: String!): String!
|
|
1129
1204
|
aiEmbed(modelId: String!, text: String!): String!
|
|
1130
|
-
aiFeedTranscriptionStream(audio: [Float!]!,
|
|
1131
|
-
aiOpenTranscriptionStream(modelId: String
|
|
1205
|
+
aiFeedTranscriptionStream(audio: [Float!]!, streamIds: [String!]!): String!
|
|
1206
|
+
aiOpenTranscriptionStream(modelId: String!, params: VoiceActivityParamsInput): String!
|
|
1132
1207
|
aiPrompt(prompt: String!, taskId: String!): String!
|
|
1133
1208
|
aiRemoveModel(modelId: String!): Boolean!
|
|
1134
1209
|
aiRemoveTask(taskId: String!): AITask!
|
|
@@ -1144,38 +1219,49 @@ type Mutation {
|
|
|
1144
1219
|
languageWriteSettings(languageAddress: String!, settings: String!): Boolean!
|
|
1145
1220
|
neighbourhoodJoinFromUrl(url: String!): PerspectiveHandle!
|
|
1146
1221
|
neighbourhoodPublishFromPerspective(linkLanguage: String!, meta: PerspectiveInput!, perspectiveUUID: String!): String!
|
|
1147
|
-
neighbourhoodSendBroadcast(payload: PerspectiveInput!, perspectiveUUID: String!): Boolean!
|
|
1148
|
-
neighbourhoodSendBroadcastU(payload: PerspectiveUnsignedInput!, perspectiveUUID: String!): Boolean!
|
|
1222
|
+
neighbourhoodSendBroadcast(loopback: Boolean, payload: PerspectiveInput!, perspectiveUUID: String!): Boolean!
|
|
1223
|
+
neighbourhoodSendBroadcastU(loopback: Boolean, payload: PerspectiveUnsignedInput!, perspectiveUUID: String!): Boolean!
|
|
1149
1224
|
neighbourhoodSendSignal(payload: PerspectiveInput!, perspectiveUUID: String!, remoteAgentDid: String!): Boolean!
|
|
1150
1225
|
neighbourhoodSendSignalU(payload: PerspectiveUnsignedInput!, perspectiveUUID: String!, remoteAgentDid: String!): Boolean!
|
|
1151
1226
|
neighbourhoodSetOnlineStatus(perspectiveUUID: String!, status: PerspectiveInput!): Boolean!
|
|
1152
1227
|
neighbourhoodSetOnlineStatusU(perspectiveUUID: String!, status: PerspectiveUnsignedInput!): Boolean!
|
|
1153
1228
|
perspectiveAdd(name: String!): PerspectiveHandle!
|
|
1154
|
-
perspectiveAddLink(link: LinkInput!, status: String = "shared", uuid: String!): LinkExpression!
|
|
1155
|
-
perspectiveAddLinkExpression(link: LinkExpressionInput!, status: String, uuid: String!): LinkExpression!
|
|
1156
|
-
perspectiveAddLinks(links: [LinkInput!]!, status: String, uuid: String!): [LinkExpression!]!
|
|
1229
|
+
perspectiveAddLink(batchId: String, link: LinkInput!, status: String = "shared", uuid: String!): LinkExpression!
|
|
1230
|
+
perspectiveAddLinkExpression(batchId: String, link: LinkExpressionInput!, status: String = "shared", uuid: String!): LinkExpression!
|
|
1231
|
+
perspectiveAddLinks(batchId: String, links: [LinkInput!]!, status: String = "shared", uuid: String!): [LinkExpression!]!
|
|
1157
1232
|
perspectiveAddSdna(name: String!, sdnaCode: String!, sdnaType: String!, uuid: String!): Boolean!
|
|
1158
|
-
|
|
1159
|
-
|
|
1233
|
+
perspectiveCommitBatch(batchId: String!, uuid: String!): LinkExpressionMutations!
|
|
1234
|
+
perspectiveCreateBatch(uuid: String!): String!
|
|
1235
|
+
perspectiveCreateSubject(batchId: String, expressionAddress: String!, initialValues: String, subjectClass: String!, uuid: String!): Boolean!
|
|
1236
|
+
perspectiveDisposeQuerySubscription(subscriptionId: String!, uuid: String!): Boolean!
|
|
1237
|
+
perspectiveExecuteCommands(batchId: String, commands: String!, expression: String!, parameters: String, uuid: String!): Boolean!
|
|
1160
1238
|
perspectiveGetSubjectData(expressionAddress: String!, subjectClass: String!, uuid: String!): String!
|
|
1239
|
+
perspectiveKeepAliveQuery(subscriptionId: String!, uuid: String!): Boolean!
|
|
1161
1240
|
perspectiveLinkMutations(mutations: LinkMutations!, status: String, uuid: String!): LinkExpressionMutations!
|
|
1162
1241
|
perspectivePublishSnapshot(uuid: String!): String
|
|
1163
1242
|
perspectiveRemove(uuid: String!): Boolean!
|
|
1164
|
-
perspectiveRemoveLink(link: LinkExpressionInput!, uuid: String!): Boolean!
|
|
1165
|
-
perspectiveRemoveLinks(links: [LinkExpressionInput!]!, uuid: String!): [LinkExpression!]!
|
|
1243
|
+
perspectiveRemoveLink(batchId: String, link: LinkExpressionInput!, uuid: String!): Boolean!
|
|
1244
|
+
perspectiveRemoveLinks(batchId: String, links: [LinkExpressionInput!]!, uuid: String!): [LinkExpression!]!
|
|
1245
|
+
perspectiveSubscribeQuery(query: String!, uuid: String!): QuerySubscription!
|
|
1166
1246
|
perspectiveUpdate(name: String!, uuid: String!): PerspectiveHandle
|
|
1167
|
-
perspectiveUpdateLink(newLink: LinkInput!, oldLink: LinkExpressionInput!, uuid: String!): LinkExpression!
|
|
1247
|
+
perspectiveUpdateLink(batchId: String, newLink: LinkInput!, oldLink: LinkExpressionInput!, uuid: String!): LinkExpression!
|
|
1168
1248
|
runtimeAddFriends(dids: [String!]!): [String!]!
|
|
1169
1249
|
runtimeAddKnownLinkLanguageTemplates(addresses: [String!]!): [String!]!
|
|
1250
|
+
runtimeExportDb(filePath: String!): Boolean!
|
|
1251
|
+
runtimeExportPerspective(filePath: String!, perspectiveUuid: String!): Boolean!
|
|
1170
1252
|
runtimeFriendSendMessage(did: String!, message: PerspectiveInput!): Boolean!
|
|
1171
1253
|
runtimeGrantNotification(id: String!): Boolean!
|
|
1172
1254
|
runtimeHcAddAgentInfos(agentInfos: String!): Boolean!
|
|
1255
|
+
runtimeImportDb(filePath: String!): Boolean!
|
|
1256
|
+
runtimeImportPerspective(filePath: String!): Boolean!
|
|
1173
1257
|
runtimeOpenLink(url: String!): Boolean!
|
|
1174
1258
|
runtimeQuit: Boolean!
|
|
1175
1259
|
runtimeRemoveFriends(dids: [String!]!): [String!]!
|
|
1176
1260
|
runtimeRemoveKnownLinkLanguageTemplates(addresses: [String!]!): [String!]!
|
|
1177
1261
|
runtimeRemoveNotification(id: String!): Boolean!
|
|
1178
1262
|
runtimeRequestInstallNotification(notification: NotificationInput!): String!
|
|
1263
|
+
runtimeRestartHolochain: Boolean!
|
|
1264
|
+
runtimeSetMultiUserEnabled(enabled: Boolean!): Boolean!
|
|
1179
1265
|
runtimeSetStatus(status: PerspectiveInput!): Boolean!
|
|
1180
1266
|
runtimeUpdateNotification(id: String!, notification: NotificationInput!): Boolean!
|
|
1181
1267
|
}
|
|
@@ -1278,15 +1364,23 @@ type Query {
|
|
|
1278
1364
|
perspectives: [PerspectiveHandle!]!
|
|
1279
1365
|
runtimeFriendStatus(did: String!): PerspectiveExpression
|
|
1280
1366
|
runtimeFriends: [String!]!
|
|
1367
|
+
runtimeGetNetworkMetrics: String!
|
|
1281
1368
|
runtimeHcAgentInfos: String!
|
|
1282
1369
|
runtimeInfo: RuntimeInfo!
|
|
1283
1370
|
runtimeKnownLinkLanguageTemplates: [String!]!
|
|
1371
|
+
runtimeListUsers: [UserStatistics!]!
|
|
1284
1372
|
runtimeMessageInbox(filter: String): [PerspectiveExpression!]!
|
|
1285
1373
|
runtimeMessageOutbox(filter: String): [SentMessage!]!
|
|
1374
|
+
runtimeMultiUserEnabled: Boolean!
|
|
1286
1375
|
runtimeNotifications: [Notification!]!
|
|
1287
1376
|
runtimeVerifyStringSignedByDid(data: String!, did: String!, didSigningKeyId: String!, signedData: String!): Boolean!
|
|
1288
1377
|
}
|
|
1289
1378
|
|
|
1379
|
+
type QuerySubscription {
|
|
1380
|
+
result: String!
|
|
1381
|
+
subscriptionId: String!
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1290
1384
|
type Resource {
|
|
1291
1385
|
domain: String!
|
|
1292
1386
|
pointers: [String!]!
|
|
@@ -1319,6 +1413,7 @@ type Subscription {
|
|
|
1319
1413
|
perspectiveLinkAdded(uuid: String!): LinkExpression
|
|
1320
1414
|
perspectiveLinkRemoved(uuid: String!): LinkExpression
|
|
1321
1415
|
perspectiveLinkUpdated(uuid: String!): LinkExpressionUpdated
|
|
1416
|
+
perspectiveQuerySubscription(subscriptionId: String!): String!
|
|
1322
1417
|
perspectiveRemoved: String
|
|
1323
1418
|
perspectiveSyncStateChange(uuid: String!): String!
|
|
1324
1419
|
perspectiveUpdated: PerspectiveHandle
|
|
@@ -1326,12 +1421,79 @@ type Subscription {
|
|
|
1326
1421
|
runtimeNotificationTriggered: TriggeredNotification
|
|
1327
1422
|
}
|
|
1328
1423
|
|
|
1424
|
+
type TokenizerSource {
|
|
1425
|
+
fileName: String!
|
|
1426
|
+
repo: String!
|
|
1427
|
+
revision: String!
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
input TokenizerSourceInput {
|
|
1431
|
+
fileName: String!
|
|
1432
|
+
repo: String!
|
|
1433
|
+
revision: String!
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1329
1436
|
type TriggeredNotification {
|
|
1330
1437
|
notification: Notification!
|
|
1331
1438
|
perspectiveId: String!
|
|
1332
1439
|
triggerMatch: String!
|
|
1333
1440
|
}
|
|
1334
|
-
`;function ih(t){return t?.length?t.length===1?t.toString():t.length===2?t.join(" and "):t.slice(0,-1).join(", ")+", and "+t.slice(-1):""}function om(t){let e=t.can.includes("*")?["READ","WRITE","UPDATE"]:t.can,r=t.with.domain==="*"?"":t.with.domain,n=t.with.pointers.includes("*")?["all AD4M data"]:t.with.pointers;return`${ih(e)} your ${r} actions, with access to ${ih(n)}`}var cn=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Q=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},tt,Pt,ns,Ce,ah=class{constructor(t,e,r){tt.set(this,void 0),Pt.set(this,void 0),ns.set(this,void 0),Ce.set(this,void 0),cn(this,tt,e||Lt.from(am(24)).toUrl(),"f"),cn(this,Ce,t,"f"),cn(this,ns,r||"ad4m://self","f")}get baseExpression(){return Q(this,tt,"f")}async getData(t){let e=t??Q(this,tt,"f"),r=await Q(this,Ce,"f").getSubjectData(Q(this,Pt,"f"),e);return Object.assign(this,r),cn(this,tt,e,"f"),this}async setProperty(key,value){let setters=await Q(this,Ce,"f").infer(`subject_class("${Q(this,Pt,"f")}", C), property_setter(C, "${key}", Setter)`);if(setters&&setters.length>0){let actions=eval(setters[0].Setter),resolveLanguageResults=await Q(this,Ce,"f").infer(`subject_class("${Q(this,Pt,"f")}", C), property_resolve_language(C, "${key}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),resolveLanguage&&(value=await Q(this,Ce,"f").createExpression(value,resolveLanguage)),await Q(this,Ce,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value}])}}async setCollectionSetter(key,value){let collectionSetters=await Q(this,Ce,"f").infer(`subject_class("${Q(this,Pt,"f")}", C), collection_setter(C, "${ur(key)}", Setter)`);if(collectionSetters||(collectionSetters=[]),collectionSetters.length>0){let actions=eval(collectionSetters[0].Setter);value&&(Array.isArray(value)?await Q(this,Ce,"f").executeAction(actions,Q(this,tt,"f"),value.map(t=>({name:"value",value:t}))):await Q(this,Ce,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value}]))}}async setCollectionAdder(key,value){let adders=await Q(this,Ce,"f").infer(`subject_class("${Q(this,Pt,"f")}", C), collection_adder(C, "${ur(key)}", Adder)`);if(adders||(adders=[]),adders.length>0){let actions=eval(adders[0].Adder);value&&(Array.isArray(value)?await Promise.all(value.map(t=>Q(this,Ce,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value:t}]))):await Q(this,Ce,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value}]))}}async setCollectionRemover(key,value){let removers=await Q(this,Ce,"f").infer(`subject_class("${Q(this,Pt,"f")}", C), collection_remover(C, "${ur(key)}", Remover)`);if(removers||(removers=[]),removers.length>0){let actions=eval(removers[0].Remover);value&&(Array.isArray(value)?await Promise.all(value.map(t=>Q(this,Ce,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value:t}]))):await Q(this,Ce,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value}]))}}async save(){cn(this,Pt,await Q(this,Ce,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await Q(this,Ce,"f").createSubject(this,Q(this,tt,"f")),await Q(this,Ce,"f").add(new Sn({source:Q(this,ns,"f"),predicate:"ad4m://has_child",target:this.baseExpression})),await this.update()}async update(){cn(this,Pt,await Q(this,Ce,"f").stringOrTemplateObjectToSubjectClass(this),"f");let t=Object.entries(this);for(let[e,r]of t)if(r!=null)if(r?.action)switch(r.action){case"setter":await this.setCollectionSetter(e,r.value);break;case"adder":await this.setCollectionAdder(e,r.value);break;case"remover":await this.setCollectionRemover(e,r.value);default:await this.setCollectionSetter(e,r.value);break}else Array.isArray(r)&&r.length>0?await this.setCollectionSetter(e,r):r!=null&&r!==""&&await this.setProperty(e,r);await this.getData()}async get(){return cn(this,Pt,await Q(this,Ce,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await this.getData()}async delete(){await Q(this,Ce,"f").removeSubject(this,Q(this,tt,"f"))}static async all(t){let e=await t.stringOrTemplateObjectToSubjectClass(this),r=await t.getAllSubjectProxies(e),n=[];if(r){for(let i of r){let a=new this(t,i.X);n.push(await a.get())}return n}return[]}static async query(t,e){let r=e?.source||"ad4m://self",n=await t.stringOrTemplateObjectToSubjectClass(this),i=[];if(e)try{if((await t.infer(`findall([Timestamp, Base], (subject_class("${n}", C), instance(C, Base), link("${r}", 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("${r}", Predicate, Base, Timestamp, Author)), AllData), sort(AllData, SortedData), reverse(SortedData, ReverseSortedData), paginate(ReverseSortedData, ${e.page}, ${e.size}, PageData).`;i=await t.infer(s),i=i[0].PageData.map(u=>({Base:u[1],Timestamp:u[0]}))}else i=await t.infer(`subject_class("${n}", C), instance(C, Base), triple("${r}", Predicate, Base).`)}catch(o){console.log("Query failed",o)}else i=await t.infer(`subject_class("${n}", C), instance(C, Base), triple("${r}", Predicate, Base).`);return i?await Promise.all(i.map(async o=>await new this(t,o.Base).get())):[]}};tt=new WeakMap,Pt=new WeakMap,ns=new WeakMap,Ce=new WeakMap;var Rs="0.10.0";function O2(){let t=new AbortController;return setTimeout(()=>t.abort(),20),t}function gl(t,e=1e4){return pe(this,null,function*(){return Promise.race([new Promise((r,n)=>{try{t.includes("localhost")||r(new WebSocket(t));let i=new WebSocket(t);i.onopen=()=>{r(i)},i.onerror=a=>{n(a)}}catch(i){n(i)}}),new Promise((r,n)=>{setTimeout(()=>{n(new Error("WebSocket connection timed out"))},e)})])})}function yl(t){return pe(this,null,function*(){try{let e=yield fetch(`http://localhost:${t}/graphql/`,{signal:O2().signal,mode:"cors"});if(e.status===400||e.status===0||e.status===200)return t;throw new Error(`Could not connect to port ${t}`)}catch(e){throw new Error(`Could not connect to port ${t}`)}})}function D2(){return new Promise((t,e)=>{let r=document.querySelector("ad4m-connect"),n=r==null?void 0:r.getAd4mClient();n?t(n):e("No Ad4mClient found")})}function vl(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(t){return!1}return!0}function Ps(t,e){vl()&&localStorage.setItem(`${Rs}/${t}`,e)}function Jt(t){return vl()?localStorage.getItem(`${Rs}/${t}`):null}function bl(t){vl()&&localStorage.removeItem(`${Rs}/${t}`)}var N2=t=>{let e=new Set;do for(let r of Reflect.ownKeys(t))e.add([t,r]);while((t=Reflect.getPrototypeOf(t))&&t!==Object.prototype);return e};function Ma(t,{include:e,exclude:r}={}){let n=i=>{let a=o=>typeof o=="string"?i===o:o.test(i);return e?e.some(a):r?!r.some(a):!0};for(let[i,a]of N2(t.constructor.prototype)){if(a==="constructor"||!n(a))continue;let o=Reflect.getOwnPropertyDescriptor(i,a);o&&typeof o.value=="function"&&(t[a]=t[a].bind(t))}return t}var ja=class{constructor({appName:e,appDesc:r,appIconPath:n,appUrl:i,appDomain:a,capabilities:o,port:s,token:u,url:c,hosting:l}){this.activeSocket=null;this.requestedRestart=!1;this.authState="unauthenticated";this.connectionState="not_connected";this.port=12e3;this.capabilities=[];this.isHosting=!1;this.listeners={authstatechange:[],configstatechange:[],connectionstatechange:[]};Ma(this);this.appName=e,this.appDesc=r,this.appDomain=a,this.appUrl=i,this.appIconPath=n,this.capabilities=o,this.port=s||this.port,this.url=c||`ws://localhost:${this.port}/graphql`,this.token=u||this.token,this.isHosting=l||!1,this.buildClient()}notifyConfigChange(e,r){this.listeners.configstatechange.forEach(n=>{n(e,r)})}notifyConnectionChange(e){this.connectionState!==e&&(this.connectionState=e,this.listeners.connectionstatechange.forEach(r=>{r(e)}))}notifyAuthChange(e){this.authState!==e&&(this.authState=e,this.listeners.authstatechange.forEach(r=>{r(e)}))}setPort(e){this.port!==e&&(this.port=e,this.setUrl(`ws://localhost:${this.port}/graphql`),this.notifyConfigChange("port",e))}setUrl(e){this.url!==e&&(this.url=e,this.notifyConfigChange("url",e))}setToken(e){this.token!==e&&(this.token=e,this.notifyConfigChange("token",e))}on(e,r){this.listeners[e].push(r)}connect(e){return pe(this,null,function*(){try{if(e){yield gl(e,1e4),this.setUrl(e);let r=this.buildClient();return yield this.checkAuth(),r}else{let r=yield this.ensureConnection();return yield this.checkAuth(),r}}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}loginToHosting(e,r){return pe(this,null,function*(){try{let n=yield fetch("https://hosting.ad4m.dev/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,password:r})});if(n.status===200){let i=yield n.json();localStorage.setItem("hosting_token",i.token);let a=localStorage.getItem("hosting_token"),o=yield fetch("https://hosting.ad4m.dev/api/service/info",{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+a}});if(o.status===200){let s=yield o.json();if(s.serviceId)if(this.setPort(s.port),this.setUrl(s.url),this.isHosting=!0,Ps("ad4mhosting","true"),!s.paused)this.connect();else throw new Error("Hosting is not running")}}else if((yield n.json()).message==="Passwords did not match")throw new Error("Passwords did not match")}catch(n){throw console.log(n),new Error(`Error logging in ${n}`)}})}checkEmail(e){return pe(this,null,function*(){try{return(yield fetch(`https://hosting.ad4m.dev/api/auth/check-email?email=${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})).status===200}catch(r){console.log(r)}})}connectToPort(e){return pe(this,null,function*(){try{if(e){let r=yield yl(e);return this.setPort(r),this.buildClient()}else if(this.url.includes("localhost")){let r=yield this.findPort();return this.setPort(r),this.buildClient()}}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}ensureConnection(){return pe(this,null,function*(){var r,n;if(((r=this.activeSocket)==null?void 0:r.readyState)===WebSocket.OPEN&&((n=this.activeSocket)==null?void 0:n.url)===this.url&&this.ad4mClient)return this.ad4mClient;try{return this.notifyConnectionChange("connecting"),yield gl(this.url,1e4),this.buildClient()}catch(i){return this.notifyConnectionChange("not_connected"),this.connectToPort()}})}findPort(){return pe(this,null,function*(){let e=[...Array(10).keys()].map((i,a)=>yl(12e3+a)),n=(yield Promise.allSettled(e)).find(i=>i.status==="fulfilled");if(n)return n.value;throw Error("Couldn't find an open port")})}buildClient(){this.notifyConnectionChange("connecting");try{let e=new WebSocket(this.url)}catch(e){this.notifyConnectionChange("not_connected");return}return this.apolloClient&&this.wsClient&&(this.requestedRestart=!0,this.wsClient.dispose(),this.apolloClient.stop(),this.wsClient=null,this.apolloClient=null),this.wsClient=Kp({url:this.url,connectionParams:()=>pe(this,null,function*(){return{headers:{authorization:this.token}}}),on:{opened:e=>{this.activeSocket=e},error:e=>{this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")},connected:()=>{this.notifyConnectionChange("connected"),this.checkAuth()},closed:()=>pe(this,null,function*(){if(!this.requestedRestart)if(!this.token)this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1;else{let e=yield this.connect();e?this.ad4mClient=e:(this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1)}})}}),this.apolloClient=new cu({link:new Zp(this.wsClient),cache:new xo({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"},mutate:{fetchPolicy:"no-cache"}}}),this.ad4mClient=new _s(this.apolloClient),this.ad4mClient}checkAuth(){return pe(this,null,function*(){try{return(yield this.ad4mClient.agent.isLocked())?this.notifyAuthChange("locked"):(yield this.ad4mClient.agent.status(),this.notifyAuthChange("authenticated")),!0}catch(e){return e.message==="Socket closed with event 4500 Cannot extractByTags from a ciphered wallet. You must unlock first."?(this.notifyAuthChange("locked"),!0):(this.notifyAuthChange("unauthenticated"),!1)}})}requestCapability(e=!1){return pe(this,null,function*(){var r;if(e&&this.setToken(null),this.isHosting){let n=localStorage.getItem("hosting_token");(yield fetch("https://hosting.ad4m.dev/api/service/checkStatus",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+n}})).status!==200&&console.error("Looks like the client is not running you might not recieve the mail with the code, please check your dashboard logs.")}return this.requestId=yield(r=this.ad4mClient)==null?void 0:r.agent.requestCapability({appName:this.appName,appDesc:this.appDesc,appUrl:this.appUrl,appIconPath:this.appIconPath,appDomain:this.appDomain,capabilities:this.capabilities}),this.requestId})}verifyCode(e){return pe(this,null,function*(){var r;try{let n=yield(r=this.ad4mClient)==null?void 0:r.agent.generateJwt(this.requestId,e);return this.setToken(n),yield this.buildClient(),yield this.checkAuth(),this.token}catch(n){throw new Error("Invalid code")}})}clearState(){this.setToken(null),this.setPort(12e3),this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}};function _l({unlockAgent:t,reconnect:e}){return B`
|
|
1441
|
+
|
|
1442
|
+
type UserStatistics {
|
|
1443
|
+
did: String!
|
|
1444
|
+
email: String!
|
|
1445
|
+
lastSeen: String
|
|
1446
|
+
perspectiveCount: Int!
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
input VoiceActivityParamsInput {
|
|
1450
|
+
endThreshold: Float
|
|
1451
|
+
endWindow: Float
|
|
1452
|
+
startThreshold: Float
|
|
1453
|
+
startWindow: Float
|
|
1454
|
+
timeBeforeSpeech: Float
|
|
1455
|
+
}
|
|
1456
|
+
`;function zh(t){return t?.length?t.length===1?t.toString():t.length===2?t.join(" and "):t.slice(0,-1).join(", ")+", and "+t.slice(-1):""}function rm(t){let e=t.can.includes("*")?["READ","WRITE","UPDATE"]:t.can,r=t.with.domain==="*"?"":t.with.domain,n=t.with.pointers.includes("*")?["all AD4M data"]:t.with.pointers;return`${zh(e)} your ${r} actions, with access to ${zh(n)}`}var D=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},v=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},be=function(t,e){return function(r,n){e(r,n,t)}},_o=new Xr;_o.author="did:ad4m:test";_o.timestamp=Date.now();_o.data={source:"root",target:"neighbourhood://Qm12345"};_o.proof={signature:"",key:"",valid:!0};var Gr=new qn;Gr.author="did:ad4m:test";Gr.timestamp=Date.now().toString();Gr.proof=new xr("","");Gr.data=new ur([_o]);var lc=class{};D([m(),v("design:type",String)],lc.prototype,"recipient",void 0);D([m(),v("design:type",qn)],lc.prototype,"message",void 0);lc=D([z()],lc);var Ui=class{};D([m(),v("design:type",String)],Ui.prototype,"ad4mExecutorVersion",void 0);D([m(),v("design:type",Boolean)],Ui.prototype,"isInitialized",void 0);D([m(),v("design:type",Boolean)],Ui.prototype,"isUnlocked",void 0);Ui=D([z()],Ui);var Wn=class{};D([m(),v("design:type",String)],Wn.prototype,"title",void 0);D([m(),v("design:type",String)],Wn.prototype,"message",void 0);D([m(),v("design:type",String)],Wn.prototype,"type",void 0);D([m(),v("design:type",String)],Wn.prototype,"addon",void 0);Wn=D([z()],Wn);var jt=class{};D([m(),v("design:type",String)],jt.prototype,"description",void 0);D([m(),v("design:type",String)],jt.prototype,"appName",void 0);D([m(),v("design:type",String)],jt.prototype,"appUrl",void 0);D([m(),v("design:type",String)],jt.prototype,"appIconPath",void 0);D([m(),v("design:type",String)],jt.prototype,"trigger",void 0);D([m(),v("design:type",Array)],jt.prototype,"perspectiveIds",void 0);D([m(),v("design:type",String)],jt.prototype,"webhookUrl",void 0);D([m(),v("design:type",String)],jt.prototype,"webhookAuth",void 0);jt=D([Ze()],jt);var Tt=class{};D([m(),v("design:type",String)],Tt.prototype,"id",void 0);D([m(),v("design:type",Boolean)],Tt.prototype,"granted",void 0);D([m(),v("design:type",String)],Tt.prototype,"description",void 0);D([m(),v("design:type",String)],Tt.prototype,"appName",void 0);D([m(),v("design:type",String)],Tt.prototype,"appUrl",void 0);D([m(),v("design:type",String)],Tt.prototype,"appIconPath",void 0);D([m(),v("design:type",String)],Tt.prototype,"trigger",void 0);D([m(),v("design:type",Array)],Tt.prototype,"perspectiveIds",void 0);D([m(),v("design:type",String)],Tt.prototype,"webhookUrl",void 0);D([m(),v("design:type",String)],Tt.prototype,"webhookAuth",void 0);Tt=D([z()],Tt);var ji=class{};D([m(),v("design:type",Tt)],ji.prototype,"notification",void 0);D([m(),v("design:type",String)],ji.prototype,"perspectiveId",void 0);D([m(),v("design:type",String)],ji.prototype,"triggerMatch",void 0);ji=D([z()],ji);var Ke=class{};D([m(),v("design:type",Number)],Ke.prototype,"total",void 0);D([m(),v("design:type",Number)],Ke.prototype,"imported",void 0);D([m(),v("design:type",Number)],Ke.prototype,"failed",void 0);D([m(),v("design:type",Number)],Ke.prototype,"omitted",void 0);D([m(),v("design:type",Array)],Ke.prototype,"errors",void 0);Ke=D([z()],Ke);var Ot=class{};D([m(),v("design:type",Ke)],Ot.prototype,"perspectives",void 0);D([m(),v("design:type",Ke)],Ot.prototype,"links",void 0);D([m(),v("design:type",Ke)],Ot.prototype,"expressions",void 0);D([m(),v("design:type",Ke)],Ot.prototype,"perspectiveDiffs",void 0);D([m(),v("design:type",Ke)],Ot.prototype,"notifications",void 0);D([m(),v("design:type",Ke)],Ot.prototype,"models",void 0);D([m(),v("design:type",Ke)],Ot.prototype,"defaultModels",void 0);D([m(),v("design:type",Ke)],Ot.prototype,"tasks",void 0);D([m(),v("design:type",Ke)],Ot.prototype,"friends",void 0);D([m(),v("design:type",Ke)],Ot.prototype,"trustedAgents",void 0);D([m(),v("design:type",Ke)],Ot.prototype,"knownLinkLanguages",void 0);Ot=D([z()],Ot);var Bi=class{};D([m(),v("design:type",String)],Bi.prototype,"email",void 0);D([m(),v("design:type",String)],Bi.prototype,"did",void 0);D([m(),v("design:type",String)],Bi.prototype,"lastSeen",void 0);D([m(),v("design:type",Number)],Bi.prototype,"perspectiveCount",void 0);Bi=D([z()],Bi);var Y=class{runtimeQuit(){return!0}runtimeOpenLink(e){return!0}runtimeInfo(){return{ad4mExecutorVersion:"x.x.x",isInitialized:!0,isUnlocked:!0}}addTrustedAgents(e){return e}deleteTrustedAgents(e){return[]}getTrustedAgents(){return["agentPubKey"]}runtimeKnownLinkLanguageTemplates(){return["Qm12345abcdef"]}runtimeAddKnownLinkLanguageTemplates(e){return e}runtimeRemoveKnownLinkLanguageTemplates(e){return[]}runtimeFriends(){return["did:test:friend"]}runtimeAddFriends(e){return e}runtimeRemoveFriends(e){return[]}runtimeHcAgentInfos(){return JSON.stringify([{agent:{type:"Buffer",data:[9,191,231,58,255,107,202,55,206,57,9,103,17,34,206,195,207,114,5,73,77,198,56,136,17,227,242,231,194,135,128,48,170,189,119,186]},signature:{type:"Buffer",data:[195,143,170,36,234,123,255,85,188,138,124,2,91,18,53,231,44,41,240,8,80,131,100,150,165,125,146,90,17,200,190,129,114,211,11,146,150,128,198,199,79,118,157,101,194,68,58,245,98,182,79,139,140,41,143,129,8,136,87,77,180,231,218,11]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,9,191,231,58,255,107,202,55,206,57,9,103,17,34,206,195,207,114,5,73,77,198,56,136,17,227,242,231,194,135,128,48,170,189,119,186,164,117,114,108,115,145,217,99,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,101,83,52,86,112,54,109,118,80,48,122,116,85,101,104,114,117,113,89,52,102,66,53,101,69,98,121,48,69,66,100,89,84,50,95,67,48,69,112,77,111,76,111,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,57,50,46,49,54,56,46,49,55,56,46,54,48,47,112,47,55,55,52,52,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,104,189,50,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}},{agent:{type:"Buffer",data:[98,187,145,48,115,209,94,143,31,153,102,69,138,29,133,213,34,52,39,164,157,139,178,111,23,33,118,250,28,155,78,246,128,49,179,38]},signature:{type:"Buffer",data:[233,192,38,3,59,248,124,231,57,255,40,154,50,60,119,252,68,198,154,109,175,155,106,217,211,155,109,223,249,91,221,210,17,132,72,230,11,230,247,119,72,244,145,91,75,7,67,5,130,151,44,231,52,220,28,154,212,82,58,90,203,211,236,4]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,98,187,145,48,115,209,94,143,31,153,102,69,138,29,133,213,34,52,39,164,157,139,178,111,23,33,118,250,28,155,78,246,128,49,179,38,164,117,114,108,115,145,217,99,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,55,101,77,106,48,73,83,72,56,56,81,56,45,89,51,74,89,70,53,76,72,57,83,54,68,119,71,73,49,88,45,115,87,53,68,104,66,87,121,71,119,78,115,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,57,50,46,49,54,56,46,49,55,56,46,54,48,47,112,47,55,55,52,52,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,103,45,197,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}},{agent:{type:"Buffer",data:[181,101,115,45,214,127,198,153,159,184,30,87,67,224,208,184,203,176,130,158,236,127,153,125,243,183,188,167,154,25,118,254,101,145,210,109]},signature:{type:"Buffer",data:[88,189,229,122,44,171,194,156,90,79,148,49,207,224,34,199,219,88,24,243,103,127,123,41,87,171,127,92,6,216,198,171,26,226,237,217,122,78,98,146,55,255,68,240,202,83,58,140,147,185,3,66,15,216,210,22,99,197,73,234,120,17,74,1]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,181,101,115,45,214,127,198,153,159,184,30,87,67,224,208,184,203,176,130,158,236,127,153,125,243,183,188,167,154,25,118,254,101,145,210,109,164,117,114,108,115,145,217,99,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,114,70,71,83,100,113,104,101,68,107,70,70,56,69,102,109,45,69,116,55,119,81,101,120,83,88,55,65,112,69,51,89,86,99,45,120,102,52,104,106,77,115,77,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,57,50,46,49,54,56,46,49,55,56,46,54,48,47,112,47,55,55,52,52,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,113,23,220,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}},{agent:{type:"Buffer",data:[3,171,237,107,186,245,165,47,237,235,211,49,245,62,113,53,255,252,223,226,75,118,148,187,23,53,70,174,160,184,64,63,94,210,227,56]},signature:{type:"Buffer",data:[129,12,55,104,239,121,138,2,86,106,136,51,219,79,170,8,195,69,81,188,225,192,247,196,54,39,164,110,75,39,240,56,245,189,154,77,72,11,97,250,202,149,242,97,128,28,47,164,236,104,136,82,212,246,44,143,132,119,255,135,112,11,20,13]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,3,171,237,107,186,245,165,47,237,235,211,49,245,62,113,53,255,252,223,226,75,118,148,187,23,53,70,174,160,184,64,63,94,210,227,56,164,117,114,108,115,145,217,97,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,104,121,112,115,86,121,103,117,80,84,115,53,118,73,80,65,102,97,112,90,88,113,117,84,115,79,80,100,67,81,79,79,117,103,57,51,82,103,106,95,114,85,73,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,54,53,46,50,50,46,51,50,46,49,49,47,112,47,53,55,55,57,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,113,188,123,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}}])}runtimeGetNetworkMetrics(){return JSON.stringify({metrics:{},stats:{}})}runtimeRestartHolochain(){return!0}runtimeHcAddAgentInfos(e){return!0}runtimeVerifyStringSignedByDid(e,r,n,i){return!0}runtimeSetStatus(e){return!0}runtimeFriendStatus(e){return Gr}runtimeFriendSendMessage(e,r){return!0}runtimeMessageInbox(e){return[Gr]}runtimeMessageOutbox(e){return[{recipient:"did:test:recipient",message:Gr}]}runtimeMessageReceived(){return Gr}exceptionOccurred(){return{title:"Test title",message:"Test message",type:jl.LanguageIsNotLoaded}}runtimeRequestInstallNotification(e){return"new-notification-id"}runtimeNotifications(){return[{id:"test-id",granted:!1,description:"Test description",appName:"Test app name",appUrl:"https://example.com",appIconPath:"https://fluxsocial.io/favicon",trigger:"triple(X, ad4m://has_type, flux://message)",perspectiveIds:["u983ud-jdhh38d"],webhookUrl:"https://example.com/webhook",webhookAuth:"test-auth"}]}runtimeUpdateNotification(e,r){return!0}runtimeRemoveNotification(e){return!0}runtimeGrantNotification(e){return!0}runtimeNotificationTriggered(){return{perspectiveId:"test-perspective-id",triggerMatch:"test-trigger-match",notification:{id:"test-id",granted:!1,description:"Test description",appName:"Test app name",appUrl:"https://example.com",appIconPath:"https://fluxsocial.io/favicon",trigger:"triple(X, ad4m://has_type, flux://message)",perspectiveIds:["u983ud-jdhh38d"],webhookUrl:"https://example.com/webhook",webhookAuth:"test-auth"}}}runtimeExportDb(e){return!0}runtimeImportDb(e){return!0}runtimeExportPerspective(e,r){return!0}runtimeImportPerspective(e){return!0}runtimeMultiUserEnabled(){return!1}runtimeSetMultiUserEnabled(e){return e}runtimeListUsers(){return[{email:"test@example.com",did:"did:key:test123",lastSeen:new Date().toISOString(),perspectiveCount:5}]}};D([Me(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",Boolean)],Y.prototype,"runtimeQuit",null);D([Me(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[String]),v("design:returntype",Boolean)],Y.prototype,"runtimeOpenLink",null);D([Dt(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",Ui)],Y.prototype,"runtimeInfo",null);D([Me(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[Array]),v("design:returntype",Array)],Y.prototype,"addTrustedAgents",null);D([Me(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[Array]),v("design:returntype",Array)],Y.prototype,"deleteTrustedAgents",null);D([Dt(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",Array)],Y.prototype,"getTrustedAgents",null);D([Dt(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",Array)],Y.prototype,"runtimeKnownLinkLanguageTemplates",null);D([Me(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[Array]),v("design:returntype",Array)],Y.prototype,"runtimeAddKnownLinkLanguageTemplates",null);D([Me(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[Array]),v("design:returntype",Array)],Y.prototype,"runtimeRemoveKnownLinkLanguageTemplates",null);D([Dt(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",Array)],Y.prototype,"runtimeFriends",null);D([Me(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[Array]),v("design:returntype",Array)],Y.prototype,"runtimeAddFriends",null);D([Me(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[Array]),v("design:returntype",Array)],Y.prototype,"runtimeRemoveFriends",null);D([Dt(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",String)],Y.prototype,"runtimeHcAgentInfos",null);D([Dt(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",String)],Y.prototype,"runtimeGetNetworkMetrics",null);D([Me(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",Boolean)],Y.prototype,"runtimeRestartHolochain",null);D([Me(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[Object]),v("design:returntype",Boolean)],Y.prototype,"runtimeHcAddAgentInfos",null);D([Dt(),be(0,ve()),be(1,ve()),be(2,ve()),be(3,ve()),v("design:type",Function),v("design:paramtypes",[String,String,String,String]),v("design:returntype",void 0)],Y.prototype,"runtimeVerifyStringSignedByDid",null);D([Me(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[ur]),v("design:returntype",Boolean)],Y.prototype,"runtimeSetStatus",null);D([Dt(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[String]),v("design:returntype",qn)],Y.prototype,"runtimeFriendStatus",null);D([Me(),be(0,ve()),be(1,ve()),v("design:type",Function),v("design:paramtypes",[String,Ws]),v("design:returntype",Boolean)],Y.prototype,"runtimeFriendSendMessage",null);D([Dt(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[String]),v("design:returntype",Array)],Y.prototype,"runtimeMessageInbox",null);D([Dt(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[String]),v("design:returntype",Array)],Y.prototype,"runtimeMessageOutbox",null);D([Ql(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",qn)],Y.prototype,"runtimeMessageReceived",null);D([Ql(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",Wn)],Y.prototype,"exceptionOccurred",null);D([Me(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[jt]),v("design:returntype",String)],Y.prototype,"runtimeRequestInstallNotification",null);D([Dt(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",Array)],Y.prototype,"runtimeNotifications",null);D([Me(),be(0,ve()),be(1,ve()),v("design:type",Function),v("design:paramtypes",[String,jt]),v("design:returntype",Boolean)],Y.prototype,"runtimeUpdateNotification",null);D([Me(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[String]),v("design:returntype",Boolean)],Y.prototype,"runtimeRemoveNotification",null);D([Me(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[String]),v("design:returntype",Boolean)],Y.prototype,"runtimeGrantNotification",null);D([Ql(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",ji)],Y.prototype,"runtimeNotificationTriggered",null);D([Me(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[String]),v("design:returntype",Boolean)],Y.prototype,"runtimeExportDb",null);D([Me(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[String]),v("design:returntype",Boolean)],Y.prototype,"runtimeImportDb",null);D([Me(),be(0,ve()),be(1,ve()),v("design:type",Function),v("design:paramtypes",[String,String]),v("design:returntype",Boolean)],Y.prototype,"runtimeExportPerspective",null);D([Me(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[String]),v("design:returntype",Boolean)],Y.prototype,"runtimeImportPerspective",null);D([Dt(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",Boolean)],Y.prototype,"runtimeMultiUserEnabled",null);D([Me(),be(0,ve()),v("design:type",Function),v("design:paramtypes",[Boolean]),v("design:returntype",Boolean)],Y.prototype,"runtimeSetMultiUserEnabled",null);D([Dt(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",Array)],Y.prototype,"runtimeListUsers",null);Y=D([a0()],Y);var Ea=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},te=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},_t,nr,Bs,Oe;function k3(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Hh(t){return t?`triple("${t}", "ad4m://has_child", Base)`:""}function ml(){return`
|
|
1457
|
+
findall(
|
|
1458
|
+
[T, A],
|
|
1459
|
+
link(Base, _, _, T, A),
|
|
1460
|
+
AllLinks
|
|
1461
|
+
),
|
|
1462
|
+
sort(AllLinks, SortedLinks),
|
|
1463
|
+
SortedLinks = [[Timestamp, Author]|_]
|
|
1464
|
+
`}function Gh(t){return`
|
|
1465
|
+
findall([PropertyName, PropertyValue, Resolve], (
|
|
1466
|
+
% Constrain to specified properties if provided
|
|
1467
|
+
${t?`member(PropertyName, [${t.map(e=>`"${e}"`).join(", ")}]),`:""}
|
|
1468
|
+
resolve_property(SubjectClass, Base, PropertyName, PropertyValue, Resolve)
|
|
1469
|
+
), Properties)
|
|
1470
|
+
`}function Wh(t){return`
|
|
1471
|
+
findall([CollectionName, CollectionValues], (
|
|
1472
|
+
% Constrain to specified collections if provided
|
|
1473
|
+
${t?`member(CollectionName, [${t.map(e=>`"${e}"`).join(", ")}]),`:""}
|
|
1474
|
+
|
|
1475
|
+
collection(SubjectClass, CollectionName),
|
|
1476
|
+
collection_getter(SubjectClass, Base, CollectionName, CollectionValues)
|
|
1477
|
+
), Collections)
|
|
1478
|
+
`}function Kh(t={}){function e(r){return typeof r=="string"?`"${r}"`:r}return Object.entries(t).map(([r,n])=>{let i=["base","author","timestamp"].includes(r),a=`resolve_property(SubjectClass, Base, "${r}", Value${r}, _)`,o=k3(r);if(Array.isArray(n)){let s=n.map(u=>e(u)).join(", ");return i?`member(${o}, [${s}])`:`${a}, member(Value${r}, [${s}])`}if(typeof n=="object"&&n!==null){let{not:s,between:u,lt:c,lte:l,gt:d,gte:f}=n;if(s!==void 0)if(Array.isArray(s)){let h=s.map(g=>e(g)).join(", ");return i?`\\+ member(${o}, [${h}])`:`${a}, \\+ member(Value${r}, [${h}])`}else return i?`${o} \\= ${e(s)}`:`${a}, Value${r} \\= ${e(s)}`;if(u!==void 0&&Array.isArray(u)&&u.length===2)return i?`${o} >= ${u[0]}, ${o} =< ${u[1]}`:`${a}, Value${r} >= ${u[0]}, Value${r} =< ${u[1]}`;let p=[{value:c,symbol:"<"},{value:l,symbol:"=<"},{value:d,symbol:">"},{value:f,symbol:">="}];for(let{value:h,symbol:g}of p)if(h!==void 0)return i?`${o} ${g} ${h}`:`${a}, Value${r} ${g} ${h}`}return i?`${o} = ${e(n)}`:`${a}, Value${r} = ${e(n)}`}).join(", ")}function Zh(t){return t?"length(UnsortedInstances, TotalCount)":""}function Jh(t){if(!t)return"SortedInstances = UnsortedInstances";let[e,r]=Object.entries(t)[0];return`sort_instances(UnsortedInstances, "${e}", "${r}", SortedInstances)`}function Yh(t){return!t||t<0?"InstancesWithOffset = SortedInstances":`skipN(SortedInstances, ${t}, InstancesWithOffset)`}function Xh(t){return!t||t<0?"AllInstances = InstancesWithOffset":`takeN(InstancesWithOffset, ${t}, AllInstances)`}var _Ad4mModel=class{static async getClassName(t){if(this===_Ad4mModel)return await t.stringOrTemplateObjectToSubjectClassName(this);let r=this.classNamesByClass.get(this);r||(r={},this.classNamesByClass.set(this,r));let n=t.uuid;return r[n]||(r[n]=await t.stringOrTemplateObjectToSubjectClassName(this)),r[n]}constructor(t,e,r){_t.set(this,void 0),nr.set(this,void 0),Bs.set(this,void 0),Oe.set(this,void 0),Ea(this,_t,e||It.from(tm(24)).toUrl(),"f"),Ea(this,Oe,t,"f"),Ea(this,Bs,r||"ad4m://self","f")}get baseExpression(){return te(this,_t,"f")}get perspective(){return te(this,Oe,"f")}static async assignValuesToInstance(t,e,r){let n=Object.fromEntries(await Promise.all(r.map(async([i,a,o])=>{let s=a;if(!o&&typeof a=="string"){let c=Array.from(a,f=>f.codePointAt(0)),l=c.every(f=>f<=255),d=c.some(f=>f>=128);if(l&&d)try{let f=Uint8Array.from(c),p=new TextDecoder("utf-8",{fatal:!0}).decode(f);p!==a&&(s=p)}catch(f){console.warn(`UTF-8 byte reconstruction failed for property "${i}"`,{value:a,error:f})}}if(o){let c=await t.getExpression(a);if(c)try{s=JSON.parse(c.data)}catch{s=c.data}}let u=e.__properties?.[i]?.transform;return u&&typeof u=="function"&&(s=u(s)),[i,s]})));Object.assign(e,n)}async getData(){let t=[ml(),Gh(),Wh()],e=`
|
|
1479
|
+
Base = "${te(this,_t,"f")}",
|
|
1480
|
+
subject_class("${te(this,nr,"f")}", SubjectClass),
|
|
1481
|
+
${t.join(", ")}
|
|
1482
|
+
`,r=await te(this,Oe,"f").infer(e);if(r?.[0]){let{Properties:n,Collections:i,Timestamp:a,Author:o}=r?.[0],s=[...n,...i,["timestamp",a],["author",o]];await _Ad4mModel.assignValuesToInstance(te(this,Oe,"f"),this,s)}return this}static async queryToProlog(t,e,r){let{source:n,properties:i,collections:a,where:o,order:s,offset:u,limit:c,count:l}=e,d=r||await this.getClassName(t),f=[ml(),Hh(n),Gh(i),Wh(a),Kh(o)],p=[Zh(l),Jh(s),Yh(u),Xh(c)];return`
|
|
1483
|
+
findall([Base, Properties, Collections, Timestamp, Author], (
|
|
1484
|
+
subject_class("${d}", SubjectClass),
|
|
1485
|
+
instance(SubjectClass, Base),
|
|
1486
|
+
${f.filter(g=>g).join(", ")}
|
|
1487
|
+
), UnsortedInstances),
|
|
1488
|
+
${p.filter(g=>g).join(", ")}
|
|
1489
|
+
`}static async instancesFromPrologResult(t,e,r){if(!r?.[0]?.AllInstances)return{results:[],totalCount:0};let n=[...e?.properties||[],...e?.collections||[]];return{results:(await Promise.all(r[0].AllInstances.map(async([a,o,s,u,c])=>{try{let l=new this(t,a);n.length&&Object.keys(l).forEach(f=>{n.includes(f)||delete l[f]});let d=[...o,...s,["timestamp",u],["author",c]];return await _Ad4mModel.assignValuesToInstance(t,l,d),l}catch(l){return console.error(`Failed to process instance ${a}:`,l),null}}))).filter(a=>a!==null),totalCount:r[0].TotalCount}}static async findAll(t,e={}){let r=await this.queryToProlog(t,e),n=await t.infer(r),{results:i}=await this.instancesFromPrologResult(t,e,n);return i}static async findAllAndCount(t,e={}){let r=await this.queryToProlog(t,e),n=await t.infer(r);return await this.instancesFromPrologResult(t,e,n)}static async paginate(t,e,r,n){let i={...n||{},limit:e,offset:e*(r-1),count:!0},a=await this.queryToProlog(t,i),o=await t.infer(a),{results:s,totalCount:u}=await this.instancesFromPrologResult(t,i,o);return{results:s,totalCount:u,pageSize:e,pageNumber:r}}static async countQueryToProlog(t,e={},r){let{source:n,where:i}=e,a=r||await this.getClassName(t),o=[ml(),Hh(n),Kh(i)],s=[Zh(!0),Jh(),Yh(),Xh()];return`
|
|
1490
|
+
findall([Base, Properties, Collections, Timestamp, Author], (
|
|
1491
|
+
subject_class("${a}", SubjectClass),
|
|
1492
|
+
instance(SubjectClass, Base),
|
|
1493
|
+
${o.filter(c=>c).join(", ")}
|
|
1494
|
+
), UnsortedInstances),
|
|
1495
|
+
${s.filter(c=>c).join(", ")}
|
|
1496
|
+
`}static async count(t,e={}){return(await t.infer(await this.countQueryToProlog(t,e)))?.[0]?.TotalCount||0}async setProperty(key,value,batchId){let setters=await te(this,Oe,"f").infer(`subject_class("${te(this,nr,"f")}", C), property_setter(C, "${key}", Setter)`);if(setters&&setters.length>0){let actions=eval(setters[0].Setter),resolveLanguageResults=await te(this,Oe,"f").infer(`subject_class("${te(this,nr,"f")}", C), property_resolve_language(C, "${key}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),resolveLanguage&&(value=await te(this,Oe,"f").createExpression(value,resolveLanguage)),await te(this,Oe,"f").executeAction(actions,te(this,_t,"f"),[{name:"value",value}],batchId)}}async setCollectionSetter(key,value,batchId){let collectionSetters=await te(this,Oe,"f").infer(`subject_class("${te(this,nr,"f")}", C), collection_setter(C, "${Cr(key)}", Setter)`);if(collectionSetters||(collectionSetters=[]),collectionSetters.length>0){let actions=eval(collectionSetters[0].Setter);value&&(Array.isArray(value)?await te(this,Oe,"f").executeAction(actions,te(this,_t,"f"),value.map(t=>({name:"value",value:t})),batchId):await te(this,Oe,"f").executeAction(actions,te(this,_t,"f"),[{name:"value",value}],batchId))}}async setCollectionAdder(key,value,batchId){let adders=await te(this,Oe,"f").infer(`subject_class("${te(this,nr,"f")}", C), collection_adder(C, "${Cr(key)}", Adder)`);if(adders||(adders=[]),adders.length>0){let actions=eval(adders[0].Adder);value&&(Array.isArray(value)?await Promise.all(value.map(t=>te(this,Oe,"f").executeAction(actions,te(this,_t,"f"),[{name:"value",value:t}],batchId))):await te(this,Oe,"f").executeAction(actions,te(this,_t,"f"),[{name:"value",value}],batchId))}}async setCollectionRemover(key,value,batchId){let removers=await te(this,Oe,"f").infer(`subject_class("${te(this,nr,"f")}", C), collection_remover(C, "${Cr(key)}", Remover)`);if(removers||(removers=[]),removers.length>0){let actions=eval(removers[0].Remover);value&&(Array.isArray(value)?await Promise.all(value.map(t=>te(this,Oe,"f").executeAction(actions,te(this,_t,"f"),[{name:"value",value:t}],batchId))):await te(this,Oe,"f").executeAction(actions,te(this,_t,"f"),[{name:"value",value}],batchId))}}async save(t){let e=!1;t||(t=await this.perspective.createBatch(),e=!0);let r={};for(let[n,i]of Object.entries(this))i!=null&&!(Array.isArray(i)&&i.length>0)&&!i?.action&&(r[n]=i);await this.perspective.createSubject(this,te(this,_t,"f"),r,t),await te(this,Oe,"f").add(new Bn({source:te(this,Bs,"f"),predicate:"ad4m://has_child",target:this.baseExpression}),"shared",t),await this.innerUpdate(!1,t),e&&(await this.perspective.commitBatch(t),await this.getData())}cleanCopy(){let t={},e=Object.entries(this);for(let[r,n]of e)n!=null&&r!=="author"&&r!=="timestamp"&&(t[r]=n);return t}async innerUpdate(t=!0,e){Ea(this,nr,await te(this,Oe,"f").stringOrTemplateObjectToSubjectClassName(this.cleanCopy()),"f");let r=Object.entries(this);for(let[n,i]of r)if(i!=null)if(i?.action)switch(i.action){case"setter":await this.setCollectionSetter(n,i.value,e);break;case"adder":await this.setCollectionAdder(n,i.value,e);break;case"remover":await this.setCollectionRemover(n,i.value,e);break;default:await this.setCollectionSetter(n,i.value,e);break}else Array.isArray(i)&&i.length>0?await this.setCollectionSetter(n,i,e):i!=null&&i!==""&&t&&await this.setProperty(n,i,e)}async update(t){await this.innerUpdate(!0,t),await this.getData()}async get(){return Ea(this,nr,await te(this,Oe,"f").stringOrTemplateObjectToSubjectClassName(this.cleanCopy()),"f"),await this.getData()}async delete(t){await te(this,Oe,"f").removeSubject(this,te(this,_t,"f"),t)}static query(t,e){return new Vl(t,this,e)}};_t=new WeakMap,nr=new WeakMap,Bs=new WeakMap,Oe=new WeakMap;_Ad4mModel.classNamesByClass=new WeakMap;var Vl=class{constructor(e,r,n){this.queryParams={},this.modelClassName=null,this.perspective=e,this.ctor=r,n&&(this.queryParams=n)}dispose(){this.currentSubscription&&(this.currentSubscription.dispose(),this.currentSubscription=void 0)}where(e){return this.queryParams.where=e,this}order(e){return this.queryParams.order=e,this}limit(e){return this.queryParams.limit=e,this}offset(e){return this.queryParams.offset=e,this}source(e){return this.queryParams.source=e,this}properties(e){return this.queryParams.properties=e,this}collections(e){return this.queryParams.collections=e,this}overrideModelClassName(e){return this.modelClassName=e,this}async get(){let e=await this.ctor.queryToProlog(this.perspective,this.queryParams),r=await this.perspective.infer(e),{results:n}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,r);return n}async subscribe(e){this.dispose();let r=await this.ctor.queryToProlog(this.perspective,this.queryParams,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(r);let n=async a=>{let{results:o}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,a);e(o)};this.currentSubscription.onResult(n);let{results:i}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,this.currentSubscription.result);return i}async count(){let e=await this.ctor.countQueryToProlog(this.perspective,this.queryParams,this.modelClassName);return(await this.perspective.infer(e))?.[0]?.TotalCount||0}async countSubscribe(e){this.dispose();let r=await this.ctor.countQueryToProlog(this.perspective,this.queryParams,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(r);let n=async i=>{let a=i?.[0]?.TotalCount||0;e(a)};return this.currentSubscription.onResult(n),this.currentSubscription.result?.[0]?.TotalCount||0}async paginate(e,r){let n={...this.queryParams||{},limit:e,offset:e*(r-1),count:!0},i=await this.ctor.queryToProlog(this.perspective,n,this.modelClassName),a=await this.perspective.infer(i),{results:o,totalCount:s}=await this.ctor.instancesFromPrologResult(this.perspective,n,a);return{results:o,totalCount:s,pageSize:e,pageNumber:r}}async paginateSubscribe(e,r,n){this.dispose();let i={...this.queryParams||{},limit:e,offset:e*(r-1),count:!0},a=await this.ctor.queryToProlog(this.perspective,i,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(a);let o=async c=>{let{results:l,totalCount:d}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,c);n({results:l,totalCount:d,pageSize:e,pageNumber:r})};this.currentSubscription.onResult(o);let{results:s,totalCount:u}=await this.ctor.instancesFromPrologResult(this.perspective,i,this.currentSubscription.result);return{results:s,totalCount:u,pageSize:e,pageNumber:r}}};var vc="0.10.1-multi-user-1";var kr=12e3;function I3(){let t=new AbortController;return setTimeout(()=>t.abort(),20),t}function ti(t,e=1e4){return ee(this,null,function*(){return Promise.race([new Promise((r,n)=>{let i;try{i=new WebSocket(t,"graphql-transport-ws"),i.onopen=()=>{i.close(),r(i)},i.onerror=a=>{n(a)},i.onclose=a=>{a.code!==1e3&&n(new Error(`WebSocket closed with code ${a.code}: ${a.reason}`))}}catch(a){i&&i.close(),n(a)}}),new Promise((r,n)=>{setTimeout(()=>{n(new Error("WebSocket connection timed out"))},e)})])})}function ip(t){return ee(this,null,function*(){try{let e=yield fetch(`http://localhost:${t}/graphql/`,{signal:I3().signal,mode:"cors"});if(e.status===400||e.status===0||e.status===200)return t;throw new Error(`Could not connect to port ${t}`)}catch(e){throw new Error(`Could not connect to port ${t}`)}})}function T3(){return new Promise((t,e)=>{let r=document.querySelector("ad4m-connect"),n=r==null?void 0:r.getAd4mClient();n?t(n):e("No Ad4mClient found")})}function ap(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(t){return!1}return!0}function bc(t,e){ap()&&localStorage.setItem(`${vc}/${t}`,e)}function Wt(t){return ap()?localStorage.getItem(`${vc}/${t}`):null}function op(t){ap()&&localStorage.removeItem(`${vc}/${t}`)}var O3=t=>{let e=new Set;do for(let r of Reflect.ownKeys(t))e.add([t,r]);while((t=Reflect.getPrototypeOf(t))&&t!==Object.prototype);return e};function wo(t,{include:e,exclude:r}={}){let n=i=>{let a=o=>typeof o=="string"?i===o:o.test(i);return e?e.some(a):r?!r.some(a):!0};for(let[i,a]of O3(t.constructor.prototype)){if(a==="constructor"||!n(a))continue;let o=Reflect.getOwnPropertyDescriptor(i,a);o&&typeof o.value=="function"&&(t[a]=t[a].bind(t))}return t}var So=class{constructor(e){this.activeSocket=null;this.requestedRestart=!1;this.authState="unauthenticated";this.connectionState="not_connected";this.port=kr;this.capabilities=[];this.isHosting=!1;this.listeners={authstatechange:[],configstatechange:[],connectionstatechange:[]};wo(this);this.options=e,this.appName=e.appName,this.appDesc=e.appDesc,this.appDomain=e.appDomain,this.appUrl=e.appUrl,this.appIconPath=e.appIconPath,this.capabilities=e.capabilities,this.port=e.port||this.port,this.url=e.url||`ws://localhost:${this.port}/graphql`,this.token=e.token||this.token,this.isHosting=e.hosting||!1}notifyConfigChange(e,r){this.listeners.configstatechange.forEach(n=>{n(e,r)})}notifyConnectionChange(e){this.connectionState!==e&&(this.connectionState=e,this.listeners.connectionstatechange.forEach(r=>{r(e)}))}notifyAuthChange(e){this.authState!==e&&(this.authState=e,this.listeners.authstatechange.forEach(r=>{r(e)}))}setPort(e){this.port!==e&&(this.port=e,this.setUrl(`ws://localhost:${this.port}/graphql`),this.notifyConfigChange("port",e))}setUrl(e){this.url!==e&&(this.url=e,this.notifyConfigChange("url",e))}setToken(e){this.token!==e&&(this.token=e,this.notifyConfigChange("token",e))}on(e,r){this.listeners[e].push(r)}buildTempClient(e){let r=Wu({url:e,connectionParams:()=>ee(this,null,function*(){return{headers:{authorization:""}}})}),n=new ps({link:new Ku(r),cache:new wa({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"}}});return new po(n)}connect(e){return ee(this,null,function*(){try{if(e){yield ti(e),this.setUrl(e);let r=this.buildClient();return yield this.checkAuth(),r}else{let r=`ws://localhost:${this.port}/graphql`;yield ti(r),this.setUrl(r);let n=this.buildClient();return yield this.checkAuth(),n}}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}connectMultiUser(){return ee(this,null,function*(){try{let e=this.options.backendUrl;console.debug("[Ad4m Connect] Connecting to backend:",e),yield ti(e),this.setUrl(e);let r=this.buildClient();console.debug("[Ad4m Connect] Built client:",r);let n;try{console.debug("[Ad4m Connect] Logging in user:",this.options.userEmail),n=yield r.agent.loginUser(this.options.userEmail,this.options.userPassword),console.debug("[Ad4m Connect] Login successful")}catch(a){console.debug("[Ad4m Connect] Login error:",a),console.debug("[Ad4m Connect] User does not exist, trying to create user:",this.options.userEmail);try{console.debug("[Ad4m Connect] Creating user:",this.options.userEmail);try{let o=yield r.agent.createUser(this.options.userEmail,this.options.userPassword);if(console.debug("[Ad4m Connect] Create result:",o),!o.success)throw new Error(o.error||"Failed to create user")}catch(o){console.log("[Ad4m Connect] Failed to create user:",o)}console.debug("[Ad4m Connect] Logging in user after creation:",this.options.userEmail),n=yield r.agent.loginUser(this.options.userEmail,this.options.userPassword),console.log("[Ad4m Connect] Successfully created and logged in user")}catch(o){throw new Error(`Failed to create/login user: ${o.message}`)}}this.setToken(n);let i=this.buildClient();return yield i.agent.status(),this.notifyAuthChange("authenticated"),this.notifyConnectionChange("connected"),i}catch(e){throw this.notifyConnectionChange("error"),this.notifyAuthChange("unauthenticated"),e}})}loginToHosting(e,r){return ee(this,null,function*(){try{let n=yield fetch("https://hosting.ad4m.dev/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,password:r})});if(n.status===200){let i=yield n.json();localStorage.setItem("hosting_token",i.token);let a=localStorage.getItem("hosting_token"),o=yield fetch("https://hosting.ad4m.dev/api/service/info",{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+a}});if(o.status===200){let s=yield o.json();if(s.serviceId)if(this.setPort(s.port),this.setUrl(s.url),this.isHosting=!0,bc("ad4mhosting","true"),!s.paused)this.connect();else throw new Error("Hosting is not running")}}else if((yield n.json()).message==="Passwords did not match")throw new Error("Passwords did not match")}catch(n){throw console.log(n),new Error(`Error logging in ${n}`)}})}checkEmail(e){return ee(this,null,function*(){try{return(yield fetch(`https://hosting.ad4m.dev/api/auth/check-email?email=${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})).status===200}catch(r){console.log(r)}})}connectToPort(e){return ee(this,null,function*(){try{if(e){let r=yield ip(e);return this.setPort(r),this.buildClient()}else if(this.url.includes("localhost")){let r=yield this.findPort();return this.setPort(r),this.buildClient()}}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}ensureConnection(){return ee(this,null,function*(){var r,n;if(((r=this.activeSocket)==null?void 0:r.readyState)===WebSocket.OPEN&&((n=this.activeSocket)==null?void 0:n.url)===this.url&&this.ad4mClient)return this.ad4mClient;try{return this.notifyConnectionChange("connecting"),yield ti(this.url),this.buildClient()}catch(i){return this.notifyConnectionChange("not_connected"),this.connectToPort()}})}findPort(){return ee(this,null,function*(){let e=[...Array(10).keys()].map((i,a)=>ip(kr+a)),n=(yield Promise.allSettled(e)).find(i=>i.status==="fulfilled");if(n)return n.value;throw Error("Couldn't find an open port")})}buildClient(){this.notifyConnectionChange("connecting");try{let e=new WebSocket(this.url)}catch(e){this.notifyConnectionChange("not_connected");return}return this.apolloClient&&this.wsClient&&(this.requestedRestart=!0,this.wsClient.dispose(),this.apolloClient.stop(),this.wsClient=null,this.apolloClient=null),this.wsClient=Wu({url:this.url,connectionParams:()=>ee(this,null,function*(){return{headers:{authorization:this.token}}}),on:{opened:e=>{this.activeSocket=e},error:e=>{this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")},connected:()=>{this.notifyConnectionChange("connected"),this.checkAuth()},closed:e=>ee(this,null,function*(){if(!e.wasClean&&!this.requestedRestart)if(!this.token)this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1;else{let r=yield this.connect();r?this.ad4mClient=r:(this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1)}})}}),this.apolloClient=new ps({link:new Ku(this.wsClient),cache:new wa({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"},mutate:{fetchPolicy:"no-cache"}}}),this.ad4mClient=new po(this.apolloClient),this.ad4mClient}checkAuth(){return ee(this,null,function*(){try{return(yield this.ad4mClient.agent.isLocked())?this.notifyAuthChange("locked"):(yield this.ad4mClient.agent.status(),this.notifyAuthChange("authenticated")),!0}catch(e){return e.message==="Socket closed with event 4500 Cannot extractByTags from a ciphered wallet. You must unlock first."?(this.notifyAuthChange("locked"),!0):(this.notifyAuthChange("unauthenticated"),!1)}})}requestCapability(e=!1){return ee(this,null,function*(){var r;if(e&&this.setToken(null),this.isHosting){let n=localStorage.getItem("hosting_token");(yield fetch("https://hosting.ad4m.dev/api/service/checkStatus",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+n}})).status!==200&&console.error("Looks like the client is not running you might not recieve the mail with the code, please check your dashboard logs.")}return this.requestId=yield(r=this.ad4mClient)==null?void 0:r.agent.requestCapability({appName:this.appName,appDesc:this.appDesc,appUrl:this.appUrl,appIconPath:this.appIconPath,appDomain:this.appDomain,capabilities:this.capabilities}),this.requestId})}verifyCode(e){return ee(this,null,function*(){var r;try{let n=yield(r=this.ad4mClient)==null?void 0:r.agent.generateJwt(this.requestId,e);return this.setToken(n),yield this.buildClient(),yield this.checkAuth(),this.token}catch(n){throw new Error("Invalid code")}})}clearState(){this.setToken(null),this.setPort(kr),this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}};function sp({unlockAgent:t,reconnect:e}){return L`
|
|
1335
1497
|
<div class="text-center">
|
|
1336
1498
|
<div class="items">
|
|
1337
1499
|
<div>
|
|
@@ -1343,7 +1505,205 @@ type TriggeredNotification {
|
|
|
1343
1505
|
<button class="button" @click=${e}>Reconnect</button>
|
|
1344
1506
|
</div>
|
|
1345
1507
|
</div>
|
|
1346
|
-
`}function
|
|
1508
|
+
`}function cp({localDetected:t,multiUserConfigured:e,backendUrl:r,configuredUrl:n,isMobile:i,onConnectLocal:a,onConnectRemote:o,onScanQR:s,onDownloadAd4m:u}){let c=!i&&t,l=!0,d=i,f=!t&&!e,p=r||n;return L`
|
|
1509
|
+
<div class="items">
|
|
1510
|
+
<div class="text-center">
|
|
1511
|
+
<h3 class="heading">Connect to AD4M</h3>
|
|
1512
|
+
${t?L`
|
|
1513
|
+
<p class="body">Choose how you want to connect:</p>
|
|
1514
|
+
`:L`
|
|
1515
|
+
<p class="body" style="color: var(--body-color); opacity: 0.8;">
|
|
1516
|
+
No local AD4M detected.
|
|
1517
|
+
${i?L`Connect to a remote executor or scan a QR code.`:L`Download AD4M or connect to a remote executor.`}
|
|
1518
|
+
</p>
|
|
1519
|
+
`}
|
|
1520
|
+
</div>
|
|
1521
|
+
|
|
1522
|
+
<div class="items items--small">
|
|
1523
|
+
${c?L`
|
|
1524
|
+
<div class="connection-option connection-option--primary">
|
|
1525
|
+
<div class="connection-option__header">
|
|
1526
|
+
<svg
|
|
1527
|
+
width="24"
|
|
1528
|
+
height="24"
|
|
1529
|
+
viewBox="0 0 24 24"
|
|
1530
|
+
fill="none"
|
|
1531
|
+
stroke="currentColor"
|
|
1532
|
+
>
|
|
1533
|
+
<circle cx="12" cy="12" r="10"></circle>
|
|
1534
|
+
<circle cx="12" cy="12" r="3" fill="currentColor"></circle>
|
|
1535
|
+
</svg>
|
|
1536
|
+
<h4 class="heading nomargin">Local AD4M</h4>
|
|
1537
|
+
</div>
|
|
1538
|
+
<p class="body" style="margin: 10px 0 15px 0; font-size: 13px;">
|
|
1539
|
+
Connect to your local executor on port 12000
|
|
1540
|
+
</p>
|
|
1541
|
+
<button
|
|
1542
|
+
class="button button--full"
|
|
1543
|
+
@click=${a}
|
|
1544
|
+
>
|
|
1545
|
+
Connect to Local AD4M
|
|
1546
|
+
</button>
|
|
1547
|
+
</div>
|
|
1548
|
+
`:""}
|
|
1549
|
+
|
|
1550
|
+
${l?L`
|
|
1551
|
+
<div
|
|
1552
|
+
class="connection-option ${c?"":"connection-option--primary"}"
|
|
1553
|
+
>
|
|
1554
|
+
<div class="connection-option__header">
|
|
1555
|
+
<svg
|
|
1556
|
+
width="24"
|
|
1557
|
+
height="24"
|
|
1558
|
+
viewBox="0 0 24 24"
|
|
1559
|
+
fill="none"
|
|
1560
|
+
stroke="currentColor"
|
|
1561
|
+
>
|
|
1562
|
+
<circle cx="12" cy="12" r="10"></circle>
|
|
1563
|
+
<path d="M2 12h20"></path>
|
|
1564
|
+
<path
|
|
1565
|
+
d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"
|
|
1566
|
+
></path>
|
|
1567
|
+
</svg>
|
|
1568
|
+
<h4 class="heading nomargin">
|
|
1569
|
+
${p?"Configured AD4M Node":"Remote AD4M"}
|
|
1570
|
+
</h4>
|
|
1571
|
+
</div>
|
|
1572
|
+
${p?L`
|
|
1573
|
+
<p
|
|
1574
|
+
class="body"
|
|
1575
|
+
style="margin: 10px 0 5px 0; font-size: 13px;"
|
|
1576
|
+
>
|
|
1577
|
+
${e?"Multi-user backend configured":"Connect to AD4M node at URL"}
|
|
1578
|
+
</p>
|
|
1579
|
+
<p
|
|
1580
|
+
class="body"
|
|
1581
|
+
style="margin: 0 0 15px 0; font-size: 12px; opacity: 0.7; font-family: monospace;"
|
|
1582
|
+
>
|
|
1583
|
+
${p}
|
|
1584
|
+
</p>
|
|
1585
|
+
`:L`
|
|
1586
|
+
<p
|
|
1587
|
+
class="body"
|
|
1588
|
+
style="margin: 10px 0 15px 0; font-size: 13px;"
|
|
1589
|
+
>
|
|
1590
|
+
Connect to a remote executor or multi-user backend
|
|
1591
|
+
</p>
|
|
1592
|
+
`}
|
|
1593
|
+
<button
|
|
1594
|
+
class="button ${c?"button--secondary":""} button--full"
|
|
1595
|
+
@click=${o}
|
|
1596
|
+
>
|
|
1597
|
+
${p?"Connect to Configured Node":"Enter Remote URL"}
|
|
1598
|
+
</button>
|
|
1599
|
+
</div>
|
|
1600
|
+
`:""}
|
|
1601
|
+
|
|
1602
|
+
${d?L`
|
|
1603
|
+
<div class="connection-option">
|
|
1604
|
+
<div class="connection-option__header">
|
|
1605
|
+
<svg
|
|
1606
|
+
width="24"
|
|
1607
|
+
height="24"
|
|
1608
|
+
viewBox="0 0 24 24"
|
|
1609
|
+
fill="none"
|
|
1610
|
+
stroke="currentColor"
|
|
1611
|
+
>
|
|
1612
|
+
<rect x="3" y="3" width="7" height="7"></rect>
|
|
1613
|
+
<rect x="14" y="3" width="7" height="7"></rect>
|
|
1614
|
+
<rect x="14" y="14" width="7" height="7"></rect>
|
|
1615
|
+
<rect x="3" y="14" width="7" height="7"></rect>
|
|
1616
|
+
</svg>
|
|
1617
|
+
<h4 class="heading nomargin">Scan QR Code</h4>
|
|
1618
|
+
</div>
|
|
1619
|
+
<p class="body" style="margin: 10px 0 15px 0; font-size: 13px;">
|
|
1620
|
+
Scan a QR code from another device
|
|
1621
|
+
</p>
|
|
1622
|
+
<button
|
|
1623
|
+
class="button button--secondary button--full"
|
|
1624
|
+
@click=${s}
|
|
1625
|
+
>
|
|
1626
|
+
Scan QR Code
|
|
1627
|
+
</button>
|
|
1628
|
+
</div>
|
|
1629
|
+
`:""}
|
|
1630
|
+
|
|
1631
|
+
${f?L`
|
|
1632
|
+
<div class="connection-option connection-option--download">
|
|
1633
|
+
<div class="connection-option__header">
|
|
1634
|
+
<svg
|
|
1635
|
+
width="24"
|
|
1636
|
+
height="24"
|
|
1637
|
+
viewBox="0 0 24 24"
|
|
1638
|
+
fill="none"
|
|
1639
|
+
stroke="currentColor"
|
|
1640
|
+
>
|
|
1641
|
+
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
|
|
1642
|
+
<polyline points="7 10 12 15 17 10"></polyline>
|
|
1643
|
+
<line x1="12" y1="15" x2="12" y2="3"></line>
|
|
1644
|
+
</svg>
|
|
1645
|
+
<h4 class="heading nomargin">Get AD4M</h4>
|
|
1646
|
+
</div>
|
|
1647
|
+
<p class="body" style="margin: 10px 0 15px 0; font-size: 13px;">
|
|
1648
|
+
Download and install AD4M on your device
|
|
1649
|
+
</p>
|
|
1650
|
+
<button
|
|
1651
|
+
class="button button--full"
|
|
1652
|
+
@click=${u}
|
|
1653
|
+
>
|
|
1654
|
+
Download AD4M
|
|
1655
|
+
</button>
|
|
1656
|
+
</div>
|
|
1657
|
+
`:""}
|
|
1658
|
+
</div>
|
|
1659
|
+
</div>
|
|
1660
|
+
|
|
1661
|
+
<style>
|
|
1662
|
+
.connection-option {
|
|
1663
|
+
background: rgba(145, 227, 253, 0.05);
|
|
1664
|
+
border: 1px solid rgba(145, 227, 253, 0.2);
|
|
1665
|
+
border-radius: 8px;
|
|
1666
|
+
padding: 20px;
|
|
1667
|
+
transition: all 0.3s ease;
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1670
|
+
.connection-option:hover {
|
|
1671
|
+
border-color: rgba(145, 227, 253, 0.4);
|
|
1672
|
+
background: rgba(145, 227, 253, 0.08);
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
.connection-option--primary {
|
|
1676
|
+
border: 2px solid var(--gradient);
|
|
1677
|
+
background: rgba(145, 227, 253, 0.1);
|
|
1678
|
+
}
|
|
1679
|
+
|
|
1680
|
+
.connection-option--primary:hover {
|
|
1681
|
+
background: rgba(145, 227, 253, 0.15);
|
|
1682
|
+
}
|
|
1683
|
+
|
|
1684
|
+
.connection-option--download {
|
|
1685
|
+
border-style: dashed;
|
|
1686
|
+
opacity: 0.9;
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
.connection-option__header {
|
|
1690
|
+
display: flex;
|
|
1691
|
+
align-items: center;
|
|
1692
|
+
gap: 10px;
|
|
1693
|
+
margin-bottom: 5px;
|
|
1694
|
+
}
|
|
1695
|
+
|
|
1696
|
+
.connection-option__header svg {
|
|
1697
|
+
flex-shrink: 0;
|
|
1698
|
+
opacity: 0.8;
|
|
1699
|
+
}
|
|
1700
|
+
|
|
1701
|
+
.connection-option--primary .connection-option__header svg {
|
|
1702
|
+
color: var(--gradient);
|
|
1703
|
+
opacity: 1;
|
|
1704
|
+
}
|
|
1705
|
+
</style>
|
|
1706
|
+
`}function up(){return L`
|
|
1347
1707
|
<div class="items">
|
|
1348
1708
|
<div class="text-center">
|
|
1349
1709
|
<h1 class="heading">Request to AD4M blocked</h1>
|
|
@@ -1364,7 +1724,7 @@ type TriggeredNotification {
|
|
|
1364
1724
|
</button>
|
|
1365
1725
|
</div>
|
|
1366
1726
|
</div>
|
|
1367
|
-
`}function
|
|
1727
|
+
`}function lp({reconnect:t}){return L`
|
|
1368
1728
|
<div class="items items--small">
|
|
1369
1729
|
<div class="text-center">
|
|
1370
1730
|
<h1 class="heading">Could not connect to AD4M</h1>
|
|
@@ -1373,7 +1733,7 @@ type TriggeredNotification {
|
|
|
1373
1733
|
<button class="button" @click=${()=>t()}>Try again</button>
|
|
1374
1734
|
</div>
|
|
1375
1735
|
</div>
|
|
1376
|
-
`}function
|
|
1736
|
+
`}function pp(){return L`<header class="dialog__header">
|
|
1377
1737
|
<div class="dialog__logo">
|
|
1378
1738
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 37" fill="none">
|
|
1379
1739
|
<path
|
|
@@ -1382,7 +1742,7 @@ type TriggeredNotification {
|
|
|
1382
1742
|
/>
|
|
1383
1743
|
</svg>
|
|
1384
1744
|
</div>
|
|
1385
|
-
</header>`}function
|
|
1745
|
+
</header>`}function fp({step:t,email:e,changeEmail:r,changeState:n,password:i,changePassword:a,login:o,checkEmail:s,passwordError:u,setHostingStep:c,isHostingRunning:l,setIsHostingRunning:d}){if(l)return L`
|
|
1386
1746
|
<div class="text-center">
|
|
1387
1747
|
<p>
|
|
1388
1748
|
Hosted executor does not seem to be running. Please check the logs in your <a href="https://hosting.ad4m.dev/dashboard">ADAM hosting dashboard</a> and potentially restart your executor there.
|
|
@@ -1394,13 +1754,13 @@ type TriggeredNotification {
|
|
|
1394
1754
|
Back
|
|
1395
1755
|
</button>
|
|
1396
1756
|
</div>
|
|
1397
|
-
`;if(t===0)return
|
|
1757
|
+
`;if(t===0)return L`
|
|
1398
1758
|
<div class="input">
|
|
1399
1759
|
<label class="input__label">EMAIL</label>
|
|
1400
1760
|
<input
|
|
1401
1761
|
class="input__field"
|
|
1402
1762
|
value=${e}
|
|
1403
|
-
@input=${
|
|
1763
|
+
@input=${f=>r(f.target.value)}
|
|
1404
1764
|
/>
|
|
1405
1765
|
<div class="buttons">
|
|
1406
1766
|
<button
|
|
@@ -1417,18 +1777,18 @@ type TriggeredNotification {
|
|
|
1417
1777
|
</button>
|
|
1418
1778
|
</div>
|
|
1419
1779
|
</div>
|
|
1420
|
-
`;if(t===1)return
|
|
1780
|
+
`;if(t===1)return L`
|
|
1421
1781
|
<div class="input">
|
|
1422
1782
|
<label class="input__label">PASSWORD</label>
|
|
1423
1783
|
<input
|
|
1424
1784
|
class="input__field"
|
|
1425
1785
|
value=${i}
|
|
1426
|
-
@input=${
|
|
1786
|
+
@input=${f=>a(f.target.value)}
|
|
1427
1787
|
type="password"
|
|
1428
1788
|
errortext={passwordError}
|
|
1429
1789
|
error={passwordError}
|
|
1430
1790
|
/>
|
|
1431
|
-
${u?
|
|
1791
|
+
${u?L`<p class="error">${u}</p>`:""}
|
|
1432
1792
|
<div class="buttons">
|
|
1433
1793
|
<button
|
|
1434
1794
|
class="button button--full button-secondary"
|
|
@@ -1445,7 +1805,7 @@ type TriggeredNotification {
|
|
|
1445
1805
|
</button>
|
|
1446
1806
|
</div>
|
|
1447
1807
|
</div>
|
|
1448
|
-
`;if(t===2)return
|
|
1808
|
+
`;if(t===2)return L`
|
|
1449
1809
|
<div class="text-center">
|
|
1450
1810
|
<p>
|
|
1451
1811
|
Email is not registered. Please follow the <a target="_blank" href="https://hosting.ad4m.dev/">link</a> to register.
|
|
@@ -1457,7 +1817,7 @@ type TriggeredNotification {
|
|
|
1457
1817
|
Back
|
|
1458
1818
|
</button>
|
|
1459
1819
|
</div>
|
|
1460
|
-
`}function
|
|
1820
|
+
`}function dp(){return L`
|
|
1461
1821
|
<div>
|
|
1462
1822
|
<div class="lds-ring">
|
|
1463
1823
|
<div></div>
|
|
@@ -1466,30 +1826,431 @@ type TriggeredNotification {
|
|
|
1466
1826
|
<div></div>
|
|
1467
1827
|
</div>
|
|
1468
1828
|
</div>
|
|
1469
|
-
`}function
|
|
1829
|
+
`}function Co(){return L`
|
|
1470
1830
|
<svg width="44" height="40" viewBox="0 0 70 60" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1471
1831
|
<path d="M63.2781 52.9928C62.4038 47.0393 59.8345 41.4763 55.9242 36.935C55.9403 36.5766 55.951 36.2182 55.951 35.8545C55.951 26.6328 50.7373 18.6039 43.0937 14.5333C41.093 9.35009 37.7352 4.72854 33.2402 1.14469L31.7705 0L30.2793 1.10725L30.2096 1.16074C25.7253 4.74458 22.3729 9.36079 20.3775 14.5386C12.7339 18.6039 7.52021 26.6328 7.52021 35.8599C7.52021 36.2236 7.53094 36.582 7.54703 36.9404C3.6421 41.471 1.06742 47.034 0.198465 52.9874L0 54.9131L1.70036 55.5817C5.40683 57.0313 9.32249 57.7695 13.3401 57.7695C15.668 57.7695 17.9369 57.5127 20.1254 57.0366C23.5744 58.9248 27.533 60 31.7383 60C35.9436 60 39.9022 58.9248 43.3512 57.0366C45.5397 57.5127 47.8086 57.7695 50.1365 57.7695C54.1541 57.7695 58.0698 57.0366 61.7762 55.5817L63.5624 54.881L63.2835 52.9874L63.2781 52.9928ZM42.5734 51.8802C40.0792 51.1581 37.7352 50.0829 35.595 48.7189C39.752 44.675 42.8041 39.5079 44.263 33.7202C46.1297 34.6938 47.8891 35.8866 49.4982 37.288C49.9917 37.716 50.4637 38.1653 50.9197 38.6253C50.1258 44.1294 46.9986 48.8954 42.568 51.8855L42.5734 51.8802ZM12.5516 38.62C13.0075 38.1599 13.4849 37.716 13.973 37.288C15.5822 35.8866 17.3415 34.6938 19.2082 33.7202C20.6672 39.5079 23.7192 44.675 27.8763 48.7189C25.7361 50.0829 23.392 51.1527 20.8978 51.8802C16.4672 48.8901 13.3401 44.1241 12.5462 38.62H12.5516ZM40.3957 25.9802C40.3957 26.3332 40.3903 26.6809 40.3742 27.0286C37.585 26.2477 34.6831 25.8411 31.7383 25.8411C28.7935 25.8411 25.8916 26.2477 23.1024 27.0286C23.0917 26.6809 23.0809 26.3279 23.0809 25.9802C23.0809 23.2362 23.494 20.5563 24.2825 18.0102C26.5782 17.0527 29.0993 16.5231 31.7383 16.5231C34.3773 16.5231 36.8984 17.0527 39.1941 18.0102C39.9826 20.5563 40.3957 23.2362 40.3957 25.9802ZM23.73 31.8641C26.3047 31.0671 29.0027 30.6553 31.7383 30.6553C34.4739 30.6553 37.1719 31.0671 39.7466 31.8641C38.5344 37.2827 35.6808 42.0915 31.7383 45.7395C27.7958 42.0861 24.9422 37.2773 23.73 31.8641ZM50.7641 32.1262C48.9887 30.8104 47.0898 29.6817 45.0998 28.7671C45.1803 27.847 45.2232 26.9163 45.2232 25.9802C45.2232 24.536 45.1266 23.1131 44.9335 21.7063C47.8676 24.4343 49.9595 28.0503 50.7641 32.1262ZM31.7383 6.19417C33.6639 7.97005 35.2946 9.99198 36.6087 12.1904C35.0371 11.8695 33.4065 11.6983 31.7383 11.6983C30.0701 11.6983 28.4395 11.8695 26.8679 12.1904C28.182 9.99198 29.8127 7.97005 31.7383 6.19417ZM18.5431 21.701C18.3553 23.1078 18.2534 24.5306 18.2534 25.9749C18.2534 26.9163 18.2963 27.8417 18.3768 28.7617C16.3868 29.6764 14.4879 30.805 12.7125 32.1209C13.5171 28.0449 15.6036 24.429 18.5377 21.701H18.5431ZM5.33173 51.7518C5.9915 48.7938 7.15547 45.9802 8.74855 43.418C9.95007 47.034 11.9776 50.2808 14.622 52.9179C14.1983 52.9393 13.7692 52.95 13.3401 52.95C10.5991 52.95 7.91178 52.5488 5.32637 51.7465L5.33173 51.7518ZM31.7383 55.1859C30.1506 55.1859 28.6058 54.988 27.1307 54.6296C28.7452 53.854 30.29 52.95 31.7383 51.923C33.1866 52.95 34.7314 53.854 36.3459 54.6296C34.8655 54.988 33.326 55.1859 31.7383 55.1859ZM50.1365 52.95C49.7074 52.95 49.2783 52.9339 48.8546 52.9179C51.499 50.2808 53.5265 47.0393 54.728 43.4234C56.3211 45.9802 57.4851 48.7938 58.1449 51.7518C55.5648 52.5488 52.8775 52.95 50.1365 52.95Z" fill="#91E3FD"/>
|
|
1472
1832
|
</svg>
|
|
1473
|
-
`}function
|
|
1833
|
+
`}function hp({openModal:t}){return L`
|
|
1474
1834
|
<div class="mainlogo" @click=${t}>
|
|
1475
|
-
${
|
|
1835
|
+
${Co()}
|
|
1476
1836
|
</div>
|
|
1477
|
-
`}function
|
|
1837
|
+
`}function mp({email:t,password:e,error:r,isLoading:n,backendUrl:i,changeEmail:a,changePassword:o,onLogin:s,onSignup:u,activeTab:c,setActiveTab:l}){return L`
|
|
1838
|
+
<div class="items">
|
|
1839
|
+
<div class="text-center">
|
|
1840
|
+
<h3 class="heading">Multi-User Authentication</h3>
|
|
1841
|
+
<p class="body">Please sign in or create an account to continue</p>
|
|
1842
|
+
${i?L`
|
|
1843
|
+
<p
|
|
1844
|
+
class="body"
|
|
1845
|
+
style="margin-top: 10px; font-size: 12px; opacity: 0.7; font-family: monospace;"
|
|
1846
|
+
>
|
|
1847
|
+
${i}
|
|
1848
|
+
</p>
|
|
1849
|
+
`:""}
|
|
1850
|
+
</div>
|
|
1851
|
+
|
|
1852
|
+
<!-- Tab Switcher -->
|
|
1853
|
+
<div class="tab-switcher">
|
|
1854
|
+
<button
|
|
1855
|
+
class="tab-button ${c==="login"?"active":""}"
|
|
1856
|
+
@click=${()=>l("login")}
|
|
1857
|
+
>
|
|
1858
|
+
Login
|
|
1859
|
+
</button>
|
|
1860
|
+
<button
|
|
1861
|
+
class="tab-button ${c==="signup"?"active":""}"
|
|
1862
|
+
@click=${()=>l("signup")}
|
|
1863
|
+
>
|
|
1864
|
+
Sign Up
|
|
1865
|
+
</button>
|
|
1866
|
+
</div>
|
|
1867
|
+
|
|
1868
|
+
${r?L`
|
|
1869
|
+
<div class="error-message">
|
|
1870
|
+
<p>${r}</p>
|
|
1871
|
+
</div>
|
|
1872
|
+
`:""}
|
|
1873
|
+
|
|
1874
|
+
<!-- Login/Signup Form -->
|
|
1875
|
+
<div class="items items--small">
|
|
1876
|
+
<div class="input">
|
|
1877
|
+
<label class="input__label" for="email">Email</label>
|
|
1878
|
+
<input
|
|
1879
|
+
id="email"
|
|
1880
|
+
type="email"
|
|
1881
|
+
class="input__field"
|
|
1882
|
+
placeholder="your@email.com"
|
|
1883
|
+
.value=${t}
|
|
1884
|
+
@input=${d=>a(d.target.value)}
|
|
1885
|
+
?disabled=${n}
|
|
1886
|
+
/>
|
|
1887
|
+
</div>
|
|
1888
|
+
|
|
1889
|
+
<div class="input">
|
|
1890
|
+
<label class="input__label" for="password">Password</label>
|
|
1891
|
+
<input
|
|
1892
|
+
id="password"
|
|
1893
|
+
type="password"
|
|
1894
|
+
class="input__field"
|
|
1895
|
+
placeholder="Enter password"
|
|
1896
|
+
.value=${e}
|
|
1897
|
+
@input=${d=>o(d.target.value)}
|
|
1898
|
+
@keypress=${d=>{d.key==="Enter"&&(c==="login"?s():u())}}
|
|
1899
|
+
?disabled=${n}
|
|
1900
|
+
/>
|
|
1901
|
+
</div>
|
|
1902
|
+
</div>
|
|
1903
|
+
|
|
1904
|
+
<div class="buttons">
|
|
1905
|
+
${c==="login"?L`
|
|
1906
|
+
<button
|
|
1907
|
+
class="button button--full"
|
|
1908
|
+
@click=${s}
|
|
1909
|
+
?disabled=${n||!t||!e}
|
|
1910
|
+
>
|
|
1911
|
+
${n?"Logging in...":"Login"}
|
|
1912
|
+
</button>
|
|
1913
|
+
`:L`
|
|
1914
|
+
<button
|
|
1915
|
+
class="button button--full"
|
|
1916
|
+
@click=${u}
|
|
1917
|
+
?disabled=${n||!t||!e}
|
|
1918
|
+
>
|
|
1919
|
+
${n?"Creating account...":"Sign Up"}
|
|
1920
|
+
</button>
|
|
1921
|
+
`}
|
|
1922
|
+
</div>
|
|
1923
|
+
|
|
1924
|
+
${c==="login"?L`
|
|
1925
|
+
<div class="text-center">
|
|
1926
|
+
<p class="body">
|
|
1927
|
+
Don't have an account?
|
|
1928
|
+
<button
|
|
1929
|
+
class="button button--link"
|
|
1930
|
+
@click=${()=>l("signup")}
|
|
1931
|
+
>
|
|
1932
|
+
Sign up
|
|
1933
|
+
</button>
|
|
1934
|
+
</p>
|
|
1935
|
+
</div>
|
|
1936
|
+
`:L`
|
|
1937
|
+
<div class="text-center">
|
|
1938
|
+
<p class="body">
|
|
1939
|
+
Already have an account?
|
|
1940
|
+
<button
|
|
1941
|
+
class="button button--link"
|
|
1942
|
+
@click=${()=>l("login")}
|
|
1943
|
+
>
|
|
1944
|
+
Log in
|
|
1945
|
+
</button>
|
|
1946
|
+
</p>
|
|
1947
|
+
</div>
|
|
1948
|
+
`}
|
|
1949
|
+
</div>
|
|
1950
|
+
|
|
1951
|
+
<style>
|
|
1952
|
+
.tab-switcher {
|
|
1953
|
+
display: flex;
|
|
1954
|
+
gap: 10px;
|
|
1955
|
+
justify-content: center;
|
|
1956
|
+
border-bottom: 1px solid var(--body-color);
|
|
1957
|
+
padding-bottom: 10px;
|
|
1958
|
+
}
|
|
1959
|
+
|
|
1960
|
+
.tab-button {
|
|
1961
|
+
background: none;
|
|
1962
|
+
border: none;
|
|
1963
|
+
color: var(--body-color);
|
|
1964
|
+
padding: 10px 20px;
|
|
1965
|
+
cursor: pointer;
|
|
1966
|
+
font-size: 16px;
|
|
1967
|
+
font-weight: 500;
|
|
1968
|
+
border-bottom: 2px solid transparent;
|
|
1969
|
+
transition: all 0.3s ease;
|
|
1970
|
+
}
|
|
1971
|
+
|
|
1972
|
+
.tab-button.active {
|
|
1973
|
+
color: var(--gradient);
|
|
1974
|
+
border-bottom-color: var(--gradient);
|
|
1975
|
+
}
|
|
1976
|
+
|
|
1977
|
+
.tab-button:hover {
|
|
1978
|
+
color: var(--primary-color);
|
|
1979
|
+
}
|
|
1980
|
+
|
|
1981
|
+
.error-message {
|
|
1982
|
+
background-color: rgba(255, 0, 0, 0.1);
|
|
1983
|
+
border: 1px solid rgba(255, 0, 0, 0.3);
|
|
1984
|
+
border-radius: 8px;
|
|
1985
|
+
padding: 15px;
|
|
1986
|
+
color: #ff6b6b;
|
|
1987
|
+
text-align: center;
|
|
1988
|
+
}
|
|
1989
|
+
|
|
1990
|
+
.error-message p {
|
|
1991
|
+
margin: 0;
|
|
1992
|
+
}
|
|
1993
|
+
</style>
|
|
1994
|
+
`}function gp({initialUrl:t,detecting:e,multiUserDetected:r,error:n,onBack:i,onUrlChange:a,onConnect:o,onMultiUserAuth:s,onRequestCapability:u}){let c=r!==null&&!e,l=t||"";return L`
|
|
1995
|
+
<div class="items">
|
|
1996
|
+
<div class="text-center">
|
|
1997
|
+
<h3 class="heading">Connect to Remote AD4M</h3>
|
|
1998
|
+
<p class="body">Enter the URL of a remote AD4M executor</p>
|
|
1999
|
+
</div>
|
|
2000
|
+
|
|
2001
|
+
${c?L`
|
|
2002
|
+
<div class="items items--small">
|
|
2003
|
+
<div class="remote-info">
|
|
2004
|
+
<p class="body" style="margin: 0 0 5px 0; font-size: 13px;">
|
|
2005
|
+
Connected to:
|
|
2006
|
+
</p>
|
|
2007
|
+
<p
|
|
2008
|
+
class="body"
|
|
2009
|
+
style="margin: 0; font-family: monospace; font-size: 12px; opacity: 0.8;"
|
|
2010
|
+
>
|
|
2011
|
+
${l}
|
|
2012
|
+
</p>
|
|
2013
|
+
</div>
|
|
2014
|
+
|
|
2015
|
+
${r?L`
|
|
2016
|
+
<div class="auth-option auth-option--primary">
|
|
2017
|
+
<div class="auth-option__header">
|
|
2018
|
+
<svg
|
|
2019
|
+
width="20"
|
|
2020
|
+
height="20"
|
|
2021
|
+
viewBox="0 0 24 24"
|
|
2022
|
+
fill="none"
|
|
2023
|
+
stroke="currentColor"
|
|
2024
|
+
>
|
|
2025
|
+
<path
|
|
2026
|
+
d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"
|
|
2027
|
+
></path>
|
|
2028
|
+
<circle cx="9" cy="7" r="4"></circle>
|
|
2029
|
+
<path d="M23 21v-2a4 4 0 0 0-3-3.87"></path>
|
|
2030
|
+
<path d="M16 3.13a4 4 0 0 1 0 7.75"></path>
|
|
2031
|
+
</svg>
|
|
2032
|
+
<h4 class="heading nomargin" style="font-size: 16px;">
|
|
2033
|
+
Multi-User Login
|
|
2034
|
+
</h4>
|
|
2035
|
+
</div>
|
|
2036
|
+
<p
|
|
2037
|
+
class="body"
|
|
2038
|
+
style="margin: 10px 0 15px 0; font-size: 13px;"
|
|
2039
|
+
>
|
|
2040
|
+
This executor supports multi-user authentication. Sign
|
|
2041
|
+
in or create an account.
|
|
2042
|
+
</p>
|
|
2043
|
+
<button class="button button--full" @click=${s}>
|
|
2044
|
+
Login / Sign Up
|
|
2045
|
+
</button>
|
|
2046
|
+
</div>
|
|
2047
|
+
|
|
2048
|
+
<div class="auth-option">
|
|
2049
|
+
<div class="auth-option__header">
|
|
2050
|
+
<svg
|
|
2051
|
+
width="20"
|
|
2052
|
+
height="20"
|
|
2053
|
+
viewBox="0 0 24 24"
|
|
2054
|
+
fill="none"
|
|
2055
|
+
stroke="currentColor"
|
|
2056
|
+
>
|
|
2057
|
+
<rect
|
|
2058
|
+
x="3"
|
|
2059
|
+
y="11"
|
|
2060
|
+
width="18"
|
|
2061
|
+
height="11"
|
|
2062
|
+
rx="2"
|
|
2063
|
+
ry="2"
|
|
2064
|
+
></rect>
|
|
2065
|
+
<path d="M7 11V7a5 5 0 0 1 10 0v4"></path>
|
|
2066
|
+
</svg>
|
|
2067
|
+
<h4 class="heading nomargin" style="font-size: 16px;">
|
|
2068
|
+
Capability Request
|
|
2069
|
+
</h4>
|
|
2070
|
+
</div>
|
|
2071
|
+
<p
|
|
2072
|
+
class="body"
|
|
2073
|
+
style="margin: 10px 0 15px 0; font-size: 13px;"
|
|
2074
|
+
>
|
|
2075
|
+
Request access to the main agent with a verification
|
|
2076
|
+
code.
|
|
2077
|
+
</p>
|
|
2078
|
+
<button
|
|
2079
|
+
class="button button--secondary button--full"
|
|
2080
|
+
@click=${u}
|
|
2081
|
+
>
|
|
2082
|
+
Request Capability
|
|
2083
|
+
</button>
|
|
2084
|
+
</div>
|
|
2085
|
+
`:L`
|
|
2086
|
+
<div class="auth-option auth-option--primary">
|
|
2087
|
+
<div class="auth-option__header">
|
|
2088
|
+
<svg
|
|
2089
|
+
width="20"
|
|
2090
|
+
height="20"
|
|
2091
|
+
viewBox="0 0 24 24"
|
|
2092
|
+
fill="none"
|
|
2093
|
+
stroke="currentColor"
|
|
2094
|
+
>
|
|
2095
|
+
<rect
|
|
2096
|
+
x="3"
|
|
2097
|
+
y="11"
|
|
2098
|
+
width="18"
|
|
2099
|
+
height="11"
|
|
2100
|
+
rx="2"
|
|
2101
|
+
ry="2"
|
|
2102
|
+
></rect>
|
|
2103
|
+
<path d="M7 11V7a5 5 0 0 1 10 0v4"></path>
|
|
2104
|
+
</svg>
|
|
2105
|
+
<h4 class="heading nomargin" style="font-size: 16px;">
|
|
2106
|
+
Single-User Executor
|
|
2107
|
+
</h4>
|
|
2108
|
+
</div>
|
|
2109
|
+
<p
|
|
2110
|
+
class="body"
|
|
2111
|
+
style="margin: 10px 0 15px 0; font-size: 13px;"
|
|
2112
|
+
>
|
|
2113
|
+
This executor uses capability-based authentication.
|
|
2114
|
+
Request access with a verification code.
|
|
2115
|
+
</p>
|
|
2116
|
+
<button
|
|
2117
|
+
class="button button--full"
|
|
2118
|
+
@click=${u}
|
|
2119
|
+
>
|
|
2120
|
+
Request Capability
|
|
2121
|
+
</button>
|
|
2122
|
+
</div>
|
|
2123
|
+
`}
|
|
2124
|
+
|
|
2125
|
+
<div class="buttons">
|
|
2126
|
+
<button
|
|
2127
|
+
class="button button--link"
|
|
2128
|
+
@click=${i}
|
|
2129
|
+
style="margin: 0 auto;"
|
|
2130
|
+
>
|
|
2131
|
+
← Back to connection options
|
|
2132
|
+
</button>
|
|
2133
|
+
</div>
|
|
2134
|
+
</div>
|
|
2135
|
+
`:L`
|
|
2136
|
+
<div class="items items--small">
|
|
2137
|
+
<div class="input">
|
|
2138
|
+
<label class="input__label" for="remote-url">
|
|
2139
|
+
Executor URL
|
|
2140
|
+
</label>
|
|
2141
|
+
<input
|
|
2142
|
+
id="remote-url"
|
|
2143
|
+
type="text"
|
|
2144
|
+
class="input__field"
|
|
2145
|
+
placeholder="wss://your-server.com/graphql"
|
|
2146
|
+
.value=${l}
|
|
2147
|
+
@input=${d=>a(d.target.value)}
|
|
2148
|
+
?disabled=${e}
|
|
2149
|
+
/>
|
|
2150
|
+
</div>
|
|
2151
|
+
|
|
2152
|
+
${n?L`
|
|
2153
|
+
<div class="error-message">
|
|
2154
|
+
<p>${n}</p>
|
|
2155
|
+
</div>
|
|
2156
|
+
`:""}
|
|
2157
|
+
|
|
2158
|
+
<div class="buttons">
|
|
2159
|
+
<button
|
|
2160
|
+
class="button button--secondary"
|
|
2161
|
+
@click=${i}
|
|
2162
|
+
?disabled=${e}
|
|
2163
|
+
>
|
|
2164
|
+
Back
|
|
2165
|
+
</button>
|
|
2166
|
+
<button
|
|
2167
|
+
class="button"
|
|
2168
|
+
@click=${o}
|
|
2169
|
+
?disabled=${e||!l}
|
|
2170
|
+
>
|
|
2171
|
+
${e?"Detecting...":"Connect"}
|
|
2172
|
+
</button>
|
|
2173
|
+
</div>
|
|
2174
|
+
</div>
|
|
2175
|
+
`}
|
|
2176
|
+
</div>
|
|
2177
|
+
|
|
2178
|
+
<style>
|
|
2179
|
+
.remote-info {
|
|
2180
|
+
background: rgba(145, 227, 253, 0.05);
|
|
2181
|
+
border: 1px solid rgba(145, 227, 253, 0.2);
|
|
2182
|
+
border-radius: 8px;
|
|
2183
|
+
padding: 15px;
|
|
2184
|
+
}
|
|
2185
|
+
|
|
2186
|
+
.auth-option {
|
|
2187
|
+
background: rgba(145, 227, 253, 0.05);
|
|
2188
|
+
border: 1px solid rgba(145, 227, 253, 0.2);
|
|
2189
|
+
border-radius: 8px;
|
|
2190
|
+
padding: 20px;
|
|
2191
|
+
transition: all 0.3s ease;
|
|
2192
|
+
}
|
|
2193
|
+
|
|
2194
|
+
.auth-option:hover {
|
|
2195
|
+
border-color: rgba(145, 227, 253, 0.4);
|
|
2196
|
+
background: rgba(145, 227, 253, 0.08);
|
|
2197
|
+
}
|
|
2198
|
+
|
|
2199
|
+
.auth-option--primary {
|
|
2200
|
+
border: 2px solid var(--gradient);
|
|
2201
|
+
background: rgba(145, 227, 253, 0.1);
|
|
2202
|
+
}
|
|
2203
|
+
|
|
2204
|
+
.auth-option--primary:hover {
|
|
2205
|
+
background: rgba(145, 227, 253, 0.15);
|
|
2206
|
+
}
|
|
2207
|
+
|
|
2208
|
+
.auth-option__header {
|
|
2209
|
+
display: flex;
|
|
2210
|
+
align-items: center;
|
|
2211
|
+
gap: 10px;
|
|
2212
|
+
margin-bottom: 5px;
|
|
2213
|
+
}
|
|
2214
|
+
|
|
2215
|
+
.auth-option__header svg {
|
|
2216
|
+
flex-shrink: 0;
|
|
2217
|
+
opacity: 0.8;
|
|
2218
|
+
}
|
|
2219
|
+
|
|
2220
|
+
.auth-option--primary .auth-option__header svg {
|
|
2221
|
+
color: var(--gradient);
|
|
2222
|
+
opacity: 1;
|
|
2223
|
+
}
|
|
2224
|
+
|
|
2225
|
+
.error-message {
|
|
2226
|
+
background-color: rgba(255, 0, 0, 0.1);
|
|
2227
|
+
border: 1px solid rgba(255, 0, 0, 0.3);
|
|
2228
|
+
border-radius: 8px;
|
|
2229
|
+
padding: 15px;
|
|
2230
|
+
color: #ff6b6b;
|
|
2231
|
+
text-align: center;
|
|
2232
|
+
}
|
|
2233
|
+
|
|
2234
|
+
.error-message p {
|
|
2235
|
+
margin: 0;
|
|
2236
|
+
}
|
|
2237
|
+
</style>
|
|
2238
|
+
`}function yp({capabilities:t,appname:e,appiconpath:r,changeState:n,setOpen:i,requestCapability:a}){return L`
|
|
1478
2239
|
<div class="items">
|
|
1479
2240
|
<div class="text-center">
|
|
1480
2241
|
<p class="body">An external application</p>
|
|
1481
2242
|
<h1 class="heading nomargin">${e}</h1>
|
|
1482
2243
|
<p class="body">wants to access your AD4M data</p>
|
|
1483
2244
|
</div>
|
|
1484
|
-
${r&&
|
|
2245
|
+
${r&&L`<div class="dialog__connect">
|
|
1485
2246
|
<img class="dialog__connect-app" src=${r} alt="Logo" />
|
|
1486
2247
|
<div class="dialog__connect-check"></div>
|
|
1487
|
-
<div class="dialog__connect-ad4m">${
|
|
2248
|
+
<div class="dialog__connect-ad4m">${Co()}</div>
|
|
1488
2249
|
</div>`}
|
|
1489
2250
|
<div>
|
|
1490
2251
|
<p class="text-center"><b>This will allow the developer to:</b></p>
|
|
1491
2252
|
<ul class="check-list">
|
|
1492
|
-
${t.map(o=>
|
|
2253
|
+
${t.map(o=>L`<li>
|
|
1493
2254
|
<span>
|
|
1494
2255
|
<svg
|
|
1495
2256
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -1503,7 +2264,7 @@ type TriggeredNotification {
|
|
|
1503
2264
|
/>
|
|
1504
2265
|
</svg>
|
|
1505
2266
|
</span>
|
|
1506
|
-
<span>${
|
|
2267
|
+
<span>${rm(o)}</span>
|
|
1507
2268
|
</li>`)}
|
|
1508
2269
|
</ul>
|
|
1509
2270
|
</div>
|
|
@@ -1528,7 +2289,7 @@ type TriggeredNotification {
|
|
|
1528
2289
|
Connection settings
|
|
1529
2290
|
</button>
|
|
1530
2291
|
</div>
|
|
1531
|
-
`}function
|
|
2292
|
+
`}function vp({changeState:t,onSuccess:e,uiState:r}){function n(i){let a=new BarcodeDetector,o=i.currentTarget,s=()=>ee(this,null,function*(){try{if(r!=="qr")return;let c=(yield a.detect(o)).find(l=>l.format==="qr_code");if(c!=null&&c.rawValue){t("requestcap"),e(c.rawValue);return}else requestAnimationFrame(s)}catch(u){console.error(u)}});s()}return L`
|
|
1532
2293
|
<div class="qr-scanner">
|
|
1533
2294
|
<div class="qr-content">
|
|
1534
2295
|
<button
|
|
@@ -1547,7 +2308,7 @@ type TriggeredNotification {
|
|
|
1547
2308
|
></video>
|
|
1548
2309
|
</div>
|
|
1549
2310
|
</div>
|
|
1550
|
-
`}function
|
|
2311
|
+
`}function bp({port:t,url:e,isRemote:r,connectToPort:n,changeIsRemote:i,connectRemote:a,changeState:o,changeUrl:s,changePort:u,clearState:c}){return L`
|
|
1551
2312
|
<div class="items items--small">
|
|
1552
2313
|
<div class="text-center">
|
|
1553
2314
|
<h1 class="heading">Connection Settings</h1>
|
|
@@ -1558,66 +2319,66 @@ type TriggeredNotification {
|
|
|
1558
2319
|
Locally
|
|
1559
2320
|
</button>
|
|
1560
2321
|
<button class=${`button ${r?"button--primary":"button--secondary"}`} @click=${()=>i(!0)}>
|
|
1561
|
-
|
|
2322
|
+
Remotely
|
|
1562
2323
|
</button>
|
|
1563
2324
|
</div>
|
|
1564
|
-
${r?
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
@input=${p=>u(parseInt(p.target.value))}
|
|
1591
|
-
/>
|
|
1592
|
-
</div>
|
|
2325
|
+
${r?L`
|
|
2326
|
+
<div class="input">
|
|
2327
|
+
<label class="input__label">URL</label>
|
|
2328
|
+
<input
|
|
2329
|
+
class="input__field"
|
|
2330
|
+
value=${e}
|
|
2331
|
+
@input=${f=>s(f.target.value)}
|
|
2332
|
+
/>
|
|
2333
|
+
</div>
|
|
2334
|
+
<div class="buttons">
|
|
2335
|
+
<button
|
|
2336
|
+
class="button button--full"
|
|
2337
|
+
@click=${()=>a(e)}
|
|
2338
|
+
>
|
|
2339
|
+
Connect
|
|
2340
|
+
</button>
|
|
2341
|
+
</div>
|
|
2342
|
+
`:L`
|
|
2343
|
+
<div class="input">
|
|
2344
|
+
<label class="input__label">PORT</label>
|
|
2345
|
+
<input
|
|
2346
|
+
class="input__field"
|
|
2347
|
+
value=${t}
|
|
2348
|
+
@input=${f=>u(parseInt(f.target.value))}
|
|
2349
|
+
/>
|
|
2350
|
+
</div>
|
|
1593
2351
|
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
2352
|
+
<div class="buttons">
|
|
2353
|
+
<button
|
|
2354
|
+
class="button button--full"
|
|
2355
|
+
@click=${()=>n(t)}
|
|
2356
|
+
>
|
|
2357
|
+
Connect
|
|
2358
|
+
</button>
|
|
2359
|
+
</div>
|
|
2360
|
+
`}
|
|
2361
|
+
|
|
2362
|
+
<div class="text-center">or</div>
|
|
2363
|
+
<div class="buttons">
|
|
2364
|
+
<button
|
|
2365
|
+
class="button button--full button--secondary"
|
|
2366
|
+
@click=${()=>o("start")}
|
|
2367
|
+
>
|
|
2368
|
+
Back
|
|
2369
|
+
</button>
|
|
2370
|
+
<button
|
|
2371
|
+
class="button button--full button--secondary"
|
|
2372
|
+
@click=${c}
|
|
2373
|
+
>
|
|
2374
|
+
Clear state
|
|
2375
|
+
</button>
|
|
2376
|
+
</div
|
|
1617
2377
|
</div>
|
|
1618
|
-
`}function
|
|
2378
|
+
`}function _p({connect:t,isMobile:e,hasClickedDownload:r,changeState:n,onDownloaded:i,scanQrcode:a,hosting:o}){let u=(Wt("ad4murl")||`http://localhost:${kr}`).includes("localhost");function c(l){l.preventDefault();let d=l.currentTarget;window.open(d.href,"_blank"),this.onDownloaded()}return L`
|
|
1619
2379
|
<div class="items">
|
|
1620
|
-
${r?
|
|
2380
|
+
${r?L`
|
|
2381
|
+
<div class="text-center">
|
|
1621
2382
|
<a class="button" target="_blank" @click=${()=>t()}>
|
|
1622
2383
|
Connect to ADAM
|
|
1623
2384
|
</a>
|
|
@@ -1625,54 +2386,62 @@ type TriggeredNotification {
|
|
|
1625
2386
|
Please connect to ADAM once you have downloaded and setup your
|
|
1626
2387
|
ADAM agent
|
|
1627
2388
|
</p>
|
|
1628
|
-
</div
|
|
2389
|
+
</div>
|
|
2390
|
+
`:L`
|
|
1629
2391
|
<div class="text-center">
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
>
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
2392
|
+
<h1 class="heading">Could not connect to AD4M</h1>
|
|
2393
|
+
${u?L`
|
|
2394
|
+
<p style="color: #b9b9b9; font-size: 15px; text-align: center; margin: 30px 0;">
|
|
2395
|
+
Please make sure you have the ADAM Launcher running on your computer and there are no browser restrictions ("Shields") blocking your connection to ADAM on localhost.
|
|
2396
|
+
<br/>
|
|
2397
|
+
<br/>
|
|
2398
|
+
(Safari users: please use a different browser for now. Safari is very strict about this and we are working on a solution.)
|
|
2399
|
+
</p>
|
|
2400
|
+
`:L`
|
|
2401
|
+
<p style="color: #b9b9b9; font-size: 15px; text-align: center; margin: 30px 0;">
|
|
2402
|
+
Looks like the remote executor you are trying to connect to is not reachable.
|
|
2403
|
+
<br/>
|
|
2404
|
+
<br/>
|
|
2405
|
+
Please try connecting to a different remote executor or check your connection settings.
|
|
2406
|
+
</p>
|
|
2407
|
+
`}
|
|
2408
|
+
${e?L`<button class="button" @click=${()=>a()}>
|
|
2409
|
+
Connect with QR
|
|
2410
|
+
</button>`:L`<a
|
|
2411
|
+
class="button"
|
|
2412
|
+
target="_blank"
|
|
2413
|
+
@click=${c}
|
|
2414
|
+
href="https://github.com/coasys/ad4m/releases"
|
|
2415
|
+
>
|
|
2416
|
+
Download AD4M
|
|
2417
|
+
</a>
|
|
2418
|
+
`}
|
|
2419
|
+
${o?L`<p>Or</p>`:""}
|
|
2420
|
+
${o?L`<button class="button" @click=${()=>n("hosting")}>Use hosted AD4M (alpha)</button>`:""}
|
|
1642
2421
|
</div>
|
|
1643
|
-
<div class="text-center">
|
|
1644
|
-
<button class="button button--link " @click=${()=>t()}>
|
|
1645
|
-
Try again
|
|
1646
|
-
</button>
|
|
1647
|
-
or
|
|
1648
|
-
<button
|
|
1649
|
-
class="button button--link "
|
|
1650
|
-
@click=${()=>n("settings")}
|
|
1651
|
-
>
|
|
1652
|
-
Change connection settings
|
|
1653
|
-
</button>
|
|
1654
|
-
|
|
1655
|
-
</div>`}
|
|
1656
2422
|
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
</
|
|
1662
|
-
|
|
1663
|
-
<
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
2423
|
+
<div style="display: flex; flex-direction: column; align-items: center; gap: 20px; margin-top: -30px">
|
|
2424
|
+
or
|
|
2425
|
+
<button class="button button--secondary" @click=${()=>t()}>
|
|
2426
|
+
Try reconnecting
|
|
2427
|
+
</button>
|
|
2428
|
+
or
|
|
2429
|
+
<button
|
|
2430
|
+
class="button button--secondary "
|
|
2431
|
+
@click=${()=>n("settings")}
|
|
2432
|
+
>
|
|
2433
|
+
Change connection settings
|
|
2434
|
+
</button>
|
|
2435
|
+
</div>
|
|
2436
|
+
`}
|
|
1668
2437
|
|
|
1669
2438
|
<div class="text-center">
|
|
1670
|
-
<a class="button
|
|
1671
|
-
|
|
1672
|
-
>
|
|
2439
|
+
<a class="button" _target="blank" href="https://ad4m.dev">
|
|
2440
|
+
Learn more about ADAM
|
|
2441
|
+
</a>
|
|
1673
2442
|
</div>
|
|
1674
2443
|
</div>
|
|
1675
|
-
`}function
|
|
2444
|
+
`}function wp({code:t,changeState:e,verifyCode:r,changeCode:n,isHosting:i,verifyCodeError:a}){return L`
|
|
1676
2445
|
<div class="items">
|
|
1677
2446
|
<div class="text-center">
|
|
1678
2447
|
<div class="heading">${i?"Please check your emails for the 2FA security code that was sent from the ADAM hosting service":"Please check your ADAM Launcher"}</div>
|
|
@@ -1690,7 +2459,7 @@ type TriggeredNotification {
|
|
|
1690
2459
|
value=${t}
|
|
1691
2460
|
@change=${o=>n(o.target.value)}
|
|
1692
2461
|
/>
|
|
1693
|
-
${a?
|
|
2462
|
+
${a?L`<p class="error">${a}</p>`:""}
|
|
1694
2463
|
</div>
|
|
1695
2464
|
<div class="buttons">
|
|
1696
2465
|
<button
|
|
@@ -1704,7 +2473,7 @@ type TriggeredNotification {
|
|
|
1704
2473
|
</button>
|
|
1705
2474
|
</div>
|
|
1706
2475
|
</div>
|
|
1707
|
-
`}function
|
|
2476
|
+
`}function D3(){return[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i].some(e=>navigator.userAgent.match(e))}var N3=Sc`
|
|
1708
2477
|
:host {
|
|
1709
2478
|
--primary-color: #fff;
|
|
1710
2479
|
--heading-color: #fff;
|
|
@@ -2105,16 +2874,16 @@ type TriggeredNotification {
|
|
|
2105
2874
|
width: 100vw;
|
|
2106
2875
|
object-fit: cover;
|
|
2107
2876
|
}
|
|
2108
|
-
`,ce=class extends hr{constructor(){super(...arguments);this._code=null;this._isMobile=null;this._hasClickedDownload=null;this._isRemote=!1;this._isOpen=!1;this._hostingStep=0;this._email="";this._passowrd="";this._passwordError=null;this._hostingNotRunningError=null;this._verifyCodeError=null;this._isHostingLoading=!1;this.uiState="start";this.appName=null;this.appDesc=null;this.appDomain=null;this.appIconPath=null;this.mobile=null;this.capabilities=[];this.hosting=Jt("ad4mhosting")==="true"||!1;this.token=Jt("ad4mToken")||"";this.port=parseInt(Jt("ad4mport"))||12e3;this.url=Jt("ad4murl")||""}get authState(){return this._client.authState}get connectionState(){return this._client.connectionState}injectFont(){let r=document.createElement("link");r.setAttribute("rel","stylesheet"),r.setAttribute("href","https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200..800&display=swap"),document.head.appendChild(r)}connectedCallback(){super.connectedCallback(),Ma(this),this.injectFont(),this._isMobile=R2(),this._client=new ja({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(Jt("ad4mport"))||12e3,token:this.token||Jt("ad4mtoken"),url:this.url||Jt("ad4murl"),hosting:this.hosting}),this._client.on("configstatechange",this.handleConfigChange),this._client.on("authstatechange",this.handleAuthChange),this._client.on("connectionstatechange",this.handleConnectionChange),this.loadFont()}checkEmail(){return pe(this,null,function*(){try{(yield this._client.checkEmail(this._email))?this._hostingStep=1:this._hostingStep=2}catch(r){console.log(r)}})}loginToHosting(){return pe(this,null,function*(){try{yield this._client.loginToHosting(this._email,this._passowrd),this.changeUIState("connected")}catch(r){r.message.includes("Passwords did not match")?this._passwordError="Passwords did not match":this._hostingNotRunningError="Hosting is not running"}})}changeEmail(r){this._email=r}changePassword(r){this._passowrd=r}unlockAgent(r,n=!0){return pe(this,null,function*(){yield this._client.ad4mClient.agent.unlock(r,n)})}verifyCode(r){return pe(this,null,function*(){try{yield this._client.verifyCode(r)}catch(n){this._verifyCodeError="Invalid code"}})}changeUrl(r){r!==this._client.url&&(bl("ad4mtoken"),this._client.setToken(null)),this._client.setUrl(r)}changePort(r){this._client.setPort(r)}changeUIState(r){this.uiState=r}setIsHostingRunning(r){this._hostingNotRunningError=r}changeIsRemote(r){this._isRemote=r}changeCode(r){this._code=r}onDownloaded(){this._hasClickedDownload=!0}handleAuthChange(r){let n=new CustomEvent("authstatechange",{detail:r});r==="locked"&&(this._isOpen=!0),r==="authenticated"&&(this._isOpen=!1),this.dispatchEvent(n),this.requestUpdate()}handleConfigChange(r,n){this[r]=n,n?Ps("ad4m"+r,n):bl("ad4m"+r),this.requestUpdate()}handleConnectionChange(r){console.log(r),r==="connected"&&(this.authState!=="authenticated"?this.changeUIState("requestcap"):(this.changeUIState("connected"),this._isOpen=!1)),r==="disconnected"&&(this._isOpen=!0),r==="not_connected"&&(this._isOpen=!0,this.changeUIState("start"));let n=new CustomEvent("connectionstatechange",{detail:r});this.dispatchEvent(n),this.requestUpdate()}loadFont(){let r=document.createElement("link");r.rel="stylesheet",r.type="text/css",r.crossOrigin="anonymous",r.href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap",document.head.appendChild(r)}startCamera(r){return pe(this,null,function*(){try{window.BarcodeDetector.getSupportedFormats()}catch(n){window.BarcodeDetector=pr}yield this.changeUIState("qr"),setTimeout(()=>pe(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 pe(this,null,function*(){this._isOpen=!0,this.requestUpdate();let r=yield this._client.connect();try{let n=yield r.agent.status();n.isUnlocked&&n.isInitialized&&window.location.reload()}catch(n){console.warn(n)}return r})}getAd4mClient(){return this._client.ad4mClient}connectRemote(r){return pe(this,null,function*(){try{this.changeUrl(r);let n=yield this._client.connect(r),i=yield n.agent.status();return i.isUnlocked&&i.isInitialized||this.changeUIState("requestcap"),n}catch(n){this.changeUIState("requestcap"),this._isOpen=!0}})}requestCapability(r){return pe(this,null,function*(){try{yield this._client.requestCapability(r),this.changeUIState("verifycode")}catch(n){console.warn(n)}})}isAuthenticated(){return pe(this,null,function*(){return this._client.checkAuth()})}setOpen(r){this._isOpen=r}setHostingStep(r){this._hostingStep=r}clearState(){this.handleConfigChange("port",null),this.handleConfigChange("url",null),this.handleConfigChange("token",null),this.handleConnectionChange("not_connected"),this.handleAuthChange("unauthenticated"),this.changeUIState("start"),this._client.clearState()}renderViews(){if(this.connectionState==="connecting")return xl();if(this.uiState==="hosting")return Cl({email:this._email,password:this._passowrd,changeEmail:this.changeEmail,changePassword:this.changePassword,changeState:this.changeUIState,step:this._hostingStep,setHostingStep:this.setHostingStep,login:this.loginToHosting,checkEmail:this.checkEmail,passwordError:this._passwordError,isHostingRunning:this._hostingNotRunningError,setIsHostingRunning:this.setIsHostingRunning});if(this.uiState==="qr")return Al({changeState:this.changeUIState,onSuccess:r=>{this.changeUrl(r),this._client.connect(r)},uiState:this.uiState});if(this.authState==="locked")return _l({unlockAgent:this.unlockAgent,reconnect:this.connect});if(this.uiState==="settings")return Il({port:this.port,changePort:this.changePort,isRemote:this._isRemote,changeIsRemote:this.changeIsRemote,url:this.url,changeState:this.changeUIState,changeUrl:this.changeUrl,connectToPort:this._client.connectToPort,connectRemote:this.connectRemote,clearState:this.clearState});if(this.connectionState==="not_connected")return Ol({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"?Dl({code:this._code,changeCode:this.changeCode,changeState:this.changeUIState,verifyCode:this.verifyCode,isHosting:this._client.isHosting,verifyCodeError:this._verifyCodeError}):Tl({changeState:this.changeUIState,requestCapability:this.requestCapability,capabilities:this.capabilities,appname:this.appName,setOpen:this.setOpen,appiconpath:this.appIconPath});if(this.connectionState==="disconnected")return Sl({reconnect:this.connect});if(this.connectionState==="port_not_found")return wl()}mobileView(){return this.mobile?kl({openModal:()=>{this.changeUIState("settings"),this._isOpen=!this._isOpen}}):null}render(){return console.log(this.authState,this.connectionState,this.uiState,this._isOpen),this._isOpen===!1?this.authState==="authenticated"?this.mobileView():null:B`
|
|
2877
|
+
`,Z=class extends Or{constructor(){super(...arguments);this._code=null;this._isMobile=null;this._hasClickedDownload=null;this._isRemote=!1;this._isOpen=!1;this._hostingStep=0;this._email="";this._passowrd="";this._passwordError=null;this._hostingNotRunningError=null;this._verifyCodeError=null;this._isHostingLoading=!1;this._multiUserEmail="";this._multiUserPassword="";this._multiUserError=null;this._multiUserLoading=!1;this._multiUserTab="login";this._localDetected=!1;this._remoteUrl="";this._remoteMultiUserDetected=null;this._remoteDetecting=!1;this._remoteError=null;this.uiState="connection_overview";this.appName=null;this.appDesc=null;this.appDomain=null;this.appIconPath=null;this.mobile=null;this.capabilities=[];this.hosting=Wt("ad4mhosting")==="true"||!1;this.token=Wt("ad4mToken")||"";this.port=parseInt(Wt("ad4mport"))||kr;this.url=Wt("ad4murl")||"";this.multiUser=!1;this.backendUrl=""}get authState(){return this._client.authState}get connectionState(){return this._client.connectionState}injectFont(){let r=document.createElement("link");r.setAttribute("rel","stylesheet"),r.setAttribute("href","https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200..800&display=swap"),document.head.appendChild(r)}connectedCallback(){super.connectedCallback(),wo(this),this.injectFont(),this._isMobile=D3(),this._client=new So({appName:this.appName,appDesc:this.appDesc,appDomain:this.appDomain,appUrl:window.location.origin,appIconPath:this.appIconPath,capabilities:Array.isArray(this.capabilities)?this.capabilities:JSON.parse(this.capabilities),port:this.port||parseInt(Wt("ad4mport"))||kr,token:this.token||Wt("ad4mtoken"),url:this.url||Wt("ad4murl"),hosting:this.hosting}),this._client.on("configstatechange",this.handleConfigChange),this._client.on("authstatechange",this.handleAuthChange),this._client.on("connectionstatechange",this.handleConnectionChange),this.loadFont(),this.token||Wt("ad4mtoken")?this._client.connect():(this.detectLocal(),this.changeUIState("connection_overview"),this._isOpen=!0)}checkEmail(){return ee(this,null,function*(){try{(yield this._client.checkEmail(this._email))?this._hostingStep=1:this._hostingStep=2}catch(r){console.log(r)}})}handleMultiUserSignup(){return ee(this,null,function*(){try{this._multiUserLoading=!0,this._multiUserError=null,this._client.options.userEmail=this._multiUserEmail,this._client.options.userPassword=this._multiUserPassword,this._client.options.backendUrl=this.backendUrl;let r=yield this._client.connectMultiUser();this._multiUserEmail="",this._multiUserPassword="",this._isOpen=!1,this.changeUIState("connected")}catch(r){this._multiUserError=r.message||"Failed to create account. Please try again."}finally{this._multiUserLoading=!1}})}handleMultiUserLogin(){return ee(this,null,function*(){try{this._multiUserLoading=!0,this._multiUserError=null,this._client.options.userEmail=this._multiUserEmail,this._client.options.userPassword=this._multiUserPassword,this._client.options.backendUrl=this.backendUrl;let r=yield this._client.connectMultiUser();this._multiUserEmail="",this._multiUserPassword="",this._isOpen=!1,this.changeUIState("connected")}catch(r){this._multiUserError=r.message||"Failed to log in. Please check your credentials."}finally{this._multiUserLoading=!1}})}changeMultiUserEmail(r){this._multiUserEmail=r,this._multiUserError=null}changeMultiUserPassword(r){this._multiUserPassword=r,this._multiUserError=null}setMultiUserTab(r){this._multiUserTab=r,this._multiUserError=null}detectLocal(){return ee(this,null,function*(){try{yield ti(`ws://localhost:${this.port}/graphql`,3e3),this._localDetected=!0}catch(r){console.log("[Ad4m Connect] Local detection failed:",r),this._localDetected=!1}})}detectRemoteMultiUser(r){return ee(this,null,function*(){try{console.log("[Ad4m Connect] Detecting multi-user mode for URL:",r);let n=this._client.buildTempClient(r);console.log("[Ad4m Connect] Temp client:",n);let i=yield n.runtime.multiUserEnabled();return console.log("[Ad4m Connect] Multi-user detection result:",i),i}catch(n){return console.error("[Ad4m Connect] Failed to detect multi-user mode:",n),console.error("[Ad4m Connect] Error details:",n.message,n.stack),!1}})}handleConnectLocal(){return ee(this,null,function*(){try{this.changeUIState("requestcap"),yield this._client.connect()}catch(r){console.error("Failed to connect to local AD4M:",r),this.changeUIState("connection_overview")}})}handleShowRemoteConnection(){this._remoteUrl=this.backendUrl||this.url||"",this._remoteMultiUserDetected=null,this._remoteError=null,this.changeUIState("remote_connection")}handleRemoteUrlChange(r){this._remoteUrl=r,this._remoteError=null}handleRemoteConnect(){return ee(this,null,function*(){if(!this._remoteUrl){this._remoteError="Please enter a URL";return}this._remoteDetecting=!0,this._remoteError=null;try{let r=yield this.detectRemoteMultiUser(this._remoteUrl);this._remoteMultiUserDetected=r,this._remoteDetecting=!1}catch(r){this._remoteError=r.message||"Failed to connect to remote executor",this._remoteDetecting=!1}})}handleRemoteMultiUserAuth(){return ee(this,null,function*(){this.backendUrl=this._remoteUrl,this.changeUIState("multiuser_auth")})}handleRemoteRequestCapability(){return ee(this,null,function*(){try{this.changeUIState("requestcap"),yield this._client.connect(this._remoteUrl)}catch(r){this._remoteError=r.message||"Failed to connect",this.changeUIState("remote_connection")}})}loginToHosting(){return ee(this,null,function*(){try{yield this._client.loginToHosting(this._email,this._passowrd),this.changeUIState("connected")}catch(r){r.message.includes("Passwords did not match")?this._passwordError="Passwords did not match":this._hostingNotRunningError="Hosting is not running"}})}changeEmail(r){this._email=r}changePassword(r){this._passowrd=r}unlockAgent(r,n=!0){return ee(this,null,function*(){yield this._client.ad4mClient.agent.unlock(r,n)})}verifyCode(r){return ee(this,null,function*(){try{yield this._client.verifyCode(r)}catch(n){this._verifyCodeError="Invalid code"}})}changeUrl(r){r!==this._client.url&&(op("ad4mtoken"),this._client.setToken(null)),this._client.setUrl(r)}changePort(r){this._client.setPort(r)}changeUIState(r){this.uiState=r}setIsHostingRunning(r){this._hostingNotRunningError=r}changeIsRemote(r){this._isRemote=r}changeCode(r){this._code=r}onDownloaded(){this._hasClickedDownload=!0}handleAuthChange(r){let n=new CustomEvent("authstatechange",{detail:r});r==="locked"&&(this._isOpen=!0),r==="authenticated"&&(this._isOpen=!1),this.dispatchEvent(n),this.requestUpdate()}handleConfigChange(r,n){this[r]=n,n?bc("ad4m"+r,n):op("ad4m"+r),this.requestUpdate()}handleConnectionChange(r){if(r==="checking_local"){this._isOpen=!1;return}r==="connected"&&(this.authState!=="authenticated"?(this.changeUIState("requestcap"),this._isOpen=!0):(this.changeUIState("connected"),this._isOpen=!1)),r==="disconnected"&&(this._isOpen=!0),r==="not_connected"&&(this._isOpen=!0,this.multiUser&&this.backendUrl?this.changeUIState("multiuser_auth"):this.changeUIState("start"));let n=new CustomEvent("connectionstatechange",{detail:r});this.dispatchEvent(n),this.requestUpdate()}loadFont(){let r=document.createElement("link");r.rel="stylesheet",r.type="text/css",r.crossOrigin="anonymous",r.href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap",document.head.appendChild(r)}startCamera(r){return ee(this,null,function*(){try{window.BarcodeDetector.getSupportedFormats()}catch(n){window.BarcodeDetector=Ir}yield this.changeUIState("qr"),setTimeout(()=>ee(this,null,function*(){let n=this.shadowRoot.querySelector("video");if(!n)return;let i=yield navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:"environment"}});n.srcObject=i,n.autoplay=!0}),100)})}connect(){return ee(this,null,function*(){this._isOpen=!0,this.requestUpdate();let r=yield this._client.connect();try{let n=yield r.agent.status();n.isUnlocked&&n.isInitialized&&window.location.reload()}catch(n){console.warn(n)}return r})}getAd4mClient(){return this._client.ad4mClient}connectRemote(r){return ee(this,null,function*(){try{this.changeUrl(r);let n=yield this._client.connect(r),i=yield n.agent.status();return i.isUnlocked&&i.isInitialized||this.changeUIState("requestcap"),n}catch(n){this.changeUIState("requestcap"),this._isOpen=!0}})}requestCapability(r){return ee(this,null,function*(){try{yield this._client.requestCapability(r),this.changeUIState("verifycode")}catch(n){console.warn(n)}})}isAuthenticated(){return ee(this,null,function*(){return this._client.checkAuth()})}setOpen(r){this._isOpen=r}setHostingStep(r){this._hostingStep=r}clearState(){this.handleConfigChange("port",null),this.handleConfigChange("url",null),this.handleConfigChange("token",null),this.handleConnectionChange("not_connected"),this.handleAuthChange("unauthenticated"),this.changeUIState("start"),this._client.clearState()}renderViews(){if(this.connectionState==="connecting")return dp();if(this.uiState==="connection_overview")return cp({localDetected:this._localDetected,multiUserConfigured:this.multiUser&&!!this.backendUrl,backendUrl:this.backendUrl,configuredUrl:this.url,isMobile:this._isMobile,onConnectLocal:this.handleConnectLocal,onConnectRemote:this.handleShowRemoteConnection,onScanQR:()=>{this.startCamera(null)},onDownloadAd4m:()=>{window.open("https://github.com/coasys/ad4m/releases")}});if(this.uiState==="remote_connection")return gp({initialUrl:this._remoteUrl,detecting:this._remoteDetecting,multiUserDetected:this._remoteMultiUserDetected,error:this._remoteError,onBack:()=>this.changeUIState("connection_overview"),onUrlChange:this.handleRemoteUrlChange,onConnect:this.handleRemoteConnect,onMultiUserAuth:this.handleRemoteMultiUserAuth,onRequestCapability:this.handleRemoteRequestCapability});if(this.uiState==="multiuser_auth")return mp({email:this._multiUserEmail,password:this._multiUserPassword,error:this._multiUserError,isLoading:this._multiUserLoading,backendUrl:this.backendUrl,changeEmail:this.changeMultiUserEmail,changePassword:this.changeMultiUserPassword,onLogin:this.handleMultiUserLogin,onSignup:this.handleMultiUserSignup,activeTab:this._multiUserTab,setActiveTab:this.setMultiUserTab});if(this.uiState==="hosting")return fp({email:this._email,password:this._passowrd,changeEmail:this.changeEmail,changePassword:this.changePassword,changeState:this.changeUIState,step:this._hostingStep,setHostingStep:this.setHostingStep,login:this.loginToHosting,checkEmail:this.checkEmail,passwordError:this._passwordError,isHostingRunning:this._hostingNotRunningError,setIsHostingRunning:this.setIsHostingRunning});if(this.uiState==="qr")return vp({changeState:this.changeUIState,onSuccess:r=>{this.changeUrl(r),this._client.connect(r)},uiState:this.uiState});if(this.authState==="locked")return sp({unlockAgent:this.unlockAgent,reconnect:this.connect});if(this.uiState==="settings")return bp({port:this.port,changePort:this.changePort,isRemote:this._isRemote,changeIsRemote:this.changeIsRemote,url:this.url,changeState:this.changeUIState,changeUrl:this.changeUrl,connectToPort:this._client.connectToPort,connectRemote:this.connectRemote,clearState:this.clearState});if(this.connectionState==="not_connected")return _p({scanQrcode:this.startCamera,connect:this.connect,isMobile:this._isMobile,hasClickedDownload:this._hasClickedDownload,onDownloaded:this.onDownloaded,changeState:this.changeUIState,hosting:this.hosting});if(this.connectionState==="connected")return this.uiState==="verifycode"?wp({code:this._code,changeCode:this.changeCode,changeState:this.changeUIState,verifyCode:this.verifyCode,isHosting:this._client.isHosting,verifyCodeError:this._verifyCodeError}):yp({changeState:this.changeUIState,requestCapability:this.requestCapability,capabilities:this.capabilities,appname:this.appName,setOpen:this.setOpen,appiconpath:this.appIconPath});if(this.connectionState==="disconnected")return lp({reconnect:this.connect});if(this.connectionState==="port_not_found")return up()}mobileView(){return this.mobile?hp({openModal:()=>{this.changeUIState("settings"),this._isOpen=!this._isOpen}}):null}render(){return console.log(this.authState,this.connectionState,this.uiState,this._isOpen),this._isOpen===!1?this.authState==="authenticated"?this.mobileView():null:L`
|
|
2109
2878
|
<div class="wrapper">
|
|
2110
2879
|
<div class="dialog">
|
|
2111
|
-
${
|
|
2880
|
+
${pp()}
|
|
2112
2881
|
<main class="dialog__content">${this.renderViews()}</main>
|
|
2113
2882
|
${this.mobileView()}
|
|
2114
2883
|
</div>
|
|
2115
2884
|
<div class="ad4mConnect__backdrop" />
|
|
2116
2885
|
</div>
|
|
2117
|
-
`}};
|
|
2886
|
+
`}};Z.styles=[N3],X([xe()],Z.prototype,"_code",2),X([xe()],Z.prototype,"_isMobile",2),X([xe()],Z.prototype,"_hasClickedDownload",2),X([xe()],Z.prototype,"_isRemote",2),X([xe()],Z.prototype,"_client",2),X([xe()],Z.prototype,"_isOpen",2),X([xe()],Z.prototype,"_hostingStep",2),X([xe()],Z.prototype,"_email",2),X([xe()],Z.prototype,"_passowrd",2),X([xe()],Z.prototype,"_passwordError",2),X([xe()],Z.prototype,"_hostingNotRunningError",2),X([xe()],Z.prototype,"_verifyCodeError",2),X([xe()],Z.prototype,"_isHostingLoading",2),X([xe()],Z.prototype,"_multiUserEmail",2),X([xe()],Z.prototype,"_multiUserPassword",2),X([xe()],Z.prototype,"_multiUserError",2),X([xe()],Z.prototype,"_multiUserLoading",2),X([xe()],Z.prototype,"_multiUserTab",2),X([xe()],Z.prototype,"_localDetected",2),X([xe()],Z.prototype,"_remoteUrl",2),X([xe()],Z.prototype,"_remoteMultiUserDetected",2),X([xe()],Z.prototype,"_remoteDetecting",2),X([xe()],Z.prototype,"_remoteError",2),X([xe()],Z.prototype,"uiState",2),X([st({type:String,reflect:!0})],Z.prototype,"appName",2),X([st({type:String,reflect:!0})],Z.prototype,"appDesc",2),X([st({type:String,reflect:!0})],Z.prototype,"appDomain",2),X([st({type:String,reflect:!0})],Z.prototype,"appIconPath",2),X([st({type:Boolean,reflect:!0})],Z.prototype,"mobile",2),X([st({type:String,reflect:!0})],Z.prototype,"capabilities",2),X([st({type:Boolean,reflect:!0})],Z.prototype,"hosting",2),X([st({type:String})],Z.prototype,"token",2),X([st({type:String,reflect:!0})],Z.prototype,"port",2),X([st({type:String,reflect:!0})],Z.prototype,"url",2),X([st({type:Boolean,reflect:!0})],Z.prototype,"multiUser",2),X([st({type:String,reflect:!0})],Z.prototype,"backendUrl",2),Z=X([Vp("ad4m-connect")],Z);function P3(t){let e=new Z;return Object.entries(t).forEach(([r,n])=>{e[r]=n}),document.body.appendChild(e),e}export{Z as Ad4mConnectElement,P3 as default,T3 as getAd4mClient};
|
|
2118
2887
|
/*!
|
|
2119
2888
|
* @undecaf/barcode-detector-polyfill v0.9.20
|
|
2120
2889
|
* A WebAssembly polyfill for the Barcode Detection API
|