@aws-amplify/datastore 3.4.4 → 3.4.5-unstable.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -103,7 +103,7 @@ function I(e){return i.Buffer.from((new h).random(e).toString(),"hex")}O.prototy
|
|
|
103
103
|
* for the specific language governing permissions and
|
|
104
104
|
* limitations under the License.
|
|
105
105
|
*/
|
|
106
|
-
var oe=function(){function e(e,t){var n=e||{},r=n.UserPoolId,i=n.ClientId,o=n.endpoint,s=n.fetchOptions,a=n.AdvancedSecurityDataCollectionFlag;if(!r||!i)throw new Error("Both UserPoolId and ClientId are required.");if(r.length>55||!/^[\w-]+_[0-9a-zA-Z]+$/.test(r))throw new Error("Invalid UserPoolId format.");var u=r.split("_")[0];this.userPoolId=r,this.clientId=i,this.client=new re(u,o,s),this.advancedSecurityDataCollectionFlag=!1!==a,this.storage=e.Storage||(new G).getStorage(),t&&(this.wrapRefreshSessionCallback=t)}var t=e.prototype;return t.getUserPoolId=function(){return this.userPoolId},t.getClientId=function(){return this.clientId},t.signUp=function(e,t,n,r,i,o){var s=this,a={ClientId:this.clientId,Username:e,Password:t,UserAttributes:n,ValidationData:r,ClientMetadata:o};this.getUserContextData(e)&&(a.UserContextData=this.getUserContextData(e)),this.client.request("SignUp",a,(function(t,n){if(t)return i(t,null);var r={Username:e,Pool:s,Storage:s.storage},o={user:new V(r),userConfirmed:n.UserConfirmed,userSub:n.UserSub,codeDeliveryDetails:n.CodeDeliveryDetails};return i(null,o)}))},t.getCurrentUser=function(){var e="CognitoIdentityServiceProvider."+this.clientId+".LastAuthUser",t=this.storage.getItem(e);if(t){var n={Username:t,Pool:this,Storage:this.storage};return new V(n)}return null},t.getUserContextData=function(e){if("undefined"!=typeof AmazonCognitoAdvancedSecurityData){var t=AmazonCognitoAdvancedSecurityData;if(this.advancedSecurityDataCollectionFlag){var n=t.getData(e,this.userPoolId,this.clientId);if(n)return{EncodedData:n}}return{}}},e}(),se=n(27),ae=function(){function e(e){if(!e.domain)throw new Error("The domain of cookieStorage can not be undefined.");if(this.domain=e.domain,e.path?this.path=e.path:this.path="/",Object.prototype.hasOwnProperty.call(e,"expires")?this.expires=e.expires:this.expires=365,Object.prototype.hasOwnProperty.call(e,"secure")?this.secure=e.secure:this.secure=!0,Object.prototype.hasOwnProperty.call(e,"sameSite")){if(!["strict","lax","none"].includes(e.sameSite))throw new Error('The sameSite value of cookieStorage must be "lax", "strict" or "none".');if("none"===e.sameSite&&!this.secure)throw new Error("sameSite = None requires the Secure attribute in latest browser versions.");this.sameSite=e.sameSite}else this.sameSite=null}var t=e.prototype;return t.setItem=function(e,t){var n={path:this.path,expires:this.expires,domain:this.domain,secure:this.secure};return this.sameSite&&(n.sameSite=this.sameSite),se.set(e,t,n),se.get(e)},t.getItem=function(e){return se.get(e)},t.removeItem=function(e){var t={path:this.path,expires:this.expires,domain:this.domain,secure:this.secure};return this.sameSite&&(t.sameSite=this.sameSite),se.remove(e,t)},t.clear=function(){for(var e=se.get(),t=Object.keys(e).length,n=0;n<t;++n)this.removeItem(Object.keys(e)[n]);return{}},e}()},function(e,t,n){"use strict";var r=n(80),i=n.n(r).a;t.a=i},function(e,t,n){"use strict";var r;n.d(t,"a",(function(){return r})),function(e){e.DEFAULT_MSG="Authentication Error",e.EMPTY_EMAIL="Email cannot be empty",e.EMPTY_PHONE="Phone number cannot be empty",e.EMPTY_USERNAME="Username cannot be empty",e.INVALID_USERNAME="The username should either be a string or one of the sign in types",e.EMPTY_PASSWORD="Password cannot be empty",e.EMPTY_CODE="Confirmation code cannot be empty",e.SIGN_UP_ERROR="Error creating account",e.NO_MFA="No valid MFA method provided",e.INVALID_MFA="Invalid MFA type",e.EMPTY_CHALLENGE="Challenge response cannot be empty",e.NO_USER_SESSION="Failed to get the session because the user is empty",e.NETWORK_ERROR="Network Error",e.DEVICE_CONFIG="Device tracking has not been configured in this User Pool"}(r||(r={}))},function(e,t,n){"use strict";var r,i;n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return i})),function(e){e.API_KEY="API_KEY",e.AWS_IAM="AWS_IAM",e.OPENID_CONNECT="OPENID_CONNECT",e.AMAZON_COGNITO_USER_POOLS="AMAZON_COGNITO_USER_POOLS",e.AWS_LAMBDA="AWS_LAMBDA"}(r||(r={})),function(e){e.NO_API_KEY="No api-key configured",e.NO_CURRENT_USER="No current user",e.NO_CREDENTIALS="No credentials",e.NO_FEDERATED_JWT="No federated jwt",e.NO_AUTH_TOKEN="No auth token specified"}(i||(i={}))},function(e,t,n){(function(t){var r;e.exports=(r=r||function(e,r){var i;if("undefined"!=typeof window&&window.crypto&&(i=window.crypto),"undefined"!=typeof self&&self.crypto&&(i=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(i=globalThis.crypto),!i&&"undefined"!=typeof window&&window.msCrypto&&(i=window.msCrypto),!i&&void 0!==t&&t.crypto&&(i=t.crypto),!i)try{i=n(96)}catch(e){}var o=function(){if(i){if("function"==typeof i.getRandomValues)try{return i.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof i.randomBytes)try{return i.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},s=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),a={},u=a.lib={},c=u.Base={extend:function(e){var t=s(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},l=u.WordArray=c.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||d).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var o=0;o<i;o++){var s=n[o>>>2]>>>24-o%4*8&255;t[r+o>>>2]|=s<<24-(r+o)%4*8}else for(var a=0;a<i;a+=4)t[r+a>>>2]=n[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=c.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(o());return new l.init(t,e)}}),f=a.enc={},d=f.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new l.init(n,t/2)}},h=f.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new l.init(n,t)}},p=f.Utf8={stringify:function(e){try{return decodeURIComponent(escape(h.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return h.parse(unescape(encodeURIComponent(e)))}},v=u.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,i=r.words,o=r.sigBytes,s=this.blockSize,a=o/(4*s),u=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*s,c=e.min(4*u,o);if(u){for(var f=0;f<u;f+=s)this._doProcessBlock(i,f);n=i.splice(0,u),r.sigBytes-=c}return new l.init(n,c)},clone:function(){var e=c.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),y=(u.Hasher=v.extend({cfg:c.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){v.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new y.HMAC.init(e,n).finalize(t)}}}),a.algo={});return a}(Math),r)}).call(this,n(29))},function(e,t,n){"use strict";var r=n(61),i=Object.prototype.toString;function o(e){return"[object Array]"===i.call(e)}function s(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===i.call(e)}function l(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),o(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}e.exports={isArray:o,isArrayBuffer:function(e){return"[object ArrayBuffer]"===i.call(e)},isBuffer:function(e){return null!==e&&!s(e)&&null!==e.constructor&&!s(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:a,isPlainObject:u,isUndefined:s,isDate:function(e){return"[object Date]"===i.call(e)},isFile:function(e){return"[object File]"===i.call(e)},isBlob:function(e){return"[object Blob]"===i.call(e)},isFunction:c,isStream:function(e){return a(e)&&c(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:l,merge:function e(){var t={};function n(n,r){u(t[r])&&u(n)?t[r]=e(t[r],n):u(n)?t[r]=e({},n):o(n)?t[r]=n.slice():t[r]=n}for(var r=0,i=arguments.length;r<i;r++)l(arguments[r],n);return t},extend:function(e,t,n){return l(t,(function(t,i){e[i]=n&&"function"==typeof t?r(t,n):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},function(e,t,n){"use strict";(function(e){n.d(t,"d",(function(){return l})),n.d(t,"c",(function(){return f})),n.d(t,"b",(function(){return d})),n.d(t,"a",(function(){return y}));var r=[{type:"text/plain",ext:"txt"},{type:"text/html",ext:"html"},{type:"text/javascript",ext:"js"},{type:"text/css",ext:"css"},{type:"text/csv",ext:"csv"},{type:"text/yaml",ext:"yml"},{type:"text/yaml",ext:"yaml"},{type:"text/calendar",ext:"ics"},{type:"text/calendar",ext:"ical"},{type:"image/apng",ext:"apng"},{type:"image/bmp",ext:"bmp"},{type:"image/gif",ext:"gif"},{type:"image/x-icon",ext:"ico"},{type:"image/x-icon",ext:"cur"},{type:"image/jpeg",ext:"jpg"},{type:"image/jpeg",ext:"jpeg"},{type:"image/jpeg",ext:"jfif"},{type:"image/jpeg",ext:"pjp"},{type:"image/jpeg",ext:"pjpeg"},{type:"image/png",ext:"png"},{type:"image/svg+xml",ext:"svg"},{type:"image/tiff",ext:"tif"},{type:"image/tiff",ext:"tiff"},{type:"image/webp",ext:"webp"},{type:"application/json",ext:"json"},{type:"application/xml",ext:"xml"},{type:"application/x-sh",ext:"sh"},{type:"application/zip",ext:"zip"},{type:"application/x-rar-compressed",ext:"rar"},{type:"application/x-tar",ext:"tar"},{type:"application/x-bzip",ext:"bz"},{type:"application/x-bzip2",ext:"bz2"},{type:"application/pdf",ext:"pdf"},{type:"application/java-archive",ext:"jar"},{type:"application/msword",ext:"doc"},{type:"application/vnd.ms-excel",ext:"xls"},{type:"application/vnd.ms-excel",ext:"xlsx"},{type:"message/rfc822",ext:"eml"}],i=function(e){return void 0===e&&(e={}),0===Object.keys(e).length},o=function(e,t,n){if(!e||!e.sort)return!1;var r=n&&"desc"===n?-1:1;return e.sort((function(e,n){var i=e[t],o=n[t];return void 0===o?void 0===i?0:1*r:void 0===i||i<o?-1*r:i>o?1*r:0})),!0},s=function(e,t){var n=Object.assign({},e);return t&&("string"==typeof t?delete n[t]:t.forEach((function(e){delete n[e]}))),n},a=function(e,t){void 0===t&&(t="application/octet-stream");var n=e.toLowerCase(),i=r.filter((function(e){return n.endsWith("."+e.ext)}));return i.length>0?i[0].type:t},u=function(e){var t=e.toLowerCase();return!!t.startsWith("text/")||("application/json"===t||"application/xml"===t||"application/sh"===t)},c=function(){for(var e="",t="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",n=32;n>0;n-=1)e+=t[Math.floor(Math.random()*t.length)];return e},l=function(e){if(e.isResolved)return e;var t=!0,n=!1,r=!1,i=e.then((function(e){return r=!0,t=!1,e}),(function(e){throw n=!0,t=!1,e}));return i.isFullfilled=function(){return r},i.isPending=function(){return t},i.isRejected=function(){return n},i},f=function(){if("undefined"==typeof self)return!1;var e=self;return void 0!==e.WorkerGlobalScope&&self instanceof e.WorkerGlobalScope},d=function(){return{isBrowser:"undefined"!=typeof window&&void 0!==window.document,isNode:void 0!==e&&null!=e.versions&&null!=e.versions.node}},h=function e(t,n,r){if(void 0===n&&(n=[]),void 0===r&&(r=[]),!v(t))return t;var i={};for(var o in t){if(t.hasOwnProperty(o))i[n.includes(o)?o:o[0].toLowerCase()+o.slice(1)]=r.includes(o)?t[o]:e(t[o],n,r)}return i},p=function e(t,n,r){if(void 0===n&&(n=[]),void 0===r&&(r=[]),!v(t))return t;var i={};for(var o in t){if(t.hasOwnProperty(o))i[n.includes(o)?o:o[0].toUpperCase()+o.slice(1)]=r.includes(o)?t[o]:e(t[o],n,r)}return i},v=function(e){return!(!(e instanceof Object)||e instanceof Array||e instanceof Function||e instanceof Number||e instanceof String||e instanceof Boolean)},y=function(){function e(){}return e.isEmpty=i,e.sortByField=o,e.objectLessAttributes=s,e.filenameToContentType=a,e.isTextFile=u,e.generateRandomString=c,e.makeQuerablePromise=l,e.isWebWorker=f,e.browserOrNode=d,e.transferKeyToLowerCase=h,e.transferKeyToUpperCase=p,e.isStrictObject=v,e}()}).call(this,n(49))},function(t,n){t.exports=e},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(22),i=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},o=new r.a("Amplify"),s=new(function(){function e(){this._components=[],this._config={},this._modules={},this.Auth=null,this.Analytics=null,this.API=null,this.Credentials=null,this.Storage=null,this.I18n=null,this.Cache=null,this.PubSub=null,this.Interactions=null,this.Pushnotification=null,this.UI=null,this.XR=null,this.Predictions=null,this.DataStore=null,this.Logger=r.a,this.ServiceWorker=null}return e.prototype.register=function(e){o.debug("component registered in amplify",e),this._components.push(e),"function"==typeof e.getModuleName?(this._modules[e.getModuleName()]=e,this[e.getModuleName()]=e):o.debug("no getModuleName method for component",e),e.configure(this._config)},e.prototype.configure=function(e){var t=this;return e?(this._config=Object.assign(this._config,e),o.debug("amplify config",this._config),Object.entries(this._modules).forEach((function(e){var n=i(e,2),r=(n[0],n[1]);Object.keys(r).forEach((function(e){t._modules[e]&&(r[e]=t._modules[e])}))})),this._components.map((function(e){e.configure(t._config)})),this._config):this._config},e.prototype.addPluggable=function(e){e&&e.getCategory&&"function"==typeof e.getCategory&&this._components.map((function(t){t.addPluggable&&"function"==typeof t.addPluggable&&t.addPluggable(e)}))},e}())},function(e,t,n){"use strict";var r=n(41);n(9);t.a=r.a},,function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return i}));var r={userAgent:"aws-amplify/4.2.9 js",product:"",navigator:null,isReactNative:!1};if("undefined"!=typeof navigator&&navigator.product)switch(r.product=navigator.product||"",r.navigator=navigator||null,navigator.product){case"ReactNative":r.userAgent="aws-amplify/4.2.9 react-native",r.isReactNative=!0;break;default:r.userAgent="aws-amplify/4.2.9 js",r.isReactNative=!1}var i=function(){return r.userAgent}},function(e,t,n){"use strict";var r=n(41),i=n(23),o=n(22),s=n(39),a=n(20),u=n(156),c=n(71),l=n(31),f=n.n(l),d=n(8),h=function(){return(h=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)},p=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(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(s,a)}u((r=r.apply(e,t||[])).next())}))},v=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}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,a])}}},y=function(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},g=new o.a("RestClient"),m=function(){function e(e){this._region="us-east-1",this._service="execute-api",this._custom_header=void 0,this._cancelTokenMap=null,this.Credentials=s.a,this._options=e,g.debug("API Options",this._options),null==this._cancelTokenMap&&(this._cancelTokenMap=new WeakMap)}return e.prototype.ajax=function(e,t,n){return p(this,void 0,void 0,(function(){var r,i,o,s,c,l,f,p,m,b,w,S,_,E,A=this;return v(this,(function(v){switch(v.label){case 0:return g.debug(t,e),o="us-east-1",s="execute-api",c=void 0,"string"==typeof e?(r=this._parseUrl(e),i=e):(i=e.endpoint,c=e.custom_header,o=e.region,s=e.service,r=this._parseUrl(e.endpoint)),l={method:t,url:i,host:r.host,path:r.path,headers:{},data:null,responseType:"json",timeout:0,cancelToken:null},f={},a.a.isReactNative&&(p=a.a.userAgent||"aws-amplify/0.1.x",f={"User-Agent":p}),m=Object.assign({},n),b=m.response,m.body&&("function"==typeof FormData&&m.body instanceof FormData?(f["Content-Type"]="multipart/form-data",l.data=m.body):(f["Content-Type"]="application/json; charset=UTF-8",l.data=JSON.stringify(m.body))),m.responseType&&(l.responseType=m.responseType),m.withCredentials&&(l.withCredentials=m.withCredentials),m.timeout&&(l.timeout=m.timeout),m.cancellableToken&&(l.cancelToken=m.cancellableToken.token),l.signerServiceInfo=m.signerServiceInfo,"function"!=typeof c?[3,2]:[4,c()];case 1:return S=v.sent(),[3,3];case 2:S=void 0,v.label=3;case 3:return w=S,l.headers=h(h(h({},f),w),m.headers),_=Object(d.parse)(i,!0,!0),_.search,E=y(_,["search"]),l.url=Object(d.format)(h(h({},E),{query:h(h({},E.query),m.queryStringParameters||{})})),void 0!==l.headers.Authorization?(l.headers=Object.keys(l.headers).reduce((function(e,t){return l.headers[t]&&(e[t]=l.headers[t]),e}),{}),[2,this._request(l,b)]):[2,this.Credentials.get().then((function(r){return A._signed(h({},l),r,b,{region:o,service:s}).catch((function(r){if(u.a.isClockSkewError(r)){var i=r.response.headers,o=i&&(i.date||i.Date),s=new Date(o),a=u.a.getDateFromHeaderString(l.headers["x-amz-date"]);if(u.a.isClockSkewed(s))return u.a.setClockOffset(s.getTime()-a.getTime()),A.ajax(e,t,n)}throw r}))}),(function(e){return g.debug("No credentials available, the request will be unsigned"),A._request(l,b)}))]}}))}))},e.prototype.get=function(e,t){return this.ajax(e,"GET",t)},e.prototype.put=function(e,t){return this.ajax(e,"PUT",t)},e.prototype.patch=function(e,t){return this.ajax(e,"PATCH",t)},e.prototype.post=function(e,t){return this.ajax(e,"POST",t)},e.prototype.del=function(e,t){return this.ajax(e,"DELETE",t)},e.prototype.head=function(e,t){return this.ajax(e,"HEAD",t)},e.prototype.cancel=function(e,t){var n=this._cancelTokenMap.get(e);return n&&n.cancel(t),!0},e.prototype.isCancel=function(e){return f.a.isCancel(e)},e.prototype.getCancellableToken=function(){return f.a.CancelToken.source()},e.prototype.updateRequestToBeCancellable=function(e,t){this._cancelTokenMap.set(e,t)},e.prototype.endpoint=function(e){var t=this,n=this._options.endpoints,r="";return Array.isArray(n)?(n.forEach((function(n){n.name===e&&(r=n.endpoint,"string"==typeof n.region?t._region=n.region:"string"==typeof t._options.region&&(t._region=t._options.region),"string"==typeof n.service?t._service=n.service||"execute-api":t._service="execute-api","function"==typeof n.custom_header?t._custom_header=n.custom_header:t._custom_header=void 0)})),r):r},e.prototype._signed=function(e,t,n,r){var i=r.service,o=r.region,s=e.signerServiceInfo,a=y(e,["signerServiceInfo"]),u=o||this._region||this._options.region,l=i||this._service||this._options.service,d={secret_key:t.secretAccessKey,access_key:t.accessKeyId,session_token:t.sessionToken},h={region:u,service:l},p=Object.assign(h,s),v=c.a.sign(a,d,p);return v.data&&(v.body=v.data),g.debug("Signed Request: ",v),delete v.headers.host,f()(v).then((function(e){return n?e:e.data})).catch((function(e){throw g.debug(e),e}))},e.prototype._request=function(e,t){return void 0===t&&(t=!1),f()(e).then((function(e){return t?e:e.data})).catch((function(e){throw g.debug(e),e}))},e.prototype._parseUrl=function(e){var t=e.split("/");return{host:t[2],path:"/"+t.slice(3).join("/")}},e}(),b=n(17),w=function(){return(w=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)},S=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(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(s,a)}u((r=r.apply(e,t||[])).next())}))},_=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}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,a])}}},E=function(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},A=new o.a("RestAPI"),O=function(){function e(e){this._api=null,this.Credentials=s.a,this._options=e,A.debug("API Options",this._options)}return e.prototype.getModuleName=function(){return"RestAPI"},e.prototype.configure=function(e){var t=e||{},n=t.API,r=void 0===n?{}:n,i=E(t,["API"]),o=w(w({},i),r);if(A.debug("configure Rest API",{opt:o}),o.aws_project_region){if(o.aws_cloud_logic_custom){var s=o.aws_cloud_logic_custom;o.endpoints="string"==typeof s?JSON.parse(s):s}o=Object.assign({},o,{region:o.aws_project_region,header:{}})}return Array.isArray(o.endpoints)?o.endpoints.forEach((function(e){void 0!==e.custom_header&&"function"!=typeof e.custom_header&&(A.warn("Rest API "+e.name+", custom_header should be a function"),e.custom_header=void 0)})):this._options&&Array.isArray(this._options.endpoints)?o.endpoints=this._options.endpoints:o.endpoints=[],this._options=Object.assign({},this._options,o),this.createInstance(),this._options},e.prototype.createInstance=function(){return A.debug("create Rest API instance"),this._api=new m(this._options),this._api.Credentials=this.Credentials,!0},e.prototype.get=function(e,t,n){try{var r=this.getEndpointInfo(e,t),i=this._api.getCancellableToken(),o=Object.assign({},n);o.cancellableToken=i;var s=this._api.get(r,o);return this._api.updateRequestToBeCancellable(s,i),s}catch(e){return Promise.reject(e.message)}},e.prototype.post=function(e,t,n){try{var r=this.getEndpointInfo(e,t),i=this._api.getCancellableToken(),o=Object.assign({},n);o.cancellableToken=i;var s=this._api.post(r,o);return this._api.updateRequestToBeCancellable(s,i),s}catch(e){return Promise.reject(e.message)}},e.prototype.put=function(e,t,n){try{var r=this.getEndpointInfo(e,t),i=this._api.getCancellableToken(),o=Object.assign({},n);o.cancellableToken=i;var s=this._api.put(r,o);return this._api.updateRequestToBeCancellable(s,i),s}catch(e){return Promise.reject(e.message)}},e.prototype.patch=function(e,t,n){try{var r=this.getEndpointInfo(e,t),i=this._api.getCancellableToken(),o=Object.assign({},n);o.cancellableToken=i;var s=this._api.patch(r,o);return this._api.updateRequestToBeCancellable(s,i),s}catch(e){return Promise.reject(e.message)}},e.prototype.del=function(e,t,n){try{var r=this.getEndpointInfo(e,t),i=this._api.getCancellableToken(),o=Object.assign({},n);o.cancellableToken=i;var s=this._api.del(r,o);return this._api.updateRequestToBeCancellable(s,i),s}catch(e){return Promise.reject(e.message)}},e.prototype.head=function(e,t,n){try{var r=this.getEndpointInfo(e,t),i=this._api.getCancellableToken(),o=Object.assign({},n);o.cancellableToken=i;var s=this._api.head(r,o);return this._api.updateRequestToBeCancellable(s,i),s}catch(e){return Promise.reject(e.message)}},e.prototype.isCancel=function(e){return this._api.isCancel(e)},e.prototype.cancel=function(e,t){return this._api.cancel(e,t)},e.prototype.endpoint=function(e){return S(this,void 0,void 0,(function(){return _(this,(function(t){return[2,this._api.endpoint(e)]}))}))},e.prototype.getEndpointInfo=function(e,t){var n=this._options.endpoints;if(!Array.isArray(n))throw new Error("API category not configured");var r=n.find((function(t){return t.name===e}));if(!r)throw new Error("API "+e+" does not exist");var i={endpoint:r.endpoint+t};return"string"==typeof r.region?i.region=r.region:"string"==typeof this._options.region&&(i.region=this._options.region),"string"==typeof r.service?i.service=r.service||"execute-api":i.service="execute-api","function"==typeof r.custom_header?i.custom_header=r.custom_header:i.custom_header=void 0,i},e}(),I=new O(null);function T(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 C(e,t){var n=e.locationOffset.column-1,r=P(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,s=t.line+o,a=1===t.line?n:0,u=t.column+a,c=r.split(/\r\n|[\n\r]/g);return"".concat(e.name," (").concat(s,":").concat(u,")\n")+function(e){var t=e.filter((function(e){e[0];return void 0!==e[1]})),n=0,r=!0,i=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(r=(s=a.next()).done);r=!0){var u=s.value[0];n=Math.max(n,u.length)}}catch(e){i=!0,o=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw o}}return t.map((function(e){var t,r=e[0],i=e[1];return P(n-(t=r).length)+t+i})).join("\n")}([["".concat(s-1,": "),c[i-1]],["".concat(s,": "),c[i]],["",P(u-1)+"^"],["".concat(s+1,": "),c[i+1]]])}function P(e){return Array(e+1).join(" ")}function x(e,t,n,r,i,o,s){var a=Array.isArray(t)?0!==t.length?t:void 0:t?[t]:void 0,u=n;if(!u&&a){var c=a[0];u=c&&c.loc&&c.loc.source}var l,f=r;!f&&a&&(f=a.reduce((function(e,t){return t.loc&&e.push(t.loc.start),e}),[])),f&&0===f.length&&(f=void 0),r&&n?l=r.map((function(e){return T(n,e)})):a&&(l=a.reduce((function(e,t){return t.loc&&e.push(T(t.loc.source,t.loc.start)),e}),[]));var d=s||o&&o.extensions;Object.defineProperties(this,{message:{value:e,enumerable:!0,writable:!0},locations:{value:l||void 0,enumerable:Boolean(l)},path:{value:i||void 0,enumerable:Boolean(i)},nodes:{value:a||void 0},source:{value:u||void 0},positions:{value:f||void 0},originalError:{value:o},extensions:{value:d||void 0,enumerable:Boolean(d)}}),o&&o.stack?Object.defineProperty(this,"stack",{value:o.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,x):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}b.a.register(I),x.prototype=Object.create(Error.prototype,{constructor:{value:x},name:{value:"GraphQLError"},toString:{value:function(){return function(e){var t=[];if(e.nodes){var n=!0,r=!1,i=void 0;try{for(var o,s=e.nodes[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var a=o.value;a.loc&&t.push(C(a.loc.source,T(a.loc.source,a.loc.start)))}}catch(e){r=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(r)throw i}}}else if(e.source&&e.locations){var u=e.source,c=!0,l=!1,f=void 0;try{for(var d,h=e.locations[Symbol.iterator]();!(c=(d=h.next()).done);c=!0){var p=d.value;t.push(C(u,p))}}catch(e){l=!0,f=e}finally{try{c||null==h.return||h.return()}finally{if(l)throw f}}}return 0===t.length?e.message:[e.message].concat(t).join("\n\n")+"\n"}(this)}}});var k={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:["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","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","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},N={};function M(e){return Boolean(e&&"string"==typeof e.kind)}function j(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 s=o[t];if("function"==typeof s)return s}}}function R(e){return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:k,r=void 0,i=Array.isArray(e),o=[e],s=-1,a=[],u=void 0,c=void 0,l=void 0,f=[],d=[],h=e;do{var p=++s===o.length,v=p&&0!==a.length;if(p){if(c=0===d.length?void 0:f[f.length-1],u=l,l=d.pop(),v){if(i)u=u.slice();else{var y={};for(var g in u)u.hasOwnProperty(g)&&(y[g]=u[g]);u=y}for(var m=0,b=0;b<a.length;b++){var w=a[b][0],S=a[b][1];i&&(w-=m),i&&null===S?(u.splice(w,1),m++):u[w]=S}}s=r.index,o=r.keys,a=r.edits,i=r.inArray,r=r.prev}else{if(c=l?i?s:o[s]:void 0,null==(u=l?l[c]:h))continue;l&&f.push(c)}var _=void 0;if(!Array.isArray(u)){if(!M(u))throw new Error("Invalid AST Node: "+JSON.stringify(u));var E=j(t,u.kind,p);if(E){if((_=E.call(t,u,c,l,f,d))===N)break;if(!1===_){if(!p){f.pop();continue}}else if(void 0!==_&&(a.push([c,_]),!p)){if(!M(_)){f.pop();continue}u=_}}}void 0===_&&v&&a.push([c,u]),p?f.pop():(r={inArray:i,index:s,keys:o,edits:a,prev:r},o=(i=Array.isArray(u))?u:n[u.kind]||[],s=-1,a=[],l&&d.push(l),l=u)}while(void 0!==r);return 0!==a.length&&(h=a[a.length-1][1]),h}(e,{leave:U})}var U={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return F(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,n=e.name,r=B("(",F(e.variableDefinitions,", "),")"),i=F(e.directives," "),o=e.selectionSet;return n||i||r||"query"!==t?F([t,F([n,r]),i,o]," "):o},VariableDefinition:function(e){var t=e.variable,n=e.type,r=e.defaultValue,i=e.directives;return t+": "+n+B(" = ",r)+B(" ",F(i," "))},SelectionSet:function(e){return L(e.selections)},Field:function(e){var t=e.alias,n=e.name,r=e.arguments,i=e.directives,o=e.selectionSet;return F([B("",t,": ")+n+B("(",F(r,", "),")"),F(i," "),o]," ")},Argument:function(e){return e.name+": "+e.value},FragmentSpread:function(e){return"..."+e.name+B(" ",F(e.directives," "))},InlineFragment:function(e){var t=e.typeCondition,n=e.directives,r=e.selectionSet;return F(["...",B("on ",t),F(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(B("(",F(r,", "),")")," ")+"on ".concat(n," ").concat(B("",F(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?function(e,t){var n=e.replace(/"""/g,'\\"""');return" "!==e[0]&&"\t"!==e[0]||-1!==e.indexOf("\n")?'"""\n'.concat(t?n:q(n),'\n"""'):'"""'.concat(n.replace(/"$/,'"\n'),'"""')}(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"["+F(e.values,", ")+"]"},ObjectValue:function(e){return"{"+F(e.fields,", ")+"}"},ObjectField:function(e){return e.name+": "+e.value},Directive:function(e){return"@"+e.name+B("(",F(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:function(e){var t=e.directives,n=e.operationTypes;return F(["schema",F(t," "),L(n)]," ")},OperationTypeDefinition:function(e){return e.operation+": "+e.type},ScalarTypeDefinition:D((function(e){return F(["scalar",e.name,F(e.directives," ")]," ")})),ObjectTypeDefinition:D((function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return F(["type",t,B("implements ",F(n," & ")),F(r," "),L(i)]," ")})),FieldDefinition:D((function(e){var t=e.name,n=e.arguments,r=e.type,i=e.directives;return t+(n.every((function(e){return-1===e.indexOf("\n")}))?B("(",F(n,", "),")"):B("(\n",q(F(n,"\n")),"\n)"))+": "+r+B(" ",F(i," "))})),InputValueDefinition:D((function(e){var t=e.name,n=e.type,r=e.defaultValue,i=e.directives;return F([t+": "+n,B("= ",r),F(i," ")]," ")})),InterfaceTypeDefinition:D((function(e){var t=e.name,n=e.directives,r=e.fields;return F(["interface",t,F(n," "),L(r)]," ")})),UnionTypeDefinition:D((function(e){var t=e.name,n=e.directives,r=e.types;return F(["union",t,F(n," "),r&&0!==r.length?"= "+F(r," | "):""]," ")})),EnumTypeDefinition:D((function(e){var t=e.name,n=e.directives,r=e.values;return F(["enum",t,F(n," "),L(r)]," ")})),EnumValueDefinition:D((function(e){return F([e.name,F(e.directives," ")]," ")})),InputObjectTypeDefinition:D((function(e){var t=e.name,n=e.directives,r=e.fields;return F(["input",t,F(n," "),L(r)]," ")})),DirectiveDefinition:D((function(e){var t=e.name,n=e.arguments,r=e.locations;return"directive @"+t+(n.every((function(e){return-1===e.indexOf("\n")}))?B("(",F(n,", "),")"):B("(\n",q(F(n,"\n")),"\n)"))+" on "+F(r," | ")})),SchemaExtension:function(e){var t=e.directives,n=e.operationTypes;return F(["extend schema",F(t," "),L(n)]," ")},ScalarTypeExtension:function(e){return F(["extend scalar",e.name,F(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return F(["extend type",t,B("implements ",F(n," & ")),F(r," "),L(i)]," ")},InterfaceTypeExtension:function(e){var t=e.name,n=e.directives,r=e.fields;return F(["extend interface",t,F(n," "),L(r)]," ")},UnionTypeExtension:function(e){var t=e.name,n=e.directives,r=e.types;return F(["extend union",t,F(n," "),r&&0!==r.length?"= "+F(r," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,n=e.directives,r=e.values;return F(["extend enum",t,F(n," "),L(r)]," ")},InputObjectTypeExtension:function(e){var t=e.name,n=e.directives,r=e.fields;return F(["extend input",t,F(n," "),L(r)]," ")}};function D(e){return function(t){return F([t.description,e(t)],"\n")}}function F(e,t){return e?e.filter((function(e){return e})).join(t||""):""}function L(e){return e&&0!==e.length?"{\n"+q(F(e,"\n"))+"\n}":""}function B(e,t,n){return t?e+t+(n||""):""}function q(e){return e&&" "+e.replace(/\n/g,"\n ")}function z(e){return(z="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 H(e){return e&&"object"===z(e)?"function"==typeof e.inspect?e.inspect():Array.isArray(e)?"["+e.map(H).join(", ")+"]":"{"+Object.keys(e).map((function(t){return"".concat(t,": ").concat(H(e[t]))})).join(", ")+"}":"string"==typeof e?'"'+e+'"':"function"==typeof e?"[function ".concat(e.name,"]"):String(e)}function G(e,t){if(!e)throw new Error(t)}function K(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var V,W=function(e,t,n){K(this,"body",void 0),K(this,"name",void 0),K(this,"locationOffset",void 0),this.body=e,this.name=t||"GraphQL request",this.locationOffset=n||{line:1,column:1},this.locationOffset.line>0||G(0,"line in locationOffset is 1-indexed and must be positive"),this.locationOffset.column>0||G(0,"column in locationOffset is 1-indexed and must be positive")};function Y(e,t,n){return new x("Syntax Error: ".concat(n),void 0,e,[t])}function J(e){for(var t=e.split(/\r\n|[\n\r]/g),n=null,r=1;r<t.length;r++){var i=t[r],o=$(i);if(o<i.length&&(null===n||o<n)&&0===(n=o))break}if(n)for(var s=1;s<t.length;s++)t[s]=t[s].slice(n);for(;t.length>0&&Z(t[0]);)t.shift();for(;t.length>0&&Z(t[t.length-1]);)t.pop();return t.join("\n")}function $(e){for(var t=0;t<e.length&&(" "===e[t]||"\t"===e[t]);)t++;return t}function Z(e){return $(e)===e.length}function Q(e,t){var n=new oe(te.SOF,0,0,0,0,null);return{source:e,options:t,lastToken:n,token:n,line:1,lineStart:0,advance:X,lookahead:ee}}function X(){return this.lastToken=this.token,this.token=this.lookahead()}function ee(){var e=this.token;if(e.kind!==te.EOF)do{e=e.next||(e.next=ae(this,e))}while(e.kind===te.COMMENT);return e}V=W,"function"==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(V.prototype,Symbol.toStringTag,{get:function(){return this.constructor.name}});var te=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 ne(e){var t=e.value;return t?"".concat(e.kind,' "').concat(t,'"'):e.kind}var re=String.prototype.charCodeAt,ie=String.prototype.slice;function oe(e,t,n,r,i,o,s){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=s,this.prev=o,this.next=null}function se(e){return isNaN(e)?te.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function ae(e,t){var n=e.source,r=n.body,i=r.length,o=function(e,t,n){var r=e.length,i=t;for(;i<r;){var o=re.call(e,i);if(9===o||32===o||44===o||65279===o)++i;else if(10===o)++i,++n.line,n.lineStart=i;else{if(13!==o)break;10===re.call(e,i+1)?i+=2:++i,++n.line,n.lineStart=i}}return i}(r,t.end,e),s=e.line,a=1+o-e.lineStart;if(o>=i)return new oe(te.EOF,i,i,s,a,t);var u=re.call(r,o);switch(u){case 33:return new oe(te.BANG,o,o+1,s,a,t);case 35:return function(e,t,n,r,i){var o,s=e.body,a=t;do{o=re.call(s,++a)}while(null!==o&&(o>31||9===o));return new oe(te.COMMENT,t,a,n,r,i,ie.call(s,t+1,a))}(n,o,s,a,t);case 36:return new oe(te.DOLLAR,o,o+1,s,a,t);case 38:return new oe(te.AMP,o,o+1,s,a,t);case 40:return new oe(te.PAREN_L,o,o+1,s,a,t);case 41:return new oe(te.PAREN_R,o,o+1,s,a,t);case 46:if(46===re.call(r,o+1)&&46===re.call(r,o+2))return new oe(te.SPREAD,o,o+3,s,a,t);break;case 58:return new oe(te.COLON,o,o+1,s,a,t);case 61:return new oe(te.EQUALS,o,o+1,s,a,t);case 64:return new oe(te.AT,o,o+1,s,a,t);case 91:return new oe(te.BRACKET_L,o,o+1,s,a,t);case 93:return new oe(te.BRACKET_R,o,o+1,s,a,t);case 123:return new oe(te.BRACE_L,o,o+1,s,a,t);case 124:return new oe(te.PIPE,o,o+1,s,a,t);case 125:return new oe(te.BRACE_R,o,o+1,s,a,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 function(e,t,n,r,i){var o=e.body,s=o.length,a=t+1,u=0;for(;a!==s&&null!==(u=re.call(o,a))&&(95===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++a;return new oe(te.NAME,t,a,n,r,i,ie.call(o,t,a))}(n,o,s,a,t);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return function(e,t,n,r,i,o){var s=e.body,a=n,u=t,c=!1;45===a&&(a=re.call(s,++u));if(48===a){if((a=re.call(s,++u))>=48&&a<=57)throw Y(e,u,"Invalid number, unexpected digit after 0: ".concat(se(a),"."))}else u=ue(e,u,a),a=re.call(s,u);46===a&&(c=!0,a=re.call(s,++u),u=ue(e,u,a),a=re.call(s,u));69!==a&&101!==a||(c=!0,43!==(a=re.call(s,++u))&&45!==a||(a=re.call(s,++u)),u=ue(e,u,a));return new oe(c?te.FLOAT:te.INT,t,u,r,i,o,ie.call(s,t,u))}(n,o,u,s,a,t);case 34:return 34===re.call(r,o+1)&&34===re.call(r,o+2)?function(e,t,n,r,i){var o=e.body,s=t+3,a=s,u=0,c="";for(;s<o.length&&null!==(u=re.call(o,s));){if(34===u&&34===re.call(o,s+1)&&34===re.call(o,s+2))return c+=ie.call(o,a,s),new oe(te.BLOCK_STRING,t,s+3,n,r,i,J(c));if(u<32&&9!==u&&10!==u&&13!==u)throw Y(e,s,"Invalid character within String: ".concat(se(u),"."));92===u&&34===re.call(o,s+1)&&34===re.call(o,s+2)&&34===re.call(o,s+3)?(c+=ie.call(o,a,s)+'"""',a=s+=4):++s}throw Y(e,s,"Unterminated string.")}(n,o,s,a,t):function(e,t,n,r,i){var o=e.body,s=t+1,a=s,u=0,c="";for(;s<o.length&&null!==(u=re.call(o,s))&&10!==u&&13!==u;){if(34===u)return c+=ie.call(o,a,s),new oe(te.STRING,t,s+1,n,r,i,c);if(u<32&&9!==u)throw Y(e,s,"Invalid character within String: ".concat(se(u),"."));if(++s,92===u){switch(c+=ie.call(o,a,s-1),u=re.call(o,s)){case 34:c+='"';break;case 47:c+="/";break;case 92:c+="\\";break;case 98:c+="\b";break;case 102:c+="\f";break;case 110:c+="\n";break;case 114:c+="\r";break;case 116:c+="\t";break;case 117:var l=(f=re.call(o,s+1),d=re.call(o,s+2),h=re.call(o,s+3),p=re.call(o,s+4),ce(f)<<12|ce(d)<<8|ce(h)<<4|ce(p));if(l<0)throw Y(e,s,"Invalid character escape sequence: "+"\\u".concat(o.slice(s+1,s+5),"."));c+=String.fromCharCode(l),s+=4;break;default:throw Y(e,s,"Invalid character escape sequence: \\".concat(String.fromCharCode(u),"."))}++s,a=s}}var f,d,h,p;throw Y(e,s,"Unterminated string.")}(n,o,s,a,t)}throw Y(n,o,function(e){if(e<32&&9!==e&&10!==e&&13!==e)return"Cannot contain the invalid character ".concat(se(e),".");if(39===e)return"Unexpected single quote character ('), did you mean to use a double quote (\")?";return"Cannot parse the unexpected character ".concat(se(e),".")}(u))}function ue(e,t,n){var r=e.body,i=t,o=n;if(o>=48&&o<=57){do{o=re.call(r,++i)}while(o>=48&&o<=57);return i}throw Y(e,i,"Invalid number, expected digit but got: ".concat(se(o),"."))}function ce(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}oe.prototype.toJSON=oe.prototype.inspect=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}};var le=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"}),fe=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 de(e,t){var n="string"==typeof e?new W(e):e;if(!(n instanceof W))throw new TypeError("Must provide Source. Received: ".concat(H(n)));return function(e){var t=e.token;return{kind:le.DOCUMENT,definitions:it(e,te.SOF,pe,te.EOF),loc:$e(e,t)}}(Q(n,t||{}))}function he(e){var t=et(e,te.NAME);return{kind:le.NAME,value:t.value,loc:$e(e,t)}}function pe(e){if(Qe(e,te.NAME))switch(e.token.value){case"query":case"mutation":case"subscription":case"fragment":return ve(e);case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return Ue(e);case"extend":return function(e){var t=e.lookahead();if(t.kind===te.NAME)switch(t.value){case"schema":return function(e){var t=e.token;tt(e,"extend"),tt(e,"schema");var n=Ne(e,!0),r=Qe(e,te.BRACE_L)?it(e,te.BRACE_L,Le,te.BRACE_R):[];if(0===n.length&&0===r.length)throw nt(e);return{kind:le.SCHEMA_EXTENSION,directives:n,operationTypes:r,loc:$e(e,t)}}(e);case"scalar":return function(e){var t=e.token;tt(e,"extend"),tt(e,"scalar");var n=he(e),r=Ne(e,!0);if(0===r.length)throw nt(e);return{kind:le.SCALAR_TYPE_EXTENSION,name:n,directives:r,loc:$e(e,t)}}(e);case"type":return function(e){var t=e.token;tt(e,"extend"),tt(e,"type");var n=he(e),r=Be(e),i=Ne(e,!0),o=qe(e);if(0===r.length&&0===i.length&&0===o.length)throw nt(e);return{kind:le.OBJECT_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:o,loc:$e(e,t)}}(e);case"interface":return function(e){var t=e.token;tt(e,"extend"),tt(e,"interface");var n=he(e),r=Ne(e,!0),i=qe(e);if(0===r.length&&0===i.length)throw nt(e);return{kind:le.INTERFACE_TYPE_EXTENSION,name:n,directives:r,fields:i,loc:$e(e,t)}}(e);case"union":return function(e){var t=e.token;tt(e,"extend"),tt(e,"union");var n=he(e),r=Ne(e,!0),i=Ke(e);if(0===r.length&&0===i.length)throw nt(e);return{kind:le.UNION_TYPE_EXTENSION,name:n,directives:r,types:i,loc:$e(e,t)}}(e);case"enum":return function(e){var t=e.token;tt(e,"extend"),tt(e,"enum");var n=he(e),r=Ne(e,!0),i=Ve(e);if(0===r.length&&0===i.length)throw nt(e);return{kind:le.ENUM_TYPE_EXTENSION,name:n,directives:r,values:i,loc:$e(e,t)}}(e);case"input":return function(e){var t=e.token;tt(e,"extend"),tt(e,"input");var n=he(e),r=Ne(e,!0),i=Ye(e);if(0===r.length&&0===i.length)throw nt(e);return{kind:le.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:r,fields:i,loc:$e(e,t)}}(e)}throw nt(e,t)}(e)}else{if(Qe(e,te.BRACE_L))return ve(e);if(De(e))return Ue(e)}throw nt(e)}function ve(e){if(Qe(e,te.NAME))switch(e.token.value){case"query":case"mutation":case"subscription":return ye(e);case"fragment":return function(e){var t=e.token;if(tt(e,"fragment"),e.options.experimentalFragmentVariables)return{kind:le.FRAGMENT_DEFINITION,name:Ie(e),variableDefinitions:me(e),typeCondition:(tt(e,"on"),Re(e)),directives:Ne(e,!1),selectionSet:Se(e),loc:$e(e,t)};return{kind:le.FRAGMENT_DEFINITION,name:Ie(e),typeCondition:(tt(e,"on"),Re(e)),directives:Ne(e,!1),selectionSet:Se(e),loc:$e(e,t)}}(e)}else if(Qe(e,te.BRACE_L))return ye(e);throw nt(e)}function ye(e){var t=e.token;if(Qe(e,te.BRACE_L))return{kind:le.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:Se(e),loc:$e(e,t)};var n,r=ge(e);return Qe(e,te.NAME)&&(n=he(e)),{kind:le.OPERATION_DEFINITION,operation:r,name:n,variableDefinitions:me(e),directives:Ne(e,!1),selectionSet:Se(e),loc:$e(e,t)}}function ge(e){var t=et(e,te.NAME);switch(t.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw nt(e,t)}function me(e){return Qe(e,te.PAREN_L)?it(e,te.PAREN_L,be,te.PAREN_R):[]}function be(e){var t=e.token;return e.options.experimentalVariableDefinitionDirectives?{kind:le.VARIABLE_DEFINITION,variable:we(e),type:(et(e,te.COLON),je(e)),defaultValue:Xe(e,te.EQUALS)?Te(e,!0):void 0,directives:Ne(e,!0),loc:$e(e,t)}:{kind:le.VARIABLE_DEFINITION,variable:we(e),type:(et(e,te.COLON),je(e)),defaultValue:Xe(e,te.EQUALS)?Te(e,!0):void 0,loc:$e(e,t)}}function we(e){var t=e.token;return et(e,te.DOLLAR),{kind:le.VARIABLE,name:he(e),loc:$e(e,t)}}function Se(e){var t=e.token;return{kind:le.SELECTION_SET,selections:it(e,te.BRACE_L,_e,te.BRACE_R),loc:$e(e,t)}}function _e(e){return Qe(e,te.SPREAD)?function(e){var t,n=e.token;if(et(e,te.SPREAD),Qe(e,te.NAME)&&"on"!==e.token.value)return{kind:le.FRAGMENT_SPREAD,name:Ie(e),directives:Ne(e,!1),loc:$e(e,n)};"on"===e.token.value&&(e.advance(),t=Re(e));return{kind:le.INLINE_FRAGMENT,typeCondition:t,directives:Ne(e,!1),selectionSet:Se(e),loc:$e(e,n)}}(e):function(e){var t,n,r=e.token,i=he(e);Xe(e,te.COLON)?(t=i,n=he(e)):n=i;return{kind:le.FIELD,alias:t,name:n,arguments:Ee(e,!1),directives:Ne(e,!1),selectionSet:Qe(e,te.BRACE_L)?Se(e):void 0,loc:$e(e,r)}}(e)}function Ee(e,t){var n=t?Oe:Ae;return Qe(e,te.PAREN_L)?it(e,te.PAREN_L,n,te.PAREN_R):[]}function Ae(e){var t=e.token;return{kind:le.ARGUMENT,name:he(e),value:(et(e,te.COLON),Te(e,!1)),loc:$e(e,t)}}function Oe(e){var t=e.token;return{kind:le.ARGUMENT,name:he(e),value:(et(e,te.COLON),Pe(e)),loc:$e(e,t)}}function Ie(e){if("on"===e.token.value)throw nt(e);return he(e)}function Te(e,t){var n=e.token;switch(n.kind){case te.BRACKET_L:return function(e,t){var n=e.token,r=t?Pe:xe;return{kind:le.LIST,values:rt(e,te.BRACKET_L,r,te.BRACKET_R),loc:$e(e,n)}}(e,t);case te.BRACE_L:return function(e,t){var n=e.token;et(e,te.BRACE_L);var r=[];for(;!Xe(e,te.BRACE_R);)r.push(ke(e,t));return{kind:le.OBJECT,fields:r,loc:$e(e,n)}}(e,t);case te.INT:return e.advance(),{kind:le.INT,value:n.value,loc:$e(e,n)};case te.FLOAT:return e.advance(),{kind:le.FLOAT,value:n.value,loc:$e(e,n)};case te.STRING:case te.BLOCK_STRING:return Ce(e);case te.NAME:return"true"===n.value||"false"===n.value?(e.advance(),{kind:le.BOOLEAN,value:"true"===n.value,loc:$e(e,n)}):"null"===n.value?(e.advance(),{kind:le.NULL,loc:$e(e,n)}):(e.advance(),{kind:le.ENUM,value:n.value,loc:$e(e,n)});case te.DOLLAR:if(!t)return we(e)}throw nt(e)}function Ce(e){var t=e.token;return e.advance(),{kind:le.STRING,value:t.value,block:t.kind===te.BLOCK_STRING,loc:$e(e,t)}}function Pe(e){return Te(e,!0)}function xe(e){return Te(e,!1)}function ke(e,t){var n=e.token;return{kind:le.OBJECT_FIELD,name:he(e),value:(et(e,te.COLON),Te(e,t)),loc:$e(e,n)}}function Ne(e,t){for(var n=[];Qe(e,te.AT);)n.push(Me(e,t));return n}function Me(e,t){var n=e.token;return et(e,te.AT),{kind:le.DIRECTIVE,name:he(e),arguments:Ee(e,t),loc:$e(e,n)}}function je(e){var t,n=e.token;return Xe(e,te.BRACKET_L)?(t=je(e),et(e,te.BRACKET_R),t={kind:le.LIST_TYPE,type:t,loc:$e(e,n)}):t=Re(e),Xe(e,te.BANG)?{kind:le.NON_NULL_TYPE,type:t,loc:$e(e,n)}:t}function Re(e){var t=e.token;return{kind:le.NAMED_TYPE,name:he(e),loc:$e(e,t)}}function Ue(e){var t=De(e)?e.lookahead():e.token;if(t.kind===te.NAME)switch(t.value){case"schema":return function(e){var t=e.token;tt(e,"schema");var n=Ne(e,!0),r=it(e,te.BRACE_L,Le,te.BRACE_R);return{kind:le.SCHEMA_DEFINITION,directives:n,operationTypes:r,loc:$e(e,t)}}(e);case"scalar":return function(e){var t=e.token,n=Fe(e);tt(e,"scalar");var r=he(e),i=Ne(e,!0);return{kind:le.SCALAR_TYPE_DEFINITION,description:n,name:r,directives:i,loc:$e(e,t)}}(e);case"type":return function(e){var t=e.token,n=Fe(e);tt(e,"type");var r=he(e),i=Be(e),o=Ne(e,!0),s=qe(e);return{kind:le.OBJECT_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:o,fields:s,loc:$e(e,t)}}(e);case"interface":return function(e){var t=e.token,n=Fe(e);tt(e,"interface");var r=he(e),i=Ne(e,!0),o=qe(e);return{kind:le.INTERFACE_TYPE_DEFINITION,description:n,name:r,directives:i,fields:o,loc:$e(e,t)}}(e);case"union":return function(e){var t=e.token,n=Fe(e);tt(e,"union");var r=he(e),i=Ne(e,!0),o=Ke(e);return{kind:le.UNION_TYPE_DEFINITION,description:n,name:r,directives:i,types:o,loc:$e(e,t)}}(e);case"enum":return function(e){var t=e.token,n=Fe(e);tt(e,"enum");var r=he(e),i=Ne(e,!0),o=Ve(e);return{kind:le.ENUM_TYPE_DEFINITION,description:n,name:r,directives:i,values:o,loc:$e(e,t)}}(e);case"input":return function(e){var t=e.token,n=Fe(e);tt(e,"input");var r=he(e),i=Ne(e,!0),o=Ye(e);return{kind:le.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:r,directives:i,fields:o,loc:$e(e,t)}}(e);case"directive":return function(e){var t=e.token,n=Fe(e);tt(e,"directive"),et(e,te.AT);var r=he(e),i=He(e);tt(e,"on");var o=function(e){Xe(e,te.PIPE);var t=[];do{t.push(Je(e))}while(Xe(e,te.PIPE));return t}(e);return{kind:le.DIRECTIVE_DEFINITION,description:n,name:r,arguments:i,locations:o,loc:$e(e,t)}}(e)}throw nt(e,t)}function De(e){return Qe(e,te.STRING)||Qe(e,te.BLOCK_STRING)}function Fe(e){if(De(e))return Ce(e)}function Le(e){var t=e.token,n=ge(e);et(e,te.COLON);var r=Re(e);return{kind:le.OPERATION_TYPE_DEFINITION,operation:n,type:r,loc:$e(e,t)}}function Be(e){var t=[];if("implements"===e.token.value){e.advance(),Xe(e,te.AMP);do{t.push(Re(e))}while(Xe(e,te.AMP)||e.options.allowLegacySDLImplementsInterfaces&&Qe(e,te.NAME))}return t}function qe(e){return e.options.allowLegacySDLEmptyFields&&Qe(e,te.BRACE_L)&&e.lookahead().kind===te.BRACE_R?(e.advance(),e.advance(),[]):Qe(e,te.BRACE_L)?it(e,te.BRACE_L,ze,te.BRACE_R):[]}function ze(e){var t=e.token,n=Fe(e),r=he(e),i=He(e);et(e,te.COLON);var o=je(e),s=Ne(e,!0);return{kind:le.FIELD_DEFINITION,description:n,name:r,arguments:i,type:o,directives:s,loc:$e(e,t)}}function He(e){return Qe(e,te.PAREN_L)?it(e,te.PAREN_L,Ge,te.PAREN_R):[]}function Ge(e){var t=e.token,n=Fe(e),r=he(e);et(e,te.COLON);var i,o=je(e);Xe(e,te.EQUALS)&&(i=Pe(e));var s=Ne(e,!0);return{kind:le.INPUT_VALUE_DEFINITION,description:n,name:r,type:o,defaultValue:i,directives:s,loc:$e(e,t)}}function Ke(e){var t=[];if(Xe(e,te.EQUALS)){Xe(e,te.PIPE);do{t.push(Re(e))}while(Xe(e,te.PIPE))}return t}function Ve(e){return Qe(e,te.BRACE_L)?it(e,te.BRACE_L,We,te.BRACE_R):[]}function We(e){var t=e.token,n=Fe(e),r=he(e),i=Ne(e,!0);return{kind:le.ENUM_VALUE_DEFINITION,description:n,name:r,directives:i,loc:$e(e,t)}}function Ye(e){return Qe(e,te.BRACE_L)?it(e,te.BRACE_L,Ge,te.BRACE_R):[]}function Je(e){var t=e.token,n=he(e);if(fe.hasOwnProperty(n.value))return n;throw nt(e,t)}function $e(e,t){if(!e.options.noLocation)return new Ze(t,e.lastToken,e.source)}function Ze(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}function Qe(e,t){return e.token.kind===t}function Xe(e,t){var n=e.token.kind===t;return n&&e.advance(),n}function et(e,t){var n=e.token;if(n.kind===t)return e.advance(),n;throw Y(e.source,n.start,"Expected ".concat(t,", found ").concat(ne(n)))}function tt(e,t){var n=e.token;if(n.kind===te.NAME&&n.value===t)return e.advance(),n;throw Y(e.source,n.start,'Expected "'.concat(t,'", found ').concat(ne(n)))}function nt(e,t){var n=t||e.token;return Y(e.source,n.start,"Unexpected ".concat(ne(n)))}function rt(e,t,n,r){et(e,t);for(var i=[];!Xe(e,r);)i.push(n(e));return i}function it(e,t,n,r){et(e,t);for(var i=[n(e)];!Xe(e,r);)i.push(n(e));return i}Ze.prototype.toJSON=Ze.prototype.inspect=function(){return{start:this.start,end:this.end}};var ot=n(7),st=n(32),at=n(16),ut=n.n(at),ct=n(18),lt=n(12),ft=function(){return(ft=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)},dt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(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(s,a)}u((r=r.apply(e,t||[])).next())}))},ht=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}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,a])}}},pt=function(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},vt=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},yt=new o.a("GraphQLAPI"),gt=function(){function e(e){this._api=null,this.Auth=ct.a,this.Cache=i.a,this.Credentials=s.a,this._options=e,yt.debug("API Options",this._options)}return e.prototype.getModuleName=function(){return"GraphQLAPI"},e.prototype.configure=function(e){var t=e||{},n=t.API,r=void 0===n?{}:n,i=pt(t,["API"]),o=ft(ft({},i),r);return yt.debug("configure GraphQL API",{opt:o}),o.aws_project_region&&(o=Object.assign({},o,{region:o.aws_project_region,header:{}})),void 0!==o.graphql_headers&&"function"!=typeof o.graphql_headers&&(yt.warn("graphql_headers should be a function"),o.graphql_headers=void 0),this._options=Object.assign({},this._options,o),this.createInstance(),this._options},e.prototype.createInstance=function(){return yt.debug("create Rest instance"),this._options?(this._api=new m(this._options),this._api.Credentials=this.Credentials,!0):Promise.reject("API not configured")},e.prototype._headerBasedAuth=function(e,t){return void 0===t&&(t={}),dt(this,void 0,void 0,(function(){var n,r,o,s,a,u,c,l;return ht(this,(function(f){switch(f.label){case 0:switch(n=this._options,r=n.aws_appsync_authenticationType,o=n.aws_appsync_apiKey,s={},e||r||"AWS_IAM"){case"API_KEY":return[3,1];case"AWS_IAM":return[3,2];case"OPENID_CONNECT":return[3,4];case"AMAZON_COGNITO_USER_POOLS":return[3,11];case"AWS_LAMBDA":return[3,15]}return[3,16];case 1:if(!o)throw new Error(lt.b.NO_API_KEY);return s={Authorization:null,"X-Api-Key":o},[3,17];case 2:return[4,this._ensureCredentials()];case 3:if(!f.sent())throw new Error(lt.b.NO_CREDENTIALS);return[3,17];case 4:return f.trys.push([4,9,,10]),a=void 0,[4,i.a.getItem("federatedInfo")];case 5:return(u=f.sent())?(a=u.token,[3,8]):[3,6];case 6:return[4,ct.a.currentAuthenticatedUser()];case 7:(c=f.sent())&&(a=c.token),f.label=8;case 8:if(!a)throw new Error(lt.b.NO_FEDERATED_JWT);return s={Authorization:a},[3,10];case 9:throw f.sent(),new Error(lt.b.NO_CURRENT_USER);case 10:return[3,17];case 11:return f.trys.push([11,13,,14]),[4,this.Auth.currentSession()];case 12:return l=f.sent(),s={Authorization:l.getAccessToken().getJwtToken()},[3,14];case 13:throw f.sent(),new Error(lt.b.NO_CURRENT_USER);case 14:return[3,17];case 15:if(!t.Authorization)throw new Error(lt.b.NO_AUTH_TOKEN);return s={Authorization:t.Authorization},[3,17];case 16:return s={Authorization:null},[3,17];case 17:return[2,s]}}))}))},e.prototype.getGraphqlOperationType=function(e){var t=de(e);return vt(t.definitions,1)[0].operation},e.prototype.graphql=function(e,t){var n=e.query,r=e.variables,i=void 0===r?{}:r,o=e.authMode,s=e.authToken,a=de("string"==typeof n?n:R(n)),u=vt(a.definitions.filter((function(e){return"OperationDefinition"===e.kind})),1)[0],c=(void 0===u?{}:u).operation,l=t||{};switch(s&&(l.Authorization=s),c){case"query":case"mutation":var f=this._api.getCancellableToken(),d={cancellableToken:f},h=this._graphql({query:a,variables:i,authMode:o},l,d);return this._api.updateRequestToBeCancellable(h,f),h;case"subscription":return this._graphqlSubscribe({query:a,variables:i,authMode:o},l)}throw new Error("invalid operation type: "+c)},e.prototype._graphql=function(e,t,n){var r=e.query,i=e.variables,o=e.authMode;return void 0===t&&(t={}),void 0===n&&(n={}),dt(this,void 0,void 0,(function(){var e,s,a,u,c,l,f,d,h,p,v,y,g,m,b,w,S,_,E,A,O;return ht(this,(function(I){switch(I.label){case 0:return this._api?[3,2]:[4,this.createInstance()];case 1:I.sent(),I.label=2;case 2:return e=this._options,s=e.aws_appsync_region,a=e.aws_appsync_graphqlEndpoint,u=e.graphql_headers,c=void 0===u?function(){return{}}:u,l=e.graphql_endpoint,f=e.graphql_endpoint_iam_region,h=[{}],(p=!l)?[4,this._headerBasedAuth(o,t)]:[3,4];case 3:p=I.sent(),I.label=4;case 4:return v=[ft.apply(void 0,h.concat([p]))],(y=l)?f?[4,this._headerBasedAuth(o,t)]:[3,6]:[3,8];case 5:return g=I.sent(),[3,7];case 6:g={Authorization:null},I.label=7;case 7:y=g,I.label=8;case 8:return m=[ft.apply(void 0,v.concat([y]))],[4,c({query:r,variables:i})];case 9:if(d=ft.apply(void 0,[ft.apply(void 0,[ft.apply(void 0,m.concat([I.sent()])),t]),!l&&(O={},O["x-amz-user-agent"]=ot.a.userAgent,O)]),b={query:R(r),variables:i},w=Object.assign({headers:d,body:b,signerServiceInfo:{service:l?"execute-api":"appsync",region:l?f:s}},n),!(S=l||a))throw{data:{},errors:[new x("No graphql endpoint provided.")]};I.label=10;case 10:return I.trys.push([10,12,,13]),[4,this._api.post(S,w)];case 11:return _=I.sent(),[3,13];case 12:if(E=I.sent(),this._api.isCancel(E))throw E;return _={data:{},errors:[new x(E.message,null,null,null,null,E)]},[3,13];case 13:if((A=_.errors)&&A.length)throw _;return[2,_]}}))}))},e.prototype.isCancel=function(e){return this._api.isCancel(e)},e.prototype.cancel=function(e,t){return this._api.cancel(e,t)},e.prototype._graphqlSubscribe=function(e,t){var n=e.query,r=e.variables,i=e.authMode,o=e.authToken;void 0===t&&(t={});var s=this._options,a=s.aws_appsync_region,u=s.aws_appsync_graphqlEndpoint,c=s.aws_appsync_authenticationType,l=s.aws_appsync_apiKey,f=s.graphql_headers,d=void 0===f?function(){return{}}:f,h=i||c||"AWS_IAM";if(ut.a&&"function"==typeof ut.a.subscribe)return ut.a.subscribe("",{provider:st.a,appSyncGraphqlEndpoint:u,authenticationType:h,apiKey:l,query:R(n),region:a,variables:r,graphql_headers:d,additionalHeaders:t,authToken:o});throw yt.debug("No pubsub module applied for subscription"),new Error("No pubsub module applied for subscription")},e.prototype._ensureCredentials=function(){var e=this;return this.Credentials.get().then((function(t){if(!t)return!1;var n=e.Credentials.shear(t);return yt.debug("set credentials for api",n),!0})).catch((function(e){return yt.warn("ensure credentials error",e),!1}))},e}(),mt=new gt(null);b.a.register(mt);var bt=function(){return(bt=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)},wt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(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(s,a)}u((r=r.apply(e,t||[])).next())}))},St=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}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,a])}}},_t=new o.a("API"),Et=new(function(){function e(e){this.Auth=r.a,this.Cache=i.a,this.Credentials=s.a,this._options=e,this._restApi=new O(e),this._graphqlApi=new gt(e),_t.debug("API Options",this._options)}return e.prototype.getModuleName=function(){return"API"},e.prototype.configure=function(e){this._options=Object.assign({},this._options,e),this._restApi.Credentials=this.Credentials,this._graphqlApi.Auth=this.Auth,this._graphqlApi.Cache=this.Cache,this._graphqlApi.Credentials=this.Credentials;var t=this._restApi.configure(this._options),n=this._graphqlApi.configure(this._options);return bt(bt({},t),n)},e.prototype.get=function(e,t,n){return this._restApi.get(e,t,n)},e.prototype.post=function(e,t,n){return this._restApi.post(e,t,n)},e.prototype.put=function(e,t,n){return this._restApi.put(e,t,n)},e.prototype.patch=function(e,t,n){return this._restApi.patch(e,t,n)},e.prototype.del=function(e,t,n){return this._restApi.del(e,t,n)},e.prototype.head=function(e,t,n){return this._restApi.head(e,t,n)},e.prototype.isCancel=function(e){return this._restApi.isCancel(e)},e.prototype.cancel=function(e,t){return this._restApi.cancel(e,t)},e.prototype.endpoint=function(e){return wt(this,void 0,void 0,(function(){return St(this,(function(t){return[2,this._restApi.endpoint(e)]}))}))},e.prototype.getGraphqlOperationType=function(e){return this._graphqlApi.getGraphqlOperationType(e)},e.prototype.graphql=function(e,t){return this._graphqlApi.graphql(e,t)},e}())(null);b.a.register(Et);t.a=Et},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r,i=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},s=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e},a={VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5};!function(e){e.DEBUG="DEBUG",e.ERROR="ERROR",e.INFO="INFO",e.WARN="WARN",e.VERBOSE="VERBOSE"}(r||(r={}));var u=function(){function e(e,t){void 0===t&&(t=r.WARN),this.name=e,this.level=t,this._pluggables=[]}return e.prototype._padding=function(e){return e<10?"0"+e:""+e},e.prototype._ts=function(){var e=new Date;return[this._padding(e.getMinutes()),this._padding(e.getSeconds())].join(":")+"."+e.getMilliseconds()},e.prototype.configure=function(e){return e?(this._config=e,this._config):this._config},e.prototype._log=function(t){for(var n,o,s=[],u=1;u<arguments.length;u++)s[u-1]=arguments[u];var c=this.level;e.LOG_LEVEL&&(c=e.LOG_LEVEL),"undefined"!=typeof window&&window.LOG_LEVEL&&(c=window.LOG_LEVEL);var l=a[c],f=a[t];if(f>=l){var d=console.log.bind(console);t===r.ERROR&&console.error&&(d=console.error.bind(console)),t===r.WARN&&console.warn&&(d=console.warn.bind(console));var h="["+t+"] "+this._ts()+" "+this.name,p="";if(1===s.length&&"string"==typeof s[0])d(p=h+" - "+s[0]);else if(1===s.length)p=h+" "+s[0],d(h,s[0]);else if("string"==typeof s[0]){var v=s.slice(1);1===v.length&&(v=v[0]),p=h+" - "+s[0]+" "+v,d(h+" - "+s[0],v)}else p=h+" "+s,d(h,s);try{for(var y=i(this._pluggables),g=y.next();!g.done;g=y.next()){var m=g.value,b={message:p,timestamp:Date.now()};m.pushLogs([b])}}catch(e){n={error:e}}finally{try{g&&!g.done&&(o=y.return)&&o.call(y)}finally{if(n)throw n.error}}}},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,s([r.INFO],e))},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,s([r.INFO],e))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,s([r.WARN],e))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,s([r.ERROR],e))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,s([r.DEBUG],e))},e.prototype.verbose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,s([r.VERBOSE],e))},e.prototype.addPluggable=function(e){e&&"Logging"===e.getCategoryName()&&(this._pluggables.push(e),e.configure(this._config))},e.prototype.listPluggables=function(){return this._pluggables},e.LOG_LEVEL=null,e}()},function(e,t,n){"use strict";var r=n(17),i={keyPrefix:"aws-amplify-cache",capacityInBytes:1048576,itemMaxSize:21e4,defaultTTL:2592e5,defaultPriority:5,warningThreshold:.8,storage:(new(n(30).a)).getStorage()};function o(e){var t=0;t=e.length;for(var n=e.length;n>=0;n-=1){var r=e.charCodeAt(n);r>127&&r<=2047?t+=1:r>2047&&r<=65535&&(t+=2),r>=56320&&r<=57343&&(n-=1)}return t}function s(){return(new Date).getTime()}function a(e){return Number.isInteger?Number.isInteger(e):function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}(e)}var u={},c=(function(){function e(){}e.clear=function(){u={}},e.getItem=function(e){return u[e]||null},e.setItem=function(e,t){u[e]=t},e.removeItem=function(e){delete u[e]}}(),n(22));function l(e){return(l="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)}var f,d=new c.a("StorageCache"),h=function(){function e(e){this.config=Object.assign({},e),this.cacheCurSizeKey=this.config.keyPrefix+"CurSize",this.checkConfig()}return e.prototype.getModuleName=function(){return"Cache"},e.prototype.checkConfig=function(){a(this.config.capacityInBytes)||(d.error("Invalid parameter: capacityInBytes. It should be an Integer. Setting back to default."),this.config.capacityInBytes=i.capacityInBytes),a(this.config.itemMaxSize)||(d.error("Invalid parameter: itemMaxSize. It should be an Integer. Setting back to default."),this.config.itemMaxSize=i.itemMaxSize),a(this.config.defaultTTL)||(d.error("Invalid parameter: defaultTTL. It should be an Integer. Setting back to default."),this.config.defaultTTL=i.defaultTTL),a(this.config.defaultPriority)||(d.error("Invalid parameter: defaultPriority. It should be an Integer. Setting back to default."),this.config.defaultPriority=i.defaultPriority),this.config.itemMaxSize>this.config.capacityInBytes&&(d.error("Invalid parameter: itemMaxSize. It should be smaller than capacityInBytes. Setting back to default."),this.config.itemMaxSize=i.itemMaxSize),(this.config.defaultPriority>5||this.config.defaultPriority<1)&&(d.error("Invalid parameter: defaultPriority. It should be between 1 and 5. Setting back to default."),this.config.defaultPriority=i.defaultPriority),(Number(this.config.warningThreshold)>1||Number(this.config.warningThreshold)<0)&&(d.error("Invalid parameter: warningThreshold. It should be between 0 and 1. Setting back to default."),this.config.warningThreshold=i.warningThreshold);this.config.capacityInBytes>5242880&&(d.error("Cache Capacity should be less than 5MB. Setting back to default. Setting back to default."),this.config.capacityInBytes=i.capacityInBytes)},e.prototype.fillCacheItem=function(e,t,n){var r={key:e,data:t,timestamp:s(),visitedTime:s(),priority:n.priority,expires:n.expires,type:l(t),byteSize:0};return r.byteSize=o(JSON.stringify(r)),r.byteSize=o(JSON.stringify(r)),r},e.prototype.configure=function(e){return e?(e.keyPrefix&&d.warn("Don't try to configure keyPrefix!"),this.config=Object.assign({},this.config,e,e.Cache),this.checkConfig(),this.config):this.config},e}(),p=(f=function(e,t){return(f=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(e,t){function n(){this.constructor=e}f(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),v=new c.a("Cache"),y=new(function(e){function t(t){var n=this,r=t?Object.assign({},i,t):i;return(n=e.call(this,r)||this).config.storage=r.storage,n.getItem=n.getItem.bind(n),n.setItem=n.setItem.bind(n),n.removeItem=n.removeItem.bind(n),n}return p(t,e),t.prototype._decreaseCurSizeInBytes=function(e){var t=this.getCacheCurSize();this.config.storage.setItem(this.cacheCurSizeKey,(t-e).toString())},t.prototype._increaseCurSizeInBytes=function(e){var t=this.getCacheCurSize();this.config.storage.setItem(this.cacheCurSizeKey,(t+e).toString())},t.prototype._refreshItem=function(e,t){return e.visitedTime=s(),this.config.storage.setItem(t,JSON.stringify(e)),e},t.prototype._isExpired=function(e){var t=this.config.storage.getItem(e),n=JSON.parse(t);return s()>=n.expires},t.prototype._removeItem=function(e,t){var n=t||JSON.parse(this.config.storage.getItem(e)).byteSize;this._decreaseCurSizeInBytes(n),this.config.storage.removeItem(e)},t.prototype._setItem=function(e,t){this._increaseCurSizeInBytes(t.byteSize);try{this.config.storage.setItem(e,JSON.stringify(t))}catch(e){this._decreaseCurSizeInBytes(t.byteSize),v.error("Failed to set item "+e)}},t.prototype._sizeToPop=function(e){var t=this.getCacheCurSize()+e-this.config.capacityInBytes,n=(1-this.config.warningThreshold)*this.config.capacityInBytes;return t>n?t:n},t.prototype._isCacheFull=function(e){return e+this.getCacheCurSize()>this.config.capacityInBytes},t.prototype._findValidKeys=function(){for(var e=[],t=[],n=0;n<this.config.storage.length;n+=1)t.push(this.config.storage.key(n));for(n=0;n<t.length;n+=1){var r=t[n];0===r.indexOf(this.config.keyPrefix)&&r!==this.cacheCurSizeKey&&(this._isExpired(r)?this._removeItem(r):e.push(r))}return e},t.prototype._popOutItems=function(e,t){for(var n=[],r=t,i=0;i<e.length;i+=1){var o=this.config.storage.getItem(e[i]);if(null!=o){var s=JSON.parse(o);n.push(s)}}n.sort((function(e,t){return e.priority>t.priority?-1:e.priority<t.priority?1:e.visitedTime<t.visitedTime?-1:1}));for(i=0;i<n.length;i+=1)if(this._removeItem(n[i].key,n[i].byteSize),(r-=n[i].byteSize)<=0)return},t.prototype.setItem=function(e,t,n){v.log("Set item: key is "+e+", value is "+t+" with options: "+n);var r=this.config.keyPrefix+e;if(r!==this.config.keyPrefix&&r!==this.cacheCurSizeKey)if(void 0!==t){var i={priority:n&&void 0!==n.priority?n.priority:this.config.defaultPriority,expires:n&&void 0!==n.expires?n.expires:this.config.defaultTTL+s()};if(i.priority<1||i.priority>5)v.warn("Invalid parameter: priority due to out or range. It should be within 1 and 5.");else{var o=this.fillCacheItem(r,t,i);if(o.byteSize>this.config.itemMaxSize)v.warn("Item with key: "+e+" you are trying to put into is too big!");else try{var a=this.config.storage.getItem(r);if(a&&this._removeItem(r,JSON.parse(a).byteSize),this._isCacheFull(o.byteSize)){var u=this._findValidKeys();if(this._isCacheFull(o.byteSize)){var c=this._sizeToPop(o.byteSize);this._popOutItems(u,c)}}this._setItem(r,o)}catch(e){v.warn("setItem failed! "+e)}}}else v.warn("The value of item should not be undefined!");else v.warn("Invalid key: should not be empty or 'CurSize'")},t.prototype.getItem=function(e,t){v.log("Get item: key is "+e+" with options "+t);var n=null,r=this.config.keyPrefix+e;if(r===this.config.keyPrefix||r===this.cacheCurSizeKey)return v.warn("Invalid key: should not be empty or 'CurSize'"),null;try{if(null!=(n=this.config.storage.getItem(r))){if(!this._isExpired(r)){var i=JSON.parse(n);return(i=this._refreshItem(i,r)).data}this._removeItem(r,JSON.parse(n).byteSize),n=null}if(t&&void 0!==t.callback){var o=t.callback();return null!==o&&this.setItem(e,o,t),o}return null}catch(e){return v.warn("getItem failed! "+e),null}},t.prototype.removeItem=function(e){v.log("Remove item: key is "+e);var t=this.config.keyPrefix+e;if(t!==this.config.keyPrefix&&t!==this.cacheCurSizeKey)try{var n=this.config.storage.getItem(t);n&&this._removeItem(t,JSON.parse(n).byteSize)}catch(e){v.warn("removeItem failed! "+e)}},t.prototype.clear=function(){v.log("Clear Cache");for(var e=[],t=0;t<this.config.storage.length;t+=1){var n=this.config.storage.key(t);0===n.indexOf(this.config.keyPrefix)&&e.push(n)}try{for(t=0;t<e.length;t+=1)this.config.storage.removeItem(e[t])}catch(e){v.warn("clear failed! "+e)}},t.prototype.getAllKeys=function(){for(var e=[],t=0;t<this.config.storage.length;t+=1){var n=this.config.storage.key(t);0===n.indexOf(this.config.keyPrefix)&&n!==this.cacheCurSizeKey&&e.push(n.substring(this.config.keyPrefix.length))}return e},t.prototype.getCacheCurSize=function(){var e=this.config.storage.getItem(this.cacheCurSizeKey);return e||(this.config.storage.setItem(this.cacheCurSizeKey,"0"),e="0"),Number(e)},t.prototype.createInstance=function(e){return e.keyPrefix&&e.keyPrefix!==i.keyPrefix||(v.error("invalid keyPrefix, setting keyPrefix with timeStamp"),e.keyPrefix=s.toString()),new t(e)},t}(h));t.a=y;r.a.register(y)},function(e,t,n){"use strict";n.d(t,"b",(function(){return y})),n.d(t,"a",(function(){return g}));var r=n(22),i=n(15),o=n(155),s=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(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(s,a)}u((r=r.apply(e,t||[])).next())}))},a=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}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,a])}}},u=new r.a("CognitoCredentials"),c=new Promise((function(e,t){return Object(i.b)().isBrowser?(window.gapi&&window.gapi.auth2?window.gapi.auth2:null)?(u.debug("google api already loaded"),e()):void setTimeout((function(){return e()}),2e3):(u.debug("not in the browser, directly resolved"),e())})),l=function(){function e(){this.initialized=!1,this.refreshGoogleToken=this.refreshGoogleToken.bind(this),this._refreshGoogleTokenImpl=this._refreshGoogleTokenImpl.bind(this)}return e.prototype.refreshGoogleToken=function(){return s(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return this.initialized?[3,2]:(u.debug("need to wait for the Google SDK loaded"),[4,c]);case 1:e.sent(),this.initialized=!0,u.debug("finish waiting"),e.label=2;case 2:return[2,this._refreshGoogleTokenImpl()]}}))}))},e.prototype._refreshGoogleTokenImpl=function(){var e=null;return Object(i.b)().isBrowser&&(e=window.gapi&&window.gapi.auth2?window.gapi.auth2:null),e?new Promise((function(t,n){e.getAuthInstance().then((function(e){e||(u.debug("google Auth undefined"),n(new o.a("google Auth undefined")));var r=e.currentUser.get();r.isSignedIn()?(u.debug("refreshing the google access token"),r.reloadAuthResponse().then((function(e){var n=e.id_token,r=e.expires_at;t({token:n,expires_at:r})})).catch((function(e){e&&"network_error"===e.error?n("Network error reloading google auth response"):n(new o.a("Failed to reload google auth response"))}))):n(new o.a("User is not signed in with Google"))})).catch((function(e){u.debug("Failed to refresh google token",e),n(new o.a("Failed to refresh google token"))}))})):(u.debug("no gapi auth2 available"),Promise.reject("no gapi auth2 available"))},e}(),f=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(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(s,a)}u((r=r.apply(e,t||[])).next())}))},d=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}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,a])}}},h=new r.a("CognitoCredentials"),p=new Promise((function(e,t){return Object(i.b)().isBrowser?window.FB?(h.debug("FB SDK already loaded"),e()):void setTimeout((function(){return e()}),2e3):(h.debug("not in the browser, directly resolved"),e())})),v=function(){function e(){this.initialized=!1,this.refreshFacebookToken=this.refreshFacebookToken.bind(this),this._refreshFacebookTokenImpl=this._refreshFacebookTokenImpl.bind(this)}return e.prototype.refreshFacebookToken=function(){return f(this,void 0,void 0,(function(){return d(this,(function(e){switch(e.label){case 0:return this.initialized?[3,2]:(h.debug("need to wait for the Facebook SDK loaded"),[4,p]);case 1:e.sent(),this.initialized=!0,h.debug("finish waiting"),e.label=2;case 2:return[2,this._refreshFacebookTokenImpl()]}}))}))},e.prototype._refreshFacebookTokenImpl=function(){var e=null;if(Object(i.b)().isBrowser&&(e=window.FB),!e){return h.debug("no fb sdk available"),Promise.reject(new o.a("no fb sdk available"))}return new Promise((function(t,n){e.getLoginStatus((function(e){if(e&&e.authResponse){var r=e.authResponse,i=r.accessToken,s=1e3*r.expiresIn+(new Date).getTime();if(!i){a="the jwtToken is undefined";h.debug(a),n(new o.a(a))}t({token:i,expires_at:s})}else{var a="no response from facebook when refreshing the jwt token";h.debug(a),n(new o.a(a))}}),{scope:"public_profile,email"})}))},e}(),y=new l,g=new v},function(e,t,n){var r;e.exports=(r=n(13),n(40),n(97),r.HmacSHA256)},function(e,t,n){"use strict";
|
|
106
|
+
var oe=function(){function e(e,t){var n=e||{},r=n.UserPoolId,i=n.ClientId,o=n.endpoint,s=n.fetchOptions,a=n.AdvancedSecurityDataCollectionFlag;if(!r||!i)throw new Error("Both UserPoolId and ClientId are required.");if(r.length>55||!/^[\w-]+_[0-9a-zA-Z]+$/.test(r))throw new Error("Invalid UserPoolId format.");var u=r.split("_")[0];this.userPoolId=r,this.clientId=i,this.client=new re(u,o,s),this.advancedSecurityDataCollectionFlag=!1!==a,this.storage=e.Storage||(new G).getStorage(),t&&(this.wrapRefreshSessionCallback=t)}var t=e.prototype;return t.getUserPoolId=function(){return this.userPoolId},t.getClientId=function(){return this.clientId},t.signUp=function(e,t,n,r,i,o){var s=this,a={ClientId:this.clientId,Username:e,Password:t,UserAttributes:n,ValidationData:r,ClientMetadata:o};this.getUserContextData(e)&&(a.UserContextData=this.getUserContextData(e)),this.client.request("SignUp",a,(function(t,n){if(t)return i(t,null);var r={Username:e,Pool:s,Storage:s.storage},o={user:new V(r),userConfirmed:n.UserConfirmed,userSub:n.UserSub,codeDeliveryDetails:n.CodeDeliveryDetails};return i(null,o)}))},t.getCurrentUser=function(){var e="CognitoIdentityServiceProvider."+this.clientId+".LastAuthUser",t=this.storage.getItem(e);if(t){var n={Username:t,Pool:this,Storage:this.storage};return new V(n)}return null},t.getUserContextData=function(e){if("undefined"!=typeof AmazonCognitoAdvancedSecurityData){var t=AmazonCognitoAdvancedSecurityData;if(this.advancedSecurityDataCollectionFlag){var n=t.getData(e,this.userPoolId,this.clientId);if(n)return{EncodedData:n}}return{}}},e}(),se=n(27),ae=function(){function e(e){if(!e.domain)throw new Error("The domain of cookieStorage can not be undefined.");if(this.domain=e.domain,e.path?this.path=e.path:this.path="/",Object.prototype.hasOwnProperty.call(e,"expires")?this.expires=e.expires:this.expires=365,Object.prototype.hasOwnProperty.call(e,"secure")?this.secure=e.secure:this.secure=!0,Object.prototype.hasOwnProperty.call(e,"sameSite")){if(!["strict","lax","none"].includes(e.sameSite))throw new Error('The sameSite value of cookieStorage must be "lax", "strict" or "none".');if("none"===e.sameSite&&!this.secure)throw new Error("sameSite = None requires the Secure attribute in latest browser versions.");this.sameSite=e.sameSite}else this.sameSite=null}var t=e.prototype;return t.setItem=function(e,t){var n={path:this.path,expires:this.expires,domain:this.domain,secure:this.secure};return this.sameSite&&(n.sameSite=this.sameSite),se.set(e,t,n),se.get(e)},t.getItem=function(e){return se.get(e)},t.removeItem=function(e){var t={path:this.path,expires:this.expires,domain:this.domain,secure:this.secure};return this.sameSite&&(t.sameSite=this.sameSite),se.remove(e,t)},t.clear=function(){for(var e=se.get(),t=Object.keys(e).length,n=0;n<t;++n)this.removeItem(Object.keys(e)[n]);return{}},e}()},function(e,t,n){"use strict";var r=n(80),i=n.n(r).a;t.a=i},function(e,t,n){"use strict";var r;n.d(t,"a",(function(){return r})),function(e){e.DEFAULT_MSG="Authentication Error",e.EMPTY_EMAIL="Email cannot be empty",e.EMPTY_PHONE="Phone number cannot be empty",e.EMPTY_USERNAME="Username cannot be empty",e.INVALID_USERNAME="The username should either be a string or one of the sign in types",e.EMPTY_PASSWORD="Password cannot be empty",e.EMPTY_CODE="Confirmation code cannot be empty",e.SIGN_UP_ERROR="Error creating account",e.NO_MFA="No valid MFA method provided",e.INVALID_MFA="Invalid MFA type",e.EMPTY_CHALLENGE="Challenge response cannot be empty",e.NO_USER_SESSION="Failed to get the session because the user is empty",e.NETWORK_ERROR="Network Error",e.DEVICE_CONFIG="Device tracking has not been configured in this User Pool"}(r||(r={}))},function(e,t,n){"use strict";var r,i;n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return i})),function(e){e.API_KEY="API_KEY",e.AWS_IAM="AWS_IAM",e.OPENID_CONNECT="OPENID_CONNECT",e.AMAZON_COGNITO_USER_POOLS="AMAZON_COGNITO_USER_POOLS",e.AWS_LAMBDA="AWS_LAMBDA"}(r||(r={})),function(e){e.NO_API_KEY="No api-key configured",e.NO_CURRENT_USER="No current user",e.NO_CREDENTIALS="No credentials",e.NO_FEDERATED_JWT="No federated jwt",e.NO_AUTH_TOKEN="No auth token specified"}(i||(i={}))},function(e,t,n){(function(t){var r;e.exports=(r=r||function(e,r){var i;if("undefined"!=typeof window&&window.crypto&&(i=window.crypto),"undefined"!=typeof self&&self.crypto&&(i=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(i=globalThis.crypto),!i&&"undefined"!=typeof window&&window.msCrypto&&(i=window.msCrypto),!i&&void 0!==t&&t.crypto&&(i=t.crypto),!i)try{i=n(96)}catch(e){}var o=function(){if(i){if("function"==typeof i.getRandomValues)try{return i.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof i.randomBytes)try{return i.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},s=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),a={},u=a.lib={},c=u.Base={extend:function(e){var t=s(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},l=u.WordArray=c.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||d).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var o=0;o<i;o++){var s=n[o>>>2]>>>24-o%4*8&255;t[r+o>>>2]|=s<<24-(r+o)%4*8}else for(var a=0;a<i;a+=4)t[r+a>>>2]=n[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=c.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(o());return new l.init(t,e)}}),f=a.enc={},d=f.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new l.init(n,t/2)}},h=f.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new l.init(n,t)}},p=f.Utf8={stringify:function(e){try{return decodeURIComponent(escape(h.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return h.parse(unescape(encodeURIComponent(e)))}},v=u.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,i=r.words,o=r.sigBytes,s=this.blockSize,a=o/(4*s),u=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*s,c=e.min(4*u,o);if(u){for(var f=0;f<u;f+=s)this._doProcessBlock(i,f);n=i.splice(0,u),r.sigBytes-=c}return new l.init(n,c)},clone:function(){var e=c.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),y=(u.Hasher=v.extend({cfg:c.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){v.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new y.HMAC.init(e,n).finalize(t)}}}),a.algo={});return a}(Math),r)}).call(this,n(29))},function(e,t,n){"use strict";var r=n(61),i=Object.prototype.toString;function o(e){return"[object Array]"===i.call(e)}function s(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===i.call(e)}function l(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),o(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}e.exports={isArray:o,isArrayBuffer:function(e){return"[object ArrayBuffer]"===i.call(e)},isBuffer:function(e){return null!==e&&!s(e)&&null!==e.constructor&&!s(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:a,isPlainObject:u,isUndefined:s,isDate:function(e){return"[object Date]"===i.call(e)},isFile:function(e){return"[object File]"===i.call(e)},isBlob:function(e){return"[object Blob]"===i.call(e)},isFunction:c,isStream:function(e){return a(e)&&c(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:l,merge:function e(){var t={};function n(n,r){u(t[r])&&u(n)?t[r]=e(t[r],n):u(n)?t[r]=e({},n):o(n)?t[r]=n.slice():t[r]=n}for(var r=0,i=arguments.length;r<i;r++)l(arguments[r],n);return t},extend:function(e,t,n){return l(t,(function(t,i){e[i]=n&&"function"==typeof t?r(t,n):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},function(e,t,n){"use strict";(function(e){n.d(t,"d",(function(){return l})),n.d(t,"c",(function(){return f})),n.d(t,"b",(function(){return d})),n.d(t,"a",(function(){return y}));var r=[{type:"text/plain",ext:"txt"},{type:"text/html",ext:"html"},{type:"text/javascript",ext:"js"},{type:"text/css",ext:"css"},{type:"text/csv",ext:"csv"},{type:"text/yaml",ext:"yml"},{type:"text/yaml",ext:"yaml"},{type:"text/calendar",ext:"ics"},{type:"text/calendar",ext:"ical"},{type:"image/apng",ext:"apng"},{type:"image/bmp",ext:"bmp"},{type:"image/gif",ext:"gif"},{type:"image/x-icon",ext:"ico"},{type:"image/x-icon",ext:"cur"},{type:"image/jpeg",ext:"jpg"},{type:"image/jpeg",ext:"jpeg"},{type:"image/jpeg",ext:"jfif"},{type:"image/jpeg",ext:"pjp"},{type:"image/jpeg",ext:"pjpeg"},{type:"image/png",ext:"png"},{type:"image/svg+xml",ext:"svg"},{type:"image/tiff",ext:"tif"},{type:"image/tiff",ext:"tiff"},{type:"image/webp",ext:"webp"},{type:"application/json",ext:"json"},{type:"application/xml",ext:"xml"},{type:"application/x-sh",ext:"sh"},{type:"application/zip",ext:"zip"},{type:"application/x-rar-compressed",ext:"rar"},{type:"application/x-tar",ext:"tar"},{type:"application/x-bzip",ext:"bz"},{type:"application/x-bzip2",ext:"bz2"},{type:"application/pdf",ext:"pdf"},{type:"application/java-archive",ext:"jar"},{type:"application/msword",ext:"doc"},{type:"application/vnd.ms-excel",ext:"xls"},{type:"application/vnd.ms-excel",ext:"xlsx"},{type:"message/rfc822",ext:"eml"}],i=function(e){return void 0===e&&(e={}),0===Object.keys(e).length},o=function(e,t,n){if(!e||!e.sort)return!1;var r=n&&"desc"===n?-1:1;return e.sort((function(e,n){var i=e[t],o=n[t];return void 0===o?void 0===i?0:1*r:void 0===i||i<o?-1*r:i>o?1*r:0})),!0},s=function(e,t){var n=Object.assign({},e);return t&&("string"==typeof t?delete n[t]:t.forEach((function(e){delete n[e]}))),n},a=function(e,t){void 0===t&&(t="application/octet-stream");var n=e.toLowerCase(),i=r.filter((function(e){return n.endsWith("."+e.ext)}));return i.length>0?i[0].type:t},u=function(e){var t=e.toLowerCase();return!!t.startsWith("text/")||("application/json"===t||"application/xml"===t||"application/sh"===t)},c=function(){for(var e="",t="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",n=32;n>0;n-=1)e+=t[Math.floor(Math.random()*t.length)];return e},l=function(e){if(e.isResolved)return e;var t=!0,n=!1,r=!1,i=e.then((function(e){return r=!0,t=!1,e}),(function(e){throw n=!0,t=!1,e}));return i.isFullfilled=function(){return r},i.isPending=function(){return t},i.isRejected=function(){return n},i},f=function(){if("undefined"==typeof self)return!1;var e=self;return void 0!==e.WorkerGlobalScope&&self instanceof e.WorkerGlobalScope},d=function(){return{isBrowser:"undefined"!=typeof window&&void 0!==window.document,isNode:void 0!==e&&null!=e.versions&&null!=e.versions.node}},h=function e(t,n,r){if(void 0===n&&(n=[]),void 0===r&&(r=[]),!v(t))return t;var i={};for(var o in t){if(t.hasOwnProperty(o))i[n.includes(o)?o:o[0].toLowerCase()+o.slice(1)]=r.includes(o)?t[o]:e(t[o],n,r)}return i},p=function e(t,n,r){if(void 0===n&&(n=[]),void 0===r&&(r=[]),!v(t))return t;var i={};for(var o in t){if(t.hasOwnProperty(o))i[n.includes(o)?o:o[0].toUpperCase()+o.slice(1)]=r.includes(o)?t[o]:e(t[o],n,r)}return i},v=function(e){return!(!(e instanceof Object)||e instanceof Array||e instanceof Function||e instanceof Number||e instanceof String||e instanceof Boolean)},y=function(){function e(){}return e.isEmpty=i,e.sortByField=o,e.objectLessAttributes=s,e.filenameToContentType=a,e.isTextFile=u,e.generateRandomString=c,e.makeQuerablePromise=l,e.isWebWorker=f,e.browserOrNode=d,e.transferKeyToLowerCase=h,e.transferKeyToUpperCase=p,e.isStrictObject=v,e}()}).call(this,n(49))},function(t,n){t.exports=e},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(22),i=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},o=new r.a("Amplify"),s=new(function(){function e(){this._components=[],this._config={},this._modules={},this.Auth=null,this.Analytics=null,this.API=null,this.Credentials=null,this.Storage=null,this.I18n=null,this.Cache=null,this.PubSub=null,this.Interactions=null,this.Pushnotification=null,this.UI=null,this.XR=null,this.Predictions=null,this.DataStore=null,this.Logger=r.a,this.ServiceWorker=null}return e.prototype.register=function(e){o.debug("component registered in amplify",e),this._components.push(e),"function"==typeof e.getModuleName?(this._modules[e.getModuleName()]=e,this[e.getModuleName()]=e):o.debug("no getModuleName method for component",e),e.configure(this._config)},e.prototype.configure=function(e){var t=this;return e?(this._config=Object.assign(this._config,e),o.debug("amplify config",this._config),Object.entries(this._modules).forEach((function(e){var n=i(e,2),r=(n[0],n[1]);Object.keys(r).forEach((function(e){t._modules[e]&&(r[e]=t._modules[e])}))})),this._components.map((function(e){e.configure(t._config)})),this._config):this._config},e.prototype.addPluggable=function(e){e&&e.getCategory&&"function"==typeof e.getCategory&&this._components.map((function(t){t.addPluggable&&"function"==typeof t.addPluggable&&t.addPluggable(e)}))},e}())},function(e,t,n){"use strict";var r=n(41);n(9);t.a=r.a},,function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return i}));var r={userAgent:"aws-amplify/4.2.10 js",product:"",navigator:null,isReactNative:!1};if("undefined"!=typeof navigator&&navigator.product)switch(r.product=navigator.product||"",r.navigator=navigator||null,navigator.product){case"ReactNative":r.userAgent="aws-amplify/4.2.10 react-native",r.isReactNative=!0;break;default:r.userAgent="aws-amplify/4.2.10 js",r.isReactNative=!1}var i=function(){return r.userAgent}},function(e,t,n){"use strict";var r=n(41),i=n(23),o=n(22),s=n(39),a=n(20),u=n(156),c=n(71),l=n(31),f=n.n(l),d=n(8),h=function(){return(h=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)},p=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(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(s,a)}u((r=r.apply(e,t||[])).next())}))},v=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}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,a])}}},y=function(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},g=new o.a("RestClient"),m=function(){function e(e){this._region="us-east-1",this._service="execute-api",this._custom_header=void 0,this._cancelTokenMap=null,this.Credentials=s.a,this._options=e,g.debug("API Options",this._options),null==this._cancelTokenMap&&(this._cancelTokenMap=new WeakMap)}return e.prototype.ajax=function(e,t,n){return p(this,void 0,void 0,(function(){var r,i,o,s,c,l,f,p,m,b,w,S,_,E,A=this;return v(this,(function(v){switch(v.label){case 0:return g.debug(t,e),o="us-east-1",s="execute-api",c=void 0,"string"==typeof e?(r=this._parseUrl(e),i=e):(i=e.endpoint,c=e.custom_header,o=e.region,s=e.service,r=this._parseUrl(e.endpoint)),l={method:t,url:i,host:r.host,path:r.path,headers:{},data:null,responseType:"json",timeout:0,cancelToken:null},f={},a.a.isReactNative&&(p=a.a.userAgent||"aws-amplify/0.1.x",f={"User-Agent":p}),m=Object.assign({},n),b=m.response,m.body&&("function"==typeof FormData&&m.body instanceof FormData?(f["Content-Type"]="multipart/form-data",l.data=m.body):(f["Content-Type"]="application/json; charset=UTF-8",l.data=JSON.stringify(m.body))),m.responseType&&(l.responseType=m.responseType),m.withCredentials&&(l.withCredentials=m.withCredentials),m.timeout&&(l.timeout=m.timeout),m.cancellableToken&&(l.cancelToken=m.cancellableToken.token),l.signerServiceInfo=m.signerServiceInfo,"function"!=typeof c?[3,2]:[4,c()];case 1:return S=v.sent(),[3,3];case 2:S=void 0,v.label=3;case 3:return w=S,l.headers=h(h(h({},f),w),m.headers),_=Object(d.parse)(i,!0,!0),_.search,E=y(_,["search"]),l.url=Object(d.format)(h(h({},E),{query:h(h({},E.query),m.queryStringParameters||{})})),void 0!==l.headers.Authorization?(l.headers=Object.keys(l.headers).reduce((function(e,t){return l.headers[t]&&(e[t]=l.headers[t]),e}),{}),[2,this._request(l,b)]):[2,this.Credentials.get().then((function(r){return A._signed(h({},l),r,b,{region:o,service:s}).catch((function(r){if(u.a.isClockSkewError(r)){var i=r.response.headers,o=i&&(i.date||i.Date),s=new Date(o),a=u.a.getDateFromHeaderString(l.headers["x-amz-date"]);if(u.a.isClockSkewed(s))return u.a.setClockOffset(s.getTime()-a.getTime()),A.ajax(e,t,n)}throw r}))}),(function(e){return g.debug("No credentials available, the request will be unsigned"),A._request(l,b)}))]}}))}))},e.prototype.get=function(e,t){return this.ajax(e,"GET",t)},e.prototype.put=function(e,t){return this.ajax(e,"PUT",t)},e.prototype.patch=function(e,t){return this.ajax(e,"PATCH",t)},e.prototype.post=function(e,t){return this.ajax(e,"POST",t)},e.prototype.del=function(e,t){return this.ajax(e,"DELETE",t)},e.prototype.head=function(e,t){return this.ajax(e,"HEAD",t)},e.prototype.cancel=function(e,t){var n=this._cancelTokenMap.get(e);return n&&n.cancel(t),!0},e.prototype.isCancel=function(e){return f.a.isCancel(e)},e.prototype.getCancellableToken=function(){return f.a.CancelToken.source()},e.prototype.updateRequestToBeCancellable=function(e,t){this._cancelTokenMap.set(e,t)},e.prototype.endpoint=function(e){var t=this,n=this._options.endpoints,r="";return Array.isArray(n)?(n.forEach((function(n){n.name===e&&(r=n.endpoint,"string"==typeof n.region?t._region=n.region:"string"==typeof t._options.region&&(t._region=t._options.region),"string"==typeof n.service?t._service=n.service||"execute-api":t._service="execute-api","function"==typeof n.custom_header?t._custom_header=n.custom_header:t._custom_header=void 0)})),r):r},e.prototype._signed=function(e,t,n,r){var i=r.service,o=r.region,s=e.signerServiceInfo,a=y(e,["signerServiceInfo"]),u=o||this._region||this._options.region,l=i||this._service||this._options.service,d={secret_key:t.secretAccessKey,access_key:t.accessKeyId,session_token:t.sessionToken},h={region:u,service:l},p=Object.assign(h,s),v=c.a.sign(a,d,p);return v.data&&(v.body=v.data),g.debug("Signed Request: ",v),delete v.headers.host,f()(v).then((function(e){return n?e:e.data})).catch((function(e){throw g.debug(e),e}))},e.prototype._request=function(e,t){return void 0===t&&(t=!1),f()(e).then((function(e){return t?e:e.data})).catch((function(e){throw g.debug(e),e}))},e.prototype._parseUrl=function(e){var t=e.split("/");return{host:t[2],path:"/"+t.slice(3).join("/")}},e}(),b=n(17),w=function(){return(w=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)},S=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(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(s,a)}u((r=r.apply(e,t||[])).next())}))},_=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}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,a])}}},E=function(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},A=new o.a("RestAPI"),O=function(){function e(e){this._api=null,this.Credentials=s.a,this._options=e,A.debug("API Options",this._options)}return e.prototype.getModuleName=function(){return"RestAPI"},e.prototype.configure=function(e){var t=e||{},n=t.API,r=void 0===n?{}:n,i=E(t,["API"]),o=w(w({},i),r);if(A.debug("configure Rest API",{opt:o}),o.aws_project_region){if(o.aws_cloud_logic_custom){var s=o.aws_cloud_logic_custom;o.endpoints="string"==typeof s?JSON.parse(s):s}o=Object.assign({},o,{region:o.aws_project_region,header:{}})}return Array.isArray(o.endpoints)?o.endpoints.forEach((function(e){void 0!==e.custom_header&&"function"!=typeof e.custom_header&&(A.warn("Rest API "+e.name+", custom_header should be a function"),e.custom_header=void 0)})):this._options&&Array.isArray(this._options.endpoints)?o.endpoints=this._options.endpoints:o.endpoints=[],this._options=Object.assign({},this._options,o),this.createInstance(),this._options},e.prototype.createInstance=function(){return A.debug("create Rest API instance"),this._api=new m(this._options),this._api.Credentials=this.Credentials,!0},e.prototype.get=function(e,t,n){try{var r=this.getEndpointInfo(e,t),i=this._api.getCancellableToken(),o=Object.assign({},n);o.cancellableToken=i;var s=this._api.get(r,o);return this._api.updateRequestToBeCancellable(s,i),s}catch(e){return Promise.reject(e.message)}},e.prototype.post=function(e,t,n){try{var r=this.getEndpointInfo(e,t),i=this._api.getCancellableToken(),o=Object.assign({},n);o.cancellableToken=i;var s=this._api.post(r,o);return this._api.updateRequestToBeCancellable(s,i),s}catch(e){return Promise.reject(e.message)}},e.prototype.put=function(e,t,n){try{var r=this.getEndpointInfo(e,t),i=this._api.getCancellableToken(),o=Object.assign({},n);o.cancellableToken=i;var s=this._api.put(r,o);return this._api.updateRequestToBeCancellable(s,i),s}catch(e){return Promise.reject(e.message)}},e.prototype.patch=function(e,t,n){try{var r=this.getEndpointInfo(e,t),i=this._api.getCancellableToken(),o=Object.assign({},n);o.cancellableToken=i;var s=this._api.patch(r,o);return this._api.updateRequestToBeCancellable(s,i),s}catch(e){return Promise.reject(e.message)}},e.prototype.del=function(e,t,n){try{var r=this.getEndpointInfo(e,t),i=this._api.getCancellableToken(),o=Object.assign({},n);o.cancellableToken=i;var s=this._api.del(r,o);return this._api.updateRequestToBeCancellable(s,i),s}catch(e){return Promise.reject(e.message)}},e.prototype.head=function(e,t,n){try{var r=this.getEndpointInfo(e,t),i=this._api.getCancellableToken(),o=Object.assign({},n);o.cancellableToken=i;var s=this._api.head(r,o);return this._api.updateRequestToBeCancellable(s,i),s}catch(e){return Promise.reject(e.message)}},e.prototype.isCancel=function(e){return this._api.isCancel(e)},e.prototype.cancel=function(e,t){return this._api.cancel(e,t)},e.prototype.endpoint=function(e){return S(this,void 0,void 0,(function(){return _(this,(function(t){return[2,this._api.endpoint(e)]}))}))},e.prototype.getEndpointInfo=function(e,t){var n=this._options.endpoints;if(!Array.isArray(n))throw new Error("API category not configured");var r=n.find((function(t){return t.name===e}));if(!r)throw new Error("API "+e+" does not exist");var i={endpoint:r.endpoint+t};return"string"==typeof r.region?i.region=r.region:"string"==typeof this._options.region&&(i.region=this._options.region),"string"==typeof r.service?i.service=r.service||"execute-api":i.service="execute-api","function"==typeof r.custom_header?i.custom_header=r.custom_header:i.custom_header=void 0,i},e}(),I=new O(null);function T(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 C(e,t){var n=e.locationOffset.column-1,r=P(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,s=t.line+o,a=1===t.line?n:0,u=t.column+a,c=r.split(/\r\n|[\n\r]/g);return"".concat(e.name," (").concat(s,":").concat(u,")\n")+function(e){var t=e.filter((function(e){e[0];return void 0!==e[1]})),n=0,r=!0,i=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(r=(s=a.next()).done);r=!0){var u=s.value[0];n=Math.max(n,u.length)}}catch(e){i=!0,o=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw o}}return t.map((function(e){var t,r=e[0],i=e[1];return P(n-(t=r).length)+t+i})).join("\n")}([["".concat(s-1,": "),c[i-1]],["".concat(s,": "),c[i]],["",P(u-1)+"^"],["".concat(s+1,": "),c[i+1]]])}function P(e){return Array(e+1).join(" ")}function x(e,t,n,r,i,o,s){var a=Array.isArray(t)?0!==t.length?t:void 0:t?[t]:void 0,u=n;if(!u&&a){var c=a[0];u=c&&c.loc&&c.loc.source}var l,f=r;!f&&a&&(f=a.reduce((function(e,t){return t.loc&&e.push(t.loc.start),e}),[])),f&&0===f.length&&(f=void 0),r&&n?l=r.map((function(e){return T(n,e)})):a&&(l=a.reduce((function(e,t){return t.loc&&e.push(T(t.loc.source,t.loc.start)),e}),[]));var d=s||o&&o.extensions;Object.defineProperties(this,{message:{value:e,enumerable:!0,writable:!0},locations:{value:l||void 0,enumerable:Boolean(l)},path:{value:i||void 0,enumerable:Boolean(i)},nodes:{value:a||void 0},source:{value:u||void 0},positions:{value:f||void 0},originalError:{value:o},extensions:{value:d||void 0,enumerable:Boolean(d)}}),o&&o.stack?Object.defineProperty(this,"stack",{value:o.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,x):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}b.a.register(I),x.prototype=Object.create(Error.prototype,{constructor:{value:x},name:{value:"GraphQLError"},toString:{value:function(){return function(e){var t=[];if(e.nodes){var n=!0,r=!1,i=void 0;try{for(var o,s=e.nodes[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var a=o.value;a.loc&&t.push(C(a.loc.source,T(a.loc.source,a.loc.start)))}}catch(e){r=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(r)throw i}}}else if(e.source&&e.locations){var u=e.source,c=!0,l=!1,f=void 0;try{for(var d,h=e.locations[Symbol.iterator]();!(c=(d=h.next()).done);c=!0){var p=d.value;t.push(C(u,p))}}catch(e){l=!0,f=e}finally{try{c||null==h.return||h.return()}finally{if(l)throw f}}}return 0===t.length?e.message:[e.message].concat(t).join("\n\n")+"\n"}(this)}}});var k={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:["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","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","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},N={};function M(e){return Boolean(e&&"string"==typeof e.kind)}function j(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 s=o[t];if("function"==typeof s)return s}}}function R(e){return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:k,r=void 0,i=Array.isArray(e),o=[e],s=-1,a=[],u=void 0,c=void 0,l=void 0,f=[],d=[],h=e;do{var p=++s===o.length,v=p&&0!==a.length;if(p){if(c=0===d.length?void 0:f[f.length-1],u=l,l=d.pop(),v){if(i)u=u.slice();else{var y={};for(var g in u)u.hasOwnProperty(g)&&(y[g]=u[g]);u=y}for(var m=0,b=0;b<a.length;b++){var w=a[b][0],S=a[b][1];i&&(w-=m),i&&null===S?(u.splice(w,1),m++):u[w]=S}}s=r.index,o=r.keys,a=r.edits,i=r.inArray,r=r.prev}else{if(c=l?i?s:o[s]:void 0,null==(u=l?l[c]:h))continue;l&&f.push(c)}var _=void 0;if(!Array.isArray(u)){if(!M(u))throw new Error("Invalid AST Node: "+JSON.stringify(u));var E=j(t,u.kind,p);if(E){if((_=E.call(t,u,c,l,f,d))===N)break;if(!1===_){if(!p){f.pop();continue}}else if(void 0!==_&&(a.push([c,_]),!p)){if(!M(_)){f.pop();continue}u=_}}}void 0===_&&v&&a.push([c,u]),p?f.pop():(r={inArray:i,index:s,keys:o,edits:a,prev:r},o=(i=Array.isArray(u))?u:n[u.kind]||[],s=-1,a=[],l&&d.push(l),l=u)}while(void 0!==r);return 0!==a.length&&(h=a[a.length-1][1]),h}(e,{leave:U})}var U={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return F(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,n=e.name,r=B("(",F(e.variableDefinitions,", "),")"),i=F(e.directives," "),o=e.selectionSet;return n||i||r||"query"!==t?F([t,F([n,r]),i,o]," "):o},VariableDefinition:function(e){var t=e.variable,n=e.type,r=e.defaultValue,i=e.directives;return t+": "+n+B(" = ",r)+B(" ",F(i," "))},SelectionSet:function(e){return L(e.selections)},Field:function(e){var t=e.alias,n=e.name,r=e.arguments,i=e.directives,o=e.selectionSet;return F([B("",t,": ")+n+B("(",F(r,", "),")"),F(i," "),o]," ")},Argument:function(e){return e.name+": "+e.value},FragmentSpread:function(e){return"..."+e.name+B(" ",F(e.directives," "))},InlineFragment:function(e){var t=e.typeCondition,n=e.directives,r=e.selectionSet;return F(["...",B("on ",t),F(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(B("(",F(r,", "),")")," ")+"on ".concat(n," ").concat(B("",F(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?function(e,t){var n=e.replace(/"""/g,'\\"""');return" "!==e[0]&&"\t"!==e[0]||-1!==e.indexOf("\n")?'"""\n'.concat(t?n:q(n),'\n"""'):'"""'.concat(n.replace(/"$/,'"\n'),'"""')}(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"["+F(e.values,", ")+"]"},ObjectValue:function(e){return"{"+F(e.fields,", ")+"}"},ObjectField:function(e){return e.name+": "+e.value},Directive:function(e){return"@"+e.name+B("(",F(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:function(e){var t=e.directives,n=e.operationTypes;return F(["schema",F(t," "),L(n)]," ")},OperationTypeDefinition:function(e){return e.operation+": "+e.type},ScalarTypeDefinition:D((function(e){return F(["scalar",e.name,F(e.directives," ")]," ")})),ObjectTypeDefinition:D((function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return F(["type",t,B("implements ",F(n," & ")),F(r," "),L(i)]," ")})),FieldDefinition:D((function(e){var t=e.name,n=e.arguments,r=e.type,i=e.directives;return t+(n.every((function(e){return-1===e.indexOf("\n")}))?B("(",F(n,", "),")"):B("(\n",q(F(n,"\n")),"\n)"))+": "+r+B(" ",F(i," "))})),InputValueDefinition:D((function(e){var t=e.name,n=e.type,r=e.defaultValue,i=e.directives;return F([t+": "+n,B("= ",r),F(i," ")]," ")})),InterfaceTypeDefinition:D((function(e){var t=e.name,n=e.directives,r=e.fields;return F(["interface",t,F(n," "),L(r)]," ")})),UnionTypeDefinition:D((function(e){var t=e.name,n=e.directives,r=e.types;return F(["union",t,F(n," "),r&&0!==r.length?"= "+F(r," | "):""]," ")})),EnumTypeDefinition:D((function(e){var t=e.name,n=e.directives,r=e.values;return F(["enum",t,F(n," "),L(r)]," ")})),EnumValueDefinition:D((function(e){return F([e.name,F(e.directives," ")]," ")})),InputObjectTypeDefinition:D((function(e){var t=e.name,n=e.directives,r=e.fields;return F(["input",t,F(n," "),L(r)]," ")})),DirectiveDefinition:D((function(e){var t=e.name,n=e.arguments,r=e.locations;return"directive @"+t+(n.every((function(e){return-1===e.indexOf("\n")}))?B("(",F(n,", "),")"):B("(\n",q(F(n,"\n")),"\n)"))+" on "+F(r," | ")})),SchemaExtension:function(e){var t=e.directives,n=e.operationTypes;return F(["extend schema",F(t," "),L(n)]," ")},ScalarTypeExtension:function(e){return F(["extend scalar",e.name,F(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return F(["extend type",t,B("implements ",F(n," & ")),F(r," "),L(i)]," ")},InterfaceTypeExtension:function(e){var t=e.name,n=e.directives,r=e.fields;return F(["extend interface",t,F(n," "),L(r)]," ")},UnionTypeExtension:function(e){var t=e.name,n=e.directives,r=e.types;return F(["extend union",t,F(n," "),r&&0!==r.length?"= "+F(r," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,n=e.directives,r=e.values;return F(["extend enum",t,F(n," "),L(r)]," ")},InputObjectTypeExtension:function(e){var t=e.name,n=e.directives,r=e.fields;return F(["extend input",t,F(n," "),L(r)]," ")}};function D(e){return function(t){return F([t.description,e(t)],"\n")}}function F(e,t){return e?e.filter((function(e){return e})).join(t||""):""}function L(e){return e&&0!==e.length?"{\n"+q(F(e,"\n"))+"\n}":""}function B(e,t,n){return t?e+t+(n||""):""}function q(e){return e&&" "+e.replace(/\n/g,"\n ")}function z(e){return(z="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 H(e){return e&&"object"===z(e)?"function"==typeof e.inspect?e.inspect():Array.isArray(e)?"["+e.map(H).join(", ")+"]":"{"+Object.keys(e).map((function(t){return"".concat(t,": ").concat(H(e[t]))})).join(", ")+"}":"string"==typeof e?'"'+e+'"':"function"==typeof e?"[function ".concat(e.name,"]"):String(e)}function G(e,t){if(!e)throw new Error(t)}function K(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var V,W=function(e,t,n){K(this,"body",void 0),K(this,"name",void 0),K(this,"locationOffset",void 0),this.body=e,this.name=t||"GraphQL request",this.locationOffset=n||{line:1,column:1},this.locationOffset.line>0||G(0,"line in locationOffset is 1-indexed and must be positive"),this.locationOffset.column>0||G(0,"column in locationOffset is 1-indexed and must be positive")};function Y(e,t,n){return new x("Syntax Error: ".concat(n),void 0,e,[t])}function J(e){for(var t=e.split(/\r\n|[\n\r]/g),n=null,r=1;r<t.length;r++){var i=t[r],o=$(i);if(o<i.length&&(null===n||o<n)&&0===(n=o))break}if(n)for(var s=1;s<t.length;s++)t[s]=t[s].slice(n);for(;t.length>0&&Z(t[0]);)t.shift();for(;t.length>0&&Z(t[t.length-1]);)t.pop();return t.join("\n")}function $(e){for(var t=0;t<e.length&&(" "===e[t]||"\t"===e[t]);)t++;return t}function Z(e){return $(e)===e.length}function Q(e,t){var n=new oe(te.SOF,0,0,0,0,null);return{source:e,options:t,lastToken:n,token:n,line:1,lineStart:0,advance:X,lookahead:ee}}function X(){return this.lastToken=this.token,this.token=this.lookahead()}function ee(){var e=this.token;if(e.kind!==te.EOF)do{e=e.next||(e.next=ae(this,e))}while(e.kind===te.COMMENT);return e}V=W,"function"==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(V.prototype,Symbol.toStringTag,{get:function(){return this.constructor.name}});var te=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 ne(e){var t=e.value;return t?"".concat(e.kind,' "').concat(t,'"'):e.kind}var re=String.prototype.charCodeAt,ie=String.prototype.slice;function oe(e,t,n,r,i,o,s){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=s,this.prev=o,this.next=null}function se(e){return isNaN(e)?te.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function ae(e,t){var n=e.source,r=n.body,i=r.length,o=function(e,t,n){var r=e.length,i=t;for(;i<r;){var o=re.call(e,i);if(9===o||32===o||44===o||65279===o)++i;else if(10===o)++i,++n.line,n.lineStart=i;else{if(13!==o)break;10===re.call(e,i+1)?i+=2:++i,++n.line,n.lineStart=i}}return i}(r,t.end,e),s=e.line,a=1+o-e.lineStart;if(o>=i)return new oe(te.EOF,i,i,s,a,t);var u=re.call(r,o);switch(u){case 33:return new oe(te.BANG,o,o+1,s,a,t);case 35:return function(e,t,n,r,i){var o,s=e.body,a=t;do{o=re.call(s,++a)}while(null!==o&&(o>31||9===o));return new oe(te.COMMENT,t,a,n,r,i,ie.call(s,t+1,a))}(n,o,s,a,t);case 36:return new oe(te.DOLLAR,o,o+1,s,a,t);case 38:return new oe(te.AMP,o,o+1,s,a,t);case 40:return new oe(te.PAREN_L,o,o+1,s,a,t);case 41:return new oe(te.PAREN_R,o,o+1,s,a,t);case 46:if(46===re.call(r,o+1)&&46===re.call(r,o+2))return new oe(te.SPREAD,o,o+3,s,a,t);break;case 58:return new oe(te.COLON,o,o+1,s,a,t);case 61:return new oe(te.EQUALS,o,o+1,s,a,t);case 64:return new oe(te.AT,o,o+1,s,a,t);case 91:return new oe(te.BRACKET_L,o,o+1,s,a,t);case 93:return new oe(te.BRACKET_R,o,o+1,s,a,t);case 123:return new oe(te.BRACE_L,o,o+1,s,a,t);case 124:return new oe(te.PIPE,o,o+1,s,a,t);case 125:return new oe(te.BRACE_R,o,o+1,s,a,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 function(e,t,n,r,i){var o=e.body,s=o.length,a=t+1,u=0;for(;a!==s&&null!==(u=re.call(o,a))&&(95===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++a;return new oe(te.NAME,t,a,n,r,i,ie.call(o,t,a))}(n,o,s,a,t);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return function(e,t,n,r,i,o){var s=e.body,a=n,u=t,c=!1;45===a&&(a=re.call(s,++u));if(48===a){if((a=re.call(s,++u))>=48&&a<=57)throw Y(e,u,"Invalid number, unexpected digit after 0: ".concat(se(a),"."))}else u=ue(e,u,a),a=re.call(s,u);46===a&&(c=!0,a=re.call(s,++u),u=ue(e,u,a),a=re.call(s,u));69!==a&&101!==a||(c=!0,43!==(a=re.call(s,++u))&&45!==a||(a=re.call(s,++u)),u=ue(e,u,a));return new oe(c?te.FLOAT:te.INT,t,u,r,i,o,ie.call(s,t,u))}(n,o,u,s,a,t);case 34:return 34===re.call(r,o+1)&&34===re.call(r,o+2)?function(e,t,n,r,i){var o=e.body,s=t+3,a=s,u=0,c="";for(;s<o.length&&null!==(u=re.call(o,s));){if(34===u&&34===re.call(o,s+1)&&34===re.call(o,s+2))return c+=ie.call(o,a,s),new oe(te.BLOCK_STRING,t,s+3,n,r,i,J(c));if(u<32&&9!==u&&10!==u&&13!==u)throw Y(e,s,"Invalid character within String: ".concat(se(u),"."));92===u&&34===re.call(o,s+1)&&34===re.call(o,s+2)&&34===re.call(o,s+3)?(c+=ie.call(o,a,s)+'"""',a=s+=4):++s}throw Y(e,s,"Unterminated string.")}(n,o,s,a,t):function(e,t,n,r,i){var o=e.body,s=t+1,a=s,u=0,c="";for(;s<o.length&&null!==(u=re.call(o,s))&&10!==u&&13!==u;){if(34===u)return c+=ie.call(o,a,s),new oe(te.STRING,t,s+1,n,r,i,c);if(u<32&&9!==u)throw Y(e,s,"Invalid character within String: ".concat(se(u),"."));if(++s,92===u){switch(c+=ie.call(o,a,s-1),u=re.call(o,s)){case 34:c+='"';break;case 47:c+="/";break;case 92:c+="\\";break;case 98:c+="\b";break;case 102:c+="\f";break;case 110:c+="\n";break;case 114:c+="\r";break;case 116:c+="\t";break;case 117:var l=(f=re.call(o,s+1),d=re.call(o,s+2),h=re.call(o,s+3),p=re.call(o,s+4),ce(f)<<12|ce(d)<<8|ce(h)<<4|ce(p));if(l<0)throw Y(e,s,"Invalid character escape sequence: "+"\\u".concat(o.slice(s+1,s+5),"."));c+=String.fromCharCode(l),s+=4;break;default:throw Y(e,s,"Invalid character escape sequence: \\".concat(String.fromCharCode(u),"."))}++s,a=s}}var f,d,h,p;throw Y(e,s,"Unterminated string.")}(n,o,s,a,t)}throw Y(n,o,function(e){if(e<32&&9!==e&&10!==e&&13!==e)return"Cannot contain the invalid character ".concat(se(e),".");if(39===e)return"Unexpected single quote character ('), did you mean to use a double quote (\")?";return"Cannot parse the unexpected character ".concat(se(e),".")}(u))}function ue(e,t,n){var r=e.body,i=t,o=n;if(o>=48&&o<=57){do{o=re.call(r,++i)}while(o>=48&&o<=57);return i}throw Y(e,i,"Invalid number, expected digit but got: ".concat(se(o),"."))}function ce(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}oe.prototype.toJSON=oe.prototype.inspect=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}};var le=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"}),fe=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 de(e,t){var n="string"==typeof e?new W(e):e;if(!(n instanceof W))throw new TypeError("Must provide Source. Received: ".concat(H(n)));return function(e){var t=e.token;return{kind:le.DOCUMENT,definitions:it(e,te.SOF,pe,te.EOF),loc:$e(e,t)}}(Q(n,t||{}))}function he(e){var t=et(e,te.NAME);return{kind:le.NAME,value:t.value,loc:$e(e,t)}}function pe(e){if(Qe(e,te.NAME))switch(e.token.value){case"query":case"mutation":case"subscription":case"fragment":return ve(e);case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return Ue(e);case"extend":return function(e){var t=e.lookahead();if(t.kind===te.NAME)switch(t.value){case"schema":return function(e){var t=e.token;tt(e,"extend"),tt(e,"schema");var n=Ne(e,!0),r=Qe(e,te.BRACE_L)?it(e,te.BRACE_L,Le,te.BRACE_R):[];if(0===n.length&&0===r.length)throw nt(e);return{kind:le.SCHEMA_EXTENSION,directives:n,operationTypes:r,loc:$e(e,t)}}(e);case"scalar":return function(e){var t=e.token;tt(e,"extend"),tt(e,"scalar");var n=he(e),r=Ne(e,!0);if(0===r.length)throw nt(e);return{kind:le.SCALAR_TYPE_EXTENSION,name:n,directives:r,loc:$e(e,t)}}(e);case"type":return function(e){var t=e.token;tt(e,"extend"),tt(e,"type");var n=he(e),r=Be(e),i=Ne(e,!0),o=qe(e);if(0===r.length&&0===i.length&&0===o.length)throw nt(e);return{kind:le.OBJECT_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:o,loc:$e(e,t)}}(e);case"interface":return function(e){var t=e.token;tt(e,"extend"),tt(e,"interface");var n=he(e),r=Ne(e,!0),i=qe(e);if(0===r.length&&0===i.length)throw nt(e);return{kind:le.INTERFACE_TYPE_EXTENSION,name:n,directives:r,fields:i,loc:$e(e,t)}}(e);case"union":return function(e){var t=e.token;tt(e,"extend"),tt(e,"union");var n=he(e),r=Ne(e,!0),i=Ke(e);if(0===r.length&&0===i.length)throw nt(e);return{kind:le.UNION_TYPE_EXTENSION,name:n,directives:r,types:i,loc:$e(e,t)}}(e);case"enum":return function(e){var t=e.token;tt(e,"extend"),tt(e,"enum");var n=he(e),r=Ne(e,!0),i=Ve(e);if(0===r.length&&0===i.length)throw nt(e);return{kind:le.ENUM_TYPE_EXTENSION,name:n,directives:r,values:i,loc:$e(e,t)}}(e);case"input":return function(e){var t=e.token;tt(e,"extend"),tt(e,"input");var n=he(e),r=Ne(e,!0),i=Ye(e);if(0===r.length&&0===i.length)throw nt(e);return{kind:le.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:r,fields:i,loc:$e(e,t)}}(e)}throw nt(e,t)}(e)}else{if(Qe(e,te.BRACE_L))return ve(e);if(De(e))return Ue(e)}throw nt(e)}function ve(e){if(Qe(e,te.NAME))switch(e.token.value){case"query":case"mutation":case"subscription":return ye(e);case"fragment":return function(e){var t=e.token;if(tt(e,"fragment"),e.options.experimentalFragmentVariables)return{kind:le.FRAGMENT_DEFINITION,name:Ie(e),variableDefinitions:me(e),typeCondition:(tt(e,"on"),Re(e)),directives:Ne(e,!1),selectionSet:Se(e),loc:$e(e,t)};return{kind:le.FRAGMENT_DEFINITION,name:Ie(e),typeCondition:(tt(e,"on"),Re(e)),directives:Ne(e,!1),selectionSet:Se(e),loc:$e(e,t)}}(e)}else if(Qe(e,te.BRACE_L))return ye(e);throw nt(e)}function ye(e){var t=e.token;if(Qe(e,te.BRACE_L))return{kind:le.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:Se(e),loc:$e(e,t)};var n,r=ge(e);return Qe(e,te.NAME)&&(n=he(e)),{kind:le.OPERATION_DEFINITION,operation:r,name:n,variableDefinitions:me(e),directives:Ne(e,!1),selectionSet:Se(e),loc:$e(e,t)}}function ge(e){var t=et(e,te.NAME);switch(t.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw nt(e,t)}function me(e){return Qe(e,te.PAREN_L)?it(e,te.PAREN_L,be,te.PAREN_R):[]}function be(e){var t=e.token;return e.options.experimentalVariableDefinitionDirectives?{kind:le.VARIABLE_DEFINITION,variable:we(e),type:(et(e,te.COLON),je(e)),defaultValue:Xe(e,te.EQUALS)?Te(e,!0):void 0,directives:Ne(e,!0),loc:$e(e,t)}:{kind:le.VARIABLE_DEFINITION,variable:we(e),type:(et(e,te.COLON),je(e)),defaultValue:Xe(e,te.EQUALS)?Te(e,!0):void 0,loc:$e(e,t)}}function we(e){var t=e.token;return et(e,te.DOLLAR),{kind:le.VARIABLE,name:he(e),loc:$e(e,t)}}function Se(e){var t=e.token;return{kind:le.SELECTION_SET,selections:it(e,te.BRACE_L,_e,te.BRACE_R),loc:$e(e,t)}}function _e(e){return Qe(e,te.SPREAD)?function(e){var t,n=e.token;if(et(e,te.SPREAD),Qe(e,te.NAME)&&"on"!==e.token.value)return{kind:le.FRAGMENT_SPREAD,name:Ie(e),directives:Ne(e,!1),loc:$e(e,n)};"on"===e.token.value&&(e.advance(),t=Re(e));return{kind:le.INLINE_FRAGMENT,typeCondition:t,directives:Ne(e,!1),selectionSet:Se(e),loc:$e(e,n)}}(e):function(e){var t,n,r=e.token,i=he(e);Xe(e,te.COLON)?(t=i,n=he(e)):n=i;return{kind:le.FIELD,alias:t,name:n,arguments:Ee(e,!1),directives:Ne(e,!1),selectionSet:Qe(e,te.BRACE_L)?Se(e):void 0,loc:$e(e,r)}}(e)}function Ee(e,t){var n=t?Oe:Ae;return Qe(e,te.PAREN_L)?it(e,te.PAREN_L,n,te.PAREN_R):[]}function Ae(e){var t=e.token;return{kind:le.ARGUMENT,name:he(e),value:(et(e,te.COLON),Te(e,!1)),loc:$e(e,t)}}function Oe(e){var t=e.token;return{kind:le.ARGUMENT,name:he(e),value:(et(e,te.COLON),Pe(e)),loc:$e(e,t)}}function Ie(e){if("on"===e.token.value)throw nt(e);return he(e)}function Te(e,t){var n=e.token;switch(n.kind){case te.BRACKET_L:return function(e,t){var n=e.token,r=t?Pe:xe;return{kind:le.LIST,values:rt(e,te.BRACKET_L,r,te.BRACKET_R),loc:$e(e,n)}}(e,t);case te.BRACE_L:return function(e,t){var n=e.token;et(e,te.BRACE_L);var r=[];for(;!Xe(e,te.BRACE_R);)r.push(ke(e,t));return{kind:le.OBJECT,fields:r,loc:$e(e,n)}}(e,t);case te.INT:return e.advance(),{kind:le.INT,value:n.value,loc:$e(e,n)};case te.FLOAT:return e.advance(),{kind:le.FLOAT,value:n.value,loc:$e(e,n)};case te.STRING:case te.BLOCK_STRING:return Ce(e);case te.NAME:return"true"===n.value||"false"===n.value?(e.advance(),{kind:le.BOOLEAN,value:"true"===n.value,loc:$e(e,n)}):"null"===n.value?(e.advance(),{kind:le.NULL,loc:$e(e,n)}):(e.advance(),{kind:le.ENUM,value:n.value,loc:$e(e,n)});case te.DOLLAR:if(!t)return we(e)}throw nt(e)}function Ce(e){var t=e.token;return e.advance(),{kind:le.STRING,value:t.value,block:t.kind===te.BLOCK_STRING,loc:$e(e,t)}}function Pe(e){return Te(e,!0)}function xe(e){return Te(e,!1)}function ke(e,t){var n=e.token;return{kind:le.OBJECT_FIELD,name:he(e),value:(et(e,te.COLON),Te(e,t)),loc:$e(e,n)}}function Ne(e,t){for(var n=[];Qe(e,te.AT);)n.push(Me(e,t));return n}function Me(e,t){var n=e.token;return et(e,te.AT),{kind:le.DIRECTIVE,name:he(e),arguments:Ee(e,t),loc:$e(e,n)}}function je(e){var t,n=e.token;return Xe(e,te.BRACKET_L)?(t=je(e),et(e,te.BRACKET_R),t={kind:le.LIST_TYPE,type:t,loc:$e(e,n)}):t=Re(e),Xe(e,te.BANG)?{kind:le.NON_NULL_TYPE,type:t,loc:$e(e,n)}:t}function Re(e){var t=e.token;return{kind:le.NAMED_TYPE,name:he(e),loc:$e(e,t)}}function Ue(e){var t=De(e)?e.lookahead():e.token;if(t.kind===te.NAME)switch(t.value){case"schema":return function(e){var t=e.token;tt(e,"schema");var n=Ne(e,!0),r=it(e,te.BRACE_L,Le,te.BRACE_R);return{kind:le.SCHEMA_DEFINITION,directives:n,operationTypes:r,loc:$e(e,t)}}(e);case"scalar":return function(e){var t=e.token,n=Fe(e);tt(e,"scalar");var r=he(e),i=Ne(e,!0);return{kind:le.SCALAR_TYPE_DEFINITION,description:n,name:r,directives:i,loc:$e(e,t)}}(e);case"type":return function(e){var t=e.token,n=Fe(e);tt(e,"type");var r=he(e),i=Be(e),o=Ne(e,!0),s=qe(e);return{kind:le.OBJECT_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:o,fields:s,loc:$e(e,t)}}(e);case"interface":return function(e){var t=e.token,n=Fe(e);tt(e,"interface");var r=he(e),i=Ne(e,!0),o=qe(e);return{kind:le.INTERFACE_TYPE_DEFINITION,description:n,name:r,directives:i,fields:o,loc:$e(e,t)}}(e);case"union":return function(e){var t=e.token,n=Fe(e);tt(e,"union");var r=he(e),i=Ne(e,!0),o=Ke(e);return{kind:le.UNION_TYPE_DEFINITION,description:n,name:r,directives:i,types:o,loc:$e(e,t)}}(e);case"enum":return function(e){var t=e.token,n=Fe(e);tt(e,"enum");var r=he(e),i=Ne(e,!0),o=Ve(e);return{kind:le.ENUM_TYPE_DEFINITION,description:n,name:r,directives:i,values:o,loc:$e(e,t)}}(e);case"input":return function(e){var t=e.token,n=Fe(e);tt(e,"input");var r=he(e),i=Ne(e,!0),o=Ye(e);return{kind:le.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:r,directives:i,fields:o,loc:$e(e,t)}}(e);case"directive":return function(e){var t=e.token,n=Fe(e);tt(e,"directive"),et(e,te.AT);var r=he(e),i=He(e);tt(e,"on");var o=function(e){Xe(e,te.PIPE);var t=[];do{t.push(Je(e))}while(Xe(e,te.PIPE));return t}(e);return{kind:le.DIRECTIVE_DEFINITION,description:n,name:r,arguments:i,locations:o,loc:$e(e,t)}}(e)}throw nt(e,t)}function De(e){return Qe(e,te.STRING)||Qe(e,te.BLOCK_STRING)}function Fe(e){if(De(e))return Ce(e)}function Le(e){var t=e.token,n=ge(e);et(e,te.COLON);var r=Re(e);return{kind:le.OPERATION_TYPE_DEFINITION,operation:n,type:r,loc:$e(e,t)}}function Be(e){var t=[];if("implements"===e.token.value){e.advance(),Xe(e,te.AMP);do{t.push(Re(e))}while(Xe(e,te.AMP)||e.options.allowLegacySDLImplementsInterfaces&&Qe(e,te.NAME))}return t}function qe(e){return e.options.allowLegacySDLEmptyFields&&Qe(e,te.BRACE_L)&&e.lookahead().kind===te.BRACE_R?(e.advance(),e.advance(),[]):Qe(e,te.BRACE_L)?it(e,te.BRACE_L,ze,te.BRACE_R):[]}function ze(e){var t=e.token,n=Fe(e),r=he(e),i=He(e);et(e,te.COLON);var o=je(e),s=Ne(e,!0);return{kind:le.FIELD_DEFINITION,description:n,name:r,arguments:i,type:o,directives:s,loc:$e(e,t)}}function He(e){return Qe(e,te.PAREN_L)?it(e,te.PAREN_L,Ge,te.PAREN_R):[]}function Ge(e){var t=e.token,n=Fe(e),r=he(e);et(e,te.COLON);var i,o=je(e);Xe(e,te.EQUALS)&&(i=Pe(e));var s=Ne(e,!0);return{kind:le.INPUT_VALUE_DEFINITION,description:n,name:r,type:o,defaultValue:i,directives:s,loc:$e(e,t)}}function Ke(e){var t=[];if(Xe(e,te.EQUALS)){Xe(e,te.PIPE);do{t.push(Re(e))}while(Xe(e,te.PIPE))}return t}function Ve(e){return Qe(e,te.BRACE_L)?it(e,te.BRACE_L,We,te.BRACE_R):[]}function We(e){var t=e.token,n=Fe(e),r=he(e),i=Ne(e,!0);return{kind:le.ENUM_VALUE_DEFINITION,description:n,name:r,directives:i,loc:$e(e,t)}}function Ye(e){return Qe(e,te.BRACE_L)?it(e,te.BRACE_L,Ge,te.BRACE_R):[]}function Je(e){var t=e.token,n=he(e);if(fe.hasOwnProperty(n.value))return n;throw nt(e,t)}function $e(e,t){if(!e.options.noLocation)return new Ze(t,e.lastToken,e.source)}function Ze(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}function Qe(e,t){return e.token.kind===t}function Xe(e,t){var n=e.token.kind===t;return n&&e.advance(),n}function et(e,t){var n=e.token;if(n.kind===t)return e.advance(),n;throw Y(e.source,n.start,"Expected ".concat(t,", found ").concat(ne(n)))}function tt(e,t){var n=e.token;if(n.kind===te.NAME&&n.value===t)return e.advance(),n;throw Y(e.source,n.start,'Expected "'.concat(t,'", found ').concat(ne(n)))}function nt(e,t){var n=t||e.token;return Y(e.source,n.start,"Unexpected ".concat(ne(n)))}function rt(e,t,n,r){et(e,t);for(var i=[];!Xe(e,r);)i.push(n(e));return i}function it(e,t,n,r){et(e,t);for(var i=[n(e)];!Xe(e,r);)i.push(n(e));return i}Ze.prototype.toJSON=Ze.prototype.inspect=function(){return{start:this.start,end:this.end}};var ot=n(7),st=n(32),at=n(16),ut=n.n(at),ct=n(18),lt=n(12),ft=function(){return(ft=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)},dt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(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(s,a)}u((r=r.apply(e,t||[])).next())}))},ht=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}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,a])}}},pt=function(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},vt=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},yt=new o.a("GraphQLAPI"),gt=function(){function e(e){this._api=null,this.Auth=ct.a,this.Cache=i.a,this.Credentials=s.a,this._options=e,yt.debug("API Options",this._options)}return e.prototype.getModuleName=function(){return"GraphQLAPI"},e.prototype.configure=function(e){var t=e||{},n=t.API,r=void 0===n?{}:n,i=pt(t,["API"]),o=ft(ft({},i),r);return yt.debug("configure GraphQL API",{opt:o}),o.aws_project_region&&(o=Object.assign({},o,{region:o.aws_project_region,header:{}})),void 0!==o.graphql_headers&&"function"!=typeof o.graphql_headers&&(yt.warn("graphql_headers should be a function"),o.graphql_headers=void 0),this._options=Object.assign({},this._options,o),this.createInstance(),this._options},e.prototype.createInstance=function(){return yt.debug("create Rest instance"),this._options?(this._api=new m(this._options),this._api.Credentials=this.Credentials,!0):Promise.reject("API not configured")},e.prototype._headerBasedAuth=function(e,t){return void 0===t&&(t={}),dt(this,void 0,void 0,(function(){var n,r,o,s,a,u,c,l;return ht(this,(function(f){switch(f.label){case 0:switch(n=this._options,r=n.aws_appsync_authenticationType,o=n.aws_appsync_apiKey,s={},e||r||"AWS_IAM"){case"API_KEY":return[3,1];case"AWS_IAM":return[3,2];case"OPENID_CONNECT":return[3,4];case"AMAZON_COGNITO_USER_POOLS":return[3,11];case"AWS_LAMBDA":return[3,15]}return[3,16];case 1:if(!o)throw new Error(lt.b.NO_API_KEY);return s={Authorization:null,"X-Api-Key":o},[3,17];case 2:return[4,this._ensureCredentials()];case 3:if(!f.sent())throw new Error(lt.b.NO_CREDENTIALS);return[3,17];case 4:return f.trys.push([4,9,,10]),a=void 0,[4,i.a.getItem("federatedInfo")];case 5:return(u=f.sent())?(a=u.token,[3,8]):[3,6];case 6:return[4,ct.a.currentAuthenticatedUser()];case 7:(c=f.sent())&&(a=c.token),f.label=8;case 8:if(!a)throw new Error(lt.b.NO_FEDERATED_JWT);return s={Authorization:a},[3,10];case 9:throw f.sent(),new Error(lt.b.NO_CURRENT_USER);case 10:return[3,17];case 11:return f.trys.push([11,13,,14]),[4,this.Auth.currentSession()];case 12:return l=f.sent(),s={Authorization:l.getAccessToken().getJwtToken()},[3,14];case 13:throw f.sent(),new Error(lt.b.NO_CURRENT_USER);case 14:return[3,17];case 15:if(!t.Authorization)throw new Error(lt.b.NO_AUTH_TOKEN);return s={Authorization:t.Authorization},[3,17];case 16:return s={Authorization:null},[3,17];case 17:return[2,s]}}))}))},e.prototype.getGraphqlOperationType=function(e){var t=de(e);return vt(t.definitions,1)[0].operation},e.prototype.graphql=function(e,t){var n=e.query,r=e.variables,i=void 0===r?{}:r,o=e.authMode,s=e.authToken,a=de("string"==typeof n?n:R(n)),u=vt(a.definitions.filter((function(e){return"OperationDefinition"===e.kind})),1)[0],c=(void 0===u?{}:u).operation,l=t||{};switch(s&&(l.Authorization=s),c){case"query":case"mutation":var f=this._api.getCancellableToken(),d={cancellableToken:f},h=this._graphql({query:a,variables:i,authMode:o},l,d);return this._api.updateRequestToBeCancellable(h,f),h;case"subscription":return this._graphqlSubscribe({query:a,variables:i,authMode:o},l)}throw new Error("invalid operation type: "+c)},e.prototype._graphql=function(e,t,n){var r=e.query,i=e.variables,o=e.authMode;return void 0===t&&(t={}),void 0===n&&(n={}),dt(this,void 0,void 0,(function(){var e,s,a,u,c,l,f,d,h,p,v,y,g,m,b,w,S,_,E,A,O;return ht(this,(function(I){switch(I.label){case 0:return this._api?[3,2]:[4,this.createInstance()];case 1:I.sent(),I.label=2;case 2:return e=this._options,s=e.aws_appsync_region,a=e.aws_appsync_graphqlEndpoint,u=e.graphql_headers,c=void 0===u?function(){return{}}:u,l=e.graphql_endpoint,f=e.graphql_endpoint_iam_region,h=[{}],(p=!l)?[4,this._headerBasedAuth(o,t)]:[3,4];case 3:p=I.sent(),I.label=4;case 4:return v=[ft.apply(void 0,h.concat([p]))],(y=l)?f?[4,this._headerBasedAuth(o,t)]:[3,6]:[3,8];case 5:return g=I.sent(),[3,7];case 6:g={Authorization:null},I.label=7;case 7:y=g,I.label=8;case 8:return m=[ft.apply(void 0,v.concat([y]))],[4,c({query:r,variables:i})];case 9:if(d=ft.apply(void 0,[ft.apply(void 0,[ft.apply(void 0,m.concat([I.sent()])),t]),!l&&(O={},O["x-amz-user-agent"]=ot.a.userAgent,O)]),b={query:R(r),variables:i},w=Object.assign({headers:d,body:b,signerServiceInfo:{service:l?"execute-api":"appsync",region:l?f:s}},n),!(S=l||a))throw{data:{},errors:[new x("No graphql endpoint provided.")]};I.label=10;case 10:return I.trys.push([10,12,,13]),[4,this._api.post(S,w)];case 11:return _=I.sent(),[3,13];case 12:if(E=I.sent(),this._api.isCancel(E))throw E;return _={data:{},errors:[new x(E.message,null,null,null,null,E)]},[3,13];case 13:if((A=_.errors)&&A.length)throw _;return[2,_]}}))}))},e.prototype.isCancel=function(e){return this._api.isCancel(e)},e.prototype.cancel=function(e,t){return this._api.cancel(e,t)},e.prototype._graphqlSubscribe=function(e,t){var n=e.query,r=e.variables,i=e.authMode,o=e.authToken;void 0===t&&(t={});var s=this._options,a=s.aws_appsync_region,u=s.aws_appsync_graphqlEndpoint,c=s.aws_appsync_authenticationType,l=s.aws_appsync_apiKey,f=s.graphql_headers,d=void 0===f?function(){return{}}:f,h=i||c||"AWS_IAM";if(ut.a&&"function"==typeof ut.a.subscribe)return ut.a.subscribe("",{provider:st.a,appSyncGraphqlEndpoint:u,authenticationType:h,apiKey:l,query:R(n),region:a,variables:r,graphql_headers:d,additionalHeaders:t,authToken:o});throw yt.debug("No pubsub module applied for subscription"),new Error("No pubsub module applied for subscription")},e.prototype._ensureCredentials=function(){var e=this;return this.Credentials.get().then((function(t){if(!t)return!1;var n=e.Credentials.shear(t);return yt.debug("set credentials for api",n),!0})).catch((function(e){return yt.warn("ensure credentials error",e),!1}))},e}(),mt=new gt(null);b.a.register(mt);var bt=function(){return(bt=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)},wt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(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(s,a)}u((r=r.apply(e,t||[])).next())}))},St=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}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,a])}}},_t=new o.a("API"),Et=new(function(){function e(e){this.Auth=r.a,this.Cache=i.a,this.Credentials=s.a,this._options=e,this._restApi=new O(e),this._graphqlApi=new gt(e),_t.debug("API Options",this._options)}return e.prototype.getModuleName=function(){return"API"},e.prototype.configure=function(e){this._options=Object.assign({},this._options,e),this._restApi.Credentials=this.Credentials,this._graphqlApi.Auth=this.Auth,this._graphqlApi.Cache=this.Cache,this._graphqlApi.Credentials=this.Credentials;var t=this._restApi.configure(this._options),n=this._graphqlApi.configure(this._options);return bt(bt({},t),n)},e.prototype.get=function(e,t,n){return this._restApi.get(e,t,n)},e.prototype.post=function(e,t,n){return this._restApi.post(e,t,n)},e.prototype.put=function(e,t,n){return this._restApi.put(e,t,n)},e.prototype.patch=function(e,t,n){return this._restApi.patch(e,t,n)},e.prototype.del=function(e,t,n){return this._restApi.del(e,t,n)},e.prototype.head=function(e,t,n){return this._restApi.head(e,t,n)},e.prototype.isCancel=function(e){return this._restApi.isCancel(e)},e.prototype.cancel=function(e,t){return this._restApi.cancel(e,t)},e.prototype.endpoint=function(e){return wt(this,void 0,void 0,(function(){return St(this,(function(t){return[2,this._restApi.endpoint(e)]}))}))},e.prototype.getGraphqlOperationType=function(e){return this._graphqlApi.getGraphqlOperationType(e)},e.prototype.graphql=function(e,t){return this._graphqlApi.graphql(e,t)},e}())(null);b.a.register(Et);t.a=Et},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r,i=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},s=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e},a={VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5};!function(e){e.DEBUG="DEBUG",e.ERROR="ERROR",e.INFO="INFO",e.WARN="WARN",e.VERBOSE="VERBOSE"}(r||(r={}));var u=function(){function e(e,t){void 0===t&&(t=r.WARN),this.name=e,this.level=t,this._pluggables=[]}return e.prototype._padding=function(e){return e<10?"0"+e:""+e},e.prototype._ts=function(){var e=new Date;return[this._padding(e.getMinutes()),this._padding(e.getSeconds())].join(":")+"."+e.getMilliseconds()},e.prototype.configure=function(e){return e?(this._config=e,this._config):this._config},e.prototype._log=function(t){for(var n,o,s=[],u=1;u<arguments.length;u++)s[u-1]=arguments[u];var c=this.level;e.LOG_LEVEL&&(c=e.LOG_LEVEL),"undefined"!=typeof window&&window.LOG_LEVEL&&(c=window.LOG_LEVEL);var l=a[c],f=a[t];if(f>=l){var d=console.log.bind(console);t===r.ERROR&&console.error&&(d=console.error.bind(console)),t===r.WARN&&console.warn&&(d=console.warn.bind(console));var h="["+t+"] "+this._ts()+" "+this.name,p="";if(1===s.length&&"string"==typeof s[0])d(p=h+" - "+s[0]);else if(1===s.length)p=h+" "+s[0],d(h,s[0]);else if("string"==typeof s[0]){var v=s.slice(1);1===v.length&&(v=v[0]),p=h+" - "+s[0]+" "+v,d(h+" - "+s[0],v)}else p=h+" "+s,d(h,s);try{for(var y=i(this._pluggables),g=y.next();!g.done;g=y.next()){var m=g.value,b={message:p,timestamp:Date.now()};m.pushLogs([b])}}catch(e){n={error:e}}finally{try{g&&!g.done&&(o=y.return)&&o.call(y)}finally{if(n)throw n.error}}}},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,s([r.INFO],e))},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,s([r.INFO],e))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,s([r.WARN],e))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,s([r.ERROR],e))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,s([r.DEBUG],e))},e.prototype.verbose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,s([r.VERBOSE],e))},e.prototype.addPluggable=function(e){e&&"Logging"===e.getCategoryName()&&(this._pluggables.push(e),e.configure(this._config))},e.prototype.listPluggables=function(){return this._pluggables},e.LOG_LEVEL=null,e}()},function(e,t,n){"use strict";var r=n(17),i={keyPrefix:"aws-amplify-cache",capacityInBytes:1048576,itemMaxSize:21e4,defaultTTL:2592e5,defaultPriority:5,warningThreshold:.8,storage:(new(n(30).a)).getStorage()};function o(e){var t=0;t=e.length;for(var n=e.length;n>=0;n-=1){var r=e.charCodeAt(n);r>127&&r<=2047?t+=1:r>2047&&r<=65535&&(t+=2),r>=56320&&r<=57343&&(n-=1)}return t}function s(){return(new Date).getTime()}function a(e){return Number.isInteger?Number.isInteger(e):function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}(e)}var u={},c=(function(){function e(){}e.clear=function(){u={}},e.getItem=function(e){return u[e]||null},e.setItem=function(e,t){u[e]=t},e.removeItem=function(e){delete u[e]}}(),n(22));function l(e){return(l="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)}var f,d=new c.a("StorageCache"),h=function(){function e(e){this.config=Object.assign({},e),this.cacheCurSizeKey=this.config.keyPrefix+"CurSize",this.checkConfig()}return e.prototype.getModuleName=function(){return"Cache"},e.prototype.checkConfig=function(){a(this.config.capacityInBytes)||(d.error("Invalid parameter: capacityInBytes. It should be an Integer. Setting back to default."),this.config.capacityInBytes=i.capacityInBytes),a(this.config.itemMaxSize)||(d.error("Invalid parameter: itemMaxSize. It should be an Integer. Setting back to default."),this.config.itemMaxSize=i.itemMaxSize),a(this.config.defaultTTL)||(d.error("Invalid parameter: defaultTTL. It should be an Integer. Setting back to default."),this.config.defaultTTL=i.defaultTTL),a(this.config.defaultPriority)||(d.error("Invalid parameter: defaultPriority. It should be an Integer. Setting back to default."),this.config.defaultPriority=i.defaultPriority),this.config.itemMaxSize>this.config.capacityInBytes&&(d.error("Invalid parameter: itemMaxSize. It should be smaller than capacityInBytes. Setting back to default."),this.config.itemMaxSize=i.itemMaxSize),(this.config.defaultPriority>5||this.config.defaultPriority<1)&&(d.error("Invalid parameter: defaultPriority. It should be between 1 and 5. Setting back to default."),this.config.defaultPriority=i.defaultPriority),(Number(this.config.warningThreshold)>1||Number(this.config.warningThreshold)<0)&&(d.error("Invalid parameter: warningThreshold. It should be between 0 and 1. Setting back to default."),this.config.warningThreshold=i.warningThreshold);this.config.capacityInBytes>5242880&&(d.error("Cache Capacity should be less than 5MB. Setting back to default. Setting back to default."),this.config.capacityInBytes=i.capacityInBytes)},e.prototype.fillCacheItem=function(e,t,n){var r={key:e,data:t,timestamp:s(),visitedTime:s(),priority:n.priority,expires:n.expires,type:l(t),byteSize:0};return r.byteSize=o(JSON.stringify(r)),r.byteSize=o(JSON.stringify(r)),r},e.prototype.configure=function(e){return e?(e.keyPrefix&&d.warn("Don't try to configure keyPrefix!"),this.config=Object.assign({},this.config,e,e.Cache),this.checkConfig(),this.config):this.config},e}(),p=(f=function(e,t){return(f=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(e,t){function n(){this.constructor=e}f(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),v=new c.a("Cache"),y=new(function(e){function t(t){var n=this,r=t?Object.assign({},i,t):i;return(n=e.call(this,r)||this).config.storage=r.storage,n.getItem=n.getItem.bind(n),n.setItem=n.setItem.bind(n),n.removeItem=n.removeItem.bind(n),n}return p(t,e),t.prototype._decreaseCurSizeInBytes=function(e){var t=this.getCacheCurSize();this.config.storage.setItem(this.cacheCurSizeKey,(t-e).toString())},t.prototype._increaseCurSizeInBytes=function(e){var t=this.getCacheCurSize();this.config.storage.setItem(this.cacheCurSizeKey,(t+e).toString())},t.prototype._refreshItem=function(e,t){return e.visitedTime=s(),this.config.storage.setItem(t,JSON.stringify(e)),e},t.prototype._isExpired=function(e){var t=this.config.storage.getItem(e),n=JSON.parse(t);return s()>=n.expires},t.prototype._removeItem=function(e,t){var n=t||JSON.parse(this.config.storage.getItem(e)).byteSize;this._decreaseCurSizeInBytes(n),this.config.storage.removeItem(e)},t.prototype._setItem=function(e,t){this._increaseCurSizeInBytes(t.byteSize);try{this.config.storage.setItem(e,JSON.stringify(t))}catch(e){this._decreaseCurSizeInBytes(t.byteSize),v.error("Failed to set item "+e)}},t.prototype._sizeToPop=function(e){var t=this.getCacheCurSize()+e-this.config.capacityInBytes,n=(1-this.config.warningThreshold)*this.config.capacityInBytes;return t>n?t:n},t.prototype._isCacheFull=function(e){return e+this.getCacheCurSize()>this.config.capacityInBytes},t.prototype._findValidKeys=function(){for(var e=[],t=[],n=0;n<this.config.storage.length;n+=1)t.push(this.config.storage.key(n));for(n=0;n<t.length;n+=1){var r=t[n];0===r.indexOf(this.config.keyPrefix)&&r!==this.cacheCurSizeKey&&(this._isExpired(r)?this._removeItem(r):e.push(r))}return e},t.prototype._popOutItems=function(e,t){for(var n=[],r=t,i=0;i<e.length;i+=1){var o=this.config.storage.getItem(e[i]);if(null!=o){var s=JSON.parse(o);n.push(s)}}n.sort((function(e,t){return e.priority>t.priority?-1:e.priority<t.priority?1:e.visitedTime<t.visitedTime?-1:1}));for(i=0;i<n.length;i+=1)if(this._removeItem(n[i].key,n[i].byteSize),(r-=n[i].byteSize)<=0)return},t.prototype.setItem=function(e,t,n){v.log("Set item: key is "+e+", value is "+t+" with options: "+n);var r=this.config.keyPrefix+e;if(r!==this.config.keyPrefix&&r!==this.cacheCurSizeKey)if(void 0!==t){var i={priority:n&&void 0!==n.priority?n.priority:this.config.defaultPriority,expires:n&&void 0!==n.expires?n.expires:this.config.defaultTTL+s()};if(i.priority<1||i.priority>5)v.warn("Invalid parameter: priority due to out or range. It should be within 1 and 5.");else{var o=this.fillCacheItem(r,t,i);if(o.byteSize>this.config.itemMaxSize)v.warn("Item with key: "+e+" you are trying to put into is too big!");else try{var a=this.config.storage.getItem(r);if(a&&this._removeItem(r,JSON.parse(a).byteSize),this._isCacheFull(o.byteSize)){var u=this._findValidKeys();if(this._isCacheFull(o.byteSize)){var c=this._sizeToPop(o.byteSize);this._popOutItems(u,c)}}this._setItem(r,o)}catch(e){v.warn("setItem failed! "+e)}}}else v.warn("The value of item should not be undefined!");else v.warn("Invalid key: should not be empty or 'CurSize'")},t.prototype.getItem=function(e,t){v.log("Get item: key is "+e+" with options "+t);var n=null,r=this.config.keyPrefix+e;if(r===this.config.keyPrefix||r===this.cacheCurSizeKey)return v.warn("Invalid key: should not be empty or 'CurSize'"),null;try{if(null!=(n=this.config.storage.getItem(r))){if(!this._isExpired(r)){var i=JSON.parse(n);return(i=this._refreshItem(i,r)).data}this._removeItem(r,JSON.parse(n).byteSize),n=null}if(t&&void 0!==t.callback){var o=t.callback();return null!==o&&this.setItem(e,o,t),o}return null}catch(e){return v.warn("getItem failed! "+e),null}},t.prototype.removeItem=function(e){v.log("Remove item: key is "+e);var t=this.config.keyPrefix+e;if(t!==this.config.keyPrefix&&t!==this.cacheCurSizeKey)try{var n=this.config.storage.getItem(t);n&&this._removeItem(t,JSON.parse(n).byteSize)}catch(e){v.warn("removeItem failed! "+e)}},t.prototype.clear=function(){v.log("Clear Cache");for(var e=[],t=0;t<this.config.storage.length;t+=1){var n=this.config.storage.key(t);0===n.indexOf(this.config.keyPrefix)&&e.push(n)}try{for(t=0;t<e.length;t+=1)this.config.storage.removeItem(e[t])}catch(e){v.warn("clear failed! "+e)}},t.prototype.getAllKeys=function(){for(var e=[],t=0;t<this.config.storage.length;t+=1){var n=this.config.storage.key(t);0===n.indexOf(this.config.keyPrefix)&&n!==this.cacheCurSizeKey&&e.push(n.substring(this.config.keyPrefix.length))}return e},t.prototype.getCacheCurSize=function(){var e=this.config.storage.getItem(this.cacheCurSizeKey);return e||(this.config.storage.setItem(this.cacheCurSizeKey,"0"),e="0"),Number(e)},t.prototype.createInstance=function(e){return e.keyPrefix&&e.keyPrefix!==i.keyPrefix||(v.error("invalid keyPrefix, setting keyPrefix with timeStamp"),e.keyPrefix=s.toString()),new t(e)},t}(h));t.a=y;r.a.register(y)},function(e,t,n){"use strict";n.d(t,"b",(function(){return y})),n.d(t,"a",(function(){return g}));var r=n(22),i=n(15),o=n(155),s=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(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(s,a)}u((r=r.apply(e,t||[])).next())}))},a=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}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,a])}}},u=new r.a("CognitoCredentials"),c=new Promise((function(e,t){return Object(i.b)().isBrowser?(window.gapi&&window.gapi.auth2?window.gapi.auth2:null)?(u.debug("google api already loaded"),e()):void setTimeout((function(){return e()}),2e3):(u.debug("not in the browser, directly resolved"),e())})),l=function(){function e(){this.initialized=!1,this.refreshGoogleToken=this.refreshGoogleToken.bind(this),this._refreshGoogleTokenImpl=this._refreshGoogleTokenImpl.bind(this)}return e.prototype.refreshGoogleToken=function(){return s(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return this.initialized?[3,2]:(u.debug("need to wait for the Google SDK loaded"),[4,c]);case 1:e.sent(),this.initialized=!0,u.debug("finish waiting"),e.label=2;case 2:return[2,this._refreshGoogleTokenImpl()]}}))}))},e.prototype._refreshGoogleTokenImpl=function(){var e=null;return Object(i.b)().isBrowser&&(e=window.gapi&&window.gapi.auth2?window.gapi.auth2:null),e?new Promise((function(t,n){e.getAuthInstance().then((function(e){e||(u.debug("google Auth undefined"),n(new o.a("google Auth undefined")));var r=e.currentUser.get();r.isSignedIn()?(u.debug("refreshing the google access token"),r.reloadAuthResponse().then((function(e){var n=e.id_token,r=e.expires_at;t({token:n,expires_at:r})})).catch((function(e){e&&"network_error"===e.error?n("Network error reloading google auth response"):n(new o.a("Failed to reload google auth response"))}))):n(new o.a("User is not signed in with Google"))})).catch((function(e){u.debug("Failed to refresh google token",e),n(new o.a("Failed to refresh google token"))}))})):(u.debug("no gapi auth2 available"),Promise.reject("no gapi auth2 available"))},e}(),f=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(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(s,a)}u((r=r.apply(e,t||[])).next())}))},d=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}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,a])}}},h=new r.a("CognitoCredentials"),p=new Promise((function(e,t){return Object(i.b)().isBrowser?window.FB?(h.debug("FB SDK already loaded"),e()):void setTimeout((function(){return e()}),2e3):(h.debug("not in the browser, directly resolved"),e())})),v=function(){function e(){this.initialized=!1,this.refreshFacebookToken=this.refreshFacebookToken.bind(this),this._refreshFacebookTokenImpl=this._refreshFacebookTokenImpl.bind(this)}return e.prototype.refreshFacebookToken=function(){return f(this,void 0,void 0,(function(){return d(this,(function(e){switch(e.label){case 0:return this.initialized?[3,2]:(h.debug("need to wait for the Facebook SDK loaded"),[4,p]);case 1:e.sent(),this.initialized=!0,h.debug("finish waiting"),e.label=2;case 2:return[2,this._refreshFacebookTokenImpl()]}}))}))},e.prototype._refreshFacebookTokenImpl=function(){var e=null;if(Object(i.b)().isBrowser&&(e=window.FB),!e){return h.debug("no fb sdk available"),Promise.reject(new o.a("no fb sdk available"))}return new Promise((function(t,n){e.getLoginStatus((function(e){if(e&&e.authResponse){var r=e.authResponse,i=r.accessToken,s=1e3*r.expiresIn+(new Date).getTime();if(!i){a="the jwtToken is undefined";h.debug(a),n(new o.a(a))}t({token:i,expires_at:s})}else{var a="no response from facebook when refreshing the jwt token";h.debug(a),n(new o.a(a))}}),{scope:"public_profile,email"})}))},e}(),y=new l,g=new v},function(e,t,n){var r;e.exports=(r=n(13),n(40),n(97),r.HmacSHA256)},function(e,t,n){"use strict";
|
|
107
107
|
/*!
|
|
108
108
|
* cookie
|
|
109
109
|
* Copyright(c) 2012-2014 Roman Shtylman
|