(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2563],{70955:function(e,t){var r="undefined"!=typeof self?self:this,s=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();(function(e){var t={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};if(t.arrayBuffer)var r=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],o=ArrayBuffer.isView||function(e){return e&&r.indexOf(Object.prototype.toString.call(e))>-1};function i(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw TypeError("Invalid character in header field name");return e.toLowerCase()}function n(e){return"string"!=typeof e&&(e=String(e)),e}function a(e){var r={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t.iterable&&(r[Symbol.iterator]=function(){return r}),r}function u(e){this.map={},e instanceof u?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function l(e){if(e.bodyUsed)return Promise.reject(TypeError("Already read"));e.bodyUsed=!0}function c(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function h(e){var t=new FileReader,r=c(t);return t.readAsArrayBuffer(e),r}function d(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function p(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e){if("string"==typeof e)this._bodyText=e;else if(t.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(t.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else{var r;t.arrayBuffer&&t.blob&&(r=e)&&DataView.prototype.isPrototypeOf(r)?(this._bodyArrayBuffer=d(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):t.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||o(e))?this._bodyArrayBuffer=d(e):this._bodyText=e=Object.prototype.toString.call(e)}}else this._bodyText="";!this.headers.get("content-type")&&("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},t.blob&&(this.blob=function(){var e=l(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(!this._bodyFormData)return Promise.resolve(new Blob([this._bodyText]));throw Error("could not read FormData body as blob")},this.arrayBuffer=function(){return this._bodyArrayBuffer?l(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(h)}),this.text=function(){var e,t,r,s=l(this);if(s)return s;if(this._bodyBlob)return e=this._bodyBlob,r=c(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=Array(t.length),s=0;s<t.length;s++)r[s]=String.fromCharCode(t[s]);return r.join("")}(this._bodyArrayBuffer));if(!this._bodyFormData)return Promise.resolve(this._bodyText);throw Error("could not read FormData body as text")},t.formData&&(this.formData=function(){return this.text().then(b)}),this.json=function(){return this.text().then(JSON.parse)},this}u.prototype.append=function(e,t){e=i(e),t=n(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},u.prototype.delete=function(e){delete this.map[i(e)]},u.prototype.get=function(e){return e=i(e),this.has(e)?this.map[e]:null},u.prototype.has=function(e){return this.map.hasOwnProperty(i(e))},u.prototype.set=function(e,t){this.map[i(e)]=n(t)},u.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},u.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),a(e)},u.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),a(e)},u.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),a(e)},t.iterable&&(u.prototype[Symbol.iterator]=u.prototype.entries);var f=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function y(e,t){var r,s,o=(t=t||{}).body;if(e instanceof y){if(e.bodyUsed)throw TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new u(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new u(t.headers)),this.method=(s=(r=t.method||this.method||"GET").toUpperCase(),f.indexOf(s)>-1?s:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function b(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),s=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(s),decodeURIComponent(o))}}),t}function m(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new u(t.headers),this.url=t.url||"",this._initBody(e)}y.prototype.clone=function(){return new y(this,{body:this._bodyInit})},p.call(y.prototype),p.call(m.prototype),m.prototype.clone=function(){return new m(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},m.error=function(){var e=new m(null,{status:0,statusText:""});return e.type="error",e};var g=[301,302,303,307,308];m.redirect=function(e,t){if(-1===g.indexOf(t))throw RangeError("Invalid status code");return new m(null,{status:t,headers:{location:e}})},e.DOMException=s.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function w(r,s){return new Promise(function(o,i){var n=new y(r,s);if(n.signal&&n.signal.aborted)return i(new e.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function l(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new u,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(e){var r=e.split(":"),s=r.shift().trim();if(s){var o=r.join(":").trim();t.append(s,o)}}),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL"),o(new m("response"in a?a.response:a.responseText,r))},a.onerror=function(){i(TypeError("Network request failed"))},a.ontimeout=function(){i(TypeError("Network request failed"))},a.onabort=function(){i(new e.DOMException("Aborted","AbortError"))},a.open(n.method,n.url,!0),"include"===n.credentials?a.withCredentials=!0:"omit"===n.credentials&&(a.withCredentials=!1),"responseType"in a&&t.blob&&(a.responseType="blob"),n.headers.forEach(function(e,t){a.setRequestHeader(t,e)}),n.signal&&(n.signal.addEventListener("abort",l),a.onreadystatechange=function(){4===a.readyState&&n.signal.removeEventListener("abort",l)}),a.send(void 0===n._bodyInit?null:n._bodyInit)})}w.polyfill=!0,s.fetch||(s.fetch=w,s.Headers=u,s.Request=y,s.Response=m),e.Headers=u,e.Request=y,e.Response=m,e.fetch=w,Object.defineProperty(e,"__esModule",{value:!0})})({}),s.fetch.ponyfill=!0,delete s.fetch.polyfill,(t=s.fetch).default=s.fetch,t.fetch=s.fetch,t.Headers=s.Headers,t.Request=s.Request,t.Response=s.Response,e.exports=t},68029:function(e){"use strict";e.exports="object"==typeof self?self.FormData:window.FormData},29894:function(e){"use strict";e.exports=function(e){var t=e.uri,r=e.name,s=e.type;this.uri=t,this.name=r,this.type=s}},93980:function(e,t,r){"use strict";var s=r(48546);e.exports=function e(t,r,o){void 0===r&&(r=""),void 0===o&&(o=s);var i,n=new Map;function a(e,t){var r=n.get(t);r?r.push.apply(r,e):n.set(t,e)}if(o(t))i=null,a([r],t);else{var u=r?r+".":"";if("undefined"!=typeof FileList&&t instanceof FileList)i=Array.prototype.map.call(t,function(e,t){return a([""+u+t],e),null});else if(Array.isArray(t))i=t.map(function(t,r){var s=e(t,""+u+r,o);return s.files.forEach(a),s.clone});else if(t&&t.constructor===Object)for(var l in i={},t){var c=e(t[l],""+u+l,o);c.files.forEach(a),i[l]=c.clone}else i=t}return{clone:i,files:n}}},48546:function(e,t,r){"use strict";var s=r(29894);e.exports=function(e){return"undefined"!=typeof File&&e instanceof File||"undefined"!=typeof Blob&&e instanceof Blob||e instanceof s}},92563:function(e,t,r){"use strict";r.d(t,{g6:function(){return P}});let s={parse:JSON.parse,stringify:JSON.stringify};var o=r(48546),i=r(93980),n=r(68029);let a=e=>o(e)||null!==e&&"object"==typeof e&&"function"==typeof e.pipe;var u=(e,t,r,o=s)=>{let{clone:u,files:l}=i({query:e,variables:t,operationName:r},"",a);if(0===l.size){if(!Array.isArray(e))return o.stringify(u);if(void 0!==t&&!Array.isArray(t))throw Error("Cannot create request body with given variable type, array expected");let r=e.reduce((e,r,s)=>(e.push({query:r,variables:t?t[s]:void 0}),e),[]);return o.stringify(r)}let c=new("undefined"==typeof FormData?n:FormData);c.append("operations",o.stringify(u));let h={},d=0;return l.forEach(e=>{h[++d]=e}),c.append("map",o.stringify(h)),d=0,l.forEach((e,t)=>{c.append(`${++d}`,t)}),c};let l=e=>e.toUpperCase(),c=e=>{let t={};return e.forEach((e,r)=>{t[r]=e}),t},h=(e,t,r)=>e.document?e:{document:e,variables:t,requestHeaders:r,signal:void 0},d=(e,t,r)=>e.query?e:{query:e,variables:t,requestHeaders:r,signal:void 0},p=(e,t)=>e.documents?e:{documents:e,requestHeaders:t,signal:void 0};var f=r(32682),y=r(65107);let b=e=>{let t;let r=e.definitions.filter(e=>"OperationDefinition"===e.kind);return 1===r.length&&(t=r[0]?.name?.value),t},m=e=>{if("string"==typeof e){let t;try{let r=(0,f.Qc)(e);t=b(r)}catch(e){}return{query:e,operationName:t}}let t=b(e);return{query:(0,y.S)(e),operationName:t}};class g extends Error{constructor(e,t){super(`${g.extractMessage(e)}: ${JSON.stringify({response:e,request:t})}`),Object.setPrototypeOf(this,g.prototype),this.response=e,this.request=t,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,g)}static extractMessage(e){return e.errors?.[0]?.message??`GraphQL Error (Code: ${e.status})`}}var w=r(70955),v=r.t(w,2);let A="ping",E="pong",q="complete";class x{get type(){return this._type}get id(){return this._id}get payload(){return this._payload}constructor(e,t,r){this._type=e,this._payload=t,this._id=r}get text(){let e={type:this.type};return null!=this.id&&void 0!=this.id&&(e.id=this.id),null!=this.payload&&void 0!=this.payload&&(e.payload=this.payload),JSON.stringify(e)}static parse(e,t){let{type:r,payload:s,id:o}=JSON.parse(e);return new x(r,t(s),o)}}class S{constructor(e,{onInit:t,onAcknowledged:r,onPing:s,onPong:o}){this.socketState={acknowledged:!1,lastRequestId:0,subscriptions:{}},this.socket=e,e.onopen=async r=>{this.socketState.acknowledged=!1,this.socketState.subscriptions={},e.send(new x("connection_init",t?await t():null).text)},e.onclose=e=>{this.socketState.acknowledged=!1,this.socketState.subscriptions={}},e.onerror=e=>{console.error(e)},e.onmessage=t=>{try{let i=function(e,t=e=>e){return x.parse(e,t)}(t.data);switch(i.type){case"connection_ack":this.socketState.acknowledged?console.warn("Duplicate CONNECTION_ACK message ignored"):(this.socketState.acknowledged=!0,r&&r(i.payload));return;case A:s?s(i.payload).then(t=>e.send(_(t).text)):e.send(_(null).text);return;case E:o&&o(i.payload);return}if(!this.socketState.acknowledged||void 0===i.id||null===i.id||!this.socketState.subscriptions[i.id])return;let{query:n,variables:a,subscriber:u}=this.socketState.subscriptions[i.id];switch(i.type){case"next":!i.payload.errors&&i.payload.data&&u.next&&u.next(i.payload.data),i.payload.errors&&u.error&&u.error(new g({...i.payload,status:200},{query:n,variables:a}));return;case"error":u.error&&u.error(new g({errors:i.payload,status:200},{query:n,variables:a}));return;case q:u.complete&&u.complete(),delete this.socketState.subscriptions[i.id];return}}catch(t){console.error(t),e.close(1006)}e.close(4400,"Unknown graphql-ws message.")}}makeSubscribe(e,t,r,s){let o=(this.socketState.lastRequestId++).toString();return this.socketState.subscriptions[o]={query:e,variables:s,subscriber:r},this.socket.send(new x("subscribe",{query:e,operationName:t,variables:s},o).text),()=>{this.socket.send(new x(q,void 0,o).text),delete this.socketState.subscriptions[o]}}rawRequest(e,t){return new Promise((r,s)=>{let o;this.rawSubscribe(e,{next:(e,t)=>o={data:e,extensions:t},error:s,complete:()=>r(o)},t)})}request(e,t){return new Promise((r,s)=>{let o;this.subscribe(e,{next:e=>o=e,error:s,complete:()=>r(o)},t)})}subscribe(e,t,r){let{query:s,operationName:o}=m(e);return this.makeSubscribe(s,o,t,r)}rawSubscribe(e,t,r){return this.makeSubscribe(e,void 0,t,r)}ping(e){this.socket.send(new x(A,e,void 0).text)}close(){this.socket.close(1e3)}}function _(e){return new x(E,e,void 0)}S.PROTOCOL="graphql-transport-ws";let O=e=>{let t={};return e&&("undefined"!=typeof Headers&&e instanceof Headers||v&&w.Headers&&e instanceof w.Headers?t=c(e):Array.isArray(e)?e.forEach(([e,r])=>{e&&void 0!==r&&(t[e]=r)}):t=e),t},k=e=>e.replace(/([\s,]|#[^\n\r]+)+/g," ").trim(),T=e=>{if(!Array.isArray(e.query)){let t=[`query=${encodeURIComponent(k(e.query))}`];return e.variables&&t.push(`variables=${encodeURIComponent(e.jsonSerializer.stringify(e.variables))}`),e.operationName&&t.push(`operationName=${encodeURIComponent(e.operationName)}`),t.join("&")}if(void 0!==e.variables&&!Array.isArray(e.variables))throw Error("Cannot create query with given variable type, array expected");let t=e.query.reduce((t,r,s)=>(t.push({query:k(r),variables:e.variables?e.jsonSerializer.stringify(e.variables[s]):void 0}),t),[]);return`query=${encodeURIComponent(e.jsonSerializer.stringify(t))}`},C=e=>async t=>{let r;let{url:o,query:i,variables:n,operationName:a,fetch:l,fetchOptions:c,middleware:h}=t,d={...t.headers},p="";"POST"===e?"string"==typeof(r=u(i,n,a,c.jsonSerializer))&&(d["Content-Type"]="application/json"):p=T({query:i,variables:n,operationName:a,jsonSerializer:c.jsonSerializer??s});let f={method:e,headers:d,body:r,...c},y=o,b=f;if(h){let{url:e,...t}=await Promise.resolve(h({...f,url:o,operationName:a,variables:n}));y=e,b=t}return p&&(y=`${y}?${p}`),await l(y,b)};class P{constructor(e,t={}){this.url=e,this.requestConfig=t,this.rawRequest=async(...e)=>{let[t,r,s]=e,o=d(t,r,s),{headers:i,fetch:n=w,method:a="POST",requestMiddleware:u,responseMiddleware:l,...c}=this.requestConfig,{url:h}=this;void 0!==o.signal&&(c.signal=o.signal);let{operationName:p}=m(o.query);return B({url:h,query:o.query,variables:o.variables,headers:{...O(D(i)),...O(o.requestHeaders)},operationName:p,fetch:n,method:a,fetchOptions:c,middleware:u}).then(e=>(l&&l(e),e)).catch(e=>{throw l&&l(e),e})}}async request(e,...t){let[r,s]=t,o=h(e,r,s),{headers:i,fetch:n=w,method:a="POST",requestMiddleware:u,responseMiddleware:l,...c}=this.requestConfig,{url:d}=this;void 0!==o.signal&&(c.signal=o.signal);let{query:p,operationName:f}=m(o.document);return B({url:d,query:p,variables:o.variables,headers:{...O(D(i)),...O(o.requestHeaders)},operationName:f,fetch:n,method:a,fetchOptions:c,middleware:u}).then(e=>(l&&l(e),e.data)).catch(e=>{throw l&&l(e),e})}batchRequests(e,t){let r=p(e,t),{headers:s,...o}=this.requestConfig;void 0!==r.signal&&(o.signal=r.signal);let i=r.documents.map(({document:e})=>m(e).query),n=r.documents.map(({variables:e})=>e);return B({url:this.url,query:i,variables:n,headers:{...O(D(s)),...O(r.requestHeaders)},operationName:void 0,fetch:this.requestConfig.fetch??w,method:this.requestConfig.method||"POST",fetchOptions:o,middleware:this.requestConfig.requestMiddleware}).then(e=>(this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(e),e.data)).catch(e=>{throw this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(e),e})}setHeaders(e){return this.requestConfig.headers=e,this}setHeader(e,t){let{headers:r}=this.requestConfig;return r?r[e]=t:this.requestConfig.headers={[e]:t},this}setEndpoint(e){return this.url=e,this}}let B=async e=>{let{query:t,variables:r,fetchOptions:o}=e,i=C(l(e.method??"post")),n=Array.isArray(e.query),a=await i(e),u=await j(a,o.jsonSerializer??s),c=Array.isArray(u)?!u.some(({data:e})=>!e):!!u.data,h=Array.isArray(u)||!u.errors||Array.isArray(u.errors)&&!u.errors.length||"all"===o.errorPolicy||"ignore"===o.errorPolicy;if(a.ok&&h&&c){let{errors:e,...t}=(Array.isArray(u),u),r="ignore"===o.errorPolicy?t:u;return{...n?{data:r}:r,headers:a.headers,status:a.status}}throw new g({..."string"==typeof u?{error:u}:u,status:a.status,headers:a.headers},{query:t,variables:r})},j=async(e,t)=>{let r;return(e.headers.forEach((e,t)=>{"content-type"===t.toLowerCase()&&(r=e)}),r&&(r.toLowerCase().startsWith("application/json")||r.toLowerCase().startsWith("application/graphql+json")||r.toLowerCase().startsWith("application/graphql-response+json")))?t.parse(await e.text()):e.text()},D=e=>"function"==typeof e?e():e}}]);
//# sourceMappingURL=2563-aa5459a1bf1806b0.js.map