import{m as r}from"./p-6f78ea17.js";import{A as e}from"./p-bc71b894.js";import{c as a,b as o,r as s}from"./p-f4d2e8f3.js";const m=(r,e)=>Amplify.API.graphql(Amplify.graphqlOperation(s,{token:r,newPassword:e})).then(r=>{let e="Unknown error";if(r&&r.data&&r.data.resetPassword){if("true"===r.data.resetPassword)return!0;e=r.data.resetPassword}throw{errors:[{inputName:"form_error",errors:[e]}],formData:"",formPath:""}}),i=(r,a,s)=>(e.injector(),Amplify.configure({API:{graphql_headers:async()=>({SiteName:"Resourceville"})}}),Amplify.API.graphql(Amplify.graphqlOperation(o,{user:{login:r,password:a,recaptcha:s}})).then(r=>r.data).catch(r=>{if(r&&r.errors){let e=[];throw r.errors.forEach(r=>{r&&r.message&&e.push(r.message)}),{errors:[{inputName:"form_error",errors:e}],formData:"",formPath:""}}})),t=r=>Amplify.API.graphql(Amplify.graphqlOperation(a,{email:r})).then(r=>(r.data.createCognitoUser.todoSubmitted=JSON.parse(r.data.createCognitoUser.todoSubmitted).map(r=>parseInt(r,10)),r.data.createCognitoUser)),f=()=>{const a=e.injector().tokenService.userAuthToken;return Amplify.configure({API:{graphql_headers:async()=>({Authorization:"Bearer "+a,SiteName:"Resourceville"})}}),Amplify.API.graphql(Amplify.graphqlOperation(r)).then(r=>r.data.me)};export{t as c,f as g,m as r,i as s}