text: !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("netlify-cms-lib-util"),require("@emotion/core"),require("prop-types"),require("react"),require("netlify-cms-ui-default"),require("netlify-cms-lib-auth")):"function"==typeof define&&define.amd?define("NetlifyCmsBackendGithub",["netlify-cms-lib-util","@emotion/core","prop-types","react","netlify-cms-ui-default","netlify-cms-lib-auth"],t):"object"==typeof exports?exports.NetlifyCmsBackendGithub=t(require("netlify-cms-lib-util"),require("@emotion/core"),require("prop-types"),require("react"),require("netlify-cms-ui-default"),require("netlify-cms-lib-auth")):e.NetlifyCmsBackendGithub=t(e.NetlifyCmsLibUtil,e.NetlifyCmsDefaultExports.EmotionCore,e.NetlifyCmsDefaultExports.PropTypes,e.React,e.NetlifyCmsUiDefault,e.NetlifyCmsLibAuth)}(window,(function(e,t,n,r,i,o){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=149)}([function(e,t,n){"use strict";n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return o})),n.d(t,"e",(function(){return a})),n.d(t,"b",(function(){return s})),n.d(t,"d",(function(){return u})),n.d(t,"f",(function(){return c}));
  /*! *****************************************************************************
  Copyright (c) Microsoft Corporation.
  
  Permission to use, copy, modify, and/or distribute this software for any
  purpose with or without fee is hereby granted.
  
  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  PERFORMANCE OF THIS SOFTWARE.
  ***************************************************************************** */
  var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function i(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o=function(){return(o=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}).apply(this,arguments)};function a(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 s(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 u(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=a.trys,(i=i.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 c(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}},function(t,n){t.exports=e},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return L})),n.d(t,"b",(function(){return f})),n.d(t,"c",(function(){return x})),n.d(t,"d",(function(){return Q})),n.d(t,"e",(function(){return V})),n.d(t,"f",(function(){return z})),n.d(t,"g",(function(){return C})),n.d(t,"h",(function(){return A})),n.d(t,"i",(function(){return g})),n.d(t,"j",(function(){return P})),n.d(t,"k",(function(){return k})),n.d(t,"l",(function(){return I})),n.d(t,"m",(function(){return _})),n.d(t,"n",(function(){return j})),n.d(t,"o",(function(){return T})),n.d(t,"p",(function(){return h})),n.d(t,"q",(function(){return Y})),n.d(t,"r",(function(){return R})),n.d(t,"s",(function(){return O})),n.d(t,"t",(function(){return d})),n.d(t,"u",(function(){return v})),n.d(t,"v",(function(){return m})),n.d(t,"w",(function(){return b})),n.d(t,"x",(function(){return H})),n.d(t,"y",(function(){return W})),n.d(t,"z",(function(){return X})),n.d(t,"A",(function(){return ee})),n.d(t,"B",(function(){return te})),n.d(t,"C",(function(){return $})),n.d(t,"D",(function(){return B})),n.d(t,"E",(function(){return p})),n.d(t,"F",(function(){return w})),n.d(t,"G",(function(){return c})),n.d(t,"H",(function(){return y})),n.d(t,"I",(function(){return J}));var r=n(5),i=n(3),o=n(0),a=n(61),s=n.n(a);n(43);function u(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 o={};n.fields.map((function(e){return u(o,e.name,e.value,r)})),e[t.value]=o}else if(function(e){return"Variable"===e.kind}(n)){var a=(r||{})[n.name.value];e[t.value]=a}else if(function(e){return"ListValue"===e.kind}(n))e[t.value]=n.values.map((function(e){var n={};return u(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 new i.a(17);e[t.value]=null}}function c(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 u(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 u(r,n,i,t)}))),h(e.name.value,r,n)}var l=["connection","include","skip","client","rest","export"];function h(e,t,n){if(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=t,o={};return r.forEach((function(e){o[e]=i[e]})),n.connection.key+"("+JSON.stringify(o)+")"}return n.connection.key}var a=e;if(t){var u=s()(t);a+="("+u+")"}return n&&Object.keys(n).forEach((function(e){-1===l.indexOf(e)&&(n[e]&&Object.keys(n[e]).length?a+="@"+e+"("+JSON.stringify(n[e])+")":a+="@"+e)})),a}function f(e,t){if(e.arguments&&e.arguments.length){var n={};return e.arguments.forEach((function(e){var r=e.name,i=e.value;return u(n,r,i,t)})),n}return null}function p(e){return e.alias?e.alias.value:e.name.value}function d(e){return"Field"===e.kind}function m(e){return"InlineFragment"===e.kind}function v(e){return e&&"id"===e.type&&"boolean"==typeof e.generated}function y(e,t){return void 0===t&&(t=!1),Object(o.a)({type:"id",generated:t},"string"==typeof e?{id:e,typename:void 0}:e)}function b(e){return null!=e&&"object"==typeof e&&"json"===e.type}function g(e,t){if(e.directives&&e.directives.length){var n={};return e.directives.forEach((function(e){n[e.name.value]=f(e,t)})),n}return null}function w(e,t){return void 0===t&&(t={}),(n=e.directives,n?n.filter(E).map((function(e){var t=e.arguments;e.name.value,Object(i.b)(t&&1===t.length,14);var n=t[0];Object(i.b)(n.name&&"if"===n.name.value,15);var r=n.value;return Object(i.b)(r&&("Variable"===r.kind||"BooleanValue"===r.kind),16),{directive:e,ifArgument:n}})):[]).every((function(e){var n=e.directive,r=e.ifArgument,o=!1;return"Variable"===r.value.kind?(o=t[r.value.name.value],Object(i.b)(void 0!==o,13)):o=r.value.value,"skip"===n.name.value?!o:o}));var n}function O(e,t){return function(e){var t=[];return Object(r.visit)(e,{Directive:function(e){t.push(e.name.value)}}),t}(t).some((function(t){return e.indexOf(t)>-1}))}function R(e){return e&&O(["client"],e)&&O(["export"],e)}function E(e){var t=e.name.value;return"skip"===t||"include"===t}function k(e,t){var n=t,r=[];return e.definitions.forEach((function(e){if("OperationDefinition"===e.kind)throw new i.a(11);"FragmentDefinition"===e.kind&&r.push(e)})),void 0===n&&(Object(i.b)(1===r.length,12),n=r[0].name.value),Object(o.a)(Object(o.a)({},e),{definitions:Object(o.f)([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:n}}]}}],e.definitions)})}function x(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.forEach((function(t){null!=t&&Object.keys(t).forEach((function(n){e[n]=t[n]}))})),e}function S(e){Object(i.b)(e&&"Document"===e.kind,2);var t=e.definitions.filter((function(e){return"FragmentDefinition"!==e.kind})).map((function(e){if("OperationDefinition"!==e.kind)throw new i.a(3);return e}));return Object(i.b)(t.length<=1,4),e}function _(e){return S(e),e.definitions.filter((function(e){return"OperationDefinition"===e.kind}))[0]}function j(e){return e.definitions.filter((function(e){return"OperationDefinition"===e.kind&&e.name})).map((function(e){return e.name.value}))[0]||null}function P(e){return e.definitions.filter((function(e){return"FragmentDefinition"===e.kind}))}function T(e){var t=_(e);return Object(i.b)(t&&"query"===t.operation,6),t}function I(e){var t;S(e);for(var n=0,r=e.definitions;n<r.length;n++){var o=r[n];if("OperationDefinition"===o.kind){var a=o.operation;if("query"===a||"mutation"===a||"subscription"===a)return o}"FragmentDefinition"!==o.kind||t||(t=o)}if(t)return t;throw new i.a(10)}function C(e){void 0===e&&(e=[]);var t={};return e.forEach((function(e){t[e.name.value]=e})),t}function A(e){if(e&&e.variableDefinitions&&e.variableDefinitions.length){var t=e.variableDefinitions.filter((function(e){return e.defaultValue})).map((function(e){var t=e.variable,n=e.defaultValue,r={};return u(r,t.name,n),r}));return x.apply(void 0,Object(o.f)([{}],t))}return{}}function N(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 q={kind:"Field",name:{kind:"Name",value:"__typename"}};function F(e){return function e(t,n){return t.selectionSet.selections.every((function(t){return"FragmentSpread"===t.kind&&e(n[t.name.value],n)}))}(_(e)||function(e){Object(i.b)("Document"===e.kind,7),Object(i.b)(e.definitions.length<=1,8);var t=e.definitions[0];return Object(i.b)("FragmentDefinition"===t.kind,9),t}(e),C(P(e)))?null:e}function D(e){return function(t){return e.some((function(e){return e.name&&e.name===t.name.value||e.test&&e.test(t)}))}}function M(e,t){var n=Object.create(null),i=[],a=Object.create(null),s=[],u=F(Object(r.visit)(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(D(e))))return t.arguments&&t.arguments.forEach((function(e){"Variable"===e.value.kind&&i.push({name:e.value.name.value})})),t.selectionSet&&function e(t){var n=[];return t.selections.forEach((function(t){(d(t)||m(t))&&t.selectionSet?e(t.selectionSet).forEach((function(e){return n.push(e)})):"FragmentSpread"===t.kind&&n.push(t)})),n}(t.selectionSet).forEach((function(e){s.push({name:e.name.value})})),null}},FragmentSpread:{enter:function(e){a[e.name.value]=!0}},Directive:{enter:function(t){if(D(e)(t))return null}}}));return u&&N(i,(function(e){return!n[e.name]})).length&&(u=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 F(Object(r.visit)(t,{OperationDefinition:{enter:function(t){return Object(o.a)(Object(o.a)({},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.forEach((function(e){n(e)&&(r+=1)})),1===r)return null}}},Argument:{enter:function(e){if(n(e))return null}}}))}(i,u)),u&&N(s,(function(e){return!a[e.name]})).length&&(u=function(e,t){function n(t){if(e.some((function(e){return e.name===t.name.value})))return null}return F(Object(r.visit)(t,{FragmentSpread:{enter:n},FragmentDefinition:{enter:n}}))}(s,u)),u}function L(e){return Object(r.visit)(S(e),{SelectionSet:{enter:function(e,t,n){if(!n||"OperationDefinition"!==n.kind){var r=e.selections;if(r)if(!r.some((function(e){return d(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))}))){var i=n;if(!(d(i)&&i.directives&&i.directives.some((function(e){return"export"===e.name.value}))))return Object(o.a)(Object(o.a)({},e),{selections:Object(o.f)(r,[q])})}}}}})}var U={test:function(e){var t="connection"===e.name.value;return t&&(!e.arguments||e.arguments.some((function(e){return"key"===e.name.value}))),t}};function B(e){return M([U],S(e))}function Q(e){return"query"===I(e).operation?e:Object(r.visit)(e,{OperationDefinition:{enter:function(e){return Object(o.a)(Object(o.a)({},e),{operation:"query"})}}})}function $(e){S(e);var t=M([{test:function(e){return"client"===e.name.value},remove:!0}],e);return t&&(t=Object(r.visit)(t,{FragmentDefinition:{enter:function(e){if(e.selectionSet&&e.selectionSet.selections.every((function(e){return d(e)&&"__typename"===e.name.value})))return null}}})),t}var V="function"==typeof WeakMap&&!("object"==typeof navigator&&"ReactNative"===navigator.product),G=Object.prototype.toString;function z(e){return function e(t,n){switch(G.call(t)){case"[object Array]":if(n.has(t))return n.get(t);var r=t.slice(0);return n.set(t,r),r.forEach((function(t,i){r[i]=e(t,n)})),r;case"[object Object]":if(n.has(t))return n.get(t);var i=Object.create(Object.getPrototypeOf(t));return n.set(t,i),Object.keys(t).forEach((function(r){i[r]=e(t[r],n)})),i;default:return t}}(e,new Map)}function K(t){return(void 0!==e?"production":"development")===t}function H(){return!0===K("production")}function W(){return!0===K("test")}function J(e){try{return e()}catch(e){console.error&&console.error(e)}}function Y(e){return e.errors&&e.errors.length}function X(e){if((!0===K("development")||W())&&!("function"==typeof Symbol&&"string"==typeof Symbol("")))return function e(t){return Object.freeze(t),Object.getOwnPropertyNames(t).forEach((function(n){null===t[n]||"object"!=typeof t[n]&&"function"!=typeof t[n]||Object.isFrozen(t[n])||e(t[n])})),t}(e);return e}var Z=Object.prototype.hasOwnProperty;function ee(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return te(e)}function te(e){var t=e[0]||{},n=e.length;if(n>1){var r=[];t=ie(t,r);for(var i=1;i<n;++i)t=re(t,e[i],r)}return t}function ne(e){return null!==e&&"object"==typeof e}function re(e,t,n){return ne(t)&&ne(e)?(Object.isExtensible&&!Object.isExtensible(e)&&(e=ie(e,n)),Object.keys(t).forEach((function(r){var i=t[r];if(Z.call(e,r)){var o=e[r];i!==o&&(e[r]=re(ie(o,n),i,n))}else e[r]=i})),e):t}function ie(e,t){return null!==e&&"object"==typeof e&&t.indexOf(e)<0&&(e=Array.isArray(e)?e.slice(0):Object(o.a)({__proto__:Object.getPrototypeOf(e)},e),t.push(e)),e}Object.create({})}).call(this,n(12))},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return s}));var r=n(0),i=Object.setPrototypeOf,o=void 0===i?function(e,t){return e.__proto__=t,e}:i,a=function(e){function t(n){void 0===n&&(n="Invariant Violation");var r=e.call(this,"number"==typeof n?"Invariant Violation: "+n+" (see https://github.com/apollographql/invariant-packages)":n)||this;return r.framesToPop=1,r.name="Invariant Violation",o(r,t.prototype),r}return Object(r.c)(t,e),t}(Error);function s(e,t){if(!e)throw new a(t)}function u(e){return function(){return console[e].apply(console,arguments)}}!function(e){e.warn=u("warn"),e.error=u("error")}(s||(s={}));var c={env:{}};if("object"==typeof e)c=e;else try{Function("stub","process = stub")(c)}catch(e){}}).call(this,n(12))},function(e,n){e.exports=t},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.visit=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a,r=void 0,c=Array.isArray(e),l=[e],h=-1,f=[],p=void 0,d=void 0,m=void 0,v=[],y=[],b=e;do{var g=++h===l.length,w=g&&0!==f.length;if(g){if(d=0===y.length?void 0:v[v.length-1],p=m,m=y.pop(),w){if(c)p=p.slice();else{for(var O={},R=0,E=Object.keys(p);R<E.length;R++){var k=E[R];O[k]=p[k]}p=O}for(var x=0,S=0;S<f.length;S++){var _=f[S][0],j=f[S][1];c&&(_-=x),c&&null===j?(p.splice(_,1),x++):p[_]=j}}h=r.index,l=r.keys,f=r.edits,c=r.inArray,r=r.prev}else{if(d=m?c?h:l[h]:void 0,null==(p=m?m[d]:b))continue;m&&v.push(d)}var P,T=void 0;if(!Array.isArray(p)){if(!(0,o.isNode)(p))throw new Error("Invalid AST Node: ".concat((0,i.default)(p),"."));var I=u(t,p.kind,g);if(I){if((T=I.call(t,p,d,m,v,y))===s)break;if(!1===T){if(!g){v.pop();continue}}else if(void 0!==T&&(f.push([d,T]),!g)){if(!(0,o.isNode)(T)){v.pop();continue}p=T}}}if(void 0===T&&w&&f.push([d,p]),g)v.pop();else r={inArray:c,index:h,keys:l,edits:f,prev:r},c=Array.isArray(p),l=c?p:null!==(P=n[p.kind])&&void 0!==P?P:[],h=-1,f=[],m&&y.push(m),m=p}while(void 0!==r);0!==f.length&&(b=f[f.length-1][1]);return b},t.visitInParallel=function(e){var t=new Array(e.length);return{enter:function(n){for(var r=0;r<e.length;r++)if(null==t[r]){var i=u(e[r],n.kind,!1);if(i){var o=i.apply(e[r],arguments);if(!1===o)t[r]=n;else if(o===s)t[r]=s;else if(void 0!==o)return o}}},leave:function(n){for(var r=0;r<e.length;r++)if(null==t[r]){var i=u(e[r],n.kind,!0);if(i){var o=i.apply(e[r],arguments);if(o===s)t[r]=s;else if(void 0!==o&&!1!==o)return o}}else t[r]===n&&(t[r]=null)}}},t.getVisitFn=u,t.BREAK=t.QueryDocumentKeys=void 0;var r,i=(r=n(82))&&r.__esModule?r:{default:r},o=n(83);var a={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"]};t.QueryDocumentKeys=a;var s=Object.freeze({});function u(e,t,n){var r=e[t];if(r){if(!n&&"function"==typeof r)return r;var i=n?r.leave:r.enter;if("function"==typeof i)return i}else{var o=n?e.leave:e.enter;if(o){if("function"==typeof o)return o;var a=o[t];if("function"==typeof a)return a}}}t.BREAK=s},function(e,t){e.exports=n},function(e,t,n){var r=n(70),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},function(e,t,n){var r=n(22),i=n(38),o=n(40),a=n(41),s=n(25),u=/^\s+/;e.exports=function(e,t,n){if((e=s(e))&&(n||void 0===t))return e.replace(u,"");if(!e||!(t=r(t)))return e;var c=a(e),l=o(c,a(t));return i(c,l).join("")}},function(e,t){e.exports=r},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){(function(t){!function(n){"use strict";var r=function(e){setTimeout(e,0)};void 0!==t&&t&&"function"==typeof t.nextTick&&(r=t.nextTick),e.exports=function(e){var t={capacity:e||1,current:0,queue:[],firstHere:!1,take:function(){if(!1===t.firstHere){t.current++,t.firstHere=!0;var e=1}else e=0;var n={n:1};"function"==typeof arguments[0]?n.task=arguments[0]:n.n=arguments[0],arguments.length>=2&&("function"==typeof arguments[1]?n.task=arguments[1]:n.n=arguments[1]);var r=n.task;if(n.task=function(){r(t.leave)},t.current+n.n-e>t.capacity)return 1===e&&(t.current--,t.firstHere=!1),t.queue.push(n);t.current+=n.n-e,n.task(t.leave),1===e&&(t.firstHere=!1)},leave:function(e){if(e=e||1,t.current-=e,t.queue.length){var n=t.queue[0];n.n+t.current>t.capacity||(t.queue.shift(),t.current+=n.n,r(n.task))}else if(t.current<0)throw new Error("leave called too many times.")},available:function(e){return e=e||1,t.current+e<=t.capacity}};return t}}()}).call(this,n(12))},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var u,c=[],l=!1,h=-1;function f(){l&&u&&(l=!1,u.length?c=u.concat(c):h=-1,c.length&&p())}function p(){if(!l){var e=s(f);l=!0;for(var t=c.length;t;){for(u=c,c=[];++h<t;)u&&u[h].run();h=-1,t=c.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function m(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new d(e,t)),1!==c.length||l||s(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=m,i.addListener=m,i.once=m,i.off=m,i.removeListener=m,i.removeAllListeners=m,i.emit=m,i.prependListener=m,i.prependOnceListener=m,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){var r=n(36),i=n(37);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},function(e,t,n){var r=n(16)(Object,"create");e.exports=r},function(e,t,n){var r=n(95),i=n(99);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},function(e,t,n){var r=n(107);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},function(e,t,n){var r=n(113);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},function(e,t,n){var r=n(28),i=n(10);e.exports=function(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=r(e.prototype),o=e.apply(n,t);return i(o)?o:n}}},function(e,t){e.exports=function(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n];a!==t&&"__lodash_placeholder__"!==a||(e[n]="__lodash_placeholder__",o[i++]=n)}return o}},function(e,t,n){var r=n(22),i=n(42),o=n(38),a=n(81),s=n(40),u=n(41),c=n(25);e.exports=function(e,t,n){if((e=c(e))&&(n||void 0===t))return i(e);if(!e||!(t=r(t)))return e;var l=u(e),h=u(t),f=s(l,h),p=a(l,h)+1;return o(l,f,p).join("")}},function(e,t,n){var r=n(23),i=n(71),o=n(13),a=n(14),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}},function(e,t,n){var r=n(7).Symbol;e.exports=r},function(e,t,n){var r=n(74),i=n(75),o=n(76);e.exports=function(e,t,n){return t==t?o(e,t,n):r(e,i,n)}},function(e,t,n){var r=n(22);e.exports=function(e){return null==e?"":r(e)}},function(e,t){e.exports=function(e){return e}},function(e,t){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)}},function(e,t,n){var r=n(10),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},function(e,t,n){var r=n(28),i=n(30);function o(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}o.prototype=r(i.prototype),o.prototype.constructor=o,e.exports=o},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e){return e.placeholder}},function(e,t){e.exports=i},function(e,t){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},function(e,t,n){(function(e){function n(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n}t.resolve=function(){for(var t="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var a=o>=0?arguments[o]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(t=a+"/"+t,i="/"===a.charAt(0))}return(i?"/":"")+(t=n(r(t.split("/"),(function(e){return!!e})),!i).join("/"))||"."},t.normalize=function(e){var o=t.isAbsolute(e),a="/"===i(e,-1);return(e=n(r(e.split("/"),(function(e){return!!e})),!o).join("/"))||o||(e="."),e&&a&&(e+="/"),(o?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(r(e,(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},t.relative=function(e,n){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var i=r(e.split("/")),o=r(n.split("/")),a=Math.min(i.length,o.length),s=a,u=0;u<a;u++)if(i[u]!==o[u]){s=u;break}var c=[];for(u=s;u<i.length;u++)c.push("..");return(c=c.concat(o.slice(s))).join("/")},t.sep="/",t.delimiter=":",t.dirname=function(e){if("string"!=typeof e&&(e+=""),0===e.length)return".";for(var t=e.charCodeAt(0),n=47===t,r=-1,i=!0,o=e.length-1;o>=1;--o)if(47===(t=e.charCodeAt(o))){if(!i){r=o;break}}else i=!1;return-1===r?n?"/":".":n&&1===r?"/":e.slice(0,r)},t.basename=function(e,t){var n=function(e){"string"!=typeof e&&(e+="");var t,n=0,r=-1,i=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!i){n=t+1;break}}else-1===r&&(i=!1,r=t+1);return-1===r?"":e.slice(n,r)}(e);return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},t.extname=function(e){"string"!=typeof e&&(e+="");for(var t=-1,n=0,r=-1,i=!0,o=0,a=e.length-1;a>=0;--a){var s=e.charCodeAt(a);if(47!==s)-1===r&&(i=!1,r=a+1),46===s?-1===t?t=a:1!==o&&(o=1):-1!==t&&(o=-1);else if(!i){n=a+1;break}}return-1===t||-1===r||0===o||1===o&&t===r-1&&t===n+1?"":e.slice(t,r)};var i="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return t<0&&(t=e.length+t),e.substr(t,n)}}).call(this,n(12))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(23),i=n(72),o=n(73),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)}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){var r=n(39);e.exports=function(e,t,n){var i=e.length;return n=void 0===n?i:n,!t&&n>=i?e:r(e,t,n)}},function(e,t){e.exports=function(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o}},function(e,t,n){var r=n(24);e.exports=function(e,t){for(var n=-1,i=e.length;++n<i&&r(t,e[n],0)>-1;);return n}},function(e,t,n){var r=n(77),i=n(78),o=n(79);e.exports=function(e){return i(e)?o(e):r(e)}},function(e,t,n){var r=n(80),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=Object.prototype,i=r.toString,o=r.hasOwnProperty,a=new Map;function s(e,t){try{return function e(t,n){if(t===n)return!0;var r=i.call(t),a=i.call(n);if(r!==a)return!1;switch(r){case"[object Array]":if(t.length!==n.length)return!1;case"[object Object]":if(u(t,n))return!0;var s=Object.keys(t),c=Object.keys(n),l=s.length;if(l!==c.length)return!1;for(var h=0;h<l;++h)if(!o.call(n,s[h]))return!1;for(h=0;h<l;++h){var f=s[h];if(!e(t[f],n[f]))return!1}return!0;case"[object Error]":return t.name===n.name&&t.message===n.message;case"[object Number]":if(t!=t)return n!=n;case"[object Boolean]":case"[object Date]":return+t==+n;case"[object RegExp]":case"[object String]":return t==""+n;case"[object Map]":case"[object Set]":if(t.size!==n.size)return!1;if(u(t,n))return!0;for(var p=t.entries(),d="[object Map]"===r;;){var m=p.next();if(m.done)break;var v=m.value,y=v[0],b=v[1];if(!n.has(y))return!1;if(d&&!e(b,n.get(y)))return!1}return!0}return!1}(e,t)}finally{a.clear()}}function u(e,t){var n=a.get(e);if(n){if(n.has(t))return!0}else a.set(e,n=new Set);return n.add(t),!1}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;t.default=r},function(e,t,n){var r=n(36),i=n(10);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}},function(e,t,n){var r=n(120),i=n(47)(r);e.exports=i},function(e,t){var n=Date.now;e.exports=function(e){var t=0,r=0;return function(){var i=n(),o=16-(i-r);if(r=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}},function(e,t,n){var r=n(26),i=n(49),o=i?function(e,t){return i.set(e,t),e}:r;e.exports=o},function(e,t,n){var r=n(124),i=r&&new r;e.exports=i},function(e,t,n){var r=n(51),i=n(52),o=n(127),a=n(19),s=n(53),u=n(31),c=n(139),l=n(20),h=n(7);e.exports=function e(t,n,f,p,d,m,v,y,b,g){var w=128&n,O=1&n,R=2&n,E=24&n,k=512&n,x=R?void 0:a(t);return function S(){for(var _=arguments.length,j=Array(_),P=_;P--;)j[P]=arguments[P];if(E)var T=u(S),I=o(j,T);if(p&&(j=r(j,p,d,E)),m&&(j=i(j,m,v,E)),_-=I,E&&_<g){var C=l(j,T);return s(t,n,e,S.placeholder,f,j,C,y,b,g-_)}var A=O?f:this,N=R?A[t]:t;return _=j.length,y?j=c(j,y):k&&_>1&&j.reverse(),w&&b<_&&(j.length=b),this&&this!==h&&this instanceof S&&(N=x||a(N)),N.apply(A,j)}}},function(e,t){var n=Math.max;e.exports=function(e,t,r,i){for(var o=-1,a=e.length,s=r.length,u=-1,c=t.length,l=n(a-s,0),h=Array(c+l),f=!i;++u<c;)h[u]=t[u];for(;++o<s;)(f||o<a)&&(h[r[o]]=e[o]);for(;l--;)h[u++]=e[o++];return h}},function(e,t){var n=Math.max;e.exports=function(e,t,r,i){for(var o=-1,a=e.length,s=-1,u=r.length,c=-1,l=t.length,h=n(a-u,0),f=Array(h+l),p=!i;++o<h;)f[o]=e[o];for(var d=o;++c<l;)f[d+c]=t[c];for(;++s<u;)(p||o<a)&&(f[d+r[s]]=e[o++]);return f}},function(e,t,n){var r=n(128),i=n(57),o=n(58);e.exports=function(e,t,n,a,s,u,c,l,h,f){var p=8&t;t|=p?32:64,4&(t&=~(p?64:32))||(t&=-4);var d=[e,t,s,p?u:void 0,p?c:void 0,p?void 0:u,p?void 0:c,l,h,f],m=n.apply(void 0,d);return r(e)&&i(m,d),m.placeholder=a,o(m,e,t)}},function(e,t,n){var r=n(49),i=n(129),o=r?function(e){return r.get(e)}:i;e.exports=o},function(e,t,n){var r=n(28),i=n(30);function o(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}o.prototype=r(i.prototype),o.prototype.constructor=o,e.exports=o},function(e,t){e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},function(e,t,n){var r=n(48),i=n(47)(r);e.exports=i},function(e,t,n){var r=n(134),i=n(135),o=n(46),a=n(136);e.exports=function(e,t,n){var s=t+"";return o(e,i(s,a(r(s),n)))}},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=o},function(e,t,n){"use strict";e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var n,r="boolean"==typeof t.cycles&&t.cycles,i=t.cmp&&(n=t.cmp,function(e){return function(t,r){var i={key:t,value:e[t]},o={key:r,value:e[r]};return n(i,o)}}),o=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var n,a;if(Array.isArray(t)){for(a="[",n=0;n<t.length;n++)n&&(a+=","),a+=e(t[n])||"null";return a+"]"}if(null===t)return"null";if(-1!==o.indexOf(t)){if(r)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var s=o.push(t)-1,u=Object.keys(t).sort(i&&i(t));for(a="",n=0;n<u.length;n++){var c=u[n],l=e(t[c]);l&&(a&&(a+=","),a+=JSON.stringify(c)+":"+l)}return o.splice(s,1),"{"+a+"}"}}(e)}},function(e,t){e.exports={__schema:{types:[{kind:"INTERFACE",name:"Node",possibleTypes:[{name:"AddedToProjectEvent"},{name:"App"},{name:"AssignedEvent"},{name:"BaseRefChangedEvent"},{name:"BaseRefForcePushedEvent"},{name:"Blob"},{name:"Bot"},{name:"BranchProtectionRule"},{name:"ClosedEvent"},{name:"CodeOfConduct"},{name:"CommentDeletedEvent"},{name:"Commit"},{name:"CommitComment"},{name:"CommitCommentThread"},{name:"ConvertedNoteToIssueEvent"},{name:"CrossReferencedEvent"},{name:"DemilestonedEvent"},{name:"DeployKey"},{name:"DeployedEvent"},{name:"Deployment"},{name:"DeploymentEnvironmentChangedEvent"},{name:"DeploymentStatus"},{name:"ExternalIdentity"},{name:"Gist"},{name:"GistComment"},{name:"HeadRefDeletedEvent"},{name:"HeadRefForcePushedEvent"},{name:"HeadRefRestoredEvent"},{name:"Issue"},{name:"IssueComment"},{name:"Label"},{name:"LabeledEvent"},{name:"Language"},{name:"License"},{name:"LockedEvent"},{name:"Mannequin"},{name:"MarketplaceCategory"},{name:"MarketplaceListing"},{name:"MentionedEvent"},{name:"MergedEvent"},{name:"Milestone"},{name:"MilestonedEvent"},{name:"MovedColumnsInProjectEvent"},{name:"Organization"},{name:"OrganizationIdentityProvider"},{name:"OrganizationInvitation"},{name:"PinnedEvent"},{name:"Project"},{name:"ProjectCard"},{name:"ProjectColumn"},{name:"PublicKey"},{name:"PullRequest"},{name:"PullRequestCommit"},{name:"PullRequestCommitCommentThread"},{name:"PullRequestReview"},{name:"PullRequestReviewComment"},{name:"PullRequestReviewThread"},{name:"PushAllowance"},{name:"Reaction"},{name:"ReadyForReviewEvent"},{name:"Ref"},{name:"ReferencedEvent"},{name:"RegistryPackage"},{name:"RegistryPackageDependency"},{name:"RegistryPackageFile"},{name:"RegistryPackageTag"},{name:"RegistryPackageVersion"},{name:"Release"},{name:"ReleaseAsset"},{name:"RemovedFromProjectEvent"},{name:"RenamedTitleEvent"},{name:"ReopenedEvent"},{name:"Repository"},{name:"RepositoryInvitation"},{name:"RepositoryTopic"},{name:"ReviewDismissalAllowance"},{name:"ReviewDismissedEvent"},{name:"ReviewRequest"},{name:"ReviewRequestRemovedEvent"},{name:"ReviewRequestedEvent"},{name:"SavedReply"},{name:"SecurityAdvisory"},{name:"SponsorsListing"},{name:"Sponsorship"},{name:"Status"},{name:"StatusContext"},{name:"SubscribedEvent"},{name:"Tag"},{name:"Team"},{name:"Topic"},{name:"TransferredEvent"},{name:"Tree"},{name:"UnassignedEvent"},{name:"UnlabeledEvent"},{name:"UnlockedEvent"},{name:"UnpinnedEvent"},{name:"UnsubscribedEvent"},{name:"User"},{name:"UserBlockedEvent"},{name:"UserContentEdit"},{name:"UserStatus"}]},{kind:"INTERFACE",name:"UniformResourceLocatable",possibleTypes:[{name:"Bot"},{name:"ClosedEvent"},{name:"Commit"},{name:"CrossReferencedEvent"},{name:"Gist"},{name:"Issue"},{name:"Mannequin"},{name:"MergedEvent"},{name:"Milestone"},{name:"Organization"},{name:"PullRequest"},{name:"PullRequestCommit"},{name:"ReadyForReviewEvent"},{name:"Release"},{name:"Repository"},{name:"RepositoryTopic"},{name:"ReviewDismissedEvent"},{name:"User"}]},{kind:"INTERFACE",name:"Actor",possibleTypes:[{name:"Bot"},{name:"Mannequin"},{name:"Organization"},{name:"User"}]},{kind:"INTERFACE",name:"RegistryPackageOwner",possibleTypes:[{name:"Organization"},{name:"Repository"},{name:"User"}]},{kind:"INTERFACE",name:"ProjectOwner",possibleTypes:[{name:"Organization"},{name:"Repository"},{name:"User"}]},{kind:"INTERFACE",name:"Closable",possibleTypes:[{name:"Issue"},{name:"Milestone"},{name:"Project"},{name:"PullRequest"}]},{kind:"INTERFACE",name:"Updatable",possibleTypes:[{name:"CommitComment"},{name:"GistComment"},{name:"Issue"},{name:"IssueComment"},{name:"Project"},{name:"PullRequest"},{name:"PullRequestReview"},{name:"PullRequestReviewComment"}]},{kind:"UNION",name:"ProjectCardItem",possibleTypes:[{name:"Issue"},{name:"PullRequest"}]},{kind:"INTERFACE",name:"Assignable",possibleTypes:[{name:"Issue"},{name:"PullRequest"}]},{kind:"INTERFACE",name:"Comment",possibleTypes:[{name:"CommitComment"},{name:"GistComment"},{name:"Issue"},{name:"IssueComment"},{name:"PullRequest"},{name:"PullRequestReview"},{name:"PullRequestReviewComment"}]},{kind:"INTERFACE",name:"UpdatableComment",possibleTypes:[{name:"CommitComment"},{name:"GistComment"},{name:"Issue"},{name:"IssueComment"},{name:"PullRequest"},{name:"PullRequestReview"},{name:"PullRequestReviewComment"}]},{kind:"INTERFACE",name:"Labelable",possibleTypes:[{name:"Issue"},{name:"PullRequest"}]},{kind:"INTERFACE",name:"Lockable",possibleTypes:[{name:"Issue"},{name:"PullRequest"}]},{kind:"INTERFACE",name:"RegistryPackageSearch",possibleTypes:[{name:"Organization"},{name:"User"}]},{kind:"INTERFACE",name:"RepositoryOwner",possibleTypes:[{name:"Organization"},{name:"User"}]},{kind:"INTERFACE",name:"MemberStatusable",possibleTypes:[{name:"Organization"},{name:"Team"}]},{kind:"INTERFACE",name:"ProfileOwner",possibleTypes:[{name:"Organization"},{name:"User"}]},{kind:"UNION",name:"PinnableItem",possibleTypes:[{name:"Gist"},{name:"Repository"}]},{kind:"INTERFACE",name:"Starrable",possibleTypes:[{name:"Gist"},{name:"Repository"},{name:"Topic"}]},{kind:"INTERFACE",name:"RepositoryInfo",possibleTypes:[{name:"Repository"}]},{kind:"INTERFACE",name:"GitObject",possibleTypes:[{name:"Blob"},{name:"Commit"},{name:"Tag"},{name:"Tree"}]},{kind:"INTERFACE",name:"RepositoryNode",possibleTypes:[{name:"CommitComment"},{name:"CommitCommentThread"},{name:"Issue"},{name:"IssueComment"},{name:"PullRequest"},{name:"PullRequestCommitCommentThread"},{name:"PullRequestReview"},{name:"PullRequestReviewComment"}]},{kind:"INTERFACE",name:"Subscribable",possibleTypes:[{name:"Commit"},{name:"Issue"},{name:"PullRequest"},{name:"Repository"},{name:"Team"}]},{kind:"INTERFACE",name:"Deletable",possibleTypes:[{name:"CommitComment"},{name:"GistComment"},{name:"IssueComment"},{name:"PullRequestReview"},{name:"PullRequestReviewComment"}]},{kind:"INTERFACE",name:"Reactable",possibleTypes:[{name:"CommitComment"},{name:"Issue"},{name:"IssueComment"},{name:"PullRequest"},{name:"PullRequestReview"},{name:"PullRequestReviewComment"}]},{kind:"INTERFACE",name:"GitSignature",possibleTypes:[{name:"GpgSignature"},{name:"SmimeSignature"},{name:"UnknownSignature"}]},{kind:"UNION",name:"RequestedReviewer",possibleTypes:[{name:"User"},{name:"Team"},{name:"Mannequin"}]},{kind:"UNION",name:"PullRequestTimelineItem",possibleTypes:[{name:"Commit"},{name:"CommitCommentThread"},{name:"PullRequestReview"},{name:"PullRequestReviewThread"},{name:"PullRequestReviewComment"},{name:"IssueComment"},{name:"ClosedEvent"},{name:"ReopenedEvent"},{name:"SubscribedEvent"},{name:"UnsubscribedEvent"},{name:"MergedEvent"},{name:"ReferencedEvent"},{name:"CrossReferencedEvent"},{name:"AssignedEvent"},{name:"UnassignedEvent"},{name:"LabeledEvent"},{name:"UnlabeledEvent"},{name:"MilestonedEvent"},{name:"DemilestonedEvent"},{name:"RenamedTitleEvent"},{name:"LockedEvent"},{name:"UnlockedEvent"},{name:"DeployedEvent"},{name:"DeploymentEnvironmentChangedEvent"},{name:"HeadRefDeletedEvent"},{name:"HeadRefRestoredEvent"},{name:"HeadRefForcePushedEvent"},{name:"BaseRefForcePushedEvent"},{name:"ReviewRequestedEvent"},{name:"ReviewRequestRemovedEvent"},{name:"ReviewDismissedEvent"},{name:"UserBlockedEvent"}]},{kind:"UNION",name:"Closer",possibleTypes:[{name:"Commit"},{name:"PullRequest"}]},{kind:"UNION",name:"ReferencedSubject",possibleTypes:[{name:"Issue"},{name:"PullRequest"}]},{kind:"UNION",name:"Assignee",possibleTypes:[{name:"Bot"},{name:"Mannequin"},{name:"Organization"},{name:"User"}]},{kind:"UNION",name:"MilestoneItem",possibleTypes:[{name:"Issue"},{name:"PullRequest"}]},{kind:"UNION",name:"RenamedTitleSubject",possibleTypes:[{name:"Issue"},{name:"PullRequest"}]},{kind:"UNION",name:"PullRequestTimelineItems",possibleTypes:[{name:"PullRequestCommit"},{name:"PullRequestCommitCommentThread"},{name:"PullRequestReview"},{name:"PullRequestReviewThread"},{name:"PullRequestRevisionMarker"},{name:"BaseRefChangedEvent"},{name:"BaseRefForcePushedEvent"},{name:"DeployedEvent"},{name:"DeploymentEnvironmentChangedEvent"},{name:"HeadRefDeletedEvent"},{name:"HeadRefForcePushedEvent"},{name:"HeadRefRestoredEvent"},{name:"MergedEvent"},{name:"ReviewDismissedEvent"},{name:"ReviewRequestedEvent"},{name:"ReviewRequestRemovedEvent"},{name:"ReadyForReviewEvent"},{name:"IssueComment"},{name:"CrossReferencedEvent"},{name:"AddedToProjectEvent"},{name:"AssignedEvent"},{name:"ClosedEvent"},{name:"CommentDeletedEvent"},{name:"ConvertedNoteToIssueEvent"},{name:"DemilestonedEvent"},{name:"LabeledEvent"},{name:"LockedEvent"},{name:"MentionedEvent"},{name:"MilestonedEvent"},{name:"MovedColumnsInProjectEvent"},{name:"PinnedEvent"},{name:"ReferencedEvent"},{name:"RemovedFromProjectEvent"},{name:"RenamedTitleEvent"},{name:"ReopenedEvent"},{name:"SubscribedEvent"},{name:"TransferredEvent"},{name:"UnassignedEvent"},{name:"UnlabeledEvent"},{name:"UnlockedEvent"},{name:"UserBlockedEvent"},{name:"UnpinnedEvent"},{name:"UnsubscribedEvent"}]},{kind:"UNION",name:"IssueOrPullRequest",possibleTypes:[{name:"Issue"},{name:"PullRequest"}]},{kind:"UNION",name:"IssueTimelineItem",possibleTypes:[{name:"Commit"},{name:"IssueComment"},{name:"CrossReferencedEvent"},{name:"ClosedEvent"},{name:"ReopenedEvent"},{name:"SubscribedEvent"},{name:"UnsubscribedEvent"},{name:"ReferencedEvent"},{name:"AssignedEvent"},{name:"UnassignedEvent"},{name:"LabeledEvent"},{name:"UnlabeledEvent"},{name:"UserBlockedEvent"},{name:"MilestonedEvent"},{name:"DemilestonedEvent"},{name:"RenamedTitleEvent"},{name:"LockedEvent"},{name:"UnlockedEvent"},{name:"TransferredEvent"}]},{kind:"UNION",name:"IssueTimelineItems",possibleTypes:[{name:"IssueComment"},{name:"CrossReferencedEvent"},{name:"AddedToProjectEvent"},{name:"AssignedEvent"},{name:"ClosedEvent"},{name:"CommentDeletedEvent"},{name:"ConvertedNoteToIssueEvent"},{name:"DemilestonedEvent"},{name:"LabeledEvent"},{name:"LockedEvent"},{name:"MentionedEvent"},{name:"MilestonedEvent"},{name:"MovedColumnsInProjectEvent"},{name:"PinnedEvent"},{name:"ReferencedEvent"},{name:"RemovedFromProjectEvent"},{name:"RenamedTitleEvent"},{name:"ReopenedEvent"},{name:"SubscribedEvent"},{name:"TransferredEvent"},{name:"UnassignedEvent"},{name:"UnlabeledEvent"},{name:"UnlockedEvent"},{name:"UserBlockedEvent"},{name:"UnpinnedEvent"},{name:"UnsubscribedEvent"}]},{kind:"UNION",name:"ReviewDismissalAllowanceActor",possibleTypes:[{name:"User"},{name:"Team"}]},{kind:"UNION",name:"PushAllowanceActor",possibleTypes:[{name:"User"},{name:"Team"}]},{kind:"UNION",name:"PermissionGranter",possibleTypes:[{name:"Organization"},{name:"Repository"},{name:"Team"}]},{kind:"INTERFACE",name:"Sponsorable",possibleTypes:[{name:"User"}]},{kind:"INTERFACE",name:"Contribution",possibleTypes:[{name:"CreatedCommitContribution"},{name:"CreatedIssueContribution"},{name:"CreatedPullRequestContribution"},{name:"CreatedPullRequestReviewContribution"},{name:"CreatedRepositoryContribution"},{name:"JoinedGitHubContribution"},{name:"RestrictedContribution"}]},{kind:"UNION",name:"CreatedRepositoryOrRestrictedContribution",possibleTypes:[{name:"CreatedRepositoryContribution"},{name:"RestrictedContribution"}]},{kind:"UNION",name:"CreatedIssueOrRestrictedContribution",possibleTypes:[{name:"CreatedIssueContribution"},{name:"RestrictedContribution"}]},{kind:"UNION",name:"CreatedPullRequestOrRestrictedContribution",possibleTypes:[{name:"CreatedPullRequestContribution"},{name:"RestrictedContribution"}]},{kind:"UNION",name:"SearchResultItem",possibleTypes:[{name:"Issue"},{name:"PullRequest"},{name:"Repository"},{name:"User"},{name:"Organization"},{name:"MarketplaceListing"},{name:"App"}]},{kind:"UNION",name:"CollectionItemContent",possibleTypes:[{name:"Repository"},{name:"Organization"},{name:"User"}]}]}}},function(e,t,n){var r=n(86),i=n(45),o=n(117);e.exports=function(e,t,n){var a=-1,s=(t=r(t,e)).length;for(s||(s=1,e=void 0);++a<s;){var u=null==e?void 0:e[o(t[a])];void 0===u&&(a=s,u=n),e=i(u)?u.call(e):u}return e}},function(e,t,n){var r=n(118),i=n(123),o=n(31),a=n(20),s=r((function(e,t){var n=a(t,o(s));return i(e,32,void 0,t,n)}));s.placeholder={},e.exports=s},function(e,t,n){var r=n(39);e.exports=function(e){return(null==e?0:e.length)?r(e,0,-1):[]}},function(e,t,n){e.exports=n(146).Observable},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.print=function(e){return(0,r.visit)(e,{leave:o})};var r=n(5),i=n(147);var o={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return s(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,n=e.name,r=c("(",s(e.variableDefinitions,", "),")"),i=s(e.directives," "),o=e.selectionSet;return n||i||r||"query"!==t?s([t,s([n,r]),i,o]," "):o},VariableDefinition:function(e){var t=e.variable,n=e.type,r=e.defaultValue,i=e.directives;return t+": "+n+c(" = ",r)+c(" ",s(i," "))},SelectionSet:function(e){return u(e.selections)},Field:function(e){var t=e.alias,n=e.name,r=e.arguments,i=e.directives,o=e.selectionSet,a=c("",t,": ")+n,u=a+c("(",s(r,", "),")");return u.length>80&&(u=a+c("(\n",l(s(r,"\n")),"\n)")),s([u,s(i," "),o]," ")},Argument:function(e){return e.name+": "+e.value},FragmentSpread:function(e){return"..."+e.name+c(" ",s(e.directives," "))},InlineFragment:function(e){var t=e.typeCondition,n=e.directives,r=e.selectionSet;return s(["...",c("on ",t),s(n," "),r]," ")},FragmentDefinition:function(e){var t=e.name,n=e.typeCondition,r=e.variableDefinitions,i=e.directives,o=e.selectionSet;return"fragment ".concat(t).concat(c("(",s(r,", "),")")," ")+"on ".concat(n," ").concat(c("",s(i," ")," "))+o},IntValue:function(e){return e.value},FloatValue:function(e){return e.value},StringValue:function(e,t){var n=e.value;return e.block?(0,i.printBlockString)(n,"description"===t?"":"  "):JSON.stringify(n)},BooleanValue:function(e){return e.value?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){return e.value},ListValue:function(e){return"["+s(e.values,", ")+"]"},ObjectValue:function(e){return"{"+s(e.fields,", ")+"}"},ObjectField:function(e){return e.name+": "+e.value},Directive:function(e){return"@"+e.name+c("(",s(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:a((function(e){var t=e.directives,n=e.operationTypes;return s(["schema",s(t," "),u(n)]," ")})),OperationTypeDefinition:function(e){return e.operation+": "+e.type},ScalarTypeDefinition:a((function(e){return s(["scalar",e.name,s(e.directives," ")]," ")})),ObjectTypeDefinition:a((function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return s(["type",t,c("implements ",s(n," & ")),s(r," "),u(i)]," ")})),FieldDefinition:a((function(e){var t=e.name,n=e.arguments,r=e.type,i=e.directives;return t+(f(n)?c("(\n",l(s(n,"\n")),"\n)"):c("(",s(n,", "),")"))+": "+r+c(" ",s(i," "))})),InputValueDefinition:a((function(e){var t=e.name,n=e.type,r=e.defaultValue,i=e.directives;return s([t+": "+n,c("= ",r),s(i," ")]," ")})),InterfaceTypeDefinition:a((function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return s(["interface",t,c("implements ",s(n," & ")),s(r," "),u(i)]," ")})),UnionTypeDefinition:a((function(e){var t=e.name,n=e.directives,r=e.types;return s(["union",t,s(n," "),r&&0!==r.length?"= "+s(r," | "):""]," ")})),EnumTypeDefinition:a((function(e){var t=e.name,n=e.directives,r=e.values;return s(["enum",t,s(n," "),u(r)]," ")})),EnumValueDefinition:a((function(e){return s([e.name,s(e.directives," ")]," ")})),InputObjectTypeDefinition:a((function(e){var t=e.name,n=e.directives,r=e.fields;return s(["input",t,s(n," "),u(r)]," ")})),DirectiveDefinition:a((function(e){var t=e.name,n=e.arguments,r=e.repeatable,i=e.locations;return"directive @"+t+(f(n)?c("(\n",l(s(n,"\n")),"\n)"):c("(",s(n,", "),")"))+(r?" repeatable":"")+" on "+s(i," | ")})),SchemaExtension:function(e){var t=e.directives,n=e.operationTypes;return s(["extend schema",s(t," "),u(n)]," ")},ScalarTypeExtension:function(e){return s(["extend scalar",e.name,s(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return s(["extend type",t,c("implements ",s(n," & ")),s(r," "),u(i)]," ")},InterfaceTypeExtension:function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return s(["extend interface",t,c("implements ",s(n," & ")),s(r," "),u(i)]," ")},UnionTypeExtension:function(e){var t=e.name,n=e.directives,r=e.types;return s(["extend union",t,s(n," "),r&&0!==r.length?"= "+s(r," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,n=e.directives,r=e.values;return s(["extend enum",t,s(n," "),u(r)]," ")},InputObjectTypeExtension:function(e){var t=e.name,n=e.directives,r=e.fields;return s(["extend input",t,s(n," "),u(r)]," ")}};function a(e){return function(t){return s([t.description,e(t)],"\n")}}function s(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null!==(t=null==e?void 0:e.filter((function(e){return e})).join(n))&&void 0!==t?t:""}function u(e){return c("{\n",l(s(e,"\n")),"\n}")}function c(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return null!=t&&""!==t?e+t+n:""}function l(e){return c("  ",e.replace(/\n/g,"\n  "))}function h(e){return-1!==e.indexOf("\n")}function f(e){return null!=e&&e.some(h)}},function(e,t,n){"use strict";(function(e,r){var i,o=n(69);i="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:r;var a=Object(o.a)(i);t.a=a}).call(this,n(35),n(148)(e))},function(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}n.d(t,"a",(function(){return r}))},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(this,n(35))},function(e,t){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}},function(e,t,n){var r=n(23),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}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t){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}},function(e,t){e.exports=function(e){return e!=e}},function(e,t){e.exports=function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}},function(e,t){e.exports=function(e){return e.split("")}},function(e,t){var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return n.test(e)}},function(e,t){var n="[\\ud800-\\udfff]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",i="\\ud83c[\\udffb-\\udfff]",o="[^\\ud800-\\udfff]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",u="(?:"+r+"|"+i+")"+"?",c="[\\ufe0e\\ufe0f]?"+u+("(?:\\u200d(?:"+[o,a,s].join("|")+")[\\ufe0e\\ufe0f]?"+u+")*"),l="(?:"+[o+r+"?",r,a,s,n].join("|")+")",h=RegExp(i+"(?="+i+")|"+l+c,"g");e.exports=function(e){return e.match(h)||[]}},function(e,t){var n=/\s/;e.exports=function(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}},function(e,t,n){var r=n(24);e.exports=function(e,t){for(var n=e.length;n--&&r(t,e[n],0)>-1;);return n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return a(e,[])};var r,i=(r=n(44))&&r.__esModule?r:{default:r};function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){switch(o(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var n=[].concat(t,[e]),r=function(e){var t=e[String(i.default)];if("function"==typeof t)return t;if("function"==typeof e.inspect)return e.inspect}(e);if(void 0!==r){var o=r.call(e);if(o!==e)return"string"==typeof o?o:a(o,n)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var n=Math.min(10,e.length),r=e.length-n,i=[],o=0;o<n;++o)i.push(a(e[o],t));1===r?i.push("... 1 more item"):r>1&&i.push("... ".concat(r," more items"));return"["+i.join(", ")+"]"}(e,n);return function(e,t){var n=Object.keys(e);if(0===n.length)return"{}";if(t.length>2)return"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var n=e.constructor.name;if("string"==typeof n&&""!==n)return n}return t}(e)+"]";return"{ "+n.map((function(n){return n+": "+a(e[n],t)})).join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNode=function(e){return null!=e&&"string"==typeof e.kind},t.Token=t.Location=void 0;var r,i=(r=n(84))&&r.__esModule?r:{default:r};var o=function(){function e(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();t.Location=o,(0,i.default)(o);var a=function(){function e(e,t,n,r,i,o,a){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=a,this.prev=o,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();t.Token=a,(0,i.default)(a)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.prototype.toJSON;"function"==typeof t||(0,r.default)(0),e.prototype.inspect=t,i.default&&(e.prototype[i.default]=t)};var r=o(n(85)),i=o(n(44));function o(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}},function(e,t,n){var r=n(13),i=n(87),o=n(88),a=n(25);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(a(e))}},function(e,t,n){var r=n(13),i=n(14),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))}},function(e,t,n){var r=n(89),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},function(e,t,n){var r=n(90);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},function(e,t,n){var r=n(91);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},function(e,t,n){var r=n(92),i=n(112),o=n(114),a=n(115),s=n(116);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},function(e,t,n){var r=n(93),i=n(104),o=n(111);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},function(e,t,n){var r=n(94),i=n(100),o=n(101),a=n(102),s=n(103);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},function(e,t,n){var r=n(15);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(e,t,n){var r=n(45),i=n(96),o=n(10),a=n(98),s=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,l=u.toString,h=c.hasOwnProperty,f=RegExp("^"+l.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?f:s).test(a(e))}},function(e,t,n){var r,i=n(97),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},function(e,t,n){var r=n(7)["__core-js_shared__"];e.exports=r},function(e,t){var n=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},function(e,t,n){var r=n(15),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}},function(e,t,n){var r=n(15),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},function(e,t,n){var r=n(15);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}},function(e,t,n){var r=n(105),i=n(106),o=n(108),a=n(109),s=n(110);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},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,n){var r=n(17),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)}},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(17);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},function(e,t,n){var r=n(17);e.exports=function(e){return r(this.__data__,e)>-1}},function(e,t,n){var r=n(17);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}},function(e,t,n){var r=n(16)(n(7),"Map");e.exports=r},function(e,t,n){var r=n(18);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},function(e,t){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},function(e,t,n){var r=n(18);e.exports=function(e){return r(this,e).get(e)}},function(e,t,n){var r=n(18);e.exports=function(e){return r(this,e).has(e)}},function(e,t,n){var r=n(18);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}},function(e,t,n){var r=n(14);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},function(e,t,n){var r=n(26),i=n(119),o=n(46);e.exports=function(e,t){return o(i(e,t,r),e+"")}},function(e,t,n){var r=n(27),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)}}},function(e,t,n){var r=n(121),i=n(122),o=n(26),a=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:o;e.exports=a},function(e,t){e.exports=function(e){return function(){return e}}},function(e,t,n){var r=n(16),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},function(e,t,n){var r=n(48),i=n(125),o=n(126),a=n(50),s=n(141),u=n(54),c=n(142),l=n(57),h=n(58),f=n(143),p=Math.max;e.exports=function(e,t,n,d,m,v,y,b){var g=2&t;if(!g&&"function"!=typeof e)throw new TypeError("Expected a function");var w=d?d.length:0;if(w||(t&=-97,d=m=void 0),y=void 0===y?y:p(f(y),0),b=void 0===b?b:f(b),w-=m?m.length:0,64&t){var O=d,R=m;d=m=void 0}var E=g?void 0:u(e),k=[e,t,n,d,m,O,R,v,y,b];if(E&&c(k,E),e=k[0],t=k[1],n=k[2],d=k[3],m=k[4],!(b=k[9]=void 0===k[9]?g?0:e.length:p(k[9]-w,0))&&24&t&&(t&=-25),t&&1!=t)x=8==t||16==t?o(e,t,b):32!=t&&33!=t||m.length?a.apply(void 0,k):s(e,t,n,d);else var x=i(e,t,n);return h((E?r:l)(x,k),e,t)}},function(e,t,n){var r=n(16)(n(7),"WeakMap");e.exports=r},function(e,t,n){var r=n(19),i=n(7);e.exports=function(e,t,n){var o=1&t,a=r(e);return function t(){var r=this&&this!==i&&this instanceof t?a:e;return r.apply(o?n:this,arguments)}}},function(e,t,n){var r=n(27),i=n(19),o=n(50),a=n(53),s=n(31),u=n(20),c=n(7);e.exports=function(e,t,n){var l=i(e);return function i(){for(var h=arguments.length,f=Array(h),p=h,d=s(i);p--;)f[p]=arguments[p];var m=h<3&&f[0]!==d&&f[h-1]!==d?[]:u(f,d);if((h-=m.length)<n)return a(e,t,o,i.placeholder,void 0,f,m,void 0,void 0,n-h);var v=this&&this!==c&&this instanceof i?l:e;return r(v,this,f)}}},function(e,t){e.exports=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}},function(e,t,n){var r=n(29),i=n(54),o=n(130),a=n(132);e.exports=function(e){var t=o(e),n=a[t];if("function"!=typeof n||!(t in r.prototype))return!1;if(e===n)return!0;var s=i(n);return!!s&&e===s[0]}},function(e,t){e.exports=function(){}},function(e,t,n){var r=n(131),i=Object.prototype.hasOwnProperty;e.exports=function(e){for(var t=e.name+"",n=r[t],o=i.call(r,t)?n.length:0;o--;){var a=n[o],s=a.func;if(null==s||s==e)return a.name}return t}},function(e,t){e.exports={}},function(e,t,n){var r=n(29),i=n(55),o=n(30),a=n(13),s=n(37),u=n(133),c=Object.prototype.hasOwnProperty;function l(e){if(s(e)&&!a(e)&&!(e instanceof r)){if(e instanceof i)return e;if(c.call(e,"__wrapped__"))return u(e)}return new i(e)}l.prototype=o.prototype,l.prototype.constructor=l,e.exports=l},function(e,t,n){var r=n(29),i=n(55),o=n(56);e.exports=function(e){if(e instanceof r)return e.clone();var t=new i(e.__wrapped__,e.__chain__);return t.__actions__=o(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}},function(e,t){var n=/\{\n\/\* \[wrapped with (.+)\] \*/,r=/,? & /;e.exports=function(e){var t=e.match(n);return t?t[1].split(r):[]}},function(e,t){var n=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;e.exports=function(e,t){var r=t.length;if(!r)return e;var i=r-1;return t[i]=(r>1?"& ":"")+t[i],t=t.join(r>2?", ":" "),e.replace(n,"{\n/* [wrapped with "+t+"] */\n")}},function(e,t,n){var r=n(137),i=n(138),o=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];e.exports=function(e,t){return r(o,(function(n){var r="_."+n[0];t&n[1]&&!i(e,r)&&e.push(r)})),e.sort()}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}},function(e,t,n){var r=n(24);e.exports=function(e,t){return!!(null==e?0:e.length)&&r(e,t,0)>-1}},function(e,t,n){var r=n(56),i=n(140),o=Math.min;e.exports=function(e,t){for(var n=e.length,a=o(t.length,n),s=r(e);a--;){var u=t[a];e[a]=i(u,n)?s[u]:void 0}return e}},function(e,t){var n=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&e<t}},function(e,t,n){var r=n(27),i=n(19),o=n(7);e.exports=function(e,t,n,a){var s=1&t,u=i(e);return function t(){for(var i=-1,c=arguments.length,l=-1,h=a.length,f=Array(h+c),p=this&&this!==o&&this instanceof t?u:e;++l<h;)f[l]=a[l];for(;c--;)f[l++]=arguments[++i];return r(p,s?n:this,f)}}},function(e,t,n){var r=n(51),i=n(52),o=n(20),a=Math.min;e.exports=function(e,t){var n=e[1],s=t[1],u=n|s,c=u<131,l=128==s&&8==n||128==s&&256==n&&e[7].length<=t[8]||384==s&&t[7].length<=t[8]&&8==n;if(!c&&!l)return e;1&s&&(e[2]=t[2],u|=1&n?0:4);var h=t[3];if(h){var f=e[3];e[3]=f?r(f,h,t[4]):h,e[4]=f?o(e[3],"__lodash_placeholder__"):t[4]}return(h=t[5])&&(f=e[5],e[5]=f?i(f,h,t[6]):h,e[6]=f?o(e[5],"__lodash_placeholder__"):t[6]),(h=t[7])&&(e[7]=h),128&s&&(e[8]=null==e[8]?t[8]:a(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=u,e}},function(e,t,n){var r=n(144);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},function(e,t,n){var r=n(145);e.exports=function(e){return e?(e=r(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},function(e,t,n){var r=n(42),i=n(10),o=n(14),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}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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 o(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}Object.defineProperty(t,"__esModule",{value:!0}),t.Observable=void 0;var a=function(){return"function"==typeof Symbol},s=function(e){return a()&&Boolean(Symbol[e])},u=function(e){return s(e)?Symbol[e]:"@@"+e};a()&&!s("observable")&&(Symbol.observable=Symbol("observable"));var c=u("iterator"),l=u("observable"),h=u("species");function f(e,t){var n=e[t];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function p(e){var t=e.constructor;return void 0!==t&&null===(t=t[h])&&(t=void 0),void 0!==t?t:E}function d(e){return e instanceof E}function m(e){m.log?m.log(e):setTimeout((function(){throw e}))}function v(e){Promise.resolve().then((function(){try{e()}catch(e){m(e)}}))}function y(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var n=f(t,"unsubscribe");n&&n.call(t)}}catch(e){m(e)}}function b(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function g(e,t,n){e._state="running";var r=e._observer;try{var i=f(r,t);switch(t){case"next":i&&i.call(r,n);break;case"error":if(b(e),!i)throw n;i.call(r,n);break;case"complete":b(e),i&&i.call(r)}}catch(e){m(e)}"closed"===e._state?y(e):"running"===e._state&&(e._state="ready")}function w(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 v((function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var n=0;n<t.length&&(g(e,t[n].type,t[n].value),"closed"!==e._state);++n);}}(e)}))):void g(e,t,n);e._queue.push({type:t,value:n})}}var O=function(){function e(t,n){r(this,e),this._cleanup=void 0,this._observer=t,this._queue=void 0,this._state="initializing";var i=new R(this);try{this._cleanup=n.call(void 0,i)}catch(e){i.error(e)}"initializing"===this._state&&(this._state="ready")}return o(e,[{key:"unsubscribe",value:function(){"closed"!==this._state&&(b(this),y(this))}},{key:"closed",get:function(){return"closed"===this._state}}]),e}(),R=function(){function e(t){r(this,e),this._subscription=t}return o(e,[{key:"next",value:function(e){w(this._subscription,"next",e)}},{key:"error",value:function(e){w(this._subscription,"error",e)}},{key:"complete",value:function(){w(this._subscription,"complete")}},{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),E=function(){function e(t){if(r(this,e),!(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}return o(e,[{key:"subscribe",value:function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new O(e,this._subscriber)}},{key:"forEach",value: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()}}))}},{key:"map",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(p(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()}})}))}},{key:"filter",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(p(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()}})}))}},{key:"reduce",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=p(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()}})}))}},{key:"concat",value:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=p(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)}}))}},{key:"flatMap",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=p(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()}}))}},{key:l,value:function(){return this}}],[{key:"from",value:function(t){var n="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var r=f(t,l);if(r){var i=r.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return d(i)&&i.constructor===n?i:new n((function(e){return i.subscribe(e)}))}if(s("iterator")&&(r=f(t,c)))return new n((function(e){v((function(){if(!e.closed){var n=!0,i=!1,o=void 0;try{for(var a,s=r.call(t)[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value;if(e.next(u),e.closed)return}}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}e.complete()}}))}));if(Array.isArray(t))return new n((function(e){v((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")}},{key:"of",value: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){v((function(){if(!e.closed){for(var t=0;t<n.length;++t)if(e.next(n[t]),e.closed)return;e.complete()}}))}))}},{key:h,get:function(){return this}}]),e}();t.Observable=E,a()&&Object.defineProperty(E,Symbol("extensions"),{value:{symbol:l,hostReportError:m},configurable:!0})},function(e,t,n){"use strict";function r(e){for(var t=0;t<e.length;++t)if(" "!==e[t]&&"\t"!==e[t])return!1;return!0}function i(e){for(var t,n=!0,r=!0,i=0,o=null,a=0;a<e.length;++a)switch(e.charCodeAt(a)){case 13:10===e.charCodeAt(a+1)&&++a;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}Object.defineProperty(t,"__esModule",{value:!0}),t.dedentBlockStringValue=function(e){var t=e.split(/\r\n|[\n\r]/g),n=i(e);if(0!==n)for(var o=1;o<t.length;o++)t[o]=t[o].slice(n);var a=0;for(;a<t.length&&r(t[a]);)++a;var s=t.length;for(;s>a&&r(t[s-1]);)--s;return t.slice(a,s).join("\n")},t.getBlockStringIndentation=i,t.printBlockString=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=-1===e.indexOf("\n"),i=" "===e[0]||"\t"===e[0],o='"'===e[e.length-1],a="\\"===e[e.length-1],s=!r||o||a||n,u="";!s||r&&i||(u+="\n"+t);u+=t?e.replace(/\n/g,"\n"+t):e,s&&(u+="\n");return'"""'+u.replace(/"""/g,'\\"""')+'"""'}},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,n){"use strict";n.r(t),n.d(t,"NetlifyCmsBackendGithub",(function(){return Wi})),n.d(t,"GitHubBackend",(function(){return Hi})),n.d(t,"API",(function(){return ht})),n.d(t,"AuthenticationPage",(function(){return ce}));var r,i,o=n(9),a=n.n(o),s=n(11),u=n.n(s),c=n(8),l=n.n(c),h=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),f=(r=["",""],i=["",""],Object.freeze(Object.defineProperties(r,{raw:{value:Object.freeze(i)}})));function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var d=function(){function e(){for(var t=this,n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return p(this,e),this.tag=function(e){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return"function"==typeof e?t.interimTag.bind(t,e):"string"==typeof e?t.transformEndResult(e):(e=e.map(t.transformString.bind(t)),t.transformEndResult(e.reduce(t.processSubstitutions.bind(t,r))))},r.length>0&&Array.isArray(r[0])&&(r=r[0]),this.transformers=r.map((function(e){return"function"==typeof e?e():e})),this.tag}return h(e,[{key:"interimTag",value:function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return this.tag(f,e.apply(void 0,[t].concat(r)))}},{key:"processSubstitutions",value:function(e,t,n){var r=this.transformSubstitution(e.shift(),t);return"".concat(t,r,n)}},{key:"transformString",value:function(e){return this.transformers.reduce((function(e,t){return t.onString?t.onString(e):e}),e)}},{key:"transformSubstitution",value:function(e,t){return this.transformers.reduce((function(e,n){return n.onSubstitution?n.onSubstitution(e,t):e}),e)}},{key:"transformEndResult",value:function(e){return this.transformers.reduce((function(e,t){return t.onEndResult?t.onEndResult(e):e}),e)}}]),e}(),m=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{onEndResult:function(t){if(""===e)return t.trim();if("start"===(e=e.toLowerCase())||"left"===e)return t.replace(/^\s*/,"");if("end"===e||"right"===e)return t.replace(/\s*$/,"");throw new Error("Side not supported: "+e)}}};function v(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"initial";return{onEndResult:function(t){if("initial"===e){var n=t.match(/^[^\S\n]*(?=\S)/gm),r=n&&Math.min.apply(Math,v(n.map((function(e){return e.length}))));if(r){var i=new RegExp("^.{"+r+"}","gm");return t.replace(i,"")}return t}if("all"===e)return t.replace(/^[^\S\n]+/gm,"");throw new Error("Unknown type: "+e)}}},b=function(e,t){return{onEndResult:function(n){if(null==e||null==t)throw new Error("replaceResultTransformer requires at least 2 arguments.");return n.replace(e,t)}}},g=function(e,t){return{onSubstitution:function(n,r){if(null==e||null==t)throw new Error("replaceSubstitutionTransformer requires at least 2 arguments.");return null==n?n:n.toString().replace(e,t)}}},w={separator:"",conjunction:"",serial:!1},O=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:w;return{onSubstitution:function(t,n){if(Array.isArray(t)){var r=t.length,i=e.separator,o=e.conjunction,a=e.serial,s=n.match(/(\n?[^\S\n]+)$/);if(t=s?t.join(i+s[1]):t.join(i+" "),o&&r>1){var u=t.lastIndexOf(i);t=t.slice(0,u)+(a?i:"")+" "+o+t.slice(u+1)}}return t}}},R=function(e){return{onSubstitution:function(t,n){if(null==e||"string"!=typeof e)throw new Error("You need to specify a string character to split by.");return"string"==typeof t&&t.includes(e)&&(t=t.split(e)),t}}},E=function(e){return null!=e&&!Number.isNaN(e)&&"boolean"!=typeof e},k=function(){return{onSubstitution:function(e){return Array.isArray(e)?e.filter(E):E(e)?e:""}}},x=(new d(O({separator:","}),y,m),new d(O({separator:",",conjunction:"and"}),y,m),new d(O({separator:",",conjunction:"or"}),y,m),new d(R("\n"),k,O,y,m),new d(R("\n"),O,y,m,g(/&/g,"&amp;"),g(/</g,"&lt;"),g(/>/g,"&gt;"),g(/"/g,"&quot;"),g(/'/g,"&#x27;"),g(/`/g,"&#x60;")),new d(b(/(?:\n(?:\s*))+/g," "),m)),S=(new d(b(/(?:\n\s*)/g,""),m),new d(O({separator:","}),b(/(?:\s+)/g," "),m),new d(O({separator:",",conjunction:"or"}),b(/(?:\s+)/g," "),m),new d(O({separator:",",conjunction:"and"}),b(/(?:\s+)/g," "),m),new d(O,y,m),new d(O,b(/(?:\s+)/g," "),m),new d(y,m)),_=(new d(y("all"),m),n(1)),j=n(59),P=n.n(j);var T=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}},I=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,C=T((function(e){return I.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),A=n(4);function N(e,t,n){var r="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]):r+=n+" "})),r}var q=function(e,t,n){var r=e.key+"-"+t.name;if(!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles),void 0===e.inserted[t.name]){var i=t;do{e.insert("."+r,i,e.sheet,!0);i=i.next}while(void 0!==i)}};var F=function(e){for(var t,n=0,r=0,i=e.length;i>=4;++r,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(i){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},D={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},M=/[A-Z]|^ms/g,L=/_EMO_([^_]+?)_([^]*?)_EMO_/g,U=function(e){return 45===e.charCodeAt(1)},B=function(e){return null!=e&&"boolean"!=typeof e},Q=T((function(e){return U(e)?e:e.replace(M,"-$&").toLowerCase()})),$=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(L,(function(e,t,n){return G={name:t,styles:n,next:G},t}))}return 1===D[e]||U(e)||"number"!=typeof t||0===t?t:t+"px"};function V(e,t,n,r){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return G={name:n.name,styles:n.styles,next:G},n.name;if(void 0!==n.styles){var i=n.next;if(void 0!==i)for(;void 0!==i;)G={name:i.name,styles:i.styles,next:G},i=i.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=V(e,t,n[i],!1);else for(var o in n){var a=n[o];if("object"!=typeof a)null!=t&&void 0!==t[a]?r+=o+"{"+t[a]+"}":B(a)&&(r+=Q(o)+":"+$(o,a)+";");else if(!Array.isArray(a)||"string"!=typeof a[0]||null!=t&&void 0!==t[a[0]]){var s=V(e,t,a,!1);switch(o){case"animation":case"animationName":r+=Q(o)+":"+s+";";break;default:r+=o+"{"+s+"}"}}else for(var u=0;u<a.length;u++)B(a[u])&&(r+=Q(o)+":"+$(o,a[u])+";")}return r}(e,t,n);case"function":if(void 0!==e){var o=G,a=n(e);return G=o,V(e,t,a,r)}break;case"string":}if(null==t)return n;var s=t[n];return void 0===s||r?n:s}var G,z=/label:\s*([^\s;\n{]+)\s*;/g;var K=function(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var r=!0,i="";G=void 0;var o=e[0];null==o||void 0===o.raw?(r=!1,i+=V(n,t,o,!1)):i+=o[0];for(var a=1;a<e.length;a++)i+=V(n,t,e[a],46===i.charCodeAt(i.length-1)),r&&(i+=o[a]);z.lastIndex=0;for(var s,u="";null!==(s=z.exec(i));)u+="-"+s[1];return{name:F(i)+u,styles:i,next:G}},H=C,W=function(e){return"theme"!==e&&"innerRef"!==e},J=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?H:W};function Y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function X(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Y(n,!0).forEach((function(t){P()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Z=function e(t,n){var r,i,a;void 0!==n&&(r=n.label,a=n.target,i=t.__emotion_forwardProp&&n.shouldForwardProp?function(e){return t.__emotion_forwardProp(e)&&n.shouldForwardProp(e)}:n.shouldForwardProp);var s=t.__emotion_real===t,u=s&&t.__emotion_base||t;"function"!=typeof i&&s&&(i=t.__emotion_forwardProp);var c=i||J(u),l=!c("as");return function(){var h=arguments,f=s&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==r&&f.push("label:"+r+";"),null==h[0]||void 0===h[0].raw)f.push.apply(f,h);else{0,f.push(h[0][0]);for(var p=h.length,d=1;d<p;d++)f.push(h[d],h[0][d])}var m=Object(A.withEmotionCache)((function(e,t,n){return Object(o.createElement)(A.ThemeContext.Consumer,null,(function(r){var s=l&&e.as||u,h="",p=[],d=e;if(null==e.theme){for(var m in d={},e)d[m]=e[m];d.theme=r}"string"==typeof e.className?h=N(t.registered,p,e.className):null!=e.className&&(h=e.className+" ");var v=K(f.concat(p),t.registered,d);q(t,v,"string"==typeof s);h+=t.key+"-"+v.name,void 0!==a&&(h+=" "+a);var y=l&&void 0===i?J(s):c,b={};for(var g in e)l&&"as"===g||y(g)&&(b[g]=e[g]);return b.className=h,b.ref=n||e.innerRef,Object(o.createElement)(s,b)}))}));return m.displayName=void 0!==r?r:"Styled("+("string"==typeof u?u:u.displayName||u.name||"Component")+")",m.defaultProps=t.defaultProps,m.__emotion_real=m,m.__emotion_base=u,m.__emotion_styles=f,m.__emotion_forwardProp=i,Object.defineProperty(m,"toString",{value:function(){return"."+a}}),m.withComponent=function(t,r){return e(t,void 0!==r?X({},n||{},{},r):n).apply(void 0,f)},m}},ee=n(6),te=n.n(ee),ne=n(60),re=n(32);function ie(){return(ie=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function oe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ae=Z(re.Icon,{target:"e191r7590",label:"LoginButtonIcon"})({name:"x0sdsu",styles:"margin-right:18px;"}),se=Z("div",{target:"e191r7591",label:"ForkApprovalContainer"})({name:"1u9l27n",styles:"display:flex;flex-flow:column nowrap;justify-content:space-around;flex-grow:0.2;"}),ue=Z("div",{target:"e191r7592",label:"ForkButtonsContainer"})({name:"qh5xse",styles:"display:flex;flex-flow:row nowrap;justify-content:space-around;"});class ce extends a.a.Component{constructor(...e){super(...e),oe(this,"state",{}),oe(this,"getPermissionToFork",()=>new Promise((e,t)=>{this.setState({requestingFork:!0,approveFork:()=>{this.setState({requestingFork:!1}),e()},refuseFork:()=>{this.setState({requestingFork:!1}),t()}})})),oe(this,"handleLogin",e=>{e.preventDefault();const t={base_url:this.props.base_url,site_id:"localhost"===document.location.host.split(":")[0]?"cms.netlify.com":this.props.siteId,auth_endpoint:this.props.authEndpoint},n=new ne.NetlifyAuthenticator(t),{open_authoring:r=!1,auth_scope:i=""}=this.props.config.backend,o=i||(r?"public_repo":"repo");n.authenticate({provider:"github",scope:o},(e,t)=>{if(!e)return r?this.loginWithOpenAuthoring(t).then(()=>this.props.onLogin(t)):void this.props.onLogin(t);this.setState({loginError:e.toString()})})}),oe(this,"renderLoginButton",()=>{const{inProgress:e,t:t}=this.props;return e||this.state.findingFork?t("auth.loggingIn"):Object(A.jsx)(a.a.Fragment,null,Object(A.jsx)(ae,{type:"github"}),t("auth.loginWithGitHub"))})}loginWithOpenAuthoring(e){const{backend:t}=this.props;return this.setState({findingFork:!0}),t.authenticateWithFork({userData:e,getPermissionToFork:this.getPermissionToFork}).catch(e=>{throw this.setState({findingFork:!1}),console.error(e),e})}getAuthenticationPageRenderArgs(){const{requestingFork:e}=this.state;if(e){const{approveFork:e,refuseFork:t}=this.state;return{renderPageContent:({LoginButton:n})=>Object(A.jsx)(se,null,Object(A.jsx)("p",null,"Open Authoring is enabled: we need to use a fork on your github account. (If a fork already exists, we'll use that.)"),Object(A.jsx)(ue,null,Object(A.jsx)(n,{onClick:e},"Fork the repo"),Object(A.jsx)(n,{onClick:t},"Don't fork the repo")))}}return{renderButtonContent:this.renderLoginButton}}render(){const{inProgress:e,config:t,t:n}=this.props,{loginError:r,requestingFork:i,findingFork:o}=this.state;return Object(A.jsx)(re.AuthenticationPage,ie({onLogin:this.handleLogin,loginDisabled:e||o||i,loginErrorMessage:r,logoUrl:t.logo_url,siteUrl:t.site_url},this.getAuthenticationPageRenderArgs(),{t:n}))}}oe(ce,"propTypes",{onLogin:te.a.func.isRequired,inProgress:te.a.bool,base_url:te.a.string,siteId:te.a.string,authEndpoint:te.a.string,config:te.a.object.isRequired,clearHash:te.a.func,t:te.a.func.isRequired});var le=n(21),he=n.n(le),fe=n(63),pe=n.n(fe),de=n(64),me=n.n(de),ve=n(33),ye=n.n(ve),be=n(65),ge=n.n(be);const we="function"==typeof atob,Oe="function"==typeof btoa,Re="function"==typeof Buffer,Ee="function"==typeof TextDecoder?new TextDecoder:void 0,ke="function"==typeof TextEncoder?new TextEncoder:void 0,xe=[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],Se=(e=>{let t={};return e.forEach((e,n)=>t[e]=n),t})(xe),_e=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,je=String.fromCharCode.bind(String),Pe="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):(e,t=(e=>e))=>new Uint8Array(Array.prototype.slice.call(e,0).map(t)),Te=e=>e.replace(/[+\/]/g,e=>"+"==e?"-":"_").replace(/=+$/m,""),Ie=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),Ce=e=>{let t,n,r,i,o="";const a=e.length%3;for(let a=0;a<e.length;){if((n=e.charCodeAt(a++))>255||(r=e.charCodeAt(a++))>255||(i=e.charCodeAt(a++))>255)throw new TypeError("invalid character found");t=n<<16|r<<8|i,o+=xe[t>>18&63]+xe[t>>12&63]+xe[t>>6&63]+xe[63&t]}return a?o.slice(0,a-3)+"===".substring(a):o},Ae=Oe?e=>btoa(e):Re?e=>Buffer.from(e,"binary").toString("base64"):Ce,Ne=Re?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let n=0,r=e.length;n<r;n+=4096)t.push(je.apply(null,e.subarray(n,n+4096)));return Ae(t.join(""))},qe=(e,t=!1)=>t?Te(Ne(e)):Ne(e),Fe=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?je(192|t>>>6)+je(128|63&t):je(224|t>>>12&15)+je(128|t>>>6&63)+je(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return je(240|t>>>18&7)+je(128|t>>>12&63)+je(128|t>>>6&63)+je(128|63&t)},De=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Me=e=>e.replace(De,Fe),Le=Re?e=>Buffer.from(e,"utf8").toString("base64"):ke?e=>Ne(ke.encode(e)):e=>Ae(Me(e)),Ue=(e,t=!1)=>t?Te(Le(e)):Le(e),Be=e=>Ue(e,!0),Qe=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,$e=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return je(55296+(t>>>10))+je(56320+(1023&t));case 3:return je((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return je((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},Ve=e=>e.replace(Qe,$e),Ge=e=>{if(e=e.replace(/\s+/g,""),!_e.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,n,r,i="";for(let o=0;o<e.length;)t=Se[e.charAt(o++)]<<18|Se[e.charAt(o++)]<<12|(n=Se[e.charAt(o++)])<<6|(r=Se[e.charAt(o++)]),i+=64===n?je(t>>16&255):64===r?je(t>>16&255,t>>8&255):je(t>>16&255,t>>8&255,255&t);return i},ze=we?e=>atob(Ie(e)):Re?e=>Buffer.from(e,"base64").toString("binary"):Ge,Ke=Re?e=>Pe(Buffer.from(e,"base64")):e=>Pe(ze(e),e=>e.charCodeAt(0)),He=e=>Ke(Je(e)),We=Re?e=>Buffer.from(e,"base64").toString("utf8"):Ee?e=>Ee.decode(Ke(e)):e=>Ve(ze(e)),Je=e=>Ie(e.replace(/[-_]/g,e=>"-"==e?"+":"/")),Ye=e=>We(Je(e)),Xe=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),Ze=function(){const e=(e,t)=>Object.defineProperty(String.prototype,e,Xe(t));e("fromBase64",(function(){return Ye(this)})),e("toBase64",(function(e){return Ue(this,e)})),e("toBase64URI",(function(){return Ue(this,!0)})),e("toBase64URL",(function(){return Ue(this,!0)})),e("toUint8Array",(function(){return He(this)}))},et=function(){const e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,Xe(t));e("toBase64",(function(e){return qe(this,e)})),e("toBase64URI",(function(){return qe(this,!0)})),e("toBase64URL",(function(){return qe(this,!0)}))},tt={version:"3.6.1",VERSION:"3.6.1",atob:ze,atobPolyfill:Ge,btoa:Ae,btoaPolyfill:Ce,fromBase64:Ye,toBase64:Ue,encode:Ue,encodeURI:Be,encodeURL:Be,utob:Me,btou:Ve,decode:Ye,isValid:e=>{if("string"!=typeof e)return!1;const t=e.replace(/\s+/g,"").replace(/=+$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},fromUint8Array:qe,toUint8Array:He,extendString:Ze,extendUint8Array:et,extendBuiltins:()=>{Ze(),et()}};var nt=n(34);function rt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function it(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rt(Object(n),!0).forEach((function(t){ot(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ot(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var at;let st;function ut(e,t){return e.labels.some(e=>Object(_.isCMSLabel)(e.name,t))}function ct(e){return e.reduce((e,t)=>("removed"===t.status?e.push({sha:null,path:t.filename}):"renamed"===t.status?(e.push({sha:null,path:t.previous_filename}),e.push({sha:t.sha,path:t.filename})):e.push({sha:t.sha,path:t.filename}),e),[])}!function(e){e.Error="error",e.Failure="failure",e.Pending="pending",e.Success="success"}(at||(at={})),function(e){e.Open="open",e.Closed="closed",e.All="all"}(st||(st={}));let lt=!1;class ht{constructor(e){ot(this,"apiRoot",void 0),ot(this,"token",void 0),ot(this,"branch",void 0),ot(this,"useOpenAuthoring",void 0),ot(this,"repo",void 0),ot(this,"originRepo",void 0),ot(this,"repoOwner",void 0),ot(this,"repoName",void 0),ot(this,"originRepoOwner",void 0),ot(this,"originRepoName",void 0),ot(this,"repoURL",void 0),ot(this,"originRepoURL",void 0),ot(this,"mergeMethod",void 0),ot(this,"initialWorkflowStatus",void 0),ot(this,"cmsLabelPrefix",void 0),ot(this,"_userPromise",void 0),ot(this,"_metadataSemaphore",void 0),ot(this,"commitAuthor",void 0),ot(this,"filterOpenAuthoringBranches",async e=>{try{const t=await this.getBranchPullRequest(e),{state:n,merged_at:r}=t;return-1!==t.number&&n===st.Closed&&r?(await this.deleteBranch(e),{branch:e,filter:!1}):{branch:e,filter:!0}}catch(t){return{branch:e,filter:!1}}}),this.apiRoot=e.apiRoot||"https://api.github.com",this.token=e.token||"",this.branch=e.branch||"master",this.useOpenAuthoring=e.useOpenAuthoring,this.repo=e.repo||"",this.originRepo=e.originRepo||this.repo,this.repoURL="/repos/"+this.repo,this.originRepoURL="/repos/"+this.originRepo;const[t,n]=[this.repo.split("/"),this.originRepo.split("/")];this.repoOwner=t[0],this.repoName=t[1],this.originRepoOwner=n[0],this.originRepoName=n[1],this.mergeMethod=e.squashMerges?"squash":"merge",this.cmsLabelPrefix=e.cmsLabelPrefix,this.initialWorkflowStatus=e.initialWorkflowStatus}user(){return this._userPromise||(this._userPromise=this.getUser()),this._userPromise}getUser(){return this.request("/user")}async hasWriteAccess(){try{const e=await this.request(this.repoURL);return this.repoOwner=e.owner.login,e.permissions.push}catch(e){throw console.error("Problem fetching repo data from GitHub"),e}}reset(){}requestHeaders(e={}){const t=it({"Content-Type":"application/json; charset=utf-8"},e);return this.token?(t.Authorization="token "+this.token,Promise.resolve(t)):Promise.resolve(t)}parseJsonResponse(e){return e.json().then(t=>e.ok?t:Promise.reject(t))}urlFor(e,t){const n=[];if(t.params)for(const e in t.params)n.push(`${e}=${encodeURIComponent(t.params[e])}`);return n.length&&(e+="?"+n.join("&")),this.apiRoot+e}parseResponse(e){const t=e.headers.get("Content-Type");if(t&&t.match(/json/))return this.parseJsonResponse(e);return e.text().then(t=>e.ok?t:Promise.reject(t))}handleRequestError(e,t){throw new _.APIError(e.message,t,"GitHub")}buildRequest(e){return e}async request(e,t={},n=(e=>this.parseResponse(e))){t=it({cache:"no-cache"},t);const r=await this.requestHeaders(t.headers||{}),i=this.urlFor(e,t);let o=500;try{const e=_.unsentRequest.fromFetchArguments(i,it(it({},t),{},{headers:r})),a=await Object(_.requestWithBackoff)(this,e);o=a.status;return await n(a)}catch(e){return this.handleRequestError(e,o)}}nextUrlProcessor(){return e=>e}async requestAllPages(e,t={}){t=it({cache:"no-cache"},t);const n=await this.requestHeaders(t.headers||{}),r=this.urlFor(e,t),i=await Object(_.getAllResponses)(r,it(it({},t),{},{headers:n}),"next",this.nextUrlProcessor()),o=await Promise.all(i.map(e=>this.parseResponse(e)));return[].concat(...o)}generateContentKey(e,t){const n=Object(_.generateContentKey)(e,t);return this.useOpenAuthoring?`${this.repo}/${n}`:n}parseContentKey(e){return this.useOpenAuthoring?Object(_.parseContentKey)(e.substring(this.repo.length+1)):Object(_.parseContentKey)(e)}checkMetadataRef(){return this.request(this.repoURL+"/git/refs/meta/_netlify_cms").then(e=>e.object).catch(()=>this.uploadBlob({raw:"# Netlify CMS\n\nThis tree is used by the Netlify CMS to store metadata information for specific files and branches."}).then(e=>this.request(this.repoURL+"/git/trees",{method:"POST",body:JSON.stringify({tree:[{path:"README.md",mode:"100644",type:"blob",sha:e.sha}]})})).then(e=>this.commit("First Commit",e)).then(e=>this.createRef("meta","_netlify_cms",e.sha)).then(e=>e.object))}async storeMetadata(e,t){return this._metadataSemaphore||(this._metadataSemaphore=u()(1)),new Promise((n,r)=>{var i;return null===(i=this._metadataSemaphore)||void 0===i?void 0:i.take(async()=>{try{var i;const r=await this.checkMetadataRef(),o={path:e+".json",raw:JSON.stringify(t)};await this.uploadBlob(o);const a=await this.updateTree(r.sha,[o]),{sha:s}=await this.commit(`Updating “${e}” metadata`,a);await this.patchRef("meta","_netlify_cms",s),await _.localForage.setItem("gh.meta."+e,{expires:Date.now()+3e5,data:t}),null===(i=this._metadataSemaphore)||void 0===i||i.leave(),n()}catch(e){r(e)}})})}deleteMetadata(e){return this._metadataSemaphore||(this._metadataSemaphore=u()(1)),new Promise(t=>{var n;return null===(n=this._metadataSemaphore)||void 0===n?void 0:n.take(async()=>{try{var n;const r=await this.checkMetadataRef(),i={path:e+".json",sha:null},o=await this.updateTree(r.sha,[i]),{sha:a}=await this.commit(`Deleting “${e}” metadata`,o);await this.patchRef("meta","_netlify_cms",a),null===(n=this._metadataSemaphore)||void 0===n||n.leave(),t()}catch(e){var r;null===(r=this._metadataSemaphore)||void 0===r||r.leave(),t()}})})}async retrieveMetadataOld(e){console.log("%c Checking for MetaData files","line-height: 30px;text-align: center;font-weight: bold");const t={params:{ref:"refs/meta/_netlify_cms"},headers:{Accept:"application/vnd.github.v3.raw"}};function n(t){throw"Not Found"===t.message&&console.log("%c %s does not have metadata","line-height: 30px;text-align: center;font-weight: bold",e),t}if(!this.useOpenAuthoring){return await this.request(`${this.repoURL}/contents/${e}.json`,t).then(e=>JSON.parse(e)).catch(n)}const[r,i]=e.split("/");return this.request(`/repos/${r}/${i}/contents/${e}.json`,t).then(e=>JSON.parse(e)).catch(n)}async getPullRequests(e,t,n){return(await this.requestAllPages(this.originRepoURL+"/pulls",{params:it(it({},e?{head:await this.getHeadReference(e)}:{}),{},{base:this.branch,state:t,per_page:100})})).filter(e=>e.head.ref.startsWith(_.CMS_BRANCH_PREFIX+"/")&&n(e))}async getOpenAuthoringPullRequest(e,t){const n=await this.getBranch(e).catch(()=>{throw new _.EditorialWorkflowError("content is not under editorial workflow",!0)}),r=t.filter(e=>e.head.sha===n.commit.sha)[0];if(r){r.labels=r.labels.filter(e=>!Object(_.isCMSLabel)(e.name,this.cmsLabelPrefix));const e=r.state===st.Closed?{name:Object(_.statusToLabel)(this.initialWorkflowStatus,this.cmsLabelPrefix)}:{name:Object(_.statusToLabel)("pending_review",this.cmsLabelPrefix)};return r.labels.push(e),r}try{return{head:{sha:n.commit.sha},number:-1,labels:[{name:Object(_.statusToLabel)(this.initialWorkflowStatus,this.cmsLabelPrefix)}],state:st.Open}}catch(e){throw new _.EditorialWorkflowError("content is not under editorial workflow",!0)}}async getBranchPullRequest(e){if(this.useOpenAuthoring){const t=await this.getPullRequests(e,st.All,()=>!0);return this.getOpenAuthoringPullRequest(e,t)}{const t=await this.getPullRequests(e,st.Open,e=>ut(e,this.cmsLabelPrefix));if(t.length<=0)throw new _.EditorialWorkflowError("content is not under editorial workflow",!0);return t[0]}}async getPullRequestCommits(e){if(-1===e)return[];try{return await this.request(`${this.originRepoURL}/pulls/${e}/commits`)}catch(e){return console.log(e),[]}}async retrieveUnpublishedEntryData(e){const{collection:t,slug:n}=this.parseContentKey(e),r=Object(_.branchFromContentKey)(e),i=await this.getBranchPullRequest(r),{files:o}=await this.getDifferences(this.branch,i.head.sha),a=await Promise.all(o.map(e=>this.diffFromFile(e))),s=i.labels.find(e=>Object(_.isCMSLabel)(e.name,this.cmsLabelPrefix)),u=Object(_.labelToStatus)(s.name,this.cmsLabelPrefix),c=i.updated_at;return{collection:t,slug:n,status:u,diffs:a.map(e=>({path:e.path,newFile:e.newFile,id:e.sha})),updatedAt:c}}async readFile(e,t,{branch:n=this.branch,repoURL:r=this.repoURL,parseText:i=!0}={}){t||(t=await this.getFileSha(e,{repoURL:r,branch:n}));return await this.fetchBlobContent({sha:t,repoURL:r,parseText:i})}async readFileMetadata(e,t){return await Object(_.readFileMetadata)(t,async()=>{try{const t=await this.request(this.originRepoURL+"/commits",{params:{path:e,sha:this.branch}}),{commit:n}=t[0];return{author:n.author.name||n.author.email,updatedOn:n.author.date}}catch(e){return{author:"",updatedOn:""}}},_.localForage)}async fetchBlobContent({sha:e,repoURL:t,parseText:n}){const r=await this.request(`${t}/git/blobs/${e}`,{cache:"force-cache"});if(n){return tt.decode(r.content)}{const e=tt.atob(r.content),t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return new Blob([t])}}async listFiles(e,{repoURL:t=this.repoURL,branch:n=this.branch,depth:r=1}={}){const i=he()(e,"/");try{return(await this.request(`${t}/git/trees/${n}:${i}`,{params:r>1?{recursive:1}:{}})).tree.filter(e=>"blob"===e.type&&e.path.split("/").length<=r).map(e=>({type:e.type,id:e.sha,name:Object(_.basename)(e.path),path:`${i}/${e.path}`,size:e.size}))}catch(e){if(e&&404===e.status)return console.log("This 404 was expected and handled appropriately."),[];throw e}}async migrateToVersion1(e,t){const n=e.head.ref.substring("cms/".length),r=`${t.collection}/${n}`,i="cms/"+r;await this.getBranch(i).catch(()=>{})||await this.createBranch(i,e.head.sha);const o=(await this.getPullRequests(i,st.All,()=>!0))[0]||await this.createPR(e.title,i),a=it(it({},t),{},{pr:{number:o.number,head:o.head.sha},branch:i,version:"1"});return await this.storeMetadata(r,a),await this.closePR(e.number),await this.deleteBranch(e.head.ref),await this.deleteMetadata(n),{metadata:a,pullRequest:o}}async migrateToPullRequestLabels(e,t){await this.setPullRequestStatus(e,t.status);const n=e.head.ref.substring("cms/".length);await this.deleteMetadata(n)}async migratePullRequest(e,t){const{number:n}=e;console.log(`Migrating Pull Request '${n}' (${t})`);const r=Object(_.contentKeyFromBranch)(e.head.ref);let i=await this.retrieveMetadataOld(r).catch(()=>{});if(!i)return void console.log(`Skipped migrating Pull Request '${n}' (${t})`);let o=n;if(!i.version){console.log(`Migrating Pull Request '${n}' to version 1`);try{({metadata:i,pullRequest:e}=await this.migrateToVersion1(e,i))}catch(e){return console.log(`Failed to migrate Pull Request '${n}' to version 1. See error below.`),void console.error(e)}o=e.number,console.log(`Done migrating Pull Request '${n}' to version 1. New pull request '${o}' created.`)}"1"===i.version&&(console.log(`Migrating Pull Request '${o}' to labels`),await this.migrateToPullRequestLabels(e,i),console.log(`Done migrating Pull Request '${o}' to labels`)),console.log(`Done migrating Pull Request '${n===o?o:`${n} => ${o}`}'`)}async getOpenAuthoringBranches(){return await this.requestAllPages(`${this.repoURL}/git/refs/heads/cms/${this.repo}`).catch(()=>[])}async listUnpublishedBranches(){let e;if(console.log("%c Checking for Unpublished entries","line-height: 30px;text-align: center;font-weight: bold"),this.useOpenAuthoring){e=(await this.getOpenAuthoringBranches()).map(e=>e.ref.substring("refs/heads/".length));const t=await Promise.all(e.map(e=>this.filterOpenAuthoringBranches(e)));e=t.filter(e=>e.filter).map(e=>e.branch)}else{const t=await this.getPullRequests(void 0,st.Open,e=>!e.head.repo.fork&&function(e,t){return e.labels.every(e=>!Object(_.isCMSLabel)(e.name,t))}(e,this.cmsLabelPrefix));let n=0;for(const e of t)lt||(lt=!0,alert(x`
              Netlify CMS is adding labels to ${t.length} of your Editorial Workflow
              entries. The "Workflow" tab will be unavailable during this migration. You may use other
              areas of the CMS during this time. Note that closing the CMS will pause the migration.
            `)),n+=1,await this.migratePullRequest(e,`${n} of ${t.length}`);e=(await this.getPullRequests(void 0,st.Open,e=>ut(e,this.cmsLabelPrefix))).map(e=>e.head.ref)}return e}async getStatuses(e,t){const n=this.generateContentKey(e,t),r=Object(_.branchFromContentKey)(n),i=(await this.getBranchPullRequest(r)).head.sha;return(await this.request(`${this.originRepoURL}/commits/${i}/status`)).statuses.map(e=>({context:e.context,target_url:e.target_url,state:e.state===at.Success?_.PreviewState.Success:_.PreviewState.Other}))}async persistFiles(e,t,n){const r=t.concat(e),i=r.map(e=>this.uploadBlob(e));if(await Promise.all(i),n.useWorkflow){const i=t.map(({sha:e,path:t})=>({path:l()(t,"/"),sha:e})),o=e[0].slug;return this.editorialWorkflowGit(r,o,i,n)}return this.getDefaultBranch().then(e=>this.updateTree(e.commit.sha,r)).then(e=>this.commit(n.commitMessage,e)).then(e=>this.patchBranch(this.branch,e.sha))}async getFileSha(e,{repoURL:t=this.repoURL,branch:n=this.branch}={}){const r=e.split("/"),i=ye()(r),o=ge()(r).join("/"),a=`${t}/git/trees/${n}:${encodeURIComponent(o)}`,s=(await this.request(a)).tree.find(e=>e.path===i);if(s)return s.sha;throw new _.APIError("Not Found",404,"GitHub")}async deleteFiles(e,t){if(this.useOpenAuthoring)return Promise.reject("Cannot delete published entries as an Open Authoring user!");const n=await this.getDefaultBranch(),r=e.map(e=>({path:e,sha:null})),i=await this.updateTree(n.commit.sha,r),o=await this.commit(t,i);await this.patchBranch(this.branch,o.sha)}async createBranchAndPullRequest(e,t,n){return await this.createBranch(e,t),this.createPR(n,e)}async updatePullRequestLabels(e,t){await this.request(`${this.repoURL}/issues/${e}/labels`,{method:"PUT",body:JSON.stringify({labels:t})})}async diffFromFile(e){return{path:e.filename,newFile:"added"===e.status,sha:e.sha,binary:"renamed"!==e.status&&!e.patch||e.filename.endsWith(".svg")}}async editorialWorkflowGit(e,t,n,r){const i=this.generateContentKey(r.collectionName,t),o=Object(_.branchFromContentKey)(i);if(r.unpublished||!1){const{files:t}=await this.getDifferences(this.branch,await this.getHeadReference(o)),i=await Promise.all(t.map(e=>this.diffFromFile(e))),a=[];for(const e of i.filter(e=>e.binary))n.some(t=>t.path===e.path)||a.push({path:e.path,sha:null});const s=await this.rebaseBranch(o),u=a.concat(e),c=await this.updateTree(s.sha,u,o),l=await this.commit(r.commitMessage,c);return this.patchBranch(o,l.sha,{force:!0})}{const t=await this.getDefaultBranch(),n=await this.updateTree(t.commit.sha,e),i=await this.commit(r.commitMessage,n);if(this.useOpenAuthoring)await this.createBranch(o,i.sha);else{const e=await this.createBranchAndPullRequest(o,i.sha,r.commitMessage);await this.setPullRequestStatus(e,r.status||this.initialWorkflowStatus)}}}async getDifferences(e,t){const n=this.useOpenAuthoring?10:1;for(let r=1;r<=n;r++)try{return await this.request(`${this.originRepoURL}/compare/${e}...${t}`)}catch(e){if(r===n)throw console.warn(`Reached maximum number of attempts '${n}' for getDifferences`),e;await new Promise(e=>setTimeout(e,500*r))}throw new _.APIError("Not Found",404,"GitHub")}async rebaseSingleCommit(e,t){const n=ct((await this.getDifferences(t.parents[0].sha,t.sha)).files);if(n.length>0){const r=await this.updateTree(e.sha,n),{message:i,author:o,committer:a}=t.commit;return await this.createCommit(i,r.sha,[e.sha],o,a)}return t}async rebaseCommits(e,t){if(0===t.length||t[0].parents[0].sha===e.sha){return ye()(t)}return t.reduce((e,t)=>e.then(e=>{const n=e,r=t;return this.rebaseSingleCommit(n,r)}),Promise.resolve(e))}async rebaseBranch(e){try{const{base_commit:t,commits:n}=await this.getDifferences(this.branch,await this.getHeadReference(e));return await this.rebaseCommits(t,n)}catch(e){throw console.error(e),e}}async setPullRequestStatus(e,t){const n=[...e.labels.filter(e=>!Object(_.isCMSLabel)(e.name,this.cmsLabelPrefix)).map(e=>e.name),Object(_.statusToLabel)(t,this.cmsLabelPrefix)];await this.updatePullRequestLabels(e.number,n)}async updateUnpublishedEntryStatus(e,t,n){const r=this.generateContentKey(e,t),i=Object(_.branchFromContentKey)(r),o=await this.getBranchPullRequest(i);if(this.useOpenAuthoring){if("pending_publish"===status)throw new Error('Open Authoring entries may not be set to the status "pending_publish".');if(-1!==o.number){const{state:e}=o;e===st.Open&&"draft"===n&&await this.closePR(o.number),e===st.Closed&&"pending_review"===n&&await this.openPR(o.number)}else if("pending_review"===n){var a,s;const e=Object(_.branchFromContentKey)(r),t=(null===(a=(await this.getDifferences(this.branch,await this.getHeadReference(e))).commits[0])||void 0===a||null===(s=a.commit)||void 0===s?void 0:s.message)||ht.DEFAULT_COMMIT_MESSAGE;await this.createPR(t,e)}}else await this.setPullRequestStatus(o,n)}async deleteUnpublishedEntry(e,t){const n=this.generateContentKey(e,t),r=Object(_.branchFromContentKey)(n),i=await this.getBranchPullRequest(r);-1!==i.number&&await this.closePR(i.number),await this.deleteBranch(r)}async publishUnpublishedEntry(e,t){const n=this.generateContentKey(e,t),r=Object(_.branchFromContentKey)(n),i=await this.getBranchPullRequest(r);await this.mergePR(i),await this.deleteBranch(r)}async createRef(e,t,n){return await this.request(this.repoURL+"/git/refs",{method:"POST",body:JSON.stringify({ref:`refs/${e}/${t}`,sha:n})})}async patchRef(e,t,n,r={}){const i=r.force||!1;return await this.request(`${this.repoURL}/git/refs/${e}/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify({sha:n,force:i})})}deleteRef(e,t){return this.request(`${this.repoURL}/git/refs/${e}/${encodeURIComponent(t)}`,{method:"DELETE"})}async getBranch(e){return await this.request(`${this.repoURL}/branches/${encodeURIComponent(e)}`)}async getDefaultBranch(){return await this.request(`${this.originRepoURL}/branches/${encodeURIComponent(this.branch)}`)}async backupBranch(e){try{const t=await this.getBranch(e);await this.createBranch(t.name.replace(new RegExp(_.CMS_BRANCH_PREFIX+"/"),`${_.CMS_BRANCH_PREFIX}_${Date.now()}/`),t.commit.sha)}catch(e){console.warn(e)}}async createBranch(e,t){try{return await this.createRef("heads",e,t)}catch(n){const r=String(n.message||"");if("Reference update failed"===r)await Object(_.throwOnConflictingBranches)(e,e=>this.getBranch(e),"GitHub");else if("Reference already exists"===r&&e.startsWith(_.CMS_BRANCH_PREFIX+"/"))try{await this.backupBranch(e);return await this.patchBranch(e,t,{force:!0})}catch(e){console.log(e)}throw n}}assertCmsBranch(e){return e.startsWith(_.CMS_BRANCH_PREFIX+"/")}patchBranch(e,t,n={}){const r=n.force||!1;if(r&&!this.assertCmsBranch(e))throw Error("Only CMS branches can be force updated, cannot force update "+e);return this.patchRef("heads",e,t,{force:r})}deleteBranch(e){return this.deleteRef("heads",e).catch(e=>"Reference does not exist"===e.message?Promise.resolve():(console.error(e),Promise.reject(e)))}async getHeadReference(e){return`${this.repoOwner}:${e}`}async createPR(e,t){return await this.request(this.originRepoURL+"/pulls",{method:"POST",body:JSON.stringify({title:e,body:_.DEFAULT_PR_BODY,head:await this.getHeadReference(t),base:this.branch})})}async openPR(e){console.log("%c Re-opening PR","line-height: 30px;text-align: center;font-weight: bold");return await this.request(`${this.originRepoURL}/pulls/${e}`,{method:"PATCH",body:JSON.stringify({state:st.Open})})}async closePR(e){console.log("%c Deleting PR","line-height: 30px;text-align: center;font-weight: bold");return await this.request(`${this.originRepoURL}/pulls/${e}`,{method:"PATCH",body:JSON.stringify({state:st.Closed})})}async mergePR(e){console.log("%c Merging PR","line-height: 30px;text-align: center;font-weight: bold");try{return await this.request(`${this.originRepoURL}/pulls/${e.number}/merge`,{method:"PUT",body:JSON.stringify({commit_message:_.MERGE_COMMIT_MESSAGE,sha:e.head.sha,merge_method:this.mergeMethod})})}catch(t){if(t instanceof _.APIError&&405===t.status)return this.forceMergePR(e);throw t}}async forceMergePR(e){const t=ct((await this.getDifferences(e.base.sha,e.head.sha)).files);let n="Automatically generated. Merged on Netlify CMS\n\nForce merge of:";return t.forEach(e=>{n+=`\n* "${e.path}"`}),console.log("%c Automatic merge not possible - Forcing merge.","line-height: 30px;text-align: center;font-weight: bold"),this.getDefaultBranch().then(e=>this.updateTree(e.commit.sha,t)).then(e=>this.commit(n,e)).then(e=>this.patchBranch(this.branch,e.sha))}toBase64(e){return Promise.resolve(tt.encode(e))}async uploadBlob(e){const t=await pe()(e,"toBase64",me()(this.toBase64,e.raw)),n=await this.request(this.repoURL+"/git/blobs",{method:"POST",body:JSON.stringify({content:t,encoding:"base64"})});return e.sha=n.sha,e}async updateTree(e,t,n=this.branch){const r=[],i=t.reduce((e,t)=>{const n={path:l()(t.path,"/"),mode:"100644",type:"blob",sha:t.sha};return t.newPath?r.push({from:t.path,to:t.newPath,sha:t.sha}):e.push(n),e},[]);for(const{from:e,to:t,sha:o}of r){const r=Object(nt.dirname)(e),a=Object(nt.dirname)(t),s=await this.listFiles(r,{branch:n,depth:100});for(const t of s)i.push({path:t.path,mode:"100644",type:"blob",sha:null}),i.push({path:t.path.replace(r,a),mode:"100644",type:"blob",sha:t.path===e?o:t.id})}return it(it({},await this.createTree(e,i)),{},{parentSha:e})}async createTree(e,t){return await this.request(this.repoURL+"/git/trees",{method:"POST",body:JSON.stringify({base_tree:e,tree:t})})}commit(e,t){const n=t.parentSha?[t.parentSha]:[];return this.createCommit(e,t.sha,n)}async createCommit(e,t,n,r,i){return await this.request(this.repoURL+"/git/commits",{method:"POST",body:JSON.stringify({message:e,tree:t,parents:n,author:r,committer:i})})}async getUnpublishedEntrySha(e,t){const n=this.generateContentKey(e,t),r=Object(_.branchFromContentKey)(n);return(await this.getBranchPullRequest(r)).head.sha}}ot(ht,"DEFAULT_COMMIT_MESSAGE","Automatically generated by Netlify CMS");var ft=n(0),pt=n(2),dt=n(43),mt=n(66),vt=n.n(mt).a,yt=n(3);!function(e){function t(t,n){var r=e.call(this,t)||this;return r.link=n,r}Object(ft.c)(t,e)}(Error);function bt(e){return e.request.length<=1}function gt(e){return new vt((function(t){t.error(e)}))}function wt(e,t){var n=Object(ft.a)({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){n="function"==typeof e?Object(ft.a)({},n,e(n)):Object(ft.a)({},n,e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return Object(ft.a)({},n)}}),Object.defineProperty(t,"toKey",{enumerable:!1,value:function(){return function(e){var t=e.query,n=e.variables,r=e.operationName;return JSON.stringify([r,t,n])}(t)}}),t}function Ot(e,t){return t?t(e):vt.of()}function Rt(e){return"function"==typeof e?new St(e):e}function Et(){return new St((function(){return vt.of()}))}function kt(e){return 0===e.length?Et():e.map(Rt).reduce((function(e,t){return e.concat(t)}))}function xt(e,t,n){var r=Rt(t),i=Rt(n||new St(Ot));return bt(r)&&bt(i)?new St((function(t){return e(t)?r.request(t)||vt.of():i.request(t)||vt.of()})):new St((function(t,n){return e(t)?r.request(t,n)||vt.of():i.request(t,n)||vt.of()}))}var St=function(){function e(e){e&&(this.request=e)}return e.prototype.split=function(t,n,r){return this.concat(xt(t,n,r||new e(Ot)))},e.prototype.concat=function(e){return function(e,t){var n=Rt(e);if(bt(n))return n;var r=Rt(t);return bt(r)?new St((function(e){return n.request(e,(function(e){return r.request(e)||vt.of()}))||vt.of()})):new St((function(e,t){return n.request(e,(function(e){return r.request(e,t)||vt.of()}))||vt.of()}))}(this,e)},e.prototype.request=function(e,t){throw new yt.a(1)},e.empty=Et,e.from=kt,e.split=xt,e.execute=_t,e}();function _t(e,t){return e.request(wt(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?Object(pt.n)(t.query):""),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 new yt.a(2)}return e}(t))))||vt.of()}var jt,Pt=n(68),Tt=n(5);function It(e){return 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"}(jt||(jt={}));var Ct=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(ft.c)(t,e),t.prototype[Pt.a]=function(){return this},t.prototype["@@observable"]=function(){return this},t}(vt);function At(e){return Array.isArray(e)&&e.length>0}var Nt,qt=function(e){function t(n){var r,i,o=n.graphQLErrors,a=n.networkError,s=n.errorMessage,u=n.extraInfo,c=e.call(this,s)||this;return c.graphQLErrors=o||[],c.networkError=a||null,c.message=s||(i="",At((r=c).graphQLErrors)&&r.graphQLErrors.forEach((function(e){var t=e?e.message:"Error message not found.";i+="GraphQL error: "+t+"\n"})),r.networkError&&(i+="Network error: "+r.networkError.message+"\n"),i=i.replace(/\n$/,"")),c.extraInfo=u,c.__proto__=t.prototype,c}return Object(ft.c)(t,e),t}(Error);!function(e){e[e.normal=1]="normal",e[e.refetch=2]="refetch",e[e.poll=3]="poll"}(Nt||(Nt={}));var Ft=function(e){function t(t){var n=t.queryManager,r=t.options,i=t.shouldSubscribe,o=void 0===i||i,a=e.call(this,(function(e){return a.onSubscribe(e)}))||this;a.observers=new Set,a.subscriptions=new Set,a.isTornDown=!1,a.options=r,a.variables=r.variables||{},a.queryId=n.generateQueryId(),a.shouldSubscribe=o;var s=Object(pt.m)(r.query);return a.queryName=s&&s.name&&s.name.value,a.queryManager=n,a}return Object(ft.c)(t,e),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.currentResult=function(){var e=this.getCurrentResult();return void 0===e.data&&(e.data={}),e},t.prototype.getCurrentResult=function(){if(this.isTornDown){var e=this.lastResult;return{data:!this.lastError&&e&&e.data||void 0,error:this.lastError,loading:!1,networkStatus:jt.error}}var t,n,r,i=this.queryManager.getCurrentQueryResult(this),o=i.data,a=i.partial,s=this.queryManager.queryStore.get(this.queryId),u=this.options.fetchPolicy,c="network-only"===u||"no-cache"===u;if(s){var l=s.networkStatus;if(n=s,void 0===(r=this.options.errorPolicy)&&(r="none"),n&&(n.networkError||"none"===r&&At(n.graphQLErrors)))return{data:void 0,loading:!1,networkStatus:l,error:new qt({graphQLErrors:s.graphQLErrors,networkError:s.networkError})};s.variables&&(this.options.variables=Object(ft.a)(Object(ft.a)({},this.options.variables),s.variables),this.variables=this.options.variables),t={data:o,loading:It(l),networkStatus:l},s.graphQLErrors&&"all"===this.options.errorPolicy&&(t.errors=s.graphQLErrors)}else{var h=c||a&&"cache-only"!==u;t={data:o,loading:h,networkStatus:h?jt.loading:jt.ready}}return a||this.updateLastResult(Object(ft.a)(Object(ft.a)({},t),{stale:!1})),Object(ft.a)(Object(ft.a)({},t),{partial:a})},t.prototype.isDifferentFromLastResult=function(e){var t=this.lastResultSnapshot;return!(t&&e&&t.networkStatus===e.networkStatus&&t.stale===e.stale&&Object(dt.a)(t.data,e.data))},t.prototype.getLastResult=function(){return this.lastResult},t.prototype.getLastError=function(){return this.lastError},t.prototype.resetLastResults=function(){delete this.lastResult,delete this.lastResultSnapshot,delete this.lastError,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){var e=this.queryManager.queryStore.get(this.queryId);e&&(e.networkError=null,e.graphQLErrors=[])},t.prototype.refetch=function(e){var t=this.options.fetchPolicy;return"cache-only"===t?Promise.reject(new yt.a(1)):("no-cache"!==t&&"cache-and-network"!==t&&(t="network-only"),Object(dt.a)(this.variables,e)||(this.variables=Object(ft.a)(Object(ft.a)({},this.variables),e)),Object(dt.a)(this.options.variables,this.variables)||(this.options.variables=Object(ft.a)(Object(ft.a)({},this.options.variables),this.variables)),this.queryManager.fetchQuery(this.queryId,Object(ft.a)(Object(ft.a)({},this.options),{fetchPolicy:t}),Nt.refetch))},t.prototype.fetchMore=function(e){var t=this;Object(yt.b)(e.updateQuery,2);var n=Object(ft.a)(Object(ft.a)({},e.query?e:Object(ft.a)(Object(ft.a)(Object(ft.a)({},this.options),e),{variables:Object(ft.a)(Object(ft.a)({},this.variables),e.variables)})),{fetchPolicy:"network-only"}),r=this.queryManager.generateQueryId();return this.queryManager.fetchQuery(r,n,Nt.normal,this.queryId).then((function(i){return t.updateQuery((function(t){return e.updateQuery(t,{fetchMoreResult:i.data,variables:n.variables})})),t.queryManager.stopQuery(r),i}),(function(e){throw t.queryManager.stopQuery(r),e}))},t.prototype.subscribeToMore=function(e){var t=this,n=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables}).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)}});return this.subscriptions.add(n),function(){t.subscriptions.delete(n)&&n.unsubscribe()}},t.prototype.setOptions=function(e){var t=this.options.fetchPolicy;this.options=Object(ft.a)(Object(ft.a)({},this.options),e),e.pollInterval?this.startPolling(e.pollInterval):0===e.pollInterval&&this.stopPolling();var n=e.fetchPolicy;return this.setVariables(this.options.variables,t!==n&&("cache-only"===t||"standby"===t||"network-only"===n),e.fetchResults)},t.prototype.setVariables=function(e,t,n){return void 0===t&&(t=!1),void 0===n&&(n=!0),this.isTornDown=!1,e=e||this.variables,!t&&Object(dt.a)(e,this.variables)?this.observers.size&&n?this.result():Promise.resolve():(this.variables=this.options.variables=e,this.observers.size?this.queryManager.fetchQuery(this.queryId,this.options):Promise.resolve())},t.prototype.updateQuery=function(e){var t=this.queryManager,n=t.getQueryWithPreviousResult(this.queryId),r=n.previousResult,i=n.variables,o=n.document,a=Object(pt.I)((function(){return e(r,{variables:i})}));a&&(t.dataStore.markUpdateQueryResult(o,i,a),t.broadcastQueries())},t.prototype.stopPolling=function(){this.queryManager.stopPollingQuery(this.queryId),this.options.pollInterval=void 0},t.prototype.startPolling=function(e){Lt(this),this.options.pollInterval=e,this.queryManager.startPollingQuery(this.options,this.queryId)},t.prototype.updateLastResult=function(e){var t=this.lastResult;return this.lastResult=e,this.lastResultSnapshot=this.queryManager.assumeImmutableResults?e:Object(pt.f)(e),t},t.prototype.onSubscribe=function(e){var t=this;try{var n=e._subscription._observer;n&&!n.error&&(n.error=Dt)}catch(e){}var r=!this.observers.size;return this.observers.add(e),e.next&&this.lastResult&&e.next(this.lastResult),e.error&&this.lastError&&e.error(this.lastError),r&&this.setUpQuery(),function(){t.observers.delete(e)&&!t.observers.size&&t.tearDownQuery()}},t.prototype.setUpQuery=function(){var e=this,t=this.queryManager,n=this.queryId;this.shouldSubscribe&&t.addObservableQuery(n,this),this.options.pollInterval&&(Lt(this),t.startPollingQuery(this.options,n));var r=function(t){e.updateLastResult(Object(ft.a)(Object(ft.a)({},e.lastResult),{errors:t.graphQLErrors,networkStatus:jt.error,loading:!1})),Mt(e.observers,"error",e.lastError=t)};t.observeQuery(n,this.options,{next:function(n){if(e.lastError||e.isDifferentFromLastResult(n)){var r=e.updateLastResult(n),i=e.options,o=i.query,a=i.variables,s=i.fetchPolicy;t.transform(o).hasClientExports?t.getLocalState().addExportedVariables(o,a).then((function(i){var a=e.variables;e.variables=e.options.variables=i,!n.loading&&r&&"cache-only"!==s&&t.transform(o).serverQuery&&!Object(dt.a)(a,i)?e.refetch():Mt(e.observers,"next",n)})):Mt(e.observers,"next",n)}},error:r}).catch(r)},t.prototype.tearDownQuery=function(){var e=this.queryManager;this.isTornDown=!0,e.stopPollingQuery(this.queryId),this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),e.removeObservableQuery(this.queryId),e.stopQuery(this.queryId),this.observers.clear()},t}(Ct);function Dt(e){}function Mt(e,t,n){var r=[];e.forEach((function(e){return e[t]&&r.push(e)})),r.forEach((function(e){return e[t](n)}))}function Lt(e){var t=e.options.fetchPolicy;Object(yt.b)("cache-first"!==t&&"cache-only"!==t,3)}var Ut=function(){function e(){this.store={}}return e.prototype.getStore=function(){return this.store},e.prototype.get=function(e){return this.store[e]},e.prototype.initMutation=function(e,t,n){this.store[e]={mutation:t,variables:n||{},loading:!0,error:null}},e.prototype.markMutationError=function(e,t){var n=this.store[e];n&&(n.loading=!1,n.error=t)},e.prototype.markMutationResult=function(e){var t=this.store[e];t&&(t.loading=!1,t.error=null)},e.prototype.reset=function(){this.store={}},e}(),Bt=function(){function e(){this.store={}}return e.prototype.getStore=function(){return this.store},e.prototype.get=function(e){return this.store[e]},e.prototype.initQuery=function(e){var t=this.store[e.queryId];Object(yt.b)(!t||t.document===e.document||Object(dt.a)(t.document,e.document),19);var n,r=!1,i=null;e.storePreviousVariables&&t&&t.networkStatus!==jt.loading&&(Object(dt.a)(t.variables,e.variables)||(r=!0,i=t.variables)),n=r?jt.setVariables:e.isPoll?jt.poll:e.isRefetch?jt.refetch:jt.loading;var o=[];t&&t.graphQLErrors&&(o=t.graphQLErrors),this.store[e.queryId]={document:e.document,variables:e.variables,previousVariables:i,networkError:null,graphQLErrors:o,networkStatus:n,metadata:e.metadata},"string"==typeof e.fetchMoreForQueryId&&this.store[e.fetchMoreForQueryId]&&(this.store[e.fetchMoreForQueryId].networkStatus=jt.fetchMore)},e.prototype.markQueryResult=function(e,t,n){this.store&&this.store[e]&&(this.store[e].networkError=null,this.store[e].graphQLErrors=At(t.errors)?t.errors:[],this.store[e].previousVariables=null,this.store[e].networkStatus=jt.ready,"string"==typeof n&&this.store[n]&&(this.store[n].networkStatus=jt.ready))},e.prototype.markQueryError=function(e,t,n){this.store&&this.store[e]&&(this.store[e].networkError=t,this.store[e].networkStatus=jt.error,"string"==typeof n&&this.markQueryResultClient(n,!0))},e.prototype.markQueryResultClient=function(e,t){var n=this.store&&this.store[e];n&&(n.networkError=null,n.previousVariables=null,t&&(n.networkStatus=jt.ready))},e.prototype.stopQuery=function(e){delete this.store[e]},e.prototype.reset=function(e){var t=this;Object.keys(this.store).forEach((function(n){e.indexOf(n)<0?t.stopQuery(n):t.store[n].networkStatus=jt.loading}))},e}();var Qt=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=Object(pt.A)(t.resolvers,e)})):this.resolvers=Object(pt.A)(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 Object(ft.b)(this,void 0,void 0,(function(){return Object(ft.d)(this,(function(e){return t?[2,this.resolveDocument(t,n.data,r,i,this.fragmentMatcher,a).then((function(e){return Object(ft.a)(Object(ft.a)({},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 Object(pt.s)(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return this.resolvers?Object(pt.C)(e):e},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.cache;return Object(ft.a)(Object(ft.a)({},e),{cache:t,getCacheKey:function(e){if(t.config)return t.config.dataIdFromObject(e);Object(yt.b)(!1,6)}})},e.prototype.addExportedVariables=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),Object(ft.b)(this,void 0,void 0,(function(){return Object(ft.d)(this,(function(r){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(n),t).then((function(e){return Object(ft.a)(Object(ft.a)({},t),e.exportedVariables)}))]:[2,Object(ft.a)({},t)]}))}))},e.prototype.shouldForceResolvers=function(e){var t=!1;return Object(Tt.visit)(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 Tt.BREAK}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:Object(pt.d)(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),Object(ft.b)(this,void 0,void 0,(function(){var a,s,u,c,l,h,f,p,d;return Object(ft.d)(this,(function(m){var v;return a=Object(pt.l)(e),s=Object(pt.j)(e),u=Object(pt.g)(s),c=a.operation,l=c?(v=c).charAt(0).toUpperCase()+v.slice(1):"Query",f=(h=this).cache,p=h.client,d={fragmentMap:u,context:Object(ft.a)(Object(ft.a)({},n),{cache:f,client:p}),variables:r,fragmentMatcher:i,defaultOperationType:l,exportedVariables:{},onlyRunForcedResolvers:o},[2,this.resolveSelectionSet(a.selectionSet,t,d).then((function(e){return{result:e,exportedVariables:d.exportedVariables}}))]}))}))},e.prototype.resolveSelectionSet=function(e,t,n){return Object(ft.b)(this,void 0,void 0,(function(){var r,i,o,a,s,u=this;return Object(ft.d)(this,(function(c){return r=n.fragmentMap,i=n.context,o=n.variables,a=[t],s=function(e){return Object(ft.b)(u,void 0,void 0,(function(){var s,u;return Object(ft.d)(this,(function(c){return Object(pt.F)(e,o)?Object(pt.t)(e)?[2,this.resolveField(e,t,n).then((function(t){var n;void 0!==t&&a.push(((n={})[Object(pt.E)(e)]=t,n))}))]:(Object(pt.v)(e)?s=e:(s=r[e.name.value],Object(yt.b)(s,7)),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 Object(pt.B)(a)}))]}))}))},e.prototype.resolveField=function(e,t,n){return Object(ft.b)(this,void 0,void 0,(function(){var r,i,o,a,s,u,c,l,h,f=this;return Object(ft.d)(this,(function(p){return r=n.variables,i=e.name.value,o=Object(pt.E)(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])&&(h=l[a?i:o])&&(u=Promise.resolve(h(t,Object(pt.b)(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}();function $t(e){var t=new Set,n=null;return new Ct((function(r){return t.add(r),n=n||e.subscribe({next:function(e){t.forEach((function(t){return t.next&&t.next(e)}))},error:function(e){t.forEach((function(t){return t.error&&t.error(e)}))},complete:function(){t.forEach((function(e){return e.complete&&e.complete()}))}}),function(){t.delete(r)&&!t.size&&n&&(n.unsubscribe(),n=null)}}))}var Vt=Object.prototype.hasOwnProperty,Gt=function(){function e(e){var t=e.link,n=e.queryDeduplication,r=void 0!==n&&n,i=e.store,o=e.onBroadcast,a=void 0===o?function(){}:o,s=e.ssrMode,u=void 0!==s&&s,c=e.clientAwareness,l=void 0===c?{}:c,h=e.localState,f=e.assumeImmutableResults;this.mutationStore=new Ut,this.queryStore=new Bt,this.clientAwareness={},this.idCounter=1,this.queries=new Map,this.fetchQueryRejectFns=new Map,this.transformCache=new(pt.e?WeakMap:Map),this.inFlightLinkObservables=new Map,this.pollingInfoByQueryId=new Map,this.link=t,this.queryDeduplication=r,this.dataStore=i,this.onBroadcast=a,this.clientAwareness=l,this.localState=h||new Qt({cache:i.getCache()}),this.ssrMode=u,this.assumeImmutableResults=!!f}return e.prototype.stop=function(){var e=this;this.queries.forEach((function(t,n){e.stopQueryNoBroadcast(n)})),this.fetchQueryRejectFns.forEach((function(e){e(new yt.a(8))}))},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.errorPolicy,h=void 0===l?"none":l,f=e.fetchPolicy,p=e.context,d=void 0===p?{}:p;return Object(ft.b)(this,void 0,void 0,(function(){var e,o,s,l=this;return Object(ft.d)(this,(function(p){switch(p.label){case 0:return Object(yt.b)(t,9),Object(yt.b)(!f||"no-cache"===f,10),e=this.generateQueryId(),t=this.transform(t).document,this.setQuery(e,(function(){return{document:t}})),n=this.getVariables(t,n),this.transform(t).hasClientExports?[4,this.localState.addExportedVariables(t,n,d)]:[3,2];case 1:n=p.sent(),p.label=2;case 2:return o=function(){var e={};return i&&l.queries.forEach((function(t,n){var r=t.observableQuery;if(r){var o=r.queryName;o&&Vt.call(i,o)&&(e[n]={updater:i[o],query:l.queryStore.get(n)})}})),e},this.mutationStore.initMutation(e,t,n),this.dataStore.markMutationInit({mutationId:e,document:t,variables:n,updateQueries:o(),update:c,optimisticResponse:r}),this.broadcastQueries(),s=this,[2,new Promise((function(i,l){var p,m;s.getObservableFromLink(t,Object(ft.a)(Object(ft.a)({},d),{optimisticResponse:r}),n,!1).subscribe({next:function(r){Object(pt.q)(r)&&"none"===h?m=new qt({graphQLErrors:r.errors}):(s.mutationStore.markMutationResult(e),"no-cache"!==f&&s.dataStore.markMutationResult({mutationId:e,result:r,document:t,variables:n,updateQueries:o(),update:c}),p=r)},error:function(t){s.mutationStore.markMutationError(e,t),s.dataStore.markMutationComplete({mutationId:e,optimisticResponse:r}),s.broadcastQueries(),s.setQuery(e,(function(){return{document:null}})),l(new qt({networkError:t}))},complete:function(){if(m&&s.mutationStore.markMutationError(e,m),s.dataStore.markMutationComplete({mutationId:e,optimisticResponse:r}),s.broadcastQueries(),m)l(m);else{"function"==typeof a&&(a=a(p));var t=[];At(a)&&a.forEach((function(e){if("string"==typeof e)s.queries.forEach((function(n){var r=n.observableQuery;r&&r.queryName===e&&t.push(r.refetch())}));else{var n={query:e.query,variables:e.variables,fetchPolicy:"network-only"};e.context&&(n.context=e.context),t.push(s.query(n))}})),Promise.all(u?t:[]).then((function(){s.setQuery(e,(function(){return{document:null}})),"ignore"===h&&p&&Object(pt.q)(p)&&delete p.errors,i(p)}))}}})}))]}}))}))},e.prototype.fetchQuery=function(e,t,n,r){return Object(ft.b)(this,void 0,void 0,(function(){var i,o,a,s,u,c,l,h,f,p,d,m,v,y,b,g,w,O,R=this;return Object(ft.d)(this,(function(E){switch(E.label){case 0:return i=t.metadata,o=void 0===i?null:i,a=t.fetchPolicy,s=void 0===a?"cache-first":a,u=t.context,c=void 0===u?{}:u,l=this.transform(t.query).document,h=this.getVariables(l,t.variables),this.transform(l).hasClientExports?[4,this.localState.addExportedVariables(l,h,c)]:[3,2];case 1:h=E.sent(),E.label=2;case 2:if(t=Object(ft.a)(Object(ft.a)({},t),{variables:h}),d=p="network-only"===s||"no-cache"===s,p||(m=this.dataStore.getCache().diff({query:l,variables:h,returnPartialData:!0,optimistic:!1}),v=m.complete,y=m.result,d=!v||"cache-and-network"===s,f=y),b=d&&"cache-only"!==s&&"standby"!==s,Object(pt.s)(["live"],l)&&(b=!0),g=this.idCounter++,w="no-cache"!==s?this.updateQueryWatch(e,l,t):void 0,this.setQuery(e,(function(){return{document:l,lastRequestId:g,invalidated:!0,cancel:w}})),this.invalidate(r),this.queryStore.initQuery({queryId:e,document:l,storePreviousVariables:b,variables:h,isPoll:n===Nt.poll,isRefetch:n===Nt.refetch,metadata:o,fetchMoreForQueryId:r}),this.broadcastQueries(),b){if(O=this.fetchRequest({requestId:g,queryId:e,document:l,options:t,fetchMoreForQueryId:r}).catch((function(t){throw t.hasOwnProperty("graphQLErrors")?t:(g>=R.getQuery(e).lastRequestId&&(R.queryStore.markQueryError(e,t,r),R.invalidate(e),R.invalidate(r),R.broadcastQueries()),new qt({networkError:t}))})),"cache-and-network"!==s)return[2,O];O.catch((function(){}))}return this.queryStore.markQueryResultClient(e,!b),this.invalidate(e),this.invalidate(r),this.transform(l).hasForcedResolvers?[2,this.localState.runResolvers({document:l,remoteResult:{data:f},context:c,variables:h,onlyRunForcedResolvers:!0}).then((function(n){return R.markQueryResult(e,n,t,r),R.broadcastQueries(),n}))]:(this.broadcastQueries(),[2,{data:f}])}}))}))},e.prototype.markQueryResult=function(e,t,n,r){var i=n.fetchPolicy,o=n.variables,a=n.errorPolicy;"no-cache"===i?this.setQuery(e,(function(){return{newData:{result:t.data,complete:!0}}})):this.dataStore.markQueryResult(t,this.getQuery(e).document,o,r,"ignore"===a||"all"===a)},e.prototype.queryListenerForObserver=function(e,t,n){var r=this;function i(e,t){if(n[e])try{n[e](t)}catch(e){}}return function(n,o){if(r.invalidate(e,!1),n){var a=r.getQuery(e),s=a.observableQuery,u=a.document,c=s?s.options.fetchPolicy:t.fetchPolicy;if("standby"!==c){var l=It(n.networkStatus),h=s&&s.getLastResult(),f=!(!h||h.networkStatus===n.networkStatus),p=t.returnPartialData||!o&&n.previousVariables||f&&t.notifyOnNetworkStatusChange||"cache-only"===c||"cache-and-network"===c;if(!l||p){var d=At(n.graphQLErrors),m=s&&s.options.errorPolicy||t.errorPolicy||"none";if("none"===m&&d||n.networkError)return i("error",new qt({graphQLErrors:n.graphQLErrors,networkError:n.networkError}));try{var v=void 0,y=void 0;if(o)"no-cache"!==c&&"network-only"!==c&&r.setQuery(e,(function(){return{newData:null}})),v=o.result,y=!o.complete;else{var b=s&&s.getLastError(),g="none"!==m&&(b&&b.graphQLErrors)!==n.graphQLErrors;if(h&&h.data&&!g)v=h.data,y=!1;else{var w=r.dataStore.getCache().diff({query:u,variables:n.previousVariables||n.variables,returnPartialData:!0,optimistic:!0});v=w.result,y=!w.complete}}var O=y&&!(t.returnPartialData||"cache-only"===c),R={data:O?h&&h.data:v,loading:l,networkStatus:n.networkStatus,stale:O};"all"===m&&d&&(R.errors=n.graphQLErrors),i("next",R)}catch(e){i("error",new qt({networkError:e}))}}}}}},e.prototype.transform=function(e){var t=this.transformCache;if(!t.has(e)){var n=this.dataStore.getCache(),r=n.transformDocument(e),i=Object(pt.D)(n.transformForLink(r)),o=this.localState.clientQuery(r),a=this.localState.serverQuery(i),s={document:r,hasClientExports:Object(pt.r)(r),hasForcedResolvers:this.localState.shouldForceResolvers(r),clientQuery:o,serverQuery:a,defaultVars:Object(pt.h)(Object(pt.m)(r))},u=function(e){e&&!t.has(e)&&t.set(e,s)};u(e),u(r),u(o),u(a)}return t.get(e)},e.prototype.getVariables=function(e,t){return Object(ft.a)(Object(ft.a)({},this.transform(e).defaultVars),t)},e.prototype.watchQuery=function(e,t){void 0===t&&(t=!0),Object(yt.b)("standby"!==e.fetchPolicy,11),e.variables=this.getVariables(e.query,e.variables),void 0===e.notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var n=Object(ft.a)({},e);return new Ft({queryManager:this,options:n,shouldSubscribe:t})},e.prototype.query=function(e){var t=this;return Object(yt.b)(e.query,12),Object(yt.b)("Document"===e.query.kind,13),Object(yt.b)(!e.returnPartialData,14),Object(yt.b)(!e.pollInterval,15),new Promise((function(n,r){var i=t.watchQuery(e,!1);t.fetchQueryRejectFns.set("query:"+i.queryId,r),i.result().then(n,r).then((function(){return t.fetchQueryRejectFns.delete("query:"+i.queryId)}))}))},e.prototype.generateQueryId=function(){return String(this.idCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){this.stopPollingQuery(e),this.queryStore.stopQuery(e),this.invalidate(e)},e.prototype.addQueryListener=function(e,t){this.setQuery(e,(function(e){return e.listeners.add(t),{invalidated:!1}}))},e.prototype.updateQueryWatch=function(e,t,n){var r=this,i=this.getQuery(e).cancel;i&&i();return this.dataStore.getCache().watch({query:t,variables:n.variables,optimistic:!0,previousResult:function(){var t=null,n=r.getQuery(e).observableQuery;if(n){var i=n.getLastResult();i&&(t=i.data)}return t},callback:function(t){r.setQuery(e,(function(){return{invalidated:!0,newData:t}}))}})},e.prototype.addObservableQuery=function(e,t){this.setQuery(e,(function(){return{observableQuery:t}}))},e.prototype.removeObservableQuery=function(e){var t=this.getQuery(e).cancel;this.setQuery(e,(function(){return{observableQuery:null}})),t&&t()},e.prototype.clearStore=function(){this.fetchQueryRejectFns.forEach((function(e){e(new yt.a(16))}));var e=[];return this.queries.forEach((function(t,n){t.observableQuery&&e.push(n)})),this.queryStore.reset(e),this.mutationStore.reset(),this.dataStore.reset()},e.prototype.resetStore=function(){var e=this;return this.clearStore().then((function(){return e.reFetchObservableQueries()}))},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var n=[];return this.queries.forEach((function(r,i){var o=r.observableQuery;if(o){var a=o.options.fetchPolicy;o.resetLastResults(),"cache-only"===a||!e&&"standby"===a||n.push(o.refetch()),t.setQuery(i,(function(){return{newData:null}})),t.invalidate(i)}})),this.broadcastQueries(),Promise.all(n)},e.prototype.observeQuery=function(e,t,n){return this.addQueryListener(e,this.queryListenerForObserver(e,t,n)),this.fetchQuery(e,t)},e.prototype.startQuery=function(e,t,n){return this.addQueryListener(e,n),this.fetchQuery(e,t).catch((function(){})),e},e.prototype.startGraphQLSubscription=function(e){var t=this,n=e.query,r=e.fetchPolicy,i=e.variables;n=this.transform(n).document,i=this.getVariables(n,i);var o=function(e){return t.getObservableFromLink(n,{},e,!1).map((function(i){if(r&&"no-cache"===r||(t.dataStore.markSubscriptionResult(i,n,e),t.broadcastQueries()),Object(pt.q)(i))throw new qt({graphQLErrors:i.errors});return i}))};if(this.transform(n).hasClientExports){var a=this.localState.addExportedVariables(n,i).then(o);return new Ct((function(e){var t=null;return a.then((function(n){return t=n.subscribe(e)}),e.error),function(){return t&&t.unsubscribe()}}))}return o(i)},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.fetchQueryRejectFns.delete("query:"+e),this.fetchQueryRejectFns.delete("fetchRequest:"+e),this.getQuery(e).subscriptions.forEach((function(e){return e.unsubscribe()})),this.queries.delete(e)},e.prototype.getCurrentQueryResult=function(e,t){void 0===t&&(t=!0);var n=e.options,r=n.variables,i=n.query,o=n.fetchPolicy,a=n.returnPartialData,s=e.getLastResult(),u=this.getQuery(e.queryId).newData;if(u&&u.complete)return{data:u.result,partial:!1};if("no-cache"===o||"network-only"===o)return{data:void 0,partial:!1};var c=this.dataStore.getCache().diff({query:i,variables:r,previousResult:s?s.data:void 0,returnPartialData:!0,optimistic:t}),l=c.result,h=c.complete;return{data:h||a?l:void 0,partial:!h}},e.prototype.getQueryWithPreviousResult=function(e){var t;if("string"==typeof e){var n=this.getQuery(e).observableQuery;Object(yt.b)(n,17),t=n}else t=e;var r=t.options,i=r.variables,o=r.query;return{previousResult:this.getCurrentQueryResult(t,!1).data,variables:i,document:o}},e.prototype.broadcastQueries=function(){var e=this;this.onBroadcast(),this.queries.forEach((function(t,n){t.invalidated&&t.listeners.forEach((function(r){r&&r(e.queryStore.get(n),t.newData)}))}))},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,n,r){var i,o=this;void 0===r&&(r=this.queryDeduplication);var a=this.transform(e).serverQuery;if(a){var s=this.inFlightLinkObservables,u=this.link,c={query:a,variables:n,operationName:Object(pt.n)(a)||void 0,context:this.prepareContext(Object(ft.a)(Object(ft.a)({},t),{forceFetch:!r}))};if(t=c.context,r){var l=s.get(a)||new Map;s.set(a,l);var h=JSON.stringify(n);if(!(i=l.get(h))){l.set(h,i=$t(_t(u,c)));var f=function(){l.delete(h),l.size||s.delete(a),p.unsubscribe()},p=i.subscribe({next:f,error:f,complete:f})}}else i=$t(_t(u,c))}else i=Ct.of({data:{}}),t=this.prepareContext(t);var d=this.transform(e).clientQuery;return d&&(i=function(e,t){return new Ct((function(n){var r=n.next,i=n.error,o=n.complete,a=0,s=!1,u={next:function(e){++a,new Promise((function(n){n(t(e))})).then((function(e){--a,r&&r.call(n,e),s&&u.complete()}),(function(e){--a,i&&i.call(n,e)}))},error:function(e){i&&i.call(n,e)},complete:function(){s=!0,a||o&&o.call(n)}},c=e.subscribe(u);return function(){return c.unsubscribe()}}))}(i,(function(e){return o.localState.runResolvers({document:d,remoteResult:e,context:t,variables:n})}))),i},e.prototype.fetchRequest=function(e){var t,n,r=this,i=e.requestId,o=e.queryId,a=e.document,s=e.options,u=e.fetchMoreForQueryId,c=s.variables,l=s.errorPolicy,h=void 0===l?"none":l,f=s.fetchPolicy;return new Promise((function(e,l){var p=r.getObservableFromLink(a,s.context,c),d="fetchRequest:"+o;r.fetchQueryRejectFns.set(d,l);var m=function(){r.fetchQueryRejectFns.delete(d),r.setQuery(o,(function(e){e.subscriptions.delete(v)}))},v=p.map((function(e){if(i>=r.getQuery(o).lastRequestId&&(r.markQueryResult(o,e,s,u),r.queryStore.markQueryResult(o,e,u),r.invalidate(o),r.invalidate(u),r.broadcastQueries()),"none"===h&&At(e.errors))return l(new qt({graphQLErrors:e.errors}));if("all"===h&&(n=e.errors),u||"no-cache"===f)t=e.data;else{var p=r.dataStore.getCache().diff({variables:c,query:a,optimistic:!1,returnPartialData:!0}),d=p.result;(p.complete||s.returnPartialData)&&(t=d)}})).subscribe({error:function(e){m(),l(e)},complete:function(){m(),e({data:t,errors:n,loading:!1,networkStatus:jt.ready,stale:!1})}});r.setQuery(o,(function(e){e.subscriptions.add(v)}))}))},e.prototype.getQuery=function(e){return this.queries.get(e)||{listeners:new Set,invalidated:!1,document:null,newData:null,lastRequestId:1,observableQuery:null,subscriptions:new Set}},e.prototype.setQuery=function(e,t){var n=this.getQuery(e),r=Object(ft.a)(Object(ft.a)({},n),t(n));this.queries.set(e,r)},e.prototype.invalidate=function(e,t){void 0===t&&(t=!0),e&&this.setQuery(e,(function(){return{invalidated:t}}))},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return Object(ft.a)(Object(ft.a)({},t),{clientAwareness:this.clientAwareness})},e.prototype.checkInFlight=function(e){var t=this.queryStore.get(e);return t&&t.networkStatus!==jt.ready&&t.networkStatus!==jt.error},e.prototype.startPollingQuery=function(e,t,n){var r=this,i=e.pollInterval;if(Object(yt.b)(i,18),!this.ssrMode){var o=this.pollingInfoByQueryId.get(t);o||this.pollingInfoByQueryId.set(t,o={}),o.interval=i,o.options=Object(ft.a)(Object(ft.a)({},e),{fetchPolicy:"network-only"});var a=function(){var e=r.pollingInfoByQueryId.get(t);e&&(r.checkInFlight(t)?s():r.fetchQuery(t,e.options,Nt.poll).then(s,s))},s=function(){var e=r.pollingInfoByQueryId.get(t);e&&(clearTimeout(e.timeout),e.timeout=setTimeout(a,e.interval))};n&&this.addQueryListener(t,n),s()}return t},e.prototype.stopPollingQuery=function(e){this.pollingInfoByQueryId.delete(e)},e}(),zt=function(){function e(e){this.cache=e}return e.prototype.getCache=function(){return this.cache},e.prototype.markQueryResult=function(e,t,n,r,i){void 0===i&&(i=!1);var o=!Object(pt.q)(e);i&&Object(pt.q)(e)&&e.data&&(o=!0),!r&&o&&this.cache.write({result:e.data,dataId:"ROOT_QUERY",query:t,variables:n})},e.prototype.markSubscriptionResult=function(e,t,n){Object(pt.q)(e)||this.cache.write({result:e.data,dataId:"ROOT_SUBSCRIPTION",query:t,variables:n})},e.prototype.markMutationInit=function(e){var t,n=this;e.optimisticResponse&&(t="function"==typeof e.optimisticResponse?e.optimisticResponse(e.variables):e.optimisticResponse,this.cache.recordOptimisticTransaction((function(r){var i=n.cache;n.cache=r;try{n.markMutationResult({mutationId:e.mutationId,result:{data:t},document:e.document,variables:e.variables,updateQueries:e.updateQueries,update:e.update})}finally{n.cache=i}}),e.mutationId))},e.prototype.markMutationResult=function(e){var t=this;if(!Object(pt.q)(e.result)){var n=[{result:e.result.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}],r=e.updateQueries;r&&Object.keys(r).forEach((function(i){var o=r[i],a=o.query,s=o.updater,u=t.cache.diff({query:a.document,variables:a.variables,returnPartialData:!0,optimistic:!1}),c=u.result;if(u.complete){var l=Object(pt.I)((function(){return s(c,{mutationResult:e.result,queryName:Object(pt.n)(a.document)||void 0,queryVariables:a.variables})}));l&&n.push({result:l,dataId:"ROOT_QUERY",query:a.document,variables:a.variables})}})),this.cache.performTransaction((function(t){n.forEach((function(e){return t.write(e)}));var r=e.update;r&&Object(pt.I)((function(){return r(t,e.result)}))}))}},e.prototype.markMutationComplete=function(e){var t=e.mutationId;e.optimisticResponse&&this.cache.removeOptimistic(t)},e.prototype.markUpdateQueryResult=function(e,t,n){this.cache.write({result:n,dataId:"ROOT_QUERY",variables:t,query:e})},e.prototype.reset=function(){return this.cache.reset()},e}(),Kt=function(){function e(e){var t=this;this.defaultOptions={},this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=e.cache,r=e.ssrMode,i=void 0!==r&&r,o=e.ssrForceFetchDelay,a=void 0===o?0:o,s=e.connectToDevTools,u=e.queryDeduplication,c=void 0===u||u,l=e.defaultOptions,h=e.assumeImmutableResults,f=void 0!==h&&h,p=e.resolvers,d=e.typeDefs,m=e.fragmentMatcher,v=e.name,y=e.version,b=e.link;if(!b&&p&&(b=St.empty()),!b||!n)throw new yt.a(4);this.link=b,this.cache=n,this.store=new zt(n),this.disableNetworkFetches=i||a>0,this.queryDeduplication=c,this.defaultOptions=l||{},this.typeDefs=d,a&&setTimeout((function(){return t.disableNetworkFetches=!1}),a),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);void 0!==s&&(s&&"undefined"!=typeof window)&&(window.__APOLLO_CLIENT__=this),this.version="2.6.10",this.localState=new Qt({cache:n,client:this,resolvers:p,fragmentMatcher:m}),this.queryManager=new Gt({link:this.link,store:this.store,queryDeduplication:c,ssrMode:i,clientAwareness:{name:v,version:y},localState:this.localState,assumeImmutableResults:f,onBroadcast:function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.queryStore.getStore(),mutations:t.queryManager.mutationStore.getStore()},dataWithOptimisticResults:t.cache.extract(!0)})}})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=Object(ft.a)(Object(ft.a)({},this.defaultOptions.watchQuery),e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=Object(ft.a)(Object(ft.a)({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=Object(ft.a)(Object(ft.a)({},this.defaultOptions.query),e)),Object(yt.b)("cache-and-network"!==e.fetchPolicy,5),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=Object(ft.a)(Object(ft.a)({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Object(ft.a)(Object(ft.a)({},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){var t=this.cache.writeQuery(e);return this.queryManager.broadcastQueries(),t},e.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return this.queryManager.broadcastQueries(),t},e.prototype.writeData=function(e){var t=this.cache.writeData(e);return this.queryManager.broadcastQueries(),t},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return _t(this.link,e)},e.prototype.initQueryManager=function(){return this.queryManager},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore()})).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()})).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.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}();function Ht(e){return{kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GeneratedClientQuery"},selectionSet:Wt(e)}]}}function Wt(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e||null==e)return null;if(Array.isArray(e))return Wt(e[0]);var t=[];return Object.keys(e).forEach((function(n){var r={kind:"Field",name:{kind:"Name",value:n},selectionSet:Wt(e[n])||void 0};t.push(r)})),{kind:"SelectionSet",selections:t}}var Jt,Yt={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:null,variableDefinitions:null,directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:null,name:{kind:"Name",value:"__typename"},arguments:[],directives:[],selectionSet:null}]}}]},Xt=function(){function e(){}return e.prototype.transformDocument=function(e){return e},e.prototype.transformForLink=function(e){return e},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.read({query:e.query,variables:e.variables,optimistic:t})},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.read({query:Object(pt.k)(e.fragment,e.fragmentName),variables:e.variables,rootId:e.id,optimistic:t})},e.prototype.writeQuery=function(e){this.write({dataId:"ROOT_QUERY",result:e.data,query:e.query,variables:e.variables})},e.prototype.writeFragment=function(e){this.write({dataId:e.id,result:e.data,variables:e.variables,query:Object(pt.k)(e.fragment,e.fragmentName)})},e.prototype.writeData=function(e){var t,n,r=e.id,i=e.data;if(void 0!==r){var o=null;try{o=this.read({rootId:r,optimistic:!1,query:Yt})}catch(e){}var a=o&&o.__typename||"__ClientData",s=Object.assign({__typename:a},i);this.writeFragment({id:r,fragment:(t=s,n=a,{kind:"Document",definitions:[{kind:"FragmentDefinition",typeCondition:{kind:"NamedType",name:{kind:"Name",value:n||"__FakeType"}},name:{kind:"Name",value:"GeneratedClientQuery"},selectionSet:Wt(t)}]}),data:s})}else this.writeQuery({query:Ht(i),data:i})},e}();Jt||(Jt={});var Zt=null,en={},tn=1,nn=Array,rn=nn["@wry/context:Slot"]||function(){var e=function(){function e(){this.id=["slot",tn++,Date.now(),Math.random().toString(36).slice(2)].join(":")}return e.prototype.hasValue=function(){for(var e=Zt;e;e=e.parent)if(this.id in e.slots){var t=e.slots[this.id];if(t===en)break;return e!==Zt&&(Zt.slots[this.id]=t),!0}return Zt&&(Zt.slots[this.id]=en),!1},e.prototype.getValue=function(){if(this.hasValue())return Zt.slots[this.id]},e.prototype.withValue=function(e,t,n,r){var i,o=((i={__proto__:null})[this.id]=e,i),a=Zt;Zt={parent:a,slots:o};try{return t.apply(r,n)}finally{Zt=a}},e.bind=function(e){var t=Zt;return function(){var n=Zt;try{return Zt=t,e.apply(this,arguments)}finally{Zt=n}}},e.noContext=function(e,t,n){if(!Zt)return e.apply(n,t);var r=Zt;try{return Zt=null,e.apply(n,t)}finally{Zt=r}},e}();try{Object.defineProperty(nn,"@wry/context:Slot",{value:nn["@wry/context:Slot"]=e,enumerable:!1,writable:!1,configurable:!1})}finally{return e}}();rn.bind,rn.noContext;function on(){}var an=function(){function e(e,t){void 0===e&&(e=1/0),void 0===t&&(t=on),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.getEntry(e);return t&&t.value},e.prototype.getEntry=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.getEntry(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}(),sn=new rn,un=[],cn=[];function ln(e,t){if(!e)throw new Error(t||"assertion failure")}function hn(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}var fn=function(){function e(t,n){this.fn=t,this.args=n,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],++e.count}return e.prototype.recompute=function(){if(ln(!this.recomputing,"already recomputing"),function(e){var t=sn.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),dn(e)?yn(t,e):bn(t,e),t}(this)||!wn(this))return dn(this)?function(e){var t=On(e);sn.withValue(e,pn,[e]),function(e){if("function"==typeof e.subscribe)try{En(e),e.unsubscribe=e.subscribe.apply(null,e.args)}catch(t){return e.setDirty(),!1}return!0}(e)&&function(e){if(e.dirty=!1,dn(e))return;vn(e)}(e);return t.forEach(wn),hn(e.value)}(this):hn(this.value)},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,mn(this),En(this))},e.prototype.dispose=function(){var e=this;On(this).forEach(wn),En(this),this.parents.forEach((function(t){t.setDirty(),Rn(t,e)}))},e.count=0,e}();function pn(e){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,e.args)}catch(t){e.value[1]=t}e.recomputing=!1}function dn(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function mn(e){e.parents.forEach((function(t){return yn(t,e)}))}function vn(e){e.parents.forEach((function(t){return bn(t,e)}))}function yn(e,t){if(ln(e.childValues.has(t)),ln(dn(t)),e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=cn.pop()||new Set;e.dirtyChildren.add(t),mn(e)}function bn(e,t){ln(e.childValues.has(t)),ln(!dn(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()),gn(e,t),dn(e)||vn(e)}function gn(e,t){var n=e.dirtyChildren;n&&(n.delete(t),0===n.size&&(cn.length<100&&cn.push(n),e.dirtyChildren=null))}function wn(e){return 0===e.parents.size&&"function"==typeof e.reportOrphan&&!0===e.reportOrphan()}function On(e){var t=un;return e.childValues.size>0&&(t=[],e.childValues.forEach((function(n,r){Rn(e,r),t.push(r)}))),ln(null===e.dirtyChildren),t}function Rn(e,t){t.parents.delete(e),e.childValues.delete(t),gn(e,t)}function En(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var kn=function(){function e(e){this.weakness=e}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 e.forEach((function(e){return t=t.getChildTrie(e)})),t.data||(t.data=Object.create(null))},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)),r},e}();var xn=new kn("function"==typeof WeakMap);function Sn(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return xn.lookupArray(e)}var _n=new Set;function jn(e,t){void 0===t&&(t=Object.create(null));var n=new an(t.max||Math.pow(2,16),(function(e){return e.dispose()})),r=!!t.disposable,i=t.makeCacheKey||Sn;function o(){if(!r||sn.hasValue()){var o=i.apply(null,arguments);if(void 0===o)return e.apply(null,arguments);var a=Array.prototype.slice.call(arguments),s=n.get(o);s?s.args=a:(s=new fn(e,a),n.set(o,s),s.subscribe=t.subscribe,r&&(s.reportOrphan=function(){return n.delete(o)}));var u=s.recompute();return n.set(o,s),_n.add(n),sn.hasValue()||(_n.forEach((function(e){return e.clean()})),_n.clear()),r?void 0:u}}return o.dirty=function(){var e=i.apply(null,arguments),t=void 0!==e&&n.get(e);t&&t.setDirty()},o}var Pn=!1;function Tn(){var e=!Pn;return Object(pt.y)()||(Pn=!0),e}var In=function(){function e(){}return e.prototype.ensureReady=function(){return Promise.resolve()},e.prototype.canBypassInit=function(){return!0},e.prototype.match=function(e,t,n){var r=n.store.get(e.id),i="ROOT_QUERY"===e.id;if(!r)return i;var o=r.__typename,a=void 0===o?i&&"Query":o;return a&&a===t||(Tn(),"heuristic")},e}(),Cn=function(){function e(e){e&&e.introspectionQueryResultData?(this.possibleTypesMap=this.parseIntrospectionResult(e.introspectionQueryResultData),this.isReady=!0):this.isReady=!1,this.match=this.match.bind(this)}return e.prototype.match=function(e,t,n){Object(yt.b)(this.isReady,1);var r=n.store.get(e.id),i="ROOT_QUERY"===e.id;if(!r)return i;var o=r.__typename,a=void 0===o?i&&"Query":o;if(Object(yt.b)(a,2),a===t)return!0;var s=this.possibleTypesMap[t];return!!(a&&s&&s.indexOf(a)>-1)},e.prototype.parseIntrospectionResult=function(e){var t={};return e.__schema.types.forEach((function(e){"UNION"!==e.kind&&"INTERFACE"!==e.kind||(t[e.name]=e.possibleTypes.map((function(e){return e.name})))})),t},e}(),An=Object.prototype.hasOwnProperty,Nn=function(){function e(e){var t=this;void 0===e&&(e=Object.create(null)),this.data=e,this.depend=jn((function(e){return t.data[e]}),{disposable:!0,makeCacheKey:function(e){return e}})}return e.prototype.toObject=function(){return this.data},e.prototype.get=function(e){return this.depend(e),this.data[e]},e.prototype.set=function(e,t){t!==this.data[e]&&(this.data[e]=t,this.depend.dirty(e))},e.prototype.delete=function(e){An.call(this.data,e)&&(delete this.data[e],this.depend.dirty(e))},e.prototype.clear=function(){this.replace(null)},e.prototype.replace=function(e){var t=this;e?(Object.keys(e).forEach((function(n){t.set(n,e[n])})),Object.keys(this.data).forEach((function(n){An.call(e,n)||t.delete(n)}))):Object.keys(this.data).forEach((function(e){t.delete(e)}))},e}();function qn(e){return new Nn(e)}var Fn=function(){function e(e){var t=this,n=void 0===e?{}:e,r=n.cacheKeyRoot,i=void 0===r?new kn(pt.e):r,o=n.freezeResults,a=void 0!==o&&o,s=this.executeStoreQuery,u=this.executeSelectionSet,c=this.executeSubSelectedArray;this.freezeResults=a,this.executeStoreQuery=jn((function(e){return s.call(t,e)}),{makeCacheKey:function(e){var t=e.query,n=e.rootValue,r=e.contextValue,o=e.variableValues,a=e.fragmentMatcher;if(r.store instanceof Nn)return i.lookup(r.store,t,a,JSON.stringify(o),n.id)}}),this.executeSelectionSet=jn((function(e){return u.call(t,e)}),{makeCacheKey:function(e){var t=e.selectionSet,n=e.rootValue,r=e.execContext;if(r.contextValue.store instanceof Nn)return i.lookup(r.contextValue.store,t,r.fragmentMatcher,JSON.stringify(r.variableValues),n.id)}}),this.executeSubSelectedArray=jn((function(e){return c.call(t,e)}),{makeCacheKey:function(e){var t=e.field,n=e.array,r=e.execContext;if(r.contextValue.store instanceof Nn)return i.lookup(r.contextValue.store,t,n,JSON.stringify(r.variableValues))}})}return e.prototype.readQueryFromStore=function(e){return this.diffQueryAgainstStore(Object(ft.a)(Object(ft.a)({},e),{returnPartialData:!1})).result},e.prototype.diffQueryAgainstStore=function(e){var t=e.store,n=e.query,r=e.variables,i=e.previousResult,o=e.returnPartialData,a=void 0===o||o,s=e.rootId,u=void 0===s?"ROOT_QUERY":s,c=e.fragmentMatcherFunction,l=e.config,h=Object(pt.o)(n);r=Object(pt.c)({},Object(pt.h)(h),r);var f={store:t,dataIdFromObject:l&&l.dataIdFromObject,cacheRedirects:l&&l.cacheRedirects||{}},p=this.executeStoreQuery({query:n,rootValue:{type:"id",id:u,generated:!0,typename:"Query"},contextValue:f,variableValues:r,fragmentMatcher:c}),d=p.missing&&p.missing.length>0;return d&&!a&&p.missing.forEach((function(e){if(!e.tolerable)throw new yt.a(8)})),i&&Object(dt.a)(i,p.result)&&(p.result=i),{result:p.result,complete:!d}},e.prototype.executeStoreQuery=function(e){var t=e.query,n=e.rootValue,r=e.contextValue,i=e.variableValues,o=e.fragmentMatcher,a=void 0===o?Mn:o,s=Object(pt.l)(t),u=Object(pt.j)(t),c={query:t,fragmentMap:Object(pt.g)(u),contextValue:r,variableValues:i,fragmentMatcher:a};return this.executeSelectionSet({selectionSet:s.selectionSet,rootValue:n,execContext:c})},e.prototype.executeSelectionSet=function(e){var t=this,n=e.selectionSet,r=e.rootValue,i=e.execContext,o=i.fragmentMap,a=i.contextValue,s=i.variableValues,u={result:null},c=[],l=a.store.get(r.id),h=l&&l.__typename||"ROOT_QUERY"===r.id&&"Query"||void 0;function f(e){var t;return e.missing&&(u.missing=u.missing||[],(t=u.missing).push.apply(t,e.missing)),e.result}return n.selections.forEach((function(e){var n;if(Object(pt.F)(e,s))if(Object(pt.t)(e)){var u=f(t.executeField(l,h,e,i));void 0!==u&&c.push(((n={})[Object(pt.E)(e)]=u,n))}else{var p=void 0;if(Object(pt.v)(e))p=e;else if(!(p=o[e.name.value]))throw new yt.a(9);var d=p.typeCondition&&p.typeCondition.name.value,m=!d||i.fragmentMatcher(r,d,a);if(m){var v=t.executeSelectionSet({selectionSet:p.selectionSet,rootValue:r,execContext:i});"heuristic"===m&&v.missing&&(v=Object(ft.a)(Object(ft.a)({},v),{missing:v.missing.map((function(e){return Object(ft.a)(Object(ft.a)({},e),{tolerable:!0})}))})),c.push(f(v))}}})),u.result=Object(pt.B)(c),this.freezeResults,u},e.prototype.executeField=function(e,t,n,r){var i=r.variableValues,o=r.contextValue,a=function(e,t,n,r,i,o){o.resultKey;var a=o.directives,s=n;(r||a)&&(s=Object(pt.p)(s,r,a));var u=void 0;if(e&&void 0===(u=e[s])&&i.cacheRedirects&&"string"==typeof t){var c=i.cacheRedirects[t];if(c){var l=c[n];l&&(u=l(e,r,{getCacheKey:function(e){var t=i.dataIdFromObject(e);return t&&Object(pt.H)({id:t,typename:e.__typename})}}))}}if(void 0===u)return{result:u,missing:[{object:e,fieldName:s,tolerable:!1}]};Object(pt.w)(u)&&(u=u.json);return{result:u}}(e,t,n.name.value,Object(pt.b)(n,i),o,{resultKey:Object(pt.E)(n),directives:Object(pt.i)(n,i)});return Array.isArray(a.result)?this.combineExecResults(a,this.executeSubSelectedArray({field:n,array:a.result,execContext:r})):n.selectionSet?null==a.result?a:this.combineExecResults(a,this.executeSelectionSet({selectionSet:n.selectionSet,rootValue:a.result,execContext:r})):(Dn(n,a.result),this.freezeResults,a)},e.prototype.combineExecResults=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t.forEach((function(t){t.missing&&(e=e||[]).push.apply(e,t.missing)})),{result:t.pop().result,missing:e}},e.prototype.executeSubSelectedArray=function(e){var t,n=this,r=e.field,i=e.array,o=e.execContext;function a(e){return e.missing&&(t=t||[]).push.apply(t,e.missing),e.result}return i=i.map((function(e){return null===e?null:Array.isArray(e)?a(n.executeSubSelectedArray({field:r,array:e,execContext:o})):r.selectionSet?a(n.executeSelectionSet({selectionSet:r.selectionSet,rootValue:e,execContext:o})):(Dn(r,e),e)})),this.freezeResults,{result:i,missing:t}},e}();function Dn(e,t){if(!e.selectionSet&&Object(pt.u)(t))throw new yt.a(10)}function Mn(){return!0}var Ln=function(){function e(e){void 0===e&&(e=Object.create(null)),this.data=e}return e.prototype.toObject=function(){return this.data},e.prototype.get=function(e){return this.data[e]},e.prototype.set=function(e,t){this.data[e]=t},e.prototype.delete=function(e){this.data[e]=void 0},e.prototype.clear=function(){this.data=Object.create(null)},e.prototype.replace=function(e){this.data=e||Object.create(null)},e}();var Un=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="WriteError",t}return Object(ft.c)(t,e),t}(Error);var Bn=function(){function e(){}return e.prototype.writeQueryToStore=function(e){var t=e.query,n=e.result,r=e.store,i=void 0===r?qn():r,o=e.variables,a=e.dataIdFromObject,s=e.fragmentMatcherFunction;return this.writeResultToStore({dataId:"ROOT_QUERY",result:n,document:t,store:i,variables:o,dataIdFromObject:a,fragmentMatcherFunction:s})},e.prototype.writeResultToStore=function(e){var t=e.dataId,n=e.result,r=e.document,i=e.store,o=void 0===i?qn():i,a=e.variables,s=e.dataIdFromObject,u=e.fragmentMatcherFunction,c=Object(pt.m)(r);try{return this.writeSelectionSetToStore({result:n,dataId:t,selectionSet:c.selectionSet,context:{store:o,processedData:{},variables:Object(pt.c)({},Object(pt.h)(c),a),dataIdFromObject:s,fragmentMap:Object(pt.g)(Object(pt.j)(r)),fragmentMatcherFunction:u}})}catch(e){throw function(e,t){var n=new Un("Error writing result to store for query:\n "+JSON.stringify(t));return n.message+="\n"+e.message,n.stack=e.stack,n}(e,r)}},e.prototype.writeSelectionSetToStore=function(e){var t=this,n=e.result,r=e.dataId,i=e.selectionSet,o=e.context,a=o.variables,s=o.store,u=o.fragmentMap;return i.selections.forEach((function(e){var i;if(Object(pt.F)(e,a))if(Object(pt.t)(e)){var s=Object(pt.E)(e),c=n[s];if(void 0!==c)t.writeFieldToStore({dataId:r,value:c,field:e,context:o});else{var l=!1,h=!1;e.directives&&e.directives.length&&(l=e.directives.some((function(e){return e.name&&"defer"===e.name.value})),h=e.directives.some((function(e){return e.name&&"client"===e.name.value}))),!l&&!h&&o.fragmentMatcherFunction}}else{var f=void 0;Object(pt.v)(e)?f=e:(f=(u||{})[e.name.value],Object(yt.b)(f,3));var p=!0;if(o.fragmentMatcherFunction&&f.typeCondition){var d=r||"self",m=Object(pt.H)({id:d,typename:void 0}),v={store:new Ln((i={},i[d]=n,i)),cacheRedirects:{}},y=o.fragmentMatcherFunction(m,f.typeCondition.name.value,v);Object(pt.x)(),p=!!y}p&&t.writeSelectionSetToStore({result:n,selectionSet:f.selectionSet,dataId:r,context:o})}})),s},e.prototype.writeFieldToStore=function(e){var t,n,r,i=e.field,o=e.value,a=e.dataId,s=e.context,u=s.variables,c=s.dataIdFromObject,l=s.store,h=Object(pt.G)(i,u);if(i.selectionSet&&null!==o)if(Array.isArray(o)){var f=a+"."+h;n=this.processArrayValue(o,f,i.selectionSet,s)}else{var p=a+"."+h,d=!0;if(Qn(p)||(p="$"+p),c){var m=c(o);Object(yt.b)(!m||!Qn(m),4),(m||"number"==typeof m&&0===m)&&(p=m,d=!1)}$n(p,i,s.processedData)||this.writeSelectionSetToStore({dataId:p,result:o,selectionSet:i.selectionSet,context:s});var v=o.__typename;n=Object(pt.H)({id:p,typename:v},d);var y=(r=l.get(a))&&r[h];if(y!==n&&Object(pt.u)(y)){var b=void 0!==y.typename,g=void 0!==v,w=b&&g&&y.typename!==v;Object(yt.b)(!d||y.generated||w,5),Object(yt.b)(!b||g,6),y.generated&&(w?d||l.delete(y.id):function e(t,n,r){if(t===n)return!1;var i=r.get(t),o=r.get(n),a=!1;Object.keys(i).forEach((function(t){var n=i[t],s=o[t];Object(pt.u)(n)&&Qn(n.id)&&Object(pt.u)(s)&&!Object(dt.a)(n,s)&&e(n.id,s.id,r)&&(a=!0)})),r.delete(t);var s=Object(ft.a)(Object(ft.a)({},i),o);if(Object(dt.a)(s,o))return a;return r.set(n,s),!0}(y.id,n.id,l))}}else n=null!=o&&"object"==typeof o?{type:"json",json:o}:o;(r=l.get(a))&&Object(dt.a)(n,r[h])||l.set(a,Object(ft.a)(Object(ft.a)({},r),((t={})[h]=n,t)))},e.prototype.processArrayValue=function(e,t,n,r){var i=this;return e.map((function(e,o){if(null===e)return null;var a=t+"."+o;if(Array.isArray(e))return i.processArrayValue(e,a,n,r);var s=!0;if(r.dataIdFromObject){var u=r.dataIdFromObject(e);u&&(a=u,s=!1)}return $n(a,n,r.processedData)||i.writeSelectionSetToStore({dataId:a,result:e,selectionSet:n,context:r}),Object(pt.H)({id:a,typename:e.__typename},s)}))},e}();function Qn(e){return"$"===e[0]}function $n(e,t,n){if(!n)return!1;if(n[e]){if(n[e].indexOf(t)>=0)return!0;n[e].push(t)}else n[e]=[t];return!1}var Vn={fragmentMatcher:new In,dataIdFromObject:Gn,addTypename:!0,resultCaching:!0,freezeResults:!1};function Gn(e){if(e.__typename){if(void 0!==e.id)return e.__typename+":"+e.id;if(void 0!==e._id)return e.__typename+":"+e._id}return null}var zn=Object.prototype.hasOwnProperty,Kn=function(e){function t(t,n,r){var i=e.call(this,Object.create(null))||this;return i.optimisticId=t,i.parent=n,i.transaction=r,i}return Object(ft.c)(t,e),t.prototype.toObject=function(){return Object(ft.a)(Object(ft.a)({},this.parent.toObject()),this.data)},t.prototype.get=function(e){return zn.call(this.data,e)?this.data[e]:this.parent.get(e)},t}(Ln),Hn=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;n.watches=new Set,n.typenameDocumentCache=new Map,n.cacheKeyRoot=new kn(pt.e),n.silenceBroadcast=!1,n.config=Object(ft.a)(Object(ft.a)({},Vn),t),n.config.customResolvers&&(n.config.cacheRedirects=n.config.customResolvers),n.config.cacheResolvers&&(n.config.cacheRedirects=n.config.cacheResolvers),n.addTypename=!!n.config.addTypename,n.data=n.config.resultCaching?new Nn:new Ln,n.optimisticData=n.data,n.storeWriter=new Bn,n.storeReader=new Fn({cacheKeyRoot:n.cacheKeyRoot,freezeResults:t.freezeResults});var r=n,i=r.maybeBroadcastWatch;return n.maybeBroadcastWatch=jn((function(e){return i.call(n,e)}),{makeCacheKey:function(e){if(!e.optimistic&&!e.previousResult)return r.data instanceof Nn?r.cacheKeyRoot.lookup(e.query,JSON.stringify(e.variables)):void 0}}),n}return Object(ft.c)(t,e),t.prototype.restore=function(e){return e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).toObject()},t.prototype.read=function(e){if("string"==typeof e.rootId&&void 0===this.data.get(e.rootId))return null;var t=this.config.fragmentMatcher,n=t&&t.match;return this.storeReader.readQueryFromStore({store:e.optimistic?this.optimisticData:this.data,query:this.transformDocument(e.query),variables:e.variables,rootId:e.rootId,fragmentMatcherFunction:n,previousResult:e.previousResult,config:this.config})||null},t.prototype.write=function(e){var t=this.config.fragmentMatcher,n=t&&t.match;this.storeWriter.writeResultToStore({dataId:e.dataId,result:e.result,variables:e.variables,document:this.transformDocument(e.query),store:this.data,dataIdFromObject:this.config.dataIdFromObject,fragmentMatcherFunction:n}),this.broadcastWatches()},t.prototype.diff=function(e){var t=this.config.fragmentMatcher,n=t&&t.match;return this.storeReader.diffQueryAgainstStore({store:e.optimistic?this.optimisticData:this.data,query:this.transformDocument(e.query),variables:e.variables,returnPartialData:e.returnPartialData,previousResult:e.previousResult,fragmentMatcherFunction:n,config:this.config})},t.prototype.watch=function(e){var t=this;return this.watches.add(e),function(){t.watches.delete(e)}},t.prototype.evict=function(e){throw new yt.a(7)},t.prototype.reset=function(){return this.data.clear(),this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){for(var t=[],n=0,r=this.optimisticData;r instanceof Kn;)r.optimisticId===e?++n:t.push(r),r=r.parent;if(n>0){for(this.optimisticData=r;t.length>0;){var i=t.pop();this.performTransaction(i.transaction,i.optimisticId)}this.broadcastWatches()}},t.prototype.performTransaction=function(e,t){var n=this.data,r=this.silenceBroadcast;this.silenceBroadcast=!0,"string"==typeof t&&(this.data=this.optimisticData=new Kn(t,this.optimisticData,e));try{e(this)}finally{this.silenceBroadcast=r,this.data=n}this.broadcastWatches()},t.prototype.recordOptimisticTransaction=function(e,t){return this.performTransaction(e,t)},t.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(t=Object(pt.a)(e),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}return e},t.prototype.broadcastWatches=function(){var e=this;this.silenceBroadcast||this.watches.forEach((function(t){return e.maybeBroadcastWatch(t)}))},t.prototype.maybeBroadcastWatch=function(e){e.callback(this.diff({query:e.query,variables:e.variables,previousResult:e.previousResult&&e.previousResult(),optimistic:e.optimistic}))},t}(Xt),Wn=n(67),Jn={http:{includeQuery:!0,includeExtensions:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},Yn=function(e,t,n){var r=new Error(n);throw r.name="ServerError",r.response=e,r.statusCode=e.status,r.result=t,r},Xn=function(e,t){var n;try{n=JSON.stringify(e)}catch(e){var r=new yt.a(2);throw r.parseError=e,r}return n},Zn=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=Object(ft.e)(e,["uri","fetch","includeExtensions","useGETForQueries"]);!function(e){if(!e&&"undefined"==typeof fetch){throw"undefined"==typeof window&&"node-fetch",new yt.a(1)}}(r),r||(r=fetch);var s={http:{includeExtensions:i},options:a.fetchOptions,credentials:a.credentials,headers:a.headers};return new St((function(e){var t=function(e,t){var n=e.getContext().uri;return n||("function"==typeof t?t(e):t||"/graphql")}(e,n),i=e.getContext(),a={};if(i.clientAwareness){var u=i.clientAwareness,c=u.name,l=u.version;c&&(a["apollographql-client-name"]=c),l&&(a["apollographql-client-version"]=l)}var h,f=Object(ft.a)({},a,i.headers),p={http:i.http,options:i.fetchOptions,credentials:i.credentials,headers:f},d=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=Object(ft.a)({},t.options,{headers:t.headers,credentials:t.credentials}),o=t.http;n.forEach((function(e){i=Object(ft.a)({},i,e.options,{headers:Object(ft.a)({},i.headers,e.headers)}),e.credentials&&(i.credentials=e.credentials),o=Object(ft.a)({},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=Object(Wn.print)(c)),{options:i,body:l}}(e,Jn,s,p),m=d.options,v=d.body;if(!m.signal){var y=function(){if("undefined"==typeof AbortController)return{controller:!1,signal:!1};var e=new AbortController;return{controller:e,signal:e.signal}}(),b=y.controller,g=y.signal;(h=b)&&(m.signal=g)}if(o&&!e.query.definitions.some((function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation}))&&(m.method="GET"),"GET"===m.method){var w=function(e,t){var n=[],r=function(e,t){n.push(e+"="+encodeURIComponent(t))};"query"in t&&r("query",t.query);t.operationName&&r("operationName",t.operationName);if(t.variables){var i=void 0;try{i=Xn(t.variables)}catch(e){return{parseError:e}}r("variables",i)}if(t.extensions){var o=void 0;try{o=Xn(t.extensions)}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,v),O=w.newURI,R=w.parseError;if(R)return gt(R);t=O}else try{m.body=Xn(v)}catch(R){return gt(R)}return new vt((function(n){var i;return r(t,m).then((function(t){return e.setContext({response:t}),t})).then((i=e,function(e){return e.text().then((function(t){try{return JSON.parse(t)}catch(r){var n=r;return n.name="ServerParseError",n.response=e,n.statusCode=e.status,n.bodyText=t,Promise.reject(n)}})).then((function(t){return e.status>=300&&Yn(e,t,"Response not successful: Received status code "+e.status),Array.isArray(t)||t.hasOwnProperty("data")||t.hasOwnProperty("errors")||Yn(e,t,"Server response was missing for query '"+(Array.isArray(i)?i.map((function(e){return e.operationName})):i.operationName)+"'."),t}))})).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(){h&&h.abort()}}))}))};!function(e){function t(t){return e.call(this,Zn(t).request)||this}Object(ft.c)(t,e)}(St);var er=n(62),tr=n.n(er);var nr=function(){return(nr=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}).apply(this,arguments)};Object.create;Object.create;function rr(e){return(rr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}"function"==typeof Symbol&&null!=Symbol.iterator&&Symbol.iterator,"function"==typeof Symbol&&null!=Symbol.asyncIterator&&Symbol.asyncIterator;var ir="function"==typeof Symbol&&null!=Symbol.toStringTag?Symbol.toStringTag:"@@toStringTag";function or(e,t){for(var n,r=/\r\n|[\n\r]/g,i=1,o=t+1;(n=r.exec(e.body))&&n.index<t;)i+=1,o=t+1-(n.index+n[0].length);return{line:i,column:o}}function ar(e){return sr(e.source,or(e.source,e.start))}function sr(e,t){var n=e.locationOffset.column-1,r=cr(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="".concat(e.name,":").concat(a,":").concat(u,"\n"),l=r.split(/\r\n|[\n\r]/g),h=l[i];if(h.length>120){for(var f=Math.floor(u/80),p=u%80,d=[],m=0;m<h.length;m+=80)d.push(h.slice(m,m+80));return c+ur([["".concat(a),d[0]]].concat(d.slice(1,f+1).map((function(e){return["",e]})),[[" ",cr(p-1)+"^"],["",d[f+1]]]))}return c+ur([["".concat(a-1),l[i-1]],["".concat(a),h],["",cr(u-1)+"^"],["".concat(a+1),l[i+1]]])}function ur(e){var t=e.filter((function(e){e[0];return void 0!==e[1]})),n=Math.max.apply(Math,t.map((function(e){return e[0].length})));return t.map((function(e){var t,r=e[0],i=e[1];return cr(n-(t=r).length)+t+(i?" | "+i:" |")})).join("\n")}function cr(e){return Array(e+1).join(" ")}function lr(e){return(lr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function hr(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 fr(e,t){return!t||"object"!==lr(t)&&"function"!=typeof t?pr(e):t}function pr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dr(e){var t="function"==typeof Map?new Map:void 0;return(dr=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return mr(e,arguments,br(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),yr(r,e)})(e)}function mr(e,t,n){return(mr=vr()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&yr(i,n.prototype),i}).apply(null,arguments)}function vr(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function yr(e,t){return(yr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function br(e){return(br=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var gr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&yr(e,t)}(s,e);var t,n,r,i,o,a=(t=s,n=vr(),function(){var e,r=br(t);if(n){var i=br(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fr(this,e)});function s(e,t,n,r,i,o,u){var c,l,h,f,p;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),p=a.call(this,e);var d,m=Array.isArray(t)?0!==t.length?t:void 0:t?[t]:void 0,v=n;!v&&m&&(v=null===(d=m[0].loc)||void 0===d?void 0:d.source);var y,b=r;!b&&m&&(b=m.reduce((function(e,t){return t.loc&&e.push(t.loc.start),e}),[])),b&&0===b.length&&(b=void 0),r&&n?y=r.map((function(e){return or(n,e)})):m&&(y=m.reduce((function(e,t){return t.loc&&e.push(or(t.loc.source,t.loc.start)),e}),[]));var g,w=u;if(null==w&&null!=o){var O=o.extensions;"object"==rr(g=O)&&null!==g&&(w=O)}return Object.defineProperties(pr(p),{name:{value:"GraphQLError"},message:{value:e,enumerable:!0,writable:!0},locations:{value:null!==(c=y)&&void 0!==c?c:void 0,enumerable:null!=y},path:{value:null!=i?i:void 0,enumerable:null!=i},nodes:{value:null!=m?m:void 0},source:{value:null!==(l=v)&&void 0!==l?l:void 0},positions:{value:null!==(h=b)&&void 0!==h?h:void 0},originalError:{value:o},extensions:{value:null!==(f=w)&&void 0!==f?f:void 0,enumerable:null!=w}}),null!=o&&o.stack?(Object.defineProperty(pr(p),"stack",{value:o.stack,writable:!0,configurable:!0}),fr(p)):(Error.captureStackTrace?Error.captureStackTrace(pr(p),s):Object.defineProperty(pr(p),"stack",{value:Error().stack,writable:!0,configurable:!0}),p)}return r=s,(i=[{key:"toString",value:function(){return function(e){var t=e.message;if(e.nodes)for(var n=0,r=e.nodes;n<r.length;n++){var i=r[n];i.loc&&(t+="\n\n"+ar(i.loc))}else if(e.source&&e.locations)for(var o=0,a=e.locations;o<a.length;o++){var s=a[o];t+="\n\n"+sr(e.source,s)}return t}(this)}},{key:ir,get:function(){return"Object"}}])&&hr(r.prototype,i),o&&hr(r,o),s}(dr(Error));function wr(e,t,n){return new gr("Syntax Error: ".concat(n),void 0,e,[t])}var Or=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});var Rr="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;function Er(e){var t=e.prototype.toJSON;"function"==typeof t||function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}(0),e.prototype.inspect=t,Rr&&(e.prototype[Rr]=t)}var kr=function(){function e(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();Er(kr);var xr=function(){function e(e,t,n,r,i,o,a){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=a,this.prev=o,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();Er(xr);var Sr=Object.freeze({SOF:"<SOF>",EOF:"<EOF>",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"});function _r(e){return(_r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function jr(e){return Pr(e,[])}function Pr(e,t){switch(_r(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var n=[].concat(t,[e]),r=function(e){var t=e[String(Rr)];if("function"==typeof t)return t;if("function"==typeof e.inspect)return e.inspect}(e);if(void 0!==r){var i=r.call(e);if(i!==e)return"string"==typeof i?i:Pr(i,n)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var n=Math.min(10,e.length),r=e.length-n,i=[],o=0;o<n;++o)i.push(Pr(e[o],t));1===r?i.push("... 1 more item"):r>1&&i.push("... ".concat(r," more items"));return"["+i.join(", ")+"]"}(e,n);return function(e,t){var n=Object.keys(e);if(0===n.length)return"{}";if(t.length>2)return"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var n=e.constructor.name;if("string"==typeof n&&""!==n)return n}return t}(e)+"]";return"{ "+n.map((function(n){return n+": "+Pr(e[n],t)})).join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}function Tr(e,t){if(!Boolean(e))throw new Error(t)}var Ir=function(e,t){return e instanceof t};function Cr(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)}}var Ar=function(){function e(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GraphQL request",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{line:1,column:1};"string"==typeof e||Tr(0,"Body must be a string. Received: ".concat(jr(e),".")),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||Tr(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Tr(0,"column in locationOffset is 1-indexed and must be positive.")}var t,n,r;return t=e,(n=[{key:ir,get:function(){return"Source"}}])&&Cr(t.prototype,n),r&&Cr(t,r),e}();var Nr=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});function qr(e){var t=e.split(/\r\n|[\n\r]/g),n=function(e){for(var t,n=!0,r=!0,i=0,o=null,a=0;a<e.length;++a)switch(e.charCodeAt(a)){case 13:10===e.charCodeAt(a+1)&&++a;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(var r=1;r<t.length;r++)t[r]=t[r].slice(n);for(var i=0;i<t.length&&Fr(t[i]);)++i;for(var o=t.length;o>i&&Fr(t[o-1]);)--o;return t.slice(i,o).join("\n")}function Fr(e){for(var t=0;t<e.length;++t)if(" "!==e[t]&&"\t"!==e[t])return!1;return!0}var Dr=function(){function e(e){var t=new xr(Sr.SOF,0,0,0,0,null);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}var t=e.prototype;return t.advance=function(){return this.lastToken=this.token,this.token=this.lookahead()},t.lookahead=function(){var e=this.token;if(e.kind!==Sr.EOF)do{var t;e=null!==(t=e.next)&&void 0!==t?t:e.next=Lr(this,e)}while(e.kind===Sr.COMMENT);return e},e}();function Mr(e){return isNaN(e)?Sr.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function Lr(e,t){for(var n=e.source,r=n.body,i=r.length,o=t.end;o<i;){var a=r.charCodeAt(o),s=e.line,u=1+o-e.lineStart;switch(a){case 65279:case 9:case 32:case 44:++o;continue;case 10:++o,++e.line,e.lineStart=o;continue;case 13:10===r.charCodeAt(o+1)?o+=2:++o,++e.line,e.lineStart=o;continue;case 33:return new xr(Sr.BANG,o,o+1,s,u,t);case 35:return Br(n,o,s,u,t);case 36:return new xr(Sr.DOLLAR,o,o+1,s,u,t);case 38:return new xr(Sr.AMP,o,o+1,s,u,t);case 40:return new xr(Sr.PAREN_L,o,o+1,s,u,t);case 41:return new xr(Sr.PAREN_R,o,o+1,s,u,t);case 46:if(46===r.charCodeAt(o+1)&&46===r.charCodeAt(o+2))return new xr(Sr.SPREAD,o,o+3,s,u,t);break;case 58:return new xr(Sr.COLON,o,o+1,s,u,t);case 61:return new xr(Sr.EQUALS,o,o+1,s,u,t);case 64:return new xr(Sr.AT,o,o+1,s,u,t);case 91:return new xr(Sr.BRACKET_L,o,o+1,s,u,t);case 93:return new xr(Sr.BRACKET_R,o,o+1,s,u,t);case 123:return new xr(Sr.BRACE_L,o,o+1,s,u,t);case 124:return new xr(Sr.PIPE,o,o+1,s,u,t);case 125:return new xr(Sr.BRACE_R,o,o+1,s,u,t);case 34:return 34===r.charCodeAt(o+1)&&34===r.charCodeAt(o+2)?Gr(n,o,s,u,t,e):Vr(n,o,s,u,t);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return Qr(n,o,a,s,u,t);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return Kr(n,o,s,u,t)}throw wr(n,o,Ur(a))}var c=e.line,l=1+o-e.lineStart;return new xr(Sr.EOF,i,i,c,l,t)}function Ur(e){return e<32&&9!==e&&10!==e&&13!==e?"Cannot contain the invalid character ".concat(Mr(e),"."):39===e?"Unexpected single quote character ('), did you mean to use a double quote (\")?":"Cannot parse the unexpected character ".concat(Mr(e),".")}function Br(e,t,n,r,i){var o,a=e.body,s=t;do{o=a.charCodeAt(++s)}while(!isNaN(o)&&(o>31||9===o));return new xr(Sr.COMMENT,t,s,n,r,i,a.slice(t+1,s))}function Qr(e,t,n,r,i,o){var a=e.body,s=n,u=t,c=!1;if(45===s&&(s=a.charCodeAt(++u)),48===s){if((s=a.charCodeAt(++u))>=48&&s<=57)throw wr(e,u,"Invalid number, unexpected digit after 0: ".concat(Mr(s),"."))}else u=$r(e,u,s),s=a.charCodeAt(u);if(46===s&&(c=!0,s=a.charCodeAt(++u),u=$r(e,u,s),s=a.charCodeAt(u)),69!==s&&101!==s||(c=!0,43!==(s=a.charCodeAt(++u))&&45!==s||(s=a.charCodeAt(++u)),u=$r(e,u,s),s=a.charCodeAt(u)),46===s||function(e){return 95===e||e>=65&&e<=90||e>=97&&e<=122}(s))throw wr(e,u,"Invalid number, expected digit but got: ".concat(Mr(s),"."));return new xr(c?Sr.FLOAT:Sr.INT,t,u,r,i,o,a.slice(t,u))}function $r(e,t,n){var r=e.body,i=t,o=n;if(o>=48&&o<=57){do{o=r.charCodeAt(++i)}while(o>=48&&o<=57);return i}throw wr(e,i,"Invalid number, expected digit but got: ".concat(Mr(o),"."))}function Vr(e,t,n,r,i){for(var o,a,s,u,c=e.body,l=t+1,h=l,f=0,p="";l<c.length&&!isNaN(f=c.charCodeAt(l))&&10!==f&&13!==f;){if(34===f)return p+=c.slice(h,l),new xr(Sr.STRING,t,l+1,n,r,i,p);if(f<32&&9!==f)throw wr(e,l,"Invalid character within String: ".concat(Mr(f),"."));if(++l,92===f){switch(p+=c.slice(h,l-1),f=c.charCodeAt(l)){case 34:p+='"';break;case 47:p+="/";break;case 92:p+="\\";break;case 98:p+="\b";break;case 102:p+="\f";break;case 110:p+="\n";break;case 114:p+="\r";break;case 116:p+="\t";break;case 117:var d=(o=c.charCodeAt(l+1),a=c.charCodeAt(l+2),s=c.charCodeAt(l+3),u=c.charCodeAt(l+4),zr(o)<<12|zr(a)<<8|zr(s)<<4|zr(u));if(d<0){var m=c.slice(l+1,l+5);throw wr(e,l,"Invalid character escape sequence: \\u".concat(m,"."))}p+=String.fromCharCode(d),l+=4;break;default:throw wr(e,l,"Invalid character escape sequence: \\".concat(String.fromCharCode(f),"."))}h=++l}}throw wr(e,l,"Unterminated string.")}function Gr(e,t,n,r,i,o){for(var a=e.body,s=t+3,u=s,c=0,l="";s<a.length&&!isNaN(c=a.charCodeAt(s));){if(34===c&&34===a.charCodeAt(s+1)&&34===a.charCodeAt(s+2))return l+=a.slice(u,s),new xr(Sr.BLOCK_STRING,t,s+3,n,r,i,qr(l));if(c<32&&9!==c&&10!==c&&13!==c)throw wr(e,s,"Invalid character within String: ".concat(Mr(c),"."));10===c?(++s,++o.line,o.lineStart=s):13===c?(10===a.charCodeAt(s+1)?s+=2:++s,++o.line,o.lineStart=s):92===c&&34===a.charCodeAt(s+1)&&34===a.charCodeAt(s+2)&&34===a.charCodeAt(s+3)?(l+=a.slice(u,s)+'"""',u=s+=4):++s}throw wr(e,s,"Unterminated string.")}function zr(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Kr(e,t,n,r,i){for(var o=e.body,a=o.length,s=t+1,u=0;s!==a&&!isNaN(u=o.charCodeAt(s))&&(95===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new xr(Sr.NAME,t,s,n,r,i,o.slice(t,s))}var Hr=function(){function e(e,t){var n=function(e){return Ir(e,Ar)}(e)?e:new Ar(e);this._lexer=new Dr(n),this._options=t}var t=e.prototype;return t.parseName=function(){var e=this.expectToken(Sr.NAME);return{kind:Or.NAME,value:e.value,loc:this.loc(e)}},t.parseDocument=function(){var e=this._lexer.token;return{kind:Or.DOCUMENT,definitions:this.many(Sr.SOF,this.parseDefinition,Sr.EOF),loc:this.loc(e)}},t.parseDefinition=function(){if(this.peek(Sr.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(Sr.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},t.parseOperationDefinition=function(){var e=this._lexer.token;if(this.peek(Sr.BRACE_L))return{kind:Or.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(e)};var t,n=this.parseOperationType();return this.peek(Sr.NAME)&&(t=this.parseName()),{kind:Or.OPERATION_DEFINITION,operation:n,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseOperationType=function(){var e=this.expectToken(Sr.NAME);switch(e.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(e)},t.parseVariableDefinitions=function(){return this.optionalMany(Sr.PAREN_L,this.parseVariableDefinition,Sr.PAREN_R)},t.parseVariableDefinition=function(){var e=this._lexer.token;return{kind:Or.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(Sr.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(Sr.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(e)}},t.parseVariable=function(){var e=this._lexer.token;return this.expectToken(Sr.DOLLAR),{kind:Or.VARIABLE,name:this.parseName(),loc:this.loc(e)}},t.parseSelectionSet=function(){var e=this._lexer.token;return{kind:Or.SELECTION_SET,selections:this.many(Sr.BRACE_L,this.parseSelection,Sr.BRACE_R),loc:this.loc(e)}},t.parseSelection=function(){return this.peek(Sr.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var e,t,n=this._lexer.token,r=this.parseName();return this.expectOptionalToken(Sr.COLON)?(e=r,t=this.parseName()):t=r,{kind:Or.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(Sr.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},t.parseArguments=function(e){var t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(Sr.PAREN_L,t,Sr.PAREN_R)},t.parseArgument=function(){var e=this._lexer.token,t=this.parseName();return this.expectToken(Sr.COLON),{kind:Or.ARGUMENT,name:t,value:this.parseValueLiteral(!1),loc:this.loc(e)}},t.parseConstArgument=function(){var e=this._lexer.token;return{kind:Or.ARGUMENT,name:this.parseName(),value:(this.expectToken(Sr.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},t.parseFragment=function(){var e=this._lexer.token;this.expectToken(Sr.SPREAD);var t=this.expectOptionalKeyword("on");return!t&&this.peek(Sr.NAME)?{kind:Or.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:Or.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseFragmentDefinition=function(){var e,t=this._lexer.token;return this.expectKeyword("fragment"),!0===(null===(e=this._options)||void 0===e?void 0:e.experimentalFragmentVariables)?{kind:Or.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}:{kind:Or.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}},t.parseFragmentName=function(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(e){var t=this._lexer.token;switch(t.kind){case Sr.BRACKET_L:return this.parseList(e);case Sr.BRACE_L:return this.parseObject(e);case Sr.INT:return this._lexer.advance(),{kind:Or.INT,value:t.value,loc:this.loc(t)};case Sr.FLOAT:return this._lexer.advance(),{kind:Or.FLOAT,value:t.value,loc:this.loc(t)};case Sr.STRING:case Sr.BLOCK_STRING:return this.parseStringLiteral();case Sr.NAME:switch(this._lexer.advance(),t.value){case"true":return{kind:Or.BOOLEAN,value:!0,loc:this.loc(t)};case"false":return{kind:Or.BOOLEAN,value:!1,loc:this.loc(t)};case"null":return{kind:Or.NULL,loc:this.loc(t)};default:return{kind:Or.ENUM,value:t.value,loc:this.loc(t)}}case Sr.DOLLAR:if(!e)return this.parseVariable()}throw this.unexpected()},t.parseStringLiteral=function(){var e=this._lexer.token;return this._lexer.advance(),{kind:Or.STRING,value:e.value,block:e.kind===Sr.BLOCK_STRING,loc:this.loc(e)}},t.parseList=function(e){var t=this,n=this._lexer.token;return{kind:Or.LIST,values:this.any(Sr.BRACKET_L,(function(){return t.parseValueLiteral(e)}),Sr.BRACKET_R),loc:this.loc(n)}},t.parseObject=function(e){var t=this,n=this._lexer.token;return{kind:Or.OBJECT,fields:this.any(Sr.BRACE_L,(function(){return t.parseObjectField(e)}),Sr.BRACE_R),loc:this.loc(n)}},t.parseObjectField=function(e){var t=this._lexer.token,n=this.parseName();return this.expectToken(Sr.COLON),{kind:Or.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e),loc:this.loc(t)}},t.parseDirectives=function(e){for(var t=[];this.peek(Sr.AT);)t.push(this.parseDirective(e));return t},t.parseDirective=function(e){var t=this._lexer.token;return this.expectToken(Sr.AT),{kind:Or.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(t)}},t.parseTypeReference=function(){var e,t=this._lexer.token;return this.expectOptionalToken(Sr.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(Sr.BRACKET_R),e={kind:Or.LIST_TYPE,type:e,loc:this.loc(t)}):e=this.parseNamedType(),this.expectOptionalToken(Sr.BANG)?{kind:Or.NON_NULL_TYPE,type:e,loc:this.loc(t)}:e},t.parseNamedType=function(){var e=this._lexer.token;return{kind:Or.NAMED_TYPE,name:this.parseName(),loc:this.loc(e)}},t.parseTypeSystemDefinition=function(){var e=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(e.kind===Sr.NAME)switch(e.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(e)},t.peekDescription=function(){return this.peek(Sr.STRING)||this.peek(Sr.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");var n=this.parseDirectives(!0),r=this.many(Sr.BRACE_L,this.parseOperationTypeDefinition,Sr.BRACE_R);return{kind:Or.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r,loc:this.loc(e)}},t.parseOperationTypeDefinition=function(){var e=this._lexer.token,t=this.parseOperationType();this.expectToken(Sr.COLON);var n=this.parseNamedType();return{kind:Or.OPERATION_TYPE_DEFINITION,operation:t,type:n,loc:this.loc(e)}},t.parseScalarTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");var n=this.parseName(),r=this.parseDirectives(!0);return{kind:Or.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r,loc:this.loc(e)}},t.parseObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");var n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),o=this.parseFieldsDefinition();return{kind:Or.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o,loc:this.loc(e)}},t.parseImplementsInterfaces=function(){var e;if(!this.expectOptionalKeyword("implements"))return[];if(!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLImplementsInterfaces)){var t=[];this.expectOptionalToken(Sr.AMP);do{t.push(this.parseNamedType())}while(this.expectOptionalToken(Sr.AMP)||this.peek(Sr.NAME));return t}return this.delimitedMany(Sr.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var e;return!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLEmptyFields)&&this.peek(Sr.BRACE_L)&&this._lexer.lookahead().kind===Sr.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(Sr.BRACE_L,this.parseFieldDefinition,Sr.BRACE_R)},t.parseFieldDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(Sr.COLON);var i=this.parseTypeReference(),o=this.parseDirectives(!0);return{kind:Or.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:o,loc:this.loc(e)}},t.parseArgumentDefs=function(){return this.optionalMany(Sr.PAREN_L,this.parseInputValueDef,Sr.PAREN_R)},t.parseInputValueDef=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(Sr.COLON);var r,i=this.parseTypeReference();this.expectOptionalToken(Sr.EQUALS)&&(r=this.parseValueLiteral(!0));var o=this.parseDirectives(!0);return{kind:Or.INPUT_VALUE_DEFINITION,description:t,name:n,type:i,defaultValue:r,directives:o,loc:this.loc(e)}},t.parseInterfaceTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");var n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),o=this.parseFieldsDefinition();return{kind:Or.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o,loc:this.loc(e)}},t.parseUnionTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseUnionMemberTypes();return{kind:Or.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i,loc:this.loc(e)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(Sr.EQUALS)?this.delimitedMany(Sr.PIPE,this.parseNamedType):[]},t.parseEnumTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseEnumValuesDefinition();return{kind:Or.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i,loc:this.loc(e)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(Sr.BRACE_L,this.parseEnumValueDefinition,Sr.BRACE_R)},t.parseEnumValueDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseDirectives(!0);return{kind:Or.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r,loc:this.loc(e)}},t.parseInputObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseInputFieldsDefinition();return{kind:Or.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i,loc:this.loc(e)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(Sr.BRACE_L,this.parseInputValueDef,Sr.BRACE_R)},t.parseTypeSystemExtension=function(){var e=this._lexer.lookahead();if(e.kind===Sr.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)},t.parseSchemaExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var t=this.parseDirectives(!0),n=this.optionalMany(Sr.BRACE_L,this.parseOperationTypeDefinition,Sr.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return{kind:Or.SCHEMA_EXTENSION,directives:t,operationTypes:n,loc:this.loc(e)}},t.parseScalarTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var t=this.parseName(),n=this.parseDirectives(!0);if(0===n.length)throw this.unexpected();return{kind:Or.SCALAR_TYPE_EXTENSION,name:t,directives:n,loc:this.loc(e)}},t.parseObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return{kind:Or.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i,loc:this.loc(e)}},t.parseInterfaceTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return{kind:Or.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i,loc:this.loc(e)}},t.parseUnionTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseUnionMemberTypes();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:Or.UNION_TYPE_EXTENSION,name:t,directives:n,types:r,loc:this.loc(e)}},t.parseEnumTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseEnumValuesDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:Or.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r,loc:this.loc(e)}},t.parseInputObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseInputFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:Or.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r,loc:this.loc(e)}},t.parseDirectiveDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(Sr.AT);var n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var o=this.parseDirectiveLocations();return{kind:Or.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:o,loc:this.loc(e)}},t.parseDirectiveLocations=function(){return this.delimitedMany(Sr.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var e=this._lexer.token,t=this.parseName();if(void 0!==Nr[t.value])return t;throw this.unexpected(e)},t.loc=function(e){var t;if(!0!==(null===(t=this._options)||void 0===t?void 0:t.noLocation))return new kr(e,this._lexer.lastToken,this._lexer.source)},t.peek=function(e){return this._lexer.token.kind===e},t.expectToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw wr(this._lexer.source,t.start,"Expected ".concat(Jr(e),", found ").concat(Wr(t),"."))},t.expectOptionalToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t},t.expectKeyword=function(e){var t=this._lexer.token;if(t.kind!==Sr.NAME||t.value!==e)throw wr(this._lexer.source,t.start,'Expected "'.concat(e,'", found ').concat(Wr(t),"."));this._lexer.advance()},t.expectOptionalKeyword=function(e){var t=this._lexer.token;return t.kind===Sr.NAME&&t.value===e&&(this._lexer.advance(),!0)},t.unexpected=function(e){var t=null!=e?e:this._lexer.token;return wr(this._lexer.source,t.start,"Unexpected ".concat(Wr(t),"."))},t.any=function(e,t,n){this.expectToken(e);for(var r=[];!this.expectOptionalToken(n);)r.push(t.call(this));return r},t.optionalMany=function(e,t,n){if(this.expectOptionalToken(e)){var r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}return[]},t.many=function(e,t,n){this.expectToken(e);var r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r},t.delimitedMany=function(e,t){this.expectOptionalToken(e);var n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n},e}();function Wr(e){var t=e.value;return Jr(e.kind)+(null!=t?' "'.concat(t,'"'):"")}function Jr(e){return function(e){return e===Sr.BANG||e===Sr.DOLLAR||e===Sr.AMP||e===Sr.PAREN_L||e===Sr.PAREN_R||e===Sr.SPREAD||e===Sr.COLON||e===Sr.EQUALS||e===Sr.AT||e===Sr.BRACKET_L||e===Sr.BRACKET_R||e===Sr.BRACE_L||e===Sr.PIPE||e===Sr.BRACE_R}(e)?'"'.concat(e,'"'):e}var Yr=new Map,Xr=new Map,Zr=!0,ei=!1;function ti(e){return e.replace(/[\s,]+/g," ").trim()}function ni(e){var t=new Set,n=[];return e.definitions.forEach((function(e){if("FragmentDefinition"===e.kind){var r=e.name.value,i=ti((a=e.loc).source.body.substring(a.start,a.end)),o=Xr.get(r);o&&!o.has(i)?Zr&&console.warn("Warning: fragment with name "+r+" 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||Xr.set(r,o=new Set),o.add(i),t.has(i)||(t.add(i),n.push(e))}else n.push(e);var a})),nr(nr({},e),{definitions:n})}function ri(e){var t=ti(e);if(!Yr.has(t)){var n=function(e,t){return new Hr(e,t).parseDocument()}(e,{experimentalFragmentVariables:ei});if(!n||"Document"!==n.kind)throw new Error("Not a valid GraphQL document.");Yr.set(t,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}(ni(n)))}return Yr.get(t)}function ii(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]})),ri(r)}var oi,ai={gql:ii,resetCaches:function(){Yr.clear(),Xr.clear()},disableFragmentWarnings:function(){Zr=!1},enableExperimentalFragmentVariables:function(){ei=!0},disableExperimentalFragmentVariables:function(){ei=!1}};(oi=ii||(ii={})).gql=ai.gql,oi.resetCaches=ai.resetCaches,oi.disableFragmentWarnings=ai.disableFragmentWarnings,oi.enableExperimentalFragmentVariables=ai.enableExperimentalFragmentVariables,oi.disableExperimentalFragmentVariables=ai.disableExperimentalFragmentVariables,ii.default=ii;const si=ii`
    fragment RepositoryParts on Repository {
      id
      isFork
    }
  `,ui=ii`
    fragment BlobWithTextParts on Blob {
      id
      text
      is_binary: isBinary
    }
  `,ci=ii`
    fragment ObjectParts on GitObject {
      id
      sha: oid
    }
  `,li=ii`
    fragment BranchParts on Ref {
      commit: target {
        ...ObjectParts
      }
      id
      name
      prefix
      repository {
        ...RepositoryParts
      }
    }
    ${ci}
    ${si}
  `,hi=ii`
    fragment PullRequestParts on PullRequest {
      id
      baseRefName
      baseRefOid
      body
      headRefName
      headRefOid
      number
      state
      title
      merged_at: mergedAt
      repository {
        ...RepositoryParts
      }
      labels(last: 100) {
        nodes {
          name
        }
      }
    }
    ${si}
  `,fi=(ii`
    fragment TreeEntryParts on TreeEntry {
      path: name
      sha: oid
      type
      mode
    }
  `,ii`
    fragment FileEntryParts on TreeEntry {
      name
      sha: oid
      type
      blob: object {
        ... on Blob {
          size: byteSize
        }
      }
    }
  `),pi=ii`
    query repoPermission($owner: String!, $name: String!) {
      repository(owner: $owner, name: $name) {
        ...RepositoryParts
        viewerPermission
      }
    }
    ${si}
  `,di=ii`
    query {
      viewer {
        id
        avatar_url: avatarUrl
        name
        login
      }
    }
  `,mi=ii`
    query blob($owner: String!, $name: String!, $expression: String!) {
      repository(owner: $owner, name: $name) {
        ...RepositoryParts
        object(expression: $expression) {
          ... on Blob {
            ...BlobWithTextParts
          }
        }
      }
    }
    ${si}
    ${ui}
  `,vi=ii`
    query statues($owner: String!, $name: String!, $sha: GitObjectID!) {
      repository(owner: $owner, name: $name) {
        ...RepositoryParts
        object(oid: $sha) {
          ...ObjectParts
          ... on Commit {
            status {
              id
              contexts {
                id
                context
                state
                target_url: targetUrl
              }
            }
          }
        }
      }
    }
    ${si}
    ${ci}
  `;function yi(e){return ii`
      query files($owner: String!, $name: String!, $expression: String!) {
        repository(owner: $owner, name: $name) {
          ...RepositoryParts
          object(expression: $expression) {
            ${function(e=1){let t=x`
      ...ObjectParts
      ... on Tree {
        entries {
          ...FileEntryParts
          ${"PLACE_HOLDER"}
        }
      }
    `;for(let n=0;n<e-1;n++)t=t.replace("PLACE_HOLDER",x`
          object {
            ... on Tree {
              entries {
                ...FileEntryParts
                ${"PLACE_HOLDER"}
              }
            }
          }
      `);return t=t.replace("PLACE_HOLDER",""),t}(e)}
          }
        }
      }
      ${si}
      ${ci}
      ${fi}
    `}const bi="\nbranch: ref(qualifiedName: $qualifiedName) {\n  ...BranchParts\n}\n",gi=ii`
    query branch($owner: String!, $name: String!, $qualifiedName: String!) {
      repository(owner: $owner, name: $name) {
        ...RepositoryParts
        ${bi}
      }
    }
    ${si}
    ${li}
  `,wi=ii`
    query openAuthoringBranches($owner: String!, $name: String!, $refPrefix: String!) {
      repository(owner: $owner, name: $name) {
        ...RepositoryParts
        refs(refPrefix: $refPrefix, last: 100) {
          nodes {
            ...BranchParts
          }
        }
      }
    }
    ${si}
    ${li}
  `,Oi=ii`
    query repository($owner: String!, $name: String!) {
      repository(owner: $owner, name: $name) {
        ...RepositoryParts
      }
    }
    ${si}
  `,Ri=ii`
    query pullRequest($owner: String!, $name: String!, $number: Int!) {
      repository(owner: $owner, name: $name) {
        id
        ${"\npullRequest(number: $number) {\n  ...PullRequestParts\n}\n"}
      }
    }
    ${hi}
  `,Ei=ii`
    query pullRequests($owner: String!, $name: String!, $head: String, $states: [PullRequestState!]) {
      repository(owner: $owner, name: $name) {
        id
        pullRequests(last: 100, headRefName: $head, states: $states) {
          nodes {
            ...PullRequestParts
          }
        }
      }
    }
    ${hi}
  `,ki=ii`
    query pullRequestAndBranch($owner: String!, $name: String!, $originRepoOwner: String!, $originRepoName: String!, $qualifiedName: String!, $number: Int!) {
      repository(owner: $owner, name: $name) {
        ...RepositoryParts
        ${bi}
      }
      origin: repository(owner: $originRepoOwner, name: $originRepoName) {
        ...RepositoryParts
        ${"\npullRequest(number: $number) {\n  ...PullRequestParts\n}\n"}
      }
    }
    ${si}
    ${li}
    ${hi}
  `,xi=ii`
    query fileSha($owner: String!, $name: String!, $expression: String!) {
      repository(owner: $owner, name: $name) {
        ...RepositoryParts
        file: object(expression: $expression) {
          ...ObjectParts
        }
      }
    }
    ${si}
    ${ci}
  `,Si=ii`
    mutation updateRef($input: UpdateRefInput!) {
      updateRef(input: $input) {
        branch: ref {
          ...BranchParts
        }
      }
    }
    ${li}
  `,_i=ii`
    mutation deleteRef($deleteRefInput: DeleteRefInput!) {
      ${"\ndeleteRef(input: $deleteRefInput) {\n  clientMutationId\n}\n"}
    }
  `,ji="\nclosePullRequest(input: $closePullRequestInput) {\n  clientMutationId\n  pullRequest {\n    ...PullRequestParts\n  }\n}\n",Pi=ii`
    mutation closePullRequestAndDeleteBranch($closePullRequestInput: ClosePullRequestInput!) {
      ${ji}
    }
    ${hi}
  `,Ti=ii`
    mutation closePullRequestAndDeleteBranch(
      $closePullRequestInput: ClosePullRequestInput!
      $deleteRefInput: DeleteRefInput!
    ) {
      ${ji}
      ${"\ndeleteRef(input: $deleteRefInput) {\n  clientMutationId\n}\n"}
    }
    ${hi}
  `,Ii="\n createPullRequest(input: $createPullRequestInput) {\n  clientMutationId\n  pullRequest {\n    ...PullRequestParts\n  }\n}\n ",Ci=ii`
    mutation createPullRequest($createPullRequestInput: CreatePullRequestInput!) {
      ${Ii}
    }
    ${hi}
  `,Ai=ii`
    mutation createBranch($createRefInput: CreateRefInput!) {
      createRef(input: $createRefInput) {
        branch: ref {
          ...BranchParts
        }
      }
    }
    ${li}
  `,Ni=ii`
    mutation createBranchAndPullRequest(
      $createRefInput: CreateRefInput!
      $createPullRequestInput: CreatePullRequestInput!
    ) {
      createRef(input: $createRefInput) {
        branch: ref {
          ...BranchParts
        }
      }
      ${Ii}
    }
    ${li}
    ${hi}
  `,qi=ii`
    mutation reopenPullRequest($reopenPullRequestInput: ReopenPullRequestInput!) {
      reopenPullRequest(input: $reopenPullRequestInput) {
        clientMutationId
        pullRequest {
          ...PullRequestParts
        }
      }
    }
    ${hi}
  `;function Fi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Di(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fi(Object(n),!0).forEach((function(t){Mi(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Mi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Li=new Cn({introspectionQueryResultData:tr.a});function Ui(e){return Di(Di({},e),{},{labels:e.labels.nodes,head:{ref:e.headRefName,sha:e.headRefOid,repo:{fork:e.repository.isFork}},base:{ref:e.baseRefName,sha:e.baseRefOid}})}class Bi extends ht{constructor(e){super(e),Mi(this,"client",void 0),this.client=this.getApolloClient()}getApolloClient(){const e=(t=(e,{headers:t})=>({headers:Di(Di({"Content-Type":"application/json; charset=utf-8"},t),{},{authorization:this.token?"token "+this.token:""})}),new St((function(e,n){var r=Object(ft.e)(e,[]);return new vt((function(i){var o;return Promise.resolve(r).then((function(n){return t(n,e.getContext())})).then(e.setContext).then((function(){o=n(e).subscribe({next:i.next.bind(i),error:i.error.bind(i),complete:i.complete.bind(i)})})).catch(i.error.bind(i)),function(){o&&o.unsubscribe()}}))})));var t;const n=Zn({uri:this.apiRoot+"/graphql"});return new Kt({link:e.concat(n),cache:new Hn({fragmentMatcher:Li}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache",errorPolicy:"ignore"},query:{fetchPolicy:"no-cache",errorPolicy:"all"}}})}reset(){return this.client.resetStore()}async getRepository(e,t){const{data:n}=await this.query({query:Oi,variables:{owner:e,name:t},fetchPolicy:"cache-first"});return n.repository}query(e){return this.client.query(e).catch(e=>{throw new _.APIError(e.message,500,"GitHub")})}async mutate(e){try{return await this.client.mutate(e)}catch(s){const u=s.graphQLErrors;if(Array.isArray(u)&&u.some(e=>"Ref cannot be created."===e.message)){var t,n;const r=(null==e||null===(t=e.variables)||void 0===t||null===(n=t.createRefInput)||void 0===n?void 0:n.name)||"",i=l()(r,"refs/heads/");i&&await Object(_.throwOnConflictingBranches)(i,e=>this.getBranch(e),"GitHub")}else if(Array.isArray(u)&&u.some(e=>new RegExp(`A ref named "refs/heads/${_.CMS_BRANCH_PREFIX}/.+?" already exists in the repository.`).test(e.message))){var r,i,o,a;const t=(null==e||null===(r=e.variables)||void 0===r||null===(i=r.createRefInput)||void 0===i?void 0:i.name)||"",n=(null==e||null===(o=e.variables)||void 0===o||null===(a=o.createRefInput)||void 0===a?void 0:a.oid)||"",s=l()(t,"refs/heads/");if(s&&s.startsWith(_.CMS_BRANCH_PREFIX+"/")&&n)try{await this.backupBranch(s),await this.deleteBranch(s);return await this.client.mutate(e)}catch(e){console.log(e)}}throw new _.APIError(s.message,500,"GitHub")}}async hasWriteAccess(){const{repoOwner:e,repoName:t}=this;try{const{data:n}=await this.query({query:pi,variables:{owner:e,name:t},fetchPolicy:"cache-first"}),{viewerPermission:r}=n.repository;return["ADMIN","MAINTAIN","WRITE"].includes(r)}catch(e){throw console.error("Problem fetching repo data from GitHub"),e}}async user(){const{data:e}=await this.query({query:di,fetchPolicy:"cache-first"});return e.viewer}async retrieveBlobObject(e,t,n,r={}){const{data:i}=await this.query(Di({query:mi,variables:{owner:e,name:t,expression:n}},r));if(i.repository.object){const{is_binary:e,text:t}=i.repository.object;return{isNull:!1,isBinary:e,text:t}}return{isNull:!0}}getOwnerAndNameFromRepoUrl(e){let{repoOwner:t,repoName:n}=this;return e===this.originRepoURL&&({originRepoOwner:t,originRepoName:n}=this),{owner:t,name:n}}async readFile(e,t,{branch:n=this.branch,repoURL:r=this.repoURL,parseText:i=!0}={}){t||(t=await this.getFileSha(e,{repoURL:r,branch:n}));return await Object(_.readFile)(t,()=>this.fetchBlobContent({sha:t,repoURL:r,parseText:i}),_.localForage,i)}async fetchBlobContent({sha:e,repoURL:t,parseText:n}){if(!n)return super.fetchBlobContent({sha:e,repoURL:t,parseText:n});const{owner:r,name:i}=this.getOwnerAndNameFromRepoUrl(t),{isNull:o,isBinary:a,text:s}=await this.retrieveBlobObject(r,i,e,{fetchPolicy:"cache-first"});if(o)throw new _.APIError("Not Found",404,"GitHub");return a?super.fetchBlobContent({sha:e,repoURL:t,parseText:n}):s}async getPullRequests(e,t,n){const{originRepoOwner:r,originRepoName:i}=this;let o;o=t===st.Open?["OPEN"]:t===st.Closed?["CLOSED","MERGED"]:["OPEN","CLOSED","MERGED"];const{data:a}=await this.query({query:Ei,variables:Di(Di({owner:r,name:i},e?{head:e}:{}),{},{states:o})}),{pullRequests:s}=a.repository;return s.nodes.map(Ui).filter(e=>e.head.ref.startsWith(_.CMS_BRANCH_PREFIX+"/")&&n(e))}async getOpenAuthoringBranches(){const{repoOwner:e,repoName:t}=this,{data:n}=await this.query({query:wi,variables:{owner:e,name:t,refPrefix:`refs/heads/cms/${this.repo}/`}});return n.repository.refs.nodes.map(({name:e,prefix:t})=>({ref:`${t}${e}`}))}async getStatuses(e,t){const n=this.generateContentKey(e,t),r=Object(_.branchFromContentKey)(n),i=(await this.getBranchPullRequest(r)).head.sha,{originRepoOwner:o,originRepoName:a}=this,{data:s}=await this.query({query:vi,variables:{owner:o,name:a,sha:i}});if(s.repository.object){const{status:e}=s.repository.object,{contexts:t}=e||{contexts:[]};return t}return[]}getAllFiles(e,t){return e.reduce((e,n)=>{if("tree"===n.type){var r;const i=(null===(r=n.object)||void 0===r?void 0:r.entries)||[];return[...e,...this.getAllFiles(i,`${t}/${n.name}`)]}return"blob"===n.type?[...e,{name:n.name,type:n.type,id:n.sha,path:`${t}/${n.name}`,size:n.blob?n.blob.size:0}]:e},[])}async listFiles(e,{repoURL:t=this.repoURL,branch:n=this.branch,depth:r=1}={}){const{owner:i,name:o}=this.getOwnerAndNameFromRepoUrl(t),a=he()(e,"/"),{data:s}=await this.query({query:yi(r),variables:{owner:i,name:o,expression:`${n}:${a}`}});if(s.repository.object){return this.getAllFiles(s.repository.object.entries,a)}return[]}getBranchQualifiedName(e){return"refs/heads/"+e}getBranchQuery(e,t,n){return{query:gi,variables:{owner:t,name:n,qualifiedName:this.getBranchQualifiedName(e)}}}async getDefaultBranch(){const{data:e}=await this.query(Di({},this.getBranchQuery(this.branch,this.originRepoOwner,this.originRepoName)));return e.repository.branch}async getBranch(e){const{data:t}=await this.query(Di(Di({},this.getBranchQuery(e,this.repoOwner,this.repoName)),{},{fetchPolicy:"cache-first"}));if(!t.repository.branch)throw new _.APIError("Branch not found",404,"GitHub");return t.repository.branch}async patchRef(e,t,n,r={}){if("heads"!==e)return super.patchRef(e,t,n,r);const i=r.force||!1,o=await this.getBranch(t),{data:a}=await this.mutate({mutation:Si,variables:{input:{oid:n,refId:o.id,force:i}}});return a.updateRef.branch}async deleteBranch(e){const t=await this.getBranch(e),{data:n}=await this.mutate({mutation:_i,variables:{deleteRefInput:{refId:t.id}},update:e=>e.data.delete(Gn(t))});return n.deleteRef}getPullRequestQuery(e){const{originRepoOwner:t,originRepoName:n}=this;return{query:Ri,variables:{owner:t,name:n,number:e}}}async getPullRequest(e){const{data:t}=await this.query(Di(Di({},this.getPullRequestQuery(e)),{},{fetchPolicy:"cache-first"})),n="OPEN"===t.repository.pullRequest.state?st.Open:st.Closed;return Di(Di({},t.repository.pullRequest),{},{state:n})}getPullRequestAndBranchQuery(e,t){const{repoOwner:n,repoName:r}=this,{originRepoOwner:i,originRepoName:o}=this;return{query:ki,variables:{owner:n,name:r,originRepoOwner:i,originRepoName:o,number:t,qualifiedName:this.getBranchQualifiedName(e)}}}async getPullRequestAndBranch(e,t){const{data:n}=await this.query(Di(Di({},this.getPullRequestAndBranchQuery(e,t)),{},{fetchPolicy:"cache-first"})),{repository:r,origin:i}=n;return{branch:r.branch,pullRequest:i.pullRequest}}async openPR(e){const t=await this.getPullRequest(e),{data:n}=await this.mutate({mutation:qi,variables:{reopenPullRequestInput:{pullRequestId:t.id}},update:(e,{data:t})=>{const{pullRequest:n}=t.reopenPullRequest,r={repository:Di(Di({},n.repository),{},{pullRequest:n})};e.writeQuery(Di(Di({},this.getPullRequestQuery(n.number)),{},{data:r}))}});return n.reopenPullRequest}async closePR(e){const t=await this.getPullRequest(e),{data:n}=await this.mutate({mutation:Pi,variables:{closePullRequestInput:{pullRequestId:t.id}},update:(e,{data:t})=>{const{pullRequest:n}=t.closePullRequest,r={repository:Di(Di({},n.repository),{},{pullRequest:n})};e.writeQuery(Di(Di({},this.getPullRequestQuery(n.number)),{},{data:r}))}});return n.closePullRequest}async deleteUnpublishedEntry(e,t){try{const n=this.generateContentKey(e,t),r=Object(_.branchFromContentKey)(n),i=await this.getBranchPullRequest(r);if(-1!==i.number){const{branch:e,pullRequest:t}=await this.getPullRequestAndBranch(r,i.number),{data:n}=await this.mutate({mutation:Ti,variables:{deleteRefInput:{refId:e.id},closePullRequestInput:{pullRequestId:t.id}},update:n=>{n.data.delete(Gn(e)),n.data.delete(Gn(t))}});return n.closePullRequest}return await this.deleteBranch(r)}catch(e){const{graphQLErrors:t}=e;if(t&&t.length>0){if(t.some(e=>"NOT_FOUND"===e.type))return}throw e}}async createPR(e,t){const[n,r]=await Promise.all([this.getRepository(this.originRepoOwner,this.originRepoName),this.useOpenAuthoring?`${(await this.user()).login}:${t}`:t]),{data:i}=await this.mutate({mutation:Ci,variables:{createPullRequestInput:{baseRefName:this.branch,body:_.DEFAULT_PR_BODY,title:e,headRefName:r,repositoryId:n.id}},update:(e,{data:t})=>{const{pullRequest:n}=t.createPullRequest,r={repository:Di(Di({},n.repository),{},{pullRequest:n})};e.writeQuery(Di(Di({},this.getPullRequestQuery(n.number)),{},{data:r}))}}),{pullRequest:o}=i.createPullRequest;return Di(Di({},o),{},{head:{sha:o.headRefOid}})}async createBranch(e,t){const n=this.repoOwner,r=this.repoName,i=await this.getRepository(n,r),{data:o}=await this.mutate({mutation:Ai,variables:{createRefInput:{name:this.getBranchQualifiedName(e),oid:t,repositoryId:i.id}},update:(t,{data:i})=>{const{branch:o}=i.createRef,a={repository:Di(Di({},o.repository),{},{branch:o})};t.writeQuery(Di(Di({},this.getBranchQuery(e,n,r)),{},{data:a}))}}),{branch:a}=o.createRef;return Di(Di({},a),{},{ref:`${a.prefix}${a.name}`})}async createBranchAndPullRequest(e,t,n){const r=this.originRepoOwner,i=this.originRepoName,o=await this.getRepository(r,i),{data:a}=await this.mutate({mutation:Ni,variables:{createRefInput:{name:this.getBranchQualifiedName(e),oid:t,repositoryId:o.id},createPullRequestInput:{baseRefName:this.branch,body:_.DEFAULT_PR_BODY,title:n,headRefName:e,repositoryId:o.id}},update:(t,{data:n})=>{const{branch:o}=n.createRef,{pullRequest:a}=n.createPullRequest,s={repository:Di(Di({},o.repository),{},{branch:o})},u={repository:Di(Di({},a.repository),{},{branch:o}),origin:Di(Di({},a.repository),{},{pullRequest:a})};t.writeQuery(Di(Di({},this.getBranchQuery(e,r,i)),{},{data:s})),t.writeQuery(Di(Di({},this.getPullRequestAndBranchQuery(e,a.number)),{},{data:u}))}}),{pullRequest:s}=a.createPullRequest;return Ui(s)}async getFileSha(e,{repoURL:t=this.repoURL,branch:n=this.branch}={}){const{owner:r,name:i}=this.getOwnerAndNameFromRepoUrl(t),{data:o}=await this.query({query:xi,variables:{owner:r,name:i,expression:`${n}:${e}`}});if(o.repository.file)return o.repository.file.sha;throw new _.APIError("Not Found",404,"GitHub")}}function Qi(){return(Qi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function $i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Vi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$i(Object(n),!0).forEach((function(t){Gi(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Gi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{fetchWithTimeout:zi}=_.unsentRequest,Ki=["API Requests","Issues, Pull Requests, Projects"];class Hi{constructor(e,t={}){var n;if(Gi(this,"lock",void 0),Gi(this,"api",void 0),Gi(this,"options",void 0),Gi(this,"originRepo",void 0),Gi(this,"repo",void 0),Gi(this,"openAuthoringEnabled",void 0),Gi(this,"useOpenAuthoring",void 0),Gi(this,"alwaysForkEnabled",void 0),Gi(this,"branch",void 0),Gi(this,"apiRoot",void 0),Gi(this,"mediaFolder",void 0),Gi(this,"previewContext",void 0),Gi(this,"token",void 0),Gi(this,"squashMerges",void 0),Gi(this,"cmsLabelPrefix",void 0),Gi(this,"useGraphql",void 0),Gi(this,"_currentUserPromise",void 0),Gi(this,"_userIsOriginMaintainerPromises",void 0),Gi(this,"_mediaDisplayURLSem",void 0),Gi(this,"getCursorAndFiles",(e,t)=>{const n=e.length,r=Math.ceil(e.length/20),i=[];t>1&&(i.push("prev"),i.push("first")),t<r&&(i.push("next"),i.push("last"));return{cursor:_.Cursor.create({actions:i,meta:{page:t,count:n,pageSize:20,pageCount:r},data:{files:e}}),files:e.slice(20*(t-1),20*t)}}),this.options=Vi({proxied:!1,API:null,initialWorkflowStatus:""},t),!this.options.proxied&&(null===e.backend.repo||void 0===e.backend.repo))throw new Error('The GitHub backend needs a "repo" in the backend configuration.');if(this.api=this.options.API||null,this.openAuthoringEnabled=e.backend.open_authoring||!1,this.openAuthoringEnabled){if(!this.options.useWorkflow)throw new Error("backend.open_authoring is true but publish_mode is not set to editorial_workflow.");this.originRepo=e.backend.repo||""}else this.repo=this.originRepo=e.backend.repo||"";this.alwaysForkEnabled=e.backend.always_fork||!1,this.branch=(null===(n=e.backend.branch)||void 0===n?void 0:n.trim())||"master",this.apiRoot=e.backend.api_root||"https://api.github.com",this.token="",this.squashMerges=e.backend.squash_merges||!1,this.cmsLabelPrefix=e.backend.cms_label_prefix||"",this.useGraphql=e.backend.use_graphql||!1,this.mediaFolder=e.media_folder,this.previewContext=e.backend.preview_context||"",this.lock=Object(_.asyncLock)()}isGitBackend(){return!0}async status(){const e=await zi("https://www.githubstatus.com/api/v2/components.json").then(e=>e.json()).then(e=>e.components.filter(e=>Ki.includes(e.name)).every(e=>"operational"===e.status)).catch(e=>(console.warn("Failed getting GitHub status",e),!0));let t=!1;var n;e&&(t=await(null===(n=this.api)||void 0===n?void 0:n.getUser().then(e=>!!e).catch(e=>(console.warn("Failed getting GitHub user",e),!1)))||!1);return{auth:{status:t},api:{status:e,statusPage:"https://www.githubstatus.com"}}}authComponent(){const e=e=>Object(A.jsx)(ce,Qi({},e,{backend:this}));return e.displayName="AuthenticationPage",e}restoreUser(e){return this.openAuthoringEnabled?this.authenticateWithFork({userData:e,getPermissionToFork:()=>!0}).then(()=>this.authenticate(e)):this.authenticate(e)}async pollUntilForkExists({repo:e,token:t}){let n=!1;for(;!n;)n=await zi(`${this.apiRoot}/repos/${e}`,{headers:{Authorization:"token "+t}}).then(()=>!0).catch(e=>e&&404===e.status?(console.log("This 404 was expected and handled appropriately."),!1):Promise.reject(e)),n||await new Promise(e=>setTimeout(e,250));return Promise.resolve()}async currentUser({token:e}){return this._currentUserPromise||(this._currentUserPromise=zi(this.apiRoot+"/user",{headers:{Authorization:"token "+e}}).then(e=>e.json())),this._currentUserPromise}async userIsOriginMaintainer({username:e,token:t}){const n=e||(await this.currentUser({token:t})).login;return this._userIsOriginMaintainerPromises=this._userIsOriginMaintainerPromises||{},this._userIsOriginMaintainerPromises[n]||(this._userIsOriginMaintainerPromises[n]=zi(`${this.apiRoot}/repos/${this.originRepo}/collaborators/${n}/permission`,{headers:{Authorization:"token "+t}}).then(e=>e.json()).then(({permission:e})=>"admin"===e||"write"===e)),this._userIsOriginMaintainerPromises[n]}async forkExists({token:e}){try{const t=await this.currentUser({token:e}),n=this.originRepo.split("/")[1],r=await zi(`${this.apiRoot}/repos/${t.login}/${n}`,{method:"GET",headers:{Authorization:"token "+e}}).then(e=>e.json());return!0===r.fork&&r.parent&&r.parent.full_name.toLowerCase()===this.originRepo.toLowerCase()}catch{return!1}}async authenticateWithFork({userData:e,getPermissionToFork:t}){if(!this.openAuthoringEnabled)throw new Error("Cannot authenticate with fork; Open Authoring is turned off.");const n=e.token;if(!this.alwaysForkEnabled&&await this.userIsOriginMaintainer({token:n}))return this.repo=this.originRepo,this.useOpenAuthoring=!1,Promise.resolve();await this.forkExists({token:n})||await t();const r=await zi(`${this.apiRoot}/repos/${this.originRepo}/forks`,{method:"POST",headers:{Authorization:"token "+n}}).then(e=>e.json());return this.useOpenAuthoring=!0,this.repo=r.full_name,this.pollUntilForkExists({repo:r.full_name,token:n})}async authenticate(e){this.token=e.token;const t=this.useGraphql?Bi:ht;this.api=new t({token:this.token,branch:this.branch,repo:this.repo,originRepo:this.originRepo,apiRoot:this.apiRoot,squashMerges:this.squashMerges,cmsLabelPrefix:this.cmsLabelPrefix,useOpenAuthoring:this.useOpenAuthoring,initialWorkflowStatus:this.options.initialWorkflowStatus});const n=await this.api.user();if(!await this.api.hasWriteAccess().catch(e=>{throw e.message=S`
          Repo "${this.repo}" not found.
  
          Please ensure the repo information is spelled correctly.
  
          If the repo is private, make sure you're logged into a GitHub account with access.
  
          If your repo is under an organization, ensure the organization has granted access to Netlify
          CMS.
        `,e}))throw new Error("Your GitHub user account does not have access to this repo.");return Vi(Vi({},n),{},{token:e.token,useOpenAuthoring:this.useOpenAuthoring})}logout(){if(this.token=null,this.api&&this.api.reset&&"function"==typeof this.api.reset)return this.api.reset()}getToken(){return Promise.resolve(this.token)}async entriesByFolder(e,t,n){const r=this.api.originRepoURL;let i;const o=await Object(_.entriesByFolder)(()=>this.api.listFiles(e,{repoURL:r,depth:n}).then(e=>{const n=e.filter(e=>Object(_.filterByExtension)(e,t)),r=this.getCursorAndFiles(n,1);return i=r.cursor,r.files}),(e,t)=>this.api.readFile(e,t,{repoURL:r}),this.api.readFileMetadata.bind(this.api),"GitHub");return o[_.CURSOR_COMPATIBILITY_SYMBOL]=i,o}async allEntriesByFolder(e,t,n){const r=this.api.originRepoURL;return await Object(_.entriesByFolder)(()=>this.api.listFiles(e,{repoURL:r,depth:n}).then(e=>e.filter(e=>Object(_.filterByExtension)(e,t))),(e,t)=>this.api.readFile(e,t,{repoURL:r}),this.api.readFileMetadata.bind(this.api),"GitHub")}entriesByFiles(e){const t=this.useOpenAuthoring?this.api.originRepoURL:this.api.repoURL;return Object(_.entriesByFiles)(e,(e,n)=>this.api.readFile(e,n,{repoURL:t}).catch(()=>""),this.api.readFileMetadata.bind(this.api),"GitHub")}getEntry(e){const t=this.api.originRepoURL;return this.api.readFile(e,null,{repoURL:t}).then(t=>({file:{path:e,id:null},data:t})).catch(()=>({file:{path:e,id:null},data:""}))}getMedia(e=this.mediaFolder){return this.api.listFiles(e).then(e=>e.map(({id:e,name:t,size:n,path:r})=>({id:e,name:t,size:n,displayURL:{id:e,path:r},path:r})))}async getMediaFile(e){const t=await Object(_.getMediaAsBlob)(e,null,this.api.readFile.bind(this.api)),n=Object(_.basename)(e),r=Object(_.blobToFileObj)(n,t),i=URL.createObjectURL(r);return{id:await Object(_.getBlobSHA)(t),displayURL:i,path:e,name:n,size:r.size,file:r,url:i}}getMediaDisplayURL(e){return this._mediaDisplayURLSem=this._mediaDisplayURLSem||u()(10),Object(_.getMediaDisplayURL)(e,this.api.readFile.bind(this.api),this._mediaDisplayURLSem)}persistEntry(e,t){return Object(_.runWithLock)(this.lock,()=>this.api.persistFiles(e.dataFiles,e.assets,t),"Failed to acquire persist entry lock")}async persistMedia(e,t){try{await this.api.persistFiles([],[e],t);const{sha:n,path:r,fileObj:i}=e,o=URL.createObjectURL(i);return{id:n,name:i.name,size:i.size,displayURL:o,path:l()(r,"/")}}catch(e){throw console.error(e),e}}deleteFiles(e,t){return this.api.deleteFiles(e,t)}async traverseCursor(e,t){const n=e.meta,r=e.data.get("files").toJS();let i;switch(t){case"first":i=this.getCursorAndFiles(r,1);break;case"last":i=this.getCursorAndFiles(r,n.get("pageCount"));break;case"next":i=this.getCursorAndFiles(r,n.get("page")+1);break;case"prev":i=this.getCursorAndFiles(r,n.get("page")-1);break;default:i=this.getCursorAndFiles(r,1)}return{entries:await Object(_.entriesByFiles)(i.files,(e,t)=>this.api.readFile(e,t,{repoURL:this.api.originRepoURL}).catch(()=>""),this.api.readFileMetadata.bind(this.api),"GitHub"),cursor:i.cursor}}async loadMediaFile(e,t){const n=await Object(_.getMediaAsBlob)(t.path,t.id,(t,n,{parseText:r})=>this.api.readFile(t,n,{branch:e,parseText:r})),r=Object(_.basename)(t.path),i=Object(_.blobToFileObj)(r,n);return{id:t.id,displayURL:URL.createObjectURL(i),path:t.path,name:r,size:i.size,file:i}}async unpublishedEntries(){return await Object(_.unpublishedEntries)(()=>this.api.listUnpublishedBranches().then(e=>e.map(e=>Object(_.contentKeyFromBranch)(e))))}async unpublishedEntry({id:e,collection:t,slug:n}){if(e){return await this.api.retrieveUnpublishedEntryData(e)}if(t&&n){const e=this.api.generateContentKey(t,n);return await this.api.retrieveUnpublishedEntryData(e)}throw new Error("Missing unpublished entry id or collection and slug")}getBranch(e,t){const n=this.api.generateContentKey(e,t);return Object(_.branchFromContentKey)(n)}async unpublishedEntryDataFile(e,t,n,r){const i=this.getBranch(e,t);return await this.api.readFile(n,r,{branch:i})}async unpublishedEntryMediaFile(e,t,n,r){const i=this.getBranch(e,t);return await this.loadMediaFile(i,{path:n,id:r})}async getDeployPreview(e,t){try{const n=await this.api.getStatuses(e,t),r=Object(_.getPreviewStatus)(n,this.previewContext);if(r){const{target_url:e,state:t}=r;return{url:e,status:t}}return null}catch(e){return null}}updateUnpublishedEntryStatus(e,t,n){return Object(_.runWithLock)(this.lock,()=>this.api.updateUnpublishedEntryStatus(e,t,n),"Failed to acquire update entry status lock")}deleteUnpublishedEntry(e,t){return Object(_.runWithLock)(this.lock,()=>this.api.deleteUnpublishedEntry(e,t),"Failed to acquire delete entry lock")}publishUnpublishedEntry(e,t){return Object(_.runWithLock)(this.lock,()=>this.api.publishUnpublishedEntry(e,t),"Failed to acquire publish entry lock")}}const Wi={GitHubBackend:Hi,API:ht,AuthenticationPage:ce}}]).NetlifyCmsBackendGithub}));
  //# sourceMappingURL=netlify-cms-backend-github.js.map