{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/AJD3tSYzDJav54BtS5AL/BilQBrFYib4XOX0ioKC8/Calculator.js"],
  "sourcesContent": ["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useRef,useState}from\"react\";// Import the necessary Framer functions\nimport{addPropertyControls,ControlType}from\"framer\";/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/#code-components-auto-sizing\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n */// Define the Calculator component\nexport default function Calculator(props){const maxAmount=props.question1.maxValue;const maxDuration=props.question2.maxValue;const[amount,setAmount]=useState(props.question1.default);const[duration,setDuration]=useState(props.question2.default);const[amountThumbPos,setAmountThumbPos]=useState(amount/maxAmount*100+\"%\");const[durationThumbPos,setDurationThumbPos]=useState(duration/maxDuration*100+\"%\");const amountEle=useRef();const durationEle=useRef();const durationInput=useRef();const amountInput=useRef();const hanleDeposit=()=>{const value1=amountInput.current.value;setAmount(amountInput.current.value);setAmountThumbPos(value1/maxAmount*100+\"%\");};const hanleDuration=()=>{const value1=durationInput.current.value;setDuration(value1);setDurationThumbPos(value1/maxDuration*100+\"%\");};let increament=Number(duration)*50;const evaluateFormula=formula=>{try{// Replace Q1 and Q2 with their respective values\nconst evaluatedFormula=formula.replace(\"Q1\",amount).replace(\"Q2\",duration);// Use the eval function to calculate the result\nconst result=eval(evaluatedFormula);// Ensure the result is a number and not NaN\nreturn isNaN(result)?0:result;}catch(error){console.error(\"Error evaluating formula:\",error);return 0;}};// Calculate the result using the provided formula\nconst result=evaluateFormula(props.formula);const styles={box:{background:props.backgroundColor,borderRadius:\"16px\",padding:\"40px\",color:props.textColor,fontFamily:props.bodyFont.fontFamily},title:{fontSize:\"28px\",fontStyle:\"normal\",fontWeight:500,lineHeight:\"110%\",textAlign:\"center\",letterSpacing:\"-1px\",marginBottom:\"40px\"},subtitle:{fontFamily:\"Figtree\",fontSize:\"18px\",fontStyle:\"normal\",fontWeight:500,lineHeight:\"170%\",marginBottom:\"10px\",color:props.textColor},totalBox:{borderRadius:\"16px\",background:props.totalboxColor,padding:\"40px\",textAlign:\"center\",marginTop:\"40px\"},totalBoxTitle:{fontSize:\"40px\",fontStyle:\"normal\",fontWeight:600,lineHeight:\"110%\",letterSpacing:\"-2px\",marginBottom:\"8px\",color:props.resultTextColor},totalBoxPara:{fontFamily:\"Figtree\",fontSize:\"18px\",fontStyle:\"normal\",fontWeight:400,lineHeight:\"120%\",color:props.textColor},rangeThumb:{backgroundColor:\"#ffff\",minWidth:\"20px\",borderRadius:\"13px\",position:\"absolute\",zIndex:222,top:\"50%\",transform:\"translate(-50%, -50%)\",pointerEvents:\"none\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",color:\"#081717\",fontFamily:\"Figtree\",fontSize:\"12px\",fontWeight:600,lineHeight:\"150%\",padding:\"3px 10px\"},rangeWrap:{position:\"relative\",marginBottom:\"32px\"},progress:{background:\"#FC3E13\",width:\"50%\",position:\"absolute\",borderRadius:\"0.5rem\",height:\"0.5rem\",marginTop:\"3px\",bottom:\"0\",top:\"0\",transform:\"translatey(-50%, -50%)\",pointerEvents:\"none\"}};return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:`\n.range {\n  -webkit-appearance: none;\n  appearance: none;\n  background: transparent;\n  cursor: pointer;\n  width: 100%;\n}\n.range:focus {\n  outline: none;\n}\n.range::-webkit-slider-runnable-track {\n  background-color: #081717;\n  opacity: 0.3;\n  border-radius: 0.5rem;\n  height: 0.5rem;\n}\n.range::-webkit-slider-thumb {\n  -webkit-appearance: none;\n  appearance: none;\n  margin-top: -12px;\n  background-color: transparent;\n  height: 24px;\n  width: 24px;\n  border-radius: 50%;\n}\n.range:focus::-webkit-slider-thumb {\n  border: none;\n  outline: none;\n  outline-offset: none;\n}\n.range::-moz-range-track {\n  background-color: #081717;\n  opacity: 0.3;\n  border-radius: 0.5rem;\n  height: 0.5rem;\n}\n.range::-moz-range-thumb {\n  border: none;\n  border-radius: 0;\n  background-color: transparent;\n  height: 24px;\n  width: 24px;\n  border-radius: 50%;\n}\n.range:focus::-moz-range-thumb {\n  border: none;\n  outline: none;\n  outline-offset: none;\n}`}),/*#__PURE__*/_jsxs(\"div\",{className:\"box\",style:styles.box,children:[/*#__PURE__*/_jsx(\"h1\",{className:\"slideTitle\",style:styles.title,children:props.title}),/*#__PURE__*/_jsxs(\"h4\",{className:\"slideSubTitle\",style:styles.subtitle,children:[props.question1.title,\" (\",amount,\")\"]}),/*#__PURE__*/_jsxs(\"div\",{className:\"rangeWrap\",style:styles.rangeWrap,children:[/*#__PURE__*/_jsx(\"input\",{className:\"range\",ref:amountInput,type:\"range\",min:props.question1.minValue,max:maxAmount,value:amount,step:props.question1.incValue,onInput:hanleDeposit}),/*#__PURE__*/_jsx(\"div\",{className:\"progress\",style:{...styles.progress,width:amountThumbPos}}),/*#__PURE__*/_jsx(\"div\",{className:\"rangeThumb\",ref:amountEle,style:{...styles.rangeThumb,left:amountThumbPos},children:amount})]}),/*#__PURE__*/_jsxs(\"h4\",{className:\"slideSubTitle\",style:styles.subtitle,children:[props.question2.title,\" (\",duration,\" \",props.question2.dynamicDataName,\")\"]}),/*#__PURE__*/_jsxs(\"div\",{className:\"rangeWrap\",style:styles.rangeWrap,children:[/*#__PURE__*/_jsx(\"input\",{className:\"range\",ref:durationInput,type:\"range\",min:props.question2.minValue,step:props.question2.incValue,max:maxDuration,value:duration,onInput:hanleDuration}),/*#__PURE__*/_jsx(\"div\",{className:\"progress\",style:{...styles.progress,width:durationThumbPos}}),/*#__PURE__*/_jsx(\"div\",{className:\"rangeThumb\",ref:durationEle,style:{...styles.rangeThumb,left:durationThumbPos},children:duration})]}),/*#__PURE__*/_jsxs(\"div\",{className:\"totalBox\",style:styles.totalBox,children:[/*#__PURE__*/_jsxs(\"h2\",{style:styles.totalBoxTitle,children:[\"$\",result===0?Number(amount)===0?0:Number(amount)+Number(increament):result]}),/*#__PURE__*/_jsx(\"p\",{style:styles.totalBoxPara,children:\"Total cost per month\"})]})]})]});}addPropertyControls(Calculator,{title:{type:ControlType.String,title:\"Title\",defaultValue:\"How will your money grow?\"},question1:{type:ControlType.Object,title:\"Question 1\",controls:{title:{type:ControlType.String,title:\"Title\",defaultValue:\"Deposit Per Month\"},default:{type:ControlType.Number,title:\"Default Value\",defaultValue:0},minValue:{type:ControlType.Number,title:\"Min Value\",defaultValue:0},maxValue:{type:ControlType.Number,title:\"Max Value\",defaultValue:100},incValue:{type:ControlType.Number,title:\"Inc Value\",defaultValue:10}}},question2:{type:ControlType.Object,title:\"Question 2 (Q2)\",controls:{title:{type:ControlType.String,title:\"Title\",defaultValue:\"Deposit Per Month\"},dynamicDataName:{type:ControlType.String,title:\"Dynamic Data Name\",defaultValue:\"Month\"},default:{type:ControlType.Number,title:\"Default Value\",defaultValue:0},minValue:{type:ControlType.Number,title:\"Min Value\",defaultValue:0},maxValue:{type:ControlType.Number,title:\"Max Value\",defaultValue:100},incValue:{type:ControlType.Number,title:\"Inc Value\",defaultValue:10}}},formula:{type:ControlType.String,title:\"Formula\",defaultValue:\"(Q1 * Q2) % 10\"},bodyFont:{title:\"Body Font\",type:ControlType.Font,controls:\"family\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#ffffff\"},resultTextColor:{type:ControlType.Color,title:\"Result Text Color\",defaultValue:\"#000000\"},backgroundColor:{type:ControlType.Color,title:\"Background Color\",defaultValue:\"#217376\"},totalboxColor:{type:ControlType.Color,title:\"Total box Color\",defaultValue:\"#ffffff\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Calculator\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Calculator.map"],
  "mappings": "qHAQe,SAARA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