1import{j as e,P as pe,S as R,T as y,B as C,k as xe,I as fe,A as O,s as ye,g as je,b as Z,U as Ce,D as ze,i as ke,G,a as H,K as Se,M as De,N as Re,O as Te,Q as Ee}from"./vendor-mui-DS9kNsJl.js";import{u as oe,a}from"./vendor-i18n-CcQdkrxB.js";import{u as le}from"./vendor-query-DAPtKPOb.js";import"./PhoneField-C93JXCIT.js";import{W as We}from"./WizardStepNav-DQUgnK0x.js";import{u as Ae}from"./useAutoSaveToast-BkyFZg-m.js";import{D as de}from"./DropZone-NAAq190V.js";import{u as Fe}from"./App-Cx8cc-so.js";import{T as Ie}from"./TitledWizardStepper-C6qsRK42.js";import{W as Pe}from"./WizardPageHeader-Cb_sTDer.js";import{W as qe}from"./WizardSupportSection-B9L2aHM9.js";import{T as Me}from"./Trustpilot-rj8BS7VN.js";import{g as ve,e as ae,n as Le,l as ce,o as ue,p as Ne,q as Oe,d as Ue,f as Be,r as Ke,a as Ye}from"./titledOrder-u75Wu9MU.js";import{u as Qe,p as me}from"./usePollAbortRegistry-KJ0ZH5Ey.js";import{A as $e}from"./AddRounded-Br4E-XxM.js";import{D as Ve}from"./DeleteOutlineRounded-CKTsZgfT.js";import{A as he}from"./AutoAwesomeRounded-DCpDYlxH.js";import{a as se,A as be}from"./AmountField-CAq7I2lr.js";import{D as J}from"./DateField-CVD_VP-n.js";import{T as Ge}from"./clients-D5Uihw1p.js";import{D as ne}from"./DocumentPreviewCard-7I6AuPk-.js";import{D as He}from"./Delete-CGAX0y_A.js";import{O as Ze}from"./OrderSummarySidebar-BYMDG2VR.js";import{W as _e}from"./WizardLoadingSkeleton-DEiUJ_a-.js";import{W as Je}from"./WizardTwoColumnLayout-D7j_uZPk.js";import{r as Xe}from"./registrationSidebar-hll-50xa.js";import{b as er}from"./claimSummaryDetails-BRYmWFv_.js";import{u as rr}from"./vendor-react-BYWuhvJQ.js";import"./main-Dx-_wTTe.js";import"./index-BU3Z37K5.js";import"./vendor-dompurify-DdwdxIb1.js";import"./navigation-nSCj0HaH.js";import"./WizardStepper-B0Qv_rz_.js";import"./CheckRounded-DrNwjEeW.js";import"./money-B4fNBo1K.js";import"./rentOrder-D1JabBGo.js";import"./DeleteOutline-DgSaLXyB.js";import"./CheckCircleOutline-fvg814Rx.js";import"./ErrorOutline-VdjZNzoY.js";import"./ConfirmDialog-DM3qXAqK.js";import"./MailOutlineRounded-BOJWqo6D.js";import"./ArrowForwardRounded-k_gXpX7L.js";import"./date-CdnUW7ZA.js";import"./DatePicker-DMKTS-1A.js";import"./DescriptionRounded-XK6yUSRG.js";import"./OpenInNewRounded-BnyLFhYt.js";import"./CloseRounded-BW8_A0Ag.js";import"./EditRounded-B79ufeFw.js";import"./InfoOutlined-DttLPjuj.js";import"./PostenLedger-DS2tb9t-.js";async function tr(n,r="/auftrag/titel"){const m=await ve();return m||(n(r,{replace:!0}),null)}const ir={vollstreckungsbescheid:"orders.organisms.titled_claim_card.title_types.vollstreckungsbescheid",versaeumnisurteil:"orders.organisms.titled_claim_card.title_types.versaeumnisurteil",endurteil:"orders.organisms.titled_claim_card.title_types.endurteil",anerkenntnisurteil:"orders.organisms.titled_claim_card.title_types.anerkenntnisurteil",vorbehaltsurteil:"orders.organisms.titled_claim_card.title_types.vorbehaltsurteil",gerichtlicher_vergleich:"orders.organisms.titled_claim_card.title_types.gerichtlicher_vergleich",notarielle_urkunde:"orders.organisms.titled_claim_card.title_types.notarielle_urkunde",kostenfestsetzungsbeschluss:"orders.organisms.titled_claim_card.title_types.kostenfestsetzungsbeschluss",sonstiger_titel:"orders.organisms.titled_claim_card.title_types.sonstiger_titel"};function ge(n){if(!n)return null;const r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(n);if(!r)return null;const m=Number(r[1]),o=Number(r[2])-1,f=Number(r[3]),s=new Date(m,o,f);return Number.isNaN(s.getTime())?null:s}function ar(n){const r=String(n.getDate()).padStart(2,"0"),m=String(n.getMonth()+1).padStart(2,"0");return`${r}.${m}.${n.getFullYear()}`}function sr(n,r){const m=ge(n);if(m)return m;const o=ge(r);if(!o)return null;const f=new Date(o);return f.setDate(f.getDate()+14),f}function nr(){const n=new Date;return new Date(n.getFullYear(),n.getMonth(),n.getDate())}const or={zustellung_missing:"orders.organisms.titled_claim_card.warnings.zustellung_missing",ausfertigung_beglaubigte_abschrift:"orders.organisms.titled_claim_card.warnings.ausfertigung_beglaubigte_abschrift",ausfertigung_unconfirmed:"orders.organisms.titled_claim_card.warnings.ausfertigung_unconfirmed",klausel_missing:"orders.organisms.titled_claim_card.warnings.klausel_missing"};function lr(n,r,m,o,f){if(!n)return[];if(n==="vollstreckungsbescheid"){const h=sr(f,r);return h&&h>nr()?[{key:"vb_rechtskraft_future",date:ar(h)}]:[]}const s=[];return r||s.push("zustellung_missing"),m==="beglaubigte_abschrift"?s.push("ausfertigung_beglaubigte_abschrift"):(m==="ausfertigung"||m==="unknown")&&s.push("ausfertigung_unconfirmed"),o===!1&&s.push("klausel_missing"),s}function dr({orderUuid:n,claim:r,index:m=0,canRemove:o=!1,onRemove:f,onStateChange:s,onAddSupportingDocument:h,onDeleteSupportingDocument:w,autoSave:u}){const{t:l}=oe(),x=r.uuid,d=r.titled_claim,I=a.useId(),P=a.useRef(null),[k,T]=a.useState(!1),[q,E]=a.useState(null),W=a.useCallback(async t=>{const _=t.target.files?.[0];if(t.target.value="",!(!_||!h)){T(!0);try{await h(_)}finally{T(!1)}}}
1,[h]),z=a.useCallback(async t=>{if(w){E(t);try{await w(t)}finally{E(null)}}},[w]),[g,v]=a.useState({title_type:d?.title_type??"",issuing_authority:d?.issuing_authority??"",file_number:d?.file_number??"",issued_on:d?.issued_on??null,legally_binding_since:d?.legally_binding_since??null,served_on:d?.served_on??null}),[S,j]=a.useState(r.total_claim_amount?.value??""),[U,L]=a.useState(null),A=l("orders.organisms.titled_claim_card.save_error"),N=se(S)??0,D=N>0&&!!g.title_type&&!!g.issuing_authority&&!!g.file_number&&!!g.issued_on,V=a.useMemo(()=>lr(g.title_type,g.served_on,d?.ausfertigung_type,d?.has_vollstreckungsklausel,g.legally_binding_since),[g.title_type,g.served_on,g.legally_binding_since,d?.ausfertigung_type,d?.has_vollstreckungsklausel]),B=a.useRef(s);B.current=s,a.useEffect(()=>{B.current(x,{subtotal:N,valid:D})},[x,N,D]);const K=a.useRef(0),Y=a.useRef(0),F=a.useCallback(async t=>{if(!t.title_type)return;const _=++K.current;u?.markSaving();try{if(await ae(n,x,{titled_claim:{title_type:t.title_type,issuing_authority:t.issuing_authority,file_number:t.file_number,issued_on:t.issued_on??void 0,legally_binding_since:t.legally_binding_since,served_on:t.served_on}}),_!==K.current)return;L(i=>i===A?null:i),u?.markSaved()}catch{if(_!==K.current)return;L(A),u?.markError()}},[n,x,A,u]),X=a.useCallback(async()=>{const t=se(S);if(t===null)return;const _=++Y.current;u?.markSaving();try{if(await ae(n,x,{total_claim_amount:t.toFixed(2)}),_!==Y.current)return;L(i=>i===A?null:i),u?.markSaved()}catch{if(_!==Y.current)return;L(A),u?.markError()}},[n,x,S,A,u]),M={eyebrow:l("orders.organisms.titled_claim_card.doc_preview.eyebrow_titel"),viewAction:l("orders.organisms.titled_claim_card.doc_preview.view"),openOriginal:l("orders.organisms.titled_claim_card.doc_preview.open_original"),pageCount:l("orders.organisms.titled_claim_card.doc_preview.page_count"),pageLabel:l("orders.organisms.titled_claim_card.doc_preview.page_label"),close:l("orders.organisms.titled_claim_card.doc_preview.close"),noPreview:l("orders.organisms.titled_claim_card.doc_preview.no_preview")},ee={...M,eyebrow:l("orders.organisms.titled_claim_card.doc_preview.eyebrow_supporting"),delete:l("orders.organisms.titled_claim_card.doc_preview.delete"),deleteConfirmTitle:l("orders.organisms.titled_claim_card.doc_preview.delete_confirm_title"),deleteConfirmBody:l("orders.organisms.titled_claim_card.doc_preview.delete_confirm_body"),deleteConfirm:l("orders.organisms.titled_claim_card.doc_preview.delete_confirm"),deleteCancel:l("orders.organisms.titled_claim_card.doc_preview.delete_cancel")};return e.jsxs(pe,{variant:"outlined",sx:{borderRadius:1,p:{xs:2,md:3}},children:[e.jsxs(R,{direction:"row",alignItems:"center",spacing:1,sx:{mb:2},children:[e.jsx(y,{variant:"h6",component:"h2",sx:{fontWeight:700},children:l("orders.organisms.titled_claim_card.card_title",{n:m+1})}),e.jsxs(R,{direction:"row",alignItems:"center",spacing:.5,sx:{color:"primary.main",minWidth:0},children:[e.jsx(he,{fontSize:"small"}),e.jsx(y,{variant:"caption",fontWeight:500,sx:{whiteSpace:"nowrap"},children:l("orders.organisms.titled_claim_card.ai_badge")})]}),e.jsx(C,{sx:{flex:1}}),o&&f&&e.jsx(xe,{title:l("orders.organisms.titled_claim_card.remove_tooltip"),children:e.jsx(fe,{size:"small",color:"error",onClick:f,"aria-label":l("orders.organisms.titled_claim_card.remove_aria",{n:m+1}),children:e.jsx(Ve,{fontSize:"small"})})})]}),U&&e.jsx(O,{severity:"error",sx:{mb:2},onClose:()=>L(null),children:U}),e.jsxs(R,{spacing:2.5,divider:e.jsx(ze,{}),children:[d?.titel_document&&e.jsx(ne,{filename:d.titel_document.original_filename,downloadUrl:d.titel_document.file_url,pages:(d.titel_document.pages??[]).map(t=>({uuid:t.uuid,num:t.num,fileUrl:t.file_url,thumbnailUrl:t.thumbnail_url})),labels:M}),((d?.supporting_documents?.length??0)>0||h)&&e.jsxs(C,{children:[e.jsx(y,{variant:"eyebrow",color:"text.secondary",sx:{mb:1.5},children:l("orders.organisms.titled_claim_card.supporting_docs_heading")}),e.jsxs(R,{spacing:1.5,children:[(d?.supporting_documents??[]).map(t=>e.jsx(ne,{filename:t.original_filename,downloadUrl:t.file_url,pages:(t.pages??[]).map(_=>({uuid:_.uuid,num:_.num,fileUrl:_.file_url,thumbnailUrl:_.thumbnail_url})),labels:ee,onDelete:w?()=>z(t.uuid):void 0,isDeleting:q===t.uuid},t.uuid)),h&&e.jsxs(e.Fragment,{children:[e.jsx("input",{ref:P,id:I,type:"file",accept:"application/pdf,.pdf",hidden:!0,onChange:W,disabled:k}),e.jsx(C,{component:"button",type:"button",onClick:()=>P.current?.click(),disabled:k,sx:t=>({appearance:"none",background:"transparent",border:`2px dashed ${t.palette.divider}`,borderRadius:1,px:2,py:1.5,width:"100%",cursor:k?"wait":"pointer",color:k?"text.disabled":"text.secondary",fontFamily:"inherit",fontSize:"0.9375rem",fontWeight:500,display:"flex",alignItems:"center",justifyContent:"center",gap:1,transition:t.transitions.create(["border-color","color","background-color"],{duration:t.transitions.duration.short}),"&:hover:not(:disabled), &:focus-visible:not(:disabled)":{borderColor:t.palette.primary.main,color:t.palette.primary.main,bgcolor:je(t.palette.primary.main,.04),outline:"none"}}),children:k?e.jsxs(e.Fragment,{children:[e.jsx(ye,{size:16,thickness:5,color:"inherit"}),l("orders.organisms.titled_claim_card.add_supporting_doc.uploading")]}):e.jsxs(e.Fragment,{children:[e.jsx($e,{fontSize:"small"}),l("orders.organisms.titled_claim_card.add_supporting_doc.label")]})})]})]})]}),e.jsxs(C,{sx:{display:"grid",gap:2,gridTemplateColumns:{xs:"1fr",sm:"1fr 1fr"}},children:[e.jsx(Z,{select:!0,label:l("orders.organisms.titled_claim_card.fields.title_type"),required:!0,value:g.title_type,onCh
1ange:t=>{const _={...g,title_type:t.target.value};v(_),F(_)},children:Ge.map(t=>e.jsx(Ce,{value:t.value,children:l(ir[t.value])},t.value))}),e.jsx(Z,{label:l("orders.organisms.titled_claim_card.fields.issuing_authority"),required:!0,value:g.issuing_authority,onChange:t=>v({...g,issuing_authority:t.target.value}),onBlur:()=>F(g)}),e.jsx(Z,{label:l("orders.organisms.titled_claim_card.fields.file_number"),required:!0,value:g.file_number,onChange:t=>v({...g,file_number:t.target.value}),onBlur:()=>F(g)}),e.jsx(J,{label:l("orders.organisms.titled_claim_card.fields.issued_on"),required:!0,value:g.issued_on??"",onChange:t=>{const _={...g,issued_on:t||null};v(_),F(_)}}),e.jsx(J,{label:l("orders.organisms.titled_claim_card.fields.legally_binding_since"),value:g.legally_binding_since??"",onChange:t=>{const _={...g,legally_binding_since:t||null};v(_),F(_)}}),e.jsx(J,{label:l("orders.organisms.titled_claim_card.fields.served_on"),value:g.served_on??"",onChange:t=>{const _={...g,served_on:t||null};v(_),F(_)}}),e.jsx(be,{label:l("orders.organisms.titled_claim_card.fields.total_claim_amount"),required:!0,fullWidth:!0,value:S,onChange:j,onBlur:X})]}),V.length>0&&e.jsx(O,{severity:"warning",children:e.jsx(R,{component:"ul",sx:{m:0,pl:2},spacing:.5,children:V.map(t=>{const _=typeof t=="string"?l(or[t]):l("orders.organisms.titled_claim_card.warnings.vb_rechtskraft_future",{date:t.date});return e.jsx(y,{component:"li",variant:"body2",children:_},_)})})})]})]})}function cr({claim:n,index:r,onUpdate:m,onRemove:o,onStateChange:f}){const{t:s}=oe(),h=n.uuid,w=n.main_claim_amount?.value,[u,l]=a.useState(w&&parseFloat(w)>0?w:""),[x,d]=a.useState(n.document_date??""),[I,P]=a.useState(n.document_reference??""),k=a.useMemo(()=>new Date().toISOString().slice(0,10),[]),T=a.useMemo(()=>parseFloat(u)||0,[u]),q=a.useMemo(()=>(parseFloat(u)||0)>0&&!!x&&!!n.rechnung,[u,x,n.rechnung]),E=a.useRef(f);E.current=f,a.useEffect(()=>{E.current(h,{subtotal:T,valid:q})},[h,T,q]);const W=()=>{const v=se(u);v!==null&&m({main_claim_amount:v.toFixed(2)})},z=n.rechnung,g={eyebrow:s("orders.organisms.enforcement_cost_card.doc_preview.eyebrow"),viewAction:s("orders.organisms.enforcement_cost_card.doc_preview.view"),openOriginal:s("orders.organisms.enforcement_cost_card.doc_preview.open_original"),pageCount:s("orders.organisms.enforcement_cost_card.doc_preview.page_count"),pageLabel:s("orders.organisms.enforcement_cost_card.doc_preview.page_label"),close:s("orders.organisms.enforcement_cost_card.doc_preview.close"),noPreview:s("orders.organisms.enforcement_cost_card.doc_preview.no_preview"),delete:s("orders.organisms.enforcement_cost_card.doc_preview.delete"),deleteConfirmTitle:s("orders.organisms.enforcement_cost_card.doc_preview.delete_confirm_title"),deleteConfirmBody:s("orders.organisms.enforcement_cost_card.doc_preview.delete_confirm_body"),deleteConfirm:s("orders.organisms.enforcement_cost_card.doc_preview.delete_confirm"),deleteCancel:s("orders.organisms.enforcement_cost_card.doc_preview.delete_cancel")};return e.jsxs(pe,{variant:"outlined",sx:{p:2.5,mb:1.5,borderRadius:1},children:[e.jsxs(R,{direction:"row",alignItems:"center",spacing:1,sx:{mb:2},children:[e.jsx(y,{variant:"subtitle2",sx:{fontWeight:700},children:s("orders.organisms.enforcement_cost_card.header",{n:r+1})}),e.jsxs(R,{direction:"row",alignItems:"center",spacing:.5,sx:{color:"primary.main",minWidth:0},children:[e.jsx(he,{fontSize:"small"}),e.jsx(y,{variant:"caption",fontWeight:500,sx:{whiteSpace:"nowrap"},children:s("orders.organisms.enforcement_cost_card.ai_badge")})]}),e.jsx(C,{sx:{flex:1}}),e.jsx(ke,{size:"small",color:"info",variant:"outlined",label:s("orders.organisms.enforcement_cost_card.review_chip")}),e.jsx(fe,{"aria-label":s("orders.organisms.enforcement_cost_card.remove_aria",{n:r+1}),onClick:o,color:"error",size:"small",children:e.jsx(He,{fontSize:"small"})})]}),e.jsx(C,{sx:{mb:2},children:z?e.jsx(ne,{filename:z.original_filename,downloadUrl:z.file_url,pages:(z.pages??[]).map(v=>({uuid:v.uuid,num:v.num,fileUrl:v.file_url,thumbnailUrl:v.thumbnail_url})),labels:g}):e.jsx(y,{variant:"body2",color:"text.secondary",children:s("orders.organisms.enforcement_cost_card.no_rechnung")})}),e.jsxs(G,{container:!0,spacing:1.5,children:[e.jsx(G,{size:{xs:12,sm:4},children:e.jsx(be,{label:s("orders.organisms.enforcement_cost_card.fields.amount"),fullWidth:!0,required:!0,value:u,onChange:l,onBlur:W})}),e.jsx(G,{size:{xs:12,sm:4},children:e.jsx(J,{label:s("orders.organisms.enforcement_cost_card.fields.document_date"),required:!0,value:x,maxDate:k,onChange:v=>{d(v),m({document_date:v||null})}})}),e.jsx(G,{size:{xs:12,sm:4},children:e.jsx(Z,{label:s("orders.organisms.enforcement_cost_card.fields.document_reference"),fullWidth:!0,value:
1I,onChange:v=>P(v.target.value),onBlur:()=>m({document_reference:I}),placeholder:s("orders.organisms.enforcement_cost_card.fields.document_reference_placeholder")})})]})]})}function ur(n,r){const m=Object.keys(n),o=Object.keys(r);return m.length!==o.length?!1:m.every(f=>n[f]===r[f])}function lt(){const n=rr(),{t:r}=oe();Fe(r("orders.pages.titled_claim_wizard.review_page.document_title"));const m=Ae(),[o,f]=a.useState(null),[s,h]=a.useState([]),[w,u]=a.useState(null),{runPoll:l,abortPoll:x,isActive:d}=Qe(),[I,P]=a.useState(!1),[k,T]=a.useState(!1),[q,E]=a.useState(!1),W=I||k||q,[z,g]=a.useState({}),[v,S]=a.useState(null),j=le({queryKey:["titled-order","review","current"],queryFn:ve,staleTime:0,gcTime:0});a.useEffect(()=>{j.data===null&&n("/auftrag/titel",{replace:!0})},[j.data,n]);const U=a.useRef(!1);!U.current&&j.data&&(U.current=!0,f(j.data),h(j.data.claims??[]));const A=le({queryKey:["titled-order","review","registration",j.data?.uuid],queryFn:()=>Ye(j.data.uuid),enabled:!!j.data}).data??null,N=a.useCallback((i,p)=>{g(b=>{const c=b[i];return c&&ur(c,p)?b:{...b,[i]:p}})},[]),D=a.useMemo(()=>s.filter(i=>i.titled_claim!=null),[s]),V=a.useMemo(()=>s.filter(i=>i.titled_claim==null),[s]),B=i=>i.type==="application/pdf"||i.name.toLowerCase().endsWith(".pdf"),K=a.useCallback(async i=>{const p=i[0];if(!o||!p)return;if(!B(p)){u(r("orders.pages.titled_claim_wizard.review_page.errors.pdf_required"));return}P(!0),u(null);let b=!1;try{const c=await Le(o.uuid,p);if(!d())return;if(c.processing_document){const Q=await l(c.processing_document.claim_uuid,re=>me((te,ie)=>ce(o.uuid,te,ie),c.processing_document.uuid,{signal:re}));if(Q.aborted||!d()){b=!0;return}Q.value.succeeded||u(r("orders.pages.titled_claim_wizard.review_page.errors.add_titel_failed"));const $=await ue(o.uuid);if(!d())return;f($),h($.claims??[]);return}f(c),h(c.claims??[])}catch{if(!d())return;u(r("orders.pages.titled_claim_wizard.review_page.errors.add_titel_failed"))}finally{!b&&d()&&P(!1)}},[o,r,l,d]),Y=a.useCallback(async i=>{const p=i[0];if(!o||!p)return;if(!B(p)){u(r("orders.pages.titled_claim_wizard.review_page.errors.pdf_required"));return}T(!0),u(null);let b=!1;try{const c=await Ne(o.uuid,p);if(!d())return;if(c.processing_document){const Q=await l(c.processing_document.claim_uuid,re=>me((te,ie)=>ce(o.uuid,te,ie),c.processing_document.uuid,{signal:re}));if(Q.aborted||!d()){b=!0;return}Q.value.succeeded||u(r("orders.pages.titled_claim_wizard.review_page.errors.add_enforcement_failed"));const $=await ue(o.uuid);if(!d())return;f($),h($.claims??[]);return}f(c),h(c.claims??[])}catch{if(!d())return;u(r("orders.pages.titled_claim_wizard.review_page.errors.add_enforcement_failed"))}finally{!b&&d()&&T(!1)}},[o,r,l,d]),F=a.useCallback((i,p)=>{if(!o)return;const b=r("orders.pages.titled_claim_wizard.review_page.errors.update_enforcement_failed_prefix");m.markSaving(),ae(o.uuid,i,p).then(()=>{u(c=>c?.startsWith(b)?null:c),m.markSaved()}).catch(()=>{u(r("orders.pages.titled_claim_wizard.review_page.errors.update_enforcement_failed")),m.markError()})},[o,m,r]),X=a.useCallback(async i=>{if(o){x(i),E(!0),u(null);try{const p=await Oe(o.uuid,i);if(!d())return;f(p),h(p.claims??[]),g(b=>{const c={...b};return delete c[i],c})}catch{if(!d())return;u(r("orders.pages.titled_claim_wizard.review_page.errors.remove_failed"))}finally{d()&&E(!1)}}},[o,r,x,d]),M=a.useMemo(()=>s.reduce((i,p)=>i+(z[p.uuid]?.subtotal??0),0),[s,z]),ee=a.useMemo(()=>M>0?{value:M.toFixed(2),currency:"EUR"}:null,[M]),t=a.useMemo(()=>D.length===0?!1:s.every(i=>z[i.uuid]?.valid??!1),[D,s,z]),_=a.useCallback(()=>{if(!t){u(r("orders.pages.titled_claim_wizard.review_page.errors.continue_incomplete"));return}n("/auftrag/titel/schuldner")},[t,n,r]);return j.isError?e.jsxs(C,{sx:{p:4},children:[e.jsx(_e,{}),e.jsx(O,{severity:"error",sx:{mt:2},role:"alert",action:e.jsx(H,{color:"inherit",size:"small",onClick:()=>j.refetch(),children:r("common.molecules.route_suspense.reload")}),children:r("orders.pages.titled_claim_wizard.review_page.errors.load_failed")})]}):o?e.jsxs(e.Fragment,{children:[e.jsx(Ie,{order:o}),e.jsxs(C,{sx:{px:{xs:2,md:3},pt:{xs:2,md:3},pb:{xs:8,md:12}},children:[e.jsx(Pe,{title:r("orders.pages.titled_claim_wizard.review_page.header.title"),subtitle:r("orders.pages.titled_claim_wizard.review_page.header.subtitle"),onDiscard:o?async()=>{await Ue(o.uuid),n("/starten",{replace:!0})}:void 0,autoSaveStatus:m.status,autoSaveLabels:{saving:r("orders.pages.titled_claim_wizard.review_page.auto_save.saving"),saved:r("orders.pages.titled_claim_wizard.review_page.auto_save.saved"),error:r("orders.pages.titled_claim_wizard.review_page.auto_save.error")}}),w&&e.jsx(O,{severity:"error",sx:{mb:2},onClose:()=>u(null),children:w}),e.jsx(Je,{main:e.jsxs(e.Fragment,{children:[e.jsxs(R,{spacing:3,children:[D.map((i,p)=>e.jsx(dr,{orderUuid:o.uuid,claim:i,index:p,canRemove:D.length>1,autoSave:m,onRemove:()=>S({claimUuid:i.uuid,label:r("orders.pages.titled_claim_wizard.review_page.removal.titel_label",{index:p+1,fileNumber:i.titled_claim?.file_number??""})}),onStateChange:N,onAddSupportingDocument:async b=>{try{const c=await Ke(o.uuid,i.uuid,b);f(c),h(c.claims??[])}catch(c){u(c instanceof Error?c.message:r("orders.pages.titled_claim_wizard.review_page.errors.add_supporting_doc_failed"))}},onDeleteSupportingDocument:async b=>{try{await Be(o.uuid,b);const c=await tr(n);c&&(f(c),h(c.claims??[]))}catch(c){u(c instanceof Error?c.message:r("orders.pages.titled_claim_wizard.review_page.errors.delete_supporting_doc_failed"))}}},i.uuid)),D.length===0&&e.jsxs(O,{severity:"warning",sx:{borderRadius:1},children:[e.jsx(y,{fontWeight:700,children:r("orders.pages.titled_claim_wizard.review_page.empty_state.t
1itle")}),e.jsx(y,{variant:"body2",sx:{mt:.5},children:r("orders.pages.titled_claim_wizard.review_page.empty_state.body")}),e.jsx(H,{variant:"contained",size:"small",onClick:()=>n("/auftrag/titel"),sx:{mt:1.5},children:r("orders.pages.titled_claim_wizard.review_page.empty_state.upload_button")})]}),e.jsx(de,{uploading:I,accept:"application/pdf,.pdf",size:"compact",onChange:K,strings:{primary:D.length===0?r("orders.pages.titled_claim_wizard.review_page.dropzone.titel.primary_initial"):r("orders.pages.titled_claim_wizard.review_page.dropzone.titel.primary_additional"),hint:r("orders.pages.titled_claim_wizard.review_page.dropzone.titel.hint"),uploading:r("orders.pages.titled_claim_wizard.review_page.dropzone.uploading")}}),e.jsxs(C,{children:[e.jsx(y,{variant:"h6",component:"h2",sx:{fontWeight:700,mb:.5},children:r("orders.pages.titled_claim_wizard.review_page.enforcement.section_heading")}),e.jsx(y,{variant:"body2",color:"text.secondary",sx:{mb:2},children:r("orders.pages.titled_claim_wizard.review_page.enforcement.section_subtitle")}),e.jsxs(R,{spacing:2,children:[V.map((i,p)=>e.jsx(cr,{claim:i,index:p,onUpdate:b=>F(i.uuid,b),onRemove:()=>S({claimUuid:i.uuid,label:r("orders.pages.titled_claim_wizard.review_page.removal.enforcement_label",{index:p+1})}),onStateChange:N},i.uuid)),e.jsx(de,{uploading:k,accept:"application/pdf,.pdf",onChange:Y,strings:{primary:r("orders.pages.titled_claim_wizard.review_page.dropzone.enforcement.primary"),hint:r("orders.pages.titled_claim_wizard.review_page.dropzone.enforcement.hint"),uploading:r("orders.pages.titled_claim_wizard.review_page.dropzone.uploading")}})]})]}),e.jsxs(C,{sx:{p:2,borderRadius:1,bgcolor:"action.hover",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsx(y,{variant:"subtitle2",sx:{fontWeight:600},children:r("orders.pages.titled_claim_wizard.review_page.total.label")}),e.jsxs(y,{variant:"h6",component:"p",sx:{fontWeight:700},"data-testid":"order-total",children:[M.toLocaleString("de-DE",{minimumFractionDigits:2,maximumFractionDigits:2})," ",r("common.currency.eur_suffix")]})]})]}),e.jsx(We,{backLabel:r("common.shared.actions.back"),onBack:()=>n("/auftrag/titel"),nextLabel:r("common.shared.actions.next"),onNext:_,nextDisabled:!t||W})]}),sidebar:(()=>{const i=Xe(A),p=o.company??i.company;return e.jsx(Ze,{claimDetails:er(r,s),company:p,debtor:o.debtor??null,additionalDebtors:[],claims:s,totalOrderValue:ee,companyDeferred:!p,contactPerson:i.contactPerson,onEditCompany:()=>n("/auftrag/titel/ihre-daten")})})()}),e.jsx(qe,{}),e.jsx(C,{sx:{mt:{xs:6,md:8}},children:e.jsx(Me,{variant:"full"})})]}),e.jsxs(Se,{open:v!==null,onClose:()=>W?void 0:S(null),"aria-labelledby":"confirm-remove-title","aria-describedby":"confirm-remove-body",children:[e.jsx(De,{id:"confirm-remove-title",children:v?.label?r("orders.pages.titled_claim_wizard.review_page.removal.dialog_title_with_label",{label:v.label}):r("orders.pages.titled_claim_wizard.review_page.removal.dialog_title_fallback")}),e.jsx(Re,{children:e.jsx(Te,{id:"confirm-remove-body",children:r("orders.pages.titled_claim_wizard.review_page.removal.dialog_body")})}),e.jsxs(Ee,{children:[e.jsx(H,{onClick:()=>S(null),disabled:W,children:r("common.shared.actions.cancel")}),e.jsx(H,{onClick:async()=>{if(v){const i=v.claimUuid;S(null),await X(i)}},color:"error",variant:"contained",disabled:W,autoFocus:!0,children:r(q?"orders.pages.titled_claim_wizard.review_page.removal.confirm_busy":"orders.pages.titled_claim_wizard.review_page.removal.confirm")})]})]})]}):e.jsxs(C,{sx:{p:4},children:[e.jsx(_e,{}),w&&e.jsx(O,{severity:"error",sx:{mt:2},role:"alert",children:w})]})}export{lt 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.