{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/7dxKZNJeLClduCYjZP2X/tBOVADIwr2xrCdDplHrL/ROI_Calculator.js"],
  "sourcesContent": ["// Welcome to Code in Framer\n// Get Started: https://www.framer.com/developers\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion,animate}from\"framer-motion\";import React,{useState}from\"react\";// Styles are written in object syntax\n// https://react.dev/reference/react-dom/components/common#usage\nconst boxStyle={width:\"100%\",height:\"auto\",fontFamily:\"Proxima, Proxima Nova, Proxima Nova Regular, Proxima Nova Regular Placeholder, sans-serif\",lineHeight:1.6,display:\"grid\",gridTemplate:\"min-content 1fr / 100%\"};const baseInputStyle={outline:\"none\",border:\"0px solid #08074D\",fontFamily:\"Proxima, Proxima Nova, Proxima Nova Regular, Proxima Nova Regular Placeholder, sans-serif\",textAlign:\"center\",padding:\"3px 4px\",background:\"#fff\",color:\"#01002A\"};const formInputsStyle={padding:\"0px 30px 30px 30px\"};const roiResultStyle={padding:\"30px 30px 30px 30px\",position:\"relative\",background:\"#fff\",color:\"#01002A\",overflow:\"visible\",display:\"flex\",flexDirection:\"column\",justifyContent:\"space-between\",gap:\"20px\"};const roiHeaderLabel={margin:0,fontWeight:700,zIndex:1};const roiHeaderResult={margin:0,fontSize:\"3.5rem\",fontWeight:700,lineHeight:\"1em\",zIndex:1};const roiHeaderComment={margin:0,opacity:1,zIndex:1};const scaleVariants={initial:{scale:1},animate:{scale:[1,1.2,1]}};const getDynamicWidth=(value,fontSize)=>{// Calculate the width based on the input's value length\n// Here, 30 is the base width, and 10 is the width per additional character\nconst minWidth=fontSize;const charWidth=fontSize/1.5;return`${Math.max(minWidth,value.toString().length*charWidth)+charWidth}px`;};function convertMonthDisplay(m,mois){if(!isFinite(m)){return`_ ${mois}`;}if(m<0){return 0;}const years=Math.floor(m/12);const m_left=m%12;let resultat=\"\";if(years>0){resultat+=`${years} an`;if(years>1){resultat+=\"s\";}resultat+=\" \";}if(m_left>0){resultat+=`${m_left} ${mois}`;}return resultat;}function convertEuroDisplay(m){return!isFinite(m)?0:Math.max(0,m);}const operatorCost=35e3;const scrapCost=1;function CalculatorInput(props){return /*#__PURE__*/_jsx(motion.input,{type:\"number\",value:props.value,onChange:props.onChange,whileFocus:{scale:1.1,color:\"#01002A\",background:\"#fff\"},whileHover:{scale:1.1,color:\"#01002A\",background:\"#fff\"},min:props.min,max:props.max,style:{...baseInputStyle,fontSize:`${props.fontSize}px`,//color: props.color,\nwidth:getDynamicWidth(props.value,props.fontSize)}});}function AnimatedNumber({value}){const[displayValue,setDisplayValue]=useState(value);React.useEffect(()=>{const controls=animate(displayValue,value,{type:\"tween\",duration:.5,onUpdate:latest=>{setDisplayValue(Math.round(latest));}});return()=>controls.stop();},[value]);return /*#__PURE__*/_jsx(React.Fragment,{children:displayValue.toLocaleString(\"fr-FR\")});}export default function ROI_Calculator(props){const{fontSize,color,texts,sparkCost}=props;const[operators,setOperators]=React.useState(2);const[producedPieces,setProducedPieces]=React.useState(1e5);const[scrapRatePercent,setScrapRatePercent]=React.useState(5);const[passThroughs,setPassThroughs]=React.useState(10);const[passThroughCost,setPassThroughCost]=React.useState(2e3);const totalOperatorCost=operators*operatorCost;const totalScrapCost=scrapRatePercent/100*producedPieces*scrapCost;const totalPassThroughsCost=passThroughs*passThroughCost;const qualityCost=totalOperatorCost+totalScrapCost+totalPassThroughsCost;const roi=qualityCost/sparkCost;const roi_euros=Math.max(qualityCost-sparkCost,0);const roi_percent=Math.round(roi)*100;const roi_months=Math.round(12/roi);React.useEffect(()=>{const css=`\n            /* Chrome, Safari, Edge, Opera */\n            input::-webkit-outer-spin-button,\n            input::-webkit-inner-spin-button {\n                -webkit-appearance: none;\n                margin: 0;\n            }\n\n            /* Firefox */\n            input[type=number] {\n                -moz-appearance: textfield;\n            }\n            * {\n                -webkit-font-smoothing: antialiased;\n            }\n        `;const style=document.createElement(\"style\");style.type=\"text/css\";style.appendChild(document.createTextNode(css));document.head.appendChild(style);return()=>{document.head.removeChild(style);};},[]);return /*#__PURE__*/_jsxs(\"div\",{style:{...boxStyle,fontSize,color},children:[/*#__PURE__*/_jsx(\"div\",{style:formInputsStyle,children:/*#__PURE__*/_jsx(\"div\",{style:{borderLeft:\"2px solid rgba(250, 250, 250, 0.2)\",paddingLeft:20},children:/*#__PURE__*/_jsxs(\"span\",{children:[texts.surMonPoint,/*#__PURE__*/_jsx(CalculatorInput,{value:operators,onChange:e=>setOperators(parseInt(e.target.value)),...props,min:0,max:100}),\" \",texts.operateurDedi\u00E9,/*#__PURE__*/_jsx(CalculatorInput,{value:producedPieces,onChange:e=>setProducedPieces(parseInt(e.target.value)),...props}),\" \",texts.pieceProduite,/*#__PURE__*/_jsx(CalculatorInput,{value:scrapRatePercent,onChange:e=>setScrapRatePercent(parseInt(e.target.value)),min:0,max:100,...props}),texts.percentLeNombre,/*#__PURE__*/_jsx(CalculatorInput,{type:\"number\",value:passThroughs,onChange:e=>setPassThroughs(parseInt(e.target.value)),min:0,max:1e5,...props}),texts.etLeCout,/*#__PURE__*/_jsx(CalculatorInput,{type:\"number\",value:passThroughCost,onChange:e=>setPassThroughCost(parseInt(e.target.value)),...props}),\"\u20AC.\"]})})}),/*#__PURE__*/_jsxs(\"div\",{style:roiResultStyle,children:[/*#__PURE__*/_jsx(\"p\",{style:roiHeaderLabel,children:texts.votreRoi}),/*#__PURE__*/_jsxs(\"p\",{style:roiHeaderResult,children:[/*#__PURE__*/_jsx(AnimatedNumber,{value:convertEuroDisplay(roi_euros)}),\"\u20AC\"]}),/*#__PURE__*/_jsxs(\"p\",{style:roiHeaderComment,children:[texts.estimeEn,\" \",/*#__PURE__*/_jsx(\"b\",{children:convertMonthDisplay(roi_months,texts.mois)}),texts.amortissementMoyen]})]})]});}addPropertyControls(ROI_Calculator,{fontSize:{title:\"Font Size\",type:ControlType.Number,defaultValue:30},sparkCost:{title:\"Spark Cost\",type:ControlType.Number,defaultValue:29e3},texts:{title:\"Textes\",type:ControlType.Object,controls:{surMonPoint:{title:\"Sur mon point...\",type:ControlType.String,defaultValue:\"Sur mon point d'inspection, il y a \"},operateurDedi\u00E9:{title:\"op\\xe9rateurs d\\xe9di\\xe9s ....\",type:ControlType.String,defaultValue:\"op\\xe9rateurs d\\xe9di\\xe9s \\xe0 l'inspection pour \"},pieceProduite:{title:\"pi\\xe8ces produites par an. Le taux ....\",type:ControlType.String,defaultValue:\"pi\\xe8ces produites par an. Le taux de rebut est de \"},percentLeNombre:{title:\"%, le nombre de ....\",type:ControlType.String,defaultValue:\"%, le nombre de r\\xe9clamations clients est de \"},etLeCout:{title:\", et le co\\xfbt associ\\xe9 ....\",type:ControlType.String,defaultValue:\", et le co\\xfbt associ\\xe9 \\xe0 chaque r\\xe9clamation de \"},votreRoi:{title:\"Votre ROI\",type:ControlType.String,defaultValue:\"Votre ROI\"},estimeEn:{title:\"Amortissement estim\\xe9 en ...\",type:ControlType.String,defaultValue:\"Amortissement estim\\xe9 en\"},amortissementMoyen:{title:\"L'amortissement moyen de nos clients\",type:ControlType.String,defaultValue:\" L'amortissement moyen de nos clients est de 10 mois.\"},mois:{title:\"Mois\",type:ControlType.String,defaultValue:\"mois.\"}}},color:{title:\"Text Color\",type:ControlType.Color,defaultValue:\"#000\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ROI_Calculator\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ROI_Calculator.map"],
  "mappings": "4HAIA,IAAMA,EAAS,CAAC,MAAM,OAAO,OAAO,OAAO,WAAW,4FAA4F,WAAW,IAAI,QAAQ,OAAO,aAAa,wBAAwB,EAAQC,EAAe,CAAC,QAAQ,OAAO,OAAO,oBAAoB,WAAW,4FAA4F,UAAU,SAAS,QAAQ,UAAU,WAAW,OAAO,MAAM,SAAS,EAAQC,EAAgB,CAAC,QAAQ,o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AKA,EAAY,OAAO,aAAa,4BAA4B,EAAE,mBAAmB,CAAC,MAAM,uCAAuC,KAAKA,EAAY,OAAO,aAAa,uDAAuD,EAAE,KAAK,CAAC,MAAM,OAAO,KAAKA,EAAY,OAAO,aAAa,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,aAAa,KAAKA,EAAY,MAAM,aAAa,MAAM,CAAC,CAAC",
  "names": ["boxStyle", "baseInputStyle", "formInputsStyle", "roiResultStyle", "roiHeaderLabel", "roiHeaderResult", "roiHeaderComment", "getDynamicWidth", "value", "fontSize", "minWidth", "charWidth", "convertMonthDisplay", "m", "mois", "years", "m_left", "resultat", "convertEuroDisplay", "operatorCost", "scrapCost", "CalculatorInput", "props", "p", "motion", "baseInputStyle", "AnimatedNumber", "displayValue", "setDisplayValue", "ye", "e", "controls", "animate", "latest", "ROI_Calculator", "color", "texts", "sparkCost", "operators", "setOperators", "producedPieces", "setProducedPieces", "scrapRatePercent", "setScrapRatePercent", "passThroughs", "setPassThroughs", "passThroughCost", "setPassThroughCost", "totalOperatorCost", "totalScrapCost", "totalPassThroughsCost", "qualityCost", "roi", "roi_euros", "roi_percent", "roi_months", "css", "style", "boxStyle", "formInputsStyle", "roiResultStyle", "roiHeaderLabel", "roiHeaderResult", "roiHeaderComment", "addPropertyControls", "ControlType"]
}
