{"version":3,"file":"CalculatingStep.CL4uS615.mjs","names":["_Fragment"],"sources":["https:/framerusercontent.com/modules/W2bbiWvGHO6D8wllLuVV/l9zRm2rRAmbhB9EKnrZf/CalculatingStep.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{useStepHistory,useCurrentStepId}from\"https://framerusercontent.com/modules/wm78KsU1IYJJVRPxnalG/7zJiE09qHzT3tvBf6zOQ/stepStores.js\";import{isBrowser}from\"framer\";import{useFields}from\"https://framerusercontent.com/modules/Ax3pgpFugmVtkLyjK0aB/gjk6sN8WNzrAQFqhH8LV/formStores.js\";import{evaluateBranchTarget}from\"https://framerusercontent.com/modules/3uKicuWZs0YreChql2h7/bZmk1MxZd5uKamZFtF9e/branching.js\";export function CalculatingStep({label=\"Calculating your results...\",nextStepId=\"Q6\",stepId=\"calculating-data\",spinnerInstance,spinSpeed=1,branchingRules=[]}){const{goToStep}=useStepHistory();const currentStepId=useCurrentStepId();const[fields]=useFields();useEffect(()=>{if(currentStepId!==stepId)return;const timeout=setTimeout(()=>{const f=fields;const target=evaluateBranchTarget(f,branchingRules,nextStepId);goToStep(target);},1500);return()=>clearTimeout(timeout);},[currentStepId,nextStepId,stepId,goToStep,fields,branchingRules]);const animation=`spin ${spinSpeed}s linear infinite`;const wrapperStyle={display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",width:48,height:48,marginBottom:16,animation};return /*#__PURE__*/_jsx(\"div\",{style:container,children:currentStepId===stepId?/*#__PURE__*/_jsxs(_Fragment,{children:[spinnerInstance?/*#__PURE__*/_jsx(\"span\",{style:wrapperStyle,children:spinnerInstance}):/*#__PURE__*/_jsx(\"div\",{style:{...spinner,animation}}),/*#__PURE__*/_jsx(\"p\",{style:text,children:label})]}):null});}addPropertyControls(CalculatingStep,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Calculating your results...\"},nextStepId:{type:ControlType.String,title:\"Next Step ID\",defaultValue:\"Q6\"},stepId:{type:ControlType.String,title:\"Trigger Step ID\",defaultValue:\"calculating-data\"},spinnerInstance:{type:ControlType.ComponentInstance,title:\"Spinner Instance\"},spinSpeed:{type:ControlType.Number,title:\"Spin Speed (s)\",defaultValue:1,min:.1,max:10,displayStepper:true},// Branching rules (first matching rule wins; else falls back to default)\nbranchingRules:{type:ControlType.Array,title:\"Branching Rules\",propertyControl:{type:ControlType.Object,controls:{field:{type:ControlType.String,title:\"Field (apiName)\",placeholder:\"e.g. business_type\"},op:{type:ControlType.Enum,title:\"Operator\",options:[\"equals\",\"notEquals\",\"includes\",\"regex\"],optionTitles:[\"equals\",\"not equals\",\"includes\",\"regex\"],defaultValue:\"equals\"},value:{type:ControlType.String,title:\"Value / Regex\",placeholder:\"e.g. pro / /^pro/i\"},nextStepId:{type:ControlType.String,title:\"Next Step ID\",placeholder:\"step-id-to-go\"}}},// Framer typings expect a `control` key as well; mirror it for compatibility\ncontrol:{type:ControlType.Object,controls:{field:{type:ControlType.String,title:\"Field (apiName)\",placeholder:\"e.g. business_type\"},op:{type:ControlType.Enum,title:\"Operator\",options:[\"equals\",\"notEquals\",\"includes\",\"regex\"],optionTitles:[\"equals\",\"not equals\",\"includes\",\"regex\"],defaultValue:\"equals\"},value:{type:ControlType.String,title:\"Value / Regex\",placeholder:\"e.g. pro / /^pro/i\"},nextStepId:{type:ControlType.String,title:\"Next Step ID\",placeholder:\"step-id-to-go\"}}},defaultValue:[]}});const container={display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",height:\"100%\",width:\"100%\"};const spinner={width:48,height:48,border:\"4px solid rgba(0, 0, 0, 0.1)\",borderTop:\"4px solid #000\",borderRadius:\"50%\",animation:\"spin 1s linear infinite\",marginBottom:16};const text={fontSize:18,fontWeight:500,fontFamily:\"Figtree, sans-serif\",color:\"#1A1A1A\"};// Inject spin keyframes once\nif(isBrowser){if(!document.querySelector(\"[data-spin-keyframes]\")){const style=document.createElement(\"style\");style.setAttribute(\"data-spin-keyframes\",\"true\");style.innerHTML=`\n      @keyframes spin {\n        0% { transform: rotate(0deg); }\n        100% { transform: rotate(360deg); }\n      }`;document.head.appendChild(style);}}\nexport const __FramerMetadata__ = {\"exports\":{\"CalculatingStep\":{\"type\":\"reactComponent\",\"name\":\"CalculatingStep\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"mWAA6jB,SAAgB,EAAgB,CAAC,QAAM,8BAA8B,aAAW,KAAK,SAAO,mBAAmB,kBAAgB,YAAU,EAAE,iBAAe,EAAE,EAAE,CAAC,GAAK,CAAC,YAAU,GAAgB,CAAO,EAAc,GAAkB,CAAM,CAAC,GAAQ,GAAW,CAAC,MAAc,CAAC,GAAG,IAAgB,EAAO,OAAO,IAAM,EAAQ,eAAe,CAA+E,EAAlD,EAApB,EAA2C,EAAe,EAAW,CAAiB,EAAG,KAAK,CAAC,UAAU,aAAa,EAAQ,EAAG,CAAC,EAAc,EAAW,EAAO,EAAS,EAAO,EAAe,CAAC,CAAC,IAAM,EAAU,QAAQ,EAAU,mBAAuJ,OAAoB,EAAK,MAAM,CAAC,MAAM,EAAU,SAAS,IAAgB,EAAoB,EAAMA,EAAU,CAAC,SAAS,CAAC,EAA6B,EAAK,OAAO,CAAC,MAAnR,CAAC,QAAQ,cAAc,WAAW,SAAS,eAAe,SAAS,MAAM,GAAG,OAAO,GAAG,aAAa,GAAG,YAAU,CAAsL,SAAS,EAAgB,CAAC,CAAc,EAAK,MAAM,CAAC,MAAM,CAAC,GAAG,EAAQ,YAAU,CAAC,CAAC,CAAc,EAAK,IAAI,CAAC,MAAM,EAAK,SAAS,EAAM,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,qBAGplD,MAH+E,IAA6B,IAAoD,IAA2I,IAAmJ,IAA+H,CAAyhC,EAAoB,EAAgB,CAAC,MAAM,CAAC,KAAK,EAAY,O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