{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/V7ZJ0Ra8qPTMQrbcXXqD/U18ja8XA04kYJzDtKzXj/ForgotPasswordForm.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useMemo,useState}from\"react\";// @ts-ignore\nimport{addPropertyControls,ControlType,withCSS}from\"framer\";// @ts-ignore\nimport{auth}from\"https://cdn.framerauth.com/packages/sdk/live/latest/framerauth.esm.js\";import BaseForm,{basePropertyControls}from\"https://framerusercontent.com/modules/ExV5oOjPmSTY0gHEjmby/NpqywsqBSPokrP5l2Kmw/BaseForm.js\";//////////////////////////////////\n/////// FORM CONFIGURATION ///////\n//////////////////////////////////\n// Define inputs\nconst baseInputs=[{label:\"Email\",name:\"email\",type:\"email\",required:true,extra:false,placeholder:\"Email\"}];const formId=\"forgot_password\"// Unique form ID for this form.\n;const defaultButtonLabel=\"Send Reset Email\"// Default submit button label on this form.\n;const buttonLabelKey=`${formId}_button_label`// Key for button label property control.\n;/**\n * Forgot Password Form\n * By Joel Whitaker\n *\n * @framerDisableUnlink\n *\n * @framerIntrinsicWidth 300\n * @framerIntrinsicHeight 40\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight any\n */const ForgotPasswordForm=withCSS(function ForgotPasswordForm({...baseProps}){const[inputs,setInputs]=useState(baseInputs)// We can override inputs with property controls.\n;const buttonProps=useMemo(()=>{// Map button label to button\n// This is to avoid style copy-pasting of the button label.\nreturn{...baseProps.button,label:baseProps.button[buttonLabelKey]};},[baseProps.button,baseProps.button[buttonLabelKey]]);useEffect(()=>{// Map input labels to inputs\nif(baseProps.inputFields){const newInputs=[];baseInputs.forEach((input,_idx)=>{const inputControlName=snakeToCamel(input.name);if(!(inputControlName in baseProps.inputFields)){// If the input is not in the inputFields object, skip it.\nconsole.log(`Input ${inputControlName} not found in inputFields object.`);return;}const inputField=baseProps.inputFields[inputControlName];const display=inputField.display;const label=inputField.label;const placeholder=label;if(display===true||display===undefined){newInputs.push({...input,label,placeholder});}});setInputs(newInputs);}},[baseProps.inputFields]);const onSubmit=async formData=>{const{data:_,error}=await auth.resetPasswordForEmail({email:formData.email});if(error){return{ok:false,message:error.message};}return{ok:true,message:\"Email instructions sent.\"};};return /*#__PURE__*/_jsx(BaseForm,{...baseProps,button:buttonProps,inputs:inputs,onSubmit:onSubmit});},[]);const snakeToCamel=str=>{return str.split(\"_\").map((word,index)=>{if(index===0){return word;}return word.charAt(0).toUpperCase()+word.slice(1);}).join(\"\");};// Here we can override property controls if we don't want to expose them to the user.\n// We generate the inputs property controls dynamically based on the inputs array.\nconst inputsPropertyControls={};baseInputs.forEach((input,_idx)=>{const inputControlName=snakeToCamel(input.name);inputsPropertyControls[inputControlName]={title:`${input.label}`,type:ControlType.Object,controls:{display:input.extra===true?{title:\"Display\",type:ControlType.Boolean,defaultValue:true}:undefined,label:{title:\"Label\",type:ControlType.String,defaultValue:input.label}}};});const exportBasePropertyControls={...basePropertyControls,inputFields:{title:\"Inputs\",type:ControlType.Object,controls:inputsPropertyControls},link:{title:\"Redirect\",type:ControlType.Link},button:{// Inject default button label\n...basePropertyControls.button,controls:{...basePropertyControls.button.controls,label:undefined,[buttonLabelKey]:{...basePropertyControls.button.controls.label,defaultValue:defaultButtonLabel}}}};// @ts-ignore - TS doesn't like our basePropertyControls type.\naddPropertyControls(ForgotPasswordForm,exportBasePropertyControls);ForgotPasswordForm.defaultProps={...BaseForm.defaultProps,...ForgotPasswordForm.defaultProps};export default ForgotPasswordForm;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ForgotPasswordForm\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerIntrinsicWidth\":\"300\",\"framerSupportedLayoutHeight\":\"any\",\"framerDisableUnlink\":\"*\",\"framerIntrinsicHeight\":\"40\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],
  "mappings": "4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AE,CAAC,CAAC,EAAQT,EAAaW,GAAaA,EAAI,MAAM,GAAG,EAAE,IAAI,CAACC,EAAKC,IAAYA,IAAQ,EAAUD,EAAaA,EAAK,OAAO,CAAC,EAAE,YAAY,EAAEA,EAAK,MAAM,CAAC,CAAG,EAAE,KAAK,EAAE,EAE7zBE,EAAuB,CAAC,EAAE/B,EAAW,QAAQ,CAACc,EAAMC,IAAO,CAAC,IAAMC,EAAiBC,EAAaH,EAAM,IAAI,EAAEiB,EAAuBf,CAAgB,EAAE,CAAC,MAAM,GAAGF,EAAM,QAAQ,KAAKkB,EAAY,OAAO,SAAS,CAAC,QAAQlB,EAAM,QAAQ,GAAK,CAAC,MAAM,UAAU,KAAKkB,EAAY,QAAQ,aAAa,EAAI,EAAE,OAAU,MAAM,CAAC,MAAM,QAAQ,KAAKA,EAAY,OAAO,aAAalB,EAAM,KAAK,CAAC,CAAC,CAAE,CAAC,EAAE,IAAMmB,EAA2B,CAAC,GAAGC,EAAqB,YAAY,CAAC,MAAM,SAAS,KAAKF,EAAY,OAAO,SAASD,CAAsB,EAAE,KAAK,CAAC,MAAM,WAAW,KAAKC,EAAY,IAAI,EAAE,OAAO,CACvkB,GAAGE,EAAqB,OAAO,SAAS,CAAC,GAAGA,EAAqB,OAAO,SAAS,MAAM,OAAU,CAAC/B,CAAc,EAAE,CAAC,GAAG+B,EAAqB,OAAO,SAAS,MAAM,aAAahC,CAAkB,CAAC,CAAC,CAAC,EACnMiC,EAAoB/B,EAAmB6B,CAA0B,EAAE7B,EAAmB,aAAa,CAAC,GAAGmB,EAAS,aAAa,GAAGnB,EAAmB,YAAY,EAAE,IAAOgC,EAAQhC",
  "names": ["baseInputs", "formId", "defaultButtonLabel", "buttonLabelKey", "ForgotPasswordForm", "withCSS", "baseProps", "inputs", "setInputs", "ye", "buttonProps", "se", "ue", "newInputs", "input", "_idx", "inputControlName", "snakeToCamel", "inputField", "display", "label", "placeholder", "p", "BaseForm_default", "formData", "_", "error", "N", "str", "word", "index", "inputsPropertyControls", "ControlType", "exportBasePropertyControls", "basePropertyControls", "addPropertyControls", "ForgotPasswordForm_default"]
}
