piral-urql 1.9.2-beta.8358 → 1.9.2-beta.8388

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "piral-urql",
3
- "version": "1.9.2-beta.8358",
3
+ "version": "1.9.2-beta.8388",
4
4
  "description": "Plugin for providing a GraphQL client in Piral.",
5
5
  "keywords": [
6
6
  "piral",
@@ -27,8 +27,8 @@
27
27
  "exports": {
28
28
  ".": "./lib/index.js",
29
29
  "./lib/*": {
30
- "import": "./lib/*",
31
- "types": "./lib/*.d.ts"
30
+ "types": "./lib/*.d.ts",
31
+ "import": "./lib/*"
32
32
  },
33
33
  "./package.json": "./package.json"
34
34
  },
@@ -60,8 +60,8 @@
60
60
  "devDependencies": {
61
61
  "@types/react": "^18.0.0",
62
62
  "graphql": "14.6.0",
63
- "piral-core": "1.9.2-beta.8358",
63
+ "piral-core": "1.9.2-beta.8388",
64
64
  "react": "^18.0.0"
65
65
  },
66
- "gitHead": "ce3cfa6949ab58c0a34af5732d81601d04b8178d"
66
+ "gitHead": "25023f913ae9423c9cecd23e44d70e959ff58c8a"
67
67
  }
package/piral-urql.min.js CHANGED
@@ -1,6 +1,6 @@
1
- var piralUrql=(()=>{var It=Object.create;var z=Object.defineProperty;var Nt=Object.getOwnPropertyDescriptor;var Mt=Object.getOwnPropertyNames;var Pt=Object.getPrototypeOf,Rt=Object.prototype.hasOwnProperty;var x=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var C=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),At=(e,t)=>{for(var n in t)z(e,n,{get:t[n],enumerable:!0})},Ae=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Mt(t))!Rt.call(e,i)&&i!==n&&z(e,i,{get:()=>t[i],enumerable:!(r=Nt(t,i))||r.enumerable});return e};var Ge=(e,t,n)=>(n=e!=null?It(Pt(e)):{},Ae(t||!e||!e.__esModule?z(n,"default",{value:e,enumerable:!0}):n,e)),Gt=e=>Ae(z({},"__esModule",{value:!0}),e);var at=C((pr,ft)=>{ft.exports=Q;function Q(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Q.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0};Q.prototype.reset=function(){this.attempts=0};Q.prototype.setMin=function(e){this.ms=e};Q.prototype.setMax=function(e){this.max=e};Q.prototype.setJitter=function(e){this.jitter=e}});var pt=C((hr,xe)=>{"use strict";var bn=Object.prototype.hasOwnProperty,b="~";function H(){}Object.create&&(H.prototype=Object.create(null),new H().__proto__||(b=!1));function _n(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function lt(e,t,n,r,i){if(typeof n!="function")throw new TypeError("The listener must be a function");var o=new _n(n,r||e,i),u=b?b+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],o]:e._events[u].push(o):(e._events[u]=o,e._eventsCount++),e}function se(e,t){--e._eventsCount===0?e._events=new H:delete e._events[t]}function v(){this._events=new H,this._eventsCount=0}v.prototype.eventNames=function(){var t=[],n,r;if(this._eventsCount===0)return t;for(r in n=this._events)bn.call(n,r)&&t.push(b?r.slice(1):r);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(n)):t};v.prototype.listeners=function(t){var n=b?b+t:t,r=this._events[n];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,u=new Array(o);i<o;i++)u[i]=r[i].fn;return u};v.prototype.listenerCount=function(t){var n=b?b+t:t,r=this._events[n];return r?r.fn?1:r.length:0};v.prototype.emit=function(t,n,r,i,o,u){var s=b?b+t:t;if(!this._events[s])return!1;var c=this._events[s],f=arguments.length,a,l;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),f){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,n),!0;case 3:return c.fn.call(c.context,n,r),!0;case 4:return c.fn.call(c.context,n,r,i),!0;case 5:return c.fn.call(c.context,n,r,i,o),!0;case 6:return c.fn.call(c.context,n,r,i,o,u),!0}for(l=1,a=new Array(f-1);l<f;l++)a[l-1]=arguments[l];c.fn.apply(c.context,a)}else{var p=c.length,h;for(l=0;l<p;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),f){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,n);break;case 3:c[l].fn.call(c[l].context,n,r);break;case 4:c[l].fn.call(c[l].context,n,r,i);break;default:if(!a)for(h=1,a=new Array(f-1);h<f;h++)a[h-1]=arguments[h];c[l].fn.apply(c[l].context,a)}}return!0};v.prototype.on=function(t,n,r){return lt(this,t,n,r,!1)};v.prototype.once=function(t,n,r){return lt(this,t,n,r,!0)};v.prototype.removeListener=function(t,n,r,i){var o=b?b+t:t;if(!this._events[o])return this;if(!n)return se(this,o),this;var u=this._events[o];if(u.fn)u.fn===n&&(!i||u.once)&&(!r||u.context===r)&&se(this,o);else{for(var s=0,c=[],f=u.length;s<f;s++)(u[s].fn!==n||i&&!u[s].once||r&&u[s].context!==r)&&c.push(u[s]);c.length?this._events[o]=c.length===1?c[0]:c:se(this,o)}return this};v.prototype.removeAllListeners=function(t){var n;return t?(n=b?b+t:t,this._events[n]&&se(this,n)):(this._events=new H,this._eventsCount=0),this};v.prototype.off=v.prototype.removeListener;v.prototype.addListener=v.prototype.on;v.prefixed=b;v.EventEmitter=v;typeof xe<"u"&&(xe.exports=v)});var ht=C(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});function kn(e){return typeof e=="string"}Te.default=kn});var dt=C(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});function On(e){return e!==null&&typeof e=="object"}Ce.default=On});var mt=C(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.default=En;function En(e){var t,n=e.Symbol;return typeof n=="function"?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}});var yt=C((Ie,Se)=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});var wn=mt(),xn=Tn(wn);function Tn(e){return e&&e.__esModule?e:{default:e}}var D;typeof self<"u"?D=self:typeof window<"u"?D=window:typeof global<"u"?D=global:typeof Se<"u"?D=Se:D=Function("return this")();var Cn=(0,xn.default)(D);Ie.default=Cn});var vt=C(j=>{"use strict";Object.defineProperty(j,"__esModule",{value:!0});j.GRAPHQL_SUBSCRIPTIONS=j.GRAPHQL_WS=void 0;var qn="graphql-ws";j.GRAPHQL_WS=qn;var Sn="graphql-subscriptions";j.GRAPHQL_SUBSCRIPTIONS=Sn});var gt=C($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.WS_TIMEOUT=$.MIN_WS_TIMEOUT=void 0;var In=1e3;$.MIN_WS_TIMEOUT=In;var Nn=3e4;$.WS_TIMEOUT=Nn});var bt=C(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});var Mn=function(){function e(){throw new Error("Static Class")}return e.GQL_CONNECTION_INIT="connection_init",e.GQL_CONNECTION_ACK="connection_ack",e.GQL_CONNECTION_ERROR="connection_error",e.GQL_CONNECTION_KEEP_ALIVE="ka",e.GQL_CONNECTION_TERMINATE="connection_terminate",e.GQL_START="start",e.GQL_DATA="data",e.GQL_ERROR="error",e.GQL_COMPLETE="complete",e.GQL_STOP="stop",e.SUBSCRIPTION_START="subscription_start",e.SUBSCRIPTION_DATA="subscription_data",e.SUBSCRIPTION_SUCCESS="subscription_success",e.SUBSCRIPTION_FAIL="subscription_fail",e.SUBSCRIPTION_END="subscription_end",e.INIT="init",e.INIT_SUCCESS="init_success",e.INIT_FAIL="init_fail",e.KEEP_ALIVE="keepalive",e}();Ne.default=Mn});var xt=C(w=>{"use strict";var U=w&&w.__assign||function(){return U=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},U.apply(this,arguments)},Pn=w&&w.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(u){u(o)})}return new(n||(n=Promise))(function(o,u){function s(a){try{f(r.next(a))}catch(l){u(l)}}function c(a){try{f(r.throw(a))}catch(l){u(l)}}function f(a){a.done?o(a.value):i(a.value).then(s,c)}f((r=r.apply(e,t||[])).next())})},Rn=w&&w.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,u;return u={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function s(f){return function(a){return c([f,a])}}function c(f){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return n.label++,{value:f[1],done:!1};case 5:n.label++,i=f[1],f=[0];continue;case 7:f=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){n=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){n.label=f[1];break}if(f[0]===6&&n.label<o[1]){n.label=o[1],o=f;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(f);break}o[2]&&n.ops.pop(),n.trys.pop();continue}f=t.call(e,n)}catch(a){f=[6,a],i=0}finally{r=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}},_t=w&&w.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),i=0,t=0;t<n;t++)for(var o=arguments[t],u=0,s=o.length;u<s;u++,i++)r[i]=o[u];return r};Object.defineProperty(w,"__esModule",{value:!0});w.SubscriptionClient=void 0;var kt=typeof global<"u"?global:typeof window<"u"?window:{},An=kt.WebSocket||kt.MozWebSocket,Ot=at(),Gn=pt(),Et=ht(),Ln=dt(),Qn=x("graphql/language/printer"),Dn=x("graphql/utilities/getOperationAST"),jn=yt(),$n=vt(),wt=gt(),_=bt(),Un=function(){function e(t,n,r,i){var o=n||{},u=o.connectionCallback,s=u===void 0?void 0:u,c=o.connectionParams,f=c===void 0?{}:c,a=o.minTimeout,l=a===void 0?wt.MIN_WS_TIMEOUT:a,p=o.timeout,h=p===void 0?wt.WS_TIMEOUT:p,d=o.reconnect,O=d===void 0?!1:d,y=o.reconnectionAttempts,N=y===void 0?1/0:y,I=o.lazy,M=I===void 0?!1:I,P=o.inactivityTimeout,qt=P===void 0?0:P,Re=o.wsOptionArguments,St=Re===void 0?[]:Re;if(this.wsImpl=r||An,!this.wsImpl)throw new Error("Unable to find native implementation, or alternative implementation for WebSocket!");this.wsProtocols=i||$n.GRAPHQL_WS,this.connectionCallback=s,this.url=t,this.operations={},this.nextOperationId=0,this.minWsTimeout=l,this.wsTimeout=h,this.unsentMessagesQueue=[],this.reconnect=O,this.reconnecting=!1,this.reconnectionAttempts=N,this.lazy=!!M,this.inactivityTimeout=qt,this.closedByUser=!1,this.backoff=new Ot({jitter:.5}),this.eventEmitter=new Gn.EventEmitter,this.middlewares=[],this.client=null,this.maxConnectTimeGenerator=this.createMaxConnectTimeGenerator(),this.connectionParams=this.getConnectionParams(f),this.wsOptionArguments=St,this.lazy||this.connect()}return Object.defineProperty(e.prototype,"status",{get:function(){return this.client===null?this.wsImpl.CLOSED:this.client.readyState},enumerable:!1,configurable:!0}),e.prototype.close=function(t,n){t===void 0&&(t=!0),n===void 0&&(n=!0),this.clearInactivityTimeout(),this.client!==null&&(this.closedByUser=n,t&&(this.clearCheckConnectionInterval(),this.clearMaxConnectTimeout(),this.clearTryReconnectTimeout(),this.unsubscribeAll(),this.sendMessage(void 0,_.default.GQL_CONNECTION_TERMINATE,null)),this.client.close(),this.client.onopen=null,this.client.onclose=null,this.client.onerror=null,this.client.onmessage=null,this.client=null,this.eventEmitter.emit("disconnected"),t||this.tryReconnect())},e.prototype.request=function(t){var n,r=this.getObserver.bind(this),i=this.executeOperation.bind(this),o=this.unsubscribe.bind(this),u;return this.clearInactivityTimeout(),n={},n[jn.default]=function(){return this},n.subscribe=function(s,c,f){var a=r(s,c,f);return u=i(t,function(l,p){l===null&&p===null?a.complete&&a.complete():l?a.error&&a.error(l[0]):a.next&&a.next(p)}),{unsubscribe:function(){u&&(o(u),u=null)}}},n},e.prototype.on=function(t,n,r){var i=this.eventEmitter.on(t,n,r);return function(){i.off(t,n,r)}},e.prototype.onConnected=function(t,n){return this.on("connected",t,n)},e.prototype.onConnecting=function(t,n){return this.on("connecting",t,n)},e.prototype.onDisconnected=function(t,n){return this.on("disconnected",t,n)},e.prototype.onReconnected=function(t,n){return this.on("reconnected",t,n)},e.prototype.onReconnecting=function(t,n){return this.on("reconnecting",t,n)},e.prototype.onError=function(t,n){return this.on("error",t,n)},e.prototype.unsubscribeAll=function(){var t=this;Object.keys(this.operations).forEach(function(n){t.unsubscribe(n)})},e.prototype.applyMiddlewares=function(t){var n=this;return new Promise(function(r,i){var o=function(u,s){var c=function(f){if(f)i(f);else if(u.length>0){var a=u.shift();a&&a.applyMiddleware.apply(s,[t,c])}else r(t)};c()};o(_t(n.middlewares),n)})},e.prototype.use=function(t){var n=this;return t.map(function(r){if(typeof r.applyMiddleware=="function")n.middlewares.push(r);else throw new Error("Middleware must implement the applyMiddleware function.")}),this},e.prototype.getConnectionParams=function(t){return function(){return new Promise(function(n,r){if(typeof t=="function")try{return n(t.call(null))}catch(i){return r(i)}n(t)})}},e.prototype.executeOperation=function(t,n){var r=this;this.client===null&&this.connect();var i=this.generateOperationId();return this.operations[i]={options:t,handler:n},this.applyMiddlewares(t).then(function(o){r.checkOperationOptions(o,n),r.operations[i]&&(r.operations[i]={options:o,handler:n},r.sendMessage(i,_.default.GQL_START,o))}).catch(function(o){r.unsubscribe(i),n(r.formatErrors(o))}),i},e.prototype.getObserver=function(t,n,r){return typeof t=="function"?{next:function(i){return t(i)},error:function(i){return n&&n(i)},complete:function(){return r&&r()}}:t},e.prototype.createMaxConnectTimeGenerator=function(){var t=this.minWsTimeout,n=this.wsTimeout;return new Ot({min:t,max:n,factor:1.2})},e.prototype.clearCheckConnectionInterval=function(){this.checkConnectionIntervalId&&(clearInterval(this.checkConnectionIntervalId),this.checkConnectionIntervalId=null)},e.prototype.clearMaxConnectTimeout=function(){this.maxConnectTimeoutId&&(clearTimeout(this.maxConnectTimeoutId),this.maxConnectTimeoutId=null)},e.prototype.clearTryReconnectTimeout=function(){this.tryReconnectTimeoutId&&(clearTimeout(this.tryReconnectTimeoutId),this.tryReconnectTimeoutId=null)},e.prototype.clearInactivityTimeout=function(){this.inactivityTimeoutId&&(clearTimeout(this.inactivityTimeoutId),this.inactivityTimeoutId=null)},e.prototype.setInactivityTimeout=function(){var t=this;this.inactivityTimeout>0&&Object.keys(this.operations).length===0&&(this.inactivityTimeoutId=setTimeout(function(){Object.keys(t.operations).length===0&&t.close()},this.inactivityTimeout))},e.prototype.checkOperationOptions=function(t,n){var r=t.query,i=t.variables,o=t.operationName;if(!r)throw new Error("Must provide a query.");if(!n)throw new Error("Must provide an handler.");if(!Et.default(r)&&!Dn.getOperationAST(r,o)||o&&!Et.default(o)||i&&!Ln.default(i))throw new Error("Incorrect option types. query must be a string or a document,`operationName` must be a string, and `variables` must be an object.")},e.prototype.buildMessage=function(t,n,r){var i=r&&r.query?U(U({},r),{query:typeof r.query=="string"?r.query:Qn.print(r.query)}):r;return{id:t,type:n,payload:i}},e.prototype.formatErrors=function(t){return Array.isArray(t)?t:t&&t.errors?this.formatErrors(t.errors):t&&t.message?[t]:[{name:"FormatedError",message:"Unknown error",originalError:t}]},e.prototype.sendMessage=function(t,n,r){this.sendMessageRaw(this.buildMessage(t,n,r))},e.prototype.sendMessageRaw=function(t){switch(this.status){case this.wsImpl.OPEN:var n=JSON.stringify(t);try{JSON.parse(n)}catch{this.eventEmitter.emit("error",new Error("Message must be JSON-serializable. Got: "+t))}this.client.send(n);break;case this.wsImpl.CONNECTING:this.unsentMessagesQueue.push(t);break;default:this.reconnecting||this.eventEmitter.emit("error",new Error("A message was not sent because socket is not connected, is closing or is already closed. Message was: "+JSON.stringify(t)))}},e.prototype.generateOperationId=function(){return String(++this.nextOperationId)},e.prototype.tryReconnect=function(){var t=this;if(!(!this.reconnect||this.backoff.attempts>=this.reconnectionAttempts)){this.reconnecting||(Object.keys(this.operations).forEach(function(r){t.unsentMessagesQueue.push(t.buildMessage(r,_.default.GQL_START,t.operations[r].options))}),this.reconnecting=!0),this.clearTryReconnectTimeout();var n=this.backoff.duration();this.tryReconnectTimeoutId=setTimeout(function(){t.connect()},n)}},e.prototype.flushUnsentMessagesQueue=function(){var t=this;this.unsentMessagesQueue.forEach(function(n){t.sendMessageRaw(n)}),this.unsentMessagesQueue=[]},e.prototype.checkConnection=function(){if(this.wasKeepAliveReceived){this.wasKeepAliveReceived=!1;return}this.reconnecting||this.close(!1,!0)},e.prototype.checkMaxConnectTimeout=function(){var t=this;this.clearMaxConnectTimeout(),this.maxConnectTimeoutId=setTimeout(function(){t.status!==t.wsImpl.OPEN&&(t.reconnecting=!0,t.close(!1,!0))},this.maxConnectTimeGenerator.duration())},e.prototype.connect=function(){var t,n=this;this.client=new((t=this.wsImpl).bind.apply(t,_t([void 0,this.url,this.wsProtocols],this.wsOptionArguments))),this.checkMaxConnectTimeout(),this.client.onopen=function(){return Pn(n,void 0,void 0,function(){var r,i;return Rn(this,function(o){switch(o.label){case 0:if(this.status!==this.wsImpl.OPEN)return[3,4];this.clearMaxConnectTimeout(),this.closedByUser=!1,this.eventEmitter.emit(this.reconnecting?"reconnecting":"connecting"),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.connectionParams()];case 2:return r=o.sent(),this.sendMessage(void 0,_.default.GQL_CONNECTION_INIT,r),this.flushUnsentMessagesQueue(),[3,4];case 3:return i=o.sent(),this.sendMessage(void 0,_.default.GQL_CONNECTION_ERROR,i),this.flushUnsentMessagesQueue(),[3,4];case 4:return[2]}})})},this.client.onclose=function(){n.closedByUser||n.close(!1,!1)},this.client.onerror=function(r){n.eventEmitter.emit("error",r)},this.client.onmessage=function(r){var i=r.data;n.processReceivedData(i)}},e.prototype.processReceivedData=function(t){var n,r;try{n=JSON.parse(t),r=n.id}catch{throw new Error("Message must be JSON-parseable. Got: "+t)}if([_.default.GQL_DATA,_.default.GQL_COMPLETE,_.default.GQL_ERROR].indexOf(n.type)!==-1&&!this.operations[r]){this.unsubscribe(r);return}switch(n.type){case _.default.GQL_CONNECTION_ERROR:this.connectionCallback&&this.connectionCallback(n.payload);break;case _.default.GQL_CONNECTION_ACK:this.eventEmitter.emit(this.reconnecting?"reconnected":"connected",n.payload),this.reconnecting=!1,this.backoff.reset(),this.maxConnectTimeGenerator.reset(),this.connectionCallback&&this.connectionCallback();break;case _.default.GQL_COMPLETE:var i=this.operations[r].handler;delete this.operations[r],i.call(this,null,null);break;case _.default.GQL_ERROR:this.operations[r].handler(this.formatErrors(n.payload),null),delete this.operations[r];break;case _.default.GQL_DATA:var o=n.payload.errors?U(U({},n.payload),{errors:this.formatErrors(n.payload.errors)}):n.payload;this.operations[r].handler(null,o);break;case _.default.GQL_CONNECTION_KEEP_ALIVE:var u=typeof this.wasKeepAliveReceived>"u";this.wasKeepAliveReceived=!0,u&&this.checkConnection(),this.checkConnectionIntervalId&&(clearInterval(this.checkConnectionIntervalId),this.checkConnection()),this.checkConnectionIntervalId=setInterval(this.checkConnection.bind(this),this.wsTimeout);break;default:throw new Error("Invalid message type!")}},e.prototype.unsubscribe=function(t){this.operations[t]&&(delete this.operations[t],this.setInactivityTimeout(),this.sendMessage(t,_.default.GQL_STOP,void 0))},e}();w.SubscriptionClient=Un});var Jn={};At(Jn,{createGqlApi:()=>Vn,gqlMutation:()=>Ee,gqlQuery:()=>K,gqlSubscription:()=>we,requestPiletsFromGraphQL:()=>Bn,setupGqlClient:()=>Me});var Ct=Ge(x("react"));function m(e,t){return t.tag=e,t}function E(){}function Le(e){return function(t){var n=e.length;let r=!1,i=!1,o=!1,u=0;t(m(0,[function(s){if(s)r=!0;else if(i)o=!0;else{for(i=o=!0;o&&!r;)u<n?(s=e[u],u=u+1|0,o=!1,t(m(1,[s]))):(r=!0,t(0));i=!1}}]))}}function Lt(){}function Qt(e){e(0)}function Dt(e){let t=!1;e(m(0,[function(n){n?t=!0:t||e(0)}]))}function jt(e){return e(0)}function Y(e){return function(t){return function(n){let r=E,i=!1,o=[],u=!1;t(function(s){typeof s=="number"?u||(u=!0,o.length===0&&n(0)):s.tag?u||(i=!1,function(c){function f(p){typeof p=="number"?o.length!==0&&(o=o.filter(a),p=o.length===0,u&&p?n(0):!i&&p&&(i=!0,r(0))):p.tag?o.length!==0&&(n(m(1,[p[0]])),l(0)):(l=p=p[0],o=o.concat(p),p(0))}function a(p){return p!==l}let l=E;c.length===1?c(f):c.bind(null,f)}(e(s[0])),i||(i=!0,r(0))):r=s[0]}),n(m(0,[function(s){s?(u||(u=!0,r(s)),o.forEach(function(c){return c(s)}),o=[]):(i||u?i=!1:(i=!0,r(0)),o.forEach(jt))}]))}}}function $t(e){return e}function R(e){return function(t){return function(n){let r=!1;return t(function(i){if(typeof i=="number")r||(r=!0,n(i));else if(i.tag)r||(e(i[0]),n(i));else{var o=i[0];n(m(0,[function(u){if(!r)return u&&(r=!0),o(u)}]))}})}}}function Ut(e){e(0)}function Qe(e){return function(t){return function(n){function r(a){s&&(typeof a=="number"?(s=!1,f?n(a):o||(o=!0,i(0))):a.tag?(n(a),c?c=!1:u(0)):(u=a=a[0],c=!1,a(0)))}let i=E,o=!1,u=E,s=!1,c=!1,f=!1;t(function(a){typeof a=="number"?f||(f=!0,s||n(0)):a.tag?f||(s&&(u(1),u=E),o?o=!1:(o=!0,i(0)),a=e(a[0]),s=!0,a(r)):i=a[0]}),n(m(0,[function(a){if(a){if(f||(f=!0,i(1)),s)return s=!1,u(1)}else f||o||(o=!0,i(0)),s&&!c&&(c=!0,u(0))}]))}}}function Wt(e){return function(t){return function(n){let r=[],i=E;return t(function(o){typeof o=="number"?Le(r)(n):o.tag?(r.length>=e&&0<e&&r.shift(),r.push(o[0]),i(0)):(o=o[0],0>=e?(o(1),Dt(n)):(i=o,o(0)))})}}}function A(e){return function(t){let n=E,r=!1;return t(function(i){typeof i=="number"?r=!0:i.tag?r||(e(i[0]),n(0)):(n=i=i[0],i(0))}),{unsubscribe:function(){if(!r)return r=!0,n(1)}}}}function Vt(){}function g(e){return function(t){return function(n){let r=E;return t(function(i){typeof i=="number"?n(i):i.tag?e(i[0])?n(i):r(0):(r=i[0],n(i))})}}}function De(e){return function(t){let n=!1;t(m(0,[function(r){r?n=!0:n||(n=!0,t(m(1,[e])),t(0))}]))}}function je(e){return function(t){let n=0;var r=setInterval(function(){var i=n;n=n+1|0,t(m(1,[i]))},e);t(m(0,[function(i){i&&clearInterval(r)}]))}}function X(e){return function(t){let n=Lt,r=!1;n=e({next:function(i){r||t(m(1,[i]))},complete:function(){r||(r=!0,t(0))}}),t(m(0,[function(i){if(i&&!r)return r=!0,n()}]))}}function $e(){let e=[],t=!1;return{source:function(n){function r(i){return i!==n}e=e.concat(n),n(m(0,[function(i){i&&(e=e.filter(r))}]))},next:function(n){t||e.forEach(function(r){r(m(1,[n]))})},complete:function(){t||(t=!0,e.forEach(Qt))}}}function W(e){return function(t){return function(n){return t(function(r){r=typeof r=="number"?0:r.tag?m(1,[e(r[0])]):m(0,[r[0]]),n(r)})}}}function G(e){return Y($t)(Le(e))}function Ue(e){return function(t){return function(n){let r=!1;return t(function(i){if(typeof i=="number")return r?void 0:(r=!0,n(i),e());if(i.tag)r||n(i);else{var o=i[0];n(m(0,[function(u){if(!r)return u?(r=!0,o(u),e()):o(u)}]))}})}}}function ce(e){return function(t){return function(n){return t(function(r){typeof r=="number"||r.tag?n(r):(n(r),e())})}}}function fe(){for(var e=arguments,t=arguments[0],n=1,r=arguments.length;n<r;n++)t=e[n](t);return t}function We(e){return A(Vt)(e)}function V(e){function t(o){typeof o=="number"?(n.forEach(Ut),n=[]):o.tag?(i=!1,n.forEach(function(u){u(o)})):r=o[0]}let n=[],r=E,i=!1;return function(o){function u(s){return s!==o}n=n.concat(o),n.length===1&&e(t),o(m(0,[function(s){if(s){if(n=n.filter(u),n.length===0)return r(1)}else i||(i=!0,r(s))}]))}}function ae(e){return function(t){return function(n){let r=!1,i=0,o=E;t(function(u){typeof u=="number"?r||(r=!0,n(0)):u.tag?i<e&&!r&&(i=i+1|0,n(u),!r&&i>=e&&(r=!0,n(0),o(1))):(u=u[0],0>=e?(r=!0,n(0),u(1)):o=u)}),n(m(0,[function(u){if(!r){if(u)return r=!0,o(1);if(i<e)return o(0)}}]))}}}function Z(e){return function(t){return function(n){function r(s){typeof s!="number"&&(s.tag?(i=!0,o(1),n(0)):(u=s=s[0],s(0)))}let i=!1,o=E,u=E;t(function(s){typeof s=="number"?i||(i=!0,u(1),n(0)):s.tag?i||n(s):(o=s[0],e(r))}),n(m(0,[function(s){if(!i)return s?(i=!0,o(1),u(1)):o(0)}]))}}}function Ve(e){return new Promise(function(t){Wt(1)(e)(function(n){typeof n!="number"&&(n.tag?t(n[0]):n[0](0))})})}var Hn=typeof Symbol=="function"?Symbol.observable||(Symbol.observable=Symbol("observable")):"@@observable";var he=x("graphql/error/GraphQLError.mjs"),He=x("graphql/language/kinds.mjs"),ze=x("graphql/language/parser.mjs"),ye=x("graphql/language/printer.mjs");function Ft(e){return typeof e=="string"?new he.GraphQLError(e):typeof e=="object"&&e.message?new he.GraphQLError(e.message,e.nodes,e.source,e.positions,e.path,e,e.extensions||{}):e}function Bt(){return this.message}function le(e,t){e|=0;for(var n=0,r=0|t.length;n<r;n++)e=(e<<5)+e+t.charCodeAt(n);return e}function F(e){var t,n,r,i,o,u;if(e===null||B.has(e))return"null";if(typeof e!="object")return JSON.stringify(e)||"";if(e.toJSON)return F(e.toJSON());if(Array.isArray(e)){for(t="[",n=0,r=e.length;n<r;n++)0<n&&(t+=","),t+=0<(i=F(e[n])).length?i:"null";return t+"]"}if(!(t=Object.keys(e).sort()).length&&e.constructor&&e.constructor!==Object)return t=pe.get(e)||Math.random().toString(36).slice(2),pe.set(e,t),'{"__key":"'+t+'"}';for(B.add(e),n="{",r=0,i=t.length;r<i;r++)(u=F(e[o=t[r]]))&&(1<n.length&&(n+=","),n+=F(o)+":"+u);return B.delete(e),n+"}"}function ne(e){return B.clear(),F(e)}function ee(e){var t=(typeof e!="string"?e.loc&&e.loc.source.body||(0,ye.print)(e):e).replace(/([\s,]|#[^\n\r]+)+/g," ").trim();return typeof e!="string"&&(e.loc?(e="definitions"in e&&me(e))&&(t="# "+e+`
2
- `+t):e.loc={start:0,end:t.length,source:{body:t,name:"gql",locationOffset:{line:1,column:1}}}),t}function de(e){if(typeof e=="string"){var t=le(5381,ee(e))>>>0;e=te.get(t)||(0,ze.parse)(e,{noLocation:!0})}else t=e.__key||le(5381,ee(e))>>>0,e=te.get(t)||e;return e.loc||ee(e),e.__key=t,te.set(t,e),e}function me(e){var t,n,r;for(t=0,n=e.definitions.length;t<n;t++)if((r=e.definitions[t]).kind===He.Kind.OPERATION_DEFINITION&&r.name)return r.name.value}function re(e,t,n){return{operation:e,data:t.data,error:Array.isArray(t.errors)?new J({graphQLErrors:t.errors,response:n}):void 0,extensions:typeof t.extensions=="object"&&t.extensions||void 0}}function ie(e,t,n){return{operation:e,data:void 0,error:new J({networkError:t,response:n}),extensions:void 0}}function k(){return(k=Object.assign||function(e){var t,n,r;for(t=1;t<arguments.length;t++){n=arguments[t];for(r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Fe(e){return{query:(0,ye.print)(e.query),operationName:me(e.query),variables:e.variables||void 0,extensions:void 0}}function Be(e,t){var n=e.context.url;return e.kind!=="query"||!e.context.preferGetMethod||!t?n:(e=[],t.operationName&&e.push("operationName="+encodeURIComponent(t.operationName)),t.query&&e.push("query="+encodeURIComponent(t.query.replace(/([\s,]|#[^\n\r]+)+/g," ").trim())),t.variables&&e.push("variables="+encodeURIComponent(ne(t.variables))),t.extensions&&e.push("extensions="+encodeURIComponent(ne(t.extensions))),n+"?"+e.join("&"))}function Je(e,t){var n=e.kind==="query"&&!!e.context.preferGetMethod;return k({},e=typeof e.context.fetchOptions=="function"?e.context.fetchOptions():e.context.fetchOptions||{},{body:!n&&t?JSON.stringify(t):void 0,method:n?"GET":"POST",headers:n?e.headers:k({},{"content-type":"application/json"},e.headers)})}function Ke(e,t,n){return X(function(r){var i=r.next,o=r.complete,u=typeof AbortController<"u"?new AbortController:null,s=!1;return Promise.resolve().then(function(){if(!s)return u&&(n.signal=u.signal),function(f,a,l){var p,h=!1;return(f.context.fetch||fetch)(a,l).then(function(d){return p=d,h=200>d.status||d.status>=(l.redirect==="manual"?400:300),d.json()}).then(function(d){if(!("data"in d)&&!("errors"in d))throw Error("No Content");return re(f,d,p)}).catch(function(d){if(d.name!=="AbortError")return ie(f,h?Error(p.statusText):d,p)})}(e,t,n)}).then(function(c){s||(s=!0,c&&i(c),o())}),function(){s=!0,u&&u.abort()}})}function T(e,t){return e=de(e),{key:t?le(e.__key,ne(t))>>>0:e.__key,query:e,variables:t||{}}}var J,B,pe,te;J=function(e){function t(n){var r,i=n.networkError,o=n.response;r=function(s,c){var f="";return s!==void 0?f="[Network] "+s.message:(c!==void 0&&c.forEach(function(l){f+="[GraphQL] "+l.message+`
3
- `}),f.trim())}(i,n=(n.graphQLErrors||[]).map(Ft)),e.call(this,r),this.name="CombinedError",this.message=r,this.graphQLErrors=n,this.networkError=i,this.response=o}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.toString=Bt,t}(Error);B=new Set,pe=new WeakMap;te=new Map;var ot=x("graphql/language/visitor.mjs"),oe=x("graphql/language/kinds.mjs"),ut=x("graphql/language/printer.mjs");function ve(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++)ve(e[n],t);else if(typeof e=="object"&&e!==null)for(n in e)n==="__typename"&&typeof e[n]=="string"?t[e[n]]=0:ve(e[n],t);return t}function Jt(e){return e.kind===oe.Kind.FIELD&&e.name.value==="__typename"&&!e.alias}function Ye(e){if(e.selectionSet&&!e.selectionSet.selections.some(Jt))return k({},e,{selectionSet:k({},e.selectionSet,{selections:e.selectionSet.selections.concat([{kind:oe.Kind.FIELD,name:{kind:oe.Kind.NAME,value:"__typename"}}])})})}function Kt(e){e=de(e);var t=_e.get(e.__key);return t||((t=(0,ot.visit)(e,{Field:Ye,InlineFragment:Ye})).__key=e.__key,_e.set(e.__key,t)),t}function ge(e){return e&&typeof e=="object"?Object.keys(e).reduce(function(t,n){var r=e[n];return n==="__typename"?Object.defineProperty(t,"__typename",{enumerable:!1,value:r}):Array.isArray(r)?t[n]=r.map(ge):t[n]=r&&typeof r=="object"&&"__typename"in r?ge(r):r,t},{}):e}function Ze(e){return e.toPromise=function(){return Ve(ae(1)(e))},e}function L(e,t,n){return n||(n=t.context),{key:t.key,query:t.query,variables:t.variables,kind:e,context:n,get operationName(){if(0)var r,i;return this.kind}}}function et(e,t){return L(e.kind,e,k({},e.context,{meta:k({},e.context.meta,t)}))}function tt(){}function be(e){return(e=e.kind)!=="mutation"&&e!=="query"}function Ht(e){var t=L(e.kind,e);return t.query=Kt(e.query),t}function zt(e){return e.kind!=="query"||e.context.requestPolicy!=="cache-only"}function Yt(e){return et(e,{cacheOutcome:"miss"})}function Xt(e){return be(e)}function Zt(e){function t(l){var p=l.context.requestPolicy;return l.kind==="query"&&p!=="network-only"&&(p==="cache-only"||f.has(l.key))}function n(l){var p=f.get(l.key);return p=k({},p,{operation:et(l,{cacheOutcome:p?"hit":"miss"})}),l.context.requestPolicy==="cache-and-network"&&(p.stale=!0,Xe(s,l)),p}function r(l){return!be(l)&&t(l)}function i(l){function p(N){d.add(N)}var h,d,O,y=l.operation;if(y){if(h=Object.keys(ve(l.data,{})).concat(y.context.additionalTypenames||[]),l.operation.kind==="mutation"){for(d=new Set,l=0;l<h.length;l++)(O=a[O=h[l]]||(a[O]=new Set)).forEach(p),O.clear();d.forEach(function(I){f.has(I)&&(y=f.get(I).operation,f.delete(I),Xe(s,y))})}else if(y.kind==="query"&&l.data)for(f.set(y.key,l),l=0;l<h.length;l++)(a[O=h[l]]||(a[O]=new Set)).add(y.key)}}function o(l){return!be(l)&&!t(l)}var u=e.forward,s=e.client,c=e.dispatchDebug,f=new Map,a=Object.create(null);return function(l){var p=V(l);return l=W(n)(g(r)(p)),p=R(i)(u(g(zt)(W(Yt)(G([W(Ht)(g(o)(p)),g(Xt)(p)]))))),G([l,p])}}function Xe(e,t){return e.reexecuteOperation(L(t.kind,t,k({},t.context,{requestPolicy:"network-only"})))}function en(e){function t(u){o.delete(u.operation.key)}function n(u){var s=u.key,c=u.kind;return c==="teardown"?(o.delete(s),!0):c!=="query"&&c!=="subscription"?!0:(c=o.has(s),o.add(s),!c)}var r=e.forward,i=e.dispatchDebug,o=new Set;return function(u){return u=g(n)(u),R(t)(r(u))}}function tn(e){return e.kind==="query"||e.kind==="mutation"}function nn(e){return e.kind!=="query"&&e.kind!=="mutation"}function rn(e){var t=e.forward,n=e.dispatchDebug;return function(r){var i,o=V(r);return r=Y(function(u){var s=u.key,c=g(function(p){return p.kind==="teardown"&&p.key===s})(o),f=Fe(u),a=Be(u,f),l=Je(u,f);return R(function(p){var h=p.data?void 0:p.error})(Z(c)(Ke(u,a,l)))})(g(tn)(o)),i=t(g(nn)(o)),G([r,i])}}function on(){return!1}function nt(e){function t(r){if(r.kind!=="teardown"&&!1)var i}var n=e.dispatchDebug;return function(r){return g(on)(R(t)(r))}}function un(e){return function(t){var n=t.client,r=t.dispatchDebug;return e.reduceRight(function(i,o){return o({client:n,forward:i,dispatchDebug:function(u){}})},t.forward)}}function q(e){var t,n,r,i,o,u=this;this.activeOperations=Object.create(null),this.queue=[],this.createOperationContext=function(s){return s||(s={}),k({},{url:u.url,fetchOptions:u.fetchOptions,fetch:u.fetch,preferGetMethod:u.preferGetMethod},s,{suspense:s.suspense||s.suspense!==!1&&u.suspense,requestPolicy:s.requestPolicy||u.requestPolicy})},this.createRequestOperation=function(s,c,f){return L(s,c,u.createOperationContext(f))},this.executeQuery=function(s,c){return s=u.createRequestOperation("query",s,c),u.executeRequestOperation(s)},this.executeSubscription=function(s,c){return s=u.createRequestOperation("subscription",s,c),u.executeRequestOperation(s)},this.executeMutation=function(s,c){return s=u.createRequestOperation("mutation",s,c),u.executeRequestOperation(s)},t=tt,this.url=e.url,this.fetchOptions=e.fetchOptions,this.fetch=e.fetch,this.suspense=!!e.suspense,this.requestPolicy=e.requestPolicy||"cache-first",this.preferGetMethod=!!e.preferGetMethod,this.maskTypename=!!e.maskTypename,n=$e(),i=n.next,this.operations$=n.source,o=!1,this.dispatchOperation=function(s){for(o=!0,s&&i(s);s=u.queue.shift();)i(s);o=!1},this.reexecuteOperation=function(s){(s.kind==="mutation"||0<(u.activeOperations[s.key]||0))&&(u.queue.push(s),o||Promise.resolve().then(u.dispatchOperation))},e=un(e.exchanges!==void 0?e.exchanges:ue),this.results$=V(e({client:this,dispatchDebug:t,forward:nt({dispatchDebug:t})})(this.operations$)),We(this.results$)}function sn(e){return e.data=ge(e.data),e}function rt(e){return new q(e)}function it(e){function t(i){return(i=i.kind)==="subscription"||!!r&&(i==="query"||i==="mutation")}var n=e.forwardSubscription,r=e.enableAllOperations;return function(i){function o(a){var l=n({key:a.key.toString(36),query:(0,ut.print)(a.query),variables:a.variables,context:k({},a.context)});return X(function(p){function h(P){return N(re(a,P))}function d(P){return N(ie(a,P))}function O(){M||(M=!0,a.kind==="subscription"&&s.reexecuteOperation(L("teardown",a,a.context)),I())}var y,N=p.next,I=p.complete,M=!1;return Promise.resolve().then(function(){M||(y=l.subscribe({next:h,error:d,complete:O}))}),function(){M=!0,y&&y.unsubscribe()}})}function u(a){return!f(a)}var s=i.client,c=i.forward,f=t;return function(a){var l,p=V(a);return a=Y(function(h){var d=h.key,O=g(function(y){return y.kind==="teardown"&&y.key===d})(p);return Z(O)(o(h))})(g(f)(p)),l=c(g(u)(p)),G([a,l])}}}var _e,cn,fn,an,ue;_e=new Map;cn={},fn={key:"Operation.operationName",message:'The "Operation.operationName" property has been deprecated and will be removed in a future release of urql. Use "Operation.kind" instead.'};an=nt({dispatchDebug:tt});ue=[en,Zt,rn];q.prototype.onOperationStart=function(e){var t=e.key;this.activeOperations[t]=(this.activeOperations[t]||0)+1,this.dispatchOperation(e)};q.prototype.onOperationEnd=function(e){var t=e.key,n=this.activeOperations[t]||0;if(0>=(this.activeOperations[t]=0>=n?0:n-1)){for(t=this.queue.length-1;0<=t;t--)this.queue[t].key===e.key&&this.queue.splice(t,1);this.dispatchOperation(L("teardown",e,e.context))}};q.prototype.executeRequestOperation=function(e){var t,n,r=this,i=g(function(o){return o.operation.key===e.key})(this.results$);return this.maskTypename&&(i=W(sn)(i)),e.kind==="mutation"?ae(1)(ce(function(){return r.dispatchOperation(e)})(i)):(t=g(function(o){return o.kind==="teardown"&&o.key===e.key})(this.operations$),n=Ue(function(){r.onOperationEnd(e)})(ce(function(){r.onOperationStart(e)})(Z(t)(i))),e.kind==="query"&&e.context.pollInterval?Qe(function(){return n})(G([De(0),je(e.context.pollInterval)])):n)};q.prototype.query=function(e,t,n){return n&&typeof n.suspense=="boolean"||(n=k({},n,{suspense:!1})),Ze(this.executeQuery(T(e,t),n))};q.prototype.readQuery=function(e,t,n){var r=null;return A(function(i){r=i})(this.executeQuery(T(e,t),n)).unsubscribe(),r};q.prototype.subscription=function(e,t,n){return this.executeSubscription(T(e,t),n)};q.prototype.mutation=function(e,t,n){return Ze(this.executeMutation(T(e,t),n))};var S=x("react");var st,ke,Oe,ln,pn,hn,dn,mn,yn,vn,gn;st=rt({url:"/graphql"});Oe=(ke=(0,S.createContext)(st)).Provider;ln=ke.Consumer;pn=!1;hn=function(){var e=(0,S.useContext)(ke);return e};dn={fetching:!1,stale:!1,error:void 0,data:void 0,extensions:void 0,operation:void 0};mn=!1;yn=function(e,t){var n,r;if(typeof e!="object"||typeof t!="object")return e!==t;for(n in e)if(!(n in t))return!0;for(r in t)if(e[r]!==t[r])return!0;return!1};vn=function(e,t){return e.suspense&&(!t||t.suspense!==!1)};gn=new Map;function ct(e){return new Promise((t,n)=>{fe(e,A(({data:r,error:i})=>{i?n(i):t(r)}))})}function K(e,t,n={}){let{variables:r,cache:i,headers:o={}}=n,u=T(t,r),s=e.executeQuery(u,{requestPolicy:i,fetchOptions:{headers:o}});return ct(s)}function Ee(e,t,n={}){let{variables:r,headers:i={}}=n,o=T(t,r),u=e.executeMutation(o,{fetchOptions:{headers:i}});return ct(u)}function we(e,t,n,r={}){let{variables:i,headers:o={}}=r,u=T(t,i),s=e.executeSubscription(u,{fetchOptions:{headers:o}}),{unsubscribe:c}=fe(s,A(({data:f,error:a})=>{n(f,a)}));return c}var Tt=Ge(xt());function Me(e={}){let t=e.url||location.origin,n=(e.subscriptionUrl||t).replace(/^http/i,"ws"),r=e.subscriptionUrl!==!1&&new Tt.SubscriptionClient(n,{reconnect:!0,lazy:e.lazy||!1,inactivityTimeout:0,connectionCallback(u){let{onConnected:s,onDisconnected:c}=e,f=u&&(Array.isArray(u)?u:[u]);f&&f.length>0?typeof c=="function"&&c(f):typeof s=="function"&&s()}}),i=u=>r.request(u),o=[...ue];return r&&o.push(it({forwardSubscription:i})),new q({url:t,fetchOptions:e.default||{},exchanges:o})}function Pe(e,t){let n=t.headers||{},r=[];return e.emit("before-fetch",{headers:n,setHeaders(i){i&&r.push(i)}}),Promise.all(r).then(i=>{let o=i.reduce((u,s)=>typeof s=="object"&&s?{...u,...s}:u,n);return{...t,headers:o}})}function Wn(){if(typeof window<"u")return Me()}function Vn(e=Wn()){return t=>(t.includeProvider(Ct.createElement(Oe,{value:e})),{query(n,r={}){return Pe(t,r).then(i=>K(e,n,i))},mutate(n,r={}){return Pe(t,r).then(i=>Ee(e,n,i))},subscribe(n,r,i={}){let o=Pe(t,i).then(u=>we(e,n,r,u));return()=>o.then(u=>u())}})}var Fn=`query initialData {
1
+ var piralUrql=(()=>{var It=Object.create;var z=Object.defineProperty;var Nt=Object.getOwnPropertyDescriptor;var Mt=Object.getOwnPropertyNames;var Pt=Object.getPrototypeOf,Rt=Object.prototype.hasOwnProperty;var x=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var C=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),At=(e,t)=>{for(var n in t)z(e,n,{get:t[n],enumerable:!0})},Ae=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Mt(t))!Rt.call(e,i)&&i!==n&&z(e,i,{get:()=>t[i],enumerable:!(r=Nt(t,i))||r.enumerable});return e};var Ge=(e,t,n)=>(n=e!=null?It(Pt(e)):{},Ae(t||!e||!e.__esModule?z(n,"default",{value:e,enumerable:!0}):n,e)),Gt=e=>Ae(z({},"__esModule",{value:!0}),e);var at=C((pr,ft)=>{ft.exports=Q;function Q(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Q.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0};Q.prototype.reset=function(){this.attempts=0};Q.prototype.setMin=function(e){this.ms=e};Q.prototype.setMax=function(e){this.max=e};Q.prototype.setJitter=function(e){this.jitter=e}});var pt=C((hr,xe)=>{"use strict";var bn=Object.prototype.hasOwnProperty,b="~";function H(){}Object.create&&(H.prototype=Object.create(null),new H().__proto__||(b=!1));function _n(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function lt(e,t,n,r,i){if(typeof n!="function")throw new TypeError("The listener must be a function");var o=new _n(n,r||e,i),u=b?b+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],o]:e._events[u].push(o):(e._events[u]=o,e._eventsCount++),e}function se(e,t){--e._eventsCount===0?e._events=new H:delete e._events[t]}function v(){this._events=new H,this._eventsCount=0}v.prototype.eventNames=function(){var t=[],n,r;if(this._eventsCount===0)return t;for(r in n=this._events)bn.call(n,r)&&t.push(b?r.slice(1):r);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(n)):t};v.prototype.listeners=function(t){var n=b?b+t:t,r=this._events[n];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,u=new Array(o);i<o;i++)u[i]=r[i].fn;return u};v.prototype.listenerCount=function(t){var n=b?b+t:t,r=this._events[n];return r?r.fn?1:r.length:0};v.prototype.emit=function(t,n,r,i,o,u){var s=b?b+t:t;if(!this._events[s])return!1;var c=this._events[s],f=arguments.length,a,l;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),f){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,n),!0;case 3:return c.fn.call(c.context,n,r),!0;case 4:return c.fn.call(c.context,n,r,i),!0;case 5:return c.fn.call(c.context,n,r,i,o),!0;case 6:return c.fn.call(c.context,n,r,i,o,u),!0}for(l=1,a=new Array(f-1);l<f;l++)a[l-1]=arguments[l];c.fn.apply(c.context,a)}else{var p=c.length,h;for(l=0;l<p;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),f){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,n);break;case 3:c[l].fn.call(c[l].context,n,r);break;case 4:c[l].fn.call(c[l].context,n,r,i);break;default:if(!a)for(h=1,a=new Array(f-1);h<f;h++)a[h-1]=arguments[h];c[l].fn.apply(c[l].context,a)}}return!0};v.prototype.on=function(t,n,r){return lt(this,t,n,r,!1)};v.prototype.once=function(t,n,r){return lt(this,t,n,r,!0)};v.prototype.removeListener=function(t,n,r,i){var o=b?b+t:t;if(!this._events[o])return this;if(!n)return se(this,o),this;var u=this._events[o];if(u.fn)u.fn===n&&(!i||u.once)&&(!r||u.context===r)&&se(this,o);else{for(var s=0,c=[],f=u.length;s<f;s++)(u[s].fn!==n||i&&!u[s].once||r&&u[s].context!==r)&&c.push(u[s]);c.length?this._events[o]=c.length===1?c[0]:c:se(this,o)}return this};v.prototype.removeAllListeners=function(t){var n;return t?(n=b?b+t:t,this._events[n]&&se(this,n)):(this._events=new H,this._eventsCount=0),this};v.prototype.off=v.prototype.removeListener;v.prototype.addListener=v.prototype.on;v.prefixed=b;v.EventEmitter=v;typeof xe<"u"&&(xe.exports=v)});var ht=C(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});function kn(e){return typeof e=="string"}Te.default=kn});var dt=C(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});function On(e){return e!==null&&typeof e=="object"}Ce.default=On});var mt=C(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.default=En;function En(e){var t,n=e.Symbol;return typeof n=="function"?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}});var yt=C((Ie,Se)=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});var wn=mt(),xn=Tn(wn);function Tn(e){return e&&e.__esModule?e:{default:e}}var D;typeof self<"u"?D=self:typeof window<"u"?D=window:typeof global<"u"?D=global:typeof Se<"u"?D=Se:D=Function("return this")();var Cn=(0,xn.default)(D);Ie.default=Cn});var vt=C(j=>{"use strict";Object.defineProperty(j,"__esModule",{value:!0});j.GRAPHQL_SUBSCRIPTIONS=j.GRAPHQL_WS=void 0;var qn="graphql-ws";j.GRAPHQL_WS=qn;var Sn="graphql-subscriptions";j.GRAPHQL_SUBSCRIPTIONS=Sn});var gt=C($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.WS_TIMEOUT=$.MIN_WS_TIMEOUT=void 0;var In=1e3;$.MIN_WS_TIMEOUT=In;var Nn=3e4;$.WS_TIMEOUT=Nn});var bt=C(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});var Mn=(function(){function e(){throw new Error("Static Class")}return e.GQL_CONNECTION_INIT="connection_init",e.GQL_CONNECTION_ACK="connection_ack",e.GQL_CONNECTION_ERROR="connection_error",e.GQL_CONNECTION_KEEP_ALIVE="ka",e.GQL_CONNECTION_TERMINATE="connection_terminate",e.GQL_START="start",e.GQL_DATA="data",e.GQL_ERROR="error",e.GQL_COMPLETE="complete",e.GQL_STOP="stop",e.SUBSCRIPTION_START="subscription_start",e.SUBSCRIPTION_DATA="subscription_data",e.SUBSCRIPTION_SUCCESS="subscription_success",e.SUBSCRIPTION_FAIL="subscription_fail",e.SUBSCRIPTION_END="subscription_end",e.INIT="init",e.INIT_SUCCESS="init_success",e.INIT_FAIL="init_fail",e.KEEP_ALIVE="keepalive",e})();Ne.default=Mn});var xt=C(w=>{"use strict";var U=w&&w.__assign||function(){return U=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},U.apply(this,arguments)},Pn=w&&w.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(u){u(o)})}return new(n||(n=Promise))(function(o,u){function s(a){try{f(r.next(a))}catch(l){u(l)}}function c(a){try{f(r.throw(a))}catch(l){u(l)}}function f(a){a.done?o(a.value):i(a.value).then(s,c)}f((r=r.apply(e,t||[])).next())})},Rn=w&&w.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,u;return u={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function s(f){return function(a){return c([f,a])}}function c(f){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return n.label++,{value:f[1],done:!1};case 5:n.label++,i=f[1],f=[0];continue;case 7:f=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){n=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){n.label=f[1];break}if(f[0]===6&&n.label<o[1]){n.label=o[1],o=f;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(f);break}o[2]&&n.ops.pop(),n.trys.pop();continue}f=t.call(e,n)}catch(a){f=[6,a],i=0}finally{r=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}},_t=w&&w.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),i=0,t=0;t<n;t++)for(var o=arguments[t],u=0,s=o.length;u<s;u++,i++)r[i]=o[u];return r};Object.defineProperty(w,"__esModule",{value:!0});w.SubscriptionClient=void 0;var kt=typeof global<"u"?global:typeof window<"u"?window:{},An=kt.WebSocket||kt.MozWebSocket,Ot=at(),Gn=pt(),Et=ht(),Ln=dt(),Qn=x("graphql/language/printer"),Dn=x("graphql/utilities/getOperationAST"),jn=yt(),$n=vt(),wt=gt(),_=bt(),Un=(function(){function e(t,n,r,i){var o=n||{},u=o.connectionCallback,s=u===void 0?void 0:u,c=o.connectionParams,f=c===void 0?{}:c,a=o.minTimeout,l=a===void 0?wt.MIN_WS_TIMEOUT:a,p=o.timeout,h=p===void 0?wt.WS_TIMEOUT:p,d=o.reconnect,O=d===void 0?!1:d,y=o.reconnectionAttempts,N=y===void 0?1/0:y,I=o.lazy,M=I===void 0?!1:I,P=o.inactivityTimeout,qt=P===void 0?0:P,Re=o.wsOptionArguments,St=Re===void 0?[]:Re;if(this.wsImpl=r||An,!this.wsImpl)throw new Error("Unable to find native implementation, or alternative implementation for WebSocket!");this.wsProtocols=i||$n.GRAPHQL_WS,this.connectionCallback=s,this.url=t,this.operations={},this.nextOperationId=0,this.minWsTimeout=l,this.wsTimeout=h,this.unsentMessagesQueue=[],this.reconnect=O,this.reconnecting=!1,this.reconnectionAttempts=N,this.lazy=!!M,this.inactivityTimeout=qt,this.closedByUser=!1,this.backoff=new Ot({jitter:.5}),this.eventEmitter=new Gn.EventEmitter,this.middlewares=[],this.client=null,this.maxConnectTimeGenerator=this.createMaxConnectTimeGenerator(),this.connectionParams=this.getConnectionParams(f),this.wsOptionArguments=St,this.lazy||this.connect()}return Object.defineProperty(e.prototype,"status",{get:function(){return this.client===null?this.wsImpl.CLOSED:this.client.readyState},enumerable:!1,configurable:!0}),e.prototype.close=function(t,n){t===void 0&&(t=!0),n===void 0&&(n=!0),this.clearInactivityTimeout(),this.client!==null&&(this.closedByUser=n,t&&(this.clearCheckConnectionInterval(),this.clearMaxConnectTimeout(),this.clearTryReconnectTimeout(),this.unsubscribeAll(),this.sendMessage(void 0,_.default.GQL_CONNECTION_TERMINATE,null)),this.client.close(),this.client.onopen=null,this.client.onclose=null,this.client.onerror=null,this.client.onmessage=null,this.client=null,this.eventEmitter.emit("disconnected"),t||this.tryReconnect())},e.prototype.request=function(t){var n,r=this.getObserver.bind(this),i=this.executeOperation.bind(this),o=this.unsubscribe.bind(this),u;return this.clearInactivityTimeout(),n={},n[jn.default]=function(){return this},n.subscribe=function(s,c,f){var a=r(s,c,f);return u=i(t,function(l,p){l===null&&p===null?a.complete&&a.complete():l?a.error&&a.error(l[0]):a.next&&a.next(p)}),{unsubscribe:function(){u&&(o(u),u=null)}}},n},e.prototype.on=function(t,n,r){var i=this.eventEmitter.on(t,n,r);return function(){i.off(t,n,r)}},e.prototype.onConnected=function(t,n){return this.on("connected",t,n)},e.prototype.onConnecting=function(t,n){return this.on("connecting",t,n)},e.prototype.onDisconnected=function(t,n){return this.on("disconnected",t,n)},e.prototype.onReconnected=function(t,n){return this.on("reconnected",t,n)},e.prototype.onReconnecting=function(t,n){return this.on("reconnecting",t,n)},e.prototype.onError=function(t,n){return this.on("error",t,n)},e.prototype.unsubscribeAll=function(){var t=this;Object.keys(this.operations).forEach(function(n){t.unsubscribe(n)})},e.prototype.applyMiddlewares=function(t){var n=this;return new Promise(function(r,i){var o=function(u,s){var c=function(f){if(f)i(f);else if(u.length>0){var a=u.shift();a&&a.applyMiddleware.apply(s,[t,c])}else r(t)};c()};o(_t(n.middlewares),n)})},e.prototype.use=function(t){var n=this;return t.map(function(r){if(typeof r.applyMiddleware=="function")n.middlewares.push(r);else throw new Error("Middleware must implement the applyMiddleware function.")}),this},e.prototype.getConnectionParams=function(t){return function(){return new Promise(function(n,r){if(typeof t=="function")try{return n(t.call(null))}catch(i){return r(i)}n(t)})}},e.prototype.executeOperation=function(t,n){var r=this;this.client===null&&this.connect();var i=this.generateOperationId();return this.operations[i]={options:t,handler:n},this.applyMiddlewares(t).then(function(o){r.checkOperationOptions(o,n),r.operations[i]&&(r.operations[i]={options:o,handler:n},r.sendMessage(i,_.default.GQL_START,o))}).catch(function(o){r.unsubscribe(i),n(r.formatErrors(o))}),i},e.prototype.getObserver=function(t,n,r){return typeof t=="function"?{next:function(i){return t(i)},error:function(i){return n&&n(i)},complete:function(){return r&&r()}}:t},e.prototype.createMaxConnectTimeGenerator=function(){var t=this.minWsTimeout,n=this.wsTimeout;return new Ot({min:t,max:n,factor:1.2})},e.prototype.clearCheckConnectionInterval=function(){this.checkConnectionIntervalId&&(clearInterval(this.checkConnectionIntervalId),this.checkConnectionIntervalId=null)},e.prototype.clearMaxConnectTimeout=function(){this.maxConnectTimeoutId&&(clearTimeout(this.maxConnectTimeoutId),this.maxConnectTimeoutId=null)},e.prototype.clearTryReconnectTimeout=function(){this.tryReconnectTimeoutId&&(clearTimeout(this.tryReconnectTimeoutId),this.tryReconnectTimeoutId=null)},e.prototype.clearInactivityTimeout=function(){this.inactivityTimeoutId&&(clearTimeout(this.inactivityTimeoutId),this.inactivityTimeoutId=null)},e.prototype.setInactivityTimeout=function(){var t=this;this.inactivityTimeout>0&&Object.keys(this.operations).length===0&&(this.inactivityTimeoutId=setTimeout(function(){Object.keys(t.operations).length===0&&t.close()},this.inactivityTimeout))},e.prototype.checkOperationOptions=function(t,n){var r=t.query,i=t.variables,o=t.operationName;if(!r)throw new Error("Must provide a query.");if(!n)throw new Error("Must provide an handler.");if(!Et.default(r)&&!Dn.getOperationAST(r,o)||o&&!Et.default(o)||i&&!Ln.default(i))throw new Error("Incorrect option types. query must be a string or a document,`operationName` must be a string, and `variables` must be an object.")},e.prototype.buildMessage=function(t,n,r){var i=r&&r.query?U(U({},r),{query:typeof r.query=="string"?r.query:Qn.print(r.query)}):r;return{id:t,type:n,payload:i}},e.prototype.formatErrors=function(t){return Array.isArray(t)?t:t&&t.errors?this.formatErrors(t.errors):t&&t.message?[t]:[{name:"FormatedError",message:"Unknown error",originalError:t}]},e.prototype.sendMessage=function(t,n,r){this.sendMessageRaw(this.buildMessage(t,n,r))},e.prototype.sendMessageRaw=function(t){switch(this.status){case this.wsImpl.OPEN:var n=JSON.stringify(t);try{JSON.parse(n)}catch{this.eventEmitter.emit("error",new Error("Message must be JSON-serializable. Got: "+t))}this.client.send(n);break;case this.wsImpl.CONNECTING:this.unsentMessagesQueue.push(t);break;default:this.reconnecting||this.eventEmitter.emit("error",new Error("A message was not sent because socket is not connected, is closing or is already closed. Message was: "+JSON.stringify(t)))}},e.prototype.generateOperationId=function(){return String(++this.nextOperationId)},e.prototype.tryReconnect=function(){var t=this;if(!(!this.reconnect||this.backoff.attempts>=this.reconnectionAttempts)){this.reconnecting||(Object.keys(this.operations).forEach(function(r){t.unsentMessagesQueue.push(t.buildMessage(r,_.default.GQL_START,t.operations[r].options))}),this.reconnecting=!0),this.clearTryReconnectTimeout();var n=this.backoff.duration();this.tryReconnectTimeoutId=setTimeout(function(){t.connect()},n)}},e.prototype.flushUnsentMessagesQueue=function(){var t=this;this.unsentMessagesQueue.forEach(function(n){t.sendMessageRaw(n)}),this.unsentMessagesQueue=[]},e.prototype.checkConnection=function(){if(this.wasKeepAliveReceived){this.wasKeepAliveReceived=!1;return}this.reconnecting||this.close(!1,!0)},e.prototype.checkMaxConnectTimeout=function(){var t=this;this.clearMaxConnectTimeout(),this.maxConnectTimeoutId=setTimeout(function(){t.status!==t.wsImpl.OPEN&&(t.reconnecting=!0,t.close(!1,!0))},this.maxConnectTimeGenerator.duration())},e.prototype.connect=function(){var t,n=this;this.client=new((t=this.wsImpl).bind.apply(t,_t([void 0,this.url,this.wsProtocols],this.wsOptionArguments))),this.checkMaxConnectTimeout(),this.client.onopen=function(){return Pn(n,void 0,void 0,function(){var r,i;return Rn(this,function(o){switch(o.label){case 0:if(this.status!==this.wsImpl.OPEN)return[3,4];this.clearMaxConnectTimeout(),this.closedByUser=!1,this.eventEmitter.emit(this.reconnecting?"reconnecting":"connecting"),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.connectionParams()];case 2:return r=o.sent(),this.sendMessage(void 0,_.default.GQL_CONNECTION_INIT,r),this.flushUnsentMessagesQueue(),[3,4];case 3:return i=o.sent(),this.sendMessage(void 0,_.default.GQL_CONNECTION_ERROR,i),this.flushUnsentMessagesQueue(),[3,4];case 4:return[2]}})})},this.client.onclose=function(){n.closedByUser||n.close(!1,!1)},this.client.onerror=function(r){n.eventEmitter.emit("error",r)},this.client.onmessage=function(r){var i=r.data;n.processReceivedData(i)}},e.prototype.processReceivedData=function(t){var n,r;try{n=JSON.parse(t),r=n.id}catch{throw new Error("Message must be JSON-parseable. Got: "+t)}if([_.default.GQL_DATA,_.default.GQL_COMPLETE,_.default.GQL_ERROR].indexOf(n.type)!==-1&&!this.operations[r]){this.unsubscribe(r);return}switch(n.type){case _.default.GQL_CONNECTION_ERROR:this.connectionCallback&&this.connectionCallback(n.payload);break;case _.default.GQL_CONNECTION_ACK:this.eventEmitter.emit(this.reconnecting?"reconnected":"connected",n.payload),this.reconnecting=!1,this.backoff.reset(),this.maxConnectTimeGenerator.reset(),this.connectionCallback&&this.connectionCallback();break;case _.default.GQL_COMPLETE:var i=this.operations[r].handler;delete this.operations[r],i.call(this,null,null);break;case _.default.GQL_ERROR:this.operations[r].handler(this.formatErrors(n.payload),null),delete this.operations[r];break;case _.default.GQL_DATA:var o=n.payload.errors?U(U({},n.payload),{errors:this.formatErrors(n.payload.errors)}):n.payload;this.operations[r].handler(null,o);break;case _.default.GQL_CONNECTION_KEEP_ALIVE:var u=typeof this.wasKeepAliveReceived>"u";this.wasKeepAliveReceived=!0,u&&this.checkConnection(),this.checkConnectionIntervalId&&(clearInterval(this.checkConnectionIntervalId),this.checkConnection()),this.checkConnectionIntervalId=setInterval(this.checkConnection.bind(this),this.wsTimeout);break;default:throw new Error("Invalid message type!")}},e.prototype.unsubscribe=function(t){this.operations[t]&&(delete this.operations[t],this.setInactivityTimeout(),this.sendMessage(t,_.default.GQL_STOP,void 0))},e})();w.SubscriptionClient=Un});var Jn={};At(Jn,{createGqlApi:()=>Vn,gqlMutation:()=>Ee,gqlQuery:()=>K,gqlSubscription:()=>we,requestPiletsFromGraphQL:()=>Bn,setupGqlClient:()=>Me});var Ct=Ge(x("react"));function m(e,t){return t.tag=e,t}function E(){}function Le(e){return function(t){var n=e.length;let r=!1,i=!1,o=!1,u=0;t(m(0,[function(s){if(s)r=!0;else if(i)o=!0;else{for(i=o=!0;o&&!r;)u<n?(s=e[u],u=u+1|0,o=!1,t(m(1,[s]))):(r=!0,t(0));i=!1}}]))}}function Lt(){}function Qt(e){e(0)}function Dt(e){let t=!1;e(m(0,[function(n){n?t=!0:t||e(0)}]))}function jt(e){return e(0)}function Y(e){return function(t){return function(n){let r=E,i=!1,o=[],u=!1;t(function(s){typeof s=="number"?u||(u=!0,o.length===0&&n(0)):s.tag?u||(i=!1,(function(c){function f(p){typeof p=="number"?o.length!==0&&(o=o.filter(a),p=o.length===0,u&&p?n(0):!i&&p&&(i=!0,r(0))):p.tag?o.length!==0&&(n(m(1,[p[0]])),l(0)):(l=p=p[0],o=o.concat(p),p(0))}function a(p){return p!==l}let l=E;c.length===1?c(f):c.bind(null,f)})(e(s[0])),i||(i=!0,r(0))):r=s[0]}),n(m(0,[function(s){s?(u||(u=!0,r(s)),o.forEach(function(c){return c(s)}),o=[]):(i||u?i=!1:(i=!0,r(0)),o.forEach(jt))}]))}}}function $t(e){return e}function R(e){return function(t){return function(n){let r=!1;return t(function(i){if(typeof i=="number")r||(r=!0,n(i));else if(i.tag)r||(e(i[0]),n(i));else{var o=i[0];n(m(0,[function(u){if(!r)return u&&(r=!0),o(u)}]))}})}}}function Ut(e){e(0)}function Qe(e){return function(t){return function(n){function r(a){s&&(typeof a=="number"?(s=!1,f?n(a):o||(o=!0,i(0))):a.tag?(n(a),c?c=!1:u(0)):(u=a=a[0],c=!1,a(0)))}let i=E,o=!1,u=E,s=!1,c=!1,f=!1;t(function(a){typeof a=="number"?f||(f=!0,s||n(0)):a.tag?f||(s&&(u(1),u=E),o?o=!1:(o=!0,i(0)),a=e(a[0]),s=!0,a(r)):i=a[0]}),n(m(0,[function(a){if(a){if(f||(f=!0,i(1)),s)return s=!1,u(1)}else f||o||(o=!0,i(0)),s&&!c&&(c=!0,u(0))}]))}}}function Wt(e){return function(t){return function(n){let r=[],i=E;return t(function(o){typeof o=="number"?Le(r)(n):o.tag?(r.length>=e&&0<e&&r.shift(),r.push(o[0]),i(0)):(o=o[0],0>=e?(o(1),Dt(n)):(i=o,o(0)))})}}}function A(e){return function(t){let n=E,r=!1;return t(function(i){typeof i=="number"?r=!0:i.tag?r||(e(i[0]),n(0)):(n=i=i[0],i(0))}),{unsubscribe:function(){if(!r)return r=!0,n(1)}}}}function Vt(){}function g(e){return function(t){return function(n){let r=E;return t(function(i){typeof i=="number"?n(i):i.tag?e(i[0])?n(i):r(0):(r=i[0],n(i))})}}}function De(e){return function(t){let n=!1;t(m(0,[function(r){r?n=!0:n||(n=!0,t(m(1,[e])),t(0))}]))}}function je(e){return function(t){let n=0;var r=setInterval(function(){var i=n;n=n+1|0,t(m(1,[i]))},e);t(m(0,[function(i){i&&clearInterval(r)}]))}}function X(e){return function(t){let n=Lt,r=!1;n=e({next:function(i){r||t(m(1,[i]))},complete:function(){r||(r=!0,t(0))}}),t(m(0,[function(i){if(i&&!r)return r=!0,n()}]))}}function $e(){let e=[],t=!1;return{source:function(n){function r(i){return i!==n}e=e.concat(n),n(m(0,[function(i){i&&(e=e.filter(r))}]))},next:function(n){t||e.forEach(function(r){r(m(1,[n]))})},complete:function(){t||(t=!0,e.forEach(Qt))}}}function W(e){return function(t){return function(n){return t(function(r){r=typeof r=="number"?0:r.tag?m(1,[e(r[0])]):m(0,[r[0]]),n(r)})}}}function G(e){return Y($t)(Le(e))}function Ue(e){return function(t){return function(n){let r=!1;return t(function(i){if(typeof i=="number")return r?void 0:(r=!0,n(i),e());if(i.tag)r||n(i);else{var o=i[0];n(m(0,[function(u){if(!r)return u?(r=!0,o(u),e()):o(u)}]))}})}}}function ce(e){return function(t){return function(n){return t(function(r){typeof r=="number"||r.tag?n(r):(n(r),e())})}}}function fe(){for(var e=arguments,t=arguments[0],n=1,r=arguments.length;n<r;n++)t=e[n](t);return t}function We(e){return A(Vt)(e)}function V(e){function t(o){typeof o=="number"?(n.forEach(Ut),n=[]):o.tag?(i=!1,n.forEach(function(u){u(o)})):r=o[0]}let n=[],r=E,i=!1;return function(o){function u(s){return s!==o}n=n.concat(o),n.length===1&&e(t),o(m(0,[function(s){if(s){if(n=n.filter(u),n.length===0)return r(1)}else i||(i=!0,r(s))}]))}}function ae(e){return function(t){return function(n){let r=!1,i=0,o=E;t(function(u){typeof u=="number"?r||(r=!0,n(0)):u.tag?i<e&&!r&&(i=i+1|0,n(u),!r&&i>=e&&(r=!0,n(0),o(1))):(u=u[0],0>=e?(r=!0,n(0),u(1)):o=u)}),n(m(0,[function(u){if(!r){if(u)return r=!0,o(1);if(i<e)return o(0)}}]))}}}function Z(e){return function(t){return function(n){function r(s){typeof s!="number"&&(s.tag?(i=!0,o(1),n(0)):(u=s=s[0],s(0)))}let i=!1,o=E,u=E;t(function(s){typeof s=="number"?i||(i=!0,u(1),n(0)):s.tag?i||n(s):(o=s[0],e(r))}),n(m(0,[function(s){if(!i)return s?(i=!0,o(1),u(1)):o(0)}]))}}}function Ve(e){return new Promise(function(t){Wt(1)(e)(function(n){typeof n!="number"&&(n.tag?t(n[0]):n[0](0))})})}var Hn=typeof Symbol=="function"?Symbol.observable||(Symbol.observable=Symbol("observable")):"@@observable";var he=x("graphql/error/GraphQLError.mjs"),He=x("graphql/language/kinds.mjs"),ze=x("graphql/language/parser.mjs"),ye=x("graphql/language/printer.mjs");function Ft(e){return typeof e=="string"?new he.GraphQLError(e):typeof e=="object"&&e.message?new he.GraphQLError(e.message,e.nodes,e.source,e.positions,e.path,e,e.extensions||{}):e}function Bt(){return this.message}function le(e,t){e|=0;for(var n=0,r=0|t.length;n<r;n++)e=(e<<5)+e+t.charCodeAt(n);return e}function F(e){var t,n,r,i,o,u;if(e===null||B.has(e))return"null";if(typeof e!="object")return JSON.stringify(e)||"";if(e.toJSON)return F(e.toJSON());if(Array.isArray(e)){for(t="[",n=0,r=e.length;n<r;n++)0<n&&(t+=","),t+=0<(i=F(e[n])).length?i:"null";return t+"]"}if(!(t=Object.keys(e).sort()).length&&e.constructor&&e.constructor!==Object)return t=pe.get(e)||Math.random().toString(36).slice(2),pe.set(e,t),'{"__key":"'+t+'"}';for(B.add(e),n="{",r=0,i=t.length;r<i;r++)(u=F(e[o=t[r]]))&&(1<n.length&&(n+=","),n+=F(o)+":"+u);return B.delete(e),n+"}"}function ne(e){return B.clear(),F(e)}function ee(e){var t=(typeof e!="string"?e.loc&&e.loc.source.body||(0,ye.print)(e):e).replace(/([\s,]|#[^\n\r]+)+/g," ").trim();return typeof e!="string"&&(e.loc?(e="definitions"in e&&me(e))&&(t="# "+e+`
2
+ `+t):e.loc={start:0,end:t.length,source:{body:t,name:"gql",locationOffset:{line:1,column:1}}}),t}function de(e){if(typeof e=="string"){var t=le(5381,ee(e))>>>0;e=te.get(t)||(0,ze.parse)(e,{noLocation:!0})}else t=e.__key||le(5381,ee(e))>>>0,e=te.get(t)||e;return e.loc||ee(e),e.__key=t,te.set(t,e),e}function me(e){var t,n,r;for(t=0,n=e.definitions.length;t<n;t++)if((r=e.definitions[t]).kind===He.Kind.OPERATION_DEFINITION&&r.name)return r.name.value}function re(e,t,n){return{operation:e,data:t.data,error:Array.isArray(t.errors)?new J({graphQLErrors:t.errors,response:n}):void 0,extensions:typeof t.extensions=="object"&&t.extensions||void 0}}function ie(e,t,n){return{operation:e,data:void 0,error:new J({networkError:t,response:n}),extensions:void 0}}function k(){return(k=Object.assign||function(e){var t,n,r;for(t=1;t<arguments.length;t++){n=arguments[t];for(r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Fe(e){return{query:(0,ye.print)(e.query),operationName:me(e.query),variables:e.variables||void 0,extensions:void 0}}function Be(e,t){var n=e.context.url;return e.kind!=="query"||!e.context.preferGetMethod||!t?n:(e=[],t.operationName&&e.push("operationName="+encodeURIComponent(t.operationName)),t.query&&e.push("query="+encodeURIComponent(t.query.replace(/([\s,]|#[^\n\r]+)+/g," ").trim())),t.variables&&e.push("variables="+encodeURIComponent(ne(t.variables))),t.extensions&&e.push("extensions="+encodeURIComponent(ne(t.extensions))),n+"?"+e.join("&"))}function Je(e,t){var n=e.kind==="query"&&!!e.context.preferGetMethod;return k({},e=typeof e.context.fetchOptions=="function"?e.context.fetchOptions():e.context.fetchOptions||{},{body:!n&&t?JSON.stringify(t):void 0,method:n?"GET":"POST",headers:n?e.headers:k({},{"content-type":"application/json"},e.headers)})}function Ke(e,t,n){return X((function(r){var i=r.next,o=r.complete,u=typeof AbortController<"u"?new AbortController:null,s=!1;return Promise.resolve().then((function(){if(!s)return u&&(n.signal=u.signal),(function(f,a,l){var p,h=!1;return(f.context.fetch||fetch)(a,l).then((function(d){return p=d,h=200>d.status||d.status>=(l.redirect==="manual"?400:300),d.json()})).then((function(d){if(!("data"in d)&&!("errors"in d))throw Error("No Content");return re(f,d,p)})).catch((function(d){if(d.name!=="AbortError")return ie(f,h?Error(p.statusText):d,p)}))})(e,t,n)})).then((function(c){s||(s=!0,c&&i(c),o())})),function(){s=!0,u&&u.abort()}}))}function T(e,t){return e=de(e),{key:t?le(e.__key,ne(t))>>>0:e.__key,query:e,variables:t||{}}}var J,B,pe,te;J=(function(e){function t(n){var r,i=n.networkError,o=n.response;r=(function(s,c){var f="";return s!==void 0?f="[Network] "+s.message:(c!==void 0&&c.forEach((function(l){f+="[GraphQL] "+l.message+`
3
+ `})),f.trim())})(i,n=(n.graphQLErrors||[]).map(Ft)),e.call(this,r),this.name="CombinedError",this.message=r,this.graphQLErrors=n,this.networkError=i,this.response=o}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.toString=Bt,t})(Error);B=new Set,pe=new WeakMap;te=new Map;var ot=x("graphql/language/visitor.mjs"),oe=x("graphql/language/kinds.mjs"),ut=x("graphql/language/printer.mjs");function ve(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++)ve(e[n],t);else if(typeof e=="object"&&e!==null)for(n in e)n==="__typename"&&typeof e[n]=="string"?t[e[n]]=0:ve(e[n],t);return t}function Jt(e){return e.kind===oe.Kind.FIELD&&e.name.value==="__typename"&&!e.alias}function Ye(e){if(e.selectionSet&&!e.selectionSet.selections.some(Jt))return k({},e,{selectionSet:k({},e.selectionSet,{selections:e.selectionSet.selections.concat([{kind:oe.Kind.FIELD,name:{kind:oe.Kind.NAME,value:"__typename"}}])})})}function Kt(e){e=de(e);var t=_e.get(e.__key);return t||((t=(0,ot.visit)(e,{Field:Ye,InlineFragment:Ye})).__key=e.__key,_e.set(e.__key,t)),t}function ge(e){return e&&typeof e=="object"?Object.keys(e).reduce((function(t,n){var r=e[n];return n==="__typename"?Object.defineProperty(t,"__typename",{enumerable:!1,value:r}):Array.isArray(r)?t[n]=r.map(ge):t[n]=r&&typeof r=="object"&&"__typename"in r?ge(r):r,t}),{}):e}function Ze(e){return e.toPromise=function(){return Ve(ae(1)(e))},e}function L(e,t,n){return n||(n=t.context),{key:t.key,query:t.query,variables:t.variables,kind:e,context:n,get operationName(){if(0)var r,i;return this.kind}}}function et(e,t){return L(e.kind,e,k({},e.context,{meta:k({},e.context.meta,t)}))}function tt(){}function be(e){return(e=e.kind)!=="mutation"&&e!=="query"}function Ht(e){var t=L(e.kind,e);return t.query=Kt(e.query),t}function zt(e){return e.kind!=="query"||e.context.requestPolicy!=="cache-only"}function Yt(e){return et(e,{cacheOutcome:"miss"})}function Xt(e){return be(e)}function Zt(e){function t(l){var p=l.context.requestPolicy;return l.kind==="query"&&p!=="network-only"&&(p==="cache-only"||f.has(l.key))}function n(l){var p=f.get(l.key);return p=k({},p,{operation:et(l,{cacheOutcome:p?"hit":"miss"})}),l.context.requestPolicy==="cache-and-network"&&(p.stale=!0,Xe(s,l)),p}function r(l){return!be(l)&&t(l)}function i(l){function p(N){d.add(N)}var h,d,O,y=l.operation;if(y){if(h=Object.keys(ve(l.data,{})).concat(y.context.additionalTypenames||[]),l.operation.kind==="mutation"){for(d=new Set,l=0;l<h.length;l++)(O=a[O=h[l]]||(a[O]=new Set)).forEach(p),O.clear();d.forEach((function(I){f.has(I)&&(y=f.get(I).operation,f.delete(I),Xe(s,y))}))}else if(y.kind==="query"&&l.data)for(f.set(y.key,l),l=0;l<h.length;l++)(a[O=h[l]]||(a[O]=new Set)).add(y.key)}}function o(l){return!be(l)&&!t(l)}var u=e.forward,s=e.client,c=e.dispatchDebug,f=new Map,a=Object.create(null);return function(l){var p=V(l);return l=W(n)(g(r)(p)),p=R(i)(u(g(zt)(W(Yt)(G([W(Ht)(g(o)(p)),g(Xt)(p)]))))),G([l,p])}}function Xe(e,t){return e.reexecuteOperation(L(t.kind,t,k({},t.context,{requestPolicy:"network-only"})))}function en(e){function t(u){o.delete(u.operation.key)}function n(u){var s=u.key,c=u.kind;return c==="teardown"?(o.delete(s),!0):c!=="query"&&c!=="subscription"?!0:(c=o.has(s),o.add(s),!c)}var r=e.forward,i=e.dispatchDebug,o=new Set;return function(u){return u=g(n)(u),R(t)(r(u))}}function tn(e){return e.kind==="query"||e.kind==="mutation"}function nn(e){return e.kind!=="query"&&e.kind!=="mutation"}function rn(e){var t=e.forward,n=e.dispatchDebug;return function(r){var i,o=V(r);return r=Y((function(u){var s=u.key,c=g((function(p){return p.kind==="teardown"&&p.key===s}))(o),f=Fe(u),a=Be(u,f),l=Je(u,f);return R((function(p){var h=p.data?void 0:p.error}))(Z(c)(Ke(u,a,l)))}))(g(tn)(o)),i=t(g(nn)(o)),G([r,i])}}function on(){return!1}function nt(e){function t(r){if(r.kind!=="teardown"&&!1)var i}var n=e.dispatchDebug;return function(r){return g(on)(R(t)(r))}}function un(e){return function(t){var n=t.client,r=t.dispatchDebug;return e.reduceRight((function(i,o){return o({client:n,forward:i,dispatchDebug:function(u){}})}),t.forward)}}function q(e){var t,n,r,i,o,u=this;this.activeOperations=Object.create(null),this.queue=[],this.createOperationContext=function(s){return s||(s={}),k({},{url:u.url,fetchOptions:u.fetchOptions,fetch:u.fetch,preferGetMethod:u.preferGetMethod},s,{suspense:s.suspense||s.suspense!==!1&&u.suspense,requestPolicy:s.requestPolicy||u.requestPolicy})},this.createRequestOperation=function(s,c,f){return L(s,c,u.createOperationContext(f))},this.executeQuery=function(s,c){return s=u.createRequestOperation("query",s,c),u.executeRequestOperation(s)},this.executeSubscription=function(s,c){return s=u.createRequestOperation("subscription",s,c),u.executeRequestOperation(s)},this.executeMutation=function(s,c){return s=u.createRequestOperation("mutation",s,c),u.executeRequestOperation(s)},t=tt,this.url=e.url,this.fetchOptions=e.fetchOptions,this.fetch=e.fetch,this.suspense=!!e.suspense,this.requestPolicy=e.requestPolicy||"cache-first",this.preferGetMethod=!!e.preferGetMethod,this.maskTypename=!!e.maskTypename,n=$e(),i=n.next,this.operations$=n.source,o=!1,this.dispatchOperation=function(s){for(o=!0,s&&i(s);s=u.queue.shift();)i(s);o=!1},this.reexecuteOperation=function(s){(s.kind==="mutation"||0<(u.activeOperations[s.key]||0))&&(u.queue.push(s),o||Promise.resolve().then(u.dispatchOperation))},e=un(e.exchanges!==void 0?e.exchanges:ue),this.results$=V(e({client:this,dispatchDebug:t,forward:nt({dispatchDebug:t})})(this.operations$)),We(this.results$)}function sn(e){return e.data=ge(e.data),e}function rt(e){return new q(e)}function it(e){function t(i){return(i=i.kind)==="subscription"||!!r&&(i==="query"||i==="mutation")}var n=e.forwardSubscription,r=e.enableAllOperations;return function(i){function o(a){var l=n({key:a.key.toString(36),query:(0,ut.print)(a.query),variables:a.variables,context:k({},a.context)});return X((function(p){function h(P){return N(re(a,P))}function d(P){return N(ie(a,P))}function O(){M||(M=!0,a.kind==="subscription"&&s.reexecuteOperation(L("teardown",a,a.context)),I())}var y,N=p.next,I=p.complete,M=!1;return Promise.resolve().then((function(){M||(y=l.subscribe({next:h,error:d,complete:O}))})),function(){M=!0,y&&y.unsubscribe()}}))}function u(a){return!f(a)}var s=i.client,c=i.forward,f=t;return function(a){var l,p=V(a);return a=Y((function(h){var d=h.key,O=g((function(y){return y.kind==="teardown"&&y.key===d}))(p);return Z(O)(o(h))}))(g(f)(p)),l=c(g(u)(p)),G([a,l])}}}var _e,cn,fn,an,ue;_e=new Map;cn={},fn={key:"Operation.operationName",message:'The "Operation.operationName" property has been deprecated and will be removed in a future release of urql. Use "Operation.kind" instead.'};an=nt({dispatchDebug:tt});ue=[en,Zt,rn];q.prototype.onOperationStart=function(e){var t=e.key;this.activeOperations[t]=(this.activeOperations[t]||0)+1,this.dispatchOperation(e)};q.prototype.onOperationEnd=function(e){var t=e.key,n=this.activeOperations[t]||0;if(0>=(this.activeOperations[t]=0>=n?0:n-1)){for(t=this.queue.length-1;0<=t;t--)this.queue[t].key===e.key&&this.queue.splice(t,1);this.dispatchOperation(L("teardown",e,e.context))}};q.prototype.executeRequestOperation=function(e){var t,n,r=this,i=g((function(o){return o.operation.key===e.key}))(this.results$);return this.maskTypename&&(i=W(sn)(i)),e.kind==="mutation"?ae(1)(ce((function(){return r.dispatchOperation(e)}))(i)):(t=g((function(o){return o.kind==="teardown"&&o.key===e.key}))(this.operations$),n=Ue((function(){r.onOperationEnd(e)}))(ce((function(){r.onOperationStart(e)}))(Z(t)(i))),e.kind==="query"&&e.context.pollInterval?Qe((function(){return n}))(G([De(0),je(e.context.pollInterval)])):n)};q.prototype.query=function(e,t,n){return n&&typeof n.suspense=="boolean"||(n=k({},n,{suspense:!1})),Ze(this.executeQuery(T(e,t),n))};q.prototype.readQuery=function(e,t,n){var r=null;return A((function(i){r=i}))(this.executeQuery(T(e,t),n)).unsubscribe(),r};q.prototype.subscription=function(e,t,n){return this.executeSubscription(T(e,t),n)};q.prototype.mutation=function(e,t,n){return Ze(this.executeMutation(T(e,t),n))};var S=x("react");var st,ke,Oe,ln,pn,hn,dn,mn,yn,vn,gn;st=rt({url:"/graphql"});Oe=(ke=(0,S.createContext)(st)).Provider;ln=ke.Consumer;pn=!1;hn=function(){var e=(0,S.useContext)(ke);return e};dn={fetching:!1,stale:!1,error:void 0,data:void 0,extensions:void 0,operation:void 0};mn=!1;yn=function(e,t){var n,r;if(typeof e!="object"||typeof t!="object")return e!==t;for(n in e)if(!(n in t))return!0;for(r in t)if(e[r]!==t[r])return!0;return!1};vn=function(e,t){return e.suspense&&(!t||t.suspense!==!1)};gn=new Map;function ct(e){return new Promise((t,n)=>{fe(e,A(({data:r,error:i})=>{i?n(i):t(r)}))})}function K(e,t,n={}){let{variables:r,cache:i,headers:o={}}=n,u=T(t,r),s=e.executeQuery(u,{requestPolicy:i,fetchOptions:{headers:o}});return ct(s)}function Ee(e,t,n={}){let{variables:r,headers:i={}}=n,o=T(t,r),u=e.executeMutation(o,{fetchOptions:{headers:i}});return ct(u)}function we(e,t,n,r={}){let{variables:i,headers:o={}}=r,u=T(t,i),s=e.executeSubscription(u,{fetchOptions:{headers:o}}),{unsubscribe:c}=fe(s,A(({data:f,error:a})=>{n(f,a)}));return c}var Tt=Ge(xt());function Me(e={}){let t=e.url||location.origin,n=(e.subscriptionUrl||t).replace(/^http/i,"ws"),r=e.subscriptionUrl!==!1&&new Tt.SubscriptionClient(n,{reconnect:!0,lazy:e.lazy||!1,inactivityTimeout:0,connectionCallback(u){let{onConnected:s,onDisconnected:c}=e,f=u&&(Array.isArray(u)?u:[u]);f&&f.length>0?typeof c=="function"&&c(f):typeof s=="function"&&s()}}),i=u=>r.request(u),o=[...ue];return r&&o.push(it({forwardSubscription:i})),new q({url:t,fetchOptions:e.default||{},exchanges:o})}function Pe(e,t){let n=t.headers||{},r=[];return e.emit("before-fetch",{headers:n,setHeaders(i){i&&r.push(i)}}),Promise.all(r).then(i=>{let o=i.reduce((u,s)=>typeof s=="object"&&s?{...u,...s}:u,n);return{...t,headers:o}})}function Wn(){if(typeof window<"u")return Me()}function Vn(e=Wn()){return t=>(t.includeProvider(Ct.createElement(Oe,{value:e})),{query(n,r={}){return Pe(t,r).then(i=>K(e,n,i))},mutate(n,r={}){return Pe(t,r).then(i=>Ee(e,n,i))},subscribe(n,r,i={}){let o=Pe(t,i).then(u=>we(e,n,r,u));return()=>o.then(u=>u())}})}var Fn=`query initialData {
4
4
  pilets {
5
5
  hash
6
6
  link