@stigg/js-client-sdk 0.37.0 → 0.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Stigg",[],t):"object"==typeof exports?exports.Stigg=t():e.Stigg=t()}(self,(function(){return(()=>{var e={4098:function(e,t){var n="undefined"!=typeof self?self:this,r=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();!function(e){!function(t){var n="URLSearchParams"in e,r="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in e,a="ArrayBuffer"in e;if(a)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function p(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r&&(t[Symbol.iterator]=function(){return t}),t}function f(e){this.map={},e instanceof f?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 d(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function h(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function y(e){var t=new FileReader,n=h(t);return t.readAsArrayBuffer(e),n}function v(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a&&i&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=v(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=v(e):this._bodyText=e=Object.prototype.toString.call(e):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):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=d(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)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(y)}),this.text=function(){var e,t,n,r=d(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,n=h(t=new FileReader),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(E)}),this.json=function(){return this.text().then(JSON.parse)},this}f.prototype.append=function(e,t){e=c(e),t=l(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},f.prototype.delete=function(e){delete this.map[c(e)]},f.prototype.get=function(e){return e=c(e),this.has(e)?this.map[e]:null},f.prototype.has=function(e){return this.map.hasOwnProperty(c(e))},f.prototype.set=function(e,t){this.map[c(e)]=l(t)},f.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},f.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),p(e)},f.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),p(e)},f.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),p(e)},r&&(f.prototype[Symbol.iterator]=f.prototype.entries);var g=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(e,t){var n,r,i=(t=t||{}).body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new f(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=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 f(t.headers)),this.method=(r=(n=t.method||this.method||"GET").toUpperCase(),g.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function E(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function _(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 f(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},m.call(b.prototype),m.call(_.prototype),_.prototype.clone=function(){return new _(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},_.error=function(){var e=new _(null,{status:0,statusText:""});return e.type="error",e};var w=[301,302,303,307,308];_.redirect=function(e,t){if(-1===w.indexOf(t))throw new RangeError("Invalid status code");return new _(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function I(e,n){return new Promise((function(r,o){var a=new b(e,n);if(a.signal&&a.signal.aborted)return o(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function u(){s.abort()}s.onload=function(){var e,t,n={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new f,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}})),t)};n.url="responseURL"in s?s.responseURL:n.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;r(new _(i,n))},s.onerror=function(){o(new TypeError("Network request failed"))},s.ontimeout=function(){o(new TypeError("Network request failed"))},s.onabort=function(){o(new t.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&i&&(s.responseType="blob"),a.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),a.signal&&(a.signal.addEventListener("abort",u),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",u)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}I.polyfill=!0,e.fetch||(e.fetch=I,e.Headers=f,e.Request=b,e.Response=_),t.Headers=f,t.Request=b,t.Response=_,t.fetch=I,Object.defineProperty(t,"__esModule",{value:!0})}({})}(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},8552:(e,t,n)=>{var r=n(852)(n(5639),"DataView");e.exports=r},1989:(e,t,n)=>{var r=n(1789),i=n(401),o=n(7667),a=n(1327),s=n(1866);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,e.exports=u},8407:(e,t,n)=>{var r=n(7040),i=n(4125),o=n(2117),a=n(7529),s=n(4705);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,e.exports=u},7071:(e,t,n)=>{var r=n(852)(n(5639),"Map");e.exports=r},3369:(e,t,n)=>{var r=n(4785),i=n(1285),o=n(6e3),a=n(9916),s=n(5265);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,e.exports=u},3818:(e,t,n)=>{var r=n(852)(n(5639),"Promise");e.exports=r},8525:(e,t,n)=>{var r=n(852)(n(5639),"Set");e.exports=r},8668:(e,t,n)=>{var r=n(3369),i=n(619),o=n(2385);function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}a.prototype.add=a.prototype.push=i,a.prototype.has=o,e.exports=a},6384:(e,t,n)=>{var r=n(8407),i=n(7465),o=n(3779),a=n(7599),s=n(4758),u=n(4309);function c(e){var t=this.__data__=new r(e);this.size=t.size}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=a,c.prototype.has=s,c.prototype.set=u,e.exports=c},2705:(e,t,n)=>{var r=n(5639).Symbol;e.exports=r},1149:(e,t,n)=>{var r=n(5639).Uint8Array;e.exports=r},577:(e,t,n)=>{var r=n(852)(n(5639),"WeakMap");e.exports=r},6874:e=>{e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},4963:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}},4636:(e,t,n)=>{var r=n(2545),i=n(5694),o=n(1469),a=n(4144),s=n(5776),u=n(6719),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=o(e),l=!n&&i(e),p=!n&&!l&&a(e),f=!n&&!l&&!p&&u(e),d=n||l||p||f,h=d?r(e.length,String):[],y=h.length;for(var v in e)!t&&!c.call(e,v)||d&&("length"==v||p&&("offset"==v||"parent"==v)||f&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||s(v,y))||h.push(v);return h}},9932:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}},2488:e=>{e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}},2908:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},6556:(e,t,n)=>{var r=n(9465),i=n(7813);e.exports=function(e,t,n){(void 0!==n&&!i(e[t],n)||void 0===n&&!(t in e))&&r(e,t,n)}},4865:(e,t,n)=>{var r=n(9465),i=n(7813),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];o.call(e,t)&&i(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},8470:(e,t,n)=>{var r=n(7813);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},9465:(e,t,n)=>{var r=n(8777);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},3118:(e,t,n)=>{var r=n(3218),i=Object.create,o=function(){function e(){}return function(t){if(!r(t))return{};if(i)return i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=o},4140:(e,t,n)=>{var r=n(7816),i=n(9291)(r);e.exports=i},1848:e=>{e.exports=function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}},1078:(e,t,n)=>{var r=n(2488),i=n(7285);e.exports=function e(t,n,o,a,s){var u=-1,c=t.length;for(o||(o=i),s||(s=[]);++u<c;){var l=t[u];n>0&&o(l)?n>1?e(l,n-1,o,a,s):r(s,l):a||(s[s.length]=l)}return s}},8483:(e,t,n)=>{var r=n(5063)();e.exports=r},7816:(e,t,n)=>{var r=n(8483),i=n(3674);e.exports=function(e,t){return e&&r(e,t,i)}},7786:(e,t,n)=>{var r=n(1811),i=n(327);e.exports=function(e,t){for(var n=0,o=(t=r(t,e)).length;null!=e&&n<o;)e=e[i(t[n++])];return n&&n==o?e:void 0}},8866:(e,t,n)=>{var r=n(2488),i=n(1469);e.exports=function(e,t,n){var o=t(e);return i(e)?o:r(o,n(e))}},4239:(e,t,n)=>{var r=n(2705),i=n(9607),o=n(2333),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},13:e=>{e.exports=function(e,t){return null!=e&&t in Object(e)}},2118:(e,t,n)=>{var r=n(1848),i=n(2722),o=n(2351);e.exports=function(e,t,n){return t==t?o(e,t,n):r(e,i,n)}},9454:(e,t,n)=>{var r=n(4239),i=n(7005);e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},939:(e,t,n)=>{var r=n(1299),i=n(7005);e.exports=function e(t,n,o,a,s){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,o,a,e,s))}},1299:(e,t,n)=>{var r=n(6384),i=n(7114),o=n(8351),a=n(6096),s=n(4160),u=n(1469),c=n(4144),l=n(6719),p="[object Arguments]",f="[object Array]",d="[object Object]",h=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,y,v,m){var g=u(e),b=u(t),E=g?f:s(e),_=b?f:s(t),w=(E=E==p?d:E)==d,I=(_=_==p?d:_)==d,T=E==_;if(T&&c(e)){if(!c(t))return!1;g=!0,w=!1}if(T&&!w)return m||(m=new r),g||l(e)?i(e,t,n,y,v,m):o(e,t,E,n,y,v,m);if(!(1&n)){var O=w&&h.call(e,"__wrapped__"),S=I&&h.call(t,"__wrapped__");if(O||S){var D=O?e.value():e,x=S?t.value():t;return m||(m=new r),v(D,x,n,y,m)}}return!!T&&(m||(m=new r),a(e,t,n,y,v,m))}},2958:(e,t,n)=>{var r=n(6384),i=n(939);e.exports=function(e,t,n,o){var a=n.length,s=a,u=!o;if(null==e)return!s;for(e=Object(e);a--;){var c=n[a];if(u&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++a<s;){var l=(c=n[a])[0],p=e[l],f=c[1];if(u&&c[2]){if(void 0===p&&!(l in e))return!1}else{var d=new r;if(o)var h=o(p,f,l,e,t,d);if(!(void 0===h?i(f,p,3,o,d):h))return!1}}return!0}},2722:e=>{e.exports=function(e){return e!=e}},8458:(e,t,n)=>{var r=n(3560),i=n(5346),o=n(3218),a=n(346),s=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,l=u.toString,p=c.hasOwnProperty,f=RegExp("^"+l.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?f:s).test(a(e))}},8749:(e,t,n)=>{var r=n(4239),i=n(1780),o=n(7005),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!a[r(e)]}},7206:(e,t,n)=>{var r=n(1573),i=n(6432),o=n(6557),a=n(1469),s=n(9601);e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?a(e)?i(e[0],e[1]):r(e):s(e)}},280:(e,t,n)=>{var r=n(5726),i=n(6916),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},313:(e,t,n)=>{var r=n(3218),i=n(5726),o=n(3498),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=i(e),n=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&n.push(s);return n}},9199:(e,t,n)=>{var r=n(4140),i=n(8612);e.exports=function(e,t){var n=-1,o=i(e)?Array(e.length):[];return r(e,(function(e,r,i){o[++n]=t(e,r,i)})),o}},1573:(e,t,n)=>{var r=n(2958),i=n(1499),o=n(2634);e.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},6432:(e,t,n)=>{var r=n(939),i=n(7361),o=n(9095),a=n(5403),s=n(9162),u=n(2634),c=n(327);e.exports=function(e,t){return a(e)&&s(t)?u(c(e),t):function(n){var a=i(n,e);return void 0===a&&a===t?o(n,e):r(t,a,3)}}},2980:(e,t,n)=>{var r=n(6384),i=n(6556),o=n(8483),a=n(9783),s=n(3218),u=n(1704),c=n(6390);e.exports=function e(t,n,l,p,f){t!==n&&o(n,(function(o,u){if(f||(f=new r),s(o))a(t,n,u,l,e,p,f);else{var d=p?p(c(t,u),o,u+"",t,n,f):void 0;void 0===d&&(d=o),i(t,u,d)}}),u)}},9783:(e,t,n)=>{var r=n(6556),i=n(4626),o=n(7133),a=n(278),s=n(8517),u=n(5694),c=n(1469),l=n(9246),p=n(4144),f=n(3560),d=n(3218),h=n(8630),y=n(6719),v=n(6390),m=n(9881);e.exports=function(e,t,n,g,b,E,_){var w=v(e,n),I=v(t,n),T=_.get(I);if(T)r(e,n,T);else{var O=E?E(w,I,n+"",e,t,_):void 0,S=void 0===O;if(S){var D=c(I),x=!D&&p(I),A=!D&&!x&&y(I);O=I,D||x||A?c(w)?O=w:l(w)?O=a(w):x?(S=!1,O=i(I,!0)):A?(S=!1,O=o(I,!0)):O=[]:h(I)||u(I)?(O=w,u(w)?O=m(w):d(w)&&!f(w)||(O=s(I))):S=!1}S&&(_.set(I,O),b(O,I,g,E,_),_.delete(I)),r(e,n,O)}}},2689:(e,t,n)=>{var r=n(9932),i=n(7786),o=n(7206),a=n(9199),s=n(1131),u=n(7518),c=n(5022),l=n(6557),p=n(1469);e.exports=function(e,t,n){t=t.length?r(t,(function(e){return p(e)?function(t){return i(t,1===e.length?e[0]:e)}:e})):[l];var f=-1;t=r(t,u(o));var d=a(e,(function(e,n,i){return{criteria:r(t,(function(t){return t(e)})),index:++f,value:e}}));return s(d,(function(e,t){return c(e,t,n)}))}},371:e=>{e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},9152:(e,t,n)=>{var r=n(7786);e.exports=function(e){return function(t){return r(t,e)}}},5976:(e,t,n)=>{var r=n(6557),i=n(5357),o=n(61);e.exports=function(e,t){return o(i(e,t,r),e+"")}},6560:(e,t,n)=>{var r=n(5703),i=n(8777),o=n(6557),a=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:o;e.exports=a},1131:e=>{e.exports=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}},2545:e=>{e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},531:(e,t,n)=>{var r=n(2705),i=n(9932),o=n(1469),a=n(3448),s=r?r.prototype:void 0,u=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(a(t))return u?u.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},7561:(e,t,n)=>{var r=n(7990),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},7518:e=>{e.exports=function(e){return function(t){return e(t)}}},7415:(e,t,n)=>{var r=n(9932);e.exports=function(e,t){return r(t,(function(t){return e[t]}))}},4757:e=>{e.exports=function(e,t){return e.has(t)}},1811:(e,t,n)=>{var r=n(1469),i=n(5403),o=n(5514),a=n(9833);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(a(e))}},4318:(e,t,n)=>{var r=n(1149);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},4626:(e,t,n)=>{e=n.nmd(e);var r=n(5639),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}},7133:(e,t,n)=>{var r=n(4318);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},6393:(e,t,n)=>{var r=n(3448);e.exports=function(e,t){if(e!==t){var n=void 0!==e,i=null===e,o=e==e,a=r(e),s=void 0!==t,u=null===t,c=t==t,l=r(t);if(!u&&!l&&!a&&e>t||a&&s&&c&&!u&&!l||i&&s&&c||!n&&c||!o)return 1;if(!i&&!a&&!l&&e<t||l&&n&&o&&!i&&!a||u&&n&&o||!s&&o||!c)return-1}return 0}},5022:(e,t,n)=>{var r=n(6393);e.exports=function(e,t,n){for(var i=-1,o=e.criteria,a=t.criteria,s=o.length,u=n.length;++i<s;){var c=r(o[i],a[i]);if(c)return i>=u?c:c*("desc"==n[i]?-1:1)}return e.index-t.index}},278:e=>{e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},8363:(e,t,n)=>{var r=n(4865),i=n(9465);e.exports=function(e,t,n,o){var a=!n;n||(n={});for(var s=-1,u=t.length;++s<u;){var c=t[s],l=o?o(n[c],e[c],c,n,e):void 0;void 0===l&&(l=e[c]),a?i(n,c,l):r(n,c,l)}return n}},4429:(e,t,n)=>{var r=n(5639)["__core-js_shared__"];e.exports=r},1463:(e,t,n)=>{var r=n(5976),i=n(6612);e.exports=function(e){return r((function(t,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(n[0],n[1],s)&&(a=o<3?void 0:a,o=1),t=Object(t);++r<o;){var u=n[r];u&&e(t,u,r,a)}return t}))}},9291:(e,t,n)=>{var r=n(8612);e.exports=function(e,t){return function(n,i){if(null==n)return n;if(!r(n))return e(n,i);for(var o=n.length,a=t?o:-1,s=Object(n);(t?a--:++a<o)&&!1!==i(s[a],a,s););return n}}},5063:e=>{e.exports=function(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var u=a[e?s:++i];if(!1===n(o[u],u,o))break}return t}}},8777:(e,t,n)=>{var r=n(852),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},7114:(e,t,n)=>{var r=n(8668),i=n(2908),o=n(4757);e.exports=function(e,t,n,a,s,u){var c=1&n,l=e.length,p=t.length;if(l!=p&&!(c&&p>l))return!1;var f=u.get(e),d=u.get(t);if(f&&d)return f==t&&d==e;var h=-1,y=!0,v=2&n?new r:void 0;for(u.set(e,t),u.set(t,e);++h<l;){var m=e[h],g=t[h];if(a)var b=c?a(g,m,h,t,e,u):a(m,g,h,e,t,u);if(void 0!==b){if(b)continue;y=!1;break}if(v){if(!i(t,(function(e,t){if(!o(v,t)&&(m===e||s(m,e,n,a,u)))return v.push(t)}))){y=!1;break}}else if(m!==g&&!s(m,g,n,a,u)){y=!1;break}}return u.delete(e),u.delete(t),y}},8351:(e,t,n)=>{var r=n(2705),i=n(1149),o=n(7813),a=n(7114),s=n(8776),u=n(1814),c=r?r.prototype:void 0,l=c?c.valueOf:void 0;e.exports=function(e,t,n,r,c,p,f){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!p(new i(e),new i(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var d=s;case"[object Set]":var h=1&r;if(d||(d=u),e.size!=t.size&&!h)return!1;var y=f.get(e);if(y)return y==t;r|=2,f.set(e,t);var v=a(d(e),d(t),r,c,p,f);return f.delete(e),v;case"[object Symbol]":if(l)return l.call(e)==l.call(t)}return!1}},6096:(e,t,n)=>{var r=n(8234),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,a,s){var u=1&n,c=r(e),l=c.length;if(l!=r(t).length&&!u)return!1;for(var p=l;p--;){var f=c[p];if(!(u?f in t:i.call(t,f)))return!1}var d=s.get(e),h=s.get(t);if(d&&h)return d==t&&h==e;var y=!0;s.set(e,t),s.set(t,e);for(var v=u;++p<l;){var m=e[f=c[p]],g=t[f];if(o)var b=u?o(g,m,f,t,e,s):o(m,g,f,e,t,s);if(!(void 0===b?m===g||a(m,g,n,o,s):b)){y=!1;break}v||(v="constructor"==f)}if(y&&!v){var E=e.constructor,_=t.constructor;E==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof E&&E instanceof E&&"function"==typeof _&&_ instanceof _||(y=!1)}return s.delete(e),s.delete(t),y}},1957:(e,t,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},8234:(e,t,n)=>{var r=n(8866),i=n(9551),o=n(3674);e.exports=function(e){return r(e,o,i)}},5050:(e,t,n)=>{var r=n(7019);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},1499:(e,t,n)=>{var r=n(9162),i=n(3674);e.exports=function(e){for(var t=i(e),n=t.length;n--;){var o=t[n],a=e[o];t[n]=[o,a,r(a)]}return t}},852:(e,t,n)=>{var r=n(8458),i=n(7801);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},5924:(e,t,n)=>{var r=n(5569)(Object.getPrototypeOf,Object);e.exports=r},9607:(e,t,n)=>{var r=n(2705),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var i=a.call(e);return r&&(t?e[s]=n:delete e[s]),i}},9551:(e,t,n)=>{var r=n(4963),i=n(479),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return o.call(e,t)})))}:i;e.exports=s},4160:(e,t,n)=>{var r=n(8552),i=n(7071),o=n(3818),a=n(8525),s=n(577),u=n(4239),c=n(346),l="[object Map]",p="[object Promise]",f="[object Set]",d="[object WeakMap]",h="[object DataView]",y=c(r),v=c(i),m=c(o),g=c(a),b=c(s),E=u;(r&&E(new r(new ArrayBuffer(1)))!=h||i&&E(new i)!=l||o&&E(o.resolve())!=p||a&&E(new a)!=f||s&&E(new s)!=d)&&(E=function(e){var t=u(e),n="[object Object]"==t?e.constructor:void 0,r=n?c(n):"";if(r)switch(r){case y:return h;case v:return l;case m:return p;case g:return f;case b:return d}return t}),e.exports=E},7801:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},222:(e,t,n)=>{var r=n(1811),i=n(5694),o=n(1469),a=n(5776),s=n(1780),u=n(327);e.exports=function(e,t,n){for(var c=-1,l=(t=r(t,e)).length,p=!1;++c<l;){var f=u(t[c]);if(!(p=null!=e&&n(e,f)))break;e=e[f]}return p||++c!=l?p:!!(l=null==e?0:e.length)&&s(l)&&a(f,l)&&(o(e)||i(e))}},1789:(e,t,n)=>{var r=n(4536);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},401:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},7667:(e,t,n)=>{var r=n(4536),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(t,e)?t[e]:void 0}},1327:(e,t,n)=>{var r=n(4536),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},1866:(e,t,n)=>{var r=n(4536);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},8517:(e,t,n)=>{var r=n(3118),i=n(5924),o=n(5726);e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:r(i(e))}},7285:(e,t,n)=>{var r=n(2705),i=n(5694),o=n(1469),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return o(e)||i(e)||!!(a&&e&&e[a])}},5776:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e<n}},6612:(e,t,n)=>{var r=n(7813),i=n(8612),o=n(5776),a=n(3218);e.exports=function(e,t,n){if(!a(n))return!1;var s=typeof t;return!!("number"==s?i(n)&&o(t,n.length):"string"==s&&t in n)&&r(n[t],e)}},5403:(e,t,n)=>{var r=n(1469),i=n(3448),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||a.test(e)||!o.test(e)||null!=t&&e in Object(t)}},7019:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},5346:(e,t,n)=>{var r,i=n(4429),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},5726:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},9162:(e,t,n)=>{var r=n(3218);e.exports=function(e){return e==e&&!r(e)}},7040:e=>{e.exports=function(){this.__data__=[],this.size=0}},4125:(e,t,n)=>{var r=n(8470),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():i.call(t,n,1),--this.size,0))}},2117:(e,t,n)=>{var r=n(8470);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},7529:(e,t,n)=>{var r=n(8470);e.exports=function(e){return r(this.__data__,e)>-1}},4705:(e,t,n)=>{var r=n(8470);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},4785:(e,t,n)=>{var r=n(1989),i=n(8407),o=n(7071);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},1285:(e,t,n)=>{var r=n(5050);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},6e3:(e,t,n)=>{var r=n(5050);e.exports=function(e){return r(this,e).get(e)}},9916:(e,t,n)=>{var r=n(5050);e.exports=function(e){return r(this,e).has(e)}},5265:(e,t,n)=>{var r=n(5050);e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},8776:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},2634:e=>{e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},4523:(e,t,n)=>{var r=n(8306);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},4536:(e,t,n)=>{var r=n(852)(Object,"create");e.exports=r},6916:(e,t,n)=>{var r=n(5569)(Object.keys,Object);e.exports=r},3498:e=>{e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},1167:(e,t,n)=>{e=n.nmd(e);var r=n(1957),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i&&r.process,s=function(){try{return o&&o.require&&o.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s},2333:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5569:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},5357:(e,t,n)=>{var r=n(6874),i=Math.max;e.exports=function(e,t,n){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,a=-1,s=i(o.length-t,0),u=Array(s);++a<s;)u[a]=o[t+a];a=-1;for(var c=Array(t+1);++a<t;)c[a]=o[a];return c[t]=n(u),r(e,this,c)}}},5639:(e,t,n)=>{var r=n(1957),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},6390:e=>{e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},619:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},2385:e=>{e.exports=function(e){return this.__data__.has(e)}},1814:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},61:(e,t,n)=>{var r=n(6560),i=n(1275)(r);e.exports=i},1275:e=>{var t=Date.now;e.exports=function(e){var n=0,r=0;return function(){var i=t(),o=16-(i-r);if(r=i,o>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},7465:(e,t,n)=>{var r=n(8407);e.exports=function(){this.__data__=new r,this.size=0}},3779:e=>{e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},7599:e=>{e.exports=function(e){return this.__data__.get(e)}},4758:e=>{e.exports=function(e){return this.__data__.has(e)}},4309:(e,t,n)=>{var r=n(8407),i=n(7071),o=n(3369);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(e,t),this.size=n.size,this}},2351:e=>{e.exports=function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}},5514:(e,t,n)=>{var r=n(4523),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,a=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,n,r,i){t.push(r?i.replace(o,"$1"):n||e)})),t}));e.exports=a},327:(e,t,n)=>{var r=n(3448);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},346:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},7990:e=>{var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},5703:e=>{e.exports=function(e){return function(){return e}}},7813:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},7361:(e,t,n)=>{var r=n(7786);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},9095:(e,t,n)=>{var r=n(13),i=n(222);e.exports=function(e,t){return null!=e&&i(e,t,r)}},6557:e=>{e.exports=function(e){return e}},4721:(e,t,n)=>{var r=n(2118),i=n(8612),o=n(7037),a=n(554),s=n(2628),u=Math.max;e.exports=function(e,t,n,c){e=i(e)?e:s(e),n=n&&!c?a(n):0;var l=e.length;return n<0&&(n=u(l+n,0)),o(e)?n<=l&&e.indexOf(t,n)>-1:!!l&&r(e,t,n)>-1}},5694:(e,t,n)=>{var r=n(9454),i=n(7005),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=u},1469:e=>{var t=Array.isArray;e.exports=t},8612:(e,t,n)=>{var r=n(3560),i=n(1780);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},9246:(e,t,n)=>{var r=n(8612),i=n(7005);e.exports=function(e){return i(e)&&r(e)}},4144:(e,t,n)=>{e=n.nmd(e);var r=n(5639),i=n(5062),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,s=a&&a.exports===o?r.Buffer:void 0,u=(s?s.isBuffer:void 0)||i;e.exports=u},1609:(e,t,n)=>{var r=n(280),i=n(4160),o=n(5694),a=n(1469),s=n(8612),u=n(4144),c=n(5726),l=n(6719),p=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(s(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||u(e)||l(e)||o(e)))return!e.length;var t=i(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(c(e))return!r(e).length;for(var n in e)if(p.call(e,n))return!1;return!0}},3560:(e,t,n)=>{var r=n(4239),i=n(3218);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1780:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},3218:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},7005:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},8630:(e,t,n)=>{var r=n(4239),i=n(5924),o=n(7005),a=Function.prototype,s=Object.prototype,u=a.toString,c=s.hasOwnProperty,l=u.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=r(e))return!1;var t=i(e);if(null===t)return!0;var n=c.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&u.call(n)==l}},7037:(e,t,n)=>{var r=n(4239),i=n(1469),o=n(7005);e.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&"[object String]"==r(e)}},3448:(e,t,n)=>{var r=n(4239),i=n(7005);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},6719:(e,t,n)=>{var r=n(8749),i=n(7518),o=n(1167),a=o&&o.isTypedArray,s=a?i(a):r;e.exports=s},3674:(e,t,n)=>{var r=n(4636),i=n(280),o=n(8612);e.exports=function(e){return o(e)?r(e):i(e)}},1704:(e,t,n)=>{var r=n(4636),i=n(313),o=n(8612);e.exports=function(e){return o(e)?r(e,!0):i(e)}},5161:(e,t,n)=>{var r=n(9932),i=n(7206),o=n(9199),a=n(1469);e.exports=function(e,t){return(a(e)?r:o)(e,i(t,3))}},8306:(e,t,n)=>{var r=n(3369);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},2492:(e,t,n)=>{var r=n(2980),i=n(1463)((function(e,t,n){r(e,t,n)}));e.exports=i},9601:(e,t,n)=>{var r=n(371),i=n(9152),o=n(5403),a=n(327);e.exports=function(e){return o(e)?r(a(e)):i(e)}},9734:(e,t,n)=>{var r=n(1078),i=n(2689),o=n(5976),a=n(6612),s=o((function(e,t){if(null==e)return[];var n=t.length;return n>1&&a(e,t[0],t[1])?t=[]:n>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),i(e,r(t,1),[])}));e.exports=s},479:e=>{e.exports=function(){return[]}},5062:e=>{e.exports=function(){return!1}},8601:(e,t,n)=>{var r=n(4841);e.exports=function(e){return e?Infinity===(e=r(e))||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},554:(e,t,n)=>{var r=n(8601);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},4841:(e,t,n)=>{var r=n(7561),i=n(3218),o=n(3448),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||u.test(e)?c(e.slice(2),n?2:8):a.test(e)?NaN:+e}},9881:(e,t,n)=>{var r=n(8363),i=n(1704);e.exports=function(e){return r(e,i(e))}},9833:(e,t,n)=>{var r=n(531);e.exports=function(e){return null==e?"":r(e)}},2628:(e,t,n)=>{var r=n(7415),i=n(3674);e.exports=function(e){return null==e?[]:r(e,i(e))}},7984:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AccessDeniedReason:()=>ce,BOOLEAN_DEFAULT_FALLBACK_ENTITLEMENT:()=>he,BillingModel:()=>l,BillingPeriod:()=>p,Currency:()=>v,CustomerModel:()=>me,EntitlementResetPeriod:()=>fe,FeatureType:()=>le,LogLevel:()=>r,METERED_DEFAULT_FALLBACK_ENTITLEMENT:()=>ve,MeterType:()=>pe,NUMERIC_DEFAULT_FALLBACK_ENTITLEMENT:()=>ye,PricingType:()=>V,PromotionalEntitlementStatus:()=>G,SubscriptionStatus:()=>te,TrialPeriodUnits:()=>oe,default:()=>Ns});var r,i=n(4721),o=n.n(i);!function(e){e.ALL="ALL",e.NONE="NONE",e.LOG="LOG",e.ERROR="ERROR"}(r||(r={}));var a,s,u,c,l,p,f,d,h,y,v,m,g,b,E,_,w,I,T,O,S,D,x,A,k,N,P,C,R,F,M,j,U,L,q,V,B,Q,z,G,$,W,K,H,Y,J,X,Z,ee,te,ne,re,ie,oe,ae,se,ue,ce,le,pe,fe,de=function(){function e(e,t){this.logger=e,this.logLevel=t}return e.prototype.error=function(e,t){this.logLevel!==r.NONE&&this.logger.error(e,t||{})},e.prototype.log=function(e,t){o()([r.ERROR,r.NONE],this.logLevel)||this.logger.log(e,t||{})},e.prototype.debug=function(e,t){o()([r.LOG,r.ALL],this.logLevel)&&this.logger.debug(e,t||{})},e}();!function(e){e.CustomerNotFound="CustomerNotFound",e.FeatureNotFound="FeatureNotFound",e.NoActiveSubscription="NoActiveSubscription",e.NoFeatureEntitlementInSubscription="NoFeatureEntitlementInSubscription",e.RequestedUsageExceedingLimit="RequestedUsageExceedingLimit",e.Unknown="Unknown"}(a||(a={})),function(e){e.BillingId="billingId",e.CreatedAt="createdAt",e.Description="description",e.DisplayName="displayName",e.EnvironmentId="environmentId",e.Id="id",e.IsLatest="isLatest",e.PricingType="pricingType",e.ProductId="productId",e.RefId="refId",e.Status="status",e.UpdatedAt="updatedAt",e.VersionNumber="versionNumber"}(s||(s={})),function(e){e.Id="id"}(u||(u={})),function(e){e.Client="CLIENT",e.Server="SERVER"}(c||(c={})),function(e){e.FlatFee="FLAT_FEE",e.PerUnit="PER_UNIT",e.UsageBased="USAGE_BASED"}(l||(l={})),function(e){e.Annually="ANNUALLY",e.Monthly="MONTHLY"}(p||(p={})),function(e){e.Added="ADDED",e.Deleted="DELETED",e.Modified="MODIFIED"}(f||(f={})),function(e){e.BillingId="billingId",e.CreatedAt="createdAt",e.Description="description",e.EnvironmentId="environmentId",e.Id="id",e.Name="name",e.RefId="refId",e.Status="status",e.Type="type",e.UpdatedAt="updatedAt"}(d||(d={})),function(e){e.Active="ACTIVE",e.Archived="ARCHIVED"}(h||(h={})),function(e){e.Fixed="FIXED",e.Percentage="PERCENTAGE"}(y||(y={})),function(e){e.Usd="USD"}(v||(v={})),function(e){e.BillingId="billingId",e.CreatedAt="createdAt",e.CrmHubspotCompanyId="crmHubspotCompanyId",e.CrmHubspotCompanyUrl="crmHubspotCompanyUrl",e.CrmId="crmId",e.Email="email",e.EnvironmentId="environmentId",e.Id="id",e.Name="name",e.RefId="refId",e.UpdatedAt="updatedAt"}(m||(m={})),function(e){e.BillingId="billingId",e.CancelReason="cancelReason",e.CancellationDate="cancellationDate",e.CreatedAt="createdAt",e.CrmId="crmId",e.CrmLinkUrl="crmLinkUrl",e.EffectiveEndDate="effectiveEndDate",e.EndDate="endDate",e.EnvironmentId="environmentId",e.Id="id",e.PricingType="pricingType",e.RefId="refId",e.StartDate="startDate",e.Status="status",e.TrialEndDate="trialEndDate"}(g||(g={})),function(e){e.Day="DAY",e.Hour="HOUR",e.Month="MONTH",e.Week="WEEK"}(b||(b={})),function(e){e.BlackList="BLACK_LIST",e.WhiteList="WHITE_LIST"}(E||(E={})),function(e){e.CreatedAt="createdAt",e.DisplayName="displayName",e.Id="id",e.Slug="slug"}(_||(_={})),function(e){e.AddonHasToHavePriceError="AddonHasToHavePriceError",e.AddonNotFound="AddonNotFound",e.ArchivedCouponCantBeApplied="ArchivedCouponCantBeApplied",e.BadUserInput="BadUserInput",e.BillingPeriodMissingError="BillingPeriodMissingError",e.CheckoutIsNotSupported="CheckoutIsNotSupported",e.CouponNotFound="CouponNotFound",e.CustomerHasNoPaymentMethod="CustomerHasNoPaymentMethod",e.CustomerNoBillingId="CustomerNoBillingId",e.CustomerNotFound="CustomerNotFound",e.DraftPlanCantBeArchived="DraftPlanCantBeArchived",e.DuplicatedEntityNotAllowed="DuplicatedEntityNotAllowed",e.EditAllowedOnDraftPackageOnlyError="EditAllowedOnDraftPackageOnlyError",e.EnvironmentMissing="EnvironmentMissing",e.FailedToImportCustomer="FailedToImportCustomer",e.FeatureNotFound="FeatureNotFound",e.IdentityForbidden="IdentityForbidden",e.ImportAlreadyInProgress="ImportAlreadyInProgress",e.InitStripePaymentMethodError="InitStripePaymentMethodError",e.IntegrationNotFound="IntegrationNotFound",e.IntegrityViolation="IntegrityViolation",e.InvalidAddressError="InvalidAddressError",e.InvalidArgumentError="InvalidArgumentError",e.InvalidCancellationDate="InvalidCancellationDate",e.InvalidEntitlementResetPeriod="InvalidEntitlementResetPeriod",e.InvalidMemberDelete="InvalidMemberDelete",e.InvalidQuantity="InvalidQuantity",e.InvalidSubscriptionStatus="InvalidSubscriptionStatus",e.InvalidUsageValueForIncrementalFeatureError="InvalidUsageValueForIncrementalFeatureError",e.MemberInvitationError="MemberInvitationError",e.MemberNotFound="MemberNotFound",e.MeteringNotAvailableForFeatureType="MeteringNotAvailableForFeatureType",e.NoFeatureEntitlementInSubscription="NoFeatureEntitlementInSubscription",e.PackageAlreadyPublished="PackageAlreadyPublished",e.PackagePricingTypeNotSet="PackagePricingTypeNotSet",e.PlanAlreadyExtended="PlanAlreadyExtended",e.PlanNotFound="PlanNotFound",e.PlanWithChildCantBeDeleted="PlanWithChildCantBeDeleted",e.PlansCircularDependencyError="PlansCircularDependencyError",e.PriceNotFound="PriceNotFound",e.RateLimitExceeded="RateLimitExceeded",e.ResyncAlreadyInProgress="ResyncAlreadyInProgress",e.SelectedBillingModelDoesntMatchImportedItemError="SelectedBillingModelDoesntMatchImportedItemError",e.StripeCustomerIsDeleted="StripeCustomerIsDeleted",e.SubscriptionAlreadyCanceledOrExpired="SubscriptionAlreadyCanceledOrExpired",e.SubscriptionMustHaveSinglePlanError="SubscriptionMustHaveSinglePlanError",e.SubscriptionNotFound="SubscriptionNotFound",e.TrialMinDateError="TrialMinDateError",e.TrialMustBeCancelledImmediately="TrialMustBeCancelledImmediately",e.TrialsNotAllowedInProduct="TrialsNotAllowedInProduct",e.UnPublishedPackage="UnPublishedPackage",e.Unauthenticated="Unauthenticated",e.UncompatibleSubscriptionAddon="UncompatibleSubscriptionAddon",e.UnexpectedError="UnexpectedError",e.UnsupportedFeatureType="UnsupportedFeatureType",e.UnsupportedVendorIdentifier="UnsupportedVendorIdentifier"}(w||(w={})),function(e){e.AddonCreated="ADDON_CREATED",e.AddonDeleted="ADDON_DELETED",e.AddonUpdated="ADDON_UPDATED",e.CouponArchived="COUPON_ARCHIVED",e.CouponCreated="COUPON_CREATED",e.CouponUpdated="COUPON_UPDATED",e.CustomerCreated="CUSTOMER_CREATED",e.CustomerDeleted="CUSTOMER_DELETED",e.CustomerUpdated="CUSTOMER_UPDATED",e.EntitlementsUpdated="ENTITLEMENTS_UPDATED",e.EntitlementDenied="ENTITLEMENT_DENIED",e.EntitlementGranted="ENTITLEMENT_GRANTED",e.EntitlementRequested="ENTITLEMENT_REQUESTED",e.FeatureCreated="FEATURE_CREATED",e.FeatureDeleted="FEATURE_DELETED",e.FeatureUpdated="FEATURE_UPDATED",e.ImportIntegrationCatalogTriggered="IMPORT_INTEGRATION_CATALOG_TRIGGERED",e.ImportIntegrationCustomersTriggered="IMPORT_INTEGRATION_CUSTOMERS_TRIGGERED",e.MeasurementReported="MEASUREMENT_REPORTED",e.PackagePublished="PACKAGE_PUBLISHED",e.PlanCreated="PLAN_CREATED",e.PlanDeleted="PLAN_DELETED",e.PlanUpdated="PLAN_UPDATED",e.PromotionalEntitlementExpired="PROMOTIONAL_ENTITLEMENT_EXPIRED",e.PromotionalEntitlementGranted="PROMOTIONAL_ENTITLEMENT_GRANTED",e.PromotionalEntitlementRevoked="PROMOTIONAL_ENTITLEMENT_REVOKED",e.PromotionalEntitlementUpdated="PROMOTIONAL_ENTITLEMENT_UPDATED",e.ResyncIntegrationTriggered="RESYNC_INTEGRATION_TRIGGERED",e.SubscriptionCanceled="SUBSCRIPTION_CANCELED",e.SubscriptionCreated="SUBSCRIPTION_CREATED",e.SubscriptionExpired="SUBSCRIPTION_EXPIRED",e.SubscriptionTrialConverted="SUBSCRIPTION_TRIAL_CONVERTED",e.SubscriptionTrialEndsSoon="SUBSCRIPTION_TRIAL_ENDS_SOON",e.SubscriptionTrialExpired="SUBSCRIPTION_TRIAL_EXPIRED",e.SubscriptionTrialStarted="SUBSCRIPTION_TRIAL_STARTED",e.SubscriptionUpdated="SUBSCRIPTION_UPDATED",e.SubscriptionUsageUpdated="SUBSCRIPTION_USAGE_UPDATED"}(I||(I={})),function(e){e.CreatedAt="createdAt",e.Description="description",e.DisplayName="displayName",e.EnvironmentId="environmentId",e.FeatureStatus="featureStatus",e.FeatureType="featureType",e.Id="id",e.MeterType="meterType",e.RefId="refId",e.UpdatedAt="updatedAt"}(T||(T={})),function(e){e.Active="ACTIVE",e.New="NEW",e.Suspended="SUSPENDED"}(O||(O={})),function(e){e.Boolean="BOOLEAN",e.Number="NUMBER"}(S||(S={})),function(e){e.CreatedAt="createdAt",e.Endpoint="endpoint",e.EnvironmentId="environmentId",e.Id="id",e.Status="status"}(D||(D={})),function(e){e.Active="ACTIVE",e.Inactive="INACTIVE"}(x||(x={})),function(e){e.CreatedAt="createdAt",e.EnvironmentId="environmentId",e.Id="id",e.Status="status",e.TaskType="taskType"}(A||(A={})),function(e){e.CreatedAt="createdAt",e.EnvironmentId="environmentId",e.Id="id",e.VendorIdentifier="vendorIdentifier"}(k||(k={})),function(e){e.CreatedAt="createdAt",e.Id="id"}(N||(N={})),function(e){e.Invited="INVITED",e.Registered="REGISTERED"}(P||(P={})),function(e){e.Fluctuating="Fluctuating",e.Incremental="Incremental",e.None="None"}(C||(C={})),function(e){e.StartOfTheMonth="StartOfTheMonth",e.SubscriptionStart="SubscriptionStart"}(R||(R={})),function(e){e.BillingId="billingId",e.CreatedAt="createdAt",e.Description="description",e.DisplayName="displayName",e.EnvironmentId="environmentId",e.Id="id",e.IsLatest="isLatest",e.PricingType="pricingType",e.ProductId="productId",e.RefId="refId",e.Status="status",e.UpdatedAt="updatedAt",e.VersionNumber="versionNumber"}(F||(F={})),function(e){e.CreatedAt="createdAt",e.EnvironmentId="environmentId",e.Id="id",e.PackageId="packageId",e.UpdatedAt="updatedAt"}(M||(M={})),function(e){e.Archived="ARCHIVED",e.Draft="DRAFT",e.Published="PUBLISHED"}(j||(j={})),function(e){e.Bank="BANK",e.Card="CARD"}(U||(U={})),function(e){e.BillingId="billingId",e.CreatedAt="createdAt",e.Description="description",e.DisplayName="displayName",e.EnvironmentId="environmentId",e.Id="id",e.IsLatest="isLatest",e.PricingType="pricingType",e.ProductId="productId",e.RefId="refId",e.Status="status",e.UpdatedAt="updatedAt",e.VersionNumber="versionNumber"}(L||(L={})),function(e){e.BillingModel="billingModel",e.BillingPeriod="billingPeriod",e.CreatedAt="createdAt",e.Id="id"}(q||(q={})),function(e){e.Custom="CUSTOM",e.Free="FREE",e.Paid="PAID"}(V||(V={})),function(e){e.CreatedAt="createdAt",e.Description="description",e.DisplayName="displayName",e.EnvironmentId="environmentId",e.Id="id",e.IsDefaultProduct="isDefaultProduct",e.RefId="refId",e.UpdatedAt="updatedAt"}(B||(B={})),function(e){e.Custom="CUSTOM",e.Lifetime="LIFETIME",e.OneMonth="ONE_MONTH",e.OneWeek="ONE_WEEK",e.OneYear="ONE_YEAR",e.SixMonth="SIX_MONTH"}(Q||(Q={})),function(e){e.CreatedAt="createdAt",e.EnvironmentId="environmentId",e.Id="id",e.Status="status",e.UpdatedAt="updatedAt"}(z||(z={})),function(e){e.Active="Active",e.Expired="Expired",e.Paused="Paused"}(G||(G={})),function(e){e.AllCustomers="ALL_CUSTOMERS",e.NewCustomers="NEW_CUSTOMERS"}($||($={})),function(e){e.Asc="ASC",e.Desc="DESC"}(W||(W={})),function(e){e.NullsFirst="NULLS_FIRST",e.NullsLast="NULLS_LAST"}(K||(K={})),function(e){e.CreatedAt="createdAt",e.Id="id",e.Quantity="quantity",e.UpdatedAt="updatedAt"}(H||(H={})),function(e){e.CancelledByBilling="CancelledByBilling",e.DetachBilling="DetachBilling",e.Expired="Expired",e.Immediate="Immediate",e.PendingPaymentExpired="PendingPaymentExpired",e.ScheduledCancellation="ScheduledCancellation",e.TrialConverted="TrialConverted",e.TrialEnded="TrialEnded",e.UpgradeOrDowngrade="UpgradeOrDowngrade"}(Y||(Y={})),function(e){e.EndOfBillingPeriod="END_OF_BILLING_PERIOD",e.Immediate="IMMEDIATE",e.SpecificDate="SPECIFIC_DATE"}(J||(J={})),function(e){e.CancelSubscription="CANCEL_SUBSCRIPTION",e.DowngradeToFree="DOWNGRADE_TO_FREE"}(X||(X={})),function(e){e.CreatedAt="createdAt",e.EnvironmentId="environmentId",e.Id="id",e.Status="status",e.TaskType="taskType"}(Z||(Z={})),function(e){e.CreatedAt="createdAt",e.Id="id",e.UpdatedAt="updatedAt",e.UsageLimit="usageLimit"}(ee||(ee={})),function(e){e.Active="ACTIVE",e.Canceled="CANCELED",e.Expired="EXPIRED",e.InTrial="IN_TRIAL",e.NotStarted="NOT_STARTED",e.PaymentPending="PAYMENT_PENDING"}(te||(te={})),function(e){e.Error="ERROR",e.NoSyncRequired="NO_SYNC_REQUIRED",e.Pending="PENDING",e.Success="SUCCESS"}(ne||(ne={})),function(e){e.Completed="COMPLETED",e.Failed="FAILED",e.InProgress="IN_PROGRESS",e.PartiallyFailed="PARTIALLY_FAILED",e.Pending="PENDING"}(re||(re={})),function(e){e.ImportIntegrationCatalog="IMPORT_INTEGRATION_CATALOG",e.ImportIntegrationCustomers="IMPORT_INTEGRATION_CUSTOMERS",e.ResyncIntegration="RESYNC_INTEGRATION",e.SubscriptionMigration="SUBSCRIPTION_MIGRATION"}(ie||(ie={})),function(e){e.Day="DAY",e.Month="MONTH"}(oe||(oe={})),function(e){e.CreatedAt="createdAt",e.EnvironmentId="environmentId",e.Id="id"}(ae||(ae={})),function(e){e.Hubspot="HUBSPOT",e.Stripe="STRIPE",e.Zuora="ZUORA"}(se||(se={})),function(e){e.EveryFriday="EveryFriday",e.EveryMonday="EveryMonday",e.EverySaturday="EverySaturday",e.EverySunday="EverySunday",e.EveryThursday="EveryThursday",e.EveryTuesday="EveryTuesday",e.EveryWednesday="EveryWednesday",e.SubscriptionStart="SubscriptionStart"}(ue||(ue={})),function(e){e.InvalidFeatureType="InvalidFeatureType",e.CustomerNotFound="CustomerNotFound",e.FeatureNotFound="FeatureNotFound",e.NoActiveSubscriptions="NoActiveSubscriptions",e.CustomerNotEntitledForFeature="CustomerNotEntitledForFeature",e.RequestedUsageExceedsLimit="RequestedUsageExceedsLimit",e.Unknown="Unknown"}(ce||(ce={})),function(e){e.Boolean="Boolean",e.Numeric="Numeric"}(le||(le={})),function(e){e.Fluctuating="Fluctuating",e.Incremental="Incremental",e.None="None"}(pe||(pe={})),function(e){e.Daily="Daily",e.Hourly="Hourly",e.Monthly="Monthly",e.Weekly="Weekly"}(fe||(fe={}));var he={isFallback:!0,hasAccess:!1,accessDeniedReason:ce.Unknown},ye={isFallback:!0,hasAccess:!1,isUnlimited:!1,accessDeniedReason:ce.Unknown},ve={isFallback:!0,hasAccess:!1,isUnlimited:!1,currentUsage:0,requestedUsage:1,accessDeniedReason:ce.Unknown},me=function(){function e(e){Object.assign(this,e)}return e.prototype.getActiveSubscriptions=function(){return this.subscriptions.filter((function(e){return e.status===te.Active}))},e.prototype.getActiveTrials=function(){return this.subscriptions.filter((function(e){return e.status===te.InTrial}))},e.prototype.getActivePromotionalEntitlements=function(){return this.promotionalEntitlements.filter((function(e){return e.status===G.Active}))},e}(),ge=function(e,t){return ge=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},ge(e,t)};function be(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}ge(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Ee=function(){return Ee=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ee.apply(this,arguments)};function _e(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function we(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function Ie(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function Te(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function Oe(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}Object.create,Object.create;const Se=/\r\n|[\n\r]/g;function De(e,t){let n=0,r=1;for(const i of e.body.matchAll(Se)){if("number"==typeof i.index||Oe(!1),i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}function xe(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,a=t.line+o,s=1===t.line?n:0,u=t.column+s,c=`${e.name}:${a}:${u}\n`,l=r.split(/\r\n|[\n\r]/g),p=l[i];if(p.length>120){const e=Math.floor(u/80),t=u%80,n=[];for(let e=0;e<p.length;e+=80)n.push(p.slice(e,e+80));return c+Ae([[`${a} |`,n[0]],...n.slice(1,e+1).map((e=>["|",e])),["|","^".padStart(t)],["|",n[e+1]]])}return c+Ae([[a-1+" |",l[i-1]],[`${a} |`,p],["|","^".padStart(u)],[`${a+1} |`,l[i+1]]])}function Ae(e){const t=e.filter((([e,t])=>void 0!==t)),n=Math.max(...t.map((([e])=>e.length)));return t.map((([e,t])=>e.padStart(n)+(t?" "+t:""))).join("\n")}class ke extends Error{constructor(e,t,n,r,i,o,a){var s,u,c;super(e),this.name="GraphQLError",this.path=null!=i?i:void 0,this.originalError=null!=o?o:void 0,this.nodes=Ne(Array.isArray(t)?t:t?[t]:void 0);const l=Ne(null===(s=this.nodes)||void 0===s?void 0:s.map((e=>e.loc)).filter((e=>null!=e)));this.source=null!=n?n:null==l||null===(u=l[0])||void 0===u?void 0:u.source,this.positions=null!=r?r:null==l?void 0:l.map((e=>e.start)),this.locations=r&&n?r.map((e=>De(n,e))):null==l?void 0:l.map((e=>De(e.source,e.start)));const p="object"==typeof(f=null==o?void 0:o.extensions)&&null!==f?null==o?void 0:o.extensions:void 0;var f;this.extensions=null!==(c=null!=a?a:p)&&void 0!==c?c:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=o&&o.stack?Object.defineProperty(this,"stack",{value:o.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,ke):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(e+="\n\n"+xe((t=n.loc).source,De(t.source,t.start)));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+xe(this.source,t);var t;return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function Ne(e){return void 0===e||0===e.length?void 0:e}function Pe(e,t,n){return new ke(`Syntax Error: ${n}`,void 0,e,[t])}let Ce;var Re;(Re=Ce||(Ce={})).NAME="Name",Re.DOCUMENT="Document",Re.OPERATION_DEFINITION="OperationDefinition",Re.VARIABLE_DEFINITION="VariableDefinition",Re.SELECTION_SET="SelectionSet",Re.FIELD="Field",Re.ARGUMENT="Argument",Re.FRAGMENT_SPREAD="FragmentSpread",Re.INLINE_FRAGMENT="InlineFragment",Re.FRAGMENT_DEFINITION="FragmentDefinition",Re.VARIABLE="Variable",Re.INT="IntValue",Re.FLOAT="FloatValue",Re.STRING="StringValue",Re.BOOLEAN="BooleanValue",Re.NULL="NullValue",Re.ENUM="EnumValue",Re.LIST="ListValue",Re.OBJECT="ObjectValue",Re.OBJECT_FIELD="ObjectField",Re.DIRECTIVE="Directive",Re.NAMED_TYPE="NamedType",Re.LIST_TYPE="ListType",Re.NON_NULL_TYPE="NonNullType",Re.SCHEMA_DEFINITION="SchemaDefinition",Re.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",Re.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",Re.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",Re.FIELD_DEFINITION="FieldDefinition",Re.INPUT_VALUE_DEFINITION="InputValueDefinition",Re.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",Re.UNION_TYPE_DEFINITION="UnionTypeDefinition",Re.ENUM_TYPE_DEFINITION="EnumTypeDefinition",Re.ENUM_VALUE_DEFINITION="EnumValueDefinition",Re.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",Re.DIRECTIVE_DEFINITION="DirectiveDefinition",Re.SCHEMA_EXTENSION="SchemaExtension",Re.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",Re.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",Re.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",Re.UNION_TYPE_EXTENSION="UnionTypeExtension",Re.ENUM_TYPE_EXTENSION="EnumTypeExtension",Re.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension";class Fe{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class Me{constructor(e,t,n,r,i,o){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const je={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},Ue=new Set(Object.keys(je));function Le(e){const t=null==e?void 0:e.kind;return"string"==typeof t&&Ue.has(t)}let qe,Ve;var Be;function Qe(e){return ze(e,[])}function ze(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const n=[...t,e];if(function(e){return"function"==typeof e.toJSON}(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:ze(t,n)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";const n=Math.min(10,e.length),r=e.length-n,i=[];for(let r=0;r<n;++r)i.push(ze(e[r],t));return 1===r?i.push("... 1 more item"):r>1&&i.push(`... ${r} more items`),"["+i.join(", ")+"]"}(e,n);return function(e,t){const n=Object.entries(e);if(0===n.length)return"{}";if(t.length>2)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const r=n.map((([e,n])=>e+": "+ze(n,t)));return"{ "+r.join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}function Ge(e,t){if(!Boolean(e))throw new Error(t)}!function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"}(qe||(qe={})),(Be=Ve||(Ve={})).SOF="<SOF>",Be.EOF="<EOF>",Be.BANG="!",Be.DOLLAR="$",Be.AMP="&",Be.PAREN_L="(",Be.PAREN_R=")",Be.SPREAD="...",Be.COLON=":",Be.EQUALS="=",Be.AT="@",Be.BRACKET_L="[",Be.BRACKET_R="]",Be.BRACE_L="{",Be.PIPE="|",Be.BRACE_R="}",Be.NAME="Name",Be.INT="Int",Be.FLOAT="Float",Be.STRING="String",Be.BLOCK_STRING="BlockString",Be.COMMENT="Comment";class $e{constructor(e,t="GraphQL request",n={line:1,column:1}){"string"==typeof e||Ge(!1,`Body must be a string. Received: ${Qe(e)}.`),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||Ge(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Ge(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}let We;function Ke(e){const t=e.split(/\r\n|[\n\r]/g),n=function(e){var t;let n=!0,r=!0,i=0,o=null;for(let t=0;t<e.length;++t)switch(e.charCodeAt(t)){case 13:10===e.charCodeAt(t+1)&&++t;case 10:n=!1,r=!0,i=0;break;case 9:case 32:++i;break;default:r&&!n&&(null===o||i<o)&&(o=i),r=!1}return null!==(t=o)&&void 0!==t?t:0}(e);if(0!==n)for(let e=1;e<t.length;e++)t[e]=t[e].slice(n);let r=0;for(;r<t.length&&He(t[r]);)++r;let i=t.length;for(;i>r&&He(t[i-1]);)--i;return t.slice(r,i).join("\n")}function He(e){for(const t of e)if(" "!==t&&"\t"!==t)return!1;return!0}function Ye(e){return e>=48&&e<=57}function Je(e){return e>=97&&e<=122||e>=65&&e<=90}function Xe(e){return Je(e)||95===e}!function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"}(We||(We={}));class Ze{constructor(e){const t=new Me(Ve.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==Ve.EOF)do{if(e.next)e=e.next;else{const t=at(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===Ve.COMMENT);return e}}function et(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function tt(e,t){return nt(e.charCodeAt(t))&&rt(e.charCodeAt(t+1))}function nt(e){return e>=55296&&e<=56319}function rt(e){return e>=56320&&e<=57343}function it(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return Ve.EOF;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function ot(e,t,n,r,i){const o=e.line,a=1+n-e.lineStart;return new Me(t,n,r,o,a,i)}function at(e,t){const n=e.source.body,r=n.length;let i=t;for(;i<r;){const t=n.charCodeAt(i);switch(t){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:10===n.charCodeAt(i+1)?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return st(e,i);case 33:return ot(e,Ve.BANG,i,i+1);case 36:return ot(e,Ve.DOLLAR,i,i+1);case 38:return ot(e,Ve.AMP,i,i+1);case 40:return ot(e,Ve.PAREN_L,i,i+1);case 41:return ot(e,Ve.PAREN_R,i,i+1);case 46:if(46===n.charCodeAt(i+1)&&46===n.charCodeAt(i+2))return ot(e,Ve.SPREAD,i,i+3);break;case 58:return ot(e,Ve.COLON,i,i+1);case 61:return ot(e,Ve.EQUALS,i,i+1);case 64:return ot(e,Ve.AT,i,i+1);case 91:return ot(e,Ve.BRACKET_L,i,i+1);case 93:return ot(e,Ve.BRACKET_R,i,i+1);case 123:return ot(e,Ve.BRACE_L,i,i+1);case 124:return ot(e,Ve.PIPE,i,i+1);case 125:return ot(e,Ve.BRACE_R,i,i+1);case 34:return 34===n.charCodeAt(i+1)&&34===n.charCodeAt(i+2)?vt(e,i):lt(e,i)}if(Ye(t)||45===t)return ut(e,i,t);if(Xe(t))return mt(e,i);throw Pe(e.source,i,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":et(t)||tt(n,i)?`Unexpected character: ${it(e,i)}.`:`Invalid character: ${it(e,i)}.`)}return ot(e,Ve.EOF,r,r)}function st(e,t){const n=e.source.body,r=n.length;let i=t+1;for(;i<r;){const e=n.charCodeAt(i);if(10===e||13===e)break;if(et(e))++i;else{if(!tt(n,i))break;i+=2}}return ot(e,Ve.COMMENT,t,i,n.slice(t+1,i))}function ut(e,t,n){const r=e.source.body;let i=t,o=n,a=!1;if(45===o&&(o=r.charCodeAt(++i)),48===o){if(o=r.charCodeAt(++i),Ye(o))throw Pe(e.source,i,`Invalid number, unexpected digit after 0: ${it(e,i)}.`)}else i=ct(e,i,o),o=r.charCodeAt(i);if(46===o&&(a=!0,o=r.charCodeAt(++i),i=ct(e,i,o),o=r.charCodeAt(i)),69!==o&&101!==o||(a=!0,o=r.charCodeAt(++i),43!==o&&45!==o||(o=r.charCodeAt(++i)),i=ct(e,i,o),o=r.charCodeAt(i)),46===o||Xe(o))throw Pe(e.source,i,`Invalid number, expected digit but got: ${it(e,i)}.`);return ot(e,a?Ve.FLOAT:Ve.INT,t,i,r.slice(t,i))}function ct(e,t,n){if(!Ye(n))throw Pe(e.source,t,`Invalid number, expected digit but got: ${it(e,t)}.`);const r=e.source.body;let i=t+1;for(;Ye(r.charCodeAt(i));)++i;return i}function lt(e,t){const n=e.source.body,r=n.length;let i=t+1,o=i,a="";for(;i<r;){const r=n.charCodeAt(i);if(34===r)return a+=n.slice(o,i),ot(e,Ve.STRING,t,i+1,a);if(92!==r){if(10===r||13===r)break;if(et(r))++i;else{if(!tt(n,i))throw Pe(e.source,i,`Invalid character within String: ${it(e,i)}.`);i+=2}}else{a+=n.slice(o,i);const t=117===n.charCodeAt(i+1)?123===n.charCodeAt(i+2)?pt(e,i):ft(e,i):yt(e,i);a+=t.value,i+=t.size,o=i}}throw Pe(e.source,i,"Unterminated string.")}function pt(e,t){const n=e.source.body;let r=0,i=3;for(;i<12;){const e=n.charCodeAt(t+i++);if(125===e){if(i<5||!et(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|ht(e),r<0)break}throw Pe(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+i)}".`)}function ft(e,t){const n=e.source.body,r=dt(n,t+2);if(et(r))return{value:String.fromCodePoint(r),size:6};if(nt(r)&&92===n.charCodeAt(t+6)&&117===n.charCodeAt(t+7)){const e=dt(n,t+8);if(rt(e))return{value:String.fromCodePoint(r,e),size:12}}throw Pe(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function dt(e,t){return ht(e.charCodeAt(t))<<12|ht(e.charCodeAt(t+1))<<8|ht(e.charCodeAt(t+2))<<4|ht(e.charCodeAt(t+3))}function ht(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function yt(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw Pe(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function vt(e,t){const n=e.source.body,r=n.length,i=e.line,o=1+t-e.lineStart;let a=t+3,s=a,u="";for(;a<r;){const r=n.charCodeAt(a);if(34===r&&34===n.charCodeAt(a+1)&&34===n.charCodeAt(a+2))return u+=n.slice(s,a),new Me(Ve.BLOCK_STRING,t,a+3,i,o,Ke(u));if(92!==r||34!==n.charCodeAt(a+1)||34!==n.charCodeAt(a+2)||34!==n.charCodeAt(a+3))if(10!==r&&13!==r)if(et(r))++a;else{if(!tt(n,a))throw Pe(e.source,a,`Invalid character within String: ${it(e,a)}.`);a+=2}else 13===r&&10===n.charCodeAt(a+1)?a+=2:++a,++e.line,e.lineStart=a;else u+=n.slice(s,a)+'"""',a+=4,s=a}throw Pe(e.source,a,"Unterminated string.")}function mt(e,t){const n=e.source.body,r=n.length;let i=t+1;for(;i<r&&(Je(o=n.charCodeAt(i))||Ye(o)||95===o);)++i;var o;return ot(e,Ve.NAME,t,i,n.slice(t,i))}class gt{constructor(e,t){const n=function(e){return e instanceof $e}(e)?e:new $e(e);this._lexer=new Ze(n),this._options=t}parseName(){const e=this.expectToken(Ve.NAME);return this.node(e,{kind:Ce.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:Ce.DOCUMENT,definitions:this.many(Ve.SOF,this.parseDefinition,Ve.EOF)})}parseDefinition(){if(this.peek(Ve.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===Ve.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw Pe(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(Ve.BRACE_L))return this.node(e,{kind:Ce.OPERATION_DEFINITION,operation:qe.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let n;return this.peek(Ve.NAME)&&(n=this.parseName()),this.node(e,{kind:Ce.OPERATION_DEFINITION,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(Ve.NAME);switch(e.value){case"query":return qe.QUERY;case"mutation":return qe.MUTATION;case"subscription":return qe.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(Ve.PAREN_L,this.parseVariableDefinition,Ve.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:Ce.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(Ve.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(Ve.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(Ve.DOLLAR),this.node(e,{kind:Ce.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:Ce.SELECTION_SET,selections:this.many(Ve.BRACE_L,this.parseSelection,Ve.BRACE_R)})}parseSelection(){return this.peek(Ve.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,r;return this.expectOptionalToken(Ve.COLON)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:Ce.FIELD,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(Ve.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(Ve.PAREN_L,t,Ve.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(Ve.COLON),this.node(t,{kind:Ce.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(Ve.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(Ve.NAME)?this.node(e,{kind:Ce.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:Ce.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){var e;const t=this._lexer.token;return this.expectKeyword("fragment"),!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacyFragmentVariables)?this.node(t,{kind:Ce.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:Ce.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case Ve.BRACKET_L:return this.parseList(e);case Ve.BRACE_L:return this.parseObject(e);case Ve.INT:return this._lexer.advance(),this.node(t,{kind:Ce.INT,value:t.value});case Ve.FLOAT:return this._lexer.advance(),this.node(t,{kind:Ce.FLOAT,value:t.value});case Ve.STRING:case Ve.BLOCK_STRING:return this.parseStringLiteral();case Ve.NAME:switch(this._lexer.advance(),t.value){case"true":return this.node(t,{kind:Ce.BOOLEAN,value:!0});case"false":return this.node(t,{kind:Ce.BOOLEAN,value:!1});case"null":return this.node(t,{kind:Ce.NULL});default:return this.node(t,{kind:Ce.ENUM,value:t.value})}case Ve.DOLLAR:if(e){if(this.expectToken(Ve.DOLLAR),this._lexer.token.kind===Ve.NAME){const e=this._lexer.token.value;throw Pe(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable()}throw this.unexpected()}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this._lexer.advance(),this.node(e,{kind:Ce.STRING,value:e.value,block:e.kind===Ve.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:Ce.LIST,values:this.any(Ve.BRACKET_L,(()=>this.parseValueLiteral(e)),Ve.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:Ce.OBJECT,fields:this.any(Ve.BRACE_L,(()=>this.parseObjectField(e)),Ve.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(Ve.COLON),this.node(t,{kind:Ce.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(Ve.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(Ve.AT),this.node(t,{kind:Ce.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(Ve.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(Ve.BRACKET_R),t=this.node(e,{kind:Ce.LIST_TYPE,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(Ve.BANG)?this.node(e,{kind:Ce.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:Ce.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(Ve.STRING)||this.peek(Ve.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.many(Ve.BRACE_L,this.parseOperationTypeDefinition,Ve.BRACE_R);return this.node(e,{kind:Ce.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(Ve.COLON);const n=this.parseNamedType();return this.node(e,{kind:Ce.OPERATION_TYPE_DEFINITION,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:Ce.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:Ce.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(Ve.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(Ve.BRACE_L,this.parseFieldDefinition,Ve.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(Ve.COLON);const i=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:Ce.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:o})}parseArgumentDefs(){return this.optionalMany(Ve.PAREN_L,this.parseInputValueDef,Ve.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(Ve.COLON);const r=this.parseTypeReference();let i;this.expectOptionalToken(Ve.EQUALS)&&(i=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:Ce.INPUT_VALUE_DEFINITION,description:t,name:n,type:r,defaultValue:i,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:Ce.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:Ce.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(Ve.EQUALS)?this.delimitedMany(Ve.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:Ce.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(Ve.BRACE_L,this.parseEnumValueDefinition,Ve.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:Ce.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw Pe(this._lexer.source,this._lexer.token.start,`${bt(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:Ce.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(Ve.BRACE_L,this.parseInputValueDef,Ve.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===Ve.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),n=this.optionalMany(Ve.BRACE_L,this.parseOperationTypeDefinition,Ve.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:Ce.SCHEMA_EXTENSION,directives:t,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),n=this.parseConstDirectives();if(0===n.length)throw this.unexpected();return this.node(e,{kind:Ce.SCALAR_TYPE_EXTENSION,name:t,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:Ce.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:Ce.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:Ce.UNION_TYPE_EXTENSION,name:t,directives:n,types:r})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:Ce.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:Ce.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(Ve.AT);const n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:Ce.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:o})}parseDirectiveLocations(){return this.delimitedMany(Ve.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(We,t.value))return t;throw this.unexpected(e)}node(e,t){var n;return!0!==(null===(n=this._options)||void 0===n?void 0:n.noLocation)&&(t.loc=new Fe(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw Pe(this._lexer.source,t.start,`Expected ${Et(e)}, found ${bt(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this._lexer.advance(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==Ve.NAME||t.value!==e)throw Pe(this._lexer.source,t.start,`Expected "${e}", found ${bt(t)}.`);this._lexer.advance()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===Ve.NAME&&t.value===e&&(this._lexer.advance(),!0)}unexpected(e){const t=null!=e?e:this._lexer.token;return Pe(this._lexer.source,t.start,`Unexpected ${bt(t)}.`)}any(e,t,n){this.expectToken(e);const r=[];for(;!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}return[]}many(e,t,n){this.expectToken(e);const r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}}function bt(e){const t=e.value;return Et(e.kind)+(null!=t?` "${t}"`:"")}function Et(e){return function(e){return e===Ve.BANG||e===Ve.DOLLAR||e===Ve.AMP||e===Ve.PAREN_L||e===Ve.PAREN_R||e===Ve.SPREAD||e===Ve.COLON||e===Ve.EQUALS||e===Ve.AT||e===Ve.BRACKET_L||e===Ve.BRACKET_R||e===Ve.BRACE_L||e===Ve.PIPE||e===Ve.BRACE_R}(e)?`"${e}"`:e}var _t=new Map,wt=new Map,It=!0,Tt=!1;function Ot(e){return e.replace(/[\s,]+/g," ").trim()}function St(e){var t,n,r,i=Ot(e);if(!_t.has(i)){var o=function(e,t){return new gt(e,t).parseDocument()}(e,{experimentalFragmentVariables:Tt,allowLegacyFragmentVariables:Tt});if(!o||"Document"!==o.kind)throw new Error("Not a valid GraphQL document.");_t.set(i,function(e){var t=new Set(e.definitions);t.forEach((function(e){e.loc&&delete e.loc,Object.keys(e).forEach((function(n){var r=e[n];r&&"object"==typeof r&&t.add(r)}))}));var n=e.loc;return n&&(delete n.startToken,delete n.endToken),e}((t=o,n=new Set,r=[],t.definitions.forEach((function(e){if("FragmentDefinition"===e.kind){var t=e.name.value,i=Ot((a=e.loc).source.body.substring(a.start,a.end)),o=wt.get(t);o&&!o.has(i)?It&&console.warn("Warning: fragment with name "+t+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):o||wt.set(t,o=new Set),o.add(i),n.has(i)||(n.add(i),r.push(e))}else r.push(e);var a})),Ee(Ee({},t),{definitions:r}))))}return _t.get(i)}function Dt(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];"string"==typeof e&&(e=[e]);var r=e[0];return t.forEach((function(t,n){t&&"Document"===t.kind?r+=t.loc.source.body:r+=t,r+=e[n+1]})),St(r)}var xt,At=Dt;(xt=Dt||(Dt={})).gql=At,xt.resetCaches=function(){_t.clear(),wt.clear()},xt.disableFragmentWarnings=function(){It=!1},xt.enableExperimentalFragmentVariables=function(){Tt=!0},xt.disableExperimentalFragmentVariables=function(){Tt=!1},Dt.default=Dt;var kt,Nt,Pt,Ct=Dt(kt||(Nt=["\n fragment PriceFragment on Price {\n billingModel\n billingPeriod\n price {\n amount\n currency\n }\n feature {\n featureUnits\n featureUnitsPlural\n displayName\n }\n }\n"],Pt=["\n fragment PriceFragment on Price {\n billingModel\n billingPeriod\n price {\n amount\n currency\n }\n feature {\n featureUnits\n featureUnitsPlural\n displayName\n }\n }\n"],Object.defineProperty?Object.defineProperty(Nt,"raw",{value:Pt}):Nt.raw=Pt,kt=Nt)),Rt=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},Ft=Dt(Lt||(Lt=Rt(["\n fragment PackageEntitlementFragment on PackageEntitlement {\n usageLimit\n hasUnlimitedUsage\n featureId\n resetPeriod\n feature {\n featureType\n meterType\n featureUnits\n featureUnitsPlural\n displayName\n description\n refId\n }\n }\n"],["\n fragment PackageEntitlementFragment on PackageEntitlement {\n usageLimit\n hasUnlimitedUsage\n featureId\n resetPeriod\n feature {\n featureType\n meterType\n featureUnits\n featureUnitsPlural\n displayName\n description\n refId\n }\n }\n"]))),Mt=Dt(qt||(qt=Rt(["\n fragment AddonFragment on Addon {\n refId\n displayName\n description\n additionalMetaData\n entitlements {\n ...PackageEntitlementFragment\n }\n prices {\n ...PriceFragment\n }\n pricingType\n }\n"],["\n fragment AddonFragment on Addon {\n refId\n displayName\n description\n additionalMetaData\n entitlements {\n ...PackageEntitlementFragment\n }\n prices {\n ...PriceFragment\n }\n pricingType\n }\n"]))),jt=Dt(Vt||(Vt=Rt(["\n fragment PlanFragment on Plan {\n id\n refId\n description\n displayName\n additionalMetaData\n product {\n refId\n displayName\n description\n additionalMetaData\n }\n basePlan {\n id\n refId\n displayName\n }\n entitlements {\n ...PackageEntitlementFragment\n }\n inheritedEntitlements {\n ...PackageEntitlementFragment\n }\n prices {\n ...PriceFragment\n }\n pricingType\n defaultTrialConfig {\n duration\n units\n }\n }\n ","\n ","\n ","\n"],["\n fragment PlanFragment on Plan {\n id\n refId\n description\n displayName\n additionalMetaData\n product {\n refId\n displayName\n description\n additionalMetaData\n }\n basePlan {\n id\n refId\n displayName\n }\n entitlements {\n ...PackageEntitlementFragment\n }\n inheritedEntitlements {\n ...PackageEntitlementFragment\n }\n prices {\n ...PriceFragment\n }\n pricingType\n defaultTrialConfig {\n duration\n units\n }\n }\n ","\n ","\n ","\n"])),Ft,Ct,Mt);const Ut=function(){function e(e){this.client=e}return e.prototype.getPlans=function(e){return this.client.query({query:Dt(Bt||(Bt=Rt(["\n query GetPlans($paging: CursorPaging, $filter: PlanFilter, $addonFilter: AddonFilter, $sorting: [PlanSort!]) {\n plans(paging: $paging, filter: $filter, sorting: $sorting) {\n edges {\n node {\n ...PlanFragment\n compatibleAddons(filter: $addonFilter) {\n ...AddonFragment\n }\n }\n }\n }\n }\n ","\n "],["\n query GetPlans($paging: CursorPaging, $filter: PlanFilter, $addonFilter: AddonFilter, $sorting: [PlanSort!]) {\n plans(paging: $paging, filter: $filter, sorting: $sorting) {\n edges {\n node {\n ...PlanFragment\n compatibleAddons(filter: $addonFilter) {\n ...AddonFragment\n }\n }\n }\n }\n }\n ","\n "])),jt),fetchPolicy:"no-cache",variables:{paging:{first:50},filter:{status:{eq:j.Published},isLatest:{is:!0},product:e?{refId:{eq:e}}:{}},addonFilter:{status:{eq:j.Published},isLatest:{is:!0}},sorting:[{field:L.RefId,direction:W.Asc}]}})},e}();var Lt,qt,Vt,Bt,Qt=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},zt=Dt(Ht||(Ht=Qt(["\n fragment TotalPriceFragment on CustomerSubscriptionTotalPrice {\n subTotal {\n amount\n currency\n }\n total {\n amount\n currency\n }\n }\n"],["\n fragment TotalPriceFragment on CustomerSubscriptionTotalPrice {\n subTotal {\n amount\n currency\n }\n total {\n amount\n currency\n }\n }\n"]))),Gt=Dt(Yt||(Yt=Qt(["\n fragment SubscriptionFragment on CustomerSubscription {\n id\n startDate\n endDate\n trialEndDate\n cancellationDate\n effectiveEndDate\n status\n refId\n currentBillingPeriodEnd\n additionalMetaData\n prices {\n usageLimit\n price {\n ...PriceFragment\n }\n }\n pricingType\n totalPrice {\n ...TotalPriceFragment\n }\n plan {\n id\n refId\n displayName\n description\n additionalMetaData\n product {\n refId\n displayName\n }\n entitlements {\n usageLimit\n featureId\n hasUnlimitedUsage\n packageId\n resetPeriod\n feature {\n featureType\n meterType\n featureUnits\n featureUnitsPlural\n displayName\n description\n refId\n }\n }\n inheritedEntitlements {\n usageLimit\n featureId\n hasUnlimitedUsage\n packageId\n resetPeriod\n packageId\n feature {\n featureType\n meterType\n featureUnits\n featureUnitsPlural\n displayName\n description\n refId\n }\n }\n prices {\n ...PriceFragment\n }\n }\n addons {\n id\n quantity\n addon {\n id\n refId\n displayName\n description\n additionalMetaData\n entitlements {\n usageLimit\n hasUnlimitedUsage\n featureId\n feature {\n featureType\n meterType\n featureUnits\n featureUnitsPlural\n displayName\n description\n refId\n }\n }\n }\n }\n }\n ","\n ","\n"],["\n fragment SubscriptionFragment on CustomerSubscription {\n id\n startDate\n endDate\n trialEndDate\n cancellationDate\n effectiveEndDate\n status\n refId\n currentBillingPeriodEnd\n additionalMetaData\n prices {\n usageLimit\n price {\n ...PriceFragment\n }\n }\n pricingType\n totalPrice {\n ...TotalPriceFragment\n }\n plan {\n id\n refId\n displayName\n description\n additionalMetaData\n product {\n refId\n displayName\n }\n entitlements {\n usageLimit\n featureId\n hasUnlimitedUsage\n packageId\n resetPeriod\n feature {\n featureType\n meterType\n featureUnits\n featureUnitsPlural\n displayName\n description\n refId\n }\n }\n inheritedEntitlements {\n usageLimit\n featureId\n hasUnlimitedUsage\n packageId\n resetPeriod\n packageId\n feature {\n featureType\n meterType\n featureUnits\n featureUnitsPlural\n displayName\n description\n refId\n }\n }\n prices {\n ...PriceFragment\n }\n }\n addons {\n id\n quantity\n addon {\n id\n refId\n displayName\n description\n additionalMetaData\n entitlements {\n usageLimit\n hasUnlimitedUsage\n featureId\n feature {\n featureType\n meterType\n featureUnits\n featureUnitsPlural\n displayName\n description\n refId\n }\n }\n }\n }\n }\n ","\n ","\n"])),Ct,zt),$t=Dt(Jt||(Jt=Qt(["\n fragment PromotionalEntitlementFragment on PromotionalEntitlement {\n status\n usageLimit\n featureId\n hasUnlimitedUsage\n resetPeriod\n endDate\n isVisible\n feature {\n featureType\n meterType\n featureUnits\n featureUnitsPlural\n displayName\n description\n refId\n }\n }\n"],["\n fragment PromotionalEntitlementFragment on PromotionalEntitlement {\n status\n usageLimit\n featureId\n hasUnlimitedUsage\n resetPeriod\n endDate\n isVisible\n feature {\n featureType\n meterType\n featureUnits\n featureUnitsPlural\n displayName\n description\n refId\n }\n }\n"]))),Wt=Dt(Xt||(Xt=Qt(["\n fragment CustomerFragment on Customer {\n id\n name\n email\n createdAt\n updatedAt\n hasPaymentMethod\n refId\n additionalMetaData\n trialedPlans {\n productId\n productRefId\n planRefId\n planId\n }\n promotionalEntitlements {\n ...PromotionalEntitlementFragment\n }\n subscriptions {\n ...SubscriptionFragment\n }\n }\n ","\n ","\n"],["\n fragment CustomerFragment on Customer {\n id\n name\n email\n createdAt\n updatedAt\n hasPaymentMethod\n refId\n additionalMetaData\n trialedPlans {\n productId\n productRefId\n planRefId\n planId\n }\n promotionalEntitlements {\n ...PromotionalEntitlementFragment\n }\n subscriptions {\n ...SubscriptionFragment\n }\n }\n ","\n ","\n"])),Gt,$t);const Kt=function(){function e(e){this.client=e}return e.prototype.getCustomer=function(e){return this.client.query({query:Dt(Zt||(Zt=Qt(["\n query GetCustomerByRefId($filter: CustomerFilter) {\n customers(filter: $filter) {\n edges {\n node {\n ...CustomerFragment\n }\n }\n }\n }\n ","\n "],["\n query GetCustomerByRefId($filter: CustomerFilter) {\n customers(filter: $filter) {\n edges {\n node {\n ...CustomerFragment\n }\n }\n }\n }\n ","\n "])),Wt),variables:{filter:{refId:{eq:e}}},fetchPolicy:"no-cache"})},e}();var Ht,Yt,Jt,Xt,Zt,en=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},tn=Dt(on||(on=en(["\n fragment CouponFragment on Coupon {\n id\n discountValue\n type\n additionalMetaData\n refId\n name\n description\n createdAt\n updatedAt\n billingId\n billingLinkUrl\n type\n status\n syncStates {\n vendorIdentifier\n status\n }\n customers {\n id\n }\n }\n"],["\n fragment CouponFragment on Coupon {\n id\n discountValue\n type\n additionalMetaData\n refId\n name\n description\n createdAt\n updatedAt\n billingId\n billingLinkUrl\n type\n status\n syncStates {\n vendorIdentifier\n status\n }\n customers {\n id\n }\n }\n"]))),nn=Dt(an||(an=en(["\n ","\n query FetchCoupons($filter: CouponFilter, $sorting: [CouponSort!], $paging: CursorPaging) {\n coupons(filter: $filter, sorting: $sorting, paging: $paging) {\n edges {\n node {\n ...CouponFragment\n }\n }\n }\n }\n"],["\n ","\n query FetchCoupons($filter: CouponFilter, $sorting: [CouponSort!], $paging: CursorPaging) {\n coupons(filter: $filter, sorting: $sorting, paging: $paging) {\n edges {\n node {\n ...CouponFragment\n }\n }\n }\n }\n"])),tn);const rn=function(){function e(e){this.client=e}return e.prototype.getCoupons=function(){return this.client.query({query:nn,fetchPolicy:"no-cache",variables:{paging:{first:50},filter:{status:{eq:h.Active}}}})},e}();var on,an;const sn=function(e){this.paywall=new Ut(e),this.customers=new Kt(e),this.coupons=new rn(e)};var un=n(1609),cn=n.n(un),ln=n(2492),pn=n.n(ln);function fn(e){var t=e.customerId;if(!t||cn()(t))throw new Error("You must set customer ID first, use setCustomerId function or pass it via the constructor");return t}var dn=n(5161),hn=n.n(dn),yn=n(9734),vn=n.n(yn),mn=function(){return mn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},mn.apply(this,arguments)},gn=function(){function e(){this.getResetPeriodData=function(e,t){switch(e){case fe.Monthly:return{monthlyResetPeriodConfiguration:{accordingTo:t.monthlyAccordingTo||R.SubscriptionStart}};case fe.Weekly:return{weeklyResetPeriodConfiguration:{accordingTo:t.weeklyAccordingTo||ue.EveryFriday}};default:return{}}}}return e.prototype.mapBooleanEntitlement=function(e,t){return{isFallback:!1,hasAccess:t.hasAccess,accessDeniedReason:t.accessDeniedReason,feature:e.calculatedEntitlement.feature?mn(mn({},e.calculatedEntitlement.feature),{isMetered:!1}):void 0}},e.prototype.mapNumericEntitlement=function(e,t){var n=e.calculatedEntitlement,r=n.hasUnlimitedUsage,i=n.usageLimit;return{isFallback:!1,hasAccess:t.hasAccess,accessDeniedReason:t.accessDeniedReason,isUnlimited:r,value:i||void 0,feature:e.calculatedEntitlement.feature?mn(mn({},e.calculatedEntitlement.feature),{isMetered:!1}):void 0}},e.prototype.mapMeteredEntitlement=function(e,t,n){var r=e.calculatedEntitlement,i=r.hasUnlimitedUsage,o=r.usageLimit,a=r.feature,s=e.featureUsage,u=s.currentUsage,c=s.nextResetDate,l=s.resetPeriod,p=null;return a&&a.featureType===le.Numeric&&a.meterType===C.Incremental&&l&&(p={nextResetDate:c,resetPeriod:l}),{isFallback:!1,hasAccess:t.hasAccess,accessDeniedReason:t.accessDeniedReason,isUnlimited:i,usageLimit:o||void 0,currentUsage:u,requestedUsage:n||0,resetSettings:p||void 0,feature:e.calculatedEntitlement.feature?mn(mn({},e.calculatedEntitlement.feature),{meterType:e.calculatedEntitlement.feature.meterType||void 0,isMetered:!0}):void 0}},e.prototype.mapEntitlement=function(e,t,n){var r=e.calculatedEntitlement;if(!r.feature)return this.mapBooleanEntitlement(e,t);var i=r.feature,o=i.featureType,a=i.meterType,s=o===le.Numeric&&(a===C.Incremental||a===C.Fluctuating);switch(o){case le.Boolean:return this.mapBooleanEntitlement(e,t);case le.Numeric:return s?this.mapMeteredEntitlement(e,t,n):this.mapNumericEntitlement(e,t)}},e.prototype.mapFeatureType=function(e){switch(e){case S.Boolean:return le.Boolean;case S.Number:return le.Numeric}},e.prototype.mapEntitlementResetPeriod=function(e){switch(e){case b.Day:return fe.Daily;case b.Hour:return fe.Hourly;case b.Week:return fe.Weekly;case b.Month:return fe.Monthly}},e.prototype.mapApiEntitlementResetPeriod=function(e){switch(e){case fe.Daily:return b.Day;case fe.Hourly:return b.Hour;case fe.Weekly:return b.Week;case fe.Monthly:return b.Month}},e.prototype.mapCachedEntitlement=function(e,t,n){var r;return e.feature&&(r={id:e.feature.refId,featureType:this.mapFeatureType(e.feature.featureType),meterType:e.feature.meterType||void 0,units:e.feature.featureUnits||void 0,unitsPlural:e.feature.featureUnitsPlural||void 0,displayName:e.feature.displayName,description:e.feature.description||""}),{calculatedEntitlement:{usageLimit:e.usageLimit,hasUnlimitedUsage:e.hasUnlimitedUsage,feature:r},featureUsage:{resetPeriod:e.resetPeriod?this.mapEntitlementResetPeriod(e.resetPeriod):void 0,resetPeriodConfiguration:e.resetPeriodConfiguration,currentUsage:t||e.currentUsage||0,nextResetDate:n||e.nextResetDate}}},e.prototype.mapCachedEntitlements=function(e){var t=this;return new Map(e.map((function(e){var n;return[(null===(n=e.feature)||void 0===n?void 0:n.refId)||"",t.mapCachedEntitlement(e)]})))},e.prototype.mapPlans=function(e){var t=this,n=e.plans.edges.map((function(e){return e.node}));return this.sortPlans(n).map((function(e,n){return t.mapPlan(e,n)}))},e.prototype.mapCoupons=function(e){var t=this;return e.coupons.edges.map((function(e){return e.node})).map((function(e){return t.mapCoupon(e)}))},e.prototype.mapCustomer=function(e){var t,n=this;return new me({id:e.refId,name:e.name||void 0,email:e.email||void 0,createdAt:new Date(e.createdAt),updatedAt:new Date(e.updatedAt),hasPaymentMethod:e.hasPaymentMethod,subscriptions:hn()(e.subscriptions,(function(e){return n.mapSubscription(e)})),promotionalEntitlements:hn()(e.promotionalEntitlements,(function(e){return n.mapPromotionalEntitlement(e)})),metadata:e.additionalMetaData,trialedPlans:(null===(t=e.trialedPlans)||void 0===t?void 0:t.map((function(e){return{productId:e.productRefId,planId:e.planRefId}})))||void 0})},e.prototype.mapTotalPrice=function(e,t,n){var r=e.feature,i=e.price,o={pricingModel:e.billingModel,billingPeriod:e.billingPeriod,amount:t.total.amount,grossAmount:t.subTotal.amount,currency:i.currency};return r&&(o.feature={displayName:r.displayName,units:r.featureUnits,unitsPlural:r.featureUnitsPlural,unitQuantity:n}),o},e.prototype.mapPrice=function(e,t){var n=e.feature,r=e.price,i={pricingModel:e.billingModel,billingPeriod:e.billingPeriod,amount:r.amount,currency:r.currency};return n&&(i.feature={displayName:n.displayName,units:n.featureUnits,unitsPlural:n.featureUnitsPlural,unitQuantity:t}),i},e.prototype.mapPlan=function(e,t){var n=this;return void 0===t&&(t=0),{id:e.refId,order:t,displayName:e.displayName,description:e.description,basePlan:e.basePlan?{id:e.basePlan.refId,displayName:e.basePlan.displayName}:void 0,entitlements:hn()(vn()(e.entitlements,(function(e){return e.feature.refId})),(function(e){return n.mapPackageEntitlement(e)})),inheritedEntitlements:hn()(vn()(e.inheritedEntitlements,(function(e){return e.feature.refId})),(function(e){return n.mapPackageEntitlement(e)})),pricePoints:hn()(e.prices,(function(e){return n.mapPrice(e)})),pricingType:e.pricingType,defaultTrialConfig:e.defaultTrialConfig,compatibleAddons:this.mapCompatibleAddons(e),product:{id:e.product.refId,displayName:e.product.displayName,description:e.product.description,metadata:e.product.additionalMetaData},metadata:e.additionalMetaData}},e.prototype.mapCompatibleAddons=function(e){var t=this;if(e.pricingType===V.Free||!e.compatibleAddons)return[];var n=e.compatibleAddons;return(e.pricingType===V.Paid?n.filter((function(e){return e.pricingType===V.Paid})):n).map((function(e){return t.mapAddon(e)}))},e.prototype.mapPackageEntitlement=function(e){var t=e.feature;return{usageLimit:e.usageLimit||0,feature:{id:t.refId,featureType:this.mapFeatureType(t.featureType),description:t.description||"",meterType:t.meterType||void 0,units:t.featureUnits||void 0,unitsPlural:t.featureUnitsPlural||void 0,displayName:t.displayName,isMetered:t.meterType===C.Fluctuating||t.meterType===C.Incremental},hasUnlimitedUsage:e.hasUnlimitedUsage,resetPeriod:e.resetPeriod?this.mapEntitlementResetPeriod(e.resetPeriod):void 0}},e.prototype.mapPromotionalEntitlement=function(e){var t=e.feature;return{status:e.status,usageLimit:e.usageLimit||0,feature:{id:t.refId,displayName:t.displayName,description:t.description||"",featureType:this.mapFeatureType(t.featureType),meterType:t.meterType||void 0,units:t.featureUnits||void 0,unitsPlural:t.featureUnitsPlural||void 0,isMetered:t.meterType===C.Fluctuating||t.meterType===C.Incremental},hasUnlimitedUsage:e.hasUnlimitedUsage,expiresAt:e.endDate,hasExpirationDate:!!e.endDate,isVisible:e.isVisible}},e.prototype.mapSubscription=function(e){var t,n=this,r=e.totalPrice,i=(e.prices||[])[0];return{id:e.refId,status:e.status,currentBillingPeriodEnd:this.mapDate(e.currentBillingPeriodEnd),plan:this.mapPlan(e.plan),price:i&&r?this.mapTotalPrice(i.price,r,i.usageLimit):null,pricingType:e.pricingType,addons:(null===(t=e.addons)||void 0===t?void 0:t.map((function(e){var t=e.quantity,r=e.addon;return{quantity:t,addon:n.mapAddon(r)}})))||[],startDate:e.startDate,endDate:this.mapDate(e.endDate),trialEndDate:this.mapDate(e.trialEndDate),cancellationDate:this.mapDate(e.cancellationDate),effectiveEndDate:this.mapDate(e.effectiveEndDate),metadata:e.additionalMetaData}},e.prototype.mapDate=function(e){return e?new Date(e):void 0},e.prototype.mapAddon=function(e){var t=this;return{id:e.refId,displayName:e.displayName,description:e.description||"",entitlements:hn()(e.entitlements,(function(e){return t.mapPackageEntitlement(e)})),pricePoints:hn()(e.prices,(function(e){return t.mapPrice(e)})),pricingType:e.pricingType,metadata:e.additionalMetaData}},e.prototype.sortPlans=function(e){var t=vn()(e.filter((function(e){return!e.basePlan})),(function(e){return e.refId})),n=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}([],t,!0);function r(e,t,n){var i=vn()(t.filter((function(t){var n;return(null===(n=t.basePlan)||void 0===n?void 0:n.refId)===e})),(function(e){return e.refId}));n.push.apply(n,i),n.length!==t.length&&i.forEach((function(e){return r(e.refId,t,n)}))}return t.forEach((function(t){return r(t.refId,e,n)})),n},e.prototype.mapAccessDeniedReason=function(e){switch(e){case ce.InvalidFeatureType:return a.Unknown;case ce.CustomerNotFound:return a.CustomerNotFound;case ce.FeatureNotFound:return a.FeatureNotFound;case ce.NoActiveSubscriptions:return a.NoActiveSubscription;case ce.CustomerNotEntitledForFeature:return a.NoFeatureEntitlementInSubscription;case ce.RequestedUsageExceedsLimit:return a.RequestedUsageExceedingLimit;case ce.Unknown:return a.Unknown}},e.prototype.mapFallbackBooleanEntitlementResult=function(e,t){return{hasAccess:e.hasAccess,accessDeniedReason:t.accessDeniedReason?this.mapAccessDeniedReason(t.accessDeniedReason):void 0}},e.prototype.mapFallbackNumericEntitlementResult=function(e,t){return{hasAccess:e.hasAccess,accessDeniedReason:t.accessDeniedReason?this.mapAccessDeniedReason(t.accessDeniedReason):void 0,usageLimit:e.value,hasUnlimitedUsage:e.isUnlimited}},e.prototype.mapEntitlementResult=function(e,t,n){return mn({hasAccess:e.hasAccess,accessDeniedReason:e.accessDeniedReason?this.mapAccessDeniedReason(e.accessDeniedReason):void 0,hasUnlimitedUsage:null==t?void 0:t.calculatedEntitlement.hasUnlimitedUsage,usageLimit:null==t?void 0:t.calculatedEntitlement.usageLimit,currentUsage:null==t?void 0:t.featureUsage.currentUsage,requestedUsage:n,nextResetDate:null==t?void 0:t.featureUsage.nextResetDate,resetPeriod:(null==t?void 0:t.featureUsage.resetPeriod)?this.mapApiEntitlementResetPeriod(t.featureUsage.resetPeriod):void 0},this.getResetPeriodData(null==t?void 0:t.featureUsage.resetPeriod,null==t?void 0:t.featureUsage.resetPeriodConfiguration))},e.prototype.mapFallbackMeteredEntitlementResult=function(e,t,n){return{hasAccess:e.hasAccess,accessDeniedReason:t.accessDeniedReason?this.mapAccessDeniedReason(t.accessDeniedReason):void 0,hasUnlimitedUsage:e.isUnlimited,usageLimit:e.usageLimit,requestedUsage:n}},e.prototype.mapCoupon=function(e){return{id:e.refId,name:e.name,description:e.description,metadata:e.additionalMetaData,discountValue:e.discountValue}},e}(),bn="Invariant Violation",En=Object.setPrototypeOf,_n=void 0===En?function(e,t){return e.__proto__=t,e}:En,wn=function(e){function t(n){void 0===n&&(n=bn);var r=e.call(this,"number"==typeof n?bn+": "+n+" (see https://github.com/apollographql/invariant-packages)":n)||this;return r.framesToPop=1,r.name=bn,_n(r,t.prototype),r}return be(t,e),t}(Error);function In(e,t){if(!e)throw new wn(t)}var Tn=["debug","log","warn","error","silent"],On=Tn.indexOf("log");function Sn(e){return function(){if(Tn.indexOf(e)>=On){var t=console[e]||console.log;return t.apply(console,arguments)}}}function Dn(e){try{return e()}catch(e){}}!function(e){e.debug=Sn("debug"),e.log=Sn("log"),e.warn=Sn("warn"),e.error=Sn("error")}(In||(In={}));const xn=Dn((function(){return globalThis}))||Dn((function(){return window}))||Dn((function(){return self}))||Dn((function(){return n.g}))||Dn((function(){return Function("return this")()}));var An="__",kn=[An,An].join("DEV");const Nn=function(){try{return Boolean(__DEV__)}catch(e){return Object.defineProperty(xn,kn,{value:"production"!==Dn((function(){return"production"})),enumerable:!1,configurable:!0,writable:!0}),xn[kn]}}();function Pn(e){try{return e()}catch(e){}}var Cn=Pn((function(){return globalThis}))||Pn((function(){return window}))||Pn((function(){return self}))||Pn((function(){return n.g}))||Pn((function(){return Function("return this")()})),Rn=!1;function Fn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Mn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function jn(e,t,n){return t&&Mn(e.prototype,t),n&&Mn(e,n),e}!Cn||Pn((function(){return"production"}))||Pn((function(){return process}))||(Object.defineProperty(Cn,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),Rn=!0),Rn&&(delete Cn.process,Rn=!1),__DEV__?In("boolean"==typeof Nn,Nn):In("boolean"==typeof Nn,38);var Un=function(){return"function"==typeof Symbol},Ln=function(e){return Un()&&Boolean(Symbol[e])},qn=function(e){return Ln(e)?Symbol[e]:"@@"+e};Un()&&!Ln("observable")&&(Symbol.observable=Symbol("observable"));var Vn=qn("iterator"),Bn=qn("observable"),Qn=qn("species");function zn(e,t){var n=e[t];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function Gn(e){var t=e.constructor;return void 0!==t&&null===(t=t[Qn])&&(t=void 0),void 0!==t?t:tr}function $n(e){return e instanceof tr}function Wn(e){Wn.log?Wn.log(e):setTimeout((function(){throw e}))}function Kn(e){Promise.resolve().then((function(){try{e()}catch(e){Wn(e)}}))}function Hn(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var n=zn(t,"unsubscribe");n&&n.call(t)}}catch(e){Wn(e)}}function Yn(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function Jn(e,t,n){e._state="running";var r=e._observer;try{var i=zn(r,t);switch(t){case"next":i&&i.call(r,n);break;case"error":if(Yn(e),!i)throw n;i.call(r,n);break;case"complete":Yn(e),i&&i.call(r)}}catch(e){Wn(e)}"closed"===e._state?Hn(e):"running"===e._state&&(e._state="ready")}function Xn(e,t,n){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:n}],void Kn((function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var n=0;n<t.length&&(Jn(e,t[n].type,t[n].value),"closed"!==e._state);++n);}}(e)}))):void Jn(e,t,n);e._queue.push({type:t,value:n})}}var Zn=function(){function e(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";var n=new er(this);try{this._cleanup=t.call(void 0,n)}catch(e){n.error(e)}"initializing"===this._state&&(this._state="ready")}return e.prototype.unsubscribe=function(){"closed"!==this._state&&(Yn(this),Hn(this))},jn(e,[{key:"closed",get:function(){return"closed"===this._state}}]),e}(),er=function(){function e(e){this._subscription=e}var t=e.prototype;return t.next=function(e){Xn(this._subscription,"next",e)},t.error=function(e){Xn(this._subscription,"error",e)},t.complete=function(){Xn(this._subscription,"complete")},jn(e,[{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),tr=function(){function e(t){if(!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}var t=e.prototype;return t.subscribe=function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new Zn(e,this._subscriber)},t.forEach=function(e){var t=this;return new Promise((function(n,r){if("function"==typeof e)var i=t.subscribe({next:function(t){try{e(t,o)}catch(e){r(e),i.unsubscribe()}},error:r,complete:n});else r(new TypeError(e+" is not a function"));function o(){i.unsubscribe(),n()}}))},t.map=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(Gn(this))((function(n){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))},t.filter=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(Gn(this))((function(n){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))},t.reduce=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=Gn(this),r=arguments.length>1,i=!1,o=arguments[1],a=o;return new n((function(n){return t.subscribe({next:function(t){var o=!i;if(i=!0,!o||r)try{a=e(a,t)}catch(e){return n.error(e)}else a=t},error:function(e){n.error(e)},complete:function(){if(!i&&!r)return n.error(new TypeError("Cannot reduce an empty sequence"));n.next(a),n.complete()}})}))},t.concat=function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=Gn(this);return new i((function(t){var r,o=0;return function e(a){r=a.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){o===n.length?(r=void 0,t.complete()):e(i.from(n[o++]))}})}(e),function(){r&&(r.unsubscribe(),r=void 0)}}))},t.flatMap=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=Gn(this);return new n((function(r){var i=[],o=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return r.error(e)}var o=n.from(t).subscribe({next:function(e){r.next(e)},error:function(e){r.error(e)},complete:function(){var e=i.indexOf(o);e>=0&&i.splice(e,1),a()}});i.push(o)},error:function(e){r.error(e)},complete:function(){a()}});function a(){o.closed&&0===i.length&&r.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),o.unsubscribe()}}))},t[Bn]=function(){return this},e.from=function(t){var n="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var r=zn(t,Bn);if(r){var i=r.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return $n(i)&&i.constructor===n?i:new n((function(e){return i.subscribe(e)}))}if(Ln("iterator")&&(r=zn(t,Vn)))return new n((function(e){Kn((function(){if(!e.closed){for(var n,i=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Fn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fn(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(r.call(t));!(n=i()).done;){var o=n.value;if(e.next(o),e.closed)return}e.complete()}}))}));if(Array.isArray(t))return new n((function(e){Kn((function(){if(!e.closed){for(var n=0;n<t.length;++n)if(e.next(t[n]),e.closed)return;e.complete()}}))}));throw new TypeError(t+" is not observable")},e.of=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i="function"==typeof this?this:e;return new i((function(e){Kn((function(){if(!e.closed){for(var t=0;t<n.length;++t)if(e.next(n[t]),e.closed)return;e.complete()}}))}))},jn(e,null,[{key:Qn,get:function(){return this}}]),e}();function nr(e){return null!==e&&"object"==typeof e}function rr(e,t){var n=t,r=[];return e.definitions.forEach((function(e){if("OperationDefinition"===e.kind)throw __DEV__?new wn("Found a "+e.operation+" operation"+(e.name?" named '"+e.name.value+"'":"")+". No operations are allowed when using a fragment as a query. Only fragments are allowed."):new wn(43);"FragmentDefinition"===e.kind&&r.push(e)})),void 0===n&&(__DEV__?In(1===r.length,"Found "+r.length+" fragments. `fragmentName` must be provided when there is not exactly 1 fragment."):In(1===r.length,44),n=r[0].name.value),Ee(Ee({},e),{definitions:Te([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:n}}]}}],e.definitions,!0)})}function ir(e){void 0===e&&(e=[]);var t={};return e.forEach((function(e){t[e.name.value]=e})),t}function or(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":var n=t&&t[e.name.value];return __DEV__?In(n,"No fragment named "+e.name.value+"."):In(n,45),n;default:return null}}function ar(e){return{__ref:String(e)}}function sr(e){return Boolean(e&&"object"==typeof e&&"string"==typeof e.__ref)}function ur(e,t,n,r){if(function(e){return"IntValue"===e.kind}(n)||function(e){return"FloatValue"===e.kind}(n))e[t.value]=Number(n.value);else if(function(e){return"BooleanValue"===e.kind}(n)||function(e){return"StringValue"===e.kind}(n))e[t.value]=n.value;else if(function(e){return"ObjectValue"===e.kind}(n)){var i={};n.fields.map((function(e){return ur(i,e.name,e.value,r)})),e[t.value]=i}else if(function(e){return"Variable"===e.kind}(n)){var o=(r||{})[n.name.value];e[t.value]=o}else if(function(e){return"ListValue"===e.kind}(n))e[t.value]=n.values.map((function(e){var n={};return ur(n,t,e,r),n[t.value]}));else if(function(e){return"EnumValue"===e.kind}(n))e[t.value]=n.value;else{if(!function(e){return"NullValue"===e.kind}(n))throw __DEV__?new wn('The inline argument "'+t.value+'" of kind "'+n.kind+'"is not supported. Use variables instead of inline arguments to overcome this limitation.'):new wn(54);e[t.value]=null}}Un()&&Object.defineProperty(tr,Symbol("extensions"),{value:{symbol:Bn,hostReportError:Wn},configurable:!0});var cr=["connection","include","skip","client","rest","export"],lr=Object.assign((function(e,t,n){if(t&&n&&n.connection&&n.connection.key){if(n.connection.filter&&n.connection.filter.length>0){var r=n.connection.filter?n.connection.filter:[];r.sort();var i={};return r.forEach((function(e){i[e]=t[e]})),n.connection.key+"("+pr(i)+")"}return n.connection.key}var o=e;if(t){var a=pr(t);o+="("+a+")"}return n&&Object.keys(n).forEach((function(e){-1===cr.indexOf(e)&&(n[e]&&Object.keys(n[e]).length?o+="@"+e+"("+pr(n[e])+")":o+="@"+e)})),o}),{setStringify:function(e){var t=pr;return pr=e,t}}),pr=function(e){return JSON.stringify(e,fr)};function fr(e,t){return nr(t)&&!Array.isArray(t)&&(t=Object.keys(t).sort().reduce((function(e,n){return e[n]=t[n],e}),{})),t}function dr(e,t){if(e.arguments&&e.arguments.length){var n={};return e.arguments.forEach((function(e){var r=e.name,i=e.value;return ur(n,r,i,t)})),n}return null}function hr(e){return e.alias?e.alias.value:e.name.value}function yr(e,t,n){if("string"==typeof e.__typename)return e.__typename;for(var r=0,i=t.selections;r<i.length;r++){var o=i[r];if(vr(o)){if("__typename"===o.name.value)return e[hr(o)]}else{var a=yr(e,or(o,n).selectionSet,n);if("string"==typeof a)return a}}}function vr(e){return"Field"===e.kind}function mr(e){return"InlineFragment"===e.kind}function gr(e){__DEV__?In(e&&"Document"===e.kind,'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):In(e&&"Document"===e.kind,46);var t=e.definitions.filter((function(e){return"FragmentDefinition"!==e.kind})).map((function(e){if("OperationDefinition"!==e.kind)throw __DEV__?new wn('Schema type definitions not allowed in queries. Found: "'+e.kind+'"'):new wn(47);return e}));return __DEV__?In(t.length<=1,"Ambiguous GraphQL document: contains "+t.length+" operations"):In(t.length<=1,48),e}function br(e){return gr(e),e.definitions.filter((function(e){return"OperationDefinition"===e.kind}))[0]}function Er(e){return e.definitions.filter((function(e){return"OperationDefinition"===e.kind&&e.name})).map((function(e){return e.name.value}))[0]||null}function _r(e){return e.definitions.filter((function(e){return"FragmentDefinition"===e.kind}))}function wr(e){var t=br(e);return __DEV__?In(t&&"query"===t.operation,"Must contain a query definition."):In(t&&"query"===t.operation,49),t}function Ir(e){var t;gr(e);for(var n=0,r=e.definitions;n<r.length;n++){var i=r[n];if("OperationDefinition"===i.kind){var o=i.operation;if("query"===o||"mutation"===o||"subscription"===o)return i}"FragmentDefinition"!==i.kind||t||(t=i)}if(t)return t;throw __DEV__?new wn("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new wn(53)}function Tr(e){var t=Object.create(null),n=e&&e.variableDefinitions;return n&&n.length&&n.forEach((function(e){e.defaultValue&&ur(t,e.variable.name,e.defaultValue)})),t}function Or(e,t){return t?t(e):tr.of()}function Sr(e){return"function"==typeof e?new Ar(e):e}function Dr(e){return e.request.length<=1}var xr=function(e){function t(t,n){var r=e.call(this,t)||this;return r.link=n,r}return be(t,e),t}(Error),Ar=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e((function(){return tr.of()}))},e.from=function(t){return 0===t.length?e.empty():t.map(Sr).reduce((function(e,t){return e.concat(t)}))},e.split=function(t,n,r){var i=Sr(n),o=Sr(r||new e(Or));return Dr(i)&&Dr(o)?new e((function(e){return t(e)?i.request(e)||tr.of():o.request(e)||tr.of()})):new e((function(e,n){return t(e)?i.request(e,n)||tr.of():o.request(e,n)||tr.of()}))},e.execute=function(e,t){return e.request(function(e,t){var n=Ee({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){n=Ee(Ee({},n),"function"==typeof e?e(n):e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return Ee({},n)}}),t}(t.context,function(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName="string"!=typeof t.query?Er(t.query)||void 0:""),t}(function(e){for(var t=["query","operationName","variables","extensions","context"],n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];if(t.indexOf(i)<0)throw __DEV__?new wn("illegal argument: "+i):new wn(26)}return e}(t))))||tr.of()},e.concat=function(t,n){var r=Sr(t);if(Dr(r))return __DEV__&&In.warn(new xr("You are calling concat on a terminating link, which will have no effect",r)),r;var i=Sr(n);return Dr(i)?new e((function(e){return r.request(e,(function(e){return i.request(e)||tr.of()}))||tr.of()})):new e((function(e,t){return r.request(e,(function(e){return i.request(e,t)||tr.of()}))||tr.of()}))},e.prototype.split=function(t,n,r){return this.concat(e.split(t,n,r||new e(Or)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(e,t){throw __DEV__?new wn("request is not implemented"):new wn(21)},e.prototype.onError=function(e,t){if(t&&t.error)return t.error(e),!1;throw e},e.prototype.setOnError=function(e){return this.onError=e,this},e}();const kr=Object.freeze({});function Nr(e,t,n=je){const r=new Map;for(const e of Object.values(Ce))r.set(e,Pr(t,e));let i,o,a,s,u=Array.isArray(e),c=[e],l=-1,p=[];const f=[],d=[];let h=e;do{l++;const e=l===c.length,g=e&&0!==p.length;if(e){if(a=0===d.length?void 0:f[f.length-1],o=s,s=d.pop(),g)if(u){o=o.slice();let e=0;for(const[t,n]of p){const r=t-e;null===n?(o.splice(r,1),e++):o[r]=n}}else{o=Object.defineProperties({},Object.getOwnPropertyDescriptors(o));for(const[e,t]of p)o[e]=t}l=i.index,c=i.keys,p=i.edits,u=i.inArray,i=i.prev}else{if(a=s?u?l:c[l]:void 0,o=s?s[a]:h,null==o)continue;s&&f.push(a)}let b;if(!Array.isArray(o)){var y,v;Le(o)||Ge(!1,`Invalid AST Node: ${Qe(o)}.`);const n=e?null===(y=r.get(o.kind))||void 0===y?void 0:y.leave:null===(v=r.get(o.kind))||void 0===v?void 0:v.enter;if(b=null==n?void 0:n.call(t,o,a,s,f,d),b===kr)break;if(!1===b){if(!e){f.pop();continue}}else if(void 0!==b&&(p.push([a,b]),!e)){if(!Le(b)){f.pop();continue}o=b}}var m;void 0===b&&g&&p.push([a,o]),e?f.pop():(i={inArray:u,index:l,keys:c,edits:p,prev:i},u=Array.isArray(o),c=u?o:null!==(m=n[o.kind])&&void 0!==m?m:[],l=-1,p=[],s&&d.push(s),s=o)}while(void 0!==i);return 0!==p.length&&(h=p[p.length-1][1]),h}function Pr(e,t){const n=e[t];return"object"==typeof n?n:"function"==typeof n?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}var Cr=function(e,t){var n;try{n=JSON.stringify(e)}catch(e){var r=__DEV__?new wn("Network request failed. "+t+" is not serializable: "+e.message):new wn(23);throw r.parseError=e,r}return n},Rr=function(e,t){return e.getContext().uri||("function"==typeof t?t(e):t||"/graphql")},Fr=function(e,t,n){var r=new Error(n);throw r.name="ServerError",r.response=e,r.statusCode=e.status,r.result=t,r},Mr=Object.prototype.hasOwnProperty;function jr(e){return function(t){return t.text().then((function(e){try{return JSON.parse(e)}catch(r){var n=r;throw n.name="ServerParseError",n.response=t,n.statusCode=t.status,n.bodyText=e,n}})).then((function(n){return t.status>=300&&Fr(t,n,"Response not successful: Received status code "+t.status),Array.isArray(n)||Mr.call(n,"data")||Mr.call(n,"errors")||Fr(t,n,"Server response was missing for query '"+(Array.isArray(e)?e.map((function(e){return e.operationName})):e.operationName)+"'."),n}))}}var Ur=function(e){if(!e&&"undefined"==typeof fetch)throw __DEV__?new wn("\n\"fetch\" has not been found globally and no fetcher has been configured. To fix this, install a fetch package (like https://www.npmjs.com/package/cross-fetch), instantiate the fetcher, and pass it into your HttpLink constructor. For example:\n\nimport fetch from 'cross-fetch';\nimport { ApolloClient, HttpLink } from '@apollo/client';\nconst client = new ApolloClient({\n link: new HttpLink({ uri: '/graphql', fetch })\n});\n "):new wn(22)};const Lr=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function qr(e){return Vr[e.charCodeAt(0)]}const Vr=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"];function Br(e){return Nr(e,Qr)}const Qr={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>zr(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=$r("(",zr(e.variableDefinitions,", "),")"),n=zr([e.operation,zr([e.name,t]),zr(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+$r(" = ",n)+$r(" ",zr(r," "))},SelectionSet:{leave:({selections:e})=>Gr(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){const o=$r("",e,": ")+t;let a=o+$r("(",zr(n,", "),")");return a.length>80&&(a=o+$r("(\n",Wr(zr(n,"\n")),"\n)")),zr([a,zr(r," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+$r(" ",zr(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>zr(["...",$r("on ",e),zr(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${$r("(",zr(n,", "),")")} on ${t} ${$r("",zr(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?function(e,t=!1){const n=!e.includes("\n"),r=e.startsWith(" ")||e.startsWith("\t"),i=e.endsWith('"'),o=e.endsWith("\\"),a=!n||i||o||t;let s="";return!a||n&&r||(s+="\n"),s+=e,a&&(s+="\n"),'"""'+s.replace(/"""/g,'\\"""')+'"""'}(e):`"${e.replace(Lr,qr)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+zr(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+zr(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+$r("(",zr(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>$r("",e,"\n")+zr(["schema",zr(t," "),Gr(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>$r("",e,"\n")+zr(["scalar",t,zr(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>$r("",e,"\n")+zr(["type",t,$r("implements ",zr(n," & ")),zr(r," "),Gr(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>$r("",e,"\n")+t+(Kr(n)?$r("(\n",Wr(zr(n,"\n")),"\n)"):$r("(",zr(n,", "),")"))+": "+r+$r(" ",zr(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>$r("",e,"\n")+zr([t+": "+n,$r("= ",r),zr(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>$r("",e,"\n")+zr(["interface",t,$r("implements ",zr(n," & ")),zr(r," "),Gr(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>$r("",e,"\n")+zr(["union",t,zr(n," "),$r("= ",zr(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>$r("",e,"\n")+zr(["enum",t,zr(n," "),Gr(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>$r("",e,"\n")+zr([t,zr(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>$r("",e,"\n")+zr(["input",t,zr(n," "),Gr(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>$r("",e,"\n")+"directive @"+t+(Kr(n)?$r("(\n",Wr(zr(n,"\n")),"\n)"):$r("(",zr(n,", "),")"))+(r?" repeatable":"")+" on "+zr(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>zr(["extend schema",zr(e," "),Gr(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>zr(["extend scalar",e,zr(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>zr(["extend type",e,$r("implements ",zr(t," & ")),zr(n," "),Gr(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>zr(["extend interface",e,$r("implements ",zr(t," & ")),zr(n," "),Gr(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>zr(["extend union",e,zr(t," "),$r("= ",zr(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>zr(["extend enum",e,zr(t," "),Gr(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>zr(["extend input",e,zr(t," "),Gr(n)]," ")}};function zr(e,t=""){var n;return null!==(n=null==e?void 0:e.filter((e=>e)).join(t))&&void 0!==n?n:""}function Gr(e){return $r("{\n",Wr(zr(e,"\n")),"\n}")}function $r(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function Wr(e){return $r(" ",e.replace(/\n/g,"\n "))}function Kr(e){var t;return null!==(t=null==e?void 0:e.some((e=>e.includes("\n"))))&&void 0!==t&&t}var Hr={http:{includeQuery:!0,includeExtensions:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},Yr=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=Ee(Ee({},t.options),{headers:t.headers,credentials:t.credentials}),o=t.http||{};n.forEach((function(e){i=Ee(Ee(Ee({},i),e.options),{headers:Ee(Ee({},i.headers),Jr(e.headers))}),e.credentials&&(i.credentials=e.credentials),o=Ee(Ee({},o),e.http)}));var a=e.operationName,s=e.extensions,u=e.variables,c=e.query,l={operationName:a,variables:u};return o.includeExtensions&&(l.extensions=s),o.includeQuery&&(l.query=Br(c)),{options:i,body:l}};function Jr(e){if(e){var t=Object.create(null);return Object.keys(Object(e)).forEach((function(n){t[n.toLowerCase()]=e[n]})),t}return e}var Xr=function(){if("undefined"==typeof AbortController)return{controller:!1,signal:!1};var e=new AbortController;return{controller:e,signal:e.signal}};function Zr(e){return new tr((function(t){t.error(e)}))}var ei=Dn((function(){return fetch})),ti=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,function(e){void 0===e&&(e={});var t=e.uri,n=void 0===t?"/graphql":t,r=e.fetch,i=e.includeExtensions,o=e.useGETForQueries,a=e.includeUnusedVariables,s=void 0!==a&&a,u=_e(e,["uri","fetch","includeExtensions","useGETForQueries","includeUnusedVariables"]);__DEV__&&Ur(r||ei);var c={http:{includeExtensions:i},options:u.fetchOptions,credentials:u.credentials,headers:u.headers};return new Ar((function(e){var t=Rr(e,n),i=e.getContext(),a={};if(i.clientAwareness){var u=i.clientAwareness,l=u.name,p=u.version;l&&(a["apollographql-client-name"]=l),p&&(a["apollographql-client-version"]=p)}var f,d=Ee(Ee({},a),i.headers),h={http:i.http,options:i.fetchOptions,credentials:i.credentials,headers:d},y=Yr(e,Hr,c,h),v=y.options,m=y.body;if(m.variables&&!s){var g=new Set(Object.keys(m.variables));Nr(e.query,{Variable:function(e,t,n){n&&"VariableDefinition"!==n.kind&&g.delete(e.name.value)}}),g.size&&(m.variables=Ee({},m.variables),g.forEach((function(e){delete m.variables[e]})))}if(!v.signal){var b=Xr(),E=b.controller,_=b.signal;(f=E)&&(v.signal=_)}if(o&&!e.query.definitions.some((function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation}))&&(v.method="GET"),"GET"===v.method){var w=function(e,t){var n=[],r=function(e,t){n.push(e+"="+encodeURIComponent(t))};if("query"in t&&r("query",t.query),t.operationName&&r("operationName",t.operationName),t.variables){var i=void 0;try{i=Cr(t.variables,"Variables map")}catch(e){return{parseError:e}}r("variables",i)}if(t.extensions){var o=void 0;try{o=Cr(t.extensions,"Extensions map")}catch(e){return{parseError:e}}r("extensions",o)}var a="",s=e,u=e.indexOf("#");-1!==u&&(a=e.substr(u),s=e.substr(0,u));var c=-1===s.indexOf("?")?"?":"&";return{newURI:s+c+n.join("&")+a}}(t,m),I=w.newURI,T=w.parseError;if(T)return Zr(T);t=I}else try{v.body=Cr(m,"Payload")}catch(T){return Zr(T)}return new tr((function(n){return(r||Dn((function(){return fetch}))||ei)(t,v).then((function(t){return e.setContext({response:t}),t})).then(jr(e)).then((function(e){return n.next(e),n.complete(),e})).catch((function(e){"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&n.next(e.result),n.error(e))})),function(){f&&f.abort()}}))}))}(t).request)||this;return n.options=t,n}return be(t,e),t}(Ar),ni=Ar.execute;function ri(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Object.create(null);return e.forEach((function(e){e&&Object.keys(e).forEach((function(t){var r=e[t];void 0!==r&&(n[t]=r)}))})),n}var ii=Object.prototype,oi=ii.toString,ai=ii.hasOwnProperty,si=Function.prototype.toString,ui=new Map;function ci(e,t){try{return li(e,t)}finally{ui.clear()}}function li(e,t){if(e===t)return!0;var n,r,i,o=oi.call(e);if(o!==oi.call(t))return!1;switch(o){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":if(hi(e,t))return!0;var a=pi(e),s=pi(t),u=a.length;if(u!==s.length)return!1;for(var c=0;c<u;++c)if(!ai.call(t,a[c]))return!1;for(c=0;c<u;++c){var l=a[c];if(!li(e[l],t[l]))return!1}return!0;case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!=e)return t!=t;case"[object Boolean]":case"[object Date]":return+e==+t;case"[object RegExp]":case"[object String]":return e==""+t;case"[object Map]":case"[object Set]":if(e.size!==t.size)return!1;if(hi(e,t))return!0;for(var p=e.entries(),f="[object Map]"===o;;){var d=p.next();if(d.done)break;var h=d.value,y=h[0],v=h[1];if(!t.has(y))return!1;if(f&&!li(v,t.get(y)))return!1}return!0;case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":e=new Uint8Array(e),t=new Uint8Array(t);case"[object DataView]":var m=e.byteLength;if(m===t.byteLength)for(;m--&&e[m]===t[m];);return-1===m;case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":var g=si.call(e);return g===si.call(t)&&(r=di,!((i=(n=g).length-r.length)>=0&&n.indexOf(r,i)===i))}return!1}function pi(e){return Object.keys(e).filter(fi,e)}function fi(e){return void 0!==this[e]}var di="{ [native code] }";function hi(e,t){var n=ui.get(e);if(n){if(n.has(t))return!0}else ui.set(e,n=new Set);return n.add(t),!1}var yi,vi,mi=function(){return Object.create(null)},gi=Array.prototype,bi=gi.forEach,Ei=gi.slice,_i=function(){function e(e,t){void 0===e&&(e=!0),void 0===t&&(t=mi),this.weakness=e,this.makeData=t}return e.prototype.lookup=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.lookupArray(e)},e.prototype.lookupArray=function(e){var t=this;return bi.call(e,(function(e){return t=t.getChildTrie(e)})),t.data||(t.data=this.makeData(Ei.call(e)))},e.prototype.getChildTrie=function(t){var n=this.weakness&&function(e){switch(typeof e){case"object":if(null===e)break;case"function":return!0}return!1}(t)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),r=n.get(t);return r||n.set(t,r=new e(this.weakness,this.makeData)),r},e}(),wi="function"==typeof WeakMap&&!("object"==typeof navigator&&"ReactNative"===navigator.product),Ii="function"==typeof WeakSet,Ti="function"==typeof Symbol&&"function"==typeof Symbol.for,Oi=function(){function e(){this.known=new(Ii?WeakSet:Set),this.pool=new _i(wi),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return e.prototype.isKnown=function(e){return nr(e)&&this.known.has(e)},e.prototype.pass=function(e){if(nr(e)){var t=function(e){return nr(e)?Array.isArray(e)?e.slice(0):Ee({__proto__:Object.getPrototypeOf(e)},e):e}(e);return this.passes.set(t,e),t}return e},e.prototype.admit=function(e){var t=this;if(nr(e)){var n=this.passes.get(e);if(n)return n;switch(Object.getPrototypeOf(e)){case Array.prototype:if(this.known.has(e))return e;var r=e.map(this.admit,this);return(s=this.pool.lookupArray(r)).array||(this.known.add(s.array=r),__DEV__&&Object.freeze(r)),s.array;case null:case Object.prototype:if(this.known.has(e))return e;var i=Object.getPrototypeOf(e),o=[i],a=this.sortedKeys(e);o.push(a.json);var s,u=o.length;if(a.sorted.forEach((function(n){o.push(t.admit(e[n]))})),!(s=this.pool.lookupArray(o)).object){var c=s.object=Object.create(i);this.known.add(c),a.sorted.forEach((function(e,t){c[e]=o[u+t]})),__DEV__&&Object.freeze(c)}return s.object}}return e},e.prototype.sortedKeys=function(e){var t=Object.keys(e),n=this.pool.lookupArray(t);if(!n.keys){t.sort();var r=JSON.stringify(t);(n.keys=this.keysByJSON.get(r))||this.keysByJSON.set(r,n.keys={sorted:t,json:r})}return n.keys},e}(),Si=Object.assign((function(e){if(nr(e)){void 0===yi&&Di();var t=yi.admit(e),n=vi.get(t);return void 0===n&&vi.set(t,n=JSON.stringify(t)),n}return JSON.stringify(e)}),{reset:Di});function Di(){yi=new Oi,vi=new(wi?WeakMap:Map)}function xi(e,t,n){return new tr((function(r){var i=r.next,o=r.error,a=r.complete,s=0,u=!1,c={then:function(e){return new Promise((function(t){return t(e())}))}};function l(e,t){return e?function(t){++s;var n=function(){return e(t)};c=c.then(n,n).then((function(e){--s,i&&i.call(r,e),u&&p.complete()}),(function(e){throw--s,e})).catch((function(e){o&&o.call(r,e)}))}:function(e){return t&&t.call(r,e)}}var p={next:l(t,i),error:l(n,o),complete:function(){u=!0,s||a&&a.call(r)}},f=e.subscribe(p);return function(){return f.unsubscribe()}}))}function Ai(e){return e.errors&&e.errors.length>0||!1}function ki(e,t,n){var r=0;return e.forEach((function(n,i){t.call(this,n,i,e)&&(e[r++]=n)}),n),e.length=r,e}var Ni={kind:"Field",name:{kind:"Name",value:"__typename"}};function Pi(e,t){return e.selectionSet.selections.every((function(e){return"FragmentSpread"===e.kind&&Pi(t[e.name.value],t)}))}function Ci(e){return Pi(br(e)||function(e){__DEV__?In("Document"===e.kind,'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):In("Document"===e.kind,50),__DEV__?In(e.definitions.length<=1,"Fragment must have exactly one definition."):In(e.definitions.length<=1,51);var t=e.definitions[0];return __DEV__?In("FragmentDefinition"===t.kind,"Must be a fragment definition."):In("FragmentDefinition"===t.kind,52),t}(e),ir(_r(e)))?null:e}function Ri(e){return function(t){return e.some((function(e){return e.name&&e.name===t.name.value||e.test&&e.test(t)}))}}function Fi(e,t){var n=Object.create(null),r=[],i=Object.create(null),o=[],a=Ci(Nr(t,{Variable:{enter:function(e,t,r){"VariableDefinition"!==r.kind&&(n[e.name.value]=!0)}},Field:{enter:function(t){if(e&&t.directives&&e.some((function(e){return e.remove}))&&t.directives&&t.directives.some(Ri(e)))return t.arguments&&t.arguments.forEach((function(e){"Variable"===e.value.kind&&r.push({name:e.value.name.value})})),t.selectionSet&&Ui(t.selectionSet).forEach((function(e){o.push({name:e.name.value})})),null}},FragmentSpread:{enter:function(e){i[e.name.value]=!0}},Directive:{enter:function(t){if(Ri(e)(t))return null}}}));return a&&ki(r,(function(e){return!!e.name&&!n[e.name]})).length&&(a=function(e,t){var n=function(e){return function(t){return e.some((function(e){return t.value&&"Variable"===t.value.kind&&t.value.name&&(e.name===t.value.name.value||e.test&&e.test(t))}))}}(e);return Ci(Nr(t,{OperationDefinition:{enter:function(t){return Ee(Ee({},t),{variableDefinitions:t.variableDefinitions?t.variableDefinitions.filter((function(t){return!e.some((function(e){return e.name===t.variable.name.value}))})):[]})}},Field:{enter:function(t){if(e.some((function(e){return e.remove}))){var r=0;if(t.arguments&&t.arguments.forEach((function(e){n(e)&&(r+=1)})),1===r)return null}}},Argument:{enter:function(e){if(n(e))return null}}}))}(r,a)),a&&ki(o,(function(e){return!!e.name&&!i[e.name]})).length&&(a=function(e,t){function n(t){if(e.some((function(e){return e.name===t.name.value})))return null}return Ci(Nr(t,{FragmentSpread:{enter:n},FragmentDefinition:{enter:n}}))}(o,a)),a}var Mi=Object.assign((function(e){return Nr(gr(e),{SelectionSet:{enter:function(e,t,n){if(!n||"OperationDefinition"!==n.kind){var r=e.selections;if(r&&!r.some((function(e){return vr(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))}))){var i=n;if(!(vr(i)&&i.directives&&i.directives.some((function(e){return"export"===e.name.value}))))return Ee(Ee({},e),{selections:Te(Te([],r,!0),[Ni],!1)})}}}}})}),{added:function(e){return e===Ni}}),ji={test:function(e){var t="connection"===e.name.value;return t&&(e.arguments&&e.arguments.some((function(e){return"key"===e.name.value}))||__DEV__&&In.warn("Removing an @connection directive even though it does not have a key. You may want to use the key parameter to specify a store key.")),t}};function Ui(e){var t=[];return e.selections.forEach((function(e){(vr(e)||mr(e))&&e.selectionSet?Ui(e.selectionSet).forEach((function(e){return t.push(e)})):"FragmentSpread"===e.kind&&t.push(e)})),t}function Li(e){return"query"===Ir(e).operation?e:Nr(e,{OperationDefinition:{enter:function(e){return Ee(Ee({},e),{operation:"query"})}}})}function qi(e,t){var n=e.directives;return!n||!n.length||function(e){var t=[];return e&&e.length&&e.forEach((function(e){if(function(e){var t=e.name.value;return"skip"===t||"include"===t}(e)){var n=e.arguments,r=e.name.value;__DEV__?In(n&&1===n.length,"Incorrect number of arguments for the @"+r+" directive."):In(n&&1===n.length,40);var i=n[0];__DEV__?In(i.name&&"if"===i.name.value,"Invalid argument for the @"+r+" directive."):In(i.name&&"if"===i.name.value,41);var o=i.value;__DEV__?In(o&&("Variable"===o.kind||"BooleanValue"===o.kind),"Argument for the @"+r+" directive must be a variable or a boolean value."):In(o&&("Variable"===o.kind||"BooleanValue"===o.kind),42),t.push({directive:e,ifArgument:i})}})),t}(n).every((function(e){var n=e.directive,r=e.ifArgument,i=!1;return"Variable"===r.value.kind?(i=t&&t[r.value.name.value],__DEV__?In(void 0!==i,"Invalid variable referenced in @"+n.name.value+" directive."):In(void 0!==i,39)):i=r.value.value,"skip"===n.name.value?!i:i}))}function Vi(e,t){return function(e){var t=[];return Nr(e,{Directive:function(e){t.push(e.name.value)}}),t}(t).some((function(t){return e.indexOf(t)>-1}))}function Bi(e){return e&&Vi(["client"],e)&&Vi(["export"],e)}var Qi=new Map;function zi(e){var t=Qi.get(e)||1;return Qi.set(e,t+1),e+":"+t+":"+Math.random().toString(36).slice(2)}function Gi(e,t,n){var r=[];e.forEach((function(e){return e[t]&&r.push(e)})),r.forEach((function(e){return e[t](n)}))}function $i(e){function t(t){Object.defineProperty(e,t,{value:tr})}return Ti&&Symbol.species&&t(Symbol.species),t("@@species"),e}function Wi(e){return e&&"function"==typeof e.then}var Ki=function(e){function t(t){var n=e.call(this,(function(e){return n.addObserver(e),function(){return n.removeObserver(e)}}))||this;return n.observers=new Set,n.addCount=0,n.promise=new Promise((function(e,t){n.resolve=e,n.reject=t})),n.handlers={next:function(e){null!==n.sub&&(n.latest=["next",e],Gi(n.observers,"next",e))},error:function(e){var t=n.sub;null!==t&&(t&&setTimeout((function(){return t.unsubscribe()})),n.sub=null,n.latest=["error",e],n.reject(e),Gi(n.observers,"error",e))},complete:function(){if(null!==n.sub){var e=n.sources.shift();e?Wi(e)?e.then((function(e){return n.sub=e.subscribe(n.handlers)})):n.sub=e.subscribe(n.handlers):(n.sub=null,n.latest&&"next"===n.latest[0]?n.resolve(n.latest[1]):n.resolve(),Gi(n.observers,"complete"))}}},n.cancel=function(e){n.reject(e),n.sources=[],n.handlers.complete()},n.promise.catch((function(e){})),"function"==typeof t&&(t=[new tr(t)]),Wi(t)?t.then((function(e){return n.start(e)}),n.handlers.error):n.start(t),n}return be(t,e),t.prototype.start=function(e){void 0===this.sub&&(this.sources=Array.from(e),this.handlers.complete())},t.prototype.deliverLastMessage=function(e){if(this.latest){var t=this.latest[0],n=e[t];n&&n.call(e,this.latest[1]),null===this.sub&&"next"===t&&e.complete&&e.complete()}},t.prototype.addObserver=function(e){this.observers.has(e)||(this.deliverLastMessage(e),this.observers.add(e),++this.addCount)},t.prototype.removeObserver=function(e,t){this.observers.delete(e)&&--this.addCount<1&&!t&&this.handlers.error(new Error("Observable cancelled prematurely"))},t.prototype.cleanup=function(e){var t=this,n=!1,r=function(){n||(n=!0,t.observers.delete(i),e())},i={next:r,error:r,complete:r},o=this.addCount;this.addObserver(i),this.addCount=o},t}(tr);function Hi(e){return Array.isArray(e)&&e.length>0}$i(Ki);var Yi,Ji=function(e){function t(n){var r,i,o=n.graphQLErrors,a=n.clientErrors,s=n.networkError,u=n.errorMessage,c=n.extraInfo,l=e.call(this,u)||this;return l.graphQLErrors=o||[],l.clientErrors=a||[],l.networkError=s||null,l.message=u||(i="",(Hi((r=l).graphQLErrors)||Hi(r.clientErrors))&&(r.graphQLErrors||[]).concat(r.clientErrors||[]).forEach((function(e){var t=e?e.message:"Error message not found.";i+=t+"\n"})),r.networkError&&(i+=r.networkError.message+"\n"),i=i.replace(/\n$/,"")),l.extraInfo=c,l.__proto__=t.prototype,l}return be(t,e),t}(Error);function Xi(e){return!!e&&e<7}!function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(Yi||(Yi={}));var Zi=Object.prototype.toString;function eo(e){return to(e)}function to(e,t){switch(Zi.call(e)){case"[object Array]":if((t=t||new Map).has(e))return t.get(e);var n=e.slice(0);return t.set(e,n),n.forEach((function(e,r){n[r]=to(e,t)})),n;case"[object Object]":if((t=t||new Map).has(e))return t.get(e);var r=Object.create(Object.getPrototypeOf(e));return t.set(e,r),Object.keys(e).forEach((function(n){r[n]=to(e[n],t)})),r;default:return e}}var no=Object.assign,ro=Object.hasOwnProperty,io=!1,oo=function(e){function t(t){var n=t.queryManager,r=t.queryInfo,i=t.options,o=e.call(this,(function(e){try{var t=e._subscription._observer;t&&!t.error&&(t.error=ao)}catch(e){}var n=!o.observers.size;o.observers.add(e);var r=o.last;return r&&r.error?e.error&&e.error(r.error):r&&r.result&&e.next&&e.next(r.result),n&&o.reobserve().catch((function(){})),function(){o.observers.delete(e)&&!o.observers.size&&o.tearDownQuery()}}))||this;o.observers=new Set,o.subscriptions=new Set,o.isTornDown=!1,o.options=i,o.queryId=r.queryId||n.generateQueryId();var a=br(i.query);return o.queryName=a&&a.name&&a.name.value,o.initialFetchPolicy=i.fetchPolicy||"cache-first",o.queryManager=n,o.queryInfo=r,o}return be(t,e),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var e=this;return new Promise((function(t,n){var r={next:function(n){t(n),e.observers.delete(r),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout((function(){i.unsubscribe()}),0)},error:n},i=e.subscribe(r)}))},t.prototype.getCurrentResult=function(e){void 0===e&&(e=!0);var t=this.getLastResult(!0),n=this.queryInfo.networkStatus||t&&t.networkStatus||Yi.ready,r=Ee(Ee({},t),{loading:Xi(n),networkStatus:n}),i=this.options.fetchPolicy,o=void 0===i?"cache-first":i;if((t||"network-only"!==o&&"no-cache"!==o&&"standby"!==o)&&!this.queryManager.transform(this.options.query).hasForcedResolvers){var a=this.queryInfo.getDiff();(a.complete||this.options.returnPartialData)&&(r.data=a.result),ci(r.data,{})&&(r.data=void 0),a.complete?(r.networkStatus!==Yi.loading||"cache-first"!==o&&"cache-only"!==o||(r.networkStatus=Yi.ready,r.loading=!1),delete r.partial):"no-cache"!==o&&(r.partial=!0),!__DEV__||a.complete||this.options.partialRefetch||r.loading||r.data||r.error||so(a.missing)}return e&&this.updateLastResult(r),r},t.prototype.isDifferentFromLastResult=function(e){return!this.last||!ci(this.last.result,e)},t.prototype.getLast=function(e,t){var n=this.last;if(n&&n[e]&&(!t||ci(n.variables,this.variables)))return n[e]},t.prototype.getLastResult=function(e){return this.getLast("result",e)},t.prototype.getLastError=function(e){return this.getLast("error",e)},t.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(e){var t,n={pollInterval:0},r=this.options.fetchPolicy;if("no-cache"===r?n.fetchPolicy="no-cache":"cache-and-network"!==r&&(n.fetchPolicy="network-only"),__DEV__&&e&&ro.call(e,"variables")){var i=wr(this.options.query),o=i.variableDefinitions;o&&o.some((function(e){return"variables"===e.variable.name.value}))||__DEV__&&In.warn("Called refetch("+JSON.stringify(e)+") for query "+((null===(t=i.name)||void 0===t?void 0:t.value)||JSON.stringify(i))+", which does not declare a $variables variable.\nDid you mean to call refetch(variables) instead of refetch({ variables })?")}return e&&!ci(this.options.variables,e)&&(n.variables=this.options.variables=Ee(Ee({},this.options.variables),e)),this.queryInfo.resetLastWrite(),this.reobserve(n,Yi.refetch)},t.prototype.fetchMore=function(e){var t=this,n=Ee(Ee({},e.query?e:Ee(Ee(Ee({},this.options),e),{variables:Ee(Ee({},this.options.variables),e.variables)})),{fetchPolicy:"no-cache"}),r=this.queryManager.generateQueryId();return n.notifyOnNetworkStatusChange&&(this.queryInfo.networkStatus=Yi.fetchMore,this.observe()),this.queryManager.fetchQuery(r,n,Yi.fetchMore).then((function(r){var i=r.data,o=e.updateQuery;return o?(__DEV__&&!io&&(__DEV__&&In.warn("The updateQuery callback for fetchMore is deprecated, and will be removed\nin the next major version of Apollo Client.\n\nPlease convert updateQuery functions to field policies with appropriate\nread and merge functions, or use/adapt a helper function (such as\nconcatPagination, offsetLimitPagination, or relayStylePagination) from\n@apollo/client/utilities.\n\nThe field policy system handles pagination more effectively than a\nhand-written updateQuery function, and you only need to define the policy\nonce, rather than every time you call fetchMore."),io=!0),t.updateQuery((function(e){return o(e,{fetchMoreResult:i,variables:n.variables})}))):t.queryManager.cache.writeQuery({query:n.query,variables:n.variables,data:i}),r})).finally((function(){t.queryManager.stopQuery(r),t.reobserve()}))},t.prototype.subscribeToMore=function(e){var t=this,n=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:function(n){var r=e.updateQuery;r&&t.updateQuery((function(e,t){var i=t.variables;return r(e,{subscriptionData:n,variables:i})}))},error:function(t){e.onError?e.onError(t):__DEV__&&In.error("Unhandled GraphQL subscription error",t)}});return this.subscriptions.add(n),function(){t.subscriptions.delete(n)&&n.unsubscribe()}},t.prototype.setOptions=function(e){return this.reobserve(e)},t.prototype.setVariables=function(e){return ci(this.variables,e)?this.observers.size?this.result():Promise.resolve():(this.options.variables=e,this.observers.size?this.reobserve({fetchPolicy:this.initialFetchPolicy,variables:e},Yi.setVariables):Promise.resolve())},t.prototype.updateQuery=function(e){var t=this.queryManager,n=e(t.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,{variables:this.variables});n&&(t.cache.writeQuery({query:this.options.query,data:n,variables:this.variables}),t.broadcastQueries())},t.prototype.startPolling=function(e){this.options.pollInterval=e,this.updatePolling()},t.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},t.prototype.fetch=function(e,t){return this.queryManager.setObservableQuery(this),this.queryManager.fetchQueryObservable(this.queryId,e,t)},t.prototype.updatePolling=function(){var e=this;if(!this.queryManager.ssrMode){var t=this.pollingInfo,n=this.options.pollInterval;if(n){if(!t||t.interval!==n){__DEV__?In(n,"Attempted to start a polling query without a polling interval."):In(n,12),(t||(this.pollingInfo={})).interval=n;var r=function(){e.pollingInfo&&(Xi(e.queryInfo.networkStatus)?i():e.reobserve({fetchPolicy:"network-only"},Yi.poll).then(i,i))},i=function(){var t=e.pollingInfo;t&&(clearTimeout(t.timeout),t.timeout=setTimeout(r,t.interval))};i()}}else t&&(clearTimeout(t.timeout),delete this.pollingInfo)}},t.prototype.updateLastResult=function(e,t){return void 0===t&&(t=this.variables),this.last=Ee(Ee({},this.last),{result:this.queryManager.assumeImmutableResults?e:eo(e),variables:t}),Hi(e.errors)||delete this.last.error,this.last},t.prototype.reobserve=function(e,t){var n=this;this.isTornDown=!1;var r=t===Yi.refetch||t===Yi.fetchMore||t===Yi.poll,i=this.options.variables,o=r?ri(this.options,e):no(this.options,ri(e));r||(this.updatePolling(),e&&e.variables&&!e.fetchPolicy&&!ci(e.variables,i)&&(o.fetchPolicy=this.initialFetchPolicy,void 0===t&&(t=Yi.setVariables)));var a=o.variables&&Ee({},o.variables),s=this.fetch(o,t),u={next:function(e){n.reportResult(e,a)},error:function(e){n.reportError(e,a)}};return r||(this.concast&&this.observer&&this.concast.removeObserver(this.observer,!0),this.concast=s,this.observer=u),s.addObserver(u),s.promise},t.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},t.prototype.reportResult=function(e,t){(this.getLastError()||this.isDifferentFromLastResult(e))&&(this.updateLastResult(e,t),Gi(this.observers,"next",e))},t.prototype.reportError=function(e,t){var n=Ee(Ee({},this.getLastResult()),{error:e,errors:e.graphQLErrors,networkStatus:Yi.error,loading:!1});this.updateLastResult(n,t),Gi(this.observers,"error",this.last.error=e)},t.prototype.hasObservers=function(){return this.observers.size>0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t}(tr);function ao(e){__DEV__&&In.error("Unhandled error",e.message,e.stack)}function so(e){__DEV__&&Hi(e)&&__DEV__&&In.debug("Missing cache result fields: "+e.map((function(e){return e.path.join(".")})).join(", "),e)}$i(oo);var uo=Object.prototype.hasOwnProperty;function co(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return lo(e)}function lo(e){var t=e[0]||{},n=e.length;if(n>1)for(var r=new fo,i=1;i<n;++i)t=r.merge(t,e[i]);return t}var po=function(e,t,n){return this.merge(e[n],t[n])},fo=function(){function e(e){void 0===e&&(e=po),this.reconciler=e,this.isObject=nr,this.pastCopies=new Set}return e.prototype.merge=function(e,t){for(var n=this,r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return nr(t)&&nr(e)?(Object.keys(t).forEach((function(i){if(uo.call(e,i)){var o=e[i];if(t[i]!==o){var a=n.reconciler.apply(n,Te([e,t,i],r,!1));a!==o&&((e=n.shallowCopyForMerge(e))[i]=a)}}else(e=n.shallowCopyForMerge(e))[i]=t[i]})),e):t},e.prototype.shallowCopyForMerge=function(e){return nr(e)&&!this.pastCopies.has(e)&&(e=Array.isArray(e)?e.slice(0):Ee({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e)),e},e}(),ho=null,yo={},vo=1,mo="@wry/context:Slot",go=Array,bo=go[mo]||function(){var e=function(){function e(){this.id=["slot",vo++,Date.now(),Math.random().toString(36).slice(2)].join(":")}return e.prototype.hasValue=function(){for(var e=ho;e;e=e.parent)if(this.id in e.slots){var t=e.slots[this.id];if(t===yo)break;return e!==ho&&(ho.slots[this.id]=t),!0}return ho&&(ho.slots[this.id]=yo),!1},e.prototype.getValue=function(){if(this.hasValue())return ho.slots[this.id]},e.prototype.withValue=function(e,t,n,r){var i,o=((i={__proto__:null})[this.id]=e,i),a=ho;ho={parent:a,slots:o};try{return t.apply(r,n)}finally{ho=a}},e.bind=function(e){var t=ho;return function(){var n=ho;try{return ho=t,e.apply(this,arguments)}finally{ho=n}}},e.noContext=function(e,t,n){if(!ho)return e.apply(n,t);var r=ho;try{return ho=null,e.apply(n,t)}finally{ho=r}},e}();try{Object.defineProperty(go,mo,{value:go[mo]=e,enumerable:!1,writable:!1,configurable:!1})}finally{return e}}();function Eo(){}bo.bind,bo.noContext;var _o,wo=function(){function e(e,t){void 0===e&&(e=1/0),void 0===t&&(t=Eo),this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}return e.prototype.has=function(e){return this.map.has(e)},e.prototype.get=function(e){var t=this.getNode(e);return t&&t.value},e.prototype.getNode=function(e){var t=this.map.get(e);if(t&&t!==this.newest){var n=t.older,r=t.newer;r&&(r.older=n),n&&(n.newer=r),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=r)}return t},e.prototype.set=function(e,t){var n=this.getNode(e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)},e.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},e.prototype.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)},e}(),Io=new bo,To=Object.prototype.hasOwnProperty,Oo=void 0===(_o=Array.from)?function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t}:_o;function So(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var Do=[];function xo(e,t){if(!e)throw new Error(t||"assertion failure")}function Ao(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}var ko=function(){function e(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++e.count}return e.prototype.peek=function(){if(1===this.value.length&&!Co(this))return No(this),this.value[0]},e.prototype.recompute=function(e){return xo(!this.recomputing,"already recomputing"),No(this),Co(this)?function(e,t){return qo(e),Io.withValue(e,Po,[e,t]),function(e,t){if("function"==typeof e.subscribe)try{So(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(t){return e.setDirty(),!1}return!0}(e,t)&&function(e){e.dirty=!1,Co(e)||Fo(e)}(e),Ao(e.value)}(this,e):Ao(this.value)},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,Ro(this),So(this))},e.prototype.dispose=function(){var e=this;this.setDirty(),qo(this),Mo(this,(function(t,n){t.setDirty(),Vo(t,e)}))},e.prototype.forget=function(){this.dispose()},e.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=Do.pop()||new Set),this.deps.add(e)},e.prototype.forgetDeps=function(){var e=this;this.deps&&(Oo(this.deps).forEach((function(t){return t.delete(e)})),this.deps.clear(),Do.push(this.deps),this.deps=null)},e.count=0,e}();function No(e){var t=Io.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),Co(e)?jo(t,e):Uo(t,e),t}function Po(e,t){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,t)}catch(t){e.value[1]=t}e.recomputing=!1}function Co(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function Ro(e){Mo(e,jo)}function Fo(e){Mo(e,Uo)}function Mo(e,t){var n=e.parents.size;if(n)for(var r=Oo(e.parents),i=0;i<n;++i)t(r[i],e)}function jo(e,t){xo(e.childValues.has(t)),xo(Co(t));var n=!Co(e);if(e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=Do.pop()||new Set;e.dirtyChildren.add(t),n&&Ro(e)}function Uo(e,t){xo(e.childValues.has(t)),xo(!Co(t));var n,r,i,o=e.childValues.get(t);0===o.length?e.childValues.set(t,t.value.slice(0)):(n=o,r=t.value,(i=n.length)>0&&i===r.length&&n[i-1]===r[i-1]||e.setDirty()),Lo(e,t),Co(e)||Fo(e)}function Lo(e,t){var n=e.dirtyChildren;n&&(n.delete(t),0===n.size&&(Do.length<100&&Do.push(n),e.dirtyChildren=null))}function qo(e){e.childValues.size>0&&e.childValues.forEach((function(t,n){Vo(e,n)})),e.forgetDeps(),xo(null===e.dirtyChildren)}function Vo(e,t){t.parents.delete(e),e.childValues.delete(t),Lo(e,t)}var Bo={setDirty:!0,dispose:!0,forget:!0};function Qo(e){var t=new Map,n=e&&e.subscribe;function r(e){var r=Io.getValue();if(r){var i=t.get(e);i||t.set(e,i=new Set),r.dependOn(i),"function"==typeof n&&(So(i),i.unsubscribe=n(e))}}return r.dirty=function(e,n){var r=t.get(e);if(r){var i=n&&To.call(Bo,n)?n:"setDirty";Oo(r).forEach((function(e){return e[i]()})),t.delete(e),So(r)}},r}function zo(){var e=new _i("function"==typeof WeakMap);return function(){return e.lookupArray(arguments)}}zo();var Go=new Set;function $o(e,t){void 0===t&&(t=Object.create(null));var n=new wo(t.max||Math.pow(2,16),(function(e){return e.dispose()})),r=t.keyArgs,i=t.makeCacheKey||zo(),o=function(){var o=i.apply(null,r?r.apply(null,arguments):arguments);if(void 0===o)return e.apply(null,arguments);var a=n.get(o);a||(n.set(o,a=new ko(e)),a.subscribe=t.subscribe,a.forget=function(){return n.delete(o)});var s=a.recompute(Array.prototype.slice.call(arguments));return n.set(o,a),Go.add(n),Io.hasValue()||(Go.forEach((function(e){return e.clean()})),Go.clear()),s};function a(e){var t=n.get(e);t&&t.setDirty()}function s(e){var t=n.get(e);if(t)return t.peek()}function u(e){return n.delete(e)}return Object.defineProperty(o,"size",{get:function(){return n.map.size},configurable:!1,enumerable:!1}),o.dirtyKey=a,o.dirty=function(){a(i.apply(null,arguments))},o.peekKey=s,o.peek=function(){return s(i.apply(null,arguments))},o.forgetKey=u,o.forget=function(){return u(i.apply(null,arguments))},o.makeCacheKey=i,o.getKey=r?function(){return i.apply(null,r.apply(null,arguments))}:i,Object.freeze(o)}var Wo=new bo,Ko=new WeakMap;function Ho(e){var t=Ko.get(e);return t||Ko.set(e,t={vars:new Set,dep:Qo()}),t}function Yo(e){Ho(e).vars.forEach((function(t){return t.forgetCache(e)}))}function Jo(e){var t=new Set,n=new Set,r=function(o){if(arguments.length>0){if(e!==o){e=o,t.forEach((function(e){Ho(e).dep.dirty(r),Xo(e)}));var a=Array.from(n);n.clear(),a.forEach((function(t){return t(e)}))}}else{var s=Wo.getValue();s&&(i(s),Ho(s).dep(r))}return e};r.onNextChange=function(e){return n.add(e),function(){n.delete(e)}};var i=r.attachCache=function(e){return t.add(e),Ho(e).vars.add(r),r};return r.forgetCache=function(e){return t.delete(e)},r}function Xo(e){e.broadcastWatches&&e.broadcastWatches()}var Zo=function(){function e(e){var t=e.cache,n=e.client,r=e.resolvers,i=e.fragmentMatcher;this.cache=t,n&&(this.client=n),r&&this.addResolvers(r),i&&this.setFragmentMatcher(i)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach((function(e){t.resolvers=co(t.resolvers,e)})):this.resolvers=co(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){var t=e.document,n=e.remoteResult,r=e.context,i=e.variables,o=e.onlyRunForcedResolvers,a=void 0!==o&&o;return we(this,void 0,void 0,(function(){return Ie(this,(function(e){return t?[2,this.resolveDocument(t,n.data,r,i,this.fragmentMatcher,a).then((function(e){return Ee(Ee({},n),{data:e.result})}))]:[2,n]}))}))},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return Vi(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return function(e){gr(e);var t=Fi([{test:function(e){return"client"===e.name.value},remove:!0}],e);return t&&(t=Nr(t,{FragmentDefinition:{enter:function(e){if(e.selectionSet&&e.selectionSet.selections.every((function(e){return vr(e)&&"__typename"===e.name.value})))return null}}})),t}(e)},e.prototype.prepareContext=function(e){var t=this.cache;return Ee(Ee({},e),{cache:t,getCacheKey:function(e){return t.identify(e)}})},e.prototype.addExportedVariables=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),we(this,void 0,void 0,(function(){return Ie(this,(function(r){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(n),t).then((function(e){return Ee(Ee({},t),e.exportedVariables)}))]:[2,Ee({},t)]}))}))},e.prototype.shouldForceResolvers=function(e){var t=!1;return Nr(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some((function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value}))))return kr}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:Li(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t,n,r,i,o){return void 0===n&&(n={}),void 0===r&&(r={}),void 0===i&&(i=function(){return!0}),void 0===o&&(o=!1),we(this,void 0,void 0,(function(){var a,s,u,c,l,p,f,d,h;return Ie(this,(function(y){return a=Ir(e),s=_r(e),u=ir(s),c=a.operation,l=c?c.charAt(0).toUpperCase()+c.slice(1):"Query",f=(p=this).cache,d=p.client,h={fragmentMap:u,context:Ee(Ee({},n),{cache:f,client:d}),variables:r,fragmentMatcher:i,defaultOperationType:l,exportedVariables:{},onlyRunForcedResolvers:o},[2,this.resolveSelectionSet(a.selectionSet,t,h).then((function(e){return{result:e,exportedVariables:h.exportedVariables}}))]}))}))},e.prototype.resolveSelectionSet=function(e,t,n){return we(this,void 0,void 0,(function(){var r,i,o,a,s,u=this;return Ie(this,(function(c){return r=n.fragmentMap,i=n.context,o=n.variables,a=[t],s=function(e){return we(u,void 0,void 0,(function(){var s,u;return Ie(this,(function(c){return qi(e,o)?vr(e)?[2,this.resolveField(e,t,n).then((function(t){var n;void 0!==t&&a.push(((n={})[hr(e)]=t,n))}))]:(mr(e)?s=e:(s=r[e.name.value],__DEV__?In(s,"No fragment named "+e.name.value):In(s,11)),s&&s.typeCondition&&(u=s.typeCondition.name.value,n.fragmentMatcher(t,u,i))?[2,this.resolveSelectionSet(s.selectionSet,t,n).then((function(e){a.push(e)}))]:[2]):[2]}))}))},[2,Promise.all(e.selections.map(s)).then((function(){return lo(a)}))]}))}))},e.prototype.resolveField=function(e,t,n){return we(this,void 0,void 0,(function(){var r,i,o,a,s,u,c,l,p,f=this;return Ie(this,(function(d){return r=n.variables,i=e.name.value,o=hr(e),a=i!==o,s=t[o]||t[i],u=Promise.resolve(s),n.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(c=t.__typename||n.defaultOperationType,(l=this.resolvers&&this.resolvers[c])&&(p=l[a?i:o])&&(u=Promise.resolve(Wo.withValue(this.cache,p,[t,dr(e,r),n.context,{field:e,fragmentMap:n.fragmentMap}])))),[2,u.then((function(t){return void 0===t&&(t=s),e.directives&&e.directives.forEach((function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach((function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(n.exportedVariables[e.value.value]=t)}))})),e.selectionSet?null==t?t:Array.isArray(t)?f.resolveSubSelectedArray(e,t,n):e.selectionSet?f.resolveSelectionSet(e.selectionSet,t,n):void 0:t}))]}))}))},e.prototype.resolveSubSelectedArray=function(e,t,n){var r=this;return Promise.all(t.map((function(t){return null===t?null:Array.isArray(t)?r.resolveSubSelectedArray(e,t,n):e.selectionSet?r.resolveSelectionSet(e.selectionSet,t,n):void 0})))},e}(),ea=new(wi?WeakMap:Map);function ta(e,t){var n=e[t];"function"==typeof n&&(e[t]=function(){return ea.set(e,(ea.get(e)+1)%1e15),n.apply(this,arguments)})}function na(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var ra=function(){function e(e,t){void 0===t&&(t=e.generateQueryId()),this.queryId=t,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=e.cache;ea.has(n)||(ea.set(n,0),ta(n,"evict"),ta(n,"modify"),ta(n,"reset"))}return e.prototype.init=function(e){var t=e.networkStatus||Yi.loading;return this.variables&&this.networkStatus!==Yi.loading&&!ci(this.variables,e.variables)&&(t=Yi.setVariables),ci(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},e.prototype.reset=function(){na(this),this.lastDiff=void 0,this.dirty=!1},e.prototype.getDiff=function(e){void 0===e&&(e=this.variables);var t=this.getDiffOptions(e);if(this.lastDiff&&ci(t,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=e);var n=this.observableQuery;if(n&&"no-cache"===n.options.fetchPolicy)return{complete:!1};var r=this.cache.diff(t);return this.updateLastDiff(r,t),r},e.prototype.updateLastDiff=function(e,t){this.lastDiff=e?{diff:e,options:t||this.getDiffOptions()}:void 0},e.prototype.getDiffOptions=function(e){var t;return void 0===e&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:null===(t=this.observableQuery)||void 0===t?void 0:t.options.canonizeResults}},e.prototype.setDiff=function(e){var t=this,n=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),this.dirty||ci(n&&n.result,e&&e.result)||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout((function(){return t.notify()}),0)))},e.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){t.getDiff().fromOptimisticTransaction?e.observe():e.reobserve()})):delete this.oqListener)},e.prototype.notify=function(){var e=this;na(this),this.shouldNotify()&&this.listeners.forEach((function(t){return t(e)})),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(Xi(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if("cache-only"!==e&&"cache-and-network"!==e)return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=e.prototype.cancel,this.subscriptions.forEach((function(e){return e.unsubscribe()}));var t=this.observableQuery;t&&t.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(e){var t=this;void 0===e&&(e=this.variables);var n=this.observableQuery;if(!n||"no-cache"!==n.options.fetchPolicy){var r=Ee(Ee({},this.getDiffOptions(e)),{watcher:this,callback:function(e){return t.setDiff(e)}});this.lastWatch&&ci(r,this.lastWatch)||(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=r))}},e.prototype.resetLastWrite=function(){this.lastWrite=void 0},e.prototype.shouldWrite=function(e,t){var n=this.lastWrite;return!(n&&n.dmCount===ea.get(this.cache)&&ci(t,n.variables)&&ci(e.data,n.result.data))},e.prototype.markResult=function(e,t,n){var r=this;this.graphQLErrors=Hi(e.errors)?e.errors:[],this.reset(),"no-cache"===t.fetchPolicy?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(t.variables)):0!==n&&(ia(e,t.errorPolicy)?this.cache.performTransaction((function(i){if(r.shouldWrite(e,t.variables))i.writeQuery({query:r.document,data:e.data,variables:t.variables,overwrite:1===n}),r.lastWrite={result:e,variables:t.variables,dmCount:ea.get(r.cache)};else if(r.lastDiff&&r.lastDiff.diff.complete)return void(e.data=r.lastDiff.diff.result);var o=r.getDiffOptions(t.variables),a=i.diff(o);r.stopped||r.updateWatch(t.variables),r.updateLastDiff(a,o),a.complete&&(e.data=a.result)})):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=Yi.ready},e.prototype.markError=function(e){return this.networkStatus=Yi.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},e}();function ia(e,t){void 0===t&&(t="none");var n="ignore"===t||"all"===t,r=!Ai(e);return!r&&n&&e.data&&(r=!0),r}var oa=Object.prototype.hasOwnProperty,aa=function(){function e(e){var t=e.cache,n=e.link,r=e.queryDeduplication,i=void 0!==r&&r,o=e.onBroadcast,a=e.ssrMode,s=void 0!==a&&a,u=e.clientAwareness,c=void 0===u?{}:u,l=e.localState,p=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(wi?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=t,this.link=n,this.queryDeduplication=i,this.clientAwareness=c,this.localState=l||new Zo({cache:t}),this.ssrMode=s,this.assumeImmutableResults=!!p,(this.onBroadcast=o)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var e=this;this.queries.forEach((function(t,n){e.stopQueryNoBroadcast(n)})),this.cancelPendingFetches(__DEV__?new wn("QueryManager stopped while query was in flight"):new wn(13))},e.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach((function(t){return t(e)})),this.fetchCancelFns.clear()},e.prototype.mutate=function(e){var t=e.mutation,n=e.variables,r=e.optimisticResponse,i=e.updateQueries,o=e.refetchQueries,a=void 0===o?[]:o,s=e.awaitRefetchQueries,u=void 0!==s&&s,c=e.update,l=e.onQueryUpdated,p=e.errorPolicy,f=void 0===p?"none":p,d=e.fetchPolicy,h=void 0===d?"network-only":d,y=e.keepRootFields,v=e.context;return we(this,void 0,void 0,(function(){var e,o,s;return Ie(this,(function(p){switch(p.label){case 0:return __DEV__?In(t,"mutation option is required. You must specify your GraphQL document in the mutation option."):In(t,14),__DEV__?In("network-only"===h||"no-cache"===h,"Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):In("network-only"===h||"no-cache"===h,15),e=this.generateMutationId(),t=this.transform(t).document,n=this.getVariables(t,n),this.transform(t).hasClientExports?[4,this.localState.addExportedVariables(t,n,v)]:[3,2];case 1:n=p.sent(),p.label=2;case 2:return o=this.mutationStore&&(this.mutationStore[e]={mutation:t,variables:n,loading:!0,error:null}),r&&this.markMutationOptimistic(r,{mutationId:e,document:t,variables:n,fetchPolicy:h,errorPolicy:f,context:v,updateQueries:i,update:c,keepRootFields:y}),this.broadcastQueries(),s=this,[2,new Promise((function(p,d){return xi(s.getObservableFromLink(t,Ee(Ee({},v),{optimisticResponse:r}),n,!1),(function(p){if(Ai(p)&&"none"===f)throw new Ji({graphQLErrors:p.errors});o&&(o.loading=!1,o.error=null);var d=Ee({},p);return"function"==typeof a&&(a=a(d)),"ignore"===f&&Ai(d)&&delete d.errors,s.markMutationResult({mutationId:e,result:d,document:t,variables:n,fetchPolicy:h,errorPolicy:f,context:v,update:c,updateQueries:i,awaitRefetchQueries:u,refetchQueries:a,removeOptimistic:r?e:void 0,onQueryUpdated:l,keepRootFields:y})})).subscribe({next:function(e){s.broadcastQueries(),p(e)},error:function(t){o&&(o.loading=!1,o.error=t),r&&s.cache.removeOptimistic(e),s.broadcastQueries(),d(t instanceof Ji?t:new Ji({networkError:t}))}})}))]}}))}))},e.prototype.markMutationResult=function(e,t){var n=this;void 0===t&&(t=this.cache);var r=e.result,i=[],o="no-cache"===e.fetchPolicy;if(!o&&ia(r,e.errorPolicy)){i.push({result:r.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables});var a=e.updateQueries;a&&this.queries.forEach((function(e,o){var s=e.observableQuery,u=s&&s.queryName;if(u&&oa.call(a,u)){var c=a[u],l=n.queries.get(o),p=l.document,f=l.variables,d=t.diff({query:p,variables:f,returnPartialData:!0,optimistic:!1}),h=d.result;if(d.complete&&h){var y=c(h,{mutationResult:r,queryName:p&&Er(p)||void 0,queryVariables:f});y&&i.push({result:y,dataId:"ROOT_QUERY",query:p,variables:f})}}}))}if(i.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var s=[];if(this.refetchQueries({updateCache:function(t){o||i.forEach((function(e){return t.write(e)}));var a=e.update;if(a){if(!o){var s=t.diff({id:"ROOT_MUTATION",query:n.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});s.complete&&(r=Ee(Ee({},r),{data:s.result}))}a(t,r,{context:e.context,variables:e.variables})}o||e.keepRootFields||t.modify({id:"ROOT_MUTATION",fields:function(e,t){var n=t.fieldName,r=t.DELETE;return"__typename"===n?e:r}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach((function(e){return s.push(e)})),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(s).then((function(){return r}))}return Promise.resolve(r)},e.prototype.markMutationOptimistic=function(e,t){var n=this,r="function"==typeof e?e(t.variables):e;return this.cache.recordOptimisticTransaction((function(e){try{n.markMutationResult(Ee(Ee({},t),{result:{data:r}}),e)}catch(e){__DEV__&&In.error(e)}}),t.mutationId)},e.prototype.fetchQuery=function(e,t,n){return this.fetchQueryObservable(e,t,n).promise},e.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach((function(t,n){e[n]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}})),e},e.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},e.prototype.transform=function(e){var t,n=this.transformCache;if(!n.has(e)){var r=this.cache.transformDocument(e),i=(t=this.cache.transformForLink(r),Fi([ji],gr(t))),o=this.localState.clientQuery(r),a=i&&this.localState.serverQuery(i),s={document:r,hasClientExports:Bi(r),hasForcedResolvers:this.localState.shouldForceResolvers(r),clientQuery:o,serverQuery:a,defaultVars:Tr(br(r)),asQuery:Ee(Ee({},r),{definitions:r.definitions.map((function(e){return"OperationDefinition"===e.kind&&"query"!==e.operation?Ee(Ee({},e),{operation:"query"}):e}))})},u=function(e){e&&!n.has(e)&&n.set(e,s)};u(e),u(r),u(o),u(a)}return n.get(e)},e.prototype.getVariables=function(e,t){return Ee(Ee({},this.transform(e).defaultVars),t)},e.prototype.watchQuery=function(e){void 0===(e=Ee(Ee({},e),{variables:this.getVariables(e.query,e.variables)})).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var t=new ra(this),n=new oo({queryManager:this,queryInfo:t,options:e});return this.queries.set(n.queryId,t),t.init({document:e.query,observableQuery:n,variables:e.variables}),n},e.prototype.query=function(e,t){var n=this;return void 0===t&&(t=this.generateQueryId()),__DEV__?In(e.query,"query option is required. You must specify your GraphQL document in the query option."):In(e.query,16),__DEV__?In("Document"===e.query.kind,'You must wrap the query string in a "gql" tag.'):In("Document"===e.query.kind,17),__DEV__?In(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):In(!e.returnPartialData,18),__DEV__?In(!e.pollInterval,"pollInterval option only supported on watchQuery."):In(!e.pollInterval,19),this.fetchQuery(t,e).finally((function(){return n.stopQuery(t)}))},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},e.prototype.clearStore=function(e){return void 0===e&&(e={discardWatches:!0}),this.cancelPendingFetches(__DEV__?new wn("Store reset while query was in flight (not completed in link chain)"):new wn(20)),this.queries.forEach((function(e){e.observableQuery?e.networkStatus=Yi.loading:e.stop()})),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},e.prototype.getObservableQueries=function(e){var t=this;void 0===e&&(e="active");var n=new Map,r=new Map,i=new Set;return Array.isArray(e)&&e.forEach((function(e){var n;"string"==typeof e?r.set(e,!1):nr(n=e)&&"Document"===n.kind&&Array.isArray(n.definitions)?r.set(t.transform(e).document,!1):nr(e)&&e.query&&i.add(e)})),this.queries.forEach((function(t,i){var o=t.observableQuery,a=t.document;if(o){if("all"===e)return void n.set(i,o);var s=o.queryName;if("standby"===o.options.fetchPolicy||"active"===e&&!o.hasObservers())return;("active"===e||s&&r.has(s)||a&&r.has(a))&&(n.set(i,o),s&&r.set(s,!0),a&&r.set(a,!0))}})),i.size&&i.forEach((function(e){var r=zi("legacyOneTimeQuery"),i=t.getQuery(r).init({document:e.query,variables:e.variables}),o=new oo({queryManager:t,queryInfo:i,options:Ee(Ee({},e),{fetchPolicy:"network-only"})});In(o.queryId===r),i.setObservableQuery(o),n.set(r,o)})),__DEV__&&r.size&&r.forEach((function(e,t){e||__DEV__&&In.warn("Unknown query "+("string"==typeof t?"named ":"")+JSON.stringify(t,null,2)+" requested in refetchQueries options.include array")})),n},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var n=[];return this.getObservableQueries(e?"all":"active").forEach((function(r,i){var o=r.options.fetchPolicy;r.resetLastResults(),(e||"standby"!==o&&"cache-only"!==o)&&n.push(r.refetch()),t.getQuery(i).setDiff(null)})),this.broadcastQueries(),Promise.all(n)},e.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},e.prototype.startGraphQLSubscription=function(e){var t=this,n=e.query,r=e.fetchPolicy,i=e.errorPolicy,o=e.variables,a=e.context,s=void 0===a?{}:a;n=this.transform(n).document,o=this.getVariables(n,o);var u=function(e){return t.getObservableFromLink(n,s,e).map((function(o){if("no-cache"!==r&&(ia(o,i)&&t.cache.write({query:n,result:o.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries()),Ai(o))throw new Ji({graphQLErrors:o.errors});return o}))};if(this.transform(n).hasClientExports){var c=this.localState.addExportedVariables(n,o,s).then(u);return new tr((function(e){var t=null;return c.then((function(n){return t=n.subscribe(e)}),e.error),function(){return t&&t.unsubscribe()}}))}return u(o)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.getQuery(e).stop(),this.queries.delete(e)},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach((function(e){return e.notify()}))},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,n,r){var i,o,a=this;void 0===r&&(r=null!==(i=null==t?void 0:t.queryDeduplication)&&void 0!==i?i:this.queryDeduplication);var s=this.transform(e).serverQuery;if(s){var u=this.inFlightLinkObservables,c=this.link,l={query:s,variables:n,operationName:Er(s)||void 0,context:this.prepareContext(Ee(Ee({},t),{forceFetch:!r}))};if(t=l.context,r){var p=u.get(s)||new Map;u.set(s,p);var f=Si(n);if(!(o=p.get(f))){var d=new Ki([ni(c,l)]);p.set(f,o=d),d.cleanup((function(){p.delete(f)&&p.size<1&&u.delete(s)}))}}else o=new Ki([ni(c,l)])}else o=new Ki([tr.of({data:{}})]),t=this.prepareContext(t);var h=this.transform(e).clientQuery;return h&&(o=xi(o,(function(e){return a.localState.runResolvers({document:h,remoteResult:e,context:t,variables:n})}))),o},e.prototype.getResultsFromLink=function(e,t,n){var r=e.lastRequestId=this.generateRequestId();return xi(this.getObservableFromLink(e.document,n.context,n.variables),(function(i){var o=Hi(i.errors);if(r>=e.lastRequestId){if(o&&"none"===n.errorPolicy)throw e.markError(new Ji({graphQLErrors:i.errors}));e.markResult(i,n,t),e.markReady()}var a={data:i.data,loading:!1,networkStatus:e.networkStatus||Yi.ready};return o&&"ignore"!==n.errorPolicy&&(a.errors=i.errors),a}),(function(t){var n=t.hasOwnProperty("graphQLErrors")?t:new Ji({networkError:t});throw r>=e.lastRequestId&&e.markError(n),n}))},e.prototype.fetchQueryObservable=function(e,t,n){var r=this;void 0===n&&(n=Yi.loading);var i=this.transform(t.query).document,o=this.getVariables(i,t.variables),a=this.getQuery(e),s=t.fetchPolicy,u=void 0===s?"cache-first":s,c=t.errorPolicy,l=void 0===c?"none":c,p=t.returnPartialData,f=void 0!==p&&p,d=t.notifyOnNetworkStatusChange,h=void 0!==d&&d,y=t.context,v=void 0===y?{}:y,m=Object.assign({},t,{query:i,variables:o,fetchPolicy:u,errorPolicy:l,returnPartialData:f,notifyOnNetworkStatusChange:h,context:v}),g=function(e){return m.variables=e,r.fetchQueryByPolicy(a,m,n)};this.fetchCancelFns.set(e,(function(e){setTimeout((function(){return b.cancel(e)}))}));var b=new Ki(this.transform(m.query).hasClientExports?this.localState.addExportedVariables(m.query,m.variables,m.context).then(g):g(m.variables));return b.cleanup((function(){r.fetchCancelFns.delete(e),function(e){var t=e.fetchPolicy,n=void 0===t?"cache-first":t,r=e.nextFetchPolicy;r&&(e.fetchPolicy="function"==typeof r?r.call(e,n):r)}(t)})),b},e.prototype.refetchQueries=function(e){var t=this,n=e.updateCache,r=e.include,i=e.optimistic,o=void 0!==i&&i,a=e.removeOptimistic,s=void 0===a?o?zi("refetchQueries"):void 0:a,u=e.onQueryUpdated,c=new Map;r&&this.getObservableQueries(r).forEach((function(e,n){c.set(n,{oq:e,lastDiff:t.getQuery(n).getDiff()})}));var l=new Map;return n&&this.cache.batch({update:n,optimistic:o&&s||!1,removeOptimistic:s,onWatchUpdated:function(e,t,n){var r=e.watcher instanceof ra&&e.watcher.observableQuery;if(r){if(u){c.delete(r.queryId);var i=u(r,t,n);return!0===i&&(i=r.refetch()),!1!==i&&l.set(r,i),!1}null!==u&&c.set(r.queryId,{oq:r,lastDiff:n,diff:t})}}}),c.size&&c.forEach((function(e,n){var r,i=e.oq,o=e.lastDiff,a=e.diff;if(u){if(!a){var s=i.queryInfo;s.reset(),a=s.getDiff()}r=u(i,a,o)}u&&!0!==r||(r=i.refetch()),!1!==r&&l.set(i,r),n.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(n)})),s&&this.cache.removeOptimistic(s),l},e.prototype.fetchQueryByPolicy=function(e,t,n){var r=this,i=t.query,o=t.variables,a=t.fetchPolicy,s=t.refetchWritePolicy,u=t.errorPolicy,c=t.returnPartialData,l=t.context,p=t.notifyOnNetworkStatusChange,f=e.networkStatus;e.init({document:i,variables:o,networkStatus:n});var d=function(){return e.getDiff(o)},h=function(t,n){void 0===n&&(n=e.networkStatus||Yi.loading);var a=t.result;!__DEV__||c||ci(a,{})||so(t.missing);var s=function(e){return tr.of(Ee({data:e,loading:Xi(n),networkStatus:n},t.complete?null:{partial:!0}))};return a&&r.transform(i).hasForcedResolvers?r.localState.runResolvers({document:i,remoteResult:{data:a},context:l,variables:o,onlyRunForcedResolvers:!0}).then((function(e){return s(e.data||void 0)})):s(a)},y="no-cache"===a?0:n===Yi.refetch&&"merge"!==s?1:2,v=function(){return r.getResultsFromLink(e,y,{variables:o,context:l,fetchPolicy:a,errorPolicy:u})},m=p&&"number"==typeof f&&f!==n&&Xi(n);switch(a){default:case"cache-first":return(g=d()).complete?[h(g,e.markReady())]:c||m?[h(g),v()]:[v()];case"cache-and-network":var g;return(g=d()).complete||c||m?[h(g),v()]:[v()];case"cache-only":return[h(d(),e.markReady())];case"network-only":return m?[h(d()),v()]:[v()];case"no-cache":return m?[h(e.getDiff()),v()]:[v()];case"standby":return[]}},e.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new ra(this,e)),this.queries.get(e)},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return Ee(Ee({},t),{clientAwareness:this.clientAwareness})},e}(),sa=!1;function ua(e,t){return ri(e,t,t.variables&&{variables:Ee(Ee({},e.variables),t.variables)})}var ca=function(){function e(e){var t=this;this.defaultOptions={},this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=e.uri,r=e.credentials,i=e.headers,o=e.cache,a=e.ssrMode,s=void 0!==a&&a,u=e.ssrForceFetchDelay,c=void 0===u?0:u,l=e.connectToDevTools,p=void 0===l?"object"==typeof window&&!window.__APOLLO_CLIENT__&&__DEV__:l,f=e.queryDeduplication,d=void 0===f||f,h=e.defaultOptions,y=e.assumeImmutableResults,v=void 0!==y&&y,m=e.resolvers,g=e.typeDefs,b=e.fragmentMatcher,E=e.name,_=e.version,w=e.link;if(w||(w=n?new ti({uri:n,credentials:r,headers:i}):Ar.empty()),!o)throw __DEV__?new wn("To initialize Apollo Client, you must specify a 'cache' property in the options object. \nFor more information, please visit: https://go.apollo.dev/c/docs"):new wn(9);if(this.link=w,this.cache=o,this.disableNetworkFetches=s||c>0,this.queryDeduplication=d,this.defaultOptions=h||{},this.typeDefs=g,c&&setTimeout((function(){return t.disableNetworkFetches=!1}),c),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),p&&"object"==typeof window&&(window.__APOLLO_CLIENT__=this),!sa&&__DEV__&&(sa=!0,"undefined"!=typeof window&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var I=window.navigator,T=I&&I.userAgent,O=void 0;"string"==typeof T&&(T.indexOf("Chrome/")>-1?O="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":T.indexOf("Firefox/")>-1&&(O="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),O&&__DEV__&&In.log("Download the Apollo DevTools for a better development experience: "+O)}this.version="3.4.17",this.localState=new Zo({cache:o,client:this,resolvers:m,fragmentMatcher:b}),this.queryManager=new aa({cache:this.cache,link:this.link,queryDeduplication:d,ssrMode:s,clientAwareness:{name:E,version:_},localState:this.localState,assumeImmutableResults:v,onBroadcast:p?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=ua(this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=Ee(Ee({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=ua(this.defaultOptions.query,e)),__DEV__?In("cache-and-network"!==e.fetchPolicy,"The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):In("cache-and-network"!==e.fetchPolicy,10),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=Ee(Ee({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=ua(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){this.cache.writeQuery(e),this.queryManager.broadcastQueries()},e.prototype.writeFragment=function(e){this.cache.writeFragment(e),this.queryManager.broadcastQueries()},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return ni(this.link,e)},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!1})})).then((function(){return Promise.all(e.resetStoreCallbacks.map((function(e){return e()})))})).then((function(){return e.reFetchObservableQueries()}))},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!0})})).then((function(){return Promise.all(e.clearStoreCallbacks.map((function(e){return e()})))}))},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),n=[],r=[];t.forEach((function(e,t){n.push(t),r.push(e)}));var i=Promise.all(r);return i.queries=n,i.results=r,i.catch((function(e){__DEV__&&In.debug("In client.refetchQueries, Promise.all promise rejected with error "+e)})),i},e.prototype.getObservableQueries=function(e){return void 0===e&&(e="active"),this.queryManager.getObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e.prototype.setLink=function(e){this.link=this.queryManager.link=e},e}(),la=function(){function e(){this.getFragmentDoc=$o(rr)}return e.prototype.batch=function(e){var t="string"==typeof e.optimistic?e.optimistic:!1===e.optimistic?null:void 0;this.performTransaction(e.update,t)},e.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},e.prototype.transformDocument=function(e){return e},e.prototype.identify=function(e){},e.prototype.gc=function(){return[]},e.prototype.modify=function(e){return!1},e.prototype.transformForLink=function(e){return e},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read(Ee(Ee({},e),{rootId:e.id||"ROOT_QUERY",optimistic:t}))},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read(Ee(Ee({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:t}))},e.prototype.writeQuery=function(e){var t=e.id,n=e.data,r=_e(e,["id","data"]);return this.write(Object.assign(r,{dataId:t||"ROOT_QUERY",result:n}))},e.prototype.writeFragment=function(e){var t=e.id,n=e.data,r=e.fragment,i=e.fragmentName,o=_e(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(r,i),dataId:t,result:n}))},e}(),pa=function(e){function t(n,r,i,o){var a=e.call(this,n)||this;return a.message=n,a.path=r,a.query=i,a.variables=o,a.__proto__=t.prototype,a}return be(t,e),t}(Error);function fa(e){return __DEV__&&(t=e,(n=new Set([t])).forEach((function(e){nr(e)&&function(e){if(__DEV__&&!Object.isFrozen(e))try{Object.freeze(e)}catch(e){if(e instanceof TypeError)return null;throw e}return e}(e)===e&&Object.getOwnPropertyNames(e).forEach((function(t){nr(e[t])&&n.add(e[t])}))}))),e;var t,n}var da=Object.prototype.hasOwnProperty;function ha(e,t){var n=e.__typename,r=e.id,i=e._id;if("string"==typeof n&&(t&&(t.keyObject=void 0!==r?{id:r}:void 0!==i?{_id:i}:void 0),void 0===r&&(r=i),void 0!==r))return n+":"+("number"==typeof r||"string"==typeof r?r:JSON.stringify(r))}var ya={dataIdFromObject:ha,addTypename:!0,resultCaching:!0,canonizeResults:!1};function va(e){var t=e.canonizeResults;return void 0===t?ya.canonizeResults:t}var ma=/^[_a-z][_0-9a-z]*/i;function ga(e){var t=e.match(ma);return t?t[0]:e}function ba(e,t,n){return!!nr(t)&&(Array.isArray(t)?t.every((function(t){return ba(e,t,n)})):e.selections.every((function(e){if(vr(e)&&qi(e,n)){var r=hr(e);return da.call(t,r)&&(!e.selectionSet||ba(e.selectionSet,t[r],n))}return!0})))}function Ea(e){return nr(e)&&!sr(e)&&!Array.isArray(e)}var _a=Object.create(null),wa=function(){return _a},Ia=Object.create(null),Ta=function(){function e(e,t){var n=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(e,t){return fa(sr(e)?n.get(e.__ref,t):e&&e[t])},this.canRead=function(e){return sr(e)?n.has(e.__ref):"object"==typeof e},this.toReference=function(e,t){if("string"==typeof e)return ar(e);if(sr(e))return e;var r=n.policies.identify(e)[0];if(r){var i=ar(r);return t&&n.merge(r,e),i}}}return e.prototype.toObject=function(){return Ee({},this.data)},e.prototype.has=function(e){return void 0!==this.lookup(e,!0)},e.prototype.get=function(e,t){if(this.group.depend(e,t),da.call(this.data,e)){var n=this.data[e];if(n&&da.call(n,t))return n[t]}return"__typename"===t&&da.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof xa?this.parent.get(e,t):void 0},e.prototype.lookup=function(e,t){return t&&this.group.depend(e,"__exists"),da.call(this.data,e)?this.data[e]:this instanceof xa?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?Object.create(null):void 0},e.prototype.merge=function(e,t){var n,r=this;sr(e)&&(e=e.__ref),sr(t)&&(t=t.__ref);var i="string"==typeof e?this.lookup(n=e):e,o="string"==typeof t?this.lookup(n=t):t;if(o){__DEV__?In("string"==typeof n,"store.merge expects a string ID"):In("string"==typeof n,1);var a=new fo(ka).merge(i,o);if(this.data[n]=a,a!==i&&(delete this.refs[n],this.group.caching)){var s=Object.create(null);i||(s.__exists=1),Object.keys(o).forEach((function(e){if(!i||i[e]!==a[e]){s[e]=1;var t=ga(e);t===e||r.policies.hasKeyArgs(a.__typename,t)||(s[t]=1),void 0!==a[e]||r instanceof xa||delete a[e]}})),!s.__typename||i&&i.__typename||this.policies.rootTypenamesById[n]!==a.__typename||delete s.__typename,Object.keys(s).forEach((function(e){return r.group.dirty(n,e)}))}}},e.prototype.modify=function(e,t){var n=this,r=this.lookup(e);if(r){var i=Object.create(null),o=!1,a=!0,s={DELETE:_a,INVALIDATE:Ia,isReference:sr,toReference:this.toReference,canRead:this.canRead,readField:function(t,r){return n.policies.readField("string"==typeof t?{fieldName:t,from:r||ar(e)}:t,{store:n})}};if(Object.keys(r).forEach((function(u){var c=ga(u),l=r[u];if(void 0!==l){var p="function"==typeof t?t:t[u]||t[c];if(p){var f=p===wa?_a:p(fa(l),Ee(Ee({},s),{fieldName:c,storeFieldName:u,storage:n.getStorage(e,u)}));f===Ia?n.group.dirty(e,u):(f===_a&&(f=void 0),f!==l&&(i[u]=f,o=!0,l=f))}void 0!==l&&(a=!1)}})),o)return this.merge(e,i),a&&(this instanceof xa?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},e.prototype.delete=function(e,t,n){var r,i=this.lookup(e);if(i){var o=this.getFieldValue(i,"__typename"),a=t&&n?this.policies.getStoreFieldName({typename:o,fieldName:t,args:n}):t;return this.modify(e,a?((r={})[a]=wa,r):wa)}return!1},e.prototype.evict=function(e,t){var n=!1;return e.id&&(da.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof xa&&this!==t&&(n=this.parent.evict(e,t)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var e=this,t=this.toObject(),n=[];return this.getRootIdSet().forEach((function(t){da.call(e.policies.rootTypenamesById,t)||n.push(t)})),n.length&&(t.__META={extraRootIds:n.sort()}),t},e.prototype.replace=function(e){var t=this;if(Object.keys(this.data).forEach((function(n){e&&da.call(e,n)||t.delete(n)})),e){var n=e.__META,r=_e(e,["__META"]);Object.keys(r).forEach((function(e){t.merge(e,r[e])})),n&&n.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},e.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},e.prototype.getRootIdSet=function(e){return void 0===e&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof xa?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},e.prototype.gc=function(){var e=this,t=this.getRootIdSet(),n=this.toObject();t.forEach((function(r){da.call(n,r)&&(Object.keys(e.findChildRefIds(r)).forEach(t.add,t),delete n[r])}));var r=Object.keys(n);if(r.length){for(var i=this;i instanceof xa;)i=i.parent;r.forEach((function(e){return i.delete(e)}))}return r},e.prototype.findChildRefIds=function(e){if(!da.call(this.refs,e)){var t=this.refs[e]=Object.create(null),n=this.data[e];if(!n)return t;var r=new Set([n]);r.forEach((function(e){sr(e)&&(t[e.__ref]=!0),nr(e)&&Object.keys(e).forEach((function(t){var n=e[t];nr(n)&&r.add(n)}))}))}return this.refs[e]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),Oa=function(){function e(e,t){void 0===t&&(t=null),this.caching=e,this.parent=t,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?Qo():null,this.keyMaker=new _i(wi)},e.prototype.depend=function(e,t){if(this.d){this.d(Sa(e,t));var n=ga(t);n!==t&&this.d(Sa(e,n)),this.parent&&this.parent.depend(e,t)}},e.prototype.dirty=function(e,t){this.d&&this.d.dirty(Sa(e,t),"__exists"===t?"forget":"setDirty")},e}();function Sa(e,t){return t+"#"+e}function Da(e,t){Na(e)&&e.group.depend(t,"__exists")}!function(e){var t=function(e){function t(t){var n=t.policies,r=t.resultCaching,i=void 0===r||r,o=t.seed,a=e.call(this,n,new Oa(i))||this;return a.stump=new Aa(a),a.storageTrie=new _i(wi),o&&a.replace(o),a}return be(t,e),t.prototype.addLayer=function(e,t){return this.stump.addLayer(e,t)},t.prototype.removeLayer=function(){return this},t.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},t}(e);e.Root=t}(Ta||(Ta={}));var xa=function(e){function t(t,n,r,i){var o=e.call(this,n.policies,i)||this;return o.id=t,o.parent=n,o.replay=r,o.group=i,r(o),o}return be(t,e),t.prototype.addLayer=function(e,n){return new t(e,this,n,this.group)},t.prototype.removeLayer=function(e){var t=this,n=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach((function(e){var r=t.data[e],i=n.lookup(e);i?r?r!==i&&Object.keys(r).forEach((function(n){ci(r[n],i[n])||t.group.dirty(e,n)})):(t.group.dirty(e,"__exists"),Object.keys(i).forEach((function(n){t.group.dirty(e,n)}))):t.delete(e)})),n):n===this.parent?this:n.addLayer(this.id,this.replay)},t.prototype.toObject=function(){return Ee(Ee({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(t){var n=this.parent.findChildRefIds(t);return da.call(this.data,t)?Ee(Ee({},n),e.prototype.findChildRefIds.call(this,t)):n},t.prototype.getStorage=function(){for(var e=this.parent;e.parent;)e=e.parent;return e.getStorage.apply(e,arguments)},t}(Ta),Aa=function(e){function t(t){return e.call(this,"EntityStore.Stump",t,(function(){}),new Oa(t.group.caching,t.group))||this}return be(t,e),t.prototype.removeLayer=function(){return this},t.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},t}(xa);function ka(e,t,n){var r=e[n],i=t[n];return ci(r,i)?r:i}function Na(e){return!!(e instanceof Ta&&e.group.caching)}function Pa(e,t){return new pa(e.message,t.path.slice(),t.query,t.variables)}function Ca(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var Ra=function(){function e(e){var t=this;this.knownResults=new(wi?WeakMap:Map),this.config=ri(e,{addTypename:!1!==e.addTypename,canonizeResults:va(e)}),this.canon=e.canon||new Oi,this.executeSelectionSet=$o((function(e){var n,r=e.context.canonizeResults,i=Ca(e);i[3]=!r;var o=(n=t.executeSelectionSet).peek.apply(n,i);return o?r?Ee(Ee({},o),{result:t.canon.admit(o.result)}):o:(Da(e.context.store,e.enclosingRef.__ref),t.execSelectionSetImpl(e))}),{max:this.config.resultCacheMaxSize,keyArgs:Ca,makeCacheKey:function(e,t,n,r){if(Na(n.store))return n.store.makeCacheKey(e,sr(t)?t.__ref:t,n.varString,r)}}),this.executeSubSelectedArray=$o((function(e){return Da(e.context.store,e.enclosingRef.__ref),t.execSubSelectedArrayImpl(e)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var t=e.field,n=e.array,r=e.context;if(Na(r.store))return r.store.makeCacheKey(t,n,r.varString)}})}return e.prototype.resetCanon=function(){this.canon=new Oi},e.prototype.diffQueryAgainstStore=function(e){var t=e.store,n=e.query,r=e.rootId,i=void 0===r?"ROOT_QUERY":r,o=e.variables,a=e.returnPartialData,s=void 0===a||a,u=e.canonizeResults,c=void 0===u?this.config.canonizeResults:u,l=this.config.cache.policies;o=Ee(Ee({},Tr(wr(n))),o);var p=ar(i),f=this.executeSelectionSet({selectionSet:Ir(n).selectionSet,objectOrReference:p,enclosingRef:p,context:{store:t,query:n,policies:l,variables:o,varString:Si(o),canonizeResults:c,fragmentMap:ir(_r(n)),path:[]}}),d=f.missing&&f.missing.length>0;if(d&&!s)throw f.missing[0];return{result:f.result,missing:f.missing,complete:!d}},e.prototype.isFresh=function(e,t,n,r){if(Na(r.store)&&this.knownResults.get(e)===n){var i=this.executeSelectionSet.peek(n,t,r,this.canon.isKnown(e));if(i&&e===i.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(e){var t=this,n=e.selectionSet,r=e.objectOrReference,i=e.enclosingRef,o=e.context;if(sr(r)&&!o.policies.rootTypenamesById[r.__ref]&&!o.store.has(r.__ref))return{result:this.canon.empty,missing:[Pa(__DEV__?new wn("Dangling reference to missing "+r.__ref+" object"):new wn(5),o)]};var a=o.variables,s=o.policies,u=o.store,c=[],l={result:null},p=u.getFieldValue(r,"__typename");function f(){return l.missing||(l.missing=[])}function d(e){var t;return e.missing&&(t=f()).push.apply(t,e.missing),e.result}this.config.addTypename&&"string"==typeof p&&!s.rootIdsByTypename[p]&&c.push({__typename:p});var h=new Set(n.selections);h.forEach((function(e){var n;if(qi(e,a))if(vr(e)){var u=s.readField({fieldName:e.name.value,field:e,variables:o.variables,from:r},o),l=hr(e);o.path.push(l),void 0===u?Mi.added(e)||f().push(Pa(__DEV__?new wn("Can't find field '"+e.name.value+"' on "+(sr(r)?r.__ref+" object":"object "+JSON.stringify(r,null,2))):new wn(6),o)):Array.isArray(u)?u=d(t.executeSubSelectedArray({field:e,array:u,enclosingRef:i,context:o})):e.selectionSet?null!=u&&(u=d(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:u,enclosingRef:sr(u)?u:i,context:o}))):o.canonizeResults&&(u=t.canon.pass(u)),void 0!==u&&c.push(((n={})[l]=u,n)),In(o.path.pop()===l)}else{var y=or(e,o.fragmentMap);y&&s.fragmentMatches(y,p)&&y.selectionSet.selections.forEach(h.add,h)}}));var y=lo(c);return l.result=o.canonizeResults?this.canon.admit(y):fa(y),this.knownResults.set(l.result,n),l},e.prototype.execSubSelectedArrayImpl=function(e){var t,n=this,r=e.field,i=e.array,o=e.enclosingRef,a=e.context;function s(e,n){return e.missing&&(t=t||[]).push.apply(t,e.missing),In(a.path.pop()===n),e.result}return r.selectionSet&&(i=i.filter(a.store.canRead)),i=i.map((function(e,t){return null===e?null:(a.path.push(t),Array.isArray(e)?s(n.executeSubSelectedArray({field:r,array:e,enclosingRef:o,context:a}),t):r.selectionSet?s(n.executeSelectionSet({selectionSet:r.selectionSet,objectOrReference:e,enclosingRef:sr(e)?e:o,context:a}),t):(__DEV__&&function(e,t,n){if(!t.selectionSet){var r=new Set([n]);r.forEach((function(n){nr(n)&&(__DEV__?In(!sr(n),"Missing selection set for object of type "+function(e,t){return sr(t)?e.get(t.__ref,"__typename"):t&&t.__typename}(e,n)+" returned for query field "+t.name.value):In(!sr(n),7),Object.values(n).forEach(r.add,r))}))}}(a.store,r,e),In(a.path.pop()===t),e))})),{result:a.canonizeResults?this.canon.admit(i):i,missing:t}},e}(),Fa=function(){function e(e,t){this.cache=e,this.reader=t}return e.prototype.writeToStore=function(e,t){var n=this,r=t.query,i=t.result,o=t.dataId,a=t.variables,s=t.overwrite,u=br(r),c=new fo;a=Ee(Ee({},Tr(u)),a);var l={store:e,written:Object.create(null),merge:function(e,t){return c.merge(e,t)},variables:a,varString:Si(a),fragmentMap:ir(_r(r)),overwrite:!!s,incomingById:new Map,clientOnly:!1},p=this.processSelectionSet({result:i||Object.create(null),dataId:o,selectionSet:u.selectionSet,mergeTree:{map:new Map},context:l});if(!sr(p))throw __DEV__?new wn("Could not identify object "+JSON.stringify(i)):new wn(8);return l.incomingById.forEach((function(t,r){var i=t.fields,o=t.mergeTree,a=t.selections,s=ar(r);if(o&&o.map.size){var u=n.applyMerges(o,s,i,l);if(sr(u))return;i=u}if(__DEV__&&!l.overwrite){var c=new Set;a.forEach((function(e){vr(e)&&e.selectionSet&&c.add(e.name.value)})),Object.keys(i).forEach((function(e){(function(e){return c.has(ga(e))})(e)&&!function(e){var t=o&&o.map.get(e);return Boolean(t&&t.info&&t.info.merge)}(e)&&function(e,t,n,r){var i=function(e){var t=r.getFieldValue(e,n);return"object"==typeof t&&t},o=i(e);if(o){var a=i(t);if(a&&!sr(o)&&!ci(o,a)&&!Object.keys(o).every((function(e){return void 0!==r.getFieldValue(a,e)}))){var s=r.getFieldValue(e,"__typename")||r.getFieldValue(t,"__typename"),u=ga(n),c=s+"."+u;if(!Va.has(c)){Va.add(c);var l=[];Array.isArray(o)||Array.isArray(a)||[o,a].forEach((function(e){var t=r.getFieldValue(e,"__typename");"string"!=typeof t||l.includes(t)||l.push(t)})),__DEV__&&In.warn("Cache data may be lost when replacing the "+u+" field of a "+s+" object.\n\nTo address this problem (which is not a bug in Apollo Client), "+(l.length?"either ensure all objects of type "+l.join(" and ")+" have an ID or a custom merge function, or ":"")+"define a custom merge function for the "+c+" field, so InMemoryCache can safely merge these objects:\n\n existing: "+JSON.stringify(o).slice(0,1e3)+"\n incoming: "+JSON.stringify(a).slice(0,1e3)+"\n\nFor more information about these options, please refer to the documentation:\n\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n")}}}}(s,i,e,l.store)}))}e.merge(r,i)})),e.retain(p.__ref),p},e.prototype.processSelectionSet=function(e){var t=this,n=e.dataId,r=e.result,i=e.selectionSet,o=e.context,a=e.mergeTree,s=this.cache.policies,u=s.identify(r,i,o.fragmentMap),c=u[0],l=u[1];if("string"==typeof(n=n||c)){var p=o.written[n]||(o.written[n]=[]),f=ar(n);if(p.indexOf(i)>=0)return f;if(p.push(i),this.reader&&this.reader.isFresh(r,f,i,o))return f}var d=Object.create(null);l&&(d=o.merge(d,l));var h=n&&s.rootTypenamesById[n]||yr(r,i,o.fragmentMap)||n&&o.store.get(n,"__typename");"string"==typeof h&&(d.__typename=h);var y=new Set(i.selections);if(y.forEach((function(e){var n;if(qi(e,o.variables))if(vr(e)){var i=hr(e),u=r[i],c=o.clientOnly;if(o.clientOnly=c||!(!e.directives||!e.directives.some((function(e){return"client"===e.name.value}))),void 0!==u){var l=s.getStoreFieldName({typename:h,fieldName:e.name.value,field:e,variables:o.variables}),p=ja(a,l),f=t.processFieldValue(u,e,o,p),v=void 0;if(e.selectionSet&&!(v=o.store.getFieldValue(f,"__typename"))&&sr(f)){var m=o.incomingById.get(f.__ref);v=m&&m.fields.__typename}var g=s.getMergeFunction(h,e.name.value,v);g?p.info={field:e,typename:h,merge:g}:qa(a,l),d=o.merge(d,((n={})[l]=f,n))}else o.clientOnly||Mi.added(e)||__DEV__&&In.error(("Missing field '"+hr(e)+"' while writing result "+JSON.stringify(r,null,2)).substring(0,1e3));o.clientOnly=c}else{var b=or(e,o.fragmentMap);b&&s.fragmentMatches(b,h,r,o.variables)&&b.selectionSet.selections.forEach(y.add,y)}})),"string"==typeof n){var v=o.incomingById.get(n);return v?(v.fields=o.merge(v.fields,d),v.mergeTree=Ua(v.mergeTree,a),v.selections.forEach(y.add,y),v.selections=y):o.incomingById.set(n,{fields:d,mergeTree:La(a)?void 0:a,selections:y}),ar(n)}return d},e.prototype.processFieldValue=function(e,t,n,r){var i=this;return t.selectionSet&&null!==e?Array.isArray(e)?e.map((function(e,o){var a=i.processFieldValue(e,t,n,ja(r,o));return qa(r,o),a})):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:r}):__DEV__?eo(e):e},e.prototype.applyMerges=function(e,t,n,r,i){var o,a=this;if(e.map.size&&!sr(n)){var s,u=Array.isArray(n)||!sr(t)&&!Ea(t)?void 0:t,c=n;u&&!i&&(i=[sr(u)?u.__ref:u]);var l=function(e,t){return Array.isArray(e)?"number"==typeof t?e[t]:void 0:r.store.getFieldValue(e,String(t))};e.map.forEach((function(e,t){var n=l(u,t),o=l(c,t);if(void 0!==o){i&&i.push(t);var p=a.applyMerges(e,n,o,r,i);p!==o&&(s=s||new Map).set(t,p),i&&In(i.pop()===t)}})),s&&(n=Array.isArray(c)?c.slice(0):Ee({},c),s.forEach((function(e,t){n[t]=e})))}return e.info?this.cache.policies.runMergeFunction(t,n,e.info,r,i&&(o=r.store).getStorage.apply(o,i)):n},e}(),Ma=[];function ja(e,t){var n=e.map;return n.has(t)||n.set(t,Ma.pop()||{map:new Map}),n.get(t)}function Ua(e,t){if(e===t||!t||La(t))return e;if(!e||La(e))return t;var n=e.info&&t.info?Ee(Ee({},e.info),t.info):e.info||t.info,r=e.map.size&&t.map.size,i={info:n,map:r?new Map:e.map.size?e.map:t.map};if(r){var o=new Set(t.map.keys());e.map.forEach((function(e,n){i.map.set(n,Ua(e,t.map.get(n))),o.delete(n)})),o.forEach((function(n){i.map.set(n,Ua(t.map.get(n),e.map.get(n)))}))}return i}function La(e){return!e||!(e.info||e.map.size)}function qa(e,t){var n=e.map,r=n.get(t);r&&La(r)&&(Ma.push(r),n.delete(t))}var Va=new Set;function Ba(e){var t=zi("stringifyForDisplay");return JSON.stringify(e,(function(e,n){return void 0===n?t:n})).split(JSON.stringify(t)).join("<undefined>")}function Qa(e){return void 0!==e.args?e.args:e.field?dr(e.field,e.variables):null}lr.setStringify(Si);var za=function(){},Ga=function(e,t){return t.fieldName},$a=function(e,t,n){return(0,n.mergeObjects)(e,t)},Wa=function(e,t){return t},Ka=function(){function e(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=Ee({dataIdFromObject:ha},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return e.prototype.identify=function(e,t,n){var r=t&&n?yr(e,t,n):e.__typename;if(r===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var i,o={typename:r,selectionSet:t,fragmentMap:n},a=r&&this.getTypePolicy(r),s=a&&a.keyFn||this.config.dataIdFromObject;s;){var u=s(e,o);if(!Array.isArray(u)){i=u;break}s=Xa(u)}return i=i?String(i):void 0,o.keyObject?[i,o.keyObject]:[i]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach((function(n){var r=e[n],i=r.queryType,o=r.mutationType,a=r.subscriptionType,s=_e(r,["queryType","mutationType","subscriptionType"]);i&&t.setRootTypename("Query",n),o&&t.setRootTypename("Mutation",n),a&&t.setRootTypename("Subscription",n),da.call(t.toBeAdded,n)?t.toBeAdded[n].push(s):t.toBeAdded[n]=[s]}))},e.prototype.updateTypePolicy=function(e,t){var n=this,r=this.getTypePolicy(e),i=t.keyFields,o=t.fields;function a(e,t){e.merge="function"==typeof t?t:!0===t?$a:!1===t?Wa:e.merge}a(r,t.merge),r.keyFn=!1===i?za:Array.isArray(i)?Xa(i):"function"==typeof i?i:r.keyFn,o&&Object.keys(o).forEach((function(t){var r=n.getFieldPolicy(e,t,!0),i=o[t];if("function"==typeof i)r.read=i;else{var s=i.keyArgs,u=i.read,c=i.merge;r.keyFn=!1===s?Ga:Array.isArray(s)?Ja(s):"function"==typeof s?s:r.keyFn,"function"==typeof u&&(r.read=u),a(r,c)}r.read&&r.merge&&(r.keyFn=r.keyFn||Ga)}))},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var n="ROOT_"+e.toUpperCase(),r=this.rootTypenamesById[n];t!==r&&(__DEV__?In(!r||r===e,"Cannot change root "+e+" __typename more than once"):In(!r||r===e,2),r&&delete this.rootIdsByTypename[r],this.rootIdsByTypename[t]=n,this.rootTypenamesById[n]=t)},e.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach((function(n){t.getSupertypeSet(n,!0),e[n].forEach((function(e){t.getSupertypeSet(e,!0).add(n);var r=e.match(ma);r&&r[0]===e||t.fuzzySubtypes.set(e,new RegExp(e))}))}))},e.prototype.getTypePolicy=function(e){var t=this;if(!da.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var r=this.supertypeMap.get(e);r&&r.size&&r.forEach((function(e){var r=t.getTypePolicy(e),i=r.fields,o=_e(r,["fields"]);Object.assign(n,o),Object.assign(n.fields,i)}))}var i=this.toBeAdded[e];return i&&i.length&&i.splice(0).forEach((function(n){t.updateTypePolicy(e,n)})),this.typePolicies[e]},e.prototype.getFieldPolicy=function(e,t,n){if(e){var r=this.getTypePolicy(e).fields;return r[t]||n&&(r[t]=Object.create(null))}},e.prototype.getSupertypeSet=function(e,t){var n=this.supertypeMap.get(e);return!n&&t&&this.supertypeMap.set(e,n=new Set),n},e.prototype.fragmentMatches=function(e,t,n,r){var i=this;if(!e.typeCondition)return!0;if(!t)return!1;var o=e.typeCondition.name.value;if(t===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var a=this.getSupertypeSet(t,!0),s=[a],u=function(e){var t=i.getSupertypeSet(e,!1);t&&t.size&&s.indexOf(t)<0&&s.push(t)},c=!(!n||!this.fuzzySubtypes.size),l=!1,p=0;p<s.length;++p){var f=s[p];if(f.has(o))return a.has(o)||(l&&__DEV__&&In.warn("Inferring subtype "+t+" of supertype "+o),a.add(o)),!0;f.forEach(u),c&&p===s.length-1&&ba(e.selectionSet,n,r)&&(c=!1,l=!0,this.fuzzySubtypes.forEach((function(e,n){var r=t.match(e);r&&r[0]===t&&u(n)})))}return!1},e.prototype.hasKeyArgs=function(e,t){var n=this.getFieldPolicy(e,t,!1);return!(!n||!n.keyFn)},e.prototype.getStoreFieldName=function(e){var t,n=e.typename,r=e.fieldName,i=this.getFieldPolicy(n,r,!1),o=i&&i.keyFn;if(o&&n)for(var a={typename:n,fieldName:r,field:e.field||null,variables:e.variables},s=Qa(e);o;){var u=o(s,a);if(!Array.isArray(u)){t=u||r;break}o=Ja(u)}return void 0===t&&(t=e.field?function(e,t){var n=null;e.directives&&(n={},e.directives.forEach((function(e){n[e.name.value]={},e.arguments&&e.arguments.forEach((function(r){var i=r.name,o=r.value;return ur(n[e.name.value],i,o,t)}))})));var r=null;return e.arguments&&e.arguments.length&&(r={},e.arguments.forEach((function(e){var n=e.name,i=e.value;return ur(r,n,i,t)}))),lr(e.name.value,r,n)}(e.field,e.variables):lr(r,Qa(e))),!1===t?r:r===ga(t)?t:r+":"+t},e.prototype.readField=function(e,t){var n=e.from;if(n&&(e.field||e.fieldName)){if(void 0===e.typename){var r=t.store.getFieldValue(n,"__typename");r&&(e.typename=r)}var i=this.getStoreFieldName(e),o=ga(i),a=t.store.getFieldValue(n,i),s=this.getFieldPolicy(e.typename,o,!1),u=s&&s.read;if(u){var c=Ha(this,n,e,t,t.store.getStorage(sr(n)?n.__ref:n,i));return Wo.withValue(this.cache,u,[a,c])}return a}},e.prototype.getMergeFunction=function(e,t,n){var r=this.getFieldPolicy(e,t,!1),i=r&&r.merge;return!i&&n&&(i=(r=this.getTypePolicy(n))&&r.merge),i},e.prototype.runMergeFunction=function(e,t,n,r,i){var o=n.field,a=n.typename,s=n.merge;return s===$a?Ya(r.store)(e,t):s===Wa?t:(r.overwrite&&(e=void 0),s(e,t,Ha(this,void 0,{typename:a,fieldName:o.name.value,field:o,variables:r.variables},r,i||Object.create(null))))},e}();function Ha(e,t,n,r,i){var o=e.getStoreFieldName(n),a=ga(o),s=n.variables||r.variables,u=r.store,c=u.toReference,l=u.canRead;return{args:Qa(n),field:n.field||null,fieldName:a,storeFieldName:o,variables:s,isReference:sr,toReference:c,storage:i,cache:e.cache,canRead:l,readField:function(n,i){var o;if("string"==typeof n)o={fieldName:n,from:arguments.length>1?i:t};else{if(!nr(n))return void(__DEV__&&In.warn("Unexpected readField arguments: "+Ba(Array.from(arguments))));o=Ee({},n),da.call(n,"from")||(o.from=t)}return __DEV__&&void 0===o.from&&__DEV__&&In.warn("Undefined 'from' passed to readField with arguments "+Ba(Array.from(arguments))),void 0===o.variables&&(o.variables=s),e.readField(o,r)},mergeObjects:Ya(r.store)}}function Ya(e){return function(t,n){if(Array.isArray(t)||Array.isArray(n))throw __DEV__?new wn("Cannot automatically merge arrays"):new wn(3);if(nr(t)&&nr(n)){var r=e.getFieldValue(t,"__typename"),i=e.getFieldValue(n,"__typename");if(r&&i&&r!==i)return n;if(sr(t)&&Ea(n))return e.merge(t.__ref,n),t;if(Ea(t)&&sr(n))return e.merge(t,n.__ref),n;if(Ea(t)&&Ea(n))return Ee(Ee({},t),n)}return n}}function Ja(e){return function(t,n){return t?n.fieldName+":"+JSON.stringify(es(t,e,!1)):n.fieldName}}function Xa(e){var t=new _i(wi);return function(n,r){var i;if(r.selectionSet&&r.fragmentMap){var o=t.lookupArray([r.selectionSet,r.fragmentMap]);i=o.aliasMap||(o.aliasMap=Za(r.selectionSet,r.fragmentMap))}var a=r.keyObject=es(n,e,!0,i);return r.typename+":"+JSON.stringify(a)}}function Za(e,t){var n=Object.create(null),r=new Set([e]);return r.forEach((function(e){e.selections.forEach((function(e){if(vr(e)){if(e.alias){var i=e.alias.value,o=e.name.value;o!==i&&((n.aliases||(n.aliases=Object.create(null)))[o]=i)}e.selectionSet&&((n.subsets||(n.subsets=Object.create(null)))[e.name.value]=Za(e.selectionSet,t))}else{var a=or(e,t);a&&r.add(a.selectionSet)}}))})),n}function es(e,t,n,r){var i,o,a=Object.create(null);return t.forEach((function(t){if(Array.isArray(t)){if("string"==typeof o&&"string"==typeof i){var s=r&&r.subsets,u=s&&s[o];a[o]=es(e[i],t,n,u)}}else{var c=r&&r.aliases,l=c&&c[t]||t;da.call(e,l)?a[o=t]=e[i=l]:(__DEV__?In(!n,"Missing field '"+l+"' while computing key fields"):In(!n,4),i=o=void 0)}})),a}var ts=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.watches=new Set,n.typenameDocumentCache=new Map,n.makeVar=Jo,n.txCount=0,n.config=function(e){return ri(ya,e)}(t),n.addTypename=!!n.config.addTypename,n.policies=new Ka({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return be(t,e),t.prototype.init=function(){var e=this.data=new Ta.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()},t.prototype.resetResultCache=function(e){var t=this,n=this.storeReader;this.storeWriter=new Fa(this,this.storeReader=new Ra({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:va(this.config),canon:e?void 0:n&&n.canon})),this.maybeBroadcastWatch=$o((function(e,n){return t.broadcastWatch(e,n)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var n=e.optimistic?t.optimisticData:t.data;if(Na(n)){var r=e.optimistic,i=e.rootId,o=e.variables;return n.makeCacheKey(e.query,e.callback,Si({optimistic:r,rootId:i,variables:o}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach((function(e){return e.resetCaching()}))},t.prototype.restore=function(e){return this.init(),e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).extract()},t.prototype.read=function(e){var t=e.returnPartialData,n=void 0!==t&&t;try{return this.storeReader.diffQueryAgainstStore(Ee(Ee({},e),{store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:n})).result||null}catch(e){if(e instanceof pa)return null;throw e}},t.prototype.write=function(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.modify=function(e){if(da.call(e,"id")&&!e.id)return!1;var t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.diff=function(e){return this.storeReader.diffQueryAgainstStore(Ee(Ee({},e),{store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(e){var t,n=this;return this.watches.size||Ho(t=this).vars.forEach((function(e){return e.attachCache(t)})),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){n.watches.delete(e)&&!n.watches.size&&Yo(n),n.maybeBroadcastWatch.forget(e)}},t.prototype.gc=function(e){Si.reset();var t=this.optimisticData.gc();return e&&!this.txCount&&(e.resetResultCache?this.resetResultCache(e.resetResultIdentities):e.resetResultIdentities&&this.storeReader.resetCanon()),t},t.prototype.retain=function(e,t){return(t?this.optimisticData:this.data).retain(e)},t.prototype.release=function(e,t){return(t?this.optimisticData:this.data).release(e)},t.prototype.identify=function(e){return sr(e)?e.__ref:this.policies.identify(e)[0]},t.prototype.evict=function(e){if(!e.id){if(da.call(e,"id"))return!1;e=Ee(Ee({},e),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(e,this.data)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.reset=function(e){var t=this;return this.init(),Si.reset(),e&&e.discardWatches?(this.watches.forEach((function(e){return t.maybeBroadcastWatch.forget(e)})),this.watches.clear(),Yo(this)):this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){var t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())},t.prototype.batch=function(e){var t=this,n=e.update,r=e.optimistic,i=void 0===r||r,o=e.removeOptimistic,a=e.onWatchUpdated,s=function(e){var r=t,i=r.data,o=r.optimisticData;++t.txCount,e&&(t.data=t.optimisticData=e);try{n(t)}finally{--t.txCount,t.data=i,t.optimisticData=o}},u=new Set;a&&!this.txCount&&this.broadcastWatches(Ee(Ee({},e),{onWatchUpdated:function(e){return u.add(e),!1}})),"string"==typeof i?this.optimisticData=this.optimisticData.addLayer(i,s):!1===i?s(this.data):s(),"string"==typeof o&&(this.optimisticData=this.optimisticData.removeLayer(o)),a&&u.size?(this.broadcastWatches(Ee(Ee({},e),{onWatchUpdated:function(e,t){var n=a.call(this,e,t);return!1!==n&&u.delete(e),n}})),u.size&&u.forEach((function(e){return t.maybeBroadcastWatch.dirty(e)}))):this.broadcastWatches(e)},t.prototype.performTransaction=function(e,t){return this.batch({update:e,optimistic:t||null!==t})},t.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(t=Mi(e),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}return e},t.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach((function(n){return t.maybeBroadcastWatch(n,e)}))},t.prototype.broadcastWatch=function(e,t){var n=e.lastDiff,r=this.diff(e);t&&(e.optimistic&&"string"==typeof t.optimistic&&(r.fromOptimisticTransaction=!0),t.onWatchUpdated&&!1===t.onWatchUpdated.call(this,e,r,n))||n&&ci(n.result,r.result)||e.callback(e.lastDiff=r,n)},t}(la);const ns=JSON.parse('{"g":{"Credentials":["HubspotCredentials","StripeCredentials","ZuoraCredentials"],"ResetPeriodConfiguration":["MonthlyResetPeriodConfig","WeeklyResetPeriodConfig"]}}');var rs=n(4098),is=n.n(rs),os=function(){function e(e){var t=e.batchDebounce,n=e.batchInterval,r=e.batchMax,i=e.batchHandler,o=e.batchKey;this.queuedRequests=new Map,this.batchDebounce=t,this.batchInterval=n,this.batchMax=r||0,this.batchHandler=i,this.batchKey=o||function(){return""}}return e.prototype.enqueueRequest=function(e){var t=this,n=Ee({},e),r=!1,i=this.batchKey(e.operation);return n.observable||(n.observable=new tr((function(e){t.queuedRequests.has(i)||t.queuedRequests.set(i,[]),r||(t.queuedRequests.get(i).push(n),r=!0),n.next=n.next||[],e.next&&n.next.push(e.next.bind(e)),n.error=n.error||[],e.error&&n.error.push(e.error.bind(e)),n.complete=n.complete||[],e.complete&&n.complete.push(e.complete.bind(e)),1===t.queuedRequests.get(i).length?t.scheduleQueueConsumption(i):t.batchDebounce&&(clearTimeout(t.scheduledBatchTimer),t.scheduleQueueConsumption(i)),t.queuedRequests.get(i).length===t.batchMax&&t.consumeQueue(i)}))),n.observable},e.prototype.consumeQueue=function(e){var t=e||"",n=this.queuedRequests.get(t);if(n){this.queuedRequests.delete(t);var r=n.map((function(e){return e.operation})),i=n.map((function(e){return e.forward})),o=[],a=[],s=[],u=[];n.forEach((function(e,t){o.push(e.observable),a.push(e.next),s.push(e.error),u.push(e.complete)}));var c=this.batchHandler(r,i)||tr.of(),l=function(e){s.forEach((function(t){t&&t.forEach((function(t){return t(e)}))}))};return c.subscribe({next:function(e){if(Array.isArray(e)||(e=[e]),a.length!==e.length){var t=new Error("server returned results with length "+e.length+", expected length of "+a.length);return t.result=e,l(t)}e.forEach((function(e,t){a[t]&&a[t].forEach((function(t){return t(e)}))}))},error:l,complete:function(){u.forEach((function(e){e&&e.forEach((function(e){return e()}))}))}}),o}},e.prototype.scheduleQueueConsumption=function(e){var t=this,n=e||"";this.scheduledBatchTimer=setTimeout((function(){t.queuedRequests.get(n)&&t.queuedRequests.get(n).length&&t.consumeQueue(n)}),this.batchInterval)},e}(),as=function(e){function t(t){var n=e.call(this)||this,r=t||{},i=r.batchDebounce,o=r.batchInterval,a=void 0===o?10:o,s=r.batchMax,u=void 0===s?0:s,c=r.batchHandler,l=void 0===c?function(){return null}:c,p=r.batchKey,f=void 0===p?function(){return""}:p;return n.batcher=new os({batchDebounce:i,batchInterval:a,batchMax:u,batchHandler:l,batchKey:f}),t.batchHandler.length<=1&&(n.request=function(e){return n.batcher.enqueueRequest({operation:e})}),n}return be(t,e),t.prototype.request=function(e,t){return this.batcher.enqueueRequest({operation:e,forward:t})},t}(Ar),ss=function(e){function t(t){var n=e.call(this)||this,r=t||{},i=r.uri,o=void 0===i?"/graphql":i,a=r.fetch,s=r.includeExtensions,u=r.batchInterval,c=r.batchDebounce,l=r.batchMax,p=r.batchKey,f=_e(r,["uri","fetch","includeExtensions","batchInterval","batchDebounce","batchMax","batchKey"]);Ur(a),a||(a=fetch);var d={http:{includeExtensions:s},options:f.fetchOptions,credentials:f.credentials,headers:f.headers};return n.batchDebounce=c,n.batchInterval=u||10,n.batchMax=l||10,p=p||function(e){var t=e.getContext(),n={http:t.http,options:t.fetchOptions,credentials:t.credentials,headers:t.headers};return Rr(e,o)+JSON.stringify(n)},n.batcher=new as({batchDebounce:n.batchDebounce,batchInterval:n.batchInterval,batchMax:n.batchMax,batchKey:p,batchHandler:function(e){var t=Rr(e[0],o),n=e[0].getContext(),r={};if(n.clientAwareness){var i=n.clientAwareness,s=i.name,u=i.version;s&&(r["apollographql-client-name"]=s),u&&(r["apollographql-client-version"]=u)}var c,l={http:n.http,options:n.fetchOptions,credentials:n.credentials,headers:Ee(Ee({},r),n.headers)},p=e.map((function(e){return Yr(e,Hr,d,l)})),f=p.map((function(e){return e.body})),h=p[0].options;if("GET"===h.method)return Zr(new Error("apollo-link-batch-http does not support GET requests"));try{h.body=Cr(f,"Payload")}catch(e){return Zr(e)}if(!h.signal){var y=Xr(),v=y.controller,m=y.signal;(c=v)&&(h.signal=m)}return new tr((function(n){return a(t,h).then((function(t){return e.forEach((function(e){return e.setContext({response:t})})),t})).then(jr(e)).then((function(e){return n.next(e),n.complete(),e})).catch((function(e){"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&n.next(e.result),n.error(e))})),function(){c&&c.abort()}}))}}),n}return be(t,e),t.prototype.request=function(e){return this.batcher.request(e)},t}(Ar),us=function(){function e(e,t,n,r){var i=this;this.operation=e,this.nextLink=t,this.delayFor=n,this.retryIf=r,this.retryCount=0,this.values=[],this.complete=!1,this.canceled=!1,this.observers=[],this.currentSubscription=null,this.onNext=function(e){i.values.push(e);for(var t=0,n=i.observers;t<n.length;t++){var r=n[t];r&&r.next(e)}},this.onComplete=function(){i.complete=!0;for(var e=0,t=i.observers;e<t.length;e++){var n=t[e];n&&n.complete()}},this.onError=function(e){return we(i,void 0,void 0,(function(){var t,n,r;return Ie(this,(function(i){switch(i.label){case 0:return this.retryCount+=1,[4,this.retryIf(this.retryCount,this.operation,e)];case 1:if(i.sent())return this.scheduleRetry(this.delayFor(this.retryCount,this.operation,e)),[2];for(this.error=e,t=0,n=this.observers;t<n.length;t++)(r=n[t])&&r.error(e);return[2]}}))}))}}return e.prototype.subscribe=function(e){if(this.canceled)throw new Error("Subscribing to a retryable link that was canceled is not supported");this.observers.push(e);for(var t=0,n=this.values;t<n.length;t++){var r=n[t];e.next(r)}this.complete?e.complete():this.error&&e.error(this.error)},e.prototype.unsubscribe=function(e){var t=this.observers.indexOf(e);if(t<0)throw new Error("RetryLink BUG! Attempting to unsubscribe unknown observer!");this.observers[t]=null,this.observers.every((function(e){return null===e}))&&this.cancel()},e.prototype.start=function(){this.currentSubscription||this.try()},e.prototype.cancel=function(){this.currentSubscription&&this.currentSubscription.unsubscribe(),clearTimeout(this.timerId),this.timerId=void 0,this.currentSubscription=null,this.canceled=!0},e.prototype.try=function(){this.currentSubscription=this.nextLink(this.operation).subscribe({next:this.onNext,error:this.onError,complete:this.onComplete})},e.prototype.scheduleRetry=function(e){var t=this;if(this.timerId)throw new Error("RetryLink BUG! Encountered overlapping retries");this.timerId=setTimeout((function(){t.timerId=void 0,t.try()}),e)},e}(),cs=function(e){function t(t){var n=e.call(this)||this,r=t||{},i=r.attempts,o=r.delay;return n.delayFor="function"==typeof o?o:function(e){var t=e||{},n=t.initial,r=void 0===n?300:n,i=t.jitter,o=void 0===i||i,a=t.max,s=void 0===a?1/0:a,u=o?r:r/2;return function(e){var t=Math.min(s,u*Math.pow(2,e));return o&&(t=Math.random()*t),t}}(o),n.retryIf="function"==typeof i?i:function(e){var t=e||{},n=t.retryIf,r=t.max,i=void 0===r?5:r;return function(e,t,r){return!(e>=i)&&(n?n(r,t):!!r)}}(i),n}return be(t,e),t.prototype.request=function(e,t){var n=new us(e,t,this.delayFor,this.retryIf);return n.start(),new tr((function(e){return n.subscribe(e),function(){n.unsubscribe(e)}}))},t}(Ar),ls=n(4147);function ps(e){return new Ar((function(t,n){return t.setContext({headers:{"X-API-KEY":e}}),n(t)}))}var fs=function(e){return!!e&&![500,400].includes(e.statusCode)};var ds=function(){function e(){var e=this;this.setFeatures=function(t){return e.features=new Set(t)},this.entitlements=new Map,this.features=new Set,this.isLoaded=!1}return e.prototype.getEntitlement=function(e){return this.entitlements.get(e)||null},e.prototype.validateFeature=function(e){return this.features.has(e)},e.prototype.setEntitlements=function(e){this.entitlements=e,this.isLoaded=!0},e.prototype.getEntitlements=function(){return this.entitlements},e}(),hs=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},ys=Dt(gs||(gs=hs(["\n fragment EntitlementFragment on Entitlement {\n isGranted\n accessDeniedReason\n customerId\n usageLimit\n hasUnlimitedUsage\n currentUsage\n requestedUsage\n nextResetDate\n resetPeriod\n resetPeriodConfiguration {\n ...ResetPeriodConfigurationFragment\n }\n feature {\n ...FeatureFragment\n }\n }\n fragment ResetPeriodConfigurationFragment on ResetPeriodConfiguration {\n __typename\n ... on MonthlyResetPeriodConfig {\n ...MonthlyResetPeriodConfigFragment\n }\n ... on WeeklyResetPeriodConfig {\n ...WeeklyResetPeriodConfigFragment\n }\n }\n fragment FeatureFragment on EntitlementFeature {\n featureType\n meterType\n featureUnits\n featureUnitsPlural\n description\n displayName\n refId\n }\n fragment MonthlyResetPeriodConfigFragment on MonthlyResetPeriodConfig {\n monthlyAccordingTo\n }\n fragment WeeklyResetPeriodConfigFragment on WeeklyResetPeriodConfig {\n weeklyAccordingTo\n }\n"],["\n fragment EntitlementFragment on Entitlement {\n isGranted\n accessDeniedReason\n customerId\n usageLimit\n hasUnlimitedUsage\n currentUsage\n requestedUsage\n nextResetDate\n resetPeriod\n resetPeriodConfiguration {\n ...ResetPeriodConfigurationFragment\n }\n feature {\n ...FeatureFragment\n }\n }\n fragment ResetPeriodConfigurationFragment on ResetPeriodConfiguration {\n __typename\n ... on MonthlyResetPeriodConfig {\n ...MonthlyResetPeriodConfigFragment\n }\n ... on WeeklyResetPeriodConfig {\n ...WeeklyResetPeriodConfigFragment\n }\n }\n fragment FeatureFragment on EntitlementFeature {\n featureType\n meterType\n featureUnits\n featureUnitsPlural\n description\n displayName\n refId\n }\n fragment MonthlyResetPeriodConfigFragment on MonthlyResetPeriodConfig {\n monthlyAccordingTo\n }\n fragment WeeklyResetPeriodConfigFragment on WeeklyResetPeriodConfig {\n weeklyAccordingTo\n }\n"]))),vs=function(){function e(e){this.client=e}return e.prototype.getEntitlements=function(e){return this.client.query({query:Dt(bs||(bs=hs(["\n query GetEntitlements($query: FetchEntitlementsQuery!) {\n entitlements: cachedEntitlements(query: $query) {\n ...EntitlementFragment\n }\n }\n ","\n "],["\n query GetEntitlements($query: FetchEntitlementsQuery!) {\n entitlements: cachedEntitlements(query: $query) {\n ...EntitlementFragment\n }\n }\n ","\n "])),ys),variables:{query:{customerId:e}},fetchPolicy:"no-cache"})},e.prototype.pollEntitlements=function(e,t){return this.client.watchQuery({query:Dt(Es||(Es=hs(["\n query GetEntitlements($query: FetchEntitlementsQuery!) {\n entitlements: cachedEntitlements(query: $query) {\n ...EntitlementFragment\n }\n }\n ","\n "],["\n query GetEntitlements($query: FetchEntitlementsQuery!) {\n entitlements: cachedEntitlements(query: $query) {\n ...EntitlementFragment\n }\n }\n ","\n "])),ys),variables:{query:{customerId:e}},fetchPolicy:"no-cache",pollInterval:t,errorPolicy:"none"})},e.prototype.reportEntitlementRequested=function(e,t,n,r){return i=this,o=void 0,s=function(){return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(i){switch(i.label){case 0:return[4,this.client.mutate({mutation:Dt(_s||(_s=hs(["\n mutation reportEntitlementCheckRequested($entitlementCheckRequested: EntitlementCheckRequested!) {\n reportEntitlementCheckRequested(entitlementCheckRequested: $entitlementCheckRequested)\n }\n "],["\n mutation reportEntitlementCheckRequested($entitlementCheckRequested: EntitlementCheckRequested!) {\n reportEntitlementCheckRequested(entitlementCheckRequested: $entitlementCheckRequested)\n }\n "]))),variables:{entitlementCheckRequested:{entitlementCheckResult:n,customerId:t,featureId:e,requestedUsage:r}},fetchPolicy:"no-cache"})];case 1:return i.sent(),[2]}}))},new((a=void 0)||(a=Promise))((function(e,t){function n(e){try{u(s.next(e))}catch(e){t(e)}}function r(e){try{u(s.throw(e))}catch(e){t(e)}}function u(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(n,r)}u((s=s.apply(i,o||[])).next())}));var i,o,a,s},e}();const ms=vs;var gs,bs,Es,_s,ws=function(){function e(){}return e.decideEntitlementPolicy=function(e,t){var n,r;if(!e||!e.calculatedEntitlement.feature)return{hasAccess:!1,accessDeniedReason:ce.CustomerNotEntitledForFeature};var i=e.calculatedEntitlement.feature,o=i.featureType,a=i.meterType;switch(o){case le.Boolean:return{hasAccess:!0};case le.Numeric:if((null===(n=e.calculatedEntitlement.feature)||void 0===n?void 0:n.meterType)===pe.None)return{hasAccess:!0};if(e.calculatedEntitlement.hasUnlimitedUsage)return{hasAccess:!0};var s=e.featureUsage.currentUsage;return a===pe.Incremental&&e.featureUsage.nextResetDate<(new Date).getTime()&&(s=0),s+(t||0)<=((null===(r=e.calculatedEntitlement)||void 0===r?void 0:r.usageLimit)||0)?{hasAccess:!0}:{hasAccess:!1,accessDeniedReason:ce.RequestedUsageExceedsLimit}}},e}(),Is=function(){function e(e,t,n){this.entitlementsApi=e,this.customerId=t,this.loggerService=n}return e.prototype.reportEntitlementCheckRequested=function(e,t,n){return r=this,i=void 0,a=function(){var r=this;return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(i){return this.entitlementsApi.reportEntitlementRequested(e,this.customerId,t,n).then((function(){r.loggerService.debug("Successfully reported entitlement check requested")}),(function(e){r.loggerService.error("Failed to report entitlement check requested",e)})),[2]}))},new((o=void 0)||(o=Promise))((function(e,t){function n(e){try{u(a.next(e))}catch(e){t(e)}}function s(e){try{u(a.throw(e))}catch(e){t(e)}}function u(t){var r;t.done?e(t.value):(r=t.value,r instanceof o?r:new o((function(e){e(r)}))).then(n,s)}u((a=a.apply(r,i||[])).next())}));var r,i,o,a},e}(),Ts=function(){return Ts=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ts.apply(this,arguments)},Os=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},Ss=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},Ds=function(){function e(e,t,n,r,i){this.customerId=e,this.cacheService=t,this.loggerService=i,this.modelMapper=new gn,this.loadingEntitlements=null,this.entitlementsApi=new ms(n),this.entitlementCheckReportingService=new Is(new ms(r),e,i),this.entitlementsPollingObserver=null}return e.prototype.startPolling=function(e){var t=this;this.stopPolling(),this.entitlementsPollingObserver=this.entitlementsApi.pollEntitlements(this.customerId,e),this.entitlementsPollingObserver.subscribe((function(n){var r;if(n.errors||!n.data||!n.data.entitlements)return t.loggerService.error("Failed to poll entitlements. Error: ".concat(n.errors),{errors:(null===(r=n.errors)||void 0===r?void 0:r.map((function(e){return e.message})).join(", "))||""}),void setTimeout((function(){return t.restartPolling(e)}),e);t.storeFetchedEntitlementsInCache(n.data.entitlements)}),(function(n){t.loggerService.error("Failed to poll entitlements. Error: ".concat(n.message),n),setTimeout((function(){return t.restartPolling(e)}),e)}))},e.prototype.stopPolling=function(){var e;null===(e=this.entitlementsPollingObserver)||void 0===e||e.stopPolling()},e.prototype.restartPolling=function(e){this.stopPolling(),this.startPolling(e)},e.prototype.refresh=function(){return Os(this,void 0,void 0,(function(){return Ss(this,(function(e){switch(e.label){case 0:return[4,this.loadEntitlements()];case 1:return e.sent(),[2]}}))}))},e.prototype.getBooleanEntitlement=function(e,t){var n=this.cacheService.getEntitlement(e),r=ws.decideEntitlementPolicy(n);if((null==n?void 0:n.calculatedEntitlement.feature)&&n.calculatedEntitlement.feature.featureType!==le.Boolean)return this.entitlementCheckReportingService.reportEntitlementCheckRequested(e,this.modelMapper.mapFallbackBooleanEntitlementResult(t,r)),t;if(!n){var i=this.modelMapper.mapEntitlementResult(r);return this.entitlementCheckReportingService.reportEntitlementCheckRequested(e,i),Ts(Ts({},r),{isFallback:!1})}var o=this.modelMapper.mapEntitlementResult(r,n);return this.entitlementCheckReportingService.reportEntitlementCheckRequested(e,o),this.modelMapper.mapBooleanEntitlement(n,r)},e.prototype.getNumericEntitlement=function(e,t){var n,r=this.cacheService.getEntitlement(e),i=ws.decideEntitlementPolicy(r);if((null==r?void 0:r.calculatedEntitlement.feature)&&(null===(n=r.calculatedEntitlement.feature)||void 0===n?void 0:n.featureType)!==le.Numeric){var o=this.modelMapper.mapFallbackNumericEntitlementResult(t,i);return this.entitlementCheckReportingService.reportEntitlementCheckRequested(e,o),t}if(!r){var a=this.modelMapper.mapEntitlementResult(i);return this.entitlementCheckReportingService.reportEntitlementCheckRequested(e,a),Ts(Ts({},i),{isFallback:!1,isUnlimited:!1})}var s=this.modelMapper.mapEntitlementResult(i,r);return this.entitlementCheckReportingService.reportEntitlementCheckRequested(e,s),this.modelMapper.mapNumericEntitlement(r,i)},e.prototype.getMeteredEntitlement=function(e,t,n){var r,i,o=this.cacheService.getEntitlement(e),a=ws.decideEntitlementPolicy(o,null==n?void 0:n.requestedUsage);if((null==o?void 0:o.calculatedEntitlement.feature)&&(null===(r=o.calculatedEntitlement.feature)||void 0===r?void 0:r.meterType)!==pe.Fluctuating&&(null===(i=o.calculatedEntitlement.feature)||void 0===i?void 0:i.meterType)!==pe.Incremental){var s=this.modelMapper.mapFallbackMeteredEntitlementResult(t,a,null==n?void 0:n.requestedUsage);return this.entitlementCheckReportingService.reportEntitlementCheckRequested(e,s),t}if(!o){var u=this.modelMapper.mapEntitlementResult(a,void 0,null==n?void 0:n.requestedUsage);return this.entitlementCheckReportingService.reportEntitlementCheckRequested(e,u),Ts(Ts({},a),{currentUsage:0,isFallback:!1,isUnlimited:!1,requestedUsage:(null==n?void 0:n.requestedUsage)||0})}var c=this.modelMapper.mapEntitlementResult(a,o,null==n?void 0:n.requestedUsage);return this.entitlementCheckReportingService.reportEntitlementCheckRequested(e,c),this.modelMapper.mapMeteredEntitlement(o,a,null==n?void 0:n.requestedUsage)},e.prototype.loadEntitlements=function(){return Os(this,void 0,void 0,(function(){return Ss(this,(function(e){switch(e.label){case 0:this.loadingEntitlements||(this.loadingEntitlements=this.loadEntitlementsFromRemote()),e.label=1;case 1:return e.trys.push([1,,3,4]),[4,this.loadingEntitlements];case 2:return[2,e.sent()];case 3:return this.loadingEntitlements=null,[7];case 4:return[2]}}))}))},e.prototype.loadEntitlementsFromRemote=function(){return Os(this,void 0,void 0,(function(){var e;return Ss(this,(function(t){switch(t.label){case 0:return[4,this.entitlementsApi.getEntitlements(this.customerId)];case 1:return e=t.sent(),this.storeFetchedEntitlementsInCache(e.data.entitlements),[2]}}))}))},e.prototype.storeFetchedEntitlementsInCache=function(e){var t=this.modelMapper.mapCachedEntitlements(e);this.cacheService.setEntitlements(t)},e.prototype.getEntitlements=function(){return Os(this,void 0,void 0,(function(){var e=this;return Ss(this,(function(t){switch(t.label){case 0:return this.cacheService.isLoaded?[3,2]:[4,this.loadEntitlements()];case 1:t.sent(),t.label=2;case 2:return[2,Array.from(this.cacheService.getEntitlements().values()).map((function(t){var n=ws.decideEntitlementPolicy(t);return e.modelMapper.mapEntitlement(t,n)}))]}}))}))},e}(),xs=function(){return xs=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},xs.apply(this,arguments)},As=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},ks=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},Ns=function(){function e(e,t){this.modelMapper=new gn,this.configuration=e,this.graphClient=function(e){var t=e.apiKey,n=e.baseUri,r=ps(t),i=function(e){return new ti({uri:"".concat(e,"/graphql"),fetch:is()})}(n),o=new cs({attempts:{max:5,retryIf:fs},delay:{initial:500,max:2e3,jitter:!0}});return new ca({link:r.concat(o.concat(i)),cache:new ts({possibleTypes:ns.g}),name:"js-client-sdk",version:ls.version})}(this.configuration),this.batchedGraphClient=function(e){var t=e.apiKey,n=e.baseUri,r=ps(t),i=function(e){return new ss({uri:"".concat(e,"/graphql"),batchMax:25,batchInterval:500,fetch:is()})}(n);return new ca({link:r.concat(i),cache:new ts({possibleTypes:ns.g}),name:"js-client-sdk",version:ls.version})}(this.configuration),this.loggerService=t,this.apiGateway=new sn(this.graphClient),this.entitlementsService=null}return e.initialize=function(t){return As(this,void 0,void 0,(function(){var n,i,o,a,s;return ks(this,(function(u){switch(u.label){case 0:if(n=function(e){var t={baseUri:"https://api.stigg.io",entitlementPollingInterval:3e4,logConfiguration:{logger:console,logLevel:r.ERROR}};return pn()(t,e)}(t),i=new de(n.logConfiguration.logger,n.logConfiguration.logLevel),o=function(e,t){var n=!0;return cn()(e.apiKey)&&(t.error("You must configure the client with an SDK key"),n=!1),e.entitlementPollingInterval&&e.entitlementPollingInterval<5e3&&(t.error("Entitlements polling interval cannot be lower than 5000ms"),n=!1),n}(n,i),!o)return[2,null];u.label=1;case 1:return u.trys.push([1,4,,5]),a=new e(n,i),t.customerId?[4,a.setCustomerId(t.customerId)]:[3,3];case 2:u.sent(),u.label=3;case 3:return[2,a];case 4:return s=u.sent(),i.error("Failed to initialize Stigg JS SDK. Error: ".concat(s.message)),[2,null];case 5:return[2]}}))}))},e.prototype.setCustomerId=function(e){var t;return As(this,void 0,void 0,(function(){var n=this;return ks(this,(function(r){return null===(t=this.entitlementsService)||void 0===t||t.stopPolling(),this.configuration.customerId=e,this.entitlementsService=new Ds(e,new ds,this.graphClient,this.batchedGraphClient,this.loggerService),this.entitlementsService.startPolling(this.configuration.entitlementPollingInterval),[2,this.withErrorHandling((function(){return As(n,void 0,void 0,(function(){var e;return ks(this,(function(t){switch(t.label){case 0:return[4,null===(e=this.entitlementsService)||void 0===e?void 0:e.loadEntitlements()];case 1:return t.sent(),[2]}}))}))}),(function(e){return"Failed to load initial entitlements for customer. Error: ".concat(e.message)}))]}))}))},e.prototype.refresh=function(){return As(this,void 0,void 0,(function(){var e=this;return ks(this,(function(t){return[2,this.withErrorHandling((function(){return As(e,void 0,void 0,(function(){var e;return ks(this,(function(t){switch(t.label){case 0:return[4,null===(e=this.entitlementsService)||void 0===e?void 0:e.refresh()];case 1:return t.sent(),[2]}}))}))}),(function(e){return"Failed to refresh entitlements. Error: ".concat(e.message)}))]}))}))},e.prototype.getBooleanEntitlement=function(e){var t=e.featureId,n=e.options,r=xs(xs({},he),(null==n?void 0:n.fallback)||{});try{return this.entitlementsService?this.entitlementsService.getBooleanEntitlement(t,r):r}catch(e){return this.loggerService.error("Failed to get boolean entitlement. Error: ".concat(e.message),e),r}},e.prototype.getNumericEntitlement=function(e){var t=e.featureId,n=e.options,r=xs(xs({},ye),(null==n?void 0:n.fallback)||{});try{return this.entitlementsService?this.entitlementsService.getNumericEntitlement(t,r):r}catch(e){return this.loggerService.error("Failed to get numeric entitlement. Error: ".concat(e.message),e),r}},e.prototype.getMeteredEntitlement=function(e){var t=e.featureId,n=e.options,r=xs(xs({},ve),(null==n?void 0:n.fallback)||{});try{return this.entitlementsService?this.entitlementsService.getMeteredEntitlement(t,r,n):r}catch(e){return this.loggerService.error("Failed to get metered entitlement. Error: ".concat(e.message),e),r}},e.prototype.getPaywall=function(e){var t=(void 0===e?{}:e).productId;return As(this,void 0,void 0,(function(){var e=this;return ks(this,(function(n){return[2,this.withErrorHandling((function(){return As(e,void 0,void 0,(function(){var e;return ks(this,(function(n){switch(n.label){case 0:return[4,this.apiGateway.paywall.getPlans(t)];case 1:return e=n.sent(),[2,this.modelMapper.mapPlans(e.data)]}}))}))}),(function(e){return"Failed to get paywall. Error: ".concat(e.message)}))]}))}))},e.prototype.getCoupons=function(){return As(this,void 0,void 0,(function(){var e=this;return ks(this,(function(t){return[2,this.withErrorHandling((function(){return As(e,void 0,void 0,(function(){var e;return ks(this,(function(t){switch(t.label){case 0:return[4,this.apiGateway.coupons.getCoupons()];case 1:return e=t.sent(),[2,this.modelMapper.mapCoupons(e.data)]}}))}))}),(function(e){return"Failed to get coupons. Error: ".concat(e.message)}))]}))}))},e.prototype.getCustomer=function(){return As(this,void 0,void 0,(function(){var e=this;return ks(this,(function(t){return[2,this.withErrorHandling((function(){return As(e,void 0,void 0,(function(){var e,t,n;return ks(this,(function(r){switch(r.label){case 0:return e=fn(this.configuration),[4,this.apiGateway.customers.getCustomer(e)];case 1:if(t=r.sent(),!(n=t.data.customers.edges[0]))throw new Error("Customer not found");return[2,this.modelMapper.mapCustomer(n.node)]}}))}))}),(function(e){return"Failed to get customer. Error: ".concat(e.message)}))]}))}))},e.prototype.getEntitlements=function(){return As(this,void 0,void 0,(function(){var e=this;return ks(this,(function(t){return[2,this.withErrorHandling((function(){return As(e,void 0,void 0,(function(){var e;return ks(this,(function(t){return fn(this.configuration),[2,(null===(e=this.entitlementsService)||void 0===e?void 0:e.getEntitlements())||[]]}))}))}),(function(e){return"Failed to get entitlements. Error: ".concat(e.message)}))]}))}))},e.prototype.withErrorHandling=function(e,t){return As(this,void 0,void 0,(function(){var n,r;return ks(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,e()];case 1:return[2,i.sent()];case 2:throw n=i.sent(),r=t?t(n):"Operation failed. Error: ".concat(n.message),this.loggerService.error(r,n),new Error(r);case 3:return[2]}}))}))},e}()},4147:e=>{"use strict";e.exports=JSON.parse('{"name":"@stigg/js-client-sdk","version":"0.37.0","description":"Stigg client-side SDK for Browser","main":"dist/index.js","typings":"dist/index.d.ts","repository":"https://github.com/stiggio/js-client-sdk.git","license":"MIT","scripts":{"start":"webpack serve","build:types":"tsc --emitDeclarationOnly","build":"yarn build:types && webpack","build:watch":"webpack --watch","build:prod":"yarn build:types && webpack --env production","generate":"graphql-codegen && yarn run fix:lint","fix":"run-s fix:*","fix:prettier":"prettier \\"src/**/*.ts\\" --write","fix:lint":"eslint src --ext .ts --fix","test":"jest","test:watch":"jest --watch","test:cov":"jest --coverage","prepare":"husky install","docs":"typedoc"},"files":["dist/**/*"],"dependencies":{"@apollo/client":"^3.4.17","cross-fetch":"^3.1.4","graphql":"^16.0.1","husky":"^7.0.4","lint-staged":"^12.0.2","lodash":"^4.17.21"},"devDependencies":{"@commitlint/cli":"^14.1.0","@commitlint/config-conventional":"^14.1.0","@graphql-codegen/cli":"^2.3.0","@graphql-codegen/fragment-matcher":"^3.2.1","@graphql-codegen/schema-ast":"^2.4.0","@graphql-codegen/typescript":"^2.4.0","@graphql-codegen/typescript-operations":"^2.2.0","@types/jest":"^27.0.2","@types/lodash":"^4.14.177","@typescript-eslint/eslint-plugin":"^5.4.0","@typescript-eslint/parser":"^5.4.0","eslint":"^8.2.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^4.0.0","jest":"^27.3.1","jest-fetch-mock":"^3.0.3","msw":"^0.35.0","npm-run-all":"^4.1.5","prettier":"^2.4.1","ts-jest":"^27.0.7","ts-loader":"^9.2.6","typedoc":"^0.22.13","typedoc-plugin-rename-defaults":"^0.4.0","typescript":"^4.5.3","webpack":"^5.64.1","webpack-cli":"^4.9.1","webpack-dev-server":"^4.5.0"},"publishConfig":{"access":"public"},"lint-staged":{"*.{js,jsx,ts,tsx}":["prettier --check","eslint --cache"]}}')}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}return n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n(7984)})()}));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Stigg",[],t):"object"==typeof exports?exports.Stigg=t():e.Stigg=t()}(self,(function(){return(()=>{var e={4098:function(e,t){var n="undefined"!=typeof self?self:this,r=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();!function(e){!function(t){var n="URLSearchParams"in e,r="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in e,a="ArrayBuffer"in e;if(a)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function f(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r&&(t[Symbol.iterator]=function(){return t}),t}function p(e){this.map={},e instanceof p?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 d(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function h(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function y(e){var t=new FileReader,n=h(t);return t.readAsArrayBuffer(e),n}function v(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a&&i&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=v(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=v(e):this._bodyText=e=Object.prototype.toString.call(e):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):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=d(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)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(y)}),this.text=function(){var e,t,n,r=d(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,n=h(t=new FileReader),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(E)}),this.json=function(){return this.text().then(JSON.parse)},this}p.prototype.append=function(e,t){e=c(e),t=l(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},p.prototype.delete=function(e){delete this.map[c(e)]},p.prototype.get=function(e){return e=c(e),this.has(e)?this.map[e]:null},p.prototype.has=function(e){return this.map.hasOwnProperty(c(e))},p.prototype.set=function(e,t){this.map[c(e)]=l(t)},p.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},p.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),f(e)},p.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),f(e)},p.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),f(e)},r&&(p.prototype[Symbol.iterator]=p.prototype.entries);var g=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(e,t){var n,r,i=(t=t||{}).body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new p(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=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 p(t.headers)),this.method=(r=(n=t.method||this.method||"GET").toUpperCase(),g.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function E(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function _(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 p(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},m.call(b.prototype),m.call(_.prototype),_.prototype.clone=function(){return new _(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},_.error=function(){var e=new _(null,{status:0,statusText:""});return e.type="error",e};var w=[301,302,303,307,308];_.redirect=function(e,t){if(-1===w.indexOf(t))throw new RangeError("Invalid status code");return new _(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function I(e,n){return new Promise((function(r,o){var a=new b(e,n);if(a.signal&&a.signal.aborted)return o(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function u(){s.abort()}s.onload=function(){var e,t,n={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new p,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}})),t)};n.url="responseURL"in s?s.responseURL:n.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;r(new _(i,n))},s.onerror=function(){o(new TypeError("Network request failed"))},s.ontimeout=function(){o(new TypeError("Network request failed"))},s.onabort=function(){o(new t.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&i&&(s.responseType="blob"),a.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),a.signal&&(a.signal.addEventListener("abort",u),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",u)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}I.polyfill=!0,e.fetch||(e.fetch=I,e.Headers=p,e.Request=b,e.Response=_),t.Headers=p,t.Request=b,t.Response=_,t.fetch=I,Object.defineProperty(t,"__esModule",{value:!0})}({})}(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},8552:(e,t,n)=>{var r=n(852)(n(5639),"DataView");e.exports=r},1989:(e,t,n)=>{var r=n(1789),i=n(401),o=n(7667),a=n(1327),s=n(1866);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,e.exports=u},8407:(e,t,n)=>{var r=n(7040),i=n(4125),o=n(2117),a=n(7529),s=n(4705);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,e.exports=u},7071:(e,t,n)=>{var r=n(852)(n(5639),"Map");e.exports=r},3369:(e,t,n)=>{var r=n(4785),i=n(1285),o=n(6e3),a=n(9916),s=n(5265);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,e.exports=u},3818:(e,t,n)=>{var r=n(852)(n(5639),"Promise");e.exports=r},8525:(e,t,n)=>{var r=n(852)(n(5639),"Set");e.exports=r},8668:(e,t,n)=>{var r=n(3369),i=n(619),o=n(2385);function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}a.prototype.add=a.prototype.push=i,a.prototype.has=o,e.exports=a},6384:(e,t,n)=>{var r=n(8407),i=n(7465),o=n(3779),a=n(7599),s=n(4758),u=n(4309);function c(e){var t=this.__data__=new r(e);this.size=t.size}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=a,c.prototype.has=s,c.prototype.set=u,e.exports=c},2705:(e,t,n)=>{var r=n(5639).Symbol;e.exports=r},1149:(e,t,n)=>{var r=n(5639).Uint8Array;e.exports=r},577:(e,t,n)=>{var r=n(852)(n(5639),"WeakMap");e.exports=r},6874:e=>{e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},4963:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}},4636:(e,t,n)=>{var r=n(2545),i=n(5694),o=n(1469),a=n(4144),s=n(5776),u=n(6719),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=o(e),l=!n&&i(e),f=!n&&!l&&a(e),p=!n&&!l&&!f&&u(e),d=n||l||f||p,h=d?r(e.length,String):[],y=h.length;for(var v in e)!t&&!c.call(e,v)||d&&("length"==v||f&&("offset"==v||"parent"==v)||p&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||s(v,y))||h.push(v);return h}},9932:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}},2488:e=>{e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}},2908:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},6556:(e,t,n)=>{var r=n(9465),i=n(7813);e.exports=function(e,t,n){(void 0!==n&&!i(e[t],n)||void 0===n&&!(t in e))&&r(e,t,n)}},4865:(e,t,n)=>{var r=n(9465),i=n(7813),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];o.call(e,t)&&i(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},8470:(e,t,n)=>{var r=n(7813);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},9465:(e,t,n)=>{var r=n(8777);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},3118:(e,t,n)=>{var r=n(3218),i=Object.create,o=function(){function e(){}return function(t){if(!r(t))return{};if(i)return i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=o},4140:(e,t,n)=>{var r=n(7816),i=n(9291)(r);e.exports=i},1848:e=>{e.exports=function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}},1078:(e,t,n)=>{var r=n(2488),i=n(7285);e.exports=function e(t,n,o,a,s){var u=-1,c=t.length;for(o||(o=i),s||(s=[]);++u<c;){var l=t[u];n>0&&o(l)?n>1?e(l,n-1,o,a,s):r(s,l):a||(s[s.length]=l)}return s}},8483:(e,t,n)=>{var r=n(5063)();e.exports=r},7816:(e,t,n)=>{var r=n(8483),i=n(3674);e.exports=function(e,t){return e&&r(e,t,i)}},7786:(e,t,n)=>{var r=n(1811),i=n(327);e.exports=function(e,t){for(var n=0,o=(t=r(t,e)).length;null!=e&&n<o;)e=e[i(t[n++])];return n&&n==o?e:void 0}},8866:(e,t,n)=>{var r=n(2488),i=n(1469);e.exports=function(e,t,n){var o=t(e);return i(e)?o:r(o,n(e))}},4239:(e,t,n)=>{var r=n(2705),i=n(9607),o=n(2333),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},13:e=>{e.exports=function(e,t){return null!=e&&t in Object(e)}},2118:(e,t,n)=>{var r=n(1848),i=n(2722),o=n(2351);e.exports=function(e,t,n){return t==t?o(e,t,n):r(e,i,n)}},9454:(e,t,n)=>{var r=n(4239),i=n(7005);e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},939:(e,t,n)=>{var r=n(1299),i=n(7005);e.exports=function e(t,n,o,a,s){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,o,a,e,s))}},1299:(e,t,n)=>{var r=n(6384),i=n(7114),o=n(8351),a=n(6096),s=n(4160),u=n(1469),c=n(4144),l=n(6719),f="[object Arguments]",p="[object Array]",d="[object Object]",h=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,y,v,m){var g=u(e),b=u(t),E=g?p:s(e),_=b?p:s(t),w=(E=E==f?d:E)==d,I=(_=_==f?d:_)==d,T=E==_;if(T&&c(e)){if(!c(t))return!1;g=!0,w=!1}if(T&&!w)return m||(m=new r),g||l(e)?i(e,t,n,y,v,m):o(e,t,E,n,y,v,m);if(!(1&n)){var O=w&&h.call(e,"__wrapped__"),S=I&&h.call(t,"__wrapped__");if(O||S){var D=O?e.value():e,x=S?t.value():t;return m||(m=new r),v(D,x,n,y,m)}}return!!T&&(m||(m=new r),a(e,t,n,y,v,m))}},2958:(e,t,n)=>{var r=n(6384),i=n(939);e.exports=function(e,t,n,o){var a=n.length,s=a,u=!o;if(null==e)return!s;for(e=Object(e);a--;){var c=n[a];if(u&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++a<s;){var l=(c=n[a])[0],f=e[l],p=c[1];if(u&&c[2]){if(void 0===f&&!(l in e))return!1}else{var d=new r;if(o)var h=o(f,p,l,e,t,d);if(!(void 0===h?i(p,f,3,o,d):h))return!1}}return!0}},2722:e=>{e.exports=function(e){return e!=e}},8458:(e,t,n)=>{var r=n(3560),i=n(5346),o=n(3218),a=n(346),s=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,l=u.toString,f=c.hasOwnProperty,p=RegExp("^"+l.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?p:s).test(a(e))}},8749:(e,t,n)=>{var r=n(4239),i=n(1780),o=n(7005),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!a[r(e)]}},7206:(e,t,n)=>{var r=n(1573),i=n(6432),o=n(6557),a=n(1469),s=n(9601);e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?a(e)?i(e[0],e[1]):r(e):s(e)}},280:(e,t,n)=>{var r=n(5726),i=n(6916),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},313:(e,t,n)=>{var r=n(3218),i=n(5726),o=n(3498),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=i(e),n=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&n.push(s);return n}},9199:(e,t,n)=>{var r=n(4140),i=n(8612);e.exports=function(e,t){var n=-1,o=i(e)?Array(e.length):[];return r(e,(function(e,r,i){o[++n]=t(e,r,i)})),o}},1573:(e,t,n)=>{var r=n(2958),i=n(1499),o=n(2634);e.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},6432:(e,t,n)=>{var r=n(939),i=n(7361),o=n(9095),a=n(5403),s=n(9162),u=n(2634),c=n(327);e.exports=function(e,t){return a(e)&&s(t)?u(c(e),t):function(n){var a=i(n,e);return void 0===a&&a===t?o(n,e):r(t,a,3)}}},2980:(e,t,n)=>{var r=n(6384),i=n(6556),o=n(8483),a=n(9783),s=n(3218),u=n(1704),c=n(6390);e.exports=function e(t,n,l,f,p){t!==n&&o(n,(function(o,u){if(p||(p=new r),s(o))a(t,n,u,l,e,f,p);else{var d=f?f(c(t,u),o,u+"",t,n,p):void 0;void 0===d&&(d=o),i(t,u,d)}}),u)}},9783:(e,t,n)=>{var r=n(6556),i=n(4626),o=n(7133),a=n(278),s=n(8517),u=n(5694),c=n(1469),l=n(9246),f=n(4144),p=n(3560),d=n(3218),h=n(8630),y=n(6719),v=n(6390),m=n(9881);e.exports=function(e,t,n,g,b,E,_){var w=v(e,n),I=v(t,n),T=_.get(I);if(T)r(e,n,T);else{var O=E?E(w,I,n+"",e,t,_):void 0,S=void 0===O;if(S){var D=c(I),x=!D&&f(I),A=!D&&!x&&y(I);O=I,D||x||A?c(w)?O=w:l(w)?O=a(w):x?(S=!1,O=i(I,!0)):A?(S=!1,O=o(I,!0)):O=[]:h(I)||u(I)?(O=w,u(w)?O=m(w):d(w)&&!p(w)||(O=s(I))):S=!1}S&&(_.set(I,O),b(O,I,g,E,_),_.delete(I)),r(e,n,O)}}},2689:(e,t,n)=>{var r=n(9932),i=n(7786),o=n(7206),a=n(9199),s=n(1131),u=n(7518),c=n(5022),l=n(6557),f=n(1469);e.exports=function(e,t,n){t=t.length?r(t,(function(e){return f(e)?function(t){return i(t,1===e.length?e[0]:e)}:e})):[l];var p=-1;t=r(t,u(o));var d=a(e,(function(e,n,i){return{criteria:r(t,(function(t){return t(e)})),index:++p,value:e}}));return s(d,(function(e,t){return c(e,t,n)}))}},371:e=>{e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},9152:(e,t,n)=>{var r=n(7786);e.exports=function(e){return function(t){return r(t,e)}}},5976:(e,t,n)=>{var r=n(6557),i=n(5357),o=n(61);e.exports=function(e,t){return o(i(e,t,r),e+"")}},6560:(e,t,n)=>{var r=n(5703),i=n(8777),o=n(6557),a=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:o;e.exports=a},1131:e=>{e.exports=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}},2545:e=>{e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},531:(e,t,n)=>{var r=n(2705),i=n(9932),o=n(1469),a=n(3448),s=r?r.prototype:void 0,u=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(a(t))return u?u.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},7561:(e,t,n)=>{var r=n(7990),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},7518:e=>{e.exports=function(e){return function(t){return e(t)}}},7415:(e,t,n)=>{var r=n(9932);e.exports=function(e,t){return r(t,(function(t){return e[t]}))}},4757:e=>{e.exports=function(e,t){return e.has(t)}},1811:(e,t,n)=>{var r=n(1469),i=n(5403),o=n(5514),a=n(9833);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(a(e))}},4318:(e,t,n)=>{var r=n(1149);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},4626:(e,t,n)=>{e=n.nmd(e);var r=n(5639),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}},7133:(e,t,n)=>{var r=n(4318);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},6393:(e,t,n)=>{var r=n(3448);e.exports=function(e,t){if(e!==t){var n=void 0!==e,i=null===e,o=e==e,a=r(e),s=void 0!==t,u=null===t,c=t==t,l=r(t);if(!u&&!l&&!a&&e>t||a&&s&&c&&!u&&!l||i&&s&&c||!n&&c||!o)return 1;if(!i&&!a&&!l&&e<t||l&&n&&o&&!i&&!a||u&&n&&o||!s&&o||!c)return-1}return 0}},5022:(e,t,n)=>{var r=n(6393);e.exports=function(e,t,n){for(var i=-1,o=e.criteria,a=t.criteria,s=o.length,u=n.length;++i<s;){var c=r(o[i],a[i]);if(c)return i>=u?c:c*("desc"==n[i]?-1:1)}return e.index-t.index}},278:e=>{e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},8363:(e,t,n)=>{var r=n(4865),i=n(9465);e.exports=function(e,t,n,o){var a=!n;n||(n={});for(var s=-1,u=t.length;++s<u;){var c=t[s],l=o?o(n[c],e[c],c,n,e):void 0;void 0===l&&(l=e[c]),a?i(n,c,l):r(n,c,l)}return n}},4429:(e,t,n)=>{var r=n(5639)["__core-js_shared__"];e.exports=r},1463:(e,t,n)=>{var r=n(5976),i=n(6612);e.exports=function(e){return r((function(t,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(n[0],n[1],s)&&(a=o<3?void 0:a,o=1),t=Object(t);++r<o;){var u=n[r];u&&e(t,u,r,a)}return t}))}},9291:(e,t,n)=>{var r=n(8612);e.exports=function(e,t){return function(n,i){if(null==n)return n;if(!r(n))return e(n,i);for(var o=n.length,a=t?o:-1,s=Object(n);(t?a--:++a<o)&&!1!==i(s[a],a,s););return n}}},5063:e=>{e.exports=function(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var u=a[e?s:++i];if(!1===n(o[u],u,o))break}return t}}},8777:(e,t,n)=>{var r=n(852),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},7114:(e,t,n)=>{var r=n(8668),i=n(2908),o=n(4757);e.exports=function(e,t,n,a,s,u){var c=1&n,l=e.length,f=t.length;if(l!=f&&!(c&&f>l))return!1;var p=u.get(e),d=u.get(t);if(p&&d)return p==t&&d==e;var h=-1,y=!0,v=2&n?new r:void 0;for(u.set(e,t),u.set(t,e);++h<l;){var m=e[h],g=t[h];if(a)var b=c?a(g,m,h,t,e,u):a(m,g,h,e,t,u);if(void 0!==b){if(b)continue;y=!1;break}if(v){if(!i(t,(function(e,t){if(!o(v,t)&&(m===e||s(m,e,n,a,u)))return v.push(t)}))){y=!1;break}}else if(m!==g&&!s(m,g,n,a,u)){y=!1;break}}return u.delete(e),u.delete(t),y}},8351:(e,t,n)=>{var r=n(2705),i=n(1149),o=n(7813),a=n(7114),s=n(8776),u=n(1814),c=r?r.prototype:void 0,l=c?c.valueOf:void 0;e.exports=function(e,t,n,r,c,f,p){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!f(new i(e),new i(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var d=s;case"[object Set]":var h=1&r;if(d||(d=u),e.size!=t.size&&!h)return!1;var y=p.get(e);if(y)return y==t;r|=2,p.set(e,t);var v=a(d(e),d(t),r,c,f,p);return p.delete(e),v;case"[object Symbol]":if(l)return l.call(e)==l.call(t)}return!1}},6096:(e,t,n)=>{var r=n(8234),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,a,s){var u=1&n,c=r(e),l=c.length;if(l!=r(t).length&&!u)return!1;for(var f=l;f--;){var p=c[f];if(!(u?p in t:i.call(t,p)))return!1}var d=s.get(e),h=s.get(t);if(d&&h)return d==t&&h==e;var y=!0;s.set(e,t),s.set(t,e);for(var v=u;++f<l;){var m=e[p=c[f]],g=t[p];if(o)var b=u?o(g,m,p,t,e,s):o(m,g,p,e,t,s);if(!(void 0===b?m===g||a(m,g,n,o,s):b)){y=!1;break}v||(v="constructor"==p)}if(y&&!v){var E=e.constructor,_=t.constructor;E==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof E&&E instanceof E&&"function"==typeof _&&_ instanceof _||(y=!1)}return s.delete(e),s.delete(t),y}},1957:(e,t,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},8234:(e,t,n)=>{var r=n(8866),i=n(9551),o=n(3674);e.exports=function(e){return r(e,o,i)}},5050:(e,t,n)=>{var r=n(7019);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},1499:(e,t,n)=>{var r=n(9162),i=n(3674);e.exports=function(e){for(var t=i(e),n=t.length;n--;){var o=t[n],a=e[o];t[n]=[o,a,r(a)]}return t}},852:(e,t,n)=>{var r=n(8458),i=n(7801);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},5924:(e,t,n)=>{var r=n(5569)(Object.getPrototypeOf,Object);e.exports=r},9607:(e,t,n)=>{var r=n(2705),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var i=a.call(e);return r&&(t?e[s]=n:delete e[s]),i}},9551:(e,t,n)=>{var r=n(4963),i=n(479),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return o.call(e,t)})))}:i;e.exports=s},4160:(e,t,n)=>{var r=n(8552),i=n(7071),o=n(3818),a=n(8525),s=n(577),u=n(4239),c=n(346),l="[object Map]",f="[object Promise]",p="[object Set]",d="[object WeakMap]",h="[object DataView]",y=c(r),v=c(i),m=c(o),g=c(a),b=c(s),E=u;(r&&E(new r(new ArrayBuffer(1)))!=h||i&&E(new i)!=l||o&&E(o.resolve())!=f||a&&E(new a)!=p||s&&E(new s)!=d)&&(E=function(e){var t=u(e),n="[object Object]"==t?e.constructor:void 0,r=n?c(n):"";if(r)switch(r){case y:return h;case v:return l;case m:return f;case g:return p;case b:return d}return t}),e.exports=E},7801:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},222:(e,t,n)=>{var r=n(1811),i=n(5694),o=n(1469),a=n(5776),s=n(1780),u=n(327);e.exports=function(e,t,n){for(var c=-1,l=(t=r(t,e)).length,f=!1;++c<l;){var p=u(t[c]);if(!(f=null!=e&&n(e,p)))break;e=e[p]}return f||++c!=l?f:!!(l=null==e?0:e.length)&&s(l)&&a(p,l)&&(o(e)||i(e))}},1789:(e,t,n)=>{var r=n(4536);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},401:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},7667:(e,t,n)=>{var r=n(4536),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(t,e)?t[e]:void 0}},1327:(e,t,n)=>{var r=n(4536),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},1866:(e,t,n)=>{var r=n(4536);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},8517:(e,t,n)=>{var r=n(3118),i=n(5924),o=n(5726);e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:r(i(e))}},7285:(e,t,n)=>{var r=n(2705),i=n(5694),o=n(1469),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return o(e)||i(e)||!!(a&&e&&e[a])}},5776:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e<n}},6612:(e,t,n)=>{var r=n(7813),i=n(8612),o=n(5776),a=n(3218);e.exports=function(e,t,n){if(!a(n))return!1;var s=typeof t;return!!("number"==s?i(n)&&o(t,n.length):"string"==s&&t in n)&&r(n[t],e)}},5403:(e,t,n)=>{var r=n(1469),i=n(3448),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||a.test(e)||!o.test(e)||null!=t&&e in Object(t)}},7019:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},5346:(e,t,n)=>{var r,i=n(4429),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},5726:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},9162:(e,t,n)=>{var r=n(3218);e.exports=function(e){return e==e&&!r(e)}},7040:e=>{e.exports=function(){this.__data__=[],this.size=0}},4125:(e,t,n)=>{var r=n(8470),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():i.call(t,n,1),--this.size,0))}},2117:(e,t,n)=>{var r=n(8470);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},7529:(e,t,n)=>{var r=n(8470);e.exports=function(e){return r(this.__data__,e)>-1}},4705:(e,t,n)=>{var r=n(8470);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},4785:(e,t,n)=>{var r=n(1989),i=n(8407),o=n(7071);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},1285:(e,t,n)=>{var r=n(5050);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},6e3:(e,t,n)=>{var r=n(5050);e.exports=function(e){return r(this,e).get(e)}},9916:(e,t,n)=>{var r=n(5050);e.exports=function(e){return r(this,e).has(e)}},5265:(e,t,n)=>{var r=n(5050);e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},8776:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},2634:e=>{e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},4523:(e,t,n)=>{var r=n(8306);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},4536:(e,t,n)=>{var r=n(852)(Object,"create");e.exports=r},6916:(e,t,n)=>{var r=n(5569)(Object.keys,Object);e.exports=r},3498:e=>{e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},1167:(e,t,n)=>{e=n.nmd(e);var r=n(1957),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i&&r.process,s=function(){try{return o&&o.require&&o.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s},2333:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5569:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},5357:(e,t,n)=>{var r=n(6874),i=Math.max;e.exports=function(e,t,n){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,a=-1,s=i(o.length-t,0),u=Array(s);++a<s;)u[a]=o[t+a];a=-1;for(var c=Array(t+1);++a<t;)c[a]=o[a];return c[t]=n(u),r(e,this,c)}}},5639:(e,t,n)=>{var r=n(1957),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},6390:e=>{e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},619:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},2385:e=>{e.exports=function(e){return this.__data__.has(e)}},1814:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},61:(e,t,n)=>{var r=n(6560),i=n(1275)(r);e.exports=i},1275:e=>{var t=Date.now;e.exports=function(e){var n=0,r=0;return function(){var i=t(),o=16-(i-r);if(r=i,o>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},7465:(e,t,n)=>{var r=n(8407);e.exports=function(){this.__data__=new r,this.size=0}},3779:e=>{e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},7599:e=>{e.exports=function(e){return this.__data__.get(e)}},4758:e=>{e.exports=function(e){return this.__data__.has(e)}},4309:(e,t,n)=>{var r=n(8407),i=n(7071),o=n(3369);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(e,t),this.size=n.size,this}},2351:e=>{e.exports=function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}},5514:(e,t,n)=>{var r=n(4523),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,a=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,n,r,i){t.push(r?i.replace(o,"$1"):n||e)})),t}));e.exports=a},327:(e,t,n)=>{var r=n(3448);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},346:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},7990:e=>{var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},5703:e=>{e.exports=function(e){return function(){return e}}},7813:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},7361:(e,t,n)=>{var r=n(7786);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},9095:(e,t,n)=>{var r=n(13),i=n(222);e.exports=function(e,t){return null!=e&&i(e,t,r)}},6557:e=>{e.exports=function(e){return e}},4721:(e,t,n)=>{var r=n(2118),i=n(8612),o=n(7037),a=n(554),s=n(2628),u=Math.max;e.exports=function(e,t,n,c){e=i(e)?e:s(e),n=n&&!c?a(n):0;var l=e.length;return n<0&&(n=u(l+n,0)),o(e)?n<=l&&e.indexOf(t,n)>-1:!!l&&r(e,t,n)>-1}},5694:(e,t,n)=>{var r=n(9454),i=n(7005),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=u},1469:e=>{var t=Array.isArray;e.exports=t},8612:(e,t,n)=>{var r=n(3560),i=n(1780);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},9246:(e,t,n)=>{var r=n(8612),i=n(7005);e.exports=function(e){return i(e)&&r(e)}},4144:(e,t,n)=>{e=n.nmd(e);var r=n(5639),i=n(5062),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,s=a&&a.exports===o?r.Buffer:void 0,u=(s?s.isBuffer:void 0)||i;e.exports=u},1609:(e,t,n)=>{var r=n(280),i=n(4160),o=n(5694),a=n(1469),s=n(8612),u=n(4144),c=n(5726),l=n(6719),f=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(s(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||u(e)||l(e)||o(e)))return!e.length;var t=i(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(c(e))return!r(e).length;for(var n in e)if(f.call(e,n))return!1;return!0}},3560:(e,t,n)=>{var r=n(4239),i=n(3218);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1780:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},3218:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},7005:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},8630:(e,t,n)=>{var r=n(4239),i=n(5924),o=n(7005),a=Function.prototype,s=Object.prototype,u=a.toString,c=s.hasOwnProperty,l=u.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=r(e))return!1;var t=i(e);if(null===t)return!0;var n=c.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&u.call(n)==l}},7037:(e,t,n)=>{var r=n(4239),i=n(1469),o=n(7005);e.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&"[object String]"==r(e)}},3448:(e,t,n)=>{var r=n(4239),i=n(7005);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},6719:(e,t,n)=>{var r=n(8749),i=n(7518),o=n(1167),a=o&&o.isTypedArray,s=a?i(a):r;e.exports=s},3674:(e,t,n)=>{var r=n(4636),i=n(280),o=n(8612);e.exports=function(e){return o(e)?r(e):i(e)}},1704:(e,t,n)=>{var r=n(4636),i=n(313),o=n(8612);e.exports=function(e){return o(e)?r(e,!0):i(e)}},5161:(e,t,n)=>{var r=n(9932),i=n(7206),o=n(9199),a=n(1469);e.exports=function(e,t){return(a(e)?r:o)(e,i(t,3))}},8306:(e,t,n)=>{var r=n(3369);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},2492:(e,t,n)=>{var r=n(2980),i=n(1463)((function(e,t,n){r(e,t,n)}));e.exports=i},9601:(e,t,n)=>{var r=n(371),i=n(9152),o=n(5403),a=n(327);e.exports=function(e){return o(e)?r(a(e)):i(e)}},9734:(e,t,n)=>{var r=n(1078),i=n(2689),o=n(5976),a=n(6612),s=o((function(e,t){if(null==e)return[];var n=t.length;return n>1&&a(e,t[0],t[1])?t=[]:n>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),i(e,r(t,1),[])}));e.exports=s},479:e=>{e.exports=function(){return[]}},5062:e=>{e.exports=function(){return!1}},8601:(e,t,n)=>{var r=n(4841);e.exports=function(e){return e?Infinity===(e=r(e))||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},554:(e,t,n)=>{var r=n(8601);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},4841:(e,t,n)=>{var r=n(7561),i=n(3218),o=n(3448),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||u.test(e)?c(e.slice(2),n?2:8):a.test(e)?NaN:+e}},9881:(e,t,n)=>{var r=n(8363),i=n(1704);e.exports=function(e){return r(e,i(e))}},9833:(e,t,n)=>{var r=n(531);e.exports=function(e){return null==e?"":r(e)}},2628:(e,t,n)=>{var r=n(7415),i=n(3674);e.exports=function(e){return null==e?[]:r(e,i(e))}},7984:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AccessDeniedReason:()=>ce,BOOLEAN_DEFAULT_FALLBACK_ENTITLEMENT:()=>he,BillingModel:()=>l,BillingPeriod:()=>f,Currency:()=>v,CustomerModel:()=>me,EntitlementResetPeriod:()=>pe,FeatureType:()=>le,LogLevel:()=>r,METERED_DEFAULT_FALLBACK_ENTITLEMENT:()=>ve,MeterType:()=>fe,NUMERIC_DEFAULT_FALLBACK_ENTITLEMENT:()=>ye,PricingType:()=>V,PromotionalEntitlementStatus:()=>G,SubscriptionStatus:()=>te,TrialPeriodUnits:()=>oe,default:()=>Ns});var r,i=n(4721),o=n.n(i);!function(e){e.ALL="ALL",e.NONE="NONE",e.LOG="LOG",e.ERROR="ERROR"}(r||(r={}));var a,s,u,c,l,f,p,d,h,y,v,m,g,b,E,_,w,I,T,O,S,D,x,A,k,N,P,C,R,F,M,j,U,L,q,V,B,Q,z,G,$,W,K,H,Y,J,X,Z,ee,te,ne,re,ie,oe,ae,se,ue,ce,le,fe,pe,de=function(){function e(e,t){this.logger=e,this.logLevel=t}return e.prototype.error=function(e,t){this.logLevel!==r.NONE&&this.logger.error(e,t||{})},e.prototype.log=function(e,t){o()([r.ERROR,r.NONE],this.logLevel)||this.logger.log(e,t||{})},e.prototype.debug=function(e,t){o()([r.LOG,r.ALL],this.logLevel)&&this.logger.debug(e,t||{})},e}();!function(e){e.CustomerNotFound="CustomerNotFound",e.FeatureNotFound="FeatureNotFound",e.NoActiveSubscription="NoActiveSubscription",e.NoFeatureEntitlementInSubscription="NoFeatureEntitlementInSubscription",e.RequestedUsageExceedingLimit="RequestedUsageExceedingLimit",e.Unknown="Unknown"}(a||(a={})),function(e){e.BillingId="billingId",e.CreatedAt="createdAt",e.Description="description",e.DisplayName="displayName",e.EnvironmentId="environmentId",e.Id="id",e.IsLatest="isLatest",e.PricingType="pricingType",e.ProductId="productId",e.RefId="refId",e.Status="status",e.UpdatedAt="updatedAt",e.VersionNumber="versionNumber"}(s||(s={})),function(e){e.Id="id"}(u||(u={})),function(e){e.Client="CLIENT",e.Server="SERVER"}(c||(c={})),function(e){e.FlatFee="FLAT_FEE",e.PerUnit="PER_UNIT",e.UsageBased="USAGE_BASED"}(l||(l={})),function(e){e.Annually="ANNUALLY",e.Monthly="MONTHLY"}(f||(f={})),function(e){e.Added="ADDED",e.Deleted="DELETED",e.Modified="MODIFIED"}(p||(p={})),function(e){e.BillingId="billingId",e.CreatedAt="createdAt",e.Description="description",e.EnvironmentId="environmentId",e.Id="id",e.Name="name",e.RefId="refId",e.Status="status",e.Type="type",e.UpdatedAt="updatedAt"}(d||(d={})),function(e){e.Active="ACTIVE",e.Archived="ARCHIVED"}(h||(h={})),function(e){e.Fixed="FIXED",e.Percentage="PERCENTAGE"}(y||(y={})),function(e){e.Usd="USD"}(v||(v={})),function(e){e.BillingId="billingId",e.CreatedAt="createdAt",e.CrmHubspotCompanyId="crmHubspotCompanyId",e.CrmHubspotCompanyUrl="crmHubspotCompanyUrl",e.CrmId="crmId",e.Email="email",e.EnvironmentId="environmentId",e.Id="id",e.Name="name",e.RefId="refId",e.UpdatedAt="updatedAt"}(m||(m={})),function(e){e.BillingId="billingId",e.CancelReason="cancelReason",e.CancellationDate="cancellationDate",e.CreatedAt="createdAt",e.CrmId="crmId",e.CrmLinkUrl="crmLinkUrl",e.EffectiveEndDate="effectiveEndDate",e.EndDate="endDate",e.EnvironmentId="environmentId",e.Id="id",e.PricingType="pricingType",e.RefId="refId",e.StartDate="startDate",e.Status="status",e.TrialEndDate="trialEndDate"}(g||(g={})),function(e){e.Day="DAY",e.Hour="HOUR",e.Month="MONTH",e.Week="WEEK"}(b||(b={})),function(e){e.BlackList="BLACK_LIST",e.WhiteList="WHITE_LIST"}(E||(E={})),function(e){e.CreatedAt="createdAt",e.DisplayName="displayName",e.Id="id",e.Slug="slug"}(_||(_={})),function(e){e.AddonHasToHavePriceError="AddonHasToHavePriceError",e.AddonNotFound="AddonNotFound",e.ArchivedCouponCantBeApplied="ArchivedCouponCantBeApplied",e.BadUserInput="BadUserInput",e.BillingPeriodMissingError="BillingPeriodMissingError",e.CheckoutIsNotSupported="CheckoutIsNotSupported",e.CouponNotFound="CouponNotFound",e.CustomerHasNoPaymentMethod="CustomerHasNoPaymentMethod",e.CustomerNoBillingId="CustomerNoBillingId",e.CustomerNotFound="CustomerNotFound",e.DraftPlanCantBeArchived="DraftPlanCantBeArchived",e.DuplicatedEntityNotAllowed="DuplicatedEntityNotAllowed",e.EditAllowedOnDraftPackageOnlyError="EditAllowedOnDraftPackageOnlyError",e.EnvironmentMissing="EnvironmentMissing",e.FailedToImportCustomer="FailedToImportCustomer",e.FeatureNotFound="FeatureNotFound",e.IdentityForbidden="IdentityForbidden",e.ImportAlreadyInProgress="ImportAlreadyInProgress",e.InitStripePaymentMethodError="InitStripePaymentMethodError",e.IntegrationNotFound="IntegrationNotFound",e.IntegrityViolation="IntegrityViolation",e.InvalidAddressError="InvalidAddressError",e.InvalidArgumentError="InvalidArgumentError",e.InvalidCancellationDate="InvalidCancellationDate",e.InvalidEntitlementResetPeriod="InvalidEntitlementResetPeriod",e.InvalidMemberDelete="InvalidMemberDelete",e.InvalidQuantity="InvalidQuantity",e.InvalidSubscriptionStatus="InvalidSubscriptionStatus",e.InvalidUsageValueForIncrementalFeatureError="InvalidUsageValueForIncrementalFeatureError",e.MemberInvitationError="MemberInvitationError",e.MemberNotFound="MemberNotFound",e.MeteringNotAvailableForFeatureType="MeteringNotAvailableForFeatureType",e.NoFeatureEntitlementInSubscription="NoFeatureEntitlementInSubscription",e.PackageAlreadyPublished="PackageAlreadyPublished",e.PackagePricingTypeNotSet="PackagePricingTypeNotSet",e.PlanAlreadyExtended="PlanAlreadyExtended",e.PlanNotFound="PlanNotFound",e.PlanWithChildCantBeDeleted="PlanWithChildCantBeDeleted",e.PlansCircularDependencyError="PlansCircularDependencyError",e.PriceNotFound="PriceNotFound",e.RateLimitExceeded="RateLimitExceeded",e.ResyncAlreadyInProgress="ResyncAlreadyInProgress",e.SelectedBillingModelDoesntMatchImportedItemError="SelectedBillingModelDoesntMatchImportedItemError",e.StripeCustomerIsDeleted="StripeCustomerIsDeleted",e.SubscriptionAlreadyCanceledOrExpired="SubscriptionAlreadyCanceledOrExpired",e.SubscriptionMustHaveSinglePlanError="SubscriptionMustHaveSinglePlanError",e.SubscriptionNotFound="SubscriptionNotFound",e.TrialMinDateError="TrialMinDateError",e.TrialMustBeCancelledImmediately="TrialMustBeCancelledImmediately",e.TrialsNotAllowedInProduct="TrialsNotAllowedInProduct",e.UnPublishedPackage="UnPublishedPackage",e.Unauthenticated="Unauthenticated",e.UncompatibleSubscriptionAddon="UncompatibleSubscriptionAddon",e.UnexpectedError="UnexpectedError",e.UnsupportedFeatureType="UnsupportedFeatureType",e.UnsupportedVendorIdentifier="UnsupportedVendorIdentifier"}(w||(w={})),function(e){e.AddonCreated="ADDON_CREATED",e.AddonDeleted="ADDON_DELETED",e.AddonUpdated="ADDON_UPDATED",e.CouponArchived="COUPON_ARCHIVED",e.CouponCreated="COUPON_CREATED",e.CouponUpdated="COUPON_UPDATED",e.CustomerCreated="CUSTOMER_CREATED",e.CustomerDeleted="CUSTOMER_DELETED",e.CustomerUpdated="CUSTOMER_UPDATED",e.EntitlementsUpdated="ENTITLEMENTS_UPDATED",e.EntitlementDenied="ENTITLEMENT_DENIED",e.EntitlementGranted="ENTITLEMENT_GRANTED",e.EntitlementRequested="ENTITLEMENT_REQUESTED",e.FeatureCreated="FEATURE_CREATED",e.FeatureDeleted="FEATURE_DELETED",e.FeatureUpdated="FEATURE_UPDATED",e.ImportIntegrationCatalogTriggered="IMPORT_INTEGRATION_CATALOG_TRIGGERED",e.ImportIntegrationCustomersTriggered="IMPORT_INTEGRATION_CUSTOMERS_TRIGGERED",e.MeasurementReported="MEASUREMENT_REPORTED",e.PackagePublished="PACKAGE_PUBLISHED",e.PlanCreated="PLAN_CREATED",e.PlanDeleted="PLAN_DELETED",e.PlanUpdated="PLAN_UPDATED",e.PromotionalEntitlementExpired="PROMOTIONAL_ENTITLEMENT_EXPIRED",e.PromotionalEntitlementGranted="PROMOTIONAL_ENTITLEMENT_GRANTED",e.PromotionalEntitlementRevoked="PROMOTIONAL_ENTITLEMENT_REVOKED",e.PromotionalEntitlementUpdated="PROMOTIONAL_ENTITLEMENT_UPDATED",e.ResyncIntegrationTriggered="RESYNC_INTEGRATION_TRIGGERED",e.SubscriptionCanceled="SUBSCRIPTION_CANCELED",e.SubscriptionCreated="SUBSCRIPTION_CREATED",e.SubscriptionExpired="SUBSCRIPTION_EXPIRED",e.SubscriptionTrialConverted="SUBSCRIPTION_TRIAL_CONVERTED",e.SubscriptionTrialEndsSoon="SUBSCRIPTION_TRIAL_ENDS_SOON",e.SubscriptionTrialExpired="SUBSCRIPTION_TRIAL_EXPIRED",e.SubscriptionTrialStarted="SUBSCRIPTION_TRIAL_STARTED",e.SubscriptionUpdated="SUBSCRIPTION_UPDATED",e.SubscriptionUsageUpdated="SUBSCRIPTION_USAGE_UPDATED"}(I||(I={})),function(e){e.CreatedAt="createdAt",e.Description="description",e.DisplayName="displayName",e.EnvironmentId="environmentId",e.FeatureStatus="featureStatus",e.FeatureType="featureType",e.Id="id",e.MeterType="meterType",e.RefId="refId",e.UpdatedAt="updatedAt"}(T||(T={})),function(e){e.Active="ACTIVE",e.New="NEW",e.Suspended="SUSPENDED"}(O||(O={})),function(e){e.Boolean="BOOLEAN",e.Number="NUMBER"}(S||(S={})),function(e){e.CreatedAt="createdAt",e.Endpoint="endpoint",e.EnvironmentId="environmentId",e.Id="id",e.Status="status"}(D||(D={})),function(e){e.Active="ACTIVE",e.Inactive="INACTIVE"}(x||(x={})),function(e){e.CreatedAt="createdAt",e.EnvironmentId="environmentId",e.Id="id",e.Status="status",e.TaskType="taskType"}(A||(A={})),function(e){e.CreatedAt="createdAt",e.EnvironmentId="environmentId",e.Id="id",e.VendorIdentifier="vendorIdentifier"}(k||(k={})),function(e){e.CreatedAt="createdAt",e.Id="id"}(N||(N={})),function(e){e.Invited="INVITED",e.Registered="REGISTERED"}(P||(P={})),function(e){e.Fluctuating="Fluctuating",e.Incremental="Incremental",e.None="None"}(C||(C={})),function(e){e.StartOfTheMonth="StartOfTheMonth",e.SubscriptionStart="SubscriptionStart"}(R||(R={})),function(e){e.BillingId="billingId",e.CreatedAt="createdAt",e.Description="description",e.DisplayName="displayName",e.EnvironmentId="environmentId",e.Id="id",e.IsLatest="isLatest",e.PricingType="pricingType",e.ProductId="productId",e.RefId="refId",e.Status="status",e.UpdatedAt="updatedAt",e.VersionNumber="versionNumber"}(F||(F={})),function(e){e.CreatedAt="createdAt",e.EnvironmentId="environmentId",e.Id="id",e.PackageId="packageId",e.UpdatedAt="updatedAt"}(M||(M={})),function(e){e.Archived="ARCHIVED",e.Draft="DRAFT",e.Published="PUBLISHED"}(j||(j={})),function(e){e.Bank="BANK",e.Card="CARD"}(U||(U={})),function(e){e.BillingId="billingId",e.CreatedAt="createdAt",e.Description="description",e.DisplayName="displayName",e.EnvironmentId="environmentId",e.Id="id",e.IsLatest="isLatest",e.PricingType="pricingType",e.ProductId="productId",e.RefId="refId",e.Status="status",e.UpdatedAt="updatedAt",e.VersionNumber="versionNumber"}(L||(L={})),function(e){e.BillingModel="billingModel",e.BillingPeriod="billingPeriod",e.CreatedAt="createdAt",e.Id="id"}(q||(q={})),function(e){e.Custom="CUSTOM",e.Free="FREE",e.Paid="PAID"}(V||(V={})),function(e){e.CreatedAt="createdAt",e.Description="description",e.DisplayName="displayName",e.EnvironmentId="environmentId",e.Id="id",e.IsDefaultProduct="isDefaultProduct",e.RefId="refId",e.UpdatedAt="updatedAt"}(B||(B={})),function(e){e.Custom="CUSTOM",e.Lifetime="LIFETIME",e.OneMonth="ONE_MONTH",e.OneWeek="ONE_WEEK",e.OneYear="ONE_YEAR",e.SixMonth="SIX_MONTH"}(Q||(Q={})),function(e){e.CreatedAt="createdAt",e.EnvironmentId="environmentId",e.Id="id",e.Status="status",e.UpdatedAt="updatedAt"}(z||(z={})),function(e){e.Active="Active",e.Expired="Expired",e.Paused="Paused"}(G||(G={})),function(e){e.AllCustomers="ALL_CUSTOMERS",e.NewCustomers="NEW_CUSTOMERS"}($||($={})),function(e){e.Asc="ASC",e.Desc="DESC"}(W||(W={})),function(e){e.NullsFirst="NULLS_FIRST",e.NullsLast="NULLS_LAST"}(K||(K={})),function(e){e.CreatedAt="createdAt",e.Id="id",e.Quantity="quantity",e.UpdatedAt="updatedAt"}(H||(H={})),function(e){e.CancelledByBilling="CancelledByBilling",e.DetachBilling="DetachBilling",e.Expired="Expired",e.Immediate="Immediate",e.PendingPaymentExpired="PendingPaymentExpired",e.ScheduledCancellation="ScheduledCancellation",e.TrialConverted="TrialConverted",e.TrialEnded="TrialEnded",e.UpgradeOrDowngrade="UpgradeOrDowngrade"}(Y||(Y={})),function(e){e.EndOfBillingPeriod="END_OF_BILLING_PERIOD",e.Immediate="IMMEDIATE",e.SpecificDate="SPECIFIC_DATE"}(J||(J={})),function(e){e.CancelSubscription="CANCEL_SUBSCRIPTION",e.DowngradeToFree="DOWNGRADE_TO_FREE"}(X||(X={})),function(e){e.CreatedAt="createdAt",e.EnvironmentId="environmentId",e.Id="id",e.Status="status",e.TaskType="taskType"}(Z||(Z={})),function(e){e.CreatedAt="createdAt",e.Id="id",e.UpdatedAt="updatedAt",e.UsageLimit="usageLimit"}(ee||(ee={})),function(e){e.Active="ACTIVE",e.Canceled="CANCELED",e.Expired="EXPIRED",e.InTrial="IN_TRIAL",e.NotStarted="NOT_STARTED",e.PaymentPending="PAYMENT_PENDING"}(te||(te={})),function(e){e.Error="ERROR",e.NoSyncRequired="NO_SYNC_REQUIRED",e.Pending="PENDING",e.Success="SUCCESS"}(ne||(ne={})),function(e){e.Completed="COMPLETED",e.Failed="FAILED",e.InProgress="IN_PROGRESS",e.PartiallyFailed="PARTIALLY_FAILED",e.Pending="PENDING"}(re||(re={})),function(e){e.ImportIntegrationCatalog="IMPORT_INTEGRATION_CATALOG",e.ImportIntegrationCustomers="IMPORT_INTEGRATION_CUSTOMERS",e.ResyncIntegration="RESYNC_INTEGRATION",e.SubscriptionMigration="SUBSCRIPTION_MIGRATION"}(ie||(ie={})),function(e){e.Day="DAY",e.Month="MONTH"}(oe||(oe={})),function(e){e.CreatedAt="createdAt",e.EnvironmentId="environmentId",e.Id="id"}(ae||(ae={})),function(e){e.Hubspot="HUBSPOT",e.Stripe="STRIPE",e.Zuora="ZUORA"}(se||(se={})),function(e){e.EveryFriday="EveryFriday",e.EveryMonday="EveryMonday",e.EverySaturday="EverySaturday",e.EverySunday="EverySunday",e.EveryThursday="EveryThursday",e.EveryTuesday="EveryTuesday",e.EveryWednesday="EveryWednesday",e.SubscriptionStart="SubscriptionStart"}(ue||(ue={})),function(e){e.InvalidFeatureType="InvalidFeatureType",e.CustomerNotFound="CustomerNotFound",e.FeatureNotFound="FeatureNotFound",e.NoActiveSubscriptions="NoActiveSubscriptions",e.CustomerNotEntitledForFeature="CustomerNotEntitledForFeature",e.RequestedUsageExceedsLimit="RequestedUsageExceedsLimit",e.Unknown="Unknown"}(ce||(ce={})),function(e){e.Boolean="Boolean",e.Numeric="Numeric"}(le||(le={})),function(e){e.Fluctuating="Fluctuating",e.Incremental="Incremental",e.None="None"}(fe||(fe={})),function(e){e.Daily="Daily",e.Hourly="Hourly",e.Monthly="Monthly",e.Weekly="Weekly"}(pe||(pe={}));var he={isFallback:!0,hasAccess:!1,accessDeniedReason:ce.Unknown},ye={isFallback:!0,hasAccess:!1,isUnlimited:!1,accessDeniedReason:ce.Unknown},ve={isFallback:!0,hasAccess:!1,isUnlimited:!1,currentUsage:0,requestedUsage:1,accessDeniedReason:ce.Unknown},me=function(){function e(e){Object.assign(this,e)}return e.prototype.getActiveSubscriptions=function(){return this.subscriptions.filter((function(e){return e.status===te.Active}))},e.prototype.getActiveTrials=function(){return this.subscriptions.filter((function(e){return e.status===te.InTrial}))},e.prototype.getActivePromotionalEntitlements=function(){return this.promotionalEntitlements.filter((function(e){return e.status===G.Active}))},e}(),ge=function(e,t){return ge=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},ge(e,t)};function be(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}ge(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Ee=function(){return Ee=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ee.apply(this,arguments)};function _e(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function we(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function Ie(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function Te(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function Oe(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}Object.create,Object.create;const Se=/\r\n|[\n\r]/g;function De(e,t){let n=0,r=1;for(const i of e.body.matchAll(Se)){if("number"==typeof i.index||Oe(!1),i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}function xe(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,a=t.line+o,s=1===t.line?n:0,u=t.column+s,c=`${e.name}:${a}:${u}\n`,l=r.split(/\r\n|[\n\r]/g),f=l[i];if(f.length>120){const e=Math.floor(u/80),t=u%80,n=[];for(let e=0;e<f.length;e+=80)n.push(f.slice(e,e+80));return c+Ae([[`${a} |`,n[0]],...n.slice(1,e+1).map((e=>["|",e])),["|","^".padStart(t)],["|",n[e+1]]])}return c+Ae([[a-1+" |",l[i-1]],[`${a} |`,f],["|","^".padStart(u)],[`${a+1} |`,l[i+1]]])}function Ae(e){const t=e.filter((([e,t])=>void 0!==t)),n=Math.max(...t.map((([e])=>e.length)));return t.map((([e,t])=>e.padStart(n)+(t?" "+t:""))).join("\n")}class ke extends Error{constructor(e,t,n,r,i,o,a){var s,u,c;super(e),this.name="GraphQLError",this.path=null!=i?i:void 0,this.originalError=null!=o?o:void 0,this.nodes=Ne(Array.isArray(t)?t:t?[t]:void 0);const l=Ne(null===(s=this.nodes)||void 0===s?void 0:s.map((e=>e.loc)).filter((e=>null!=e)));this.source=null!=n?n:null==l||null===(u=l[0])||void 0===u?void 0:u.source,this.positions=null!=r?r:null==l?void 0:l.map((e=>e.start)),this.locations=r&&n?r.map((e=>De(n,e))):null==l?void 0:l.map((e=>De(e.source,e.start)));const f="object"==typeof(p=null==o?void 0:o.extensions)&&null!==p?null==o?void 0:o.extensions:void 0;var p;this.extensions=null!==(c=null!=a?a:f)&&void 0!==c?c:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=o&&o.stack?Object.defineProperty(this,"stack",{value:o.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,ke):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(e+="\n\n"+xe((t=n.loc).source,De(t.source,t.start)));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+xe(this.source,t);var t;return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function Ne(e){return void 0===e||0===e.length?void 0:e}function Pe(e,t,n){return new ke(`Syntax Error: ${n}`,void 0,e,[t])}let Ce;var Re;(Re=Ce||(Ce={})).NAME="Name",Re.DOCUMENT="Document",Re.OPERATION_DEFINITION="OperationDefinition",Re.VARIABLE_DEFINITION="VariableDefinition",Re.SELECTION_SET="SelectionSet",Re.FIELD="Field",Re.ARGUMENT="Argument",Re.FRAGMENT_SPREAD="FragmentSpread",Re.INLINE_FRAGMENT="InlineFragment",Re.FRAGMENT_DEFINITION="FragmentDefinition",Re.VARIABLE="Variable",Re.INT="IntValue",Re.FLOAT="FloatValue",Re.STRING="StringValue",Re.BOOLEAN="BooleanValue",Re.NULL="NullValue",Re.ENUM="EnumValue",Re.LIST="ListValue",Re.OBJECT="ObjectValue",Re.OBJECT_FIELD="ObjectField",Re.DIRECTIVE="Directive",Re.NAMED_TYPE="NamedType",Re.LIST_TYPE="ListType",Re.NON_NULL_TYPE="NonNullType",Re.SCHEMA_DEFINITION="SchemaDefinition",Re.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",Re.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",Re.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",Re.FIELD_DEFINITION="FieldDefinition",Re.INPUT_VALUE_DEFINITION="InputValueDefinition",Re.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",Re.UNION_TYPE_DEFINITION="UnionTypeDefinition",Re.ENUM_TYPE_DEFINITION="EnumTypeDefinition",Re.ENUM_VALUE_DEFINITION="EnumValueDefinition",Re.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",Re.DIRECTIVE_DEFINITION="DirectiveDefinition",Re.SCHEMA_EXTENSION="SchemaExtension",Re.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",Re.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",Re.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",Re.UNION_TYPE_EXTENSION="UnionTypeExtension",Re.ENUM_TYPE_EXTENSION="EnumTypeExtension",Re.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension";class Fe{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class Me{constructor(e,t,n,r,i,o){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const je={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},Ue=new Set(Object.keys(je));function Le(e){const t=null==e?void 0:e.kind;return"string"==typeof t&&Ue.has(t)}let qe,Ve;var Be;function Qe(e){return ze(e,[])}function ze(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const n=[...t,e];if(function(e){return"function"==typeof e.toJSON}(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:ze(t,n)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";const n=Math.min(10,e.length),r=e.length-n,i=[];for(let r=0;r<n;++r)i.push(ze(e[r],t));return 1===r?i.push("... 1 more item"):r>1&&i.push(`... ${r} more items`),"["+i.join(", ")+"]"}(e,n);return function(e,t){const n=Object.entries(e);if(0===n.length)return"{}";if(t.length>2)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const r=n.map((([e,n])=>e+": "+ze(n,t)));return"{ "+r.join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}function Ge(e,t){if(!Boolean(e))throw new Error(t)}!function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"}(qe||(qe={})),(Be=Ve||(Ve={})).SOF="<SOF>",Be.EOF="<EOF>",Be.BANG="!",Be.DOLLAR="$",Be.AMP="&",Be.PAREN_L="(",Be.PAREN_R=")",Be.SPREAD="...",Be.COLON=":",Be.EQUALS="=",Be.AT="@",Be.BRACKET_L="[",Be.BRACKET_R="]",Be.BRACE_L="{",Be.PIPE="|",Be.BRACE_R="}",Be.NAME="Name",Be.INT="Int",Be.FLOAT="Float",Be.STRING="String",Be.BLOCK_STRING="BlockString",Be.COMMENT="Comment";class $e{constructor(e,t="GraphQL request",n={line:1,column:1}){"string"==typeof e||Ge(!1,`Body must be a string. Received: ${Qe(e)}.`),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||Ge(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Ge(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}let We;function Ke(e){const t=e.split(/\r\n|[\n\r]/g),n=function(e){var t;let n=!0,r=!0,i=0,o=null;for(let t=0;t<e.length;++t)switch(e.charCodeAt(t)){case 13:10===e.charCodeAt(t+1)&&++t;case 10:n=!1,r=!0,i=0;break;case 9:case 32:++i;break;default:r&&!n&&(null===o||i<o)&&(o=i),r=!1}return null!==(t=o)&&void 0!==t?t:0}(e);if(0!==n)for(let e=1;e<t.length;e++)t[e]=t[e].slice(n);let r=0;for(;r<t.length&&He(t[r]);)++r;let i=t.length;for(;i>r&&He(t[i-1]);)--i;return t.slice(r,i).join("\n")}function He(e){for(const t of e)if(" "!==t&&"\t"!==t)return!1;return!0}function Ye(e){return e>=48&&e<=57}function Je(e){return e>=97&&e<=122||e>=65&&e<=90}function Xe(e){return Je(e)||95===e}!function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"}(We||(We={}));class Ze{constructor(e){const t=new Me(Ve.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==Ve.EOF)do{if(e.next)e=e.next;else{const t=at(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===Ve.COMMENT);return e}}function et(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function tt(e,t){return nt(e.charCodeAt(t))&&rt(e.charCodeAt(t+1))}function nt(e){return e>=55296&&e<=56319}function rt(e){return e>=56320&&e<=57343}function it(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return Ve.EOF;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function ot(e,t,n,r,i){const o=e.line,a=1+n-e.lineStart;return new Me(t,n,r,o,a,i)}function at(e,t){const n=e.source.body,r=n.length;let i=t;for(;i<r;){const t=n.charCodeAt(i);switch(t){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:10===n.charCodeAt(i+1)?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return st(e,i);case 33:return ot(e,Ve.BANG,i,i+1);case 36:return ot(e,Ve.DOLLAR,i,i+1);case 38:return ot(e,Ve.AMP,i,i+1);case 40:return ot(e,Ve.PAREN_L,i,i+1);case 41:return ot(e,Ve.PAREN_R,i,i+1);case 46:if(46===n.charCodeAt(i+1)&&46===n.charCodeAt(i+2))return ot(e,Ve.SPREAD,i,i+3);break;case 58:return ot(e,Ve.COLON,i,i+1);case 61:return ot(e,Ve.EQUALS,i,i+1);case 64:return ot(e,Ve.AT,i,i+1);case 91:return ot(e,Ve.BRACKET_L,i,i+1);case 93:return ot(e,Ve.BRACKET_R,i,i+1);case 123:return ot(e,Ve.BRACE_L,i,i+1);case 124:return ot(e,Ve.PIPE,i,i+1);case 125:return ot(e,Ve.BRACE_R,i,i+1);case 34:return 34===n.charCodeAt(i+1)&&34===n.charCodeAt(i+2)?vt(e,i):lt(e,i)}if(Ye(t)||45===t)return ut(e,i,t);if(Xe(t))return mt(e,i);throw Pe(e.source,i,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":et(t)||tt(n,i)?`Unexpected character: ${it(e,i)}.`:`Invalid character: ${it(e,i)}.`)}return ot(e,Ve.EOF,r,r)}function st(e,t){const n=e.source.body,r=n.length;let i=t+1;for(;i<r;){const e=n.charCodeAt(i);if(10===e||13===e)break;if(et(e))++i;else{if(!tt(n,i))break;i+=2}}return ot(e,Ve.COMMENT,t,i,n.slice(t+1,i))}function ut(e,t,n){const r=e.source.body;let i=t,o=n,a=!1;if(45===o&&(o=r.charCodeAt(++i)),48===o){if(o=r.charCodeAt(++i),Ye(o))throw Pe(e.source,i,`Invalid number, unexpected digit after 0: ${it(e,i)}.`)}else i=ct(e,i,o),o=r.charCodeAt(i);if(46===o&&(a=!0,o=r.charCodeAt(++i),i=ct(e,i,o),o=r.charCodeAt(i)),69!==o&&101!==o||(a=!0,o=r.charCodeAt(++i),43!==o&&45!==o||(o=r.charCodeAt(++i)),i=ct(e,i,o),o=r.charCodeAt(i)),46===o||Xe(o))throw Pe(e.source,i,`Invalid number, expected digit but got: ${it(e,i)}.`);return ot(e,a?Ve.FLOAT:Ve.INT,t,i,r.slice(t,i))}function ct(e,t,n){if(!Ye(n))throw Pe(e.source,t,`Invalid number, expected digit but got: ${it(e,t)}.`);const r=e.source.body;let i=t+1;for(;Ye(r.charCodeAt(i));)++i;return i}function lt(e,t){const n=e.source.body,r=n.length;let i=t+1,o=i,a="";for(;i<r;){const r=n.charCodeAt(i);if(34===r)return a+=n.slice(o,i),ot(e,Ve.STRING,t,i+1,a);if(92!==r){if(10===r||13===r)break;if(et(r))++i;else{if(!tt(n,i))throw Pe(e.source,i,`Invalid character within String: ${it(e,i)}.`);i+=2}}else{a+=n.slice(o,i);const t=117===n.charCodeAt(i+1)?123===n.charCodeAt(i+2)?ft(e,i):pt(e,i):yt(e,i);a+=t.value,i+=t.size,o=i}}throw Pe(e.source,i,"Unterminated string.")}function ft(e,t){const n=e.source.body;let r=0,i=3;for(;i<12;){const e=n.charCodeAt(t+i++);if(125===e){if(i<5||!et(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|ht(e),r<0)break}throw Pe(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+i)}".`)}function pt(e,t){const n=e.source.body,r=dt(n,t+2);if(et(r))return{value:String.fromCodePoint(r),size:6};if(nt(r)&&92===n.charCodeAt(t+6)&&117===n.charCodeAt(t+7)){const e=dt(n,t+8);if(rt(e))return{value:String.fromCodePoint(r,e),size:12}}throw Pe(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function dt(e,t){return ht(e.charCodeAt(t))<<12|ht(e.charCodeAt(t+1))<<8|ht(e.charCodeAt(t+2))<<4|ht(e.charCodeAt(t+3))}function ht(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function yt(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw Pe(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function vt(e,t){const n=e.source.body,r=n.length,i=e.line,o=1+t-e.lineStart;let a=t+3,s=a,u="";for(;a<r;){const r=n.charCodeAt(a);if(34===r&&34===n.charCodeAt(a+1)&&34===n.charCodeAt(a+2))return u+=n.slice(s,a),new Me(Ve.BLOCK_STRING,t,a+3,i,o,Ke(u));if(92!==r||34!==n.charCodeAt(a+1)||34!==n.charCodeAt(a+2)||34!==n.charCodeAt(a+3))if(10!==r&&13!==r)if(et(r))++a;else{if(!tt(n,a))throw Pe(e.source,a,`Invalid character within String: ${it(e,a)}.`);a+=2}else 13===r&&10===n.charCodeAt(a+1)?a+=2:++a,++e.line,e.lineStart=a;else u+=n.slice(s,a)+'"""',a+=4,s=a}throw Pe(e.source,a,"Unterminated string.")}function mt(e,t){const n=e.source.body,r=n.length;let i=t+1;for(;i<r&&(Je(o=n.charCodeAt(i))||Ye(o)||95===o);)++i;var o;return ot(e,Ve.NAME,t,i,n.slice(t,i))}class gt{constructor(e,t){const n=function(e){return e instanceof $e}(e)?e:new $e(e);this._lexer=new Ze(n),this._options=t}parseName(){const e=this.expectToken(Ve.NAME);return this.node(e,{kind:Ce.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:Ce.DOCUMENT,definitions:this.many(Ve.SOF,this.parseDefinition,Ve.EOF)})}parseDefinition(){if(this.peek(Ve.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===Ve.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw Pe(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(Ve.BRACE_L))return this.node(e,{kind:Ce.OPERATION_DEFINITION,operation:qe.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let n;return this.peek(Ve.NAME)&&(n=this.parseName()),this.node(e,{kind:Ce.OPERATION_DEFINITION,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(Ve.NAME);switch(e.value){case"query":return qe.QUERY;case"mutation":return qe.MUTATION;case"subscription":return qe.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(Ve.PAREN_L,this.parseVariableDefinition,Ve.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:Ce.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(Ve.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(Ve.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(Ve.DOLLAR),this.node(e,{kind:Ce.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:Ce.SELECTION_SET,selections:this.many(Ve.BRACE_L,this.parseSelection,Ve.BRACE_R)})}parseSelection(){return this.peek(Ve.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,r;return this.expectOptionalToken(Ve.COLON)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:Ce.FIELD,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(Ve.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(Ve.PAREN_L,t,Ve.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(Ve.COLON),this.node(t,{kind:Ce.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(Ve.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(Ve.NAME)?this.node(e,{kind:Ce.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:Ce.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){var e;const t=this._lexer.token;return this.expectKeyword("fragment"),!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacyFragmentVariables)?this.node(t,{kind:Ce.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:Ce.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case Ve.BRACKET_L:return this.parseList(e);case Ve.BRACE_L:return this.parseObject(e);case Ve.INT:return this._lexer.advance(),this.node(t,{kind:Ce.INT,value:t.value});case Ve.FLOAT:return this._lexer.advance(),this.node(t,{kind:Ce.FLOAT,value:t.value});case Ve.STRING:case Ve.BLOCK_STRING:return this.parseStringLiteral();case Ve.NAME:switch(this._lexer.advance(),t.value){case"true":return this.node(t,{kind:Ce.BOOLEAN,value:!0});case"false":return this.node(t,{kind:Ce.BOOLEAN,value:!1});case"null":return this.node(t,{kind:Ce.NULL});default:return this.node(t,{kind:Ce.ENUM,value:t.value})}case Ve.DOLLAR:if(e){if(this.expectToken(Ve.DOLLAR),this._lexer.token.kind===Ve.NAME){const e=this._lexer.token.value;throw Pe(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable()}throw this.unexpected()}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this._lexer.advance(),this.node(e,{kind:Ce.STRING,value:e.value,block:e.kind===Ve.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:Ce.LIST,values:this.any(Ve.BRACKET_L,(()=>this.parseValueLiteral(e)),Ve.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:Ce.OBJECT,fields:this.any(Ve.BRACE_L,(()=>this.parseObjectField(e)),Ve.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(Ve.COLON),this.node(t,{kind:Ce.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(Ve.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(Ve.AT),this.node(t,{kind:Ce.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(Ve.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(Ve.BRACKET_R),t=this.node(e,{kind:Ce.LIST_TYPE,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(Ve.BANG)?this.node(e,{kind:Ce.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:Ce.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(Ve.STRING)||this.peek(Ve.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.many(Ve.BRACE_L,this.parseOperationTypeDefinition,Ve.BRACE_R);return this.node(e,{kind:Ce.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(Ve.COLON);const n=this.parseNamedType();return this.node(e,{kind:Ce.OPERATION_TYPE_DEFINITION,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:Ce.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:Ce.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(Ve.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(Ve.BRACE_L,this.parseFieldDefinition,Ve.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(Ve.COLON);const i=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:Ce.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:o})}parseArgumentDefs(){return this.optionalMany(Ve.PAREN_L,this.parseInputValueDef,Ve.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(Ve.COLON);const r=this.parseTypeReference();let i;this.expectOptionalToken(Ve.EQUALS)&&(i=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:Ce.INPUT_VALUE_DEFINITION,description:t,name:n,type:r,defaultValue:i,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:Ce.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:Ce.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(Ve.EQUALS)?this.delimitedMany(Ve.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:Ce.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(Ve.BRACE_L,this.parseEnumValueDefinition,Ve.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:Ce.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw Pe(this._lexer.source,this._lexer.token.start,`${bt(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:Ce.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(Ve.BRACE_L,this.parseInputValueDef,Ve.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===Ve.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),n=this.optionalMany(Ve.BRACE_L,this.parseOperationTypeDefinition,Ve.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:Ce.SCHEMA_EXTENSION,directives:t,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),n=this.parseConstDirectives();if(0===n.length)throw this.unexpected();return this.node(e,{kind:Ce.SCALAR_TYPE_EXTENSION,name:t,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:Ce.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:Ce.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:Ce.UNION_TYPE_EXTENSION,name:t,directives:n,types:r})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:Ce.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:Ce.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(Ve.AT);const n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:Ce.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:o})}parseDirectiveLocations(){return this.delimitedMany(Ve.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(We,t.value))return t;throw this.unexpected(e)}node(e,t){var n;return!0!==(null===(n=this._options)||void 0===n?void 0:n.noLocation)&&(t.loc=new Fe(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw Pe(this._lexer.source,t.start,`Expected ${Et(e)}, found ${bt(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this._lexer.advance(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==Ve.NAME||t.value!==e)throw Pe(this._lexer.source,t.start,`Expected "${e}", found ${bt(t)}.`);this._lexer.advance()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===Ve.NAME&&t.value===e&&(this._lexer.advance(),!0)}unexpected(e){const t=null!=e?e:this._lexer.token;return Pe(this._lexer.source,t.start,`Unexpected ${bt(t)}.`)}any(e,t,n){this.expectToken(e);const r=[];for(;!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}return[]}many(e,t,n){this.expectToken(e);const r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}}function bt(e){const t=e.value;return Et(e.kind)+(null!=t?` "${t}"`:"")}function Et(e){return function(e){return e===Ve.BANG||e===Ve.DOLLAR||e===Ve.AMP||e===Ve.PAREN_L||e===Ve.PAREN_R||e===Ve.SPREAD||e===Ve.COLON||e===Ve.EQUALS||e===Ve.AT||e===Ve.BRACKET_L||e===Ve.BRACKET_R||e===Ve.BRACE_L||e===Ve.PIPE||e===Ve.BRACE_R}(e)?`"${e}"`:e}var _t=new Map,wt=new Map,It=!0,Tt=!1;function Ot(e){return e.replace(/[\s,]+/g," ").trim()}function St(e){var t,n,r,i=Ot(e);if(!_t.has(i)){var o=function(e,t){return new gt(e,t).parseDocument()}(e,{experimentalFragmentVariables:Tt,allowLegacyFragmentVariables:Tt});if(!o||"Document"!==o.kind)throw new Error("Not a valid GraphQL document.");_t.set(i,function(e){var t=new Set(e.definitions);t.forEach((function(e){e.loc&&delete e.loc,Object.keys(e).forEach((function(n){var r=e[n];r&&"object"==typeof r&&t.add(r)}))}));var n=e.loc;return n&&(delete n.startToken,delete n.endToken),e}((t=o,n=new Set,r=[],t.definitions.forEach((function(e){if("FragmentDefinition"===e.kind){var t=e.name.value,i=Ot((a=e.loc).source.body.substring(a.start,a.end)),o=wt.get(t);o&&!o.has(i)?It&&console.warn("Warning: fragment with name "+t+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):o||wt.set(t,o=new Set),o.add(i),n.has(i)||(n.add(i),r.push(e))}else r.push(e);var a})),Ee(Ee({},t),{definitions:r}))))}return _t.get(i)}function Dt(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];"string"==typeof e&&(e=[e]);var r=e[0];return t.forEach((function(t,n){t&&"Document"===t.kind?r+=t.loc.source.body:r+=t,r+=e[n+1]})),St(r)}var xt,At=Dt;(xt=Dt||(Dt={})).gql=At,xt.resetCaches=function(){_t.clear(),wt.clear()},xt.disableFragmentWarnings=function(){It=!1},xt.enableExperimentalFragmentVariables=function(){Tt=!0},xt.disableExperimentalFragmentVariables=function(){Tt=!1},Dt.default=Dt;var kt,Nt,Pt,Ct=Dt(kt||(Nt=["\n fragment PriceFragment on Price {\n billingModel\n billingPeriod\n price {\n amount\n currency\n }\n feature {\n featureUnits\n featureUnitsPlural\n displayName\n }\n }\n"],Pt=["\n fragment PriceFragment on Price {\n billingModel\n billingPeriod\n price {\n amount\n currency\n }\n feature {\n featureUnits\n featureUnitsPlural\n displayName\n }\n }\n"],Object.defineProperty?Object.defineProperty(Nt,"raw",{value:Pt}):Nt.raw=Pt,kt=Nt)),Rt=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},Ft=Dt(Lt||(Lt=Rt(["\n fragment PackageEntitlementFragment on PackageEntitlement {\n usageLimit\n hasUnlimitedUsage\n featureId\n resetPeriod\n feature {\n featureType\n meterType\n featureUnits\n featureUnitsPlural\n displayName\n description\n refId\n }\n }\n"],["\n fragment PackageEntitlementFragment on PackageEntitlement {\n usageLimit\n hasUnlimitedUsage\n featureId\n resetPeriod\n feature {\n featureType\n meterType\n featureUnits\n featureUnitsPlural\n displayName\n description\n refId\n }\n }\n"]))),Mt=Dt(qt||(qt=Rt(["\n fragment AddonFragment on Addon {\n refId\n displayName\n description\n additionalMetaData\n entitlements {\n ...PackageEntitlementFragment\n }\n prices {\n ...PriceFragment\n }\n pricingType\n }\n"],["\n fragment AddonFragment on Addon {\n refId\n displayName\n description\n additionalMetaData\n entitlements {\n ...PackageEntitlementFragment\n }\n prices {\n ...PriceFragment\n }\n pricingType\n }\n"]))),jt=Dt(Vt||(Vt=Rt(["\n fragment PlanFragment on Plan {\n id\n refId\n description\n displayName\n additionalMetaData\n product {\n refId\n displayName\n description\n additionalMetaData\n }\n basePlan {\n id\n refId\n displayName\n }\n entitlements {\n ...PackageEntitlementFragment\n }\n inheritedEntitlements {\n ...PackageEntitlementFragment\n }\n prices {\n ...PriceFragment\n }\n pricingType\n defaultTrialConfig {\n duration\n units\n }\n }\n ","\n ","\n ","\n"],["\n fragment PlanFragment on Plan {\n id\n refId\n description\n displayName\n additionalMetaData\n product {\n refId\n displayName\n description\n additionalMetaData\n }\n basePlan {\n id\n refId\n displayName\n }\n entitlements {\n ...PackageEntitlementFragment\n }\n inheritedEntitlements {\n ...PackageEntitlementFragment\n }\n prices {\n ...PriceFragment\n }\n pricingType\n defaultTrialConfig {\n duration\n units\n }\n }\n ","\n ","\n ","\n"])),Ft,Ct,Mt);const Ut=function(){function e(e){this.client=e}return e.prototype.getPlans=function(e){return this.client.query({query:Dt(Bt||(Bt=Rt(["\n query GetPlans($paging: CursorPaging, $filter: PlanFilter, $addonFilter: AddonFilter, $sorting: [PlanSort!]) {\n plans(paging: $paging, filter: $filter, sorting: $sorting) {\n edges {\n node {\n ...PlanFragment\n compatibleAddons(filter: $addonFilter) {\n ...AddonFragment\n }\n }\n }\n }\n }\n ","\n "],["\n query GetPlans($paging: CursorPaging, $filter: PlanFilter, $addonFilter: AddonFilter, $sorting: [PlanSort!]) {\n plans(paging: $paging, filter: $filter, sorting: $sorting) {\n edges {\n node {\n ...PlanFragment\n compatibleAddons(filter: $addonFilter) {\n ...AddonFragment\n }\n }\n }\n }\n }\n ","\n "])),jt),fetchPolicy:"no-cache",variables:{paging:{first:50},filter:{status:{eq:j.Published},isLatest:{is:!0},product:e?{refId:{eq:e}}:{}},addonFilter:{status:{eq:j.Published},isLatest:{is:!0}},sorting:[{field:L.RefId,direction:W.Asc}]}})},e}();var Lt,qt,Vt,Bt,Qt=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},zt=Dt(Ht||(Ht=Qt(["\n fragment TotalPriceFragment on CustomerSubscriptionTotalPrice {\n subTotal {\n amount\n currency\n }\n total {\n amount\n currency\n }\n }\n"],["\n fragment TotalPriceFragment on CustomerSubscriptionTotalPrice {\n subTotal {\n amount\n currency\n }\n total {\n amount\n currency\n }\n }\n"]))),Gt=Dt(Yt||(Yt=Qt(["\n fragment SubscriptionFragment on CustomerSubscription {\n id\n startDate\n endDate\n trialEndDate\n cancellationDate\n effectiveEndDate\n status\n refId\n currentBillingPeriodEnd\n additionalMetaData\n prices {\n usageLimit\n price {\n ...PriceFragment\n }\n }\n pricingType\n totalPrice {\n ...TotalPriceFragment\n }\n plan {\n id\n refId\n displayName\n description\n additionalMetaData\n product {\n refId\n displayName\n }\n entitlements {\n usageLimit\n featureId\n hasUnlimitedUsage\n packageId\n resetPeriod\n feature {\n featureType\n meterType\n featureUnits\n featureUnitsPlural\n displayName\n description\n refId\n }\n }\n inheritedEntitlements {\n usageLimit\n featureId\n hasUnlimitedUsage\n packageId\n resetPeriod\n packageId\n feature {\n featureType\n meterType\n featureUnits\n featureUnitsPlural\n displayName\n description\n refId\n }\n }\n prices {\n ...PriceFragment\n }\n }\n addons {\n id\n quantity\n addon {\n id\n refId\n displayName\n description\n additionalMetaData\n entitlements {\n usageLimit\n hasUnlimitedUsage\n featureId\n feature {\n featureType\n meterType\n featureUnits\n featureUnitsPlural\n displayName\n description\n refId\n }\n }\n }\n }\n }\n ","\n ","\n"],["\n fragment SubscriptionFragment on CustomerSubscription {\n id\n startDate\n endDate\n trialEndDate\n cancellationDate\n effectiveEndDate\n status\n refId\n currentBillingPeriodEnd\n additionalMetaData\n prices {\n usageLimit\n price {\n ...PriceFragment\n }\n }\n pricingType\n totalPrice {\n ...TotalPriceFragment\n }\n plan {\n id\n refId\n displayName\n description\n additionalMetaData\n product {\n refId\n displayName\n }\n entitlements {\n usageLimit\n featureId\n hasUnlimitedUsage\n packageId\n resetPeriod\n feature {\n featureType\n meterType\n featureUnits\n featureUnitsPlural\n displayName\n description\n refId\n }\n }\n inheritedEntitlements {\n usageLimit\n featureId\n hasUnlimitedUsage\n packageId\n resetPeriod\n packageId\n feature {\n featureType\n meterType\n featureUnits\n featureUnitsPlural\n displayName\n description\n refId\n }\n }\n prices {\n ...PriceFragment\n }\n }\n addons {\n id\n quantity\n addon {\n id\n refId\n displayName\n description\n additionalMetaData\n entitlements {\n usageLimit\n hasUnlimitedUsage\n featureId\n feature {\n featureType\n meterType\n featureUnits\n featureUnitsPlural\n displayName\n description\n refId\n }\n }\n }\n }\n }\n ","\n ","\n"])),Ct,zt),$t=Dt(Jt||(Jt=Qt(["\n fragment PromotionalEntitlementFragment on PromotionalEntitlement {\n status\n usageLimit\n featureId\n hasUnlimitedUsage\n resetPeriod\n endDate\n isVisible\n feature {\n featureType\n meterType\n featureUnits\n featureUnitsPlural\n displayName\n description\n refId\n }\n }\n"],["\n fragment PromotionalEntitlementFragment on PromotionalEntitlement {\n status\n usageLimit\n featureId\n hasUnlimitedUsage\n resetPeriod\n endDate\n isVisible\n feature {\n featureType\n meterType\n featureUnits\n featureUnitsPlural\n displayName\n description\n refId\n }\n }\n"]))),Wt=Dt(Xt||(Xt=Qt(["\n fragment CustomerFragment on Customer {\n id\n name\n email\n createdAt\n updatedAt\n hasPaymentMethod\n refId\n additionalMetaData\n trialedPlans {\n productId\n productRefId\n planRefId\n planId\n }\n promotionalEntitlements {\n ...PromotionalEntitlementFragment\n }\n subscriptions {\n ...SubscriptionFragment\n }\n }\n ","\n ","\n"],["\n fragment CustomerFragment on Customer {\n id\n name\n email\n createdAt\n updatedAt\n hasPaymentMethod\n refId\n additionalMetaData\n trialedPlans {\n productId\n productRefId\n planRefId\n planId\n }\n promotionalEntitlements {\n ...PromotionalEntitlementFragment\n }\n subscriptions {\n ...SubscriptionFragment\n }\n }\n ","\n ","\n"])),Gt,$t);const Kt=function(){function e(e){this.client=e}return e.prototype.getCustomer=function(e){return this.client.query({query:Dt(Zt||(Zt=Qt(["\n query GetCustomerByRefId($filter: CustomerFilter) {\n customers(filter: $filter) {\n edges {\n node {\n ...CustomerFragment\n }\n }\n }\n }\n ","\n "],["\n query GetCustomerByRefId($filter: CustomerFilter) {\n customers(filter: $filter) {\n edges {\n node {\n ...CustomerFragment\n }\n }\n }\n }\n ","\n "])),Wt),variables:{filter:{refId:{eq:e}}},fetchPolicy:"no-cache"})},e}();var Ht,Yt,Jt,Xt,Zt,en=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},tn=Dt(on||(on=en(["\n fragment CouponFragment on Coupon {\n id\n discountValue\n type\n additionalMetaData\n refId\n name\n description\n createdAt\n updatedAt\n billingId\n billingLinkUrl\n type\n status\n syncStates {\n vendorIdentifier\n status\n }\n customers {\n id\n }\n }\n"],["\n fragment CouponFragment on Coupon {\n id\n discountValue\n type\n additionalMetaData\n refId\n name\n description\n createdAt\n updatedAt\n billingId\n billingLinkUrl\n type\n status\n syncStates {\n vendorIdentifier\n status\n }\n customers {\n id\n }\n }\n"]))),nn=Dt(an||(an=en(["\n ","\n query FetchCoupons($filter: CouponFilter, $sorting: [CouponSort!], $paging: CursorPaging) {\n coupons(filter: $filter, sorting: $sorting, paging: $paging) {\n edges {\n node {\n ...CouponFragment\n }\n }\n }\n }\n"],["\n ","\n query FetchCoupons($filter: CouponFilter, $sorting: [CouponSort!], $paging: CursorPaging) {\n coupons(filter: $filter, sorting: $sorting, paging: $paging) {\n edges {\n node {\n ...CouponFragment\n }\n }\n }\n }\n"])),tn);const rn=function(){function e(e){this.client=e}return e.prototype.getCoupons=function(){return this.client.query({query:nn,fetchPolicy:"no-cache",variables:{paging:{first:50},filter:{status:{eq:h.Active}}}})},e}();var on,an;const sn=function(e){this.paywall=new Ut(e),this.customers=new Kt(e),this.coupons=new rn(e)};var un=n(1609),cn=n.n(un),ln=n(2492),fn=n.n(ln);function pn(e){var t=e.customerId;if(!t||cn()(t))throw new Error("You must set customer ID first, use setCustomerId function or pass it via the constructor");return t}var dn=n(5161),hn=n.n(dn),yn=n(9734),vn=n.n(yn),mn=function(){return mn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},mn.apply(this,arguments)},gn=function(){function e(){this.getResetPeriodData=function(e,t){switch(e){case pe.Monthly:return{monthlyResetPeriodConfiguration:{accordingTo:t.monthlyAccordingTo||R.SubscriptionStart}};case pe.Weekly:return{weeklyResetPeriodConfiguration:{accordingTo:t.weeklyAccordingTo||ue.EveryFriday}};default:return{}}}}return e.prototype.mapBooleanEntitlement=function(e,t){return{isFallback:!1,hasAccess:t.hasAccess,accessDeniedReason:t.accessDeniedReason,feature:e.calculatedEntitlement.feature?mn(mn({},e.calculatedEntitlement.feature),{isMetered:!1}):void 0}},e.prototype.mapNumericEntitlement=function(e,t){var n=e.calculatedEntitlement,r=n.hasUnlimitedUsage,i=n.usageLimit;return{isFallback:!1,hasAccess:t.hasAccess,accessDeniedReason:t.accessDeniedReason,isUnlimited:r,value:i||void 0,feature:e.calculatedEntitlement.feature?mn(mn({},e.calculatedEntitlement.feature),{isMetered:!1}):void 0}},e.prototype.mapMeteredEntitlement=function(e,t,n){var r=e.calculatedEntitlement,i=r.hasUnlimitedUsage,o=r.usageLimit,a=r.feature,s=e.featureUsage,u=s.currentUsage,c=s.nextResetDate,l=s.resetPeriod,f=null;return a&&a.featureType===le.Numeric&&a.meterType===C.Incremental&&l&&(f={nextResetDate:c,resetPeriod:l}),{isFallback:!1,hasAccess:t.hasAccess,accessDeniedReason:t.accessDeniedReason,isUnlimited:i,usageLimit:o||void 0,currentUsage:u,requestedUsage:n||0,resetSettings:f||void 0,feature:e.calculatedEntitlement.feature?mn(mn({},e.calculatedEntitlement.feature),{meterType:e.calculatedEntitlement.feature.meterType||void 0,isMetered:!0}):void 0}},e.prototype.mapEntitlement=function(e,t,n){var r=e.calculatedEntitlement;if(!r.feature)return this.mapBooleanEntitlement(e,t);var i=r.feature,o=i.featureType,a=i.meterType,s=o===le.Numeric&&(a===C.Incremental||a===C.Fluctuating);switch(o){case le.Boolean:return this.mapBooleanEntitlement(e,t);case le.Numeric:return s?this.mapMeteredEntitlement(e,t,n):this.mapNumericEntitlement(e,t)}},e.prototype.mapFeatureType=function(e){switch(e){case S.Boolean:return le.Boolean;case S.Number:return le.Numeric}},e.prototype.mapEntitlementResetPeriod=function(e){switch(e){case b.Day:return pe.Daily;case b.Hour:return pe.Hourly;case b.Week:return pe.Weekly;case b.Month:return pe.Monthly}},e.prototype.mapApiEntitlementResetPeriod=function(e){switch(e){case pe.Daily:return b.Day;case pe.Hourly:return b.Hour;case pe.Weekly:return b.Week;case pe.Monthly:return b.Month}},e.prototype.mapCachedEntitlement=function(e,t,n){var r;return e.feature&&(r={id:e.feature.refId,featureType:this.mapFeatureType(e.feature.featureType),meterType:e.feature.meterType||void 0,units:e.feature.featureUnits||void 0,unitsPlural:e.feature.featureUnitsPlural||void 0,displayName:e.feature.displayName,description:e.feature.description||""}),{calculatedEntitlement:{usageLimit:e.usageLimit,hasUnlimitedUsage:e.hasUnlimitedUsage,feature:r},featureUsage:{resetPeriod:e.resetPeriod?this.mapEntitlementResetPeriod(e.resetPeriod):void 0,resetPeriodConfiguration:e.resetPeriodConfiguration,currentUsage:t||e.currentUsage||0,nextResetDate:n||e.nextResetDate}}},e.prototype.mapCachedEntitlements=function(e){var t=this;return new Map(e.map((function(e){var n;return[(null===(n=e.feature)||void 0===n?void 0:n.refId)||"",t.mapCachedEntitlement(e)]})))},e.prototype.mapPlans=function(e){var t=this,n=e.plans.edges.map((function(e){return e.node}));return this.sortPlans(n).map((function(e,n){return t.mapPlan(e,n)}))},e.prototype.mapCoupons=function(e){var t=this;return e.coupons.edges.map((function(e){return e.node})).map((function(e){return t.mapCoupon(e)}))},e.prototype.mapCustomer=function(e){var t,n=this;return new me({id:e.refId,name:e.name||void 0,email:e.email||void 0,createdAt:new Date(e.createdAt),updatedAt:new Date(e.updatedAt),hasPaymentMethod:e.hasPaymentMethod,subscriptions:hn()(e.subscriptions,(function(e){return n.mapSubscription(e)})),promotionalEntitlements:hn()(e.promotionalEntitlements,(function(e){return n.mapPromotionalEntitlement(e)})),metadata:e.additionalMetaData,trialedPlans:(null===(t=e.trialedPlans)||void 0===t?void 0:t.map((function(e){return{productId:e.productRefId,planId:e.planRefId}})))||void 0})},e.prototype.mapTotalPrice=function(e,t,n){var r=e.feature,i=e.price,o={pricingModel:e.billingModel,billingPeriod:e.billingPeriod,amount:t.total.amount,grossAmount:t.subTotal.amount,currency:i.currency};return r&&(o.feature={displayName:r.displayName,units:r.featureUnits,unitsPlural:r.featureUnitsPlural,unitQuantity:n}),o},e.prototype.mapPrice=function(e,t){var n=e.feature,r=e.price,i={pricingModel:e.billingModel,billingPeriod:e.billingPeriod,amount:r.amount,currency:r.currency};return n&&(i.feature={displayName:n.displayName,units:n.featureUnits,unitsPlural:n.featureUnitsPlural,unitQuantity:t}),i},e.prototype.mapPlan=function(e,t){var n=this;return void 0===t&&(t=0),{id:e.refId,order:t,displayName:e.displayName,description:e.description,basePlan:e.basePlan?{id:e.basePlan.refId,displayName:e.basePlan.displayName}:void 0,entitlements:hn()(vn()(e.entitlements,(function(e){return e.feature.refId})),(function(e){return n.mapPackageEntitlement(e)})),inheritedEntitlements:hn()(vn()(e.inheritedEntitlements,(function(e){return e.feature.refId})),(function(e){return n.mapPackageEntitlement(e)})),pricePoints:hn()(e.prices,(function(e){return n.mapPrice(e)})),pricingType:e.pricingType,defaultTrialConfig:e.defaultTrialConfig,compatibleAddons:this.mapCompatibleAddons(e),product:{id:e.product.refId,displayName:e.product.displayName,description:e.product.description,metadata:e.product.additionalMetaData},metadata:e.additionalMetaData}},e.prototype.mapCompatibleAddons=function(e){var t=this;if(e.pricingType===V.Free||!e.compatibleAddons)return[];var n=e.compatibleAddons;return(e.pricingType===V.Paid?n.filter((function(e){return e.pricingType===V.Paid})):n).map((function(e){return t.mapAddon(e)}))},e.prototype.mapPackageEntitlement=function(e){var t=e.feature;return{usageLimit:e.usageLimit||0,feature:{id:t.refId,featureType:this.mapFeatureType(t.featureType),description:t.description||"",meterType:t.meterType||void 0,units:t.featureUnits||void 0,unitsPlural:t.featureUnitsPlural||void 0,displayName:t.displayName,isMetered:t.meterType===C.Fluctuating||t.meterType===C.Incremental},hasUnlimitedUsage:e.hasUnlimitedUsage,resetPeriod:e.resetPeriod?this.mapEntitlementResetPeriod(e.resetPeriod):void 0}},e.prototype.mapPromotionalEntitlement=function(e){var t=e.feature;return{status:e.status,usageLimit:e.usageLimit||0,feature:{id:t.refId,displayName:t.displayName,description:t.description||"",featureType:this.mapFeatureType(t.featureType),meterType:t.meterType||void 0,units:t.featureUnits||void 0,unitsPlural:t.featureUnitsPlural||void 0,isMetered:t.meterType===C.Fluctuating||t.meterType===C.Incremental},hasUnlimitedUsage:e.hasUnlimitedUsage,expiresAt:e.endDate,hasExpirationDate:!!e.endDate,isVisible:e.isVisible}},e.prototype.mapSubscription=function(e){var t,n=this,r=e.totalPrice,i=(e.prices||[])[0];return{id:e.refId,status:e.status,currentBillingPeriodEnd:this.mapDate(e.currentBillingPeriodEnd),plan:this.mapPlan(e.plan),price:i&&r?this.mapTotalPrice(i.price,r,i.usageLimit):null,pricingType:e.pricingType,addons:(null===(t=e.addons)||void 0===t?void 0:t.map((function(e){var t=e.quantity,r=e.addon;return{quantity:t,addon:n.mapAddon(r)}})))||[],startDate:e.startDate,endDate:this.mapDate(e.endDate),trialEndDate:this.mapDate(e.trialEndDate),cancellationDate:this.mapDate(e.cancellationDate),effectiveEndDate:this.mapDate(e.effectiveEndDate),metadata:e.additionalMetaData}},e.prototype.mapDate=function(e){return e?new Date(e):void 0},e.prototype.mapAddon=function(e){var t=this;return{id:e.refId,displayName:e.displayName,description:e.description||"",entitlements:hn()(e.entitlements,(function(e){return t.mapPackageEntitlement(e)})),pricePoints:hn()(e.prices,(function(e){return t.mapPrice(e)})),pricingType:e.pricingType,metadata:e.additionalMetaData}},e.prototype.sortPlans=function(e){var t=vn()(e.filter((function(e){return!e.basePlan})),(function(e){return e.refId})),n=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}([],t,!0);function r(e,t,n){var i=vn()(t.filter((function(t){var n;return(null===(n=t.basePlan)||void 0===n?void 0:n.refId)===e})),(function(e){return e.refId}));n.push.apply(n,i),n.length!==t.length&&i.forEach((function(e){return r(e.refId,t,n)}))}return t.forEach((function(t){return r(t.refId,e,n)})),n},e.prototype.mapAccessDeniedReason=function(e){switch(e){case ce.InvalidFeatureType:return a.Unknown;case ce.CustomerNotFound:return a.CustomerNotFound;case ce.FeatureNotFound:return a.FeatureNotFound;case ce.NoActiveSubscriptions:return a.NoActiveSubscription;case ce.CustomerNotEntitledForFeature:return a.NoFeatureEntitlementInSubscription;case ce.RequestedUsageExceedsLimit:return a.RequestedUsageExceedingLimit;case ce.Unknown:return a.Unknown}},e.prototype.mapFallbackBooleanEntitlementResult=function(e,t){return{hasAccess:e.hasAccess,accessDeniedReason:t.accessDeniedReason?this.mapAccessDeniedReason(t.accessDeniedReason):void 0}},e.prototype.mapFallbackNumericEntitlementResult=function(e,t){return{hasAccess:e.hasAccess,accessDeniedReason:t.accessDeniedReason?this.mapAccessDeniedReason(t.accessDeniedReason):void 0,usageLimit:e.value,hasUnlimitedUsage:e.isUnlimited}},e.prototype.mapEntitlementResult=function(e,t,n){return mn({hasAccess:e.hasAccess,accessDeniedReason:e.accessDeniedReason?this.mapAccessDeniedReason(e.accessDeniedReason):void 0,hasUnlimitedUsage:null==t?void 0:t.calculatedEntitlement.hasUnlimitedUsage,usageLimit:null==t?void 0:t.calculatedEntitlement.usageLimit,currentUsage:null==t?void 0:t.featureUsage.currentUsage,requestedUsage:n,nextResetDate:null==t?void 0:t.featureUsage.nextResetDate,resetPeriod:(null==t?void 0:t.featureUsage.resetPeriod)?this.mapApiEntitlementResetPeriod(t.featureUsage.resetPeriod):void 0},this.getResetPeriodData(null==t?void 0:t.featureUsage.resetPeriod,null==t?void 0:t.featureUsage.resetPeriodConfiguration))},e.prototype.mapFallbackMeteredEntitlementResult=function(e,t,n){return{hasAccess:e.hasAccess,accessDeniedReason:t.accessDeniedReason?this.mapAccessDeniedReason(t.accessDeniedReason):void 0,hasUnlimitedUsage:e.isUnlimited,usageLimit:e.usageLimit,requestedUsage:n}},e.prototype.mapCoupon=function(e){return{id:e.refId,name:e.name,description:e.description,metadata:e.additionalMetaData,discountValue:e.discountValue}},e}(),bn="Invariant Violation",En=Object.setPrototypeOf,_n=void 0===En?function(e,t){return e.__proto__=t,e}:En,wn=function(e){function t(n){void 0===n&&(n=bn);var r=e.call(this,"number"==typeof n?bn+": "+n+" (see https://github.com/apollographql/invariant-packages)":n)||this;return r.framesToPop=1,r.name=bn,_n(r,t.prototype),r}return be(t,e),t}(Error);function In(e,t){if(!e)throw new wn(t)}var Tn=["debug","log","warn","error","silent"],On=Tn.indexOf("log");function Sn(e){return function(){if(Tn.indexOf(e)>=On){var t=console[e]||console.log;return t.apply(console,arguments)}}}function Dn(e){try{return e()}catch(e){}}!function(e){e.debug=Sn("debug"),e.log=Sn("log"),e.warn=Sn("warn"),e.error=Sn("error")}(In||(In={}));const xn=Dn((function(){return globalThis}))||Dn((function(){return window}))||Dn((function(){return self}))||Dn((function(){return n.g}))||Dn((function(){return Function("return this")()}));var An="__",kn=[An,An].join("DEV");const Nn=function(){try{return Boolean(__DEV__)}catch(e){return Object.defineProperty(xn,kn,{value:"production"!==Dn((function(){return"production"})),enumerable:!1,configurable:!0,writable:!0}),xn[kn]}}();function Pn(e){try{return e()}catch(e){}}var Cn=Pn((function(){return globalThis}))||Pn((function(){return window}))||Pn((function(){return self}))||Pn((function(){return n.g}))||Pn((function(){return Function("return this")()})),Rn=!1;function Fn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Mn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function jn(e,t,n){return t&&Mn(e.prototype,t),n&&Mn(e,n),e}!Cn||Pn((function(){return"production"}))||Pn((function(){return process}))||(Object.defineProperty(Cn,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),Rn=!0),Rn&&(delete Cn.process,Rn=!1),__DEV__?In("boolean"==typeof Nn,Nn):In("boolean"==typeof Nn,38);var Un=function(){return"function"==typeof Symbol},Ln=function(e){return Un()&&Boolean(Symbol[e])},qn=function(e){return Ln(e)?Symbol[e]:"@@"+e};Un()&&!Ln("observable")&&(Symbol.observable=Symbol("observable"));var Vn=qn("iterator"),Bn=qn("observable"),Qn=qn("species");function zn(e,t){var n=e[t];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function Gn(e){var t=e.constructor;return void 0!==t&&null===(t=t[Qn])&&(t=void 0),void 0!==t?t:tr}function $n(e){return e instanceof tr}function Wn(e){Wn.log?Wn.log(e):setTimeout((function(){throw e}))}function Kn(e){Promise.resolve().then((function(){try{e()}catch(e){Wn(e)}}))}function Hn(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var n=zn(t,"unsubscribe");n&&n.call(t)}}catch(e){Wn(e)}}function Yn(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function Jn(e,t,n){e._state="running";var r=e._observer;try{var i=zn(r,t);switch(t){case"next":i&&i.call(r,n);break;case"error":if(Yn(e),!i)throw n;i.call(r,n);break;case"complete":Yn(e),i&&i.call(r)}}catch(e){Wn(e)}"closed"===e._state?Hn(e):"running"===e._state&&(e._state="ready")}function Xn(e,t,n){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:n}],void Kn((function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var n=0;n<t.length&&(Jn(e,t[n].type,t[n].value),"closed"!==e._state);++n);}}(e)}))):void Jn(e,t,n);e._queue.push({type:t,value:n})}}var Zn=function(){function e(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";var n=new er(this);try{this._cleanup=t.call(void 0,n)}catch(e){n.error(e)}"initializing"===this._state&&(this._state="ready")}return e.prototype.unsubscribe=function(){"closed"!==this._state&&(Yn(this),Hn(this))},jn(e,[{key:"closed",get:function(){return"closed"===this._state}}]),e}(),er=function(){function e(e){this._subscription=e}var t=e.prototype;return t.next=function(e){Xn(this._subscription,"next",e)},t.error=function(e){Xn(this._subscription,"error",e)},t.complete=function(){Xn(this._subscription,"complete")},jn(e,[{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),tr=function(){function e(t){if(!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}var t=e.prototype;return t.subscribe=function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new Zn(e,this._subscriber)},t.forEach=function(e){var t=this;return new Promise((function(n,r){if("function"==typeof e)var i=t.subscribe({next:function(t){try{e(t,o)}catch(e){r(e),i.unsubscribe()}},error:r,complete:n});else r(new TypeError(e+" is not a function"));function o(){i.unsubscribe(),n()}}))},t.map=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(Gn(this))((function(n){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))},t.filter=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(Gn(this))((function(n){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))},t.reduce=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=Gn(this),r=arguments.length>1,i=!1,o=arguments[1],a=o;return new n((function(n){return t.subscribe({next:function(t){var o=!i;if(i=!0,!o||r)try{a=e(a,t)}catch(e){return n.error(e)}else a=t},error:function(e){n.error(e)},complete:function(){if(!i&&!r)return n.error(new TypeError("Cannot reduce an empty sequence"));n.next(a),n.complete()}})}))},t.concat=function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=Gn(this);return new i((function(t){var r,o=0;return function e(a){r=a.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){o===n.length?(r=void 0,t.complete()):e(i.from(n[o++]))}})}(e),function(){r&&(r.unsubscribe(),r=void 0)}}))},t.flatMap=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=Gn(this);return new n((function(r){var i=[],o=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return r.error(e)}var o=n.from(t).subscribe({next:function(e){r.next(e)},error:function(e){r.error(e)},complete:function(){var e=i.indexOf(o);e>=0&&i.splice(e,1),a()}});i.push(o)},error:function(e){r.error(e)},complete:function(){a()}});function a(){o.closed&&0===i.length&&r.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),o.unsubscribe()}}))},t[Bn]=function(){return this},e.from=function(t){var n="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var r=zn(t,Bn);if(r){var i=r.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return $n(i)&&i.constructor===n?i:new n((function(e){return i.subscribe(e)}))}if(Ln("iterator")&&(r=zn(t,Vn)))return new n((function(e){Kn((function(){if(!e.closed){for(var n,i=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Fn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fn(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(r.call(t));!(n=i()).done;){var o=n.value;if(e.next(o),e.closed)return}e.complete()}}))}));if(Array.isArray(t))return new n((function(e){Kn((function(){if(!e.closed){for(var n=0;n<t.length;++n)if(e.next(t[n]),e.closed)return;e.complete()}}))}));throw new TypeError(t+" is not observable")},e.of=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i="function"==typeof this?this:e;return new i((function(e){Kn((function(){if(!e.closed){for(var t=0;t<n.length;++t)if(e.next(n[t]),e.closed)return;e.complete()}}))}))},jn(e,null,[{key:Qn,get:function(){return this}}]),e}();function nr(e){return null!==e&&"object"==typeof e}function rr(e,t){var n=t,r=[];return e.definitions.forEach((function(e){if("OperationDefinition"===e.kind)throw __DEV__?new wn("Found a "+e.operation+" operation"+(e.name?" named '"+e.name.value+"'":"")+". No operations are allowed when using a fragment as a query. Only fragments are allowed."):new wn(43);"FragmentDefinition"===e.kind&&r.push(e)})),void 0===n&&(__DEV__?In(1===r.length,"Found "+r.length+" fragments. `fragmentName` must be provided when there is not exactly 1 fragment."):In(1===r.length,44),n=r[0].name.value),Ee(Ee({},e),{definitions:Te([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:n}}]}}],e.definitions,!0)})}function ir(e){void 0===e&&(e=[]);var t={};return e.forEach((function(e){t[e.name.value]=e})),t}function or(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":var n=t&&t[e.name.value];return __DEV__?In(n,"No fragment named "+e.name.value+"."):In(n,45),n;default:return null}}function ar(e){return{__ref:String(e)}}function sr(e){return Boolean(e&&"object"==typeof e&&"string"==typeof e.__ref)}function ur(e,t,n,r){if(function(e){return"IntValue"===e.kind}(n)||function(e){return"FloatValue"===e.kind}(n))e[t.value]=Number(n.value);else if(function(e){return"BooleanValue"===e.kind}(n)||function(e){return"StringValue"===e.kind}(n))e[t.value]=n.value;else if(function(e){return"ObjectValue"===e.kind}(n)){var i={};n.fields.map((function(e){return ur(i,e.name,e.value,r)})),e[t.value]=i}else if(function(e){return"Variable"===e.kind}(n)){var o=(r||{})[n.name.value];e[t.value]=o}else if(function(e){return"ListValue"===e.kind}(n))e[t.value]=n.values.map((function(e){var n={};return ur(n,t,e,r),n[t.value]}));else if(function(e){return"EnumValue"===e.kind}(n))e[t.value]=n.value;else{if(!function(e){return"NullValue"===e.kind}(n))throw __DEV__?new wn('The inline argument "'+t.value+'" of kind "'+n.kind+'"is not supported. Use variables instead of inline arguments to overcome this limitation.'):new wn(54);e[t.value]=null}}Un()&&Object.defineProperty(tr,Symbol("extensions"),{value:{symbol:Bn,hostReportError:Wn},configurable:!0});var cr=["connection","include","skip","client","rest","export"],lr=Object.assign((function(e,t,n){if(t&&n&&n.connection&&n.connection.key){if(n.connection.filter&&n.connection.filter.length>0){var r=n.connection.filter?n.connection.filter:[];r.sort();var i={};return r.forEach((function(e){i[e]=t[e]})),n.connection.key+"("+fr(i)+")"}return n.connection.key}var o=e;if(t){var a=fr(t);o+="("+a+")"}return n&&Object.keys(n).forEach((function(e){-1===cr.indexOf(e)&&(n[e]&&Object.keys(n[e]).length?o+="@"+e+"("+fr(n[e])+")":o+="@"+e)})),o}),{setStringify:function(e){var t=fr;return fr=e,t}}),fr=function(e){return JSON.stringify(e,pr)};function pr(e,t){return nr(t)&&!Array.isArray(t)&&(t=Object.keys(t).sort().reduce((function(e,n){return e[n]=t[n],e}),{})),t}function dr(e,t){if(e.arguments&&e.arguments.length){var n={};return e.arguments.forEach((function(e){var r=e.name,i=e.value;return ur(n,r,i,t)})),n}return null}function hr(e){return e.alias?e.alias.value:e.name.value}function yr(e,t,n){if("string"==typeof e.__typename)return e.__typename;for(var r=0,i=t.selections;r<i.length;r++){var o=i[r];if(vr(o)){if("__typename"===o.name.value)return e[hr(o)]}else{var a=yr(e,or(o,n).selectionSet,n);if("string"==typeof a)return a}}}function vr(e){return"Field"===e.kind}function mr(e){return"InlineFragment"===e.kind}function gr(e){__DEV__?In(e&&"Document"===e.kind,'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):In(e&&"Document"===e.kind,46);var t=e.definitions.filter((function(e){return"FragmentDefinition"!==e.kind})).map((function(e){if("OperationDefinition"!==e.kind)throw __DEV__?new wn('Schema type definitions not allowed in queries. Found: "'+e.kind+'"'):new wn(47);return e}));return __DEV__?In(t.length<=1,"Ambiguous GraphQL document: contains "+t.length+" operations"):In(t.length<=1,48),e}function br(e){return gr(e),e.definitions.filter((function(e){return"OperationDefinition"===e.kind}))[0]}function Er(e){return e.definitions.filter((function(e){return"OperationDefinition"===e.kind&&e.name})).map((function(e){return e.name.value}))[0]||null}function _r(e){return e.definitions.filter((function(e){return"FragmentDefinition"===e.kind}))}function wr(e){var t=br(e);return __DEV__?In(t&&"query"===t.operation,"Must contain a query definition."):In(t&&"query"===t.operation,49),t}function Ir(e){var t;gr(e);for(var n=0,r=e.definitions;n<r.length;n++){var i=r[n];if("OperationDefinition"===i.kind){var o=i.operation;if("query"===o||"mutation"===o||"subscription"===o)return i}"FragmentDefinition"!==i.kind||t||(t=i)}if(t)return t;throw __DEV__?new wn("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new wn(53)}function Tr(e){var t=Object.create(null),n=e&&e.variableDefinitions;return n&&n.length&&n.forEach((function(e){e.defaultValue&&ur(t,e.variable.name,e.defaultValue)})),t}function Or(e,t){return t?t(e):tr.of()}function Sr(e){return"function"==typeof e?new Ar(e):e}function Dr(e){return e.request.length<=1}var xr=function(e){function t(t,n){var r=e.call(this,t)||this;return r.link=n,r}return be(t,e),t}(Error),Ar=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e((function(){return tr.of()}))},e.from=function(t){return 0===t.length?e.empty():t.map(Sr).reduce((function(e,t){return e.concat(t)}))},e.split=function(t,n,r){var i=Sr(n),o=Sr(r||new e(Or));return Dr(i)&&Dr(o)?new e((function(e){return t(e)?i.request(e)||tr.of():o.request(e)||tr.of()})):new e((function(e,n){return t(e)?i.request(e,n)||tr.of():o.request(e,n)||tr.of()}))},e.execute=function(e,t){return e.request(function(e,t){var n=Ee({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){n=Ee(Ee({},n),"function"==typeof e?e(n):e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return Ee({},n)}}),t}(t.context,function(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName="string"!=typeof t.query?Er(t.query)||void 0:""),t}(function(e){for(var t=["query","operationName","variables","extensions","context"],n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];if(t.indexOf(i)<0)throw __DEV__?new wn("illegal argument: "+i):new wn(26)}return e}(t))))||tr.of()},e.concat=function(t,n){var r=Sr(t);if(Dr(r))return __DEV__&&In.warn(new xr("You are calling concat on a terminating link, which will have no effect",r)),r;var i=Sr(n);return Dr(i)?new e((function(e){return r.request(e,(function(e){return i.request(e)||tr.of()}))||tr.of()})):new e((function(e,t){return r.request(e,(function(e){return i.request(e,t)||tr.of()}))||tr.of()}))},e.prototype.split=function(t,n,r){return this.concat(e.split(t,n,r||new e(Or)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(e,t){throw __DEV__?new wn("request is not implemented"):new wn(21)},e.prototype.onError=function(e,t){if(t&&t.error)return t.error(e),!1;throw e},e.prototype.setOnError=function(e){return this.onError=e,this},e}();const kr=Object.freeze({});function Nr(e,t,n=je){const r=new Map;for(const e of Object.values(Ce))r.set(e,Pr(t,e));let i,o,a,s,u=Array.isArray(e),c=[e],l=-1,f=[];const p=[],d=[];let h=e;do{l++;const e=l===c.length,g=e&&0!==f.length;if(e){if(a=0===d.length?void 0:p[p.length-1],o=s,s=d.pop(),g)if(u){o=o.slice();let e=0;for(const[t,n]of f){const r=t-e;null===n?(o.splice(r,1),e++):o[r]=n}}else{o=Object.defineProperties({},Object.getOwnPropertyDescriptors(o));for(const[e,t]of f)o[e]=t}l=i.index,c=i.keys,f=i.edits,u=i.inArray,i=i.prev}else{if(a=s?u?l:c[l]:void 0,o=s?s[a]:h,null==o)continue;s&&p.push(a)}let b;if(!Array.isArray(o)){var y,v;Le(o)||Ge(!1,`Invalid AST Node: ${Qe(o)}.`);const n=e?null===(y=r.get(o.kind))||void 0===y?void 0:y.leave:null===(v=r.get(o.kind))||void 0===v?void 0:v.enter;if(b=null==n?void 0:n.call(t,o,a,s,p,d),b===kr)break;if(!1===b){if(!e){p.pop();continue}}else if(void 0!==b&&(f.push([a,b]),!e)){if(!Le(b)){p.pop();continue}o=b}}var m;void 0===b&&g&&f.push([a,o]),e?p.pop():(i={inArray:u,index:l,keys:c,edits:f,prev:i},u=Array.isArray(o),c=u?o:null!==(m=n[o.kind])&&void 0!==m?m:[],l=-1,f=[],s&&d.push(s),s=o)}while(void 0!==i);return 0!==f.length&&(h=f[f.length-1][1]),h}function Pr(e,t){const n=e[t];return"object"==typeof n?n:"function"==typeof n?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}var Cr=function(e,t){var n;try{n=JSON.stringify(e)}catch(e){var r=__DEV__?new wn("Network request failed. "+t+" is not serializable: "+e.message):new wn(23);throw r.parseError=e,r}return n},Rr=function(e,t){return e.getContext().uri||("function"==typeof t?t(e):t||"/graphql")},Fr=function(e,t,n){var r=new Error(n);throw r.name="ServerError",r.response=e,r.statusCode=e.status,r.result=t,r},Mr=Object.prototype.hasOwnProperty;function jr(e){return function(t){return t.text().then((function(e){try{return JSON.parse(e)}catch(r){var n=r;throw n.name="ServerParseError",n.response=t,n.statusCode=t.status,n.bodyText=e,n}})).then((function(n){return t.status>=300&&Fr(t,n,"Response not successful: Received status code "+t.status),Array.isArray(n)||Mr.call(n,"data")||Mr.call(n,"errors")||Fr(t,n,"Server response was missing for query '"+(Array.isArray(e)?e.map((function(e){return e.operationName})):e.operationName)+"'."),n}))}}var Ur=function(e){if(!e&&"undefined"==typeof fetch)throw __DEV__?new wn("\n\"fetch\" has not been found globally and no fetcher has been configured. To fix this, install a fetch package (like https://www.npmjs.com/package/cross-fetch), instantiate the fetcher, and pass it into your HttpLink constructor. For example:\n\nimport fetch from 'cross-fetch';\nimport { ApolloClient, HttpLink } from '@apollo/client';\nconst client = new ApolloClient({\n link: new HttpLink({ uri: '/graphql', fetch })\n});\n "):new wn(22)};const Lr=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function qr(e){return Vr[e.charCodeAt(0)]}const Vr=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"];function Br(e){return Nr(e,Qr)}const Qr={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>zr(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=$r("(",zr(e.variableDefinitions,", "),")"),n=zr([e.operation,zr([e.name,t]),zr(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+$r(" = ",n)+$r(" ",zr(r," "))},SelectionSet:{leave:({selections:e})=>Gr(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){const o=$r("",e,": ")+t;let a=o+$r("(",zr(n,", "),")");return a.length>80&&(a=o+$r("(\n",Wr(zr(n,"\n")),"\n)")),zr([a,zr(r," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+$r(" ",zr(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>zr(["...",$r("on ",e),zr(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${$r("(",zr(n,", "),")")} on ${t} ${$r("",zr(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?function(e,t=!1){const n=!e.includes("\n"),r=e.startsWith(" ")||e.startsWith("\t"),i=e.endsWith('"'),o=e.endsWith("\\"),a=!n||i||o||t;let s="";return!a||n&&r||(s+="\n"),s+=e,a&&(s+="\n"),'"""'+s.replace(/"""/g,'\\"""')+'"""'}(e):`"${e.replace(Lr,qr)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+zr(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+zr(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+$r("(",zr(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>$r("",e,"\n")+zr(["schema",zr(t," "),Gr(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>$r("",e,"\n")+zr(["scalar",t,zr(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>$r("",e,"\n")+zr(["type",t,$r("implements ",zr(n," & ")),zr(r," "),Gr(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>$r("",e,"\n")+t+(Kr(n)?$r("(\n",Wr(zr(n,"\n")),"\n)"):$r("(",zr(n,", "),")"))+": "+r+$r(" ",zr(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>$r("",e,"\n")+zr([t+": "+n,$r("= ",r),zr(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>$r("",e,"\n")+zr(["interface",t,$r("implements ",zr(n," & ")),zr(r," "),Gr(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>$r("",e,"\n")+zr(["union",t,zr(n," "),$r("= ",zr(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>$r("",e,"\n")+zr(["enum",t,zr(n," "),Gr(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>$r("",e,"\n")+zr([t,zr(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>$r("",e,"\n")+zr(["input",t,zr(n," "),Gr(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>$r("",e,"\n")+"directive @"+t+(Kr(n)?$r("(\n",Wr(zr(n,"\n")),"\n)"):$r("(",zr(n,", "),")"))+(r?" repeatable":"")+" on "+zr(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>zr(["extend schema",zr(e," "),Gr(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>zr(["extend scalar",e,zr(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>zr(["extend type",e,$r("implements ",zr(t," & ")),zr(n," "),Gr(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>zr(["extend interface",e,$r("implements ",zr(t," & ")),zr(n," "),Gr(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>zr(["extend union",e,zr(t," "),$r("= ",zr(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>zr(["extend enum",e,zr(t," "),Gr(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>zr(["extend input",e,zr(t," "),Gr(n)]," ")}};function zr(e,t=""){var n;return null!==(n=null==e?void 0:e.filter((e=>e)).join(t))&&void 0!==n?n:""}function Gr(e){return $r("{\n",Wr(zr(e,"\n")),"\n}")}function $r(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function Wr(e){return $r(" ",e.replace(/\n/g,"\n "))}function Kr(e){var t;return null!==(t=null==e?void 0:e.some((e=>e.includes("\n"))))&&void 0!==t&&t}var Hr={http:{includeQuery:!0,includeExtensions:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},Yr=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=Ee(Ee({},t.options),{headers:t.headers,credentials:t.credentials}),o=t.http||{};n.forEach((function(e){i=Ee(Ee(Ee({},i),e.options),{headers:Ee(Ee({},i.headers),Jr(e.headers))}),e.credentials&&(i.credentials=e.credentials),o=Ee(Ee({},o),e.http)}));var a=e.operationName,s=e.extensions,u=e.variables,c=e.query,l={operationName:a,variables:u};return o.includeExtensions&&(l.extensions=s),o.includeQuery&&(l.query=Br(c)),{options:i,body:l}};function Jr(e){if(e){var t=Object.create(null);return Object.keys(Object(e)).forEach((function(n){t[n.toLowerCase()]=e[n]})),t}return e}var Xr=function(){if("undefined"==typeof AbortController)return{controller:!1,signal:!1};var e=new AbortController;return{controller:e,signal:e.signal}};function Zr(e){return new tr((function(t){t.error(e)}))}var ei=Dn((function(){return fetch})),ti=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,function(e){void 0===e&&(e={});var t=e.uri,n=void 0===t?"/graphql":t,r=e.fetch,i=e.includeExtensions,o=e.useGETForQueries,a=e.includeUnusedVariables,s=void 0!==a&&a,u=_e(e,["uri","fetch","includeExtensions","useGETForQueries","includeUnusedVariables"]);__DEV__&&Ur(r||ei);var c={http:{includeExtensions:i},options:u.fetchOptions,credentials:u.credentials,headers:u.headers};return new Ar((function(e){var t=Rr(e,n),i=e.getContext(),a={};if(i.clientAwareness){var u=i.clientAwareness,l=u.name,f=u.version;l&&(a["apollographql-client-name"]=l),f&&(a["apollographql-client-version"]=f)}var p,d=Ee(Ee({},a),i.headers),h={http:i.http,options:i.fetchOptions,credentials:i.credentials,headers:d},y=Yr(e,Hr,c,h),v=y.options,m=y.body;if(m.variables&&!s){var g=new Set(Object.keys(m.variables));Nr(e.query,{Variable:function(e,t,n){n&&"VariableDefinition"!==n.kind&&g.delete(e.name.value)}}),g.size&&(m.variables=Ee({},m.variables),g.forEach((function(e){delete m.variables[e]})))}if(!v.signal){var b=Xr(),E=b.controller,_=b.signal;(p=E)&&(v.signal=_)}if(o&&!e.query.definitions.some((function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation}))&&(v.method="GET"),"GET"===v.method){var w=function(e,t){var n=[],r=function(e,t){n.push(e+"="+encodeURIComponent(t))};if("query"in t&&r("query",t.query),t.operationName&&r("operationName",t.operationName),t.variables){var i=void 0;try{i=Cr(t.variables,"Variables map")}catch(e){return{parseError:e}}r("variables",i)}if(t.extensions){var o=void 0;try{o=Cr(t.extensions,"Extensions map")}catch(e){return{parseError:e}}r("extensions",o)}var a="",s=e,u=e.indexOf("#");-1!==u&&(a=e.substr(u),s=e.substr(0,u));var c=-1===s.indexOf("?")?"?":"&";return{newURI:s+c+n.join("&")+a}}(t,m),I=w.newURI,T=w.parseError;if(T)return Zr(T);t=I}else try{v.body=Cr(m,"Payload")}catch(T){return Zr(T)}return new tr((function(n){return(r||Dn((function(){return fetch}))||ei)(t,v).then((function(t){return e.setContext({response:t}),t})).then(jr(e)).then((function(e){return n.next(e),n.complete(),e})).catch((function(e){"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&n.next(e.result),n.error(e))})),function(){p&&p.abort()}}))}))}(t).request)||this;return n.options=t,n}return be(t,e),t}(Ar),ni=Ar.execute;function ri(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Object.create(null);return e.forEach((function(e){e&&Object.keys(e).forEach((function(t){var r=e[t];void 0!==r&&(n[t]=r)}))})),n}var ii=Object.prototype,oi=ii.toString,ai=ii.hasOwnProperty,si=Function.prototype.toString,ui=new Map;function ci(e,t){try{return li(e,t)}finally{ui.clear()}}function li(e,t){if(e===t)return!0;var n,r,i,o=oi.call(e);if(o!==oi.call(t))return!1;switch(o){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":if(hi(e,t))return!0;var a=fi(e),s=fi(t),u=a.length;if(u!==s.length)return!1;for(var c=0;c<u;++c)if(!ai.call(t,a[c]))return!1;for(c=0;c<u;++c){var l=a[c];if(!li(e[l],t[l]))return!1}return!0;case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!=e)return t!=t;case"[object Boolean]":case"[object Date]":return+e==+t;case"[object RegExp]":case"[object String]":return e==""+t;case"[object Map]":case"[object Set]":if(e.size!==t.size)return!1;if(hi(e,t))return!0;for(var f=e.entries(),p="[object Map]"===o;;){var d=f.next();if(d.done)break;var h=d.value,y=h[0],v=h[1];if(!t.has(y))return!1;if(p&&!li(v,t.get(y)))return!1}return!0;case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":e=new Uint8Array(e),t=new Uint8Array(t);case"[object DataView]":var m=e.byteLength;if(m===t.byteLength)for(;m--&&e[m]===t[m];);return-1===m;case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":var g=si.call(e);return g===si.call(t)&&(r=di,!((i=(n=g).length-r.length)>=0&&n.indexOf(r,i)===i))}return!1}function fi(e){return Object.keys(e).filter(pi,e)}function pi(e){return void 0!==this[e]}var di="{ [native code] }";function hi(e,t){var n=ui.get(e);if(n){if(n.has(t))return!0}else ui.set(e,n=new Set);return n.add(t),!1}var yi,vi,mi=function(){return Object.create(null)},gi=Array.prototype,bi=gi.forEach,Ei=gi.slice,_i=function(){function e(e,t){void 0===e&&(e=!0),void 0===t&&(t=mi),this.weakness=e,this.makeData=t}return e.prototype.lookup=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.lookupArray(e)},e.prototype.lookupArray=function(e){var t=this;return bi.call(e,(function(e){return t=t.getChildTrie(e)})),t.data||(t.data=this.makeData(Ei.call(e)))},e.prototype.getChildTrie=function(t){var n=this.weakness&&function(e){switch(typeof e){case"object":if(null===e)break;case"function":return!0}return!1}(t)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),r=n.get(t);return r||n.set(t,r=new e(this.weakness,this.makeData)),r},e}(),wi="function"==typeof WeakMap&&!("object"==typeof navigator&&"ReactNative"===navigator.product),Ii="function"==typeof WeakSet,Ti="function"==typeof Symbol&&"function"==typeof Symbol.for,Oi=function(){function e(){this.known=new(Ii?WeakSet:Set),this.pool=new _i(wi),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return e.prototype.isKnown=function(e){return nr(e)&&this.known.has(e)},e.prototype.pass=function(e){if(nr(e)){var t=function(e){return nr(e)?Array.isArray(e)?e.slice(0):Ee({__proto__:Object.getPrototypeOf(e)},e):e}(e);return this.passes.set(t,e),t}return e},e.prototype.admit=function(e){var t=this;if(nr(e)){var n=this.passes.get(e);if(n)return n;switch(Object.getPrototypeOf(e)){case Array.prototype:if(this.known.has(e))return e;var r=e.map(this.admit,this);return(s=this.pool.lookupArray(r)).array||(this.known.add(s.array=r),__DEV__&&Object.freeze(r)),s.array;case null:case Object.prototype:if(this.known.has(e))return e;var i=Object.getPrototypeOf(e),o=[i],a=this.sortedKeys(e);o.push(a.json);var s,u=o.length;if(a.sorted.forEach((function(n){o.push(t.admit(e[n]))})),!(s=this.pool.lookupArray(o)).object){var c=s.object=Object.create(i);this.known.add(c),a.sorted.forEach((function(e,t){c[e]=o[u+t]})),__DEV__&&Object.freeze(c)}return s.object}}return e},e.prototype.sortedKeys=function(e){var t=Object.keys(e),n=this.pool.lookupArray(t);if(!n.keys){t.sort();var r=JSON.stringify(t);(n.keys=this.keysByJSON.get(r))||this.keysByJSON.set(r,n.keys={sorted:t,json:r})}return n.keys},e}(),Si=Object.assign((function(e){if(nr(e)){void 0===yi&&Di();var t=yi.admit(e),n=vi.get(t);return void 0===n&&vi.set(t,n=JSON.stringify(t)),n}return JSON.stringify(e)}),{reset:Di});function Di(){yi=new Oi,vi=new(wi?WeakMap:Map)}function xi(e,t,n){return new tr((function(r){var i=r.next,o=r.error,a=r.complete,s=0,u=!1,c={then:function(e){return new Promise((function(t){return t(e())}))}};function l(e,t){return e?function(t){++s;var n=function(){return e(t)};c=c.then(n,n).then((function(e){--s,i&&i.call(r,e),u&&f.complete()}),(function(e){throw--s,e})).catch((function(e){o&&o.call(r,e)}))}:function(e){return t&&t.call(r,e)}}var f={next:l(t,i),error:l(n,o),complete:function(){u=!0,s||a&&a.call(r)}},p=e.subscribe(f);return function(){return p.unsubscribe()}}))}function Ai(e){return e.errors&&e.errors.length>0||!1}function ki(e,t,n){var r=0;return e.forEach((function(n,i){t.call(this,n,i,e)&&(e[r++]=n)}),n),e.length=r,e}var Ni={kind:"Field",name:{kind:"Name",value:"__typename"}};function Pi(e,t){return e.selectionSet.selections.every((function(e){return"FragmentSpread"===e.kind&&Pi(t[e.name.value],t)}))}function Ci(e){return Pi(br(e)||function(e){__DEV__?In("Document"===e.kind,'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):In("Document"===e.kind,50),__DEV__?In(e.definitions.length<=1,"Fragment must have exactly one definition."):In(e.definitions.length<=1,51);var t=e.definitions[0];return __DEV__?In("FragmentDefinition"===t.kind,"Must be a fragment definition."):In("FragmentDefinition"===t.kind,52),t}(e),ir(_r(e)))?null:e}function Ri(e){return function(t){return e.some((function(e){return e.name&&e.name===t.name.value||e.test&&e.test(t)}))}}function Fi(e,t){var n=Object.create(null),r=[],i=Object.create(null),o=[],a=Ci(Nr(t,{Variable:{enter:function(e,t,r){"VariableDefinition"!==r.kind&&(n[e.name.value]=!0)}},Field:{enter:function(t){if(e&&t.directives&&e.some((function(e){return e.remove}))&&t.directives&&t.directives.some(Ri(e)))return t.arguments&&t.arguments.forEach((function(e){"Variable"===e.value.kind&&r.push({name:e.value.name.value})})),t.selectionSet&&Ui(t.selectionSet).forEach((function(e){o.push({name:e.name.value})})),null}},FragmentSpread:{enter:function(e){i[e.name.value]=!0}},Directive:{enter:function(t){if(Ri(e)(t))return null}}}));return a&&ki(r,(function(e){return!!e.name&&!n[e.name]})).length&&(a=function(e,t){var n=function(e){return function(t){return e.some((function(e){return t.value&&"Variable"===t.value.kind&&t.value.name&&(e.name===t.value.name.value||e.test&&e.test(t))}))}}(e);return Ci(Nr(t,{OperationDefinition:{enter:function(t){return Ee(Ee({},t),{variableDefinitions:t.variableDefinitions?t.variableDefinitions.filter((function(t){return!e.some((function(e){return e.name===t.variable.name.value}))})):[]})}},Field:{enter:function(t){if(e.some((function(e){return e.remove}))){var r=0;if(t.arguments&&t.arguments.forEach((function(e){n(e)&&(r+=1)})),1===r)return null}}},Argument:{enter:function(e){if(n(e))return null}}}))}(r,a)),a&&ki(o,(function(e){return!!e.name&&!i[e.name]})).length&&(a=function(e,t){function n(t){if(e.some((function(e){return e.name===t.name.value})))return null}return Ci(Nr(t,{FragmentSpread:{enter:n},FragmentDefinition:{enter:n}}))}(o,a)),a}var Mi=Object.assign((function(e){return Nr(gr(e),{SelectionSet:{enter:function(e,t,n){if(!n||"OperationDefinition"!==n.kind){var r=e.selections;if(r&&!r.some((function(e){return vr(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))}))){var i=n;if(!(vr(i)&&i.directives&&i.directives.some((function(e){return"export"===e.name.value}))))return Ee(Ee({},e),{selections:Te(Te([],r,!0),[Ni],!1)})}}}}})}),{added:function(e){return e===Ni}}),ji={test:function(e){var t="connection"===e.name.value;return t&&(e.arguments&&e.arguments.some((function(e){return"key"===e.name.value}))||__DEV__&&In.warn("Removing an @connection directive even though it does not have a key. You may want to use the key parameter to specify a store key.")),t}};function Ui(e){var t=[];return e.selections.forEach((function(e){(vr(e)||mr(e))&&e.selectionSet?Ui(e.selectionSet).forEach((function(e){return t.push(e)})):"FragmentSpread"===e.kind&&t.push(e)})),t}function Li(e){return"query"===Ir(e).operation?e:Nr(e,{OperationDefinition:{enter:function(e){return Ee(Ee({},e),{operation:"query"})}}})}function qi(e,t){var n=e.directives;return!n||!n.length||function(e){var t=[];return e&&e.length&&e.forEach((function(e){if(function(e){var t=e.name.value;return"skip"===t||"include"===t}(e)){var n=e.arguments,r=e.name.value;__DEV__?In(n&&1===n.length,"Incorrect number of arguments for the @"+r+" directive."):In(n&&1===n.length,40);var i=n[0];__DEV__?In(i.name&&"if"===i.name.value,"Invalid argument for the @"+r+" directive."):In(i.name&&"if"===i.name.value,41);var o=i.value;__DEV__?In(o&&("Variable"===o.kind||"BooleanValue"===o.kind),"Argument for the @"+r+" directive must be a variable or a boolean value."):In(o&&("Variable"===o.kind||"BooleanValue"===o.kind),42),t.push({directive:e,ifArgument:i})}})),t}(n).every((function(e){var n=e.directive,r=e.ifArgument,i=!1;return"Variable"===r.value.kind?(i=t&&t[r.value.name.value],__DEV__?In(void 0!==i,"Invalid variable referenced in @"+n.name.value+" directive."):In(void 0!==i,39)):i=r.value.value,"skip"===n.name.value?!i:i}))}function Vi(e,t){return function(e){var t=[];return Nr(e,{Directive:function(e){t.push(e.name.value)}}),t}(t).some((function(t){return e.indexOf(t)>-1}))}function Bi(e){return e&&Vi(["client"],e)&&Vi(["export"],e)}var Qi=new Map;function zi(e){var t=Qi.get(e)||1;return Qi.set(e,t+1),e+":"+t+":"+Math.random().toString(36).slice(2)}function Gi(e,t,n){var r=[];e.forEach((function(e){return e[t]&&r.push(e)})),r.forEach((function(e){return e[t](n)}))}function $i(e){function t(t){Object.defineProperty(e,t,{value:tr})}return Ti&&Symbol.species&&t(Symbol.species),t("@@species"),e}function Wi(e){return e&&"function"==typeof e.then}var Ki=function(e){function t(t){var n=e.call(this,(function(e){return n.addObserver(e),function(){return n.removeObserver(e)}}))||this;return n.observers=new Set,n.addCount=0,n.promise=new Promise((function(e,t){n.resolve=e,n.reject=t})),n.handlers={next:function(e){null!==n.sub&&(n.latest=["next",e],Gi(n.observers,"next",e))},error:function(e){var t=n.sub;null!==t&&(t&&setTimeout((function(){return t.unsubscribe()})),n.sub=null,n.latest=["error",e],n.reject(e),Gi(n.observers,"error",e))},complete:function(){if(null!==n.sub){var e=n.sources.shift();e?Wi(e)?e.then((function(e){return n.sub=e.subscribe(n.handlers)})):n.sub=e.subscribe(n.handlers):(n.sub=null,n.latest&&"next"===n.latest[0]?n.resolve(n.latest[1]):n.resolve(),Gi(n.observers,"complete"))}}},n.cancel=function(e){n.reject(e),n.sources=[],n.handlers.complete()},n.promise.catch((function(e){})),"function"==typeof t&&(t=[new tr(t)]),Wi(t)?t.then((function(e){return n.start(e)}),n.handlers.error):n.start(t),n}return be(t,e),t.prototype.start=function(e){void 0===this.sub&&(this.sources=Array.from(e),this.handlers.complete())},t.prototype.deliverLastMessage=function(e){if(this.latest){var t=this.latest[0],n=e[t];n&&n.call(e,this.latest[1]),null===this.sub&&"next"===t&&e.complete&&e.complete()}},t.prototype.addObserver=function(e){this.observers.has(e)||(this.deliverLastMessage(e),this.observers.add(e),++this.addCount)},t.prototype.removeObserver=function(e,t){this.observers.delete(e)&&--this.addCount<1&&!t&&this.handlers.error(new Error("Observable cancelled prematurely"))},t.prototype.cleanup=function(e){var t=this,n=!1,r=function(){n||(n=!0,t.observers.delete(i),e())},i={next:r,error:r,complete:r},o=this.addCount;this.addObserver(i),this.addCount=o},t}(tr);function Hi(e){return Array.isArray(e)&&e.length>0}$i(Ki);var Yi,Ji=function(e){function t(n){var r,i,o=n.graphQLErrors,a=n.clientErrors,s=n.networkError,u=n.errorMessage,c=n.extraInfo,l=e.call(this,u)||this;return l.graphQLErrors=o||[],l.clientErrors=a||[],l.networkError=s||null,l.message=u||(i="",(Hi((r=l).graphQLErrors)||Hi(r.clientErrors))&&(r.graphQLErrors||[]).concat(r.clientErrors||[]).forEach((function(e){var t=e?e.message:"Error message not found.";i+=t+"\n"})),r.networkError&&(i+=r.networkError.message+"\n"),i=i.replace(/\n$/,"")),l.extraInfo=c,l.__proto__=t.prototype,l}return be(t,e),t}(Error);function Xi(e){return!!e&&e<7}!function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(Yi||(Yi={}));var Zi=Object.prototype.toString;function eo(e){return to(e)}function to(e,t){switch(Zi.call(e)){case"[object Array]":if((t=t||new Map).has(e))return t.get(e);var n=e.slice(0);return t.set(e,n),n.forEach((function(e,r){n[r]=to(e,t)})),n;case"[object Object]":if((t=t||new Map).has(e))return t.get(e);var r=Object.create(Object.getPrototypeOf(e));return t.set(e,r),Object.keys(e).forEach((function(n){r[n]=to(e[n],t)})),r;default:return e}}var no=Object.assign,ro=Object.hasOwnProperty,io=!1,oo=function(e){function t(t){var n=t.queryManager,r=t.queryInfo,i=t.options,o=e.call(this,(function(e){try{var t=e._subscription._observer;t&&!t.error&&(t.error=ao)}catch(e){}var n=!o.observers.size;o.observers.add(e);var r=o.last;return r&&r.error?e.error&&e.error(r.error):r&&r.result&&e.next&&e.next(r.result),n&&o.reobserve().catch((function(){})),function(){o.observers.delete(e)&&!o.observers.size&&o.tearDownQuery()}}))||this;o.observers=new Set,o.subscriptions=new Set,o.isTornDown=!1,o.options=i,o.queryId=r.queryId||n.generateQueryId();var a=br(i.query);return o.queryName=a&&a.name&&a.name.value,o.initialFetchPolicy=i.fetchPolicy||"cache-first",o.queryManager=n,o.queryInfo=r,o}return be(t,e),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var e=this;return new Promise((function(t,n){var r={next:function(n){t(n),e.observers.delete(r),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout((function(){i.unsubscribe()}),0)},error:n},i=e.subscribe(r)}))},t.prototype.getCurrentResult=function(e){void 0===e&&(e=!0);var t=this.getLastResult(!0),n=this.queryInfo.networkStatus||t&&t.networkStatus||Yi.ready,r=Ee(Ee({},t),{loading:Xi(n),networkStatus:n}),i=this.options.fetchPolicy,o=void 0===i?"cache-first":i;if((t||"network-only"!==o&&"no-cache"!==o&&"standby"!==o)&&!this.queryManager.transform(this.options.query).hasForcedResolvers){var a=this.queryInfo.getDiff();(a.complete||this.options.returnPartialData)&&(r.data=a.result),ci(r.data,{})&&(r.data=void 0),a.complete?(r.networkStatus!==Yi.loading||"cache-first"!==o&&"cache-only"!==o||(r.networkStatus=Yi.ready,r.loading=!1),delete r.partial):"no-cache"!==o&&(r.partial=!0),!__DEV__||a.complete||this.options.partialRefetch||r.loading||r.data||r.error||so(a.missing)}return e&&this.updateLastResult(r),r},t.prototype.isDifferentFromLastResult=function(e){return!this.last||!ci(this.last.result,e)},t.prototype.getLast=function(e,t){var n=this.last;if(n&&n[e]&&(!t||ci(n.variables,this.variables)))return n[e]},t.prototype.getLastResult=function(e){return this.getLast("result",e)},t.prototype.getLastError=function(e){return this.getLast("error",e)},t.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(e){var t,n={pollInterval:0},r=this.options.fetchPolicy;if("no-cache"===r?n.fetchPolicy="no-cache":"cache-and-network"!==r&&(n.fetchPolicy="network-only"),__DEV__&&e&&ro.call(e,"variables")){var i=wr(this.options.query),o=i.variableDefinitions;o&&o.some((function(e){return"variables"===e.variable.name.value}))||__DEV__&&In.warn("Called refetch("+JSON.stringify(e)+") for query "+((null===(t=i.name)||void 0===t?void 0:t.value)||JSON.stringify(i))+", which does not declare a $variables variable.\nDid you mean to call refetch(variables) instead of refetch({ variables })?")}return e&&!ci(this.options.variables,e)&&(n.variables=this.options.variables=Ee(Ee({},this.options.variables),e)),this.queryInfo.resetLastWrite(),this.reobserve(n,Yi.refetch)},t.prototype.fetchMore=function(e){var t=this,n=Ee(Ee({},e.query?e:Ee(Ee(Ee({},this.options),e),{variables:Ee(Ee({},this.options.variables),e.variables)})),{fetchPolicy:"no-cache"}),r=this.queryManager.generateQueryId();return n.notifyOnNetworkStatusChange&&(this.queryInfo.networkStatus=Yi.fetchMore,this.observe()),this.queryManager.fetchQuery(r,n,Yi.fetchMore).then((function(r){var i=r.data,o=e.updateQuery;return o?(__DEV__&&!io&&(__DEV__&&In.warn("The updateQuery callback for fetchMore is deprecated, and will be removed\nin the next major version of Apollo Client.\n\nPlease convert updateQuery functions to field policies with appropriate\nread and merge functions, or use/adapt a helper function (such as\nconcatPagination, offsetLimitPagination, or relayStylePagination) from\n@apollo/client/utilities.\n\nThe field policy system handles pagination more effectively than a\nhand-written updateQuery function, and you only need to define the policy\nonce, rather than every time you call fetchMore."),io=!0),t.updateQuery((function(e){return o(e,{fetchMoreResult:i,variables:n.variables})}))):t.queryManager.cache.writeQuery({query:n.query,variables:n.variables,data:i}),r})).finally((function(){t.queryManager.stopQuery(r),t.reobserve()}))},t.prototype.subscribeToMore=function(e){var t=this,n=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:function(n){var r=e.updateQuery;r&&t.updateQuery((function(e,t){var i=t.variables;return r(e,{subscriptionData:n,variables:i})}))},error:function(t){e.onError?e.onError(t):__DEV__&&In.error("Unhandled GraphQL subscription error",t)}});return this.subscriptions.add(n),function(){t.subscriptions.delete(n)&&n.unsubscribe()}},t.prototype.setOptions=function(e){return this.reobserve(e)},t.prototype.setVariables=function(e){return ci(this.variables,e)?this.observers.size?this.result():Promise.resolve():(this.options.variables=e,this.observers.size?this.reobserve({fetchPolicy:this.initialFetchPolicy,variables:e},Yi.setVariables):Promise.resolve())},t.prototype.updateQuery=function(e){var t=this.queryManager,n=e(t.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,{variables:this.variables});n&&(t.cache.writeQuery({query:this.options.query,data:n,variables:this.variables}),t.broadcastQueries())},t.prototype.startPolling=function(e){this.options.pollInterval=e,this.updatePolling()},t.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},t.prototype.fetch=function(e,t){return this.queryManager.setObservableQuery(this),this.queryManager.fetchQueryObservable(this.queryId,e,t)},t.prototype.updatePolling=function(){var e=this;if(!this.queryManager.ssrMode){var t=this.pollingInfo,n=this.options.pollInterval;if(n){if(!t||t.interval!==n){__DEV__?In(n,"Attempted to start a polling query without a polling interval."):In(n,12),(t||(this.pollingInfo={})).interval=n;var r=function(){e.pollingInfo&&(Xi(e.queryInfo.networkStatus)?i():e.reobserve({fetchPolicy:"network-only"},Yi.poll).then(i,i))},i=function(){var t=e.pollingInfo;t&&(clearTimeout(t.timeout),t.timeout=setTimeout(r,t.interval))};i()}}else t&&(clearTimeout(t.timeout),delete this.pollingInfo)}},t.prototype.updateLastResult=function(e,t){return void 0===t&&(t=this.variables),this.last=Ee(Ee({},this.last),{result:this.queryManager.assumeImmutableResults?e:eo(e),variables:t}),Hi(e.errors)||delete this.last.error,this.last},t.prototype.reobserve=function(e,t){var n=this;this.isTornDown=!1;var r=t===Yi.refetch||t===Yi.fetchMore||t===Yi.poll,i=this.options.variables,o=r?ri(this.options,e):no(this.options,ri(e));r||(this.updatePolling(),e&&e.variables&&!e.fetchPolicy&&!ci(e.variables,i)&&(o.fetchPolicy=this.initialFetchPolicy,void 0===t&&(t=Yi.setVariables)));var a=o.variables&&Ee({},o.variables),s=this.fetch(o,t),u={next:function(e){n.reportResult(e,a)},error:function(e){n.reportError(e,a)}};return r||(this.concast&&this.observer&&this.concast.removeObserver(this.observer,!0),this.concast=s,this.observer=u),s.addObserver(u),s.promise},t.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},t.prototype.reportResult=function(e,t){(this.getLastError()||this.isDifferentFromLastResult(e))&&(this.updateLastResult(e,t),Gi(this.observers,"next",e))},t.prototype.reportError=function(e,t){var n=Ee(Ee({},this.getLastResult()),{error:e,errors:e.graphQLErrors,networkStatus:Yi.error,loading:!1});this.updateLastResult(n,t),Gi(this.observers,"error",this.last.error=e)},t.prototype.hasObservers=function(){return this.observers.size>0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t}(tr);function ao(e){__DEV__&&In.error("Unhandled error",e.message,e.stack)}function so(e){__DEV__&&Hi(e)&&__DEV__&&In.debug("Missing cache result fields: "+e.map((function(e){return e.path.join(".")})).join(", "),e)}$i(oo);var uo=Object.prototype.hasOwnProperty;function co(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return lo(e)}function lo(e){var t=e[0]||{},n=e.length;if(n>1)for(var r=new po,i=1;i<n;++i)t=r.merge(t,e[i]);return t}var fo=function(e,t,n){return this.merge(e[n],t[n])},po=function(){function e(e){void 0===e&&(e=fo),this.reconciler=e,this.isObject=nr,this.pastCopies=new Set}return e.prototype.merge=function(e,t){for(var n=this,r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return nr(t)&&nr(e)?(Object.keys(t).forEach((function(i){if(uo.call(e,i)){var o=e[i];if(t[i]!==o){var a=n.reconciler.apply(n,Te([e,t,i],r,!1));a!==o&&((e=n.shallowCopyForMerge(e))[i]=a)}}else(e=n.shallowCopyForMerge(e))[i]=t[i]})),e):t},e.prototype.shallowCopyForMerge=function(e){return nr(e)&&!this.pastCopies.has(e)&&(e=Array.isArray(e)?e.slice(0):Ee({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e)),e},e}(),ho=null,yo={},vo=1,mo="@wry/context:Slot",go=Array,bo=go[mo]||function(){var e=function(){function e(){this.id=["slot",vo++,Date.now(),Math.random().toString(36).slice(2)].join(":")}return e.prototype.hasValue=function(){for(var e=ho;e;e=e.parent)if(this.id in e.slots){var t=e.slots[this.id];if(t===yo)break;return e!==ho&&(ho.slots[this.id]=t),!0}return ho&&(ho.slots[this.id]=yo),!1},e.prototype.getValue=function(){if(this.hasValue())return ho.slots[this.id]},e.prototype.withValue=function(e,t,n,r){var i,o=((i={__proto__:null})[this.id]=e,i),a=ho;ho={parent:a,slots:o};try{return t.apply(r,n)}finally{ho=a}},e.bind=function(e){var t=ho;return function(){var n=ho;try{return ho=t,e.apply(this,arguments)}finally{ho=n}}},e.noContext=function(e,t,n){if(!ho)return e.apply(n,t);var r=ho;try{return ho=null,e.apply(n,t)}finally{ho=r}},e}();try{Object.defineProperty(go,mo,{value:go[mo]=e,enumerable:!1,writable:!1,configurable:!1})}finally{return e}}();function Eo(){}bo.bind,bo.noContext;var _o,wo=function(){function e(e,t){void 0===e&&(e=1/0),void 0===t&&(t=Eo),this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}return e.prototype.has=function(e){return this.map.has(e)},e.prototype.get=function(e){var t=this.getNode(e);return t&&t.value},e.prototype.getNode=function(e){var t=this.map.get(e);if(t&&t!==this.newest){var n=t.older,r=t.newer;r&&(r.older=n),n&&(n.newer=r),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=r)}return t},e.prototype.set=function(e,t){var n=this.getNode(e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)},e.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},e.prototype.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)},e}(),Io=new bo,To=Object.prototype.hasOwnProperty,Oo=void 0===(_o=Array.from)?function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t}:_o;function So(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var Do=[];function xo(e,t){if(!e)throw new Error(t||"assertion failure")}function Ao(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}var ko=function(){function e(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++e.count}return e.prototype.peek=function(){if(1===this.value.length&&!Co(this))return No(this),this.value[0]},e.prototype.recompute=function(e){return xo(!this.recomputing,"already recomputing"),No(this),Co(this)?function(e,t){return qo(e),Io.withValue(e,Po,[e,t]),function(e,t){if("function"==typeof e.subscribe)try{So(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(t){return e.setDirty(),!1}return!0}(e,t)&&function(e){e.dirty=!1,Co(e)||Fo(e)}(e),Ao(e.value)}(this,e):Ao(this.value)},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,Ro(this),So(this))},e.prototype.dispose=function(){var e=this;this.setDirty(),qo(this),Mo(this,(function(t,n){t.setDirty(),Vo(t,e)}))},e.prototype.forget=function(){this.dispose()},e.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=Do.pop()||new Set),this.deps.add(e)},e.prototype.forgetDeps=function(){var e=this;this.deps&&(Oo(this.deps).forEach((function(t){return t.delete(e)})),this.deps.clear(),Do.push(this.deps),this.deps=null)},e.count=0,e}();function No(e){var t=Io.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),Co(e)?jo(t,e):Uo(t,e),t}function Po(e,t){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,t)}catch(t){e.value[1]=t}e.recomputing=!1}function Co(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function Ro(e){Mo(e,jo)}function Fo(e){Mo(e,Uo)}function Mo(e,t){var n=e.parents.size;if(n)for(var r=Oo(e.parents),i=0;i<n;++i)t(r[i],e)}function jo(e,t){xo(e.childValues.has(t)),xo(Co(t));var n=!Co(e);if(e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=Do.pop()||new Set;e.dirtyChildren.add(t),n&&Ro(e)}function Uo(e,t){xo(e.childValues.has(t)),xo(!Co(t));var n,r,i,o=e.childValues.get(t);0===o.length?e.childValues.set(t,t.value.slice(0)):(n=o,r=t.value,(i=n.length)>0&&i===r.length&&n[i-1]===r[i-1]||e.setDirty()),Lo(e,t),Co(e)||Fo(e)}function Lo(e,t){var n=e.dirtyChildren;n&&(n.delete(t),0===n.size&&(Do.length<100&&Do.push(n),e.dirtyChildren=null))}function qo(e){e.childValues.size>0&&e.childValues.forEach((function(t,n){Vo(e,n)})),e.forgetDeps(),xo(null===e.dirtyChildren)}function Vo(e,t){t.parents.delete(e),e.childValues.delete(t),Lo(e,t)}var Bo={setDirty:!0,dispose:!0,forget:!0};function Qo(e){var t=new Map,n=e&&e.subscribe;function r(e){var r=Io.getValue();if(r){var i=t.get(e);i||t.set(e,i=new Set),r.dependOn(i),"function"==typeof n&&(So(i),i.unsubscribe=n(e))}}return r.dirty=function(e,n){var r=t.get(e);if(r){var i=n&&To.call(Bo,n)?n:"setDirty";Oo(r).forEach((function(e){return e[i]()})),t.delete(e),So(r)}},r}function zo(){var e=new _i("function"==typeof WeakMap);return function(){return e.lookupArray(arguments)}}zo();var Go=new Set;function $o(e,t){void 0===t&&(t=Object.create(null));var n=new wo(t.max||Math.pow(2,16),(function(e){return e.dispose()})),r=t.keyArgs,i=t.makeCacheKey||zo(),o=function(){var o=i.apply(null,r?r.apply(null,arguments):arguments);if(void 0===o)return e.apply(null,arguments);var a=n.get(o);a||(n.set(o,a=new ko(e)),a.subscribe=t.subscribe,a.forget=function(){return n.delete(o)});var s=a.recompute(Array.prototype.slice.call(arguments));return n.set(o,a),Go.add(n),Io.hasValue()||(Go.forEach((function(e){return e.clean()})),Go.clear()),s};function a(e){var t=n.get(e);t&&t.setDirty()}function s(e){var t=n.get(e);if(t)return t.peek()}function u(e){return n.delete(e)}return Object.defineProperty(o,"size",{get:function(){return n.map.size},configurable:!1,enumerable:!1}),o.dirtyKey=a,o.dirty=function(){a(i.apply(null,arguments))},o.peekKey=s,o.peek=function(){return s(i.apply(null,arguments))},o.forgetKey=u,o.forget=function(){return u(i.apply(null,arguments))},o.makeCacheKey=i,o.getKey=r?function(){return i.apply(null,r.apply(null,arguments))}:i,Object.freeze(o)}var Wo=new bo,Ko=new WeakMap;function Ho(e){var t=Ko.get(e);return t||Ko.set(e,t={vars:new Set,dep:Qo()}),t}function Yo(e){Ho(e).vars.forEach((function(t){return t.forgetCache(e)}))}function Jo(e){var t=new Set,n=new Set,r=function(o){if(arguments.length>0){if(e!==o){e=o,t.forEach((function(e){Ho(e).dep.dirty(r),Xo(e)}));var a=Array.from(n);n.clear(),a.forEach((function(t){return t(e)}))}}else{var s=Wo.getValue();s&&(i(s),Ho(s).dep(r))}return e};r.onNextChange=function(e){return n.add(e),function(){n.delete(e)}};var i=r.attachCache=function(e){return t.add(e),Ho(e).vars.add(r),r};return r.forgetCache=function(e){return t.delete(e)},r}function Xo(e){e.broadcastWatches&&e.broadcastWatches()}var Zo=function(){function e(e){var t=e.cache,n=e.client,r=e.resolvers,i=e.fragmentMatcher;this.cache=t,n&&(this.client=n),r&&this.addResolvers(r),i&&this.setFragmentMatcher(i)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach((function(e){t.resolvers=co(t.resolvers,e)})):this.resolvers=co(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){var t=e.document,n=e.remoteResult,r=e.context,i=e.variables,o=e.onlyRunForcedResolvers,a=void 0!==o&&o;return we(this,void 0,void 0,(function(){return Ie(this,(function(e){return t?[2,this.resolveDocument(t,n.data,r,i,this.fragmentMatcher,a).then((function(e){return Ee(Ee({},n),{data:e.result})}))]:[2,n]}))}))},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return Vi(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return function(e){gr(e);var t=Fi([{test:function(e){return"client"===e.name.value},remove:!0}],e);return t&&(t=Nr(t,{FragmentDefinition:{enter:function(e){if(e.selectionSet&&e.selectionSet.selections.every((function(e){return vr(e)&&"__typename"===e.name.value})))return null}}})),t}(e)},e.prototype.prepareContext=function(e){var t=this.cache;return Ee(Ee({},e),{cache:t,getCacheKey:function(e){return t.identify(e)}})},e.prototype.addExportedVariables=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),we(this,void 0,void 0,(function(){return Ie(this,(function(r){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(n),t).then((function(e){return Ee(Ee({},t),e.exportedVariables)}))]:[2,Ee({},t)]}))}))},e.prototype.shouldForceResolvers=function(e){var t=!1;return Nr(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some((function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value}))))return kr}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:Li(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t,n,r,i,o){return void 0===n&&(n={}),void 0===r&&(r={}),void 0===i&&(i=function(){return!0}),void 0===o&&(o=!1),we(this,void 0,void 0,(function(){var a,s,u,c,l,f,p,d,h;return Ie(this,(function(y){return a=Ir(e),s=_r(e),u=ir(s),c=a.operation,l=c?c.charAt(0).toUpperCase()+c.slice(1):"Query",p=(f=this).cache,d=f.client,h={fragmentMap:u,context:Ee(Ee({},n),{cache:p,client:d}),variables:r,fragmentMatcher:i,defaultOperationType:l,exportedVariables:{},onlyRunForcedResolvers:o},[2,this.resolveSelectionSet(a.selectionSet,t,h).then((function(e){return{result:e,exportedVariables:h.exportedVariables}}))]}))}))},e.prototype.resolveSelectionSet=function(e,t,n){return we(this,void 0,void 0,(function(){var r,i,o,a,s,u=this;return Ie(this,(function(c){return r=n.fragmentMap,i=n.context,o=n.variables,a=[t],s=function(e){return we(u,void 0,void 0,(function(){var s,u;return Ie(this,(function(c){return qi(e,o)?vr(e)?[2,this.resolveField(e,t,n).then((function(t){var n;void 0!==t&&a.push(((n={})[hr(e)]=t,n))}))]:(mr(e)?s=e:(s=r[e.name.value],__DEV__?In(s,"No fragment named "+e.name.value):In(s,11)),s&&s.typeCondition&&(u=s.typeCondition.name.value,n.fragmentMatcher(t,u,i))?[2,this.resolveSelectionSet(s.selectionSet,t,n).then((function(e){a.push(e)}))]:[2]):[2]}))}))},[2,Promise.all(e.selections.map(s)).then((function(){return lo(a)}))]}))}))},e.prototype.resolveField=function(e,t,n){return we(this,void 0,void 0,(function(){var r,i,o,a,s,u,c,l,f,p=this;return Ie(this,(function(d){return r=n.variables,i=e.name.value,o=hr(e),a=i!==o,s=t[o]||t[i],u=Promise.resolve(s),n.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(c=t.__typename||n.defaultOperationType,(l=this.resolvers&&this.resolvers[c])&&(f=l[a?i:o])&&(u=Promise.resolve(Wo.withValue(this.cache,f,[t,dr(e,r),n.context,{field:e,fragmentMap:n.fragmentMap}])))),[2,u.then((function(t){return void 0===t&&(t=s),e.directives&&e.directives.forEach((function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach((function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(n.exportedVariables[e.value.value]=t)}))})),e.selectionSet?null==t?t:Array.isArray(t)?p.resolveSubSelectedArray(e,t,n):e.selectionSet?p.resolveSelectionSet(e.selectionSet,t,n):void 0:t}))]}))}))},e.prototype.resolveSubSelectedArray=function(e,t,n){var r=this;return Promise.all(t.map((function(t){return null===t?null:Array.isArray(t)?r.resolveSubSelectedArray(e,t,n):e.selectionSet?r.resolveSelectionSet(e.selectionSet,t,n):void 0})))},e}(),ea=new(wi?WeakMap:Map);function ta(e,t){var n=e[t];"function"==typeof n&&(e[t]=function(){return ea.set(e,(ea.get(e)+1)%1e15),n.apply(this,arguments)})}function na(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var ra=function(){function e(e,t){void 0===t&&(t=e.generateQueryId()),this.queryId=t,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=e.cache;ea.has(n)||(ea.set(n,0),ta(n,"evict"),ta(n,"modify"),ta(n,"reset"))}return e.prototype.init=function(e){var t=e.networkStatus||Yi.loading;return this.variables&&this.networkStatus!==Yi.loading&&!ci(this.variables,e.variables)&&(t=Yi.setVariables),ci(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},e.prototype.reset=function(){na(this),this.lastDiff=void 0,this.dirty=!1},e.prototype.getDiff=function(e){void 0===e&&(e=this.variables);var t=this.getDiffOptions(e);if(this.lastDiff&&ci(t,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=e);var n=this.observableQuery;if(n&&"no-cache"===n.options.fetchPolicy)return{complete:!1};var r=this.cache.diff(t);return this.updateLastDiff(r,t),r},e.prototype.updateLastDiff=function(e,t){this.lastDiff=e?{diff:e,options:t||this.getDiffOptions()}:void 0},e.prototype.getDiffOptions=function(e){var t;return void 0===e&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:null===(t=this.observableQuery)||void 0===t?void 0:t.options.canonizeResults}},e.prototype.setDiff=function(e){var t=this,n=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),this.dirty||ci(n&&n.result,e&&e.result)||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout((function(){return t.notify()}),0)))},e.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){t.getDiff().fromOptimisticTransaction?e.observe():e.reobserve()})):delete this.oqListener)},e.prototype.notify=function(){var e=this;na(this),this.shouldNotify()&&this.listeners.forEach((function(t){return t(e)})),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(Xi(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if("cache-only"!==e&&"cache-and-network"!==e)return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=e.prototype.cancel,this.subscriptions.forEach((function(e){return e.unsubscribe()}));var t=this.observableQuery;t&&t.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(e){var t=this;void 0===e&&(e=this.variables);var n=this.observableQuery;if(!n||"no-cache"!==n.options.fetchPolicy){var r=Ee(Ee({},this.getDiffOptions(e)),{watcher:this,callback:function(e){return t.setDiff(e)}});this.lastWatch&&ci(r,this.lastWatch)||(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=r))}},e.prototype.resetLastWrite=function(){this.lastWrite=void 0},e.prototype.shouldWrite=function(e,t){var n=this.lastWrite;return!(n&&n.dmCount===ea.get(this.cache)&&ci(t,n.variables)&&ci(e.data,n.result.data))},e.prototype.markResult=function(e,t,n){var r=this;this.graphQLErrors=Hi(e.errors)?e.errors:[],this.reset(),"no-cache"===t.fetchPolicy?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(t.variables)):0!==n&&(ia(e,t.errorPolicy)?this.cache.performTransaction((function(i){if(r.shouldWrite(e,t.variables))i.writeQuery({query:r.document,data:e.data,variables:t.variables,overwrite:1===n}),r.lastWrite={result:e,variables:t.variables,dmCount:ea.get(r.cache)};else if(r.lastDiff&&r.lastDiff.diff.complete)return void(e.data=r.lastDiff.diff.result);var o=r.getDiffOptions(t.variables),a=i.diff(o);r.stopped||r.updateWatch(t.variables),r.updateLastDiff(a,o),a.complete&&(e.data=a.result)})):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=Yi.ready},e.prototype.markError=function(e){return this.networkStatus=Yi.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},e}();function ia(e,t){void 0===t&&(t="none");var n="ignore"===t||"all"===t,r=!Ai(e);return!r&&n&&e.data&&(r=!0),r}var oa=Object.prototype.hasOwnProperty,aa=function(){function e(e){var t=e.cache,n=e.link,r=e.queryDeduplication,i=void 0!==r&&r,o=e.onBroadcast,a=e.ssrMode,s=void 0!==a&&a,u=e.clientAwareness,c=void 0===u?{}:u,l=e.localState,f=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(wi?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=t,this.link=n,this.queryDeduplication=i,this.clientAwareness=c,this.localState=l||new Zo({cache:t}),this.ssrMode=s,this.assumeImmutableResults=!!f,(this.onBroadcast=o)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var e=this;this.queries.forEach((function(t,n){e.stopQueryNoBroadcast(n)})),this.cancelPendingFetches(__DEV__?new wn("QueryManager stopped while query was in flight"):new wn(13))},e.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach((function(t){return t(e)})),this.fetchCancelFns.clear()},e.prototype.mutate=function(e){var t=e.mutation,n=e.variables,r=e.optimisticResponse,i=e.updateQueries,o=e.refetchQueries,a=void 0===o?[]:o,s=e.awaitRefetchQueries,u=void 0!==s&&s,c=e.update,l=e.onQueryUpdated,f=e.errorPolicy,p=void 0===f?"none":f,d=e.fetchPolicy,h=void 0===d?"network-only":d,y=e.keepRootFields,v=e.context;return we(this,void 0,void 0,(function(){var e,o,s;return Ie(this,(function(f){switch(f.label){case 0:return __DEV__?In(t,"mutation option is required. You must specify your GraphQL document in the mutation option."):In(t,14),__DEV__?In("network-only"===h||"no-cache"===h,"Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):In("network-only"===h||"no-cache"===h,15),e=this.generateMutationId(),t=this.transform(t).document,n=this.getVariables(t,n),this.transform(t).hasClientExports?[4,this.localState.addExportedVariables(t,n,v)]:[3,2];case 1:n=f.sent(),f.label=2;case 2:return o=this.mutationStore&&(this.mutationStore[e]={mutation:t,variables:n,loading:!0,error:null}),r&&this.markMutationOptimistic(r,{mutationId:e,document:t,variables:n,fetchPolicy:h,errorPolicy:p,context:v,updateQueries:i,update:c,keepRootFields:y}),this.broadcastQueries(),s=this,[2,new Promise((function(f,d){return xi(s.getObservableFromLink(t,Ee(Ee({},v),{optimisticResponse:r}),n,!1),(function(f){if(Ai(f)&&"none"===p)throw new Ji({graphQLErrors:f.errors});o&&(o.loading=!1,o.error=null);var d=Ee({},f);return"function"==typeof a&&(a=a(d)),"ignore"===p&&Ai(d)&&delete d.errors,s.markMutationResult({mutationId:e,result:d,document:t,variables:n,fetchPolicy:h,errorPolicy:p,context:v,update:c,updateQueries:i,awaitRefetchQueries:u,refetchQueries:a,removeOptimistic:r?e:void 0,onQueryUpdated:l,keepRootFields:y})})).subscribe({next:function(e){s.broadcastQueries(),f(e)},error:function(t){o&&(o.loading=!1,o.error=t),r&&s.cache.removeOptimistic(e),s.broadcastQueries(),d(t instanceof Ji?t:new Ji({networkError:t}))}})}))]}}))}))},e.prototype.markMutationResult=function(e,t){var n=this;void 0===t&&(t=this.cache);var r=e.result,i=[],o="no-cache"===e.fetchPolicy;if(!o&&ia(r,e.errorPolicy)){i.push({result:r.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables});var a=e.updateQueries;a&&this.queries.forEach((function(e,o){var s=e.observableQuery,u=s&&s.queryName;if(u&&oa.call(a,u)){var c=a[u],l=n.queries.get(o),f=l.document,p=l.variables,d=t.diff({query:f,variables:p,returnPartialData:!0,optimistic:!1}),h=d.result;if(d.complete&&h){var y=c(h,{mutationResult:r,queryName:f&&Er(f)||void 0,queryVariables:p});y&&i.push({result:y,dataId:"ROOT_QUERY",query:f,variables:p})}}}))}if(i.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var s=[];if(this.refetchQueries({updateCache:function(t){o||i.forEach((function(e){return t.write(e)}));var a=e.update;if(a){if(!o){var s=t.diff({id:"ROOT_MUTATION",query:n.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});s.complete&&(r=Ee(Ee({},r),{data:s.result}))}a(t,r,{context:e.context,variables:e.variables})}o||e.keepRootFields||t.modify({id:"ROOT_MUTATION",fields:function(e,t){var n=t.fieldName,r=t.DELETE;return"__typename"===n?e:r}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach((function(e){return s.push(e)})),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(s).then((function(){return r}))}return Promise.resolve(r)},e.prototype.markMutationOptimistic=function(e,t){var n=this,r="function"==typeof e?e(t.variables):e;return this.cache.recordOptimisticTransaction((function(e){try{n.markMutationResult(Ee(Ee({},t),{result:{data:r}}),e)}catch(e){__DEV__&&In.error(e)}}),t.mutationId)},e.prototype.fetchQuery=function(e,t,n){return this.fetchQueryObservable(e,t,n).promise},e.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach((function(t,n){e[n]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}})),e},e.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},e.prototype.transform=function(e){var t,n=this.transformCache;if(!n.has(e)){var r=this.cache.transformDocument(e),i=(t=this.cache.transformForLink(r),Fi([ji],gr(t))),o=this.localState.clientQuery(r),a=i&&this.localState.serverQuery(i),s={document:r,hasClientExports:Bi(r),hasForcedResolvers:this.localState.shouldForceResolvers(r),clientQuery:o,serverQuery:a,defaultVars:Tr(br(r)),asQuery:Ee(Ee({},r),{definitions:r.definitions.map((function(e){return"OperationDefinition"===e.kind&&"query"!==e.operation?Ee(Ee({},e),{operation:"query"}):e}))})},u=function(e){e&&!n.has(e)&&n.set(e,s)};u(e),u(r),u(o),u(a)}return n.get(e)},e.prototype.getVariables=function(e,t){return Ee(Ee({},this.transform(e).defaultVars),t)},e.prototype.watchQuery=function(e){void 0===(e=Ee(Ee({},e),{variables:this.getVariables(e.query,e.variables)})).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var t=new ra(this),n=new oo({queryManager:this,queryInfo:t,options:e});return this.queries.set(n.queryId,t),t.init({document:e.query,observableQuery:n,variables:e.variables}),n},e.prototype.query=function(e,t){var n=this;return void 0===t&&(t=this.generateQueryId()),__DEV__?In(e.query,"query option is required. You must specify your GraphQL document in the query option."):In(e.query,16),__DEV__?In("Document"===e.query.kind,'You must wrap the query string in a "gql" tag.'):In("Document"===e.query.kind,17),__DEV__?In(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):In(!e.returnPartialData,18),__DEV__?In(!e.pollInterval,"pollInterval option only supported on watchQuery."):In(!e.pollInterval,19),this.fetchQuery(t,e).finally((function(){return n.stopQuery(t)}))},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},e.prototype.clearStore=function(e){return void 0===e&&(e={discardWatches:!0}),this.cancelPendingFetches(__DEV__?new wn("Store reset while query was in flight (not completed in link chain)"):new wn(20)),this.queries.forEach((function(e){e.observableQuery?e.networkStatus=Yi.loading:e.stop()})),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},e.prototype.getObservableQueries=function(e){var t=this;void 0===e&&(e="active");var n=new Map,r=new Map,i=new Set;return Array.isArray(e)&&e.forEach((function(e){var n;"string"==typeof e?r.set(e,!1):nr(n=e)&&"Document"===n.kind&&Array.isArray(n.definitions)?r.set(t.transform(e).document,!1):nr(e)&&e.query&&i.add(e)})),this.queries.forEach((function(t,i){var o=t.observableQuery,a=t.document;if(o){if("all"===e)return void n.set(i,o);var s=o.queryName;if("standby"===o.options.fetchPolicy||"active"===e&&!o.hasObservers())return;("active"===e||s&&r.has(s)||a&&r.has(a))&&(n.set(i,o),s&&r.set(s,!0),a&&r.set(a,!0))}})),i.size&&i.forEach((function(e){var r=zi("legacyOneTimeQuery"),i=t.getQuery(r).init({document:e.query,variables:e.variables}),o=new oo({queryManager:t,queryInfo:i,options:Ee(Ee({},e),{fetchPolicy:"network-only"})});In(o.queryId===r),i.setObservableQuery(o),n.set(r,o)})),__DEV__&&r.size&&r.forEach((function(e,t){e||__DEV__&&In.warn("Unknown query "+("string"==typeof t?"named ":"")+JSON.stringify(t,null,2)+" requested in refetchQueries options.include array")})),n},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var n=[];return this.getObservableQueries(e?"all":"active").forEach((function(r,i){var o=r.options.fetchPolicy;r.resetLastResults(),(e||"standby"!==o&&"cache-only"!==o)&&n.push(r.refetch()),t.getQuery(i).setDiff(null)})),this.broadcastQueries(),Promise.all(n)},e.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},e.prototype.startGraphQLSubscription=function(e){var t=this,n=e.query,r=e.fetchPolicy,i=e.errorPolicy,o=e.variables,a=e.context,s=void 0===a?{}:a;n=this.transform(n).document,o=this.getVariables(n,o);var u=function(e){return t.getObservableFromLink(n,s,e).map((function(o){if("no-cache"!==r&&(ia(o,i)&&t.cache.write({query:n,result:o.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries()),Ai(o))throw new Ji({graphQLErrors:o.errors});return o}))};if(this.transform(n).hasClientExports){var c=this.localState.addExportedVariables(n,o,s).then(u);return new tr((function(e){var t=null;return c.then((function(n){return t=n.subscribe(e)}),e.error),function(){return t&&t.unsubscribe()}}))}return u(o)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.getQuery(e).stop(),this.queries.delete(e)},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach((function(e){return e.notify()}))},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,n,r){var i,o,a=this;void 0===r&&(r=null!==(i=null==t?void 0:t.queryDeduplication)&&void 0!==i?i:this.queryDeduplication);var s=this.transform(e).serverQuery;if(s){var u=this.inFlightLinkObservables,c=this.link,l={query:s,variables:n,operationName:Er(s)||void 0,context:this.prepareContext(Ee(Ee({},t),{forceFetch:!r}))};if(t=l.context,r){var f=u.get(s)||new Map;u.set(s,f);var p=Si(n);if(!(o=f.get(p))){var d=new Ki([ni(c,l)]);f.set(p,o=d),d.cleanup((function(){f.delete(p)&&f.size<1&&u.delete(s)}))}}else o=new Ki([ni(c,l)])}else o=new Ki([tr.of({data:{}})]),t=this.prepareContext(t);var h=this.transform(e).clientQuery;return h&&(o=xi(o,(function(e){return a.localState.runResolvers({document:h,remoteResult:e,context:t,variables:n})}))),o},e.prototype.getResultsFromLink=function(e,t,n){var r=e.lastRequestId=this.generateRequestId();return xi(this.getObservableFromLink(e.document,n.context,n.variables),(function(i){var o=Hi(i.errors);if(r>=e.lastRequestId){if(o&&"none"===n.errorPolicy)throw e.markError(new Ji({graphQLErrors:i.errors}));e.markResult(i,n,t),e.markReady()}var a={data:i.data,loading:!1,networkStatus:e.networkStatus||Yi.ready};return o&&"ignore"!==n.errorPolicy&&(a.errors=i.errors),a}),(function(t){var n=t.hasOwnProperty("graphQLErrors")?t:new Ji({networkError:t});throw r>=e.lastRequestId&&e.markError(n),n}))},e.prototype.fetchQueryObservable=function(e,t,n){var r=this;void 0===n&&(n=Yi.loading);var i=this.transform(t.query).document,o=this.getVariables(i,t.variables),a=this.getQuery(e),s=t.fetchPolicy,u=void 0===s?"cache-first":s,c=t.errorPolicy,l=void 0===c?"none":c,f=t.returnPartialData,p=void 0!==f&&f,d=t.notifyOnNetworkStatusChange,h=void 0!==d&&d,y=t.context,v=void 0===y?{}:y,m=Object.assign({},t,{query:i,variables:o,fetchPolicy:u,errorPolicy:l,returnPartialData:p,notifyOnNetworkStatusChange:h,context:v}),g=function(e){return m.variables=e,r.fetchQueryByPolicy(a,m,n)};this.fetchCancelFns.set(e,(function(e){setTimeout((function(){return b.cancel(e)}))}));var b=new Ki(this.transform(m.query).hasClientExports?this.localState.addExportedVariables(m.query,m.variables,m.context).then(g):g(m.variables));return b.cleanup((function(){r.fetchCancelFns.delete(e),function(e){var t=e.fetchPolicy,n=void 0===t?"cache-first":t,r=e.nextFetchPolicy;r&&(e.fetchPolicy="function"==typeof r?r.call(e,n):r)}(t)})),b},e.prototype.refetchQueries=function(e){var t=this,n=e.updateCache,r=e.include,i=e.optimistic,o=void 0!==i&&i,a=e.removeOptimistic,s=void 0===a?o?zi("refetchQueries"):void 0:a,u=e.onQueryUpdated,c=new Map;r&&this.getObservableQueries(r).forEach((function(e,n){c.set(n,{oq:e,lastDiff:t.getQuery(n).getDiff()})}));var l=new Map;return n&&this.cache.batch({update:n,optimistic:o&&s||!1,removeOptimistic:s,onWatchUpdated:function(e,t,n){var r=e.watcher instanceof ra&&e.watcher.observableQuery;if(r){if(u){c.delete(r.queryId);var i=u(r,t,n);return!0===i&&(i=r.refetch()),!1!==i&&l.set(r,i),!1}null!==u&&c.set(r.queryId,{oq:r,lastDiff:n,diff:t})}}}),c.size&&c.forEach((function(e,n){var r,i=e.oq,o=e.lastDiff,a=e.diff;if(u){if(!a){var s=i.queryInfo;s.reset(),a=s.getDiff()}r=u(i,a,o)}u&&!0!==r||(r=i.refetch()),!1!==r&&l.set(i,r),n.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(n)})),s&&this.cache.removeOptimistic(s),l},e.prototype.fetchQueryByPolicy=function(e,t,n){var r=this,i=t.query,o=t.variables,a=t.fetchPolicy,s=t.refetchWritePolicy,u=t.errorPolicy,c=t.returnPartialData,l=t.context,f=t.notifyOnNetworkStatusChange,p=e.networkStatus;e.init({document:i,variables:o,networkStatus:n});var d=function(){return e.getDiff(o)},h=function(t,n){void 0===n&&(n=e.networkStatus||Yi.loading);var a=t.result;!__DEV__||c||ci(a,{})||so(t.missing);var s=function(e){return tr.of(Ee({data:e,loading:Xi(n),networkStatus:n},t.complete?null:{partial:!0}))};return a&&r.transform(i).hasForcedResolvers?r.localState.runResolvers({document:i,remoteResult:{data:a},context:l,variables:o,onlyRunForcedResolvers:!0}).then((function(e){return s(e.data||void 0)})):s(a)},y="no-cache"===a?0:n===Yi.refetch&&"merge"!==s?1:2,v=function(){return r.getResultsFromLink(e,y,{variables:o,context:l,fetchPolicy:a,errorPolicy:u})},m=f&&"number"==typeof p&&p!==n&&Xi(n);switch(a){default:case"cache-first":return(g=d()).complete?[h(g,e.markReady())]:c||m?[h(g),v()]:[v()];case"cache-and-network":var g;return(g=d()).complete||c||m?[h(g),v()]:[v()];case"cache-only":return[h(d(),e.markReady())];case"network-only":return m?[h(d()),v()]:[v()];case"no-cache":return m?[h(e.getDiff()),v()]:[v()];case"standby":return[]}},e.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new ra(this,e)),this.queries.get(e)},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return Ee(Ee({},t),{clientAwareness:this.clientAwareness})},e}(),sa=!1;function ua(e,t){return ri(e,t,t.variables&&{variables:Ee(Ee({},e.variables),t.variables)})}var ca=function(){function e(e){var t=this;this.defaultOptions={},this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=e.uri,r=e.credentials,i=e.headers,o=e.cache,a=e.ssrMode,s=void 0!==a&&a,u=e.ssrForceFetchDelay,c=void 0===u?0:u,l=e.connectToDevTools,f=void 0===l?"object"==typeof window&&!window.__APOLLO_CLIENT__&&__DEV__:l,p=e.queryDeduplication,d=void 0===p||p,h=e.defaultOptions,y=e.assumeImmutableResults,v=void 0!==y&&y,m=e.resolvers,g=e.typeDefs,b=e.fragmentMatcher,E=e.name,_=e.version,w=e.link;if(w||(w=n?new ti({uri:n,credentials:r,headers:i}):Ar.empty()),!o)throw __DEV__?new wn("To initialize Apollo Client, you must specify a 'cache' property in the options object. \nFor more information, please visit: https://go.apollo.dev/c/docs"):new wn(9);if(this.link=w,this.cache=o,this.disableNetworkFetches=s||c>0,this.queryDeduplication=d,this.defaultOptions=h||{},this.typeDefs=g,c&&setTimeout((function(){return t.disableNetworkFetches=!1}),c),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),f&&"object"==typeof window&&(window.__APOLLO_CLIENT__=this),!sa&&__DEV__&&(sa=!0,"undefined"!=typeof window&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var I=window.navigator,T=I&&I.userAgent,O=void 0;"string"==typeof T&&(T.indexOf("Chrome/")>-1?O="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":T.indexOf("Firefox/")>-1&&(O="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),O&&__DEV__&&In.log("Download the Apollo DevTools for a better development experience: "+O)}this.version="3.4.17",this.localState=new Zo({cache:o,client:this,resolvers:m,fragmentMatcher:b}),this.queryManager=new aa({cache:this.cache,link:this.link,queryDeduplication:d,ssrMode:s,clientAwareness:{name:E,version:_},localState:this.localState,assumeImmutableResults:v,onBroadcast:f?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=ua(this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=Ee(Ee({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=ua(this.defaultOptions.query,e)),__DEV__?In("cache-and-network"!==e.fetchPolicy,"The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):In("cache-and-network"!==e.fetchPolicy,10),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=Ee(Ee({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=ua(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){this.cache.writeQuery(e),this.queryManager.broadcastQueries()},e.prototype.writeFragment=function(e){this.cache.writeFragment(e),this.queryManager.broadcastQueries()},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return ni(this.link,e)},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!1})})).then((function(){return Promise.all(e.resetStoreCallbacks.map((function(e){return e()})))})).then((function(){return e.reFetchObservableQueries()}))},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!0})})).then((function(){return Promise.all(e.clearStoreCallbacks.map((function(e){return e()})))}))},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),n=[],r=[];t.forEach((function(e,t){n.push(t),r.push(e)}));var i=Promise.all(r);return i.queries=n,i.results=r,i.catch((function(e){__DEV__&&In.debug("In client.refetchQueries, Promise.all promise rejected with error "+e)})),i},e.prototype.getObservableQueries=function(e){return void 0===e&&(e="active"),this.queryManager.getObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e.prototype.setLink=function(e){this.link=this.queryManager.link=e},e}(),la=function(){function e(){this.getFragmentDoc=$o(rr)}return e.prototype.batch=function(e){var t="string"==typeof e.optimistic?e.optimistic:!1===e.optimistic?null:void 0;this.performTransaction(e.update,t)},e.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},e.prototype.transformDocument=function(e){return e},e.prototype.identify=function(e){},e.prototype.gc=function(){return[]},e.prototype.modify=function(e){return!1},e.prototype.transformForLink=function(e){return e},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read(Ee(Ee({},e),{rootId:e.id||"ROOT_QUERY",optimistic:t}))},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read(Ee(Ee({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:t}))},e.prototype.writeQuery=function(e){var t=e.id,n=e.data,r=_e(e,["id","data"]);return this.write(Object.assign(r,{dataId:t||"ROOT_QUERY",result:n}))},e.prototype.writeFragment=function(e){var t=e.id,n=e.data,r=e.fragment,i=e.fragmentName,o=_e(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(r,i),dataId:t,result:n}))},e}(),fa=function(e){function t(n,r,i,o){var a=e.call(this,n)||this;return a.message=n,a.path=r,a.query=i,a.variables=o,a.__proto__=t.prototype,a}return be(t,e),t}(Error);function pa(e){return __DEV__&&(t=e,(n=new Set([t])).forEach((function(e){nr(e)&&function(e){if(__DEV__&&!Object.isFrozen(e))try{Object.freeze(e)}catch(e){if(e instanceof TypeError)return null;throw e}return e}(e)===e&&Object.getOwnPropertyNames(e).forEach((function(t){nr(e[t])&&n.add(e[t])}))}))),e;var t,n}var da=Object.prototype.hasOwnProperty;function ha(e,t){var n=e.__typename,r=e.id,i=e._id;if("string"==typeof n&&(t&&(t.keyObject=void 0!==r?{id:r}:void 0!==i?{_id:i}:void 0),void 0===r&&(r=i),void 0!==r))return n+":"+("number"==typeof r||"string"==typeof r?r:JSON.stringify(r))}var ya={dataIdFromObject:ha,addTypename:!0,resultCaching:!0,canonizeResults:!1};function va(e){var t=e.canonizeResults;return void 0===t?ya.canonizeResults:t}var ma=/^[_a-z][_0-9a-z]*/i;function ga(e){var t=e.match(ma);return t?t[0]:e}function ba(e,t,n){return!!nr(t)&&(Array.isArray(t)?t.every((function(t){return ba(e,t,n)})):e.selections.every((function(e){if(vr(e)&&qi(e,n)){var r=hr(e);return da.call(t,r)&&(!e.selectionSet||ba(e.selectionSet,t[r],n))}return!0})))}function Ea(e){return nr(e)&&!sr(e)&&!Array.isArray(e)}var _a=Object.create(null),wa=function(){return _a},Ia=Object.create(null),Ta=function(){function e(e,t){var n=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(e,t){return pa(sr(e)?n.get(e.__ref,t):e&&e[t])},this.canRead=function(e){return sr(e)?n.has(e.__ref):"object"==typeof e},this.toReference=function(e,t){if("string"==typeof e)return ar(e);if(sr(e))return e;var r=n.policies.identify(e)[0];if(r){var i=ar(r);return t&&n.merge(r,e),i}}}return e.prototype.toObject=function(){return Ee({},this.data)},e.prototype.has=function(e){return void 0!==this.lookup(e,!0)},e.prototype.get=function(e,t){if(this.group.depend(e,t),da.call(this.data,e)){var n=this.data[e];if(n&&da.call(n,t))return n[t]}return"__typename"===t&&da.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof xa?this.parent.get(e,t):void 0},e.prototype.lookup=function(e,t){return t&&this.group.depend(e,"__exists"),da.call(this.data,e)?this.data[e]:this instanceof xa?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?Object.create(null):void 0},e.prototype.merge=function(e,t){var n,r=this;sr(e)&&(e=e.__ref),sr(t)&&(t=t.__ref);var i="string"==typeof e?this.lookup(n=e):e,o="string"==typeof t?this.lookup(n=t):t;if(o){__DEV__?In("string"==typeof n,"store.merge expects a string ID"):In("string"==typeof n,1);var a=new po(ka).merge(i,o);if(this.data[n]=a,a!==i&&(delete this.refs[n],this.group.caching)){var s=Object.create(null);i||(s.__exists=1),Object.keys(o).forEach((function(e){if(!i||i[e]!==a[e]){s[e]=1;var t=ga(e);t===e||r.policies.hasKeyArgs(a.__typename,t)||(s[t]=1),void 0!==a[e]||r instanceof xa||delete a[e]}})),!s.__typename||i&&i.__typename||this.policies.rootTypenamesById[n]!==a.__typename||delete s.__typename,Object.keys(s).forEach((function(e){return r.group.dirty(n,e)}))}}},e.prototype.modify=function(e,t){var n=this,r=this.lookup(e);if(r){var i=Object.create(null),o=!1,a=!0,s={DELETE:_a,INVALIDATE:Ia,isReference:sr,toReference:this.toReference,canRead:this.canRead,readField:function(t,r){return n.policies.readField("string"==typeof t?{fieldName:t,from:r||ar(e)}:t,{store:n})}};if(Object.keys(r).forEach((function(u){var c=ga(u),l=r[u];if(void 0!==l){var f="function"==typeof t?t:t[u]||t[c];if(f){var p=f===wa?_a:f(pa(l),Ee(Ee({},s),{fieldName:c,storeFieldName:u,storage:n.getStorage(e,u)}));p===Ia?n.group.dirty(e,u):(p===_a&&(p=void 0),p!==l&&(i[u]=p,o=!0,l=p))}void 0!==l&&(a=!1)}})),o)return this.merge(e,i),a&&(this instanceof xa?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},e.prototype.delete=function(e,t,n){var r,i=this.lookup(e);if(i){var o=this.getFieldValue(i,"__typename"),a=t&&n?this.policies.getStoreFieldName({typename:o,fieldName:t,args:n}):t;return this.modify(e,a?((r={})[a]=wa,r):wa)}return!1},e.prototype.evict=function(e,t){var n=!1;return e.id&&(da.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof xa&&this!==t&&(n=this.parent.evict(e,t)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var e=this,t=this.toObject(),n=[];return this.getRootIdSet().forEach((function(t){da.call(e.policies.rootTypenamesById,t)||n.push(t)})),n.length&&(t.__META={extraRootIds:n.sort()}),t},e.prototype.replace=function(e){var t=this;if(Object.keys(this.data).forEach((function(n){e&&da.call(e,n)||t.delete(n)})),e){var n=e.__META,r=_e(e,["__META"]);Object.keys(r).forEach((function(e){t.merge(e,r[e])})),n&&n.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},e.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},e.prototype.getRootIdSet=function(e){return void 0===e&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof xa?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},e.prototype.gc=function(){var e=this,t=this.getRootIdSet(),n=this.toObject();t.forEach((function(r){da.call(n,r)&&(Object.keys(e.findChildRefIds(r)).forEach(t.add,t),delete n[r])}));var r=Object.keys(n);if(r.length){for(var i=this;i instanceof xa;)i=i.parent;r.forEach((function(e){return i.delete(e)}))}return r},e.prototype.findChildRefIds=function(e){if(!da.call(this.refs,e)){var t=this.refs[e]=Object.create(null),n=this.data[e];if(!n)return t;var r=new Set([n]);r.forEach((function(e){sr(e)&&(t[e.__ref]=!0),nr(e)&&Object.keys(e).forEach((function(t){var n=e[t];nr(n)&&r.add(n)}))}))}return this.refs[e]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),Oa=function(){function e(e,t){void 0===t&&(t=null),this.caching=e,this.parent=t,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?Qo():null,this.keyMaker=new _i(wi)},e.prototype.depend=function(e,t){if(this.d){this.d(Sa(e,t));var n=ga(t);n!==t&&this.d(Sa(e,n)),this.parent&&this.parent.depend(e,t)}},e.prototype.dirty=function(e,t){this.d&&this.d.dirty(Sa(e,t),"__exists"===t?"forget":"setDirty")},e}();function Sa(e,t){return t+"#"+e}function Da(e,t){Na(e)&&e.group.depend(t,"__exists")}!function(e){var t=function(e){function t(t){var n=t.policies,r=t.resultCaching,i=void 0===r||r,o=t.seed,a=e.call(this,n,new Oa(i))||this;return a.stump=new Aa(a),a.storageTrie=new _i(wi),o&&a.replace(o),a}return be(t,e),t.prototype.addLayer=function(e,t){return this.stump.addLayer(e,t)},t.prototype.removeLayer=function(){return this},t.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},t}(e);e.Root=t}(Ta||(Ta={}));var xa=function(e){function t(t,n,r,i){var o=e.call(this,n.policies,i)||this;return o.id=t,o.parent=n,o.replay=r,o.group=i,r(o),o}return be(t,e),t.prototype.addLayer=function(e,n){return new t(e,this,n,this.group)},t.prototype.removeLayer=function(e){var t=this,n=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach((function(e){var r=t.data[e],i=n.lookup(e);i?r?r!==i&&Object.keys(r).forEach((function(n){ci(r[n],i[n])||t.group.dirty(e,n)})):(t.group.dirty(e,"__exists"),Object.keys(i).forEach((function(n){t.group.dirty(e,n)}))):t.delete(e)})),n):n===this.parent?this:n.addLayer(this.id,this.replay)},t.prototype.toObject=function(){return Ee(Ee({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(t){var n=this.parent.findChildRefIds(t);return da.call(this.data,t)?Ee(Ee({},n),e.prototype.findChildRefIds.call(this,t)):n},t.prototype.getStorage=function(){for(var e=this.parent;e.parent;)e=e.parent;return e.getStorage.apply(e,arguments)},t}(Ta),Aa=function(e){function t(t){return e.call(this,"EntityStore.Stump",t,(function(){}),new Oa(t.group.caching,t.group))||this}return be(t,e),t.prototype.removeLayer=function(){return this},t.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},t}(xa);function ka(e,t,n){var r=e[n],i=t[n];return ci(r,i)?r:i}function Na(e){return!!(e instanceof Ta&&e.group.caching)}function Pa(e,t){return new fa(e.message,t.path.slice(),t.query,t.variables)}function Ca(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var Ra=function(){function e(e){var t=this;this.knownResults=new(wi?WeakMap:Map),this.config=ri(e,{addTypename:!1!==e.addTypename,canonizeResults:va(e)}),this.canon=e.canon||new Oi,this.executeSelectionSet=$o((function(e){var n,r=e.context.canonizeResults,i=Ca(e);i[3]=!r;var o=(n=t.executeSelectionSet).peek.apply(n,i);return o?r?Ee(Ee({},o),{result:t.canon.admit(o.result)}):o:(Da(e.context.store,e.enclosingRef.__ref),t.execSelectionSetImpl(e))}),{max:this.config.resultCacheMaxSize,keyArgs:Ca,makeCacheKey:function(e,t,n,r){if(Na(n.store))return n.store.makeCacheKey(e,sr(t)?t.__ref:t,n.varString,r)}}),this.executeSubSelectedArray=$o((function(e){return Da(e.context.store,e.enclosingRef.__ref),t.execSubSelectedArrayImpl(e)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var t=e.field,n=e.array,r=e.context;if(Na(r.store))return r.store.makeCacheKey(t,n,r.varString)}})}return e.prototype.resetCanon=function(){this.canon=new Oi},e.prototype.diffQueryAgainstStore=function(e){var t=e.store,n=e.query,r=e.rootId,i=void 0===r?"ROOT_QUERY":r,o=e.variables,a=e.returnPartialData,s=void 0===a||a,u=e.canonizeResults,c=void 0===u?this.config.canonizeResults:u,l=this.config.cache.policies;o=Ee(Ee({},Tr(wr(n))),o);var f=ar(i),p=this.executeSelectionSet({selectionSet:Ir(n).selectionSet,objectOrReference:f,enclosingRef:f,context:{store:t,query:n,policies:l,variables:o,varString:Si(o),canonizeResults:c,fragmentMap:ir(_r(n)),path:[]}}),d=p.missing&&p.missing.length>0;if(d&&!s)throw p.missing[0];return{result:p.result,missing:p.missing,complete:!d}},e.prototype.isFresh=function(e,t,n,r){if(Na(r.store)&&this.knownResults.get(e)===n){var i=this.executeSelectionSet.peek(n,t,r,this.canon.isKnown(e));if(i&&e===i.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(e){var t=this,n=e.selectionSet,r=e.objectOrReference,i=e.enclosingRef,o=e.context;if(sr(r)&&!o.policies.rootTypenamesById[r.__ref]&&!o.store.has(r.__ref))return{result:this.canon.empty,missing:[Pa(__DEV__?new wn("Dangling reference to missing "+r.__ref+" object"):new wn(5),o)]};var a=o.variables,s=o.policies,u=o.store,c=[],l={result:null},f=u.getFieldValue(r,"__typename");function p(){return l.missing||(l.missing=[])}function d(e){var t;return e.missing&&(t=p()).push.apply(t,e.missing),e.result}this.config.addTypename&&"string"==typeof f&&!s.rootIdsByTypename[f]&&c.push({__typename:f});var h=new Set(n.selections);h.forEach((function(e){var n;if(qi(e,a))if(vr(e)){var u=s.readField({fieldName:e.name.value,field:e,variables:o.variables,from:r},o),l=hr(e);o.path.push(l),void 0===u?Mi.added(e)||p().push(Pa(__DEV__?new wn("Can't find field '"+e.name.value+"' on "+(sr(r)?r.__ref+" object":"object "+JSON.stringify(r,null,2))):new wn(6),o)):Array.isArray(u)?u=d(t.executeSubSelectedArray({field:e,array:u,enclosingRef:i,context:o})):e.selectionSet?null!=u&&(u=d(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:u,enclosingRef:sr(u)?u:i,context:o}))):o.canonizeResults&&(u=t.canon.pass(u)),void 0!==u&&c.push(((n={})[l]=u,n)),In(o.path.pop()===l)}else{var y=or(e,o.fragmentMap);y&&s.fragmentMatches(y,f)&&y.selectionSet.selections.forEach(h.add,h)}}));var y=lo(c);return l.result=o.canonizeResults?this.canon.admit(y):pa(y),this.knownResults.set(l.result,n),l},e.prototype.execSubSelectedArrayImpl=function(e){var t,n=this,r=e.field,i=e.array,o=e.enclosingRef,a=e.context;function s(e,n){return e.missing&&(t=t||[]).push.apply(t,e.missing),In(a.path.pop()===n),e.result}return r.selectionSet&&(i=i.filter(a.store.canRead)),i=i.map((function(e,t){return null===e?null:(a.path.push(t),Array.isArray(e)?s(n.executeSubSelectedArray({field:r,array:e,enclosingRef:o,context:a}),t):r.selectionSet?s(n.executeSelectionSet({selectionSet:r.selectionSet,objectOrReference:e,enclosingRef:sr(e)?e:o,context:a}),t):(__DEV__&&function(e,t,n){if(!t.selectionSet){var r=new Set([n]);r.forEach((function(n){nr(n)&&(__DEV__?In(!sr(n),"Missing selection set for object of type "+function(e,t){return sr(t)?e.get(t.__ref,"__typename"):t&&t.__typename}(e,n)+" returned for query field "+t.name.value):In(!sr(n),7),Object.values(n).forEach(r.add,r))}))}}(a.store,r,e),In(a.path.pop()===t),e))})),{result:a.canonizeResults?this.canon.admit(i):i,missing:t}},e}(),Fa=function(){function e(e,t){this.cache=e,this.reader=t}return e.prototype.writeToStore=function(e,t){var n=this,r=t.query,i=t.result,o=t.dataId,a=t.variables,s=t.overwrite,u=br(r),c=new po;a=Ee(Ee({},Tr(u)),a);var l={store:e,written:Object.create(null),merge:function(e,t){return c.merge(e,t)},variables:a,varString:Si(a),fragmentMap:ir(_r(r)),overwrite:!!s,incomingById:new Map,clientOnly:!1},f=this.processSelectionSet({result:i||Object.create(null),dataId:o,selectionSet:u.selectionSet,mergeTree:{map:new Map},context:l});if(!sr(f))throw __DEV__?new wn("Could not identify object "+JSON.stringify(i)):new wn(8);return l.incomingById.forEach((function(t,r){var i=t.fields,o=t.mergeTree,a=t.selections,s=ar(r);if(o&&o.map.size){var u=n.applyMerges(o,s,i,l);if(sr(u))return;i=u}if(__DEV__&&!l.overwrite){var c=new Set;a.forEach((function(e){vr(e)&&e.selectionSet&&c.add(e.name.value)})),Object.keys(i).forEach((function(e){(function(e){return c.has(ga(e))})(e)&&!function(e){var t=o&&o.map.get(e);return Boolean(t&&t.info&&t.info.merge)}(e)&&function(e,t,n,r){var i=function(e){var t=r.getFieldValue(e,n);return"object"==typeof t&&t},o=i(e);if(o){var a=i(t);if(a&&!sr(o)&&!ci(o,a)&&!Object.keys(o).every((function(e){return void 0!==r.getFieldValue(a,e)}))){var s=r.getFieldValue(e,"__typename")||r.getFieldValue(t,"__typename"),u=ga(n),c=s+"."+u;if(!Va.has(c)){Va.add(c);var l=[];Array.isArray(o)||Array.isArray(a)||[o,a].forEach((function(e){var t=r.getFieldValue(e,"__typename");"string"!=typeof t||l.includes(t)||l.push(t)})),__DEV__&&In.warn("Cache data may be lost when replacing the "+u+" field of a "+s+" object.\n\nTo address this problem (which is not a bug in Apollo Client), "+(l.length?"either ensure all objects of type "+l.join(" and ")+" have an ID or a custom merge function, or ":"")+"define a custom merge function for the "+c+" field, so InMemoryCache can safely merge these objects:\n\n existing: "+JSON.stringify(o).slice(0,1e3)+"\n incoming: "+JSON.stringify(a).slice(0,1e3)+"\n\nFor more information about these options, please refer to the documentation:\n\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n")}}}}(s,i,e,l.store)}))}e.merge(r,i)})),e.retain(f.__ref),f},e.prototype.processSelectionSet=function(e){var t=this,n=e.dataId,r=e.result,i=e.selectionSet,o=e.context,a=e.mergeTree,s=this.cache.policies,u=s.identify(r,i,o.fragmentMap),c=u[0],l=u[1];if("string"==typeof(n=n||c)){var f=o.written[n]||(o.written[n]=[]),p=ar(n);if(f.indexOf(i)>=0)return p;if(f.push(i),this.reader&&this.reader.isFresh(r,p,i,o))return p}var d=Object.create(null);l&&(d=o.merge(d,l));var h=n&&s.rootTypenamesById[n]||yr(r,i,o.fragmentMap)||n&&o.store.get(n,"__typename");"string"==typeof h&&(d.__typename=h);var y=new Set(i.selections);if(y.forEach((function(e){var n;if(qi(e,o.variables))if(vr(e)){var i=hr(e),u=r[i],c=o.clientOnly;if(o.clientOnly=c||!(!e.directives||!e.directives.some((function(e){return"client"===e.name.value}))),void 0!==u){var l=s.getStoreFieldName({typename:h,fieldName:e.name.value,field:e,variables:o.variables}),f=ja(a,l),p=t.processFieldValue(u,e,o,f),v=void 0;if(e.selectionSet&&!(v=o.store.getFieldValue(p,"__typename"))&&sr(p)){var m=o.incomingById.get(p.__ref);v=m&&m.fields.__typename}var g=s.getMergeFunction(h,e.name.value,v);g?f.info={field:e,typename:h,merge:g}:qa(a,l),d=o.merge(d,((n={})[l]=p,n))}else o.clientOnly||Mi.added(e)||__DEV__&&In.error(("Missing field '"+hr(e)+"' while writing result "+JSON.stringify(r,null,2)).substring(0,1e3));o.clientOnly=c}else{var b=or(e,o.fragmentMap);b&&s.fragmentMatches(b,h,r,o.variables)&&b.selectionSet.selections.forEach(y.add,y)}})),"string"==typeof n){var v=o.incomingById.get(n);return v?(v.fields=o.merge(v.fields,d),v.mergeTree=Ua(v.mergeTree,a),v.selections.forEach(y.add,y),v.selections=y):o.incomingById.set(n,{fields:d,mergeTree:La(a)?void 0:a,selections:y}),ar(n)}return d},e.prototype.processFieldValue=function(e,t,n,r){var i=this;return t.selectionSet&&null!==e?Array.isArray(e)?e.map((function(e,o){var a=i.processFieldValue(e,t,n,ja(r,o));return qa(r,o),a})):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:r}):__DEV__?eo(e):e},e.prototype.applyMerges=function(e,t,n,r,i){var o,a=this;if(e.map.size&&!sr(n)){var s,u=Array.isArray(n)||!sr(t)&&!Ea(t)?void 0:t,c=n;u&&!i&&(i=[sr(u)?u.__ref:u]);var l=function(e,t){return Array.isArray(e)?"number"==typeof t?e[t]:void 0:r.store.getFieldValue(e,String(t))};e.map.forEach((function(e,t){var n=l(u,t),o=l(c,t);if(void 0!==o){i&&i.push(t);var f=a.applyMerges(e,n,o,r,i);f!==o&&(s=s||new Map).set(t,f),i&&In(i.pop()===t)}})),s&&(n=Array.isArray(c)?c.slice(0):Ee({},c),s.forEach((function(e,t){n[t]=e})))}return e.info?this.cache.policies.runMergeFunction(t,n,e.info,r,i&&(o=r.store).getStorage.apply(o,i)):n},e}(),Ma=[];function ja(e,t){var n=e.map;return n.has(t)||n.set(t,Ma.pop()||{map:new Map}),n.get(t)}function Ua(e,t){if(e===t||!t||La(t))return e;if(!e||La(e))return t;var n=e.info&&t.info?Ee(Ee({},e.info),t.info):e.info||t.info,r=e.map.size&&t.map.size,i={info:n,map:r?new Map:e.map.size?e.map:t.map};if(r){var o=new Set(t.map.keys());e.map.forEach((function(e,n){i.map.set(n,Ua(e,t.map.get(n))),o.delete(n)})),o.forEach((function(n){i.map.set(n,Ua(t.map.get(n),e.map.get(n)))}))}return i}function La(e){return!e||!(e.info||e.map.size)}function qa(e,t){var n=e.map,r=n.get(t);r&&La(r)&&(Ma.push(r),n.delete(t))}var Va=new Set;function Ba(e){var t=zi("stringifyForDisplay");return JSON.stringify(e,(function(e,n){return void 0===n?t:n})).split(JSON.stringify(t)).join("<undefined>")}function Qa(e){return void 0!==e.args?e.args:e.field?dr(e.field,e.variables):null}lr.setStringify(Si);var za=function(){},Ga=function(e,t){return t.fieldName},$a=function(e,t,n){return(0,n.mergeObjects)(e,t)},Wa=function(e,t){return t},Ka=function(){function e(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=Ee({dataIdFromObject:ha},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return e.prototype.identify=function(e,t,n){var r=t&&n?yr(e,t,n):e.__typename;if(r===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var i,o={typename:r,selectionSet:t,fragmentMap:n},a=r&&this.getTypePolicy(r),s=a&&a.keyFn||this.config.dataIdFromObject;s;){var u=s(e,o);if(!Array.isArray(u)){i=u;break}s=Xa(u)}return i=i?String(i):void 0,o.keyObject?[i,o.keyObject]:[i]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach((function(n){var r=e[n],i=r.queryType,o=r.mutationType,a=r.subscriptionType,s=_e(r,["queryType","mutationType","subscriptionType"]);i&&t.setRootTypename("Query",n),o&&t.setRootTypename("Mutation",n),a&&t.setRootTypename("Subscription",n),da.call(t.toBeAdded,n)?t.toBeAdded[n].push(s):t.toBeAdded[n]=[s]}))},e.prototype.updateTypePolicy=function(e,t){var n=this,r=this.getTypePolicy(e),i=t.keyFields,o=t.fields;function a(e,t){e.merge="function"==typeof t?t:!0===t?$a:!1===t?Wa:e.merge}a(r,t.merge),r.keyFn=!1===i?za:Array.isArray(i)?Xa(i):"function"==typeof i?i:r.keyFn,o&&Object.keys(o).forEach((function(t){var r=n.getFieldPolicy(e,t,!0),i=o[t];if("function"==typeof i)r.read=i;else{var s=i.keyArgs,u=i.read,c=i.merge;r.keyFn=!1===s?Ga:Array.isArray(s)?Ja(s):"function"==typeof s?s:r.keyFn,"function"==typeof u&&(r.read=u),a(r,c)}r.read&&r.merge&&(r.keyFn=r.keyFn||Ga)}))},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var n="ROOT_"+e.toUpperCase(),r=this.rootTypenamesById[n];t!==r&&(__DEV__?In(!r||r===e,"Cannot change root "+e+" __typename more than once"):In(!r||r===e,2),r&&delete this.rootIdsByTypename[r],this.rootIdsByTypename[t]=n,this.rootTypenamesById[n]=t)},e.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach((function(n){t.getSupertypeSet(n,!0),e[n].forEach((function(e){t.getSupertypeSet(e,!0).add(n);var r=e.match(ma);r&&r[0]===e||t.fuzzySubtypes.set(e,new RegExp(e))}))}))},e.prototype.getTypePolicy=function(e){var t=this;if(!da.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var r=this.supertypeMap.get(e);r&&r.size&&r.forEach((function(e){var r=t.getTypePolicy(e),i=r.fields,o=_e(r,["fields"]);Object.assign(n,o),Object.assign(n.fields,i)}))}var i=this.toBeAdded[e];return i&&i.length&&i.splice(0).forEach((function(n){t.updateTypePolicy(e,n)})),this.typePolicies[e]},e.prototype.getFieldPolicy=function(e,t,n){if(e){var r=this.getTypePolicy(e).fields;return r[t]||n&&(r[t]=Object.create(null))}},e.prototype.getSupertypeSet=function(e,t){var n=this.supertypeMap.get(e);return!n&&t&&this.supertypeMap.set(e,n=new Set),n},e.prototype.fragmentMatches=function(e,t,n,r){var i=this;if(!e.typeCondition)return!0;if(!t)return!1;var o=e.typeCondition.name.value;if(t===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var a=this.getSupertypeSet(t,!0),s=[a],u=function(e){var t=i.getSupertypeSet(e,!1);t&&t.size&&s.indexOf(t)<0&&s.push(t)},c=!(!n||!this.fuzzySubtypes.size),l=!1,f=0;f<s.length;++f){var p=s[f];if(p.has(o))return a.has(o)||(l&&__DEV__&&In.warn("Inferring subtype "+t+" of supertype "+o),a.add(o)),!0;p.forEach(u),c&&f===s.length-1&&ba(e.selectionSet,n,r)&&(c=!1,l=!0,this.fuzzySubtypes.forEach((function(e,n){var r=t.match(e);r&&r[0]===t&&u(n)})))}return!1},e.prototype.hasKeyArgs=function(e,t){var n=this.getFieldPolicy(e,t,!1);return!(!n||!n.keyFn)},e.prototype.getStoreFieldName=function(e){var t,n=e.typename,r=e.fieldName,i=this.getFieldPolicy(n,r,!1),o=i&&i.keyFn;if(o&&n)for(var a={typename:n,fieldName:r,field:e.field||null,variables:e.variables},s=Qa(e);o;){var u=o(s,a);if(!Array.isArray(u)){t=u||r;break}o=Ja(u)}return void 0===t&&(t=e.field?function(e,t){var n=null;e.directives&&(n={},e.directives.forEach((function(e){n[e.name.value]={},e.arguments&&e.arguments.forEach((function(r){var i=r.name,o=r.value;return ur(n[e.name.value],i,o,t)}))})));var r=null;return e.arguments&&e.arguments.length&&(r={},e.arguments.forEach((function(e){var n=e.name,i=e.value;return ur(r,n,i,t)}))),lr(e.name.value,r,n)}(e.field,e.variables):lr(r,Qa(e))),!1===t?r:r===ga(t)?t:r+":"+t},e.prototype.readField=function(e,t){var n=e.from;if(n&&(e.field||e.fieldName)){if(void 0===e.typename){var r=t.store.getFieldValue(n,"__typename");r&&(e.typename=r)}var i=this.getStoreFieldName(e),o=ga(i),a=t.store.getFieldValue(n,i),s=this.getFieldPolicy(e.typename,o,!1),u=s&&s.read;if(u){var c=Ha(this,n,e,t,t.store.getStorage(sr(n)?n.__ref:n,i));return Wo.withValue(this.cache,u,[a,c])}return a}},e.prototype.getMergeFunction=function(e,t,n){var r=this.getFieldPolicy(e,t,!1),i=r&&r.merge;return!i&&n&&(i=(r=this.getTypePolicy(n))&&r.merge),i},e.prototype.runMergeFunction=function(e,t,n,r,i){var o=n.field,a=n.typename,s=n.merge;return s===$a?Ya(r.store)(e,t):s===Wa?t:(r.overwrite&&(e=void 0),s(e,t,Ha(this,void 0,{typename:a,fieldName:o.name.value,field:o,variables:r.variables},r,i||Object.create(null))))},e}();function Ha(e,t,n,r,i){var o=e.getStoreFieldName(n),a=ga(o),s=n.variables||r.variables,u=r.store,c=u.toReference,l=u.canRead;return{args:Qa(n),field:n.field||null,fieldName:a,storeFieldName:o,variables:s,isReference:sr,toReference:c,storage:i,cache:e.cache,canRead:l,readField:function(n,i){var o;if("string"==typeof n)o={fieldName:n,from:arguments.length>1?i:t};else{if(!nr(n))return void(__DEV__&&In.warn("Unexpected readField arguments: "+Ba(Array.from(arguments))));o=Ee({},n),da.call(n,"from")||(o.from=t)}return __DEV__&&void 0===o.from&&__DEV__&&In.warn("Undefined 'from' passed to readField with arguments "+Ba(Array.from(arguments))),void 0===o.variables&&(o.variables=s),e.readField(o,r)},mergeObjects:Ya(r.store)}}function Ya(e){return function(t,n){if(Array.isArray(t)||Array.isArray(n))throw __DEV__?new wn("Cannot automatically merge arrays"):new wn(3);if(nr(t)&&nr(n)){var r=e.getFieldValue(t,"__typename"),i=e.getFieldValue(n,"__typename");if(r&&i&&r!==i)return n;if(sr(t)&&Ea(n))return e.merge(t.__ref,n),t;if(Ea(t)&&sr(n))return e.merge(t,n.__ref),n;if(Ea(t)&&Ea(n))return Ee(Ee({},t),n)}return n}}function Ja(e){return function(t,n){return t?n.fieldName+":"+JSON.stringify(es(t,e,!1)):n.fieldName}}function Xa(e){var t=new _i(wi);return function(n,r){var i;if(r.selectionSet&&r.fragmentMap){var o=t.lookupArray([r.selectionSet,r.fragmentMap]);i=o.aliasMap||(o.aliasMap=Za(r.selectionSet,r.fragmentMap))}var a=r.keyObject=es(n,e,!0,i);return r.typename+":"+JSON.stringify(a)}}function Za(e,t){var n=Object.create(null),r=new Set([e]);return r.forEach((function(e){e.selections.forEach((function(e){if(vr(e)){if(e.alias){var i=e.alias.value,o=e.name.value;o!==i&&((n.aliases||(n.aliases=Object.create(null)))[o]=i)}e.selectionSet&&((n.subsets||(n.subsets=Object.create(null)))[e.name.value]=Za(e.selectionSet,t))}else{var a=or(e,t);a&&r.add(a.selectionSet)}}))})),n}function es(e,t,n,r){var i,o,a=Object.create(null);return t.forEach((function(t){if(Array.isArray(t)){if("string"==typeof o&&"string"==typeof i){var s=r&&r.subsets,u=s&&s[o];a[o]=es(e[i],t,n,u)}}else{var c=r&&r.aliases,l=c&&c[t]||t;da.call(e,l)?a[o=t]=e[i=l]:(__DEV__?In(!n,"Missing field '"+l+"' while computing key fields"):In(!n,4),i=o=void 0)}})),a}var ts=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.watches=new Set,n.typenameDocumentCache=new Map,n.makeVar=Jo,n.txCount=0,n.config=function(e){return ri(ya,e)}(t),n.addTypename=!!n.config.addTypename,n.policies=new Ka({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return be(t,e),t.prototype.init=function(){var e=this.data=new Ta.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()},t.prototype.resetResultCache=function(e){var t=this,n=this.storeReader;this.storeWriter=new Fa(this,this.storeReader=new Ra({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:va(this.config),canon:e?void 0:n&&n.canon})),this.maybeBroadcastWatch=$o((function(e,n){return t.broadcastWatch(e,n)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var n=e.optimistic?t.optimisticData:t.data;if(Na(n)){var r=e.optimistic,i=e.rootId,o=e.variables;return n.makeCacheKey(e.query,e.callback,Si({optimistic:r,rootId:i,variables:o}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach((function(e){return e.resetCaching()}))},t.prototype.restore=function(e){return this.init(),e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).extract()},t.prototype.read=function(e){var t=e.returnPartialData,n=void 0!==t&&t;try{return this.storeReader.diffQueryAgainstStore(Ee(Ee({},e),{store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:n})).result||null}catch(e){if(e instanceof fa)return null;throw e}},t.prototype.write=function(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.modify=function(e){if(da.call(e,"id")&&!e.id)return!1;var t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.diff=function(e){return this.storeReader.diffQueryAgainstStore(Ee(Ee({},e),{store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(e){var t,n=this;return this.watches.size||Ho(t=this).vars.forEach((function(e){return e.attachCache(t)})),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){n.watches.delete(e)&&!n.watches.size&&Yo(n),n.maybeBroadcastWatch.forget(e)}},t.prototype.gc=function(e){Si.reset();var t=this.optimisticData.gc();return e&&!this.txCount&&(e.resetResultCache?this.resetResultCache(e.resetResultIdentities):e.resetResultIdentities&&this.storeReader.resetCanon()),t},t.prototype.retain=function(e,t){return(t?this.optimisticData:this.data).retain(e)},t.prototype.release=function(e,t){return(t?this.optimisticData:this.data).release(e)},t.prototype.identify=function(e){return sr(e)?e.__ref:this.policies.identify(e)[0]},t.prototype.evict=function(e){if(!e.id){if(da.call(e,"id"))return!1;e=Ee(Ee({},e),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(e,this.data)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.reset=function(e){var t=this;return this.init(),Si.reset(),e&&e.discardWatches?(this.watches.forEach((function(e){return t.maybeBroadcastWatch.forget(e)})),this.watches.clear(),Yo(this)):this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){var t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())},t.prototype.batch=function(e){var t=this,n=e.update,r=e.optimistic,i=void 0===r||r,o=e.removeOptimistic,a=e.onWatchUpdated,s=function(e){var r=t,i=r.data,o=r.optimisticData;++t.txCount,e&&(t.data=t.optimisticData=e);try{n(t)}finally{--t.txCount,t.data=i,t.optimisticData=o}},u=new Set;a&&!this.txCount&&this.broadcastWatches(Ee(Ee({},e),{onWatchUpdated:function(e){return u.add(e),!1}})),"string"==typeof i?this.optimisticData=this.optimisticData.addLayer(i,s):!1===i?s(this.data):s(),"string"==typeof o&&(this.optimisticData=this.optimisticData.removeLayer(o)),a&&u.size?(this.broadcastWatches(Ee(Ee({},e),{onWatchUpdated:function(e,t){var n=a.call(this,e,t);return!1!==n&&u.delete(e),n}})),u.size&&u.forEach((function(e){return t.maybeBroadcastWatch.dirty(e)}))):this.broadcastWatches(e)},t.prototype.performTransaction=function(e,t){return this.batch({update:e,optimistic:t||null!==t})},t.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(t=Mi(e),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}return e},t.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach((function(n){return t.maybeBroadcastWatch(n,e)}))},t.prototype.broadcastWatch=function(e,t){var n=e.lastDiff,r=this.diff(e);t&&(e.optimistic&&"string"==typeof t.optimistic&&(r.fromOptimisticTransaction=!0),t.onWatchUpdated&&!1===t.onWatchUpdated.call(this,e,r,n))||n&&ci(n.result,r.result)||e.callback(e.lastDiff=r,n)},t}(la);const ns=JSON.parse('{"g":{"Credentials":["HubspotCredentials","StripeCredentials","ZuoraCredentials"],"ResetPeriodConfiguration":["MonthlyResetPeriodConfig","WeeklyResetPeriodConfig"]}}');var rs=n(4098),is=n.n(rs),os=function(){function e(e){var t=e.batchDebounce,n=e.batchInterval,r=e.batchMax,i=e.batchHandler,o=e.batchKey;this.queuedRequests=new Map,this.batchDebounce=t,this.batchInterval=n,this.batchMax=r||0,this.batchHandler=i,this.batchKey=o||function(){return""}}return e.prototype.enqueueRequest=function(e){var t=this,n=Ee({},e),r=!1,i=this.batchKey(e.operation);return n.observable||(n.observable=new tr((function(e){t.queuedRequests.has(i)||t.queuedRequests.set(i,[]),r||(t.queuedRequests.get(i).push(n),r=!0),n.next=n.next||[],e.next&&n.next.push(e.next.bind(e)),n.error=n.error||[],e.error&&n.error.push(e.error.bind(e)),n.complete=n.complete||[],e.complete&&n.complete.push(e.complete.bind(e)),1===t.queuedRequests.get(i).length?t.scheduleQueueConsumption(i):t.batchDebounce&&(clearTimeout(t.scheduledBatchTimer),t.scheduleQueueConsumption(i)),t.queuedRequests.get(i).length===t.batchMax&&t.consumeQueue(i)}))),n.observable},e.prototype.consumeQueue=function(e){var t=e||"",n=this.queuedRequests.get(t);if(n){this.queuedRequests.delete(t);var r=n.map((function(e){return e.operation})),i=n.map((function(e){return e.forward})),o=[],a=[],s=[],u=[];n.forEach((function(e,t){o.push(e.observable),a.push(e.next),s.push(e.error),u.push(e.complete)}));var c=this.batchHandler(r,i)||tr.of(),l=function(e){s.forEach((function(t){t&&t.forEach((function(t){return t(e)}))}))};return c.subscribe({next:function(e){if(Array.isArray(e)||(e=[e]),a.length!==e.length){var t=new Error("server returned results with length "+e.length+", expected length of "+a.length);return t.result=e,l(t)}e.forEach((function(e,t){a[t]&&a[t].forEach((function(t){return t(e)}))}))},error:l,complete:function(){u.forEach((function(e){e&&e.forEach((function(e){return e()}))}))}}),o}},e.prototype.scheduleQueueConsumption=function(e){var t=this,n=e||"";this.scheduledBatchTimer=setTimeout((function(){t.queuedRequests.get(n)&&t.queuedRequests.get(n).length&&t.consumeQueue(n)}),this.batchInterval)},e}(),as=function(e){function t(t){var n=e.call(this)||this,r=t||{},i=r.batchDebounce,o=r.batchInterval,a=void 0===o?10:o,s=r.batchMax,u=void 0===s?0:s,c=r.batchHandler,l=void 0===c?function(){return null}:c,f=r.batchKey,p=void 0===f?function(){return""}:f;return n.batcher=new os({batchDebounce:i,batchInterval:a,batchMax:u,batchHandler:l,batchKey:p}),t.batchHandler.length<=1&&(n.request=function(e){return n.batcher.enqueueRequest({operation:e})}),n}return be(t,e),t.prototype.request=function(e,t){return this.batcher.enqueueRequest({operation:e,forward:t})},t}(Ar),ss=function(e){function t(t){var n=e.call(this)||this,r=t||{},i=r.uri,o=void 0===i?"/graphql":i,a=r.fetch,s=r.includeExtensions,u=r.batchInterval,c=r.batchDebounce,l=r.batchMax,f=r.batchKey,p=_e(r,["uri","fetch","includeExtensions","batchInterval","batchDebounce","batchMax","batchKey"]);Ur(a),a||(a=fetch);var d={http:{includeExtensions:s},options:p.fetchOptions,credentials:p.credentials,headers:p.headers};return n.batchDebounce=c,n.batchInterval=u||10,n.batchMax=l||10,f=f||function(e){var t=e.getContext(),n={http:t.http,options:t.fetchOptions,credentials:t.credentials,headers:t.headers};return Rr(e,o)+JSON.stringify(n)},n.batcher=new as({batchDebounce:n.batchDebounce,batchInterval:n.batchInterval,batchMax:n.batchMax,batchKey:f,batchHandler:function(e){var t=Rr(e[0],o),n=e[0].getContext(),r={};if(n.clientAwareness){var i=n.clientAwareness,s=i.name,u=i.version;s&&(r["apollographql-client-name"]=s),u&&(r["apollographql-client-version"]=u)}var c,l={http:n.http,options:n.fetchOptions,credentials:n.credentials,headers:Ee(Ee({},r),n.headers)},f=e.map((function(e){return Yr(e,Hr,d,l)})),p=f.map((function(e){return e.body})),h=f[0].options;if("GET"===h.method)return Zr(new Error("apollo-link-batch-http does not support GET requests"));try{h.body=Cr(p,"Payload")}catch(e){return Zr(e)}if(!h.signal){var y=Xr(),v=y.controller,m=y.signal;(c=v)&&(h.signal=m)}return new tr((function(n){return a(t,h).then((function(t){return e.forEach((function(e){return e.setContext({response:t})})),t})).then(jr(e)).then((function(e){return n.next(e),n.complete(),e})).catch((function(e){"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&n.next(e.result),n.error(e))})),function(){c&&c.abort()}}))}}),n}return be(t,e),t.prototype.request=function(e){return this.batcher.request(e)},t}(Ar),us=function(){function e(e,t,n,r){var i=this;this.operation=e,this.nextLink=t,this.delayFor=n,this.retryIf=r,this.retryCount=0,this.values=[],this.complete=!1,this.canceled=!1,this.observers=[],this.currentSubscription=null,this.onNext=function(e){i.values.push(e);for(var t=0,n=i.observers;t<n.length;t++){var r=n[t];r&&r.next(e)}},this.onComplete=function(){i.complete=!0;for(var e=0,t=i.observers;e<t.length;e++){var n=t[e];n&&n.complete()}},this.onError=function(e){return we(i,void 0,void 0,(function(){var t,n,r;return Ie(this,(function(i){switch(i.label){case 0:return this.retryCount+=1,[4,this.retryIf(this.retryCount,this.operation,e)];case 1:if(i.sent())return this.scheduleRetry(this.delayFor(this.retryCount,this.operation,e)),[2];for(this.error=e,t=0,n=this.observers;t<n.length;t++)(r=n[t])&&r.error(e);return[2]}}))}))}}return e.prototype.subscribe=function(e){if(this.canceled)throw new Error("Subscribing to a retryable link that was canceled is not supported");this.observers.push(e);for(var t=0,n=this.values;t<n.length;t++){var r=n[t];e.next(r)}this.complete?e.complete():this.error&&e.error(this.error)},e.prototype.unsubscribe=function(e){var t=this.observers.indexOf(e);if(t<0)throw new Error("RetryLink BUG! Attempting to unsubscribe unknown observer!");this.observers[t]=null,this.observers.every((function(e){return null===e}))&&this.cancel()},e.prototype.start=function(){this.currentSubscription||this.try()},e.prototype.cancel=function(){this.currentSubscription&&this.currentSubscription.unsubscribe(),clearTimeout(this.timerId),this.timerId=void 0,this.currentSubscription=null,this.canceled=!0},e.prototype.try=function(){this.currentSubscription=this.nextLink(this.operation).subscribe({next:this.onNext,error:this.onError,complete:this.onComplete})},e.prototype.scheduleRetry=function(e){var t=this;if(this.timerId)throw new Error("RetryLink BUG! Encountered overlapping retries");this.timerId=setTimeout((function(){t.timerId=void 0,t.try()}),e)},e}(),cs=function(e){function t(t){var n=e.call(this)||this,r=t||{},i=r.attempts,o=r.delay;return n.delayFor="function"==typeof o?o:function(e){var t=e||{},n=t.initial,r=void 0===n?300:n,i=t.jitter,o=void 0===i||i,a=t.max,s=void 0===a?1/0:a,u=o?r:r/2;return function(e){var t=Math.min(s,u*Math.pow(2,e));return o&&(t=Math.random()*t),t}}(o),n.retryIf="function"==typeof i?i:function(e){var t=e||{},n=t.retryIf,r=t.max,i=void 0===r?5:r;return function(e,t,r){return!(e>=i)&&(n?n(r,t):!!r)}}(i),n}return be(t,e),t.prototype.request=function(e,t){var n=new us(e,t,this.delayFor,this.retryIf);return n.start(),new tr((function(e){return n.subscribe(e),function(){n.unsubscribe(e)}}))},t}(Ar),ls=n(4147);function fs(e){return new Ar((function(t,n){return t.setContext({headers:{"X-API-KEY":e}}),n(t)}))}var ps=function(e){return!!e&&![500,400].includes(e.statusCode)};var ds=function(){function e(){var e=this;this.setFeatures=function(t){return e.features=new Set(t)},this.entitlements=new Map,this.features=new Set,this.isLoaded=!1}return e.prototype.getEntitlement=function(e){return this.entitlements.get(e)||null},e.prototype.validateFeature=function(e){return this.features.has(e)},e.prototype.setEntitlements=function(e){this.entitlements=e,this.isLoaded=!0},e.prototype.getEntitlements=function(){return this.entitlements},e}(),hs=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},ys=Dt(gs||(gs=hs(["\n fragment EntitlementFragment on Entitlement {\n isGranted\n accessDeniedReason\n customerId\n usageLimit\n hasUnlimitedUsage\n currentUsage\n requestedUsage\n nextResetDate\n resetPeriod\n resetPeriodConfiguration {\n ...ResetPeriodConfigurationFragment\n }\n feature {\n ...FeatureFragment\n }\n }\n fragment ResetPeriodConfigurationFragment on ResetPeriodConfiguration {\n __typename\n ... on MonthlyResetPeriodConfig {\n ...MonthlyResetPeriodConfigFragment\n }\n ... on WeeklyResetPeriodConfig {\n ...WeeklyResetPeriodConfigFragment\n }\n }\n fragment FeatureFragment on EntitlementFeature {\n featureType\n meterType\n featureUnits\n featureUnitsPlural\n description\n displayName\n refId\n }\n fragment MonthlyResetPeriodConfigFragment on MonthlyResetPeriodConfig {\n monthlyAccordingTo\n }\n fragment WeeklyResetPeriodConfigFragment on WeeklyResetPeriodConfig {\n weeklyAccordingTo\n }\n"],["\n fragment EntitlementFragment on Entitlement {\n isGranted\n accessDeniedReason\n customerId\n usageLimit\n hasUnlimitedUsage\n currentUsage\n requestedUsage\n nextResetDate\n resetPeriod\n resetPeriodConfiguration {\n ...ResetPeriodConfigurationFragment\n }\n feature {\n ...FeatureFragment\n }\n }\n fragment ResetPeriodConfigurationFragment on ResetPeriodConfiguration {\n __typename\n ... on MonthlyResetPeriodConfig {\n ...MonthlyResetPeriodConfigFragment\n }\n ... on WeeklyResetPeriodConfig {\n ...WeeklyResetPeriodConfigFragment\n }\n }\n fragment FeatureFragment on EntitlementFeature {\n featureType\n meterType\n featureUnits\n featureUnitsPlural\n description\n displayName\n refId\n }\n fragment MonthlyResetPeriodConfigFragment on MonthlyResetPeriodConfig {\n monthlyAccordingTo\n }\n fragment WeeklyResetPeriodConfigFragment on WeeklyResetPeriodConfig {\n weeklyAccordingTo\n }\n"]))),vs=function(){function e(e){this.client=e}return e.prototype.getEntitlements=function(e){return this.client.query({query:Dt(bs||(bs=hs(["\n query GetEntitlements($query: FetchEntitlementsQuery!) {\n entitlements: cachedEntitlements(query: $query) {\n ...EntitlementFragment\n }\n }\n ","\n "],["\n query GetEntitlements($query: FetchEntitlementsQuery!) {\n entitlements: cachedEntitlements(query: $query) {\n ...EntitlementFragment\n }\n }\n ","\n "])),ys),variables:{query:{customerId:e}},fetchPolicy:"no-cache"})},e.prototype.pollEntitlements=function(e,t){return this.client.watchQuery({query:Dt(Es||(Es=hs(["\n query GetEntitlements($query: FetchEntitlementsQuery!) {\n entitlements: cachedEntitlements(query: $query) {\n ...EntitlementFragment\n }\n }\n ","\n "],["\n query GetEntitlements($query: FetchEntitlementsQuery!) {\n entitlements: cachedEntitlements(query: $query) {\n ...EntitlementFragment\n }\n }\n ","\n "])),ys),variables:{query:{customerId:e}},fetchPolicy:"no-cache",pollInterval:t,errorPolicy:"none"})},e.prototype.reportEntitlementRequested=function(e,t,n,r){return i=this,o=void 0,s=function(){return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(i){switch(i.label){case 0:return[4,this.client.mutate({mutation:Dt(_s||(_s=hs(["\n mutation reportEntitlementCheckRequested($entitlementCheckRequested: EntitlementCheckRequested!) {\n reportEntitlementCheckRequested(entitlementCheckRequested: $entitlementCheckRequested)\n }\n "],["\n mutation reportEntitlementCheckRequested($entitlementCheckRequested: EntitlementCheckRequested!) {\n reportEntitlementCheckRequested(entitlementCheckRequested: $entitlementCheckRequested)\n }\n "]))),variables:{entitlementCheckRequested:{entitlementCheckResult:n,customerId:t,featureId:e,requestedUsage:r}},fetchPolicy:"no-cache"})];case 1:return i.sent(),[2]}}))},new((a=void 0)||(a=Promise))((function(e,t){function n(e){try{u(s.next(e))}catch(e){t(e)}}function r(e){try{u(s.throw(e))}catch(e){t(e)}}function u(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(n,r)}u((s=s.apply(i,o||[])).next())}));var i,o,a,s},e}();const ms=vs;var gs,bs,Es,_s,ws=function(){function e(){}return e.decideEntitlementPolicy=function(e,t){var n,r;if(!e||!e.calculatedEntitlement.feature)return{hasAccess:!1,accessDeniedReason:ce.CustomerNotEntitledForFeature};var i=e.calculatedEntitlement.feature,o=i.featureType,a=i.meterType;switch(o){case le.Boolean:return{hasAccess:!0};case le.Numeric:if((null===(n=e.calculatedEntitlement.feature)||void 0===n?void 0:n.meterType)===fe.None)return{hasAccess:!0};if(e.calculatedEntitlement.hasUnlimitedUsage)return{hasAccess:!0};var s=e.featureUsage.currentUsage;return a===fe.Incremental&&e.featureUsage.nextResetDate<(new Date).getTime()&&(s=0),s+(t||0)<=((null===(r=e.calculatedEntitlement)||void 0===r?void 0:r.usageLimit)||0)?{hasAccess:!0}:{hasAccess:!1,accessDeniedReason:ce.RequestedUsageExceedsLimit}}},e}(),Is=function(){function e(e,t,n){this.entitlementsApi=e,this.customerId=t,this.loggerService=n}return e.prototype.reportEntitlementCheckRequested=function(e,t,n){return r=this,i=void 0,a=function(){var r=this;return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(i){return this.entitlementsApi.reportEntitlementRequested(e,this.customerId,t,n).then((function(){r.loggerService.debug("Successfully reported entitlement check requested")}),(function(e){r.loggerService.error("Failed to report entitlement check requested",e)})),[2]}))},new((o=void 0)||(o=Promise))((function(e,t){function n(e){try{u(a.next(e))}catch(e){t(e)}}function s(e){try{u(a.throw(e))}catch(e){t(e)}}function u(t){var r;t.done?e(t.value):(r=t.value,r instanceof o?r:new o((function(e){e(r)}))).then(n,s)}u((a=a.apply(r,i||[])).next())}));var r,i,o,a},e}(),Ts=function(){return Ts=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ts.apply(this,arguments)},Os=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},Ss=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},Ds=function(){function e(e,t,n,r,i){this.customerId=e,this.cacheService=t,this.loggerService=i,this.modelMapper=new gn,this.loadingEntitlements=null,this.entitlementsApi=new ms(n),this.entitlementCheckReportingService=new Is(new ms(r),e,i),this.entitlementsPollingObserver=null}return e.prototype.startPolling=function(e){var t=this;this.stopPolling(),this.entitlementsPollingObserver=this.entitlementsApi.pollEntitlements(this.customerId,e),this.entitlementsPollingObserver.subscribe((function(n){var r;if(n.errors||!n.data||!n.data.entitlements)return t.loggerService.error("Failed to poll entitlements. Error: ".concat(n.errors),{errors:(null===(r=n.errors)||void 0===r?void 0:r.map((function(e){return e.message})).join(", "))||""}),void setTimeout((function(){return t.restartPolling(e)}),e);t.storeFetchedEntitlementsInCache(n.data.entitlements)}),(function(n){t.loggerService.error("Failed to poll entitlements. Error: ".concat(n.message),n),setTimeout((function(){return t.restartPolling(e)}),e)}))},e.prototype.stopPolling=function(){var e;null===(e=this.entitlementsPollingObserver)||void 0===e||e.stopPolling()},e.prototype.restartPolling=function(e){this.stopPolling(),this.startPolling(e)},e.prototype.refresh=function(){return Os(this,void 0,void 0,(function(){return Ss(this,(function(e){switch(e.label){case 0:return[4,this.loadEntitlements()];case 1:return e.sent(),[2]}}))}))},e.prototype.getBooleanEntitlement=function(e,t){var n=this.cacheService.getEntitlement(e),r=ws.decideEntitlementPolicy(n);if((null==n?void 0:n.calculatedEntitlement.feature)&&n.calculatedEntitlement.feature.featureType!==le.Boolean)return this.entitlementCheckReportingService.reportEntitlementCheckRequested(e,this.modelMapper.mapFallbackBooleanEntitlementResult(t,r)),t;if(!n){var i=this.modelMapper.mapEntitlementResult(r);return this.entitlementCheckReportingService.reportEntitlementCheckRequested(e,i),Ts(Ts({},r),{isFallback:!1})}var o=this.modelMapper.mapEntitlementResult(r,n);return this.entitlementCheckReportingService.reportEntitlementCheckRequested(e,o),this.modelMapper.mapBooleanEntitlement(n,r)},e.prototype.getNumericEntitlement=function(e,t){var n,r=this.cacheService.getEntitlement(e),i=ws.decideEntitlementPolicy(r);if((null==r?void 0:r.calculatedEntitlement.feature)&&(null===(n=r.calculatedEntitlement.feature)||void 0===n?void 0:n.featureType)!==le.Numeric){var o=this.modelMapper.mapFallbackNumericEntitlementResult(t,i);return this.entitlementCheckReportingService.reportEntitlementCheckRequested(e,o),t}if(!r){var a=this.modelMapper.mapEntitlementResult(i);return this.entitlementCheckReportingService.reportEntitlementCheckRequested(e,a),Ts(Ts({},i),{isFallback:!1,isUnlimited:!1})}var s=this.modelMapper.mapEntitlementResult(i,r);return this.entitlementCheckReportingService.reportEntitlementCheckRequested(e,s),this.modelMapper.mapNumericEntitlement(r,i)},e.prototype.getMeteredEntitlement=function(e,t,n){var r,i,o=this.cacheService.getEntitlement(e),a=ws.decideEntitlementPolicy(o,null==n?void 0:n.requestedUsage);if((null==o?void 0:o.calculatedEntitlement.feature)&&(null===(r=o.calculatedEntitlement.feature)||void 0===r?void 0:r.meterType)!==fe.Fluctuating&&(null===(i=o.calculatedEntitlement.feature)||void 0===i?void 0:i.meterType)!==fe.Incremental){var s=this.modelMapper.mapFallbackMeteredEntitlementResult(t,a,null==n?void 0:n.requestedUsage);return this.entitlementCheckReportingService.reportEntitlementCheckRequested(e,s),t}if(!o){var u=this.modelMapper.mapEntitlementResult(a,void 0,null==n?void 0:n.requestedUsage);return this.entitlementCheckReportingService.reportEntitlementCheckRequested(e,u),Ts(Ts({},a),{currentUsage:0,isFallback:!1,isUnlimited:!1,requestedUsage:(null==n?void 0:n.requestedUsage)||0})}var c=this.modelMapper.mapEntitlementResult(a,o,null==n?void 0:n.requestedUsage);return this.entitlementCheckReportingService.reportEntitlementCheckRequested(e,c),this.modelMapper.mapMeteredEntitlement(o,a,null==n?void 0:n.requestedUsage)},e.prototype.loadEntitlements=function(){return Os(this,void 0,void 0,(function(){return Ss(this,(function(e){switch(e.label){case 0:this.loadingEntitlements||(this.loadingEntitlements=this.loadEntitlementsFromRemote()),e.label=1;case 1:return e.trys.push([1,,3,4]),[4,this.loadingEntitlements];case 2:return[2,e.sent()];case 3:return this.loadingEntitlements=null,[7];case 4:return[2]}}))}))},e.prototype.loadEntitlementsFromRemote=function(){return Os(this,void 0,void 0,(function(){var e;return Ss(this,(function(t){switch(t.label){case 0:return[4,this.entitlementsApi.getEntitlements(this.customerId)];case 1:return e=t.sent(),this.storeFetchedEntitlementsInCache(e.data.entitlements),[2]}}))}))},e.prototype.storeFetchedEntitlementsInCache=function(e){var t=this.modelMapper.mapCachedEntitlements(e);this.cacheService.setEntitlements(t)},e.prototype.getEntitlements=function(){return Os(this,void 0,void 0,(function(){var e=this;return Ss(this,(function(t){switch(t.label){case 0:return this.cacheService.isLoaded?[3,2]:[4,this.loadEntitlements()];case 1:t.sent(),t.label=2;case 2:return[2,Array.from(this.cacheService.getEntitlements().values()).map((function(t){var n=ws.decideEntitlementPolicy(t);return e.modelMapper.mapEntitlement(t,n)}))]}}))}))},e}(),xs=function(){return xs=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},xs.apply(this,arguments)},As=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},ks=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},Ns=function(){function e(e,t){this.modelMapper=new gn,this.configuration=e,this.graphClient=function(e){var t=e.apiKey,n=e.baseUri,r=fs(t),i=function(e){return new ti({uri:"".concat(e,"/graphql"),fetch:is()})}(n),o=new cs({attempts:{max:5,retryIf:ps},delay:{initial:500,max:2e3,jitter:!0}});return new ca({link:r.concat(o.concat(i)),cache:new ts({possibleTypes:ns.g}),name:"js-client-sdk",version:ls.version})}(this.configuration),this.batchedGraphClient=function(e){var t=e.apiKey,n=e.baseUri,r=fs(t),i=function(e){return new ss({uri:"".concat(e,"/graphql"),batchMax:25,batchInterval:500,fetch:is()})}(n);return new ca({link:r.concat(i),cache:new ts({possibleTypes:ns.g}),name:"js-client-sdk",version:ls.version})}(this.configuration),this.loggerService=t,this.apiGateway=new sn(this.graphClient),this.entitlementsService=null}return e.initialize=function(t){return As(this,void 0,void 0,(function(){var n,i,o,a,s;return ks(this,(function(u){switch(u.label){case 0:if(n=function(e){var t={baseUri:"https://api.stigg.io",entitlementPollingInterval:3e4,logConfiguration:{logger:console,logLevel:r.ERROR}};return fn()(t,e)}(t),i=new de(n.logConfiguration.logger,n.logConfiguration.logLevel),o=function(e,t){var n=!0;return cn()(e.apiKey)&&(t.error("You must configure the client with an SDK key"),n=!1),e.entitlementPollingInterval&&e.entitlementPollingInterval<5e3&&(t.error("Entitlements polling interval cannot be lower than 5000ms"),n=!1),n}(n,i),!o)return[2,null];u.label=1;case 1:return u.trys.push([1,4,,5]),a=new e(n,i),t.customerId?[4,a.setCustomerId(t.customerId)]:[3,3];case 2:u.sent(),u.label=3;case 3:return[2,a];case 4:return s=u.sent(),i.error("Failed to initialize Stigg JS SDK. Error: ".concat(s.message)),[2,null];case 5:return[2]}}))}))},e.prototype.setCustomerId=function(e){var t;return As(this,void 0,void 0,(function(){var n=this;return ks(this,(function(r){return null===(t=this.entitlementsService)||void 0===t||t.stopPolling(),this.configuration.customerId=e,this.entitlementsService=new Ds(e,new ds,this.graphClient,this.batchedGraphClient,this.loggerService),this.entitlementsService.startPolling(this.configuration.entitlementPollingInterval),[2,this.withErrorHandling((function(){return As(n,void 0,void 0,(function(){var e;return ks(this,(function(t){switch(t.label){case 0:return[4,null===(e=this.entitlementsService)||void 0===e?void 0:e.loadEntitlements()];case 1:return t.sent(),[2]}}))}))}),(function(e){return"Failed to load initial entitlements for customer. Error: ".concat(e.message)}))]}))}))},e.prototype.refresh=function(){return As(this,void 0,void 0,(function(){var e=this;return ks(this,(function(t){return[2,this.withErrorHandling((function(){return As(e,void 0,void 0,(function(){var e;return ks(this,(function(t){switch(t.label){case 0:return[4,null===(e=this.entitlementsService)||void 0===e?void 0:e.refresh()];case 1:return t.sent(),[2]}}))}))}),(function(e){return"Failed to refresh entitlements. Error: ".concat(e.message)}))]}))}))},e.prototype.getBooleanEntitlement=function(e){var t=e.featureId,n=e.options,r=xs(xs({},he),(null==n?void 0:n.fallback)||{});try{return this.entitlementsService?this.entitlementsService.getBooleanEntitlement(t,r):r}catch(e){return this.loggerService.error("Failed to get boolean entitlement. Error: ".concat(e.message),e),r}},e.prototype.getNumericEntitlement=function(e){var t=e.featureId,n=e.options,r=xs(xs({},ye),(null==n?void 0:n.fallback)||{});try{return this.entitlementsService?this.entitlementsService.getNumericEntitlement(t,r):r}catch(e){return this.loggerService.error("Failed to get numeric entitlement. Error: ".concat(e.message),e),r}},e.prototype.getMeteredEntitlement=function(e){var t=e.featureId,n=e.options,r=xs(xs({},ve),(null==n?void 0:n.fallback)||{});try{return this.entitlementsService?this.entitlementsService.getMeteredEntitlement(t,r,n):r}catch(e){return this.loggerService.error("Failed to get metered entitlement. Error: ".concat(e.message),e),r}},e.prototype.getPaywall=function(e){var t=(void 0===e?{}:e).productId;return As(this,void 0,void 0,(function(){var e=this;return ks(this,(function(n){return[2,this.withErrorHandling((function(){return As(e,void 0,void 0,(function(){var e;return ks(this,(function(n){switch(n.label){case 0:return[4,this.apiGateway.paywall.getPlans(t)];case 1:return e=n.sent(),[2,this.modelMapper.mapPlans(e.data)]}}))}))}),(function(e){return"Failed to get paywall. Error: ".concat(e.message)}))]}))}))},e.prototype.getCoupons=function(){return As(this,void 0,void 0,(function(){var e=this;return ks(this,(function(t){return[2,this.withErrorHandling((function(){return As(e,void 0,void 0,(function(){var e;return ks(this,(function(t){switch(t.label){case 0:return[4,this.apiGateway.coupons.getCoupons()];case 1:return e=t.sent(),[2,this.modelMapper.mapCoupons(e.data)]}}))}))}),(function(e){return"Failed to get coupons. Error: ".concat(e.message)}))]}))}))},e.prototype.getCustomer=function(){return As(this,void 0,void 0,(function(){var e=this;return ks(this,(function(t){return[2,this.withErrorHandling((function(){return As(e,void 0,void 0,(function(){var e,t,n;return ks(this,(function(r){switch(r.label){case 0:return e=pn(this.configuration),[4,this.apiGateway.customers.getCustomer(e)];case 1:if(t=r.sent(),!(n=t.data.customers.edges[0]))throw new Error("Customer not found");return[2,this.modelMapper.mapCustomer(n.node)]}}))}))}),(function(e){return"Failed to get customer. Error: ".concat(e.message)}))]}))}))},e.prototype.getEntitlements=function(){return As(this,void 0,void 0,(function(){var e=this;return ks(this,(function(t){return[2,this.withErrorHandling((function(){return As(e,void 0,void 0,(function(){var e;return ks(this,(function(t){return pn(this.configuration),[2,(null===(e=this.entitlementsService)||void 0===e?void 0:e.getEntitlements())||[]]}))}))}),(function(e){return"Failed to get entitlements. Error: ".concat(e.message)}))]}))}))},e.prototype.waitForCheckoutCompleted=function(e){var t=void 0===e?{}:e,n=t.timeoutMs,r=void 0===n?15e3:n,i=t.refreshOnComplete,o=void 0===i||i;return As(this,void 0,void 0,(function(){var e,t,n,i,a,s;return ks(this,(function(u){switch(u.label){case 0:if("undefined"==typeof window)throw new Error("`waitForCheckoutCompleted` was called, but `window` is not defined");if(e=new URLSearchParams(window.location.search),!(t=e.get("subscriptionId")))return this.loggerService.log("`waitCheckoutCompleted` was called, but no `subscriptionId` found in query params"),[2,null];n=Date.now(),i=!1,a=null,u.label=1;case 1:return i?[4,new Promise((function(e){return setTimeout(e,1e3)}))]:[3,3];case 2:u.sent(),u.label=3;case 3:return[4,this.getCustomer()];case 4:s=u.sent(),a=s.getActiveSubscriptions().find((function(e){return e.id===t}))||null,i=!0,u.label=5;case 5:if(!a&&Date.now()-n<r)return[3,1];u.label=6;case 6:if(!a)throw new Error("Timeout while waiting for checkout to complete, subscription ".concat(t," is not active"));return o?[4,this.refresh()]:[3,8];case 7:u.sent(),u.label=8;case 8:return[2,a]}}))}))},e.prototype.withErrorHandling=function(e,t){return As(this,void 0,void 0,(function(){var n,r;return ks(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,e()];case 1:return[2,i.sent()];case 2:throw n=i.sent(),r=t?t(n):"Operation failed. Error: ".concat(n.message),this.loggerService.error(r,n),new Error(r);case 3:return[2]}}))}))},e}()},4147:e=>{"use strict";e.exports=JSON.parse('{"name":"@stigg/js-client-sdk","version":"0.38.0","description":"Stigg client-side SDK for Browser","main":"dist/index.js","typings":"dist/index.d.ts","repository":"https://github.com/stiggio/js-client-sdk.git","license":"MIT","scripts":{"start":"webpack serve","build:types":"tsc --emitDeclarationOnly","build":"yarn build:types && webpack","build:watch":"webpack --watch","build:prod":"yarn build:types && webpack --env production","generate":"graphql-codegen && yarn run fix:lint","fix":"run-s fix:*","fix:prettier":"prettier \\"src/**/*.ts\\" --write","fix:lint":"eslint src --ext .ts --fix","test":"jest","test:watch":"jest --watch","test:cov":"jest --coverage","prepare":"husky install","docs":"typedoc"},"files":["dist/**/*"],"dependencies":{"@apollo/client":"^3.4.17","cross-fetch":"^3.1.4","graphql":"^16.0.1","husky":"^7.0.4","lint-staged":"^12.0.2","lodash":"^4.17.21"},"devDependencies":{"@commitlint/cli":"^14.1.0","@commitlint/config-conventional":"^14.1.0","@graphql-codegen/cli":"^2.3.0","@graphql-codegen/fragment-matcher":"^3.2.1","@graphql-codegen/schema-ast":"^2.4.0","@graphql-codegen/typescript":"^2.4.0","@graphql-codegen/typescript-operations":"^2.2.0","@types/jest":"^27.0.2","@types/lodash":"^4.14.177","@typescript-eslint/eslint-plugin":"^5.4.0","@typescript-eslint/parser":"^5.4.0","eslint":"^8.2.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^4.0.0","jest":"^27.3.1","jest-fetch-mock":"^3.0.3","msw":"^0.35.0","npm-run-all":"^4.1.5","prettier":"^2.4.1","ts-jest":"^27.0.7","ts-loader":"^9.2.6","typedoc":"^0.22.13","typedoc-plugin-rename-defaults":"^0.4.0","typescript":"^4.5.3","webpack":"^5.64.1","webpack-cli":"^4.9.1","webpack-dev-server":"^4.5.0"},"publishConfig":{"access":"public"},"lint-staged":{"*.{js,jsx,ts,tsx}":["prettier --check","eslint --cache"]}}')}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}return n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n(7984)})()}));
2
2
  //# sourceMappingURL=index.js.map