PageSourceSearch

https://cashy.de/assets/_next/static/chunks/pages/wert-check-455c54c5e2f61333.js

js cashy.de collected 2026-10-05 23:12:15 UTC 34,613 bytes, 2 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6ea4a0fb-a7b5-418e-bbd5-1530eb4dc019",e._sentryDebugIdIdentifier="sentry-dbid-6ea4a0fb-a7b5-418e-bbd5-1530eb4dc019")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9035],{782:function(){},12569:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/wert-check",function(){return n(93486)}])},23683:function(e,t,n){var a=n(3513);n(782);var r=n(29873);function s(e){return e&&"object"===typeof e&&"default"in e?e:{default:e}}var i=s(r);function l(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}var o="undefined"!==typeof a&&a.env&&!0,u=function(e){return"[object String]"===Object.prototype.toString.call(e)},c=function(){function e(e){var t=void 0===e?{}:e,n=t.name,a=void 0===n?"stylesheet":n,r=t.optimizeForSpeed,s=void 0===r?o:r;d(u(a),"`name` must be a string"),this._name=a,this._deletedRulePlaceholder="#"+a+"-deleted-rule____{}",d("boolean"===typeof s,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=s,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var i=document.querySelector('meta[property="csp-nonce"]');this._nonce=i?i.getAttribute("content"):null}var t,n,a,r=e.prototype;return r.setOptimizeForSpeed=function(e){d("boolean"===typeof e,"`setOptimizeForSpeed` accepts a boolean"),d(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},r.isOptimizeForSpeed=function(){return this._optimizeForSpeed},r.inject=function(){var e=this;if(d(!this._injected,"sheet already injected"),this._injected=!0,this._optimizeForSpeed)return this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),void(this._optimizeForSpeed||(o||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0));this._serverSheet={cssRules:[],insertRule:function(t,n){return"number"===typeof n?e._serverSheet.cssRules[n]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),n},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},r.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]},r.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},r.insertRule=function(e,t){if(d(u(e),"`insertRule` accepts only strings"),this._optimizeForSpeed){var n=this.getSheet();"number"!==typeof t&&(t=n.cssRules.length);try{n.insertRule(e,t)}catch(r){return o||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var a=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,a))}return this._rulesCount++},r.replaceRule=function(e,t){if(this._optimizeForSpeed){var n=this.getSheet();if(t.trim()||(t=this._deletedRulePlaceholder),!n.cssRules[e])return e;n.deleteRule(e);try{n.insertRule(t,e)}catch(r){o||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),n.insertRule(this._deletedRulePlaceholder,e)}}else{var a=this._tags[e];d(a,"old rule at index `"+e+"` not found"),a.textContent=t}return e},r.deleteRule=function(e){if(this._optimizeForSpeed)this.replaceRule(e,"");else{var t=this._tags[e];d(t,"rule at index `"+e+"` not found"),t.parentNode.removeChild(t),this._tags[e]=null}},r.flush=function(){this._injected=!1,this._rulesCount=0,this._tags.forEac
1h((function(e){return e&&e.parentNode.removeChild(e)})),this._tags=[]},r.cssRules=function(){var e=this;return this._tags.reduce((function(t,n){return n?t=t.concat(Array.prototype.map.call(e.getSheetForTag(n).cssRules,(function(t){return t.cssText===e._deletedRulePlaceholder?null:t}))):t.push(null),t}),[])},r.makeStyleTag=function(e,t,n){t&&d(u(t),"makeStyleTag accepts only strings as second parameter");var a=document.createElement("style");this._nonce&&a.setAttribute("nonce",this._nonce),a.type="text/css",a.setAttribute("data-"+e,""),t&&a.appendChild(document.createTextNode(t));var r=document.head||document.getElementsByTagName("head")[0];return n?r.insertBefore(a,n):r.appendChild(a),a},t=e,(n=[{key:"length",get:function(){return this._rulesCount}}])&&l(t.prototype,n),a&&l(t,a),e}();function d(e,t){if(!e)throw new Error("StyleSheet: "+t+".")}var m=function(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return t>>>0},p={};function h(e,t){if(!t)return"jsx-"+e;var n=String(t),a=e+n;return p[a]||(p[a]="jsx-"+m(e+"-"+n)),p[a]}function f(e,t){var n=e+t;return p[n]||(p[n]=t.replace(/__jsx-style-dynamic-selector/g,e)),p[n]}var x=function(){function e(e){var t=void 0===e?{}:e,n=t.styleSheet,a=void 0===n?null:n,r=t.optimizeForSpeed,s=void 0!==r&&r;this._sheet=a||new c({name:"styled-jsx",optimizeForSpeed:s}),this._sheet.inject(),a&&"boolean"===typeof s&&(this._sheet.setOptimizeForSpeed(s),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer||(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce((function(e,t){return e[t]=0,e}),{}));var n=this.getIdAndRules(e),a=n.styleId,r=n.rules;if(a in this._instancesCounts)this._instancesCounts[a]+=1;else{var s=r.map((function(e){return t._sheet.insertRule(e)})).filter((function(e){return-1!==e}));this._indices[a]=s,this._instancesCounts[a]=1}},t.remove=function(e){var t=this,n=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw new Error("StyleSheetRegistry: "+t+".")}(n in this._instancesCounts,"styleId: `"+n+"` not found"),this._instancesCounts[n]-=1,this._instancesCounts[n]<1){var a=this._fromServer&&this._fromServer[n];a?(a.parentNode.removeChild(a),delete this._fromServer[n]):(this._indices[n].forEach((function(e){return t._sheet.deleteRule(e)})),delete this._indices[n]),delete this._instancesCounts[n]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map((function(t){return[t,e._fromServer[t]]})):[],n=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map((function(t){return[t,e._indices[t].map((function(e){return n[e].cssText})).join(e._optimizeForSpeed?"":"\n")]})).filter((function(e){return Boolean(e[1])})))},t.styles=function(e){return function(e,t){return void 0===t&&(t={}),e.map((function(e){var n=e[0],a=e[1];return i.default.createElement("style",{id:"__"+n,key:"__"+n,nonce:t.nonce?t.nonce:void 0,dangerouslySetInnerHTML:{__html:a}})}))}(this.cssRules(),e)},t.getIdAndRules=function(e){var t=e.children,n=e.dynamic,a=e.id;if(n){var r=h(a,n);return{styleId:r,rules:Array.isArray(t)?t.map((function(e){return f(r,e)})):[f(r,t)]}}return{styleId:h(a),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce((function(e,t){return e[t.id.slice(2)]=t,e}),{})},e}();var v=r.createContext(null);function g(){return new x}function y(){return r.useContext(v)}v.displayName="StyleSheetContext";var _=i.default.useInsertionEffect||i.default.useLayoutEffect,b=g();function w(e){var t=b||y();return t?(_((function(){return t.add(e),function(){t.remove(e)}}),[e.id,String(e.dynamic)]),null):null}w.dynamic=function(e){return e.map((function(e){return h(e[0],e[1])})).join(" ")},t.style=w},87689:function(e,t,n){"use strict";e.exports=n(23683).style},47999:function(e,t,n){"use strict";n.d(t,{Z:function(){return a.Z}});var a=n(59064)},37900:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});var a=n(29873);function r(e){(0,a.useLayoutEffect)((()=>{const[t]=document.getElementsByTagName("html");return t.className+=" "+e,()=>{t.className=t.className.replace(e,"").trim()}}),[e])}},93486:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return le},default:function(){return oe}});var a=n(3116),r=n(22569),s=n(63464),i=n(55575),l=n(29873),o=n(47999),u=n(66673),c=n(95009),d=n(30842),m=n(21037);const p=200,h={phase:"landing",text:"",productName:"",context:null,questions:[],isFinalStep:!0,answers:{},submittedAnswers:[],valuation:null,rejectionMessage:"",rejectionReason:"",handoff:null,request:null,lastVariables:null,rounds:0};function f(e,t){switch(t.type){case"REQUEST_STARTED":return{...e,phase:t.variables.context?"loadingEstimate":"loadingQuestions",text:t.variables.text,lastVariables:t.variables,submittedAnswers:t.variables.context?[...e.submittedAnswers.filter((e=>!t.answeredNow.some((t=>t.questionTitle===e.questionTitle)))),...t.answeredNow]:[]};case"RESPONSE_RECEIVED":switch(t.result.__typename){case"AppraisalQuestionsStep":return{...e,phase:"questions",productName:t.result.productName||e.productName,context:t.result.context,questions:t.result.questions,isFinalStep:t.result.isFinalStep,answers:{},rounds:e.rounds+1};case"AppraisalValuationResult":{var n;const r=null!==(n=t.result.adjustQuestions)&&void 0!==n?n:[];var a;return{...e,phase:"result",productName:t.result.productName||e.productName,valuation:t.result,context:null!==(a=t.result.adjustContext)&&void 0!==a?a:e.context,questions:r,answers:Object.fromEntries(r.filter((e=>null!=e.prefill)).map((e=>[e.key,e.prefill])))}}case"AppraisalRejectionResult":return{...e,phase:"rejected",rejectionMessage:t.result.message,rejectionReason:t.result.reason,questions:[],answers:{}};case"AppraisalHandoffResult":return{...e,phase:"handoff",handoff:t.result,questions:[],answers:{}};case"AppraisalRequestResult":return{...e,phase:"request",productName:t.result.productName||e.productName,request:t.result,questions:[],answers:{}};default:return{...e,phase:"error"}}case"SET_ANSWER":{const n={...e.answers};return null===t.value?delete n[t.key]:n[t.key]=t.value,{...e,answers:n}}case"REQUEST_FAILED":return{...e,phase:"error"};case"RESET":return h;default:return e}}function x(e){var t,n;return{min:null!==(t=null===e||void 0===e?void 0:e.min)&&void 0!==t?t:1,max:null!==(n=null===e||void 0===e?void 0:e.max)&&void 0!==n?n:2e3}}function v(e,t){if(!e)return!1;const n=Number(e.replace(",",".")),{min:a,max:r}=x(t);return Number.isFinite(n)&&n>=a&&n<=r}var g=n(9878),y=n(79276),_=n(96567),b=n(2174),w=n(40965),k=n(80720),j=n(69533),S=n(84250),N=n(98217),C=n(47669);const R=e=>e.map((e=>{var t,n;return{questionId:e.questionId,selectedOptionIndex:null!==(t=e.selectedOptionIndex)&&void 0!==t?t:void 0,rangeValue:null!==(n=e.rangeValue)&&void 0!==n?n:void 0}}));const A=e=>
1"\u20ac".concat(Math.round(e).toLocaleString("de-AT"));var E=n(50122),I=n(35229);const q=["example_1","example_2","example_3","example_4","example_5"];function T(e){let{onSubmit:t}=e;const{t:n}=(0,s.Z)("wertCheck"),[r,i]=(0,l.useState)(""),o=r.trim();return(0,a.jsxs)("form",{className:"flex flex-col gap-6",onSubmit:e=>{e.preventDefault(),o&&t(o)},children:[(0,a.jsx)("h1",{className:"text-heading-m text-primary text-center",children:n("headline")}),(0,a.jsxs)("div",{className:"bg-static-white rounded-xl shadow-[0_0_2rem_rgba(0,0,0,0.1)] p-4",children:[(0,a.jsx)("textarea",{className:"input-border w-full rounded-xl p-4 text-l text-primary resize-none min-h-[7rem]",placeholder:n("input_placeholder"),value:r,maxLength:p,rows:3,onChange:e=>i(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),o&&t(o))}}),(0,a.jsxs)("p",{className:(0,I.cn)("text-s text-right tabular-nums",r.length>180?"text-negative":"text-secondary"),children:[r.length,"/",p]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2 mt-3",children:q.map((e=>(0,a.jsx)("button",{type:"button",className:"input-border rounded-full bg-static-white px-4 py-2 text-s text-primary",onClick:()=>{i(n(e)),t(n(e))},children:n(e)},e)))})]}),(0,a.jsx)(E.z,{type:"submit",variant:"cta",className:"w-full",disabled:!o,children:n("submit_description")})]})}function F(e){let{onRetry:t,onReset:n}=e;const{t:r}=(0,s.Z)("wertCheck");return(0,a.jsxs)("div",{className:"bg-static-white rounded-xl shadow-[0_0_2rem_rgba(0,0,0,0.1)] p-6 flex flex-col items-center gap-4 text-center",children:[(0,a.jsx)("p",{className:"text-l text-primary",children:r("error_message")}),(0,a.jsx)(E.z,{type:"button",variant:"cta",className:"w-full",onClick:t,children:r("error_retry")}),(0,a.jsx)(E.z,{type:"button",variant:"link",onClick:n,children:r("reset")})]})}const z={amount:"betrag",make:"marke",model:"modell",registrationYear:"zulassungsjahr",mileageKm:"km",horsePower:"ps",fuel:"kraftstoff"};var D=n(46517),P=n.n(D),Z=n(25084);function O(e){let{target:t,message:n,vehicle:r,onReset:i}=e;const{t:l}=(0,s.Z)("wertCheck");if(t===m.WTD.Car||t===m.WTD.Motorcycle){const e=function(e,t){if(!e)return[];const n=[];return e.make&&n.push({label:t("common:car.make"),value:e.make}),e.model&&n.push({label:t("common:car.model"),value:e.model}),e.registrationYear&&n.push({label:t("common:car.regdate"),value:String(e.registrationYear)}),e.mileageKm&&n.push({label:t("common:car.odometer"),value:"".concat(e.mileageKm.toLocaleString("de-AT")," km")}),e.horsePower&&n.push({label:t("wertCheck:vehicle_power"),value:"".concat(e.horsePower," PS")}),e.fuel&&n.push({label:t("common:car.fuel"),value:t("wertCheck:fuel_".concat(e.fuel))}),n}(null!==r&&void 0!==r?r:null,l);var o;return(0,a.jsxs)("div",{className:"bg-static-white rounded-xl shadow-[0_0_2rem_rgba(0,0,0,0.1)] p-6 flex flex-col items-center gap-4 text-center",children:[(0,a.jsx)("p",{className:"text-l text-primary",children:n}),e.length>0&&(0,a.jsxs)("dl",{className:"w-full max-w-80 text-left grid grid-cols-[auto_1fr] gap-x-4 gap-y-1 text-sm","data-testid":"vehicle-handoff-details",children:[(0,a.jsx)("dt",{className:"col-span-2 font-semibold text-primary",children:l("vehicle_detected")}),e.map((e=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("dt",{className:"text-neutral-600",children:e.label},"".concat(e.label,"-label")),(0,a.jsx)("dd",{className:"text-primary",children:e.value},"".concat(e.label,"-value"))]})))]}),(0,a.jsx)(Z.ZP,{className:"shadow-none border border-neutral-200 w-full",ctaText:l("vehicle_cta"),initialAmount:null!==(o=null===r||void 0===r?void 0:r.desiredAmount)&&void 0!==o?o:t===m.WTD.Motorcycle?2e3:5e3,maxAmount:t===m.WTD.Motorcycle?75e3:void 0,buildHref:e=>function(e,t,n){const{amount:a,make:r,model:s,registrationYear:i,mileageKm:l,horsePower:o,fuel:u}=z;return e===m.WTD.Motorcycle?{pathname:"/motorrad",query:(c={[a]:n,[r]:null===t||void 0===t?void 0:t.make,[s]:null===t||void 0===t?void 0:t.model,[i]:null===t||void 0===t?void 0:t.registrationYear,[l]:null===t||void 0===t?void 0:t.mileageKm,[o]:null===t||void 0===t?void 0:t.horsePower,[u]:null===t||void 0===t?void 0:t.fuel},Object.fromEntries(Object.entries(c).filter((e=>{let[,t]=e;return void 0!==t&&null!==t&&""!==t}))))}:(null===t||void 0===t?void 0:t.make)&&t.model?{pathname:"/autopfand-formular/zulassungsjahr",query:{[a]:n,[r]:t.make,[
1s]:t.model}}:(null===t||void 0===t?void 0:t.make)?{pathname:"/autopfand-formular/modell",query:{[a]:n,[r]:t.make}}:{pathname:"/autopfand-formular",query:{[a]:n}};var c}(t,null!==r&&void 0!==r?r:null,e)}),(0,a.jsx)(E.z,{type:"button",variant:"link",onClick:i,children:l("reset")})]})}return(0,a.jsxs)("div",{className:"bg-static-white rounded-xl shadow-[0_0_2rem_rgba(0,0,0,0.1)] p-6 flex flex-col items-center gap-4 text-center",children:[(0,a.jsx)("p",{className:"text-l text-primary",children:n}),(0,a.jsx)(P(),{href:"/kontakt",className:"w-full",children:(0,a.jsx)(E.z,{type:"button",variant:"cta",className:"w-full",children:l("handoff_cta")})}),(0,a.jsx)(E.z,{type:"button",variant:"link",onClick:i,children:l("reset")})]})}var L=n(87689),V=n.n(L),Q=n(63215);const M=["loading_fun_1","loading_fun_2","loading_fun_3","loading_fun_4","loading_fun_5","loading_fun_6"];function W(e){let{message:t}=e;const{t:n}=(0,s.Z)("wertCheck"),[r,i]=(0,l.useState)(-1);(0,l.useEffect)((()=>{i(-1);const e=setTimeout((()=>i(0)),5e3),t=setInterval((()=>i((e=>e<0?e:(e+1)%M.length))),4e3);return()=>{clearTimeout(e),clearInterval(t)}}),[t]);const o=r<0?t:n(M[r]);return(0,a.jsxs)("div",{className:"jsx-7674bc5618b6910f flex flex-col items-center gap-4 py-12",children:[(0,a.jsx)(Q.Z,{color:"#002147"}),(0,a.jsx)("p",{style:{animation:"wertcheckFadeIn 0.4s ease-in"},className:"jsx-7674bc5618b6910f text-l text-primary text-center",children:o},o),(0,a.jsx)(V(),{id:"7674bc5618b6910f",children:'@-webkit-keyframes wertcheckFadeIn{from{opacity:0}to{opacity:1}}@-moz-keyframes wertcheckFadeIn{from{opacity:0}to{opacity:1}}@-o-keyframes wertcheckFadeIn{from{opacity:0}to{opacity:1}}@keyframes wertcheckFadeIn{from{opacity:0}to{opacity:1}}@media(prefers-reduced-motion:reduce){p[style*="wertcheckFadeIn"]{-webkit-animation:none!important;-moz-animation:none!important;-o-animation:none!important;animation:none!important}}'})]})}function H(e){let{value:t,unit:n,placeholder:r,range:i,onChange:l}=e;const{t:o}=(0,s.Z)("wertCheck"),u=""!==t&&!v(t,i),c=null==(null===i||void 0===i?void 0:i.min)&&null==(null===i||void 0===i?void 0:i.max);return(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsxs)("div",{className:"input-border flex items-center rounded-xl bg-static-white px-6 py-3",children:[(0,a.jsx)("input",{className:"w-full text-l font-semibold text-primary outline-none placeholder:font-normal placeholder:text-secondary",type:"text",inputMode:"decimal",placeholder:null!==r&&void 0!==r?r:void 0,value:t,onChange:e=>l(e.target.value.replace(/[^\d.,]/g,""))}),n&&(0,a.jsx)("span",{className:"text-l text-secondary ml-2",children:n})]}),u&&(0,a.jsx)("p",{className:"text-s text-center",children:o(c?"weight_invalid":"number_invalid",x(i))})]})}function K(e){let{question:t,value:n,onChange:r}=e;var s;const i=null!==(s=t.options)&&void 0!==s?s:[];var l;const o=null!==(l=t.optionDescriptions)&&void 0!==l?l:[],u=o.some(Boolean),c=!u&&(2===i.length||i.length>=4&&i.every((e=>e.length<=14)));return(0,a.jsx)("div",{role:"listbox",className:(0,I.cn)("grid gap-2",c?"grid-cols-2":"grid-cols-1"),children:i.map(((e,t)=>{const s=String(t),i=n===s,l=i?o[t]:void 0;return(0,a.jsx)("button",{type:"button",role:"option","aria-selected":i,className:(0,I.cn)("input-border w-full rounded-xl bg-static-white px-6 py-3",u?"text-left":"text-center",i&&"outline outline-2 outline-brand-secondary"),onClick:()=>r(i?null:s),children:(0,a.jsxs)("span",{className:(0,I.cn)("flex flex-row gap-4",!u&&"justify-center"),children:[(0,a.jsx)("span",{className:"text-l font-semibold text-primary",children:e}),l&&(0,a.jsx)("span",{className:"text-sm text-secondary font-normal pt-[3px]",children:l})]})},e)}))})}function B(e){let{value:t,placeholder:n,onChange:r}=e;return(0,a.jsx)("div",{className:"input-border flex items-center rounded-xl bg-static-white px-6 py-3",children:(0,a.jsx)("input",{className:"w-full text-l font-semibold text-primary outline-none placeholder:font-normal placeholder:text-secondary",type:"text",autoComplete:"off",maxLength:40,placeholder:null!==n&&void 0!==n?n:void 0,value:t,onChange:e=>r(e.target.value)})})}function U(e){let{questions:t,answers:n,canSubmit:r,isFinalStep:i,onAnswerChange:l,onSubmit:o}=e;const{t:u}=(0,s.Z)("wertCheck");return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[t.map((e=>{var t,r;return(0,a.jsxs)("section",{className:"bg-static-white rounded-xl shadow-[0_0_2rem_rgba(0,0,0,0.1)] p-4 flex flex-col gap-3",children:[e.skippable?(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsx)("h2",{className:"text-heading-2xs text-primary uppercase tracking-wide",children:e.title}),(0,a.jsx)("div",{className:"flex rounded-full border border-neutral-300 p-0.5",role:"radiogroup","aria-label":e.title,children:["known","unknown"].map((t=>{const r=""===n[e.key]===("unknown"===t);return(0,a.jsx)("button",{type:"button",role:"radio","aria-checked":r,className:(0,I.cn)("rounded-full px-3 py-1 text-s transition-colors",r?"bg-brand-700 text-primary-white":"text-secondary hover:text-primary"),onClick:()=>l(e.key,"unknown"===t?"":null),children:u(t)},t)}))})]}):(0,a.jsx)("h2",{className:"text-heading-2xs text-primary text-center uppercase tracking-wide",children:e.title}),e.hint&&(0,a.jsx)("p",{className:"text-s text-secondary text-center",children:e.hint}),e.skippable&&""===n[e.key]?null:e.inputType===m.cQD.Number?(0,a.jsx)(H,{value:null!==(t=n[e.key])&&void 0!==t?t:"",unit:e.unit,placeholder:e.placeholder,range:e,onCh
1ange:t=>l(e.key,""===t?null:t)}):e.inputType===m.cQD.Text?(0,a.jsx)(B,{value:null!==(r=n[e.key])&&void 0!==r?r:"",placeholder:e.placeholder,onChange:t=>l(e.key,""===t.trim()?null:t)}):(0,a.jsx)(K,{question:e,value:n[e.key],onChange:t=>l(e.key,t)})]},e.key)})),(0,a.jsx)(E.z,{type:"button",variant:"cta",className:"w-full",disabled:!r,onClick:o,children:u(i?"submit_answers":"next_step")})]})}function G(e){let{text:t,className:n,"data-testid":r}=e;return(0,a.jsx)("p",{className:n,"data-testid":r,children:X(t)})}const Y=/\*\*(.+?)\*\*|\[([^\]]+)\]\(([^)\s]+)\)/g;function X(e){const t=[];let n=0;for(const s of e.matchAll(Y)){const[i,l,o,u]=s;var r;const c=null!==(r=s.index)&&void 0!==r?r:0;c>n&&t.push(e.slice(n,c)),void 0!==l?t.push((0,a.jsx)("strong",{children:l},c)):t.push((0,a.jsx)(P(),{href:u,className:"underline text-brand-secondary",target:u.startsWith("/")?void 0:"_blank",children:o},c)),n=c+i.length}return n<e.length&&t.push(e.slice(n)),t.map(((e,t)=>(0,a.jsx)(l.Fragment,{children:e},t)))}function J(e){let{note:t,onReset:n}=e;const{t:r}=(0,s.Z)("wertCheck");return(0,a.jsxs)("div",{className:"bg-static-white rounded-xl shadow-[0_0_2rem_rgba(0,0,0,0.1)] p-6 flex flex-col items-center gap-4 text-center",children:[(0,a.jsx)(G,{text:t,className:"text-l text-primary"}),(0,a.jsx)(E.z,{type:"button",variant:"cta",className:"w-full",onClick:n,children:r("rejected_try_again")})]})}function $(e){let{message:t,suggestedAmount:n,minAmount:r,maxAmount:i,onSubmit:l,onReset:o,isSubmitting:u}=e;const{t:c}=(0,s.Z)("wertCheck");return(0,a.jsxs)("div",{className:"bg-static-white rounded-xl shadow-[0_0_2rem_rgba(0,0,0,0.1)] p-6 flex flex-col items-center gap-4 text-center",children:[(0,a.jsx)(G,{text:t,className:"text-l text-primary"}),(0,a.jsx)(Z.ZP,{className:"shadow-none border border-neutral-200 w-full",label:c("request_amount_label"),ctaText:c("request_cta"),initialAmount:n,minAmount:r,maxAmount:i,onSubmit:l,isSubmitting:u}),(0,a.jsx)(E.z,{type:"button",variant:"link",onClick:o,children:c("reset")})]})}const ee=new Intl.NumberFormat("de-AT",{style:"currency",currency:"EUR",maximumFractionDigits:0});function te(e){let{amountEur:t,disclaimer:n,adjustQuestions:r,answers:i,canRecalculate:l,onAnswerChange:o,onRecalculate:u,onCtaClick:c,isSubmitting:d}=e;const{t:p}=(0,s.Z)("wertCheck"),h=r.some((e=>{var t;return i[e.key]!==(null!==(t=e.prefill)&&void 0!==t?t:void 0)}));return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)("div",{className:"bg-static-white rounded-xl shadow-[0_0_2rem_rgba(0,0,0,0.1)] p-6 flex flex-col items-center gap-4 text-center",children:[(0,a.jsx)("h2",{className:"text-heading-2xs text-primary uppercase tracking-wide",children:p("result_title")}),(0,a.jsx)("p",{className:"text-heading-m text-brand-secondary font-bold",children:ee.format(t)}),n&&(0,a.jsx)(G,{text:n,className:"text-m text-primary","data-testid":"result-disclaimer"}),c&&(0,a.jsx)(E.z,{type:"button",variant:"cta",className:"w-full",disabled:d,loading:d,onClick:c,children:p("result_cta")})]}),r.length>0&&(0,a.jsxs)("div",{className:"bg-static-white rounded-xl shadow-[0_0_2rem_rgba(0,0,0,0.1)] p-4 flex flex-col gap-4",children:[(0,a.jsx)("h3",{className:"text-heading-2xs text-primary text-center uppercase tracking-wide",children:p("adjust_title")}),r.map((e=>{var t;return(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("p",{className:"text-m text-secondary",children:e.title}),e.inputType===m.cQD.Number?(0,a.jsx)(H,{value:null!==(t=i[e.key])&&void 0!==t?t:"",unit:e.unit,onChange:t=>o(e.key,""===t?null:t)}):(0,a.jsx)(K,{question:e,value:i[e.key],onChange:t=>o(e.key,t)})]},e.key)})),(0,a.jsx)(E.z,{type:"button",variant:"secondary",className:"w-full",disabled:!h||!l,onClick:u,children:p("recalculate")})]})]})}function ne(e){let{description:t,answeredQuestions:n,itemLabel:r}=e;const{t:i}=(0,s.Z)("wertCheck");return(0,a.jsxs)("aside",{className:"bg-static-white rounded-xl shadow-[0_0_2rem_rgba(0,0,0,0.1)] p-4 flex flex-col gap-3 h-fit",children:[(0,a.jsx)("h2",{className:"text-heading-2xs text-primary uppercase tracking-wide",children:i("summary_title")}),(0,a.jsx)(ae,{label:i("summary_description_label"),value:t}),n.map(((e,t)=>(0,a.jsx)(ae,{label:e.questionTitle,value:e.valueLabel},t))),r&&(0,a.jsx)(ae,{label:i("summary_rated_as"),value:r})]})}function ae(e){let{label:t,value:n}=e;return(0,a.jsxs)("div",{className:"flex flex-col border-t border-secondary pt-2",children:[(0,a.jsx)("span",{className:"text-s text-secondary uppercase",children:t}),(0,a.jsx)("span",{className:"text-m text-primary break-words",children:n})]})}function re(){const{t:e}=(0,s.Z)("wertCheck"),t=function(){const[e,t]=(0,l.useReducer)(f,h),n=(0,d.Z)(),[a]=(0,u.Db)(m.bbU,{disableDefaultErrorHandling:!0}),r=(0,l.useCallback)((async(e,r)=>{if(n){t({type:"REQUEST_STARTED",variables:e,answeredNow:r});try{const r=await a({variables:{...e,companyId:n._id}});if(r.error||!r.data)return void t({type:"REQUEST_FAILED"});t({type:"RESPONSE_RECEIVED",result:r.data.appraiseItem})}catch(s){t({type:"REQUEST_FAILED"})}}else t({type:"REQUEST_FAILED"})}),[a,n]),s=(0,l.useCallback)((e=>{const t=e.trim().slice(0,p);t&&((0,c.L9)("appraisal_started",{text_length:t.length}),r({text:t,context:null,answers:[]},[]))}),[r]),i=(0,l.useCallback)((()=>{const t=[],n=e.questions.filter((t=>void 0!==e.answers[t.key]||t.optional)).map((n=>{var a,r;const s=null!==(r=e.answers[n.key])&&void 0!==r?r:"";var i;const l=n.inputType===m.cQD.Choice?null!==(i=null===(a=n.options)||void 0===a?void 0:a[parseInt(s,10)])&&void 0!==i?i:s:"".concat(s).concat(n.unit?" ".concat(n.unit):"");return""!==s&&t.push({questionTitle:n.title,valueLabel:l}),{key:n.key,value:s}}));r({text:e.text,context:e.context,answers:n},t)}),[r,e]),o=(0,l.useCallback)(((e,n)=>{t({type:"SET_ANSWER",key:e,value:n})}),[]),x=(0,l.useCallback)((()=>{e.lastVariables&&r(e.lastVariables,[])}),[r,e.lastVariables]),g=(0,l.useCallback)((()=>t({type:"RESET"})),[]),y=e.questions.every((t=>{const n=e.answers[t.key];return!(!t.optional||void 0!==n&&""!==n)||(t.inputType===m.cQD.Number?v(n,t):void 0!==n)}));return{...e,canSubmitAnswers:y,submitDescription:s,submitAnswers:i,setAnswer:o,retry:x,reset:g}}(),n=function(){const{t:e}=(0,s.Z)("wertCheck"),t=(0,i.useRouter)(),n=(0,d.Z)(),[r]=(0,g.FV)(y.bv),o=(0,l.useContext)(_.Z),p=(0,N.d)(),h=(0,g.Zl)(S.C8),f=(0,g.Zl)(S.Bh),x=(0,g.Zl)(S.fi),v=(0,g.Zl)(S._4),{showError:E}=(0,C.Z)(),[I,q]=(0,l.useState)(!1),[T]=(0,u.td)(m.JLB),[F]=(0,u.td)(m.O4A),{createCustomDeal
1:z}=(0,w.n)(),D=(0,l.useCallback)((async(a,r)=>{var s,i,l,o;if(!n)return;const u=null===(s=(await T({variables:{itemCategoryId:r.itemCategoryId}})).data)||void 0===s?void 0:s.getItemCategory;if(!u)return void E(e("handoff_failed"));var d,g,y,_,b,w;const k={title:a.productName,itemCategoryId:r.itemCategoryId,itemCategory:u,answers:R(r.answers),algoliaReference:null!==(d=r.algoliaReference)&&void 0!==d?d:"custom",material:null!==(g=r.material)&&void 0!==g?g:void 0,isInvestmentGold:null!==(y=r.isInvestmentGold)&&void 0!==y?y:void 0,useOldValuesOfPrediction:null!==(_=r.useOldValuesOfPrediction)&&void 0!==_?_:void 0,existingCurrentMarketValue:null!==(b=r.existingCurrentMarketValue)&&void 0!==b?b:void 0,existingPredictedMarketValue:null!==(w=r.existingPredictedMarketValue)&&void 0!==w?w:void 0},S=await F({variables:(0,j.ok)({companyId:n._id,dealType:m.kH4.Pawn,items:[k],durationInDays:r.durationInDays}),onError:()=>E(e("handoff_failed"))});if(!(null===(i=S.data)||void 0===i?void 0:i.dealCalculation))return;const{dealValuesEntry:N,itemsValuesEntries:C}=S.data.dealCalculation;var A,I;h([k]),x(N.durationInDays),f(S.data.dealCalculation),v(new Date),c.a({productName:a.productName,categoryNames:null!==(A=null===(l=u.parentCategories)||void 0===l?void 0:l.map((e=>e.name)))&&void 0!==A?A:[],value:null!==(I=null===(o=C[C.length-1])||void 0===o?void 0:o.loanToValue)&&void 0!==I?I:a.payoutAmount}),p(),t.push("/checkout/items")}),[n,F,T,t,p,v,f,x,h,E,e]),P=(0,l.useCallback)((async(e,n)=>{const s=e=>{c.L9("custom_deal_request",{transaction_id:e._id,value:n,type:"pawn"})};if(!r)return void o.open((0,a.jsx)(k.Z,{args:e,onSuccess:s}),{variant:"full"});const i=await z({variables:{customDealCreateArgs:e}});if(i.data)try{s(i.data.createCustomDeal),c.SE({dealId:i.data.createCustomDeal._id,type:"pawn",items:i.data.createCustomDeal.items.map((e=>({categoryHierarchy:e.itemCategory.parentCategories.map((e=>e._id))})))})}finally{o.open((0,a.jsx)(b.Z,{}),{variant:"full",onAfterClose:()=>{t.push("/")}})}}),[z,r,o,t]),Z=(0,l.useCallback)((async(e,t)=>{if(!n)return;const a=[null!=e.marketValue?"Marktwert ca. ".concat(A(e.marketValue)):null,"Auszahlungssch\xe4tzung ".concat(A(e.payoutAmount)),"Pfad ".concat(e.path).concat(e.isAiGenerated?", KI-generiert":"")].filter(Boolean);await P({companyId:n._id,contactData:{},customerId:null===r||void 0===r?void 0:r._id,dealType:m.kH4.Pawn,durationInDays:n.configuration.minimumPawnDuration,isItemEvaluationMissing:!0,items:[{itemCategoryId:t.itemCategoryId,title:e.productName,answers:R(t.answers),pawnPayoutAmount:0,purchasePayoutAmount:0,note:"KI Wert-Check: ".concat(a.join(", "))}]},e.payoutAmount)}),[n,r,P]),O=(0,l.useCallback)((async(e,t)=>{if(n&&!I){c.L9("appraisal_cta_click",{appraisal_path:e.path,target:"custom_deal"}),q(!0);try{await P({companyId:n._id,contactData:{},customerId:null===r||void 0===r?void 0:r._id,dealType:m.kH4.Pawn,durationInDays:n.configuration.minimumPawnDuration,items:[{itemCategoryId:e.itemCategoryId,title:e.productName,answers:R(e.answers),pawnPayoutAmount:t,purchasePayoutAmount:t,note:"KI Wert-Check: keine Online-Sch\xe4tzung m\xf6glich, Wunschbetrag ".concat(A(t))}]},t)}finally{q(!1)}}}),[n,r,I,P]);return{startHandoff:(0,l.useCallback)((async e=>{const t=e.checkout;if(t&&!I){c.L9("appraisal_cta_click",{appraisal_path:e.path,target:t.kind===m.fnw.DirectCheckout?"checkout":"custom_deal"}),q(!0);try{t.kind===m.fnw.DirectCheckout?await D(e,t):await Z(e,t)}finally{q(!1)}}}),[I,Z,D]),startRequest:O,isSubmitting:I}}();!function(e){const t=(0,l.useRef)(null),n=(0,l.useRef)(null),a=(0,l.useRef)(null),r=(0,l.useRef)(null),s=(0,l.useRef)(null),i=(0,l.useRef)(!1),{phase:o,valuation:u,handoff:d,request:m,rejectionReason:p,rounds:h,context:f}=e,x=e.questions.length;(0,l.useEffect)((()=>{switch("error"!==o&&(i.current=!1),"landing"===o&&(t.current=null,n.current=null,a.current=null,r.current=null,s.current=null),o){case"questions":if(!f||t.current===f)return;return t.current=f,void(0,c.L9)("appraisal_questions_shown",{round:h,question_count:x});case"result":{if(!u)return;const e="".concat(u.payoutAmount,":").concat(u.path);if(n.current===e)return;return n.current=e,void(0,c.xr)({productName:u.productName,appraisalPath:u.path,payoutAmount:u.payoutAmount,status:u.payoutAmount>0?"ok":"no_payout",isAiGenerated:u.isAiGenerated,rounds:h})}case"rejected":if(!p||a.current===p)return;return a.current=p,void(0,c.L9)("appraisal_rejected",{reason:p});case"handoff":if(!d||r.current===d.target)return;return r.current=d.target,void(0,c.L9)("appraisal_handoff",{target:d.target});case"request":if(!m||s.current===m.productName)return;return s.current=m.productName,void(0,c.L9)("appraisal_request_shown",{appraisal_path:m.path});case"error":if(i.current)return;return i.current=!0,void(0,c.L9)("appraisal_error")}}),[o,u,d,m,p,h,f,x])}(t);const r="landing"!==t.phase;return(0,a.jsxs)("div",{className:"flex flex-col md:grid md:grid-cols-[2fr_1fr] gap-6 w-full max-w-[900px] mx-auto px-4 py-8",children:[(0,a.jsxs)("main",{className:"flex flex-col gap-6",children:["landing"===t.phase&&(0,a.jsx)(T,{onSubmit:t.submitDescription}),"loadingQuestions"===t.phase&&(0,a.jsx)(W,{message:e("loading_questions")}),"loadingEstimate"===t.phase&&(0,a.jsx)(W,{message:e("loading_estimate")}),"questions"===t.phase&&(0,a.jsx)(U,{questions:t.questions,answers:t.answers,canSubmit:t.canSubmitAnswers,isFinalStep:t.isFinalStep,onAnswerChange:t.setAnswer,onSubmit:t.submitAnswers}),"result"===t.phase&&t.valuation&&(0,a.jsx)(te,{amountEur:t.valuation.payoutAmount,disclaimer:t.valuation.disclaimer,adjustQuestions:t.questions,answers:t.answers,canRecalculate:t.canSubmitAnswers,onAnswerChange:t.setAnswer,onRecalculate:t.submitAnswers,onCtaClick:t.valuation.checkout?()=>{t.valuation&&n.startHandoff(t.valuation)}:void 0,isSubmitting:n.isSubmitting}),"rejected"===t.phase&&(0,a.jsx)(J,{note:t.rejectionMessage,onReset:t.reset}),"handoff"===t.phase&&t.handoff&&(0,a.jsx)(O,{target:t.handoff.target,message:t.handoff.message,vehicle:t.handoff.vehicle,onReset:t.reset}),"request"===t.phase&&t.request&&(0,a.jsx)($,{message:t.request.message,suggestedAmount:t.request.suggestedAmount,minAmount:t.request.minAmount,maxAmount:t.request.maxAmount,onSubmit:e=>
1{t.request&&n.startRequest(t.request,e)},onReset:t.reset,isSubmitting:n.isSubmitting}),"error"===t.phase&&(0,a.jsx)(F,{onRetry:t.retry,onReset:t.reset}),("questions"===t.phase||"result"===t.phase)&&(0,a.jsx)(E.z,{type:"button",variant:"link",className:"self-center",onClick:t.reset,children:e("reset_new_item")})]}),r&&(0,a.jsx)(ne,{description:t.text,answeredQuestions:t.submittedAnswers,itemLabel:t.productName})]})}var se=n(29228),ie=n(37900),le=!0;function oe(){const{t:e}=(0,s.Z)("wertCheck");(0,ie.Z)("bg-fill-senary");const t=(0,i.useRouter)(),n=(0,se.vi)();return(0,l.useEffect)((()=>{!1===n&&t.replace("/")}),[n,t]),(0,a.jsxs)(o.Z,{children:[(0,a.jsx)(r.PB,{noindex:!0,nofollow:!0,title:e("page_title")}),n&&(0,a.jsx)(re,{})]})}}},function(e){e.O(0,[9774,2888,179],(function(){return t=12569,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
2//# sourceMappingURL=wert-check-455c54c5e2f61333.js.map

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.