(this["webpackJsonpgonzo-test-client"]=this["webpackJsonpgonzo-test-client"]||[]).push([[103],{Dc3S:function(e,t,n){(function(e){!function e(t,n,o){function r(a,s){if(!n[a]){if(!t[a]){if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[a]={exports:{}};t[a][0].call(u.exports,(function(e){var n=t[a][1][e];return r(n||e)}),u,u.exports,e,t,n,o)}return n[a].exports}for(var i=!1,a=0;ar||u<-1*r)&&(o=Date.now())}Date.now()-o>s&&i()}())};var l=e.context.createAnalyser();return l.minDecibels=-90,l.maxDecibels=-10,l.smoothingTimeConstant=.85,e.connect(l),l.connect(c),c.connect(e.context.destination),{record:function(e,t){i=e,a=t,o=Date.now(),s=!0},stop:u,clear:function(){u(),r.postMessage({command:"clear"})},exportWAV:function(e,t){n=e,r.postMessage({command:"export",sampleRate:t})}}};n.audioRecorder=function(){return{requestDevice:function(){return"undefined"===typeof t&&(window.AudioContext=window.AudioContext||window.webkitAudioContext,t=new AudioContext),navigator.mediaDevices.getUserMedia({audio:!0}).then((function(e){o=e}))},createRecorder:function(e){return i(t.createMediaStreamSource(o),e)},audioContext:function(){return t}}}}()},{"./worker.js":6,webworkify:4}],6:[function(e,t,n){t.exports=function(e){"use strict";var t,n=0,o=[];function r(e,t,n){for(var o=0;o0&&r[r.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]0&&r[r.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]0&&r[r.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]0&&(this.defaultSignUpFields=this.defaultSignUpFields.filter((function(t){return!e.props.signUpConfig.hiddenDefaults.includes(t.key)}))),this.checkCustomSignUpFields()?(this.props.signUpConfig&&this.props.signUpConfig.hideAllDefaults||this.defaultSignUpFields.forEach((function(t){-1===e.signUpFields.findIndex((function(e){return e.key===t.key}))&&e.signUpFields.push(t)})),this.signUpFields.sort((function(e,t){return e.displayOrder&&t.displayOrder?e.displayOrdert.displayOrder?1:e.key0},t.prototype.signUp=function(){var e=this;this.setState({requestPending:!0}),this.inputs.dial_code||(this.inputs.dial_code=this.getDefaultDialCode());var t=this.validate();if(t&&t.length>0)return this.setState({requestPending:!1}),this.error("The following fields need to be filled out: "+t.join(", "));if(!s.a||"function"!==typeof s.a.signUp)throw new Error("No Auth module found, please ensure @aws-amplify/auth is imported");var n={username:this.inputs.username,password:this.inputs.password,attributes:{}},o=Object.keys(this.inputs),r=Object.values(this.inputs);o.forEach((function(t,o){if(!["username","password","checkedValue","dial_code"].includes(t)&&"phone_line_number"!==t&&"dial_code"!==t&&"error"!==t){var i=(e.needPrefix(t)?"custom:":"")+t;n.attributes[i]=r[o]}})),this.phone_number&&(n.attributes.phone_number=this.phone_number);var i=!1;if(this.signUpFields.forEach((function(t){t.label===e.getUsernameLabel()&&(pt.debug("Changing the username to the value of "+t.label),n.username=n.attributes[t.key]||n.username,i=!0)})),!i&&!n.username)throw new Error("Couldn't find the label: "+this.getUsernameLabel()+", in sign up fields according to usernameAttributes!");s.a.signUp(n).then((function(t){e.setState({requestPending:!1}),e.changeState("confirmSignUp",t.user.username)})).catch((function(t){return e.setState({requestPending:!1}),e.error(t)}))},t.prototype.showComponent=function(e){var n=this,r=this.props.hide;return r&&r.includes(t)?null:(this.checkCustomSignUpFields()&&(this.signUpFields=this.props.signUpConfig.signUpFields),this.sortFields(),a.createElement(h,{theme:e,"data-test":ae.section},a.createElement(f,{theme:e,"data-test":ae.headerSection},o.g.get(this.header)),a.createElement(b,{theme:e,"data-test":ae.bodySection},this.signUpFields.map((function(t){return"phone_number"!==t.key?a.createElement(O,{theme:e,key:t.key},t.required?a.createElement(M,{theme:e},o.g.get(t.label)," *"):a.createElement(M,{theme:e},o.g.get(t.label)),a.createElement(I,{autoFocus:0===n.signUpFields.findIndex((function(e){return e.key===t.key})),placeholder:o.g.get(t.placeholder),theme:e,type:t.type,name:t.key,key:t.key,onChange:n.handleInputChange,"data-test":ae.nonPhoneNumberInput})):a.createElement(ve,{theme:e,required:t.required,defaultDialCode:n.getDefaultDialCode(),label:t.label,placeholder:t.placeholder,onChangeText:n.onPhoneNumberChanged,key:"phone_number"})}))),a.createElement(g,{theme:e,"data-test":ae.footerSection},a.createElement(y,{theme:e},a.createElement(A,{disabled:this.state.requestPending,onClick:this.signUp,theme:e,"data-test":ae.createAccountButton},o.g.get("Create Account"))),a.createElement(v,{theme:e},o.g.get("Have an account? "),a.createElement(L,{theme:e,onClick:function(){return n.changeState("signIn")},"data-test":ae.signInLink},o.g.get("Sign in"))))))},t}(Ce),ht=function(){var e=function(t,n){return(e=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])})(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ft=new o.c("ForgotPassword"),mt=function(e){function t(t){var n=e.call(this,t)||this;return n.send=n.send.bind(n),n.submit=n.submit.bind(n),n._validAuthStates=["forgotPassword"],n.state={delivery:null},n}return ht(t,e),t.prototype.send=function(){var e=this,t=this.props.authData,n=void 0===t?{}:t,o=this.getUsernameFromInput()||n.username;if(!s.a||"function"!==typeof s.a.forgotPassword)throw new Error("No Auth module found, please ensure @aws-amplify/auth is imported");s.a.forgotPassword(o).then((function(t){ft.debug(t),e.setState({delivery:t.CodeDeliveryDetails})})).catch((function(t){return e.error(t)}))},t.prototype.submit=function(){var e=this,t=this.props.authData,n=void 0===t?{}:t,o=this.inputs,r=o.code,i=o.password,a=this.getUsernameFromInput()||n.username;if(!s.a||"function"!==typeof s.a.forgotPasswordSubmit)throw new Error("No Auth module found, please ensure @aws-amplify/auth is imported");s.a.forgotPasswordSubmit(a,r,i).then((function(t){ft.debug(t),e.changeState("signIn"),e.setState({delivery:null})})).catch((function(t){return e.error(t)}))},t.prototype.sendView=function(){var e=this.props.theme||u;return a.createElement("div",null,this.renderUsernameField(e))},t.prototype.submitView=function(){var e=this.props.theme||u;return a.createElement("div",null,a.createElement(O,{theme:e},a.createElement(M,{theme:e},o.g.get("Code")," *"),a.createElement(I,{placeholder:o.g.get("Code"),theme:e,key:"code",name:"code",autoComplete:"off",onChange:this.handleInputChange})),a.createElement(O,{theme:e},a.createElement(M,{theme:e},o.g.get("New Password")," *"),a.createElement(I,{placeholder:o.g.get("New Password"),theme:e,type:"password",key:"password",name:"password",autoComplete:"off",onChange:this.handleInputChange})))},t.prototype.showComponent=function(e){var n=this,r=this.props,i=(r.authState,r.hide),s=r.authData,c=void 0===s?{}:s;return i&&i.includes(t)?null:a.createElement(h,{theme:e,"data-test":ge.section},a.createElement(f,{theme:e,"data-test":ge.headerSection},o.g.get("Reset your password")),a.createElement(b,{theme:e,"data-test":ge.bodySection},this.state.delivery||c.username?this.submitView():this.sendView()),a.createElement(g,{theme:e},a.createElement(y,{theme:e},this.state.delivery||c.username?a.createElement(A,{theme:e,onClick:this.submit,"data-test":ge.submitButton},o.g.get("Submit")):a.createElement(A,{theme:e,onClick:this.send,"data-test":ge.sendCodeButton},o.g.get("Send Code"))),a.createElement(v,{theme:e},this.state.delivery||c.username?a.createElement(L,{theme:e,onClick:this.send,"data-test":ge.resendCodeLink},o.g.get("Resend Code")):a.createElement(L,{theme:e,onClick:function(){return n.changeState("signIn")},"data-test":ge.backToSignInLink},o.g.get("Back to Sign In")))))},t}(Ce),gt=function(){var e=function(t,n){return(e=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])})(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),yt=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(t){i(t)}}function s(e){try{c(o.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))},vt=function(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]2?n[2]:n[0];return o.g.get(n[0],r)}var Gt=function(){var e=function(t,n){return(e=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])})(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Kt=new o.c("Authenticator"),Wt=function(e){var t=e.children;return a.createElement(a.Fragment,null,t)},Zt=function(e){function t(t){var n=e.call(this,t)||this;return n.handleStateChange=n.handleStateChange.bind(n),n.handleAuthEvent=n.handleAuthEvent.bind(n),n.onHubCapsule=n.onHubCapsule.bind(n),n._initialAuthState=n.props.authState||"signIn",n.state={authState:"loading"},o.f.listen("auth",n.onHubCapsule),n}return Gt(t,e),t.prototype.componentDidMount=function(){var e=this.props.amplifyConfig;e&&o.n.configure(e),this._isMounted=!0;var t=localStorage.getItem(Se.REDIRECTED_FROM_HOSTED_UI);localStorage.removeItem(Se.REDIRECTED_FROM_HOSTED_UI),"true"!==t&&this.checkUser()},t.prototype.componentWillUnmount=function(){this._isMounted=!1},t.prototype.checkUser=function(){var e=this;if(!s.a||"function"!==typeof s.a.currentAuthenticatedUser)throw new Error("No Auth module found, please ensure @aws-amplify/auth is imported");return s.a.currentAuthenticatedUser().then((function(t){e._isMounted&&e.handleStateChange("signedIn",t)})).catch((function(t){if(e._isMounted){var n=null;try{n=localStorage.getItem("amplify-authenticator-authState")}catch(o){Kt.debug("Failed to get the auth state from local storage",o)}("signedIn"===n?s.a.signOut():Promise.resolve()).then((function(){return e.handleStateChange(e._initialAuthState)})).catch((function(e){Kt.debug("Failed to sign out",e)}))}}))},t.prototype.onHubCapsule=function(e){var t=e.channel,n=e.payload;e.source;if("auth"===t)switch(n.event){case"cognitoHostedUI":this.handleStateChange("signedIn",n.data);break;case"cognitoHostedUI_failure":case"parsingUrl_failure":case"signOut":case"customGreetingSignOut":this.handleStateChange("signIn",null)}},t.prototype.handleStateChange=function(e,t){if(Kt.debug("authenticator state change "+e,t),e!==this.state.authState){"signedOut"===e&&(e="signIn");try{localStorage.setItem("amplify-authenticator-authState",e)}catch(n){Kt.debug("Failed to set the auth state into local storage",n)}this._isMounted&&this.setState({authState:e,authData:t,error:null,showToast:!1}),this.props.onStateChange&&this.props.onStateChange(e,t)}},t.prototype.handleAuthEvent=function(e,t,n){if(void 0===n&&(n=!0),"error"===t.type){var o=this.props.errorMessage||qt,r="string"===typeof o?o:o(t.data);this.setState({error:r,showToast:n})}},t.prototype.render=function(){var e=this,t=this.state,n=t.authState,r=t.authData,i=this.props.theme||u,s=this.props.errorMessage||qt,c=void 0===this.props.container?p:this.props.container||Wt,l=this.props,d=l.hideDefault,h=l.hide,f=void 0===h?[]:h,m=l.federated,g=l.signUpConfig,y=l.usernameAttributes;d&&(f=f.concat([ot,wt,St,It,dt,Pt,Ut,mt,Ht,Ot]));var v=[];"object"===typeof this.props.children&&(Array.isArray(this.props.children)?v=this.props.children:v.push(this.props.children));var b=[a.createElement(ot,{federated:m}),a.createElement(wt,{federated:m}),a.createElement(St,null),a.createElement(It,null),a.createElement(dt,{signUpConfig:g}),a.createElement(Pt,null),a.createElement(Ut,null),a.createElement(mt,null),a.createElement(Ht,null),a.createElement(Ot,null)],w=a.Children.map(v,(function(e){return e.props.override}));f=f.filter((function(e){return!v.find((function(t){return t.type===e}))}));var C=a.Children.map(v,(function(t,o){return a.cloneElement(t,{key:"aws-amplify-authenticator-props-children-"+o,theme:i,messageMap:s,authState:n,authData:r,onStateChange:e.handleStateChange,onAuthEvent:e.handleAuthEvent,hide:f,override:w,usernameAttributes:y})})),S=(d?[]:a.Children.map(b,(function(t,o){return a.cloneElement(t,{key:"aws-amplify-authenticator-default-children-"+o,theme:i,messageMap:s,authState:n,authData:r,onStateChange:e.handleStateChange,onAuthEvent:e.handleAuthEvent,hide:f,override:w,usernameAttributes:y})}))).concat(C),E=this.state.error;return a.createElement(c,{theme:i},this.state.showToast&&a.createElement(H,{theme:i,onClose:function(){return e.setState({showToast:!1})},"data-test":re.signInError},o.g.get(E)),S)},t}(a.Component),Yt=function(){var e=function(t,n){return(e=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])})(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Jt=function(){return(Jt=Object.assign||function(e){for(var t,n=1,o=arguments.length;n1?r[1]:"";return a="lastModified"===i?"asc"===a?"asc":"desc":"desc"===a?"desc":"asc",o.i.sortByField(e,i,a),e}return vn.warn("invalid sort. done nothing. should be a string or function"),e},t.prototype.render=function(){var e=this,t=this.props,n=t.picker,r=t.translateItem,i=t.level,s=t.identityId,c=this.state,u=c.items,l=c.ts,p=this.props.pickerTitle||"Pick",d=this.props.theme||Nt.c,h=u.map((function(t){return t.contentType&&o.i.isTextFile(t.contentType)?a.createElement(gn,{key:t.key,textKey:t.key,theme:d,style:d.albumText,selected:t.selected,translate:r,level:i,identityId:s,onClick:function(){return e.handleClick(t)}}):a.createElement(un,{key:t.key,imgKey:t.key,theme:d,style:d.albumPhoto,selected:t.selected,translate:r,level:i,identityId:s,onClick:function(){return e.handleClick(t)}})}));return a.createElement("div",null,a.createElement("div",{style:d.album},h),n?a.createElement(tn,{key:l,title:p,accept:"image/*, text/*",onPick:this.handlePick,theme:d}):null)}}(a.Component),function(){var e=function(t,n){return(e=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])})(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}()),wn=function(){return(wn=Object.assign||function(e){for(var t,n=1,o=arguments.length;n0&&r[r.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]0&&r[r.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]