1import{b5 as f,k,X as d,ad as m,b7 as i,S as h,z as l}from"./Cg_qdefa.js";const v=f(async(o,s)=>{let e,c;const a=k(),{calculationData:r}=d(a);if(r.value?.refId===void 0||r.value.refId===null||r.value.refId.length===0){const n=a.getCalculationParams().catch(u=>{console.error("[middleware] getCalculationParams failed:",u?.statusCode||u?.message||u)});m().isHydrating||([e,c]=i(()=>n),await e,c())}const t=h.validateCalculator();if(!["/kalkulator-oc-ac","/kalkulator-oc-ac-2","/kalkulator-oc-ac-3"].includes(s.path)){if(t!==!0){if(a.calculationTmp.preventShowCalculatorValidationFormErrors||(a.calculationTmp.showCalculatorValidationFormErrors=!0),t.hasBasicParamsError)return o.path!=="/kalkulator-oc-ac"?l("/kalkulator-oc-ac"):void 0;if(t.hasVehicleParamsError)return o.path!=="/kalkulator-oc-ac-2"?l("/kalkulator-oc-ac-2"):void 0;if(t.hasSubjectParamsError)return o.path!=="/kalkulator-oc-ac-3"?l("/kalkulator-oc-ac-3"):void 0}if(r.value?.status==="DONE"){if(r.value.offersAreObsolete)return a.clearCalculation(),[e,c]=i(()=>a.getCalculationParams()),await e,c(),a.calculationTmp.preventShowCalculatorValidationFormErrors=!0,l("/kalkulator-oc-ac");if(o.path!=="/kalkulator-oc-ac/oferty"&&t===!0)return l("/kalkulator-oc-ac/oferty")}}});export{v as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.