1import{aq as W,ar as M,au as q,R as b,av as U,a3 as z,ap as F,a4 as Q,a2 as G,y as g,j as e,S as J,B as $,g as H,aj as V}from"./index-Db5gaNc7.js";import{a as n,A as Z,F as o,E as K}from"./antd-vendor-D0fIZ7aZ.js";import{i as X}from"./reg_succes-dAplpPuD.js";import{A as Y}from"./AccountHeaderSection-D2eapAH5.js";import{E as N}from"./EmptySection-CUD0YhC2.js";import{P as ee}from"./PaymentRequisitesSelect-B77TIgof.js";import{S as te}from"./SectionCard-BcpMeBtO.js";import{S as se}from"./Stepper-CZmtl6XI.js";import{S as oe}from"./SuccessStep-9K_imK3s.js";import{g as ae,P as re}from"./ProjectCharacteristicsStep-8GyvDeqi.js";import{P as ne}from"./ProjectCheckStep-C1ATWQ6S.js";import{m as ce,b as ie}from"./projectUtils-D1WsICbb.js";import{b as pe,a as le,u as me,m as v}from"./react-vendor-B9WQRuLt.js";import"./redux-vendor-BkbGJ5L2.js";import"./Alert-BdxAWxjZ.js";import"./Select-7MPQglJv.js";import"./paymentRequisitesUtils-DafJL8xZ.js";import"./formUtils-ny6WJWcC.js";import"./Checkbox-yBElFB8Z.js";import"./Input-GXDRMw06.js";import"./workSections-Cav5Fi_l.js";import"./projectTypes-Cx6uZ6gD.js";import"./Radio-GGYIS8UT.js";import"./TextArea-CR1luyF9.js";import"./debounce-D2TKVR_N.js";import"./input-B2G9stqo.js";import"./SectionBlock-CXMix7Im.js";import"./Divider-DwYr2uYK.js";const A=100,ue=t=>{const{data:s}=W({projectId:t??"",page:1,pageSize:A},{skip:!t}),S=(s?.items??[]).some(c=>(c.contractor.works??[]).length>0),{data:f}=M({project_id:t??"",page:1,page_size:A},{skip:!t||!S});return n.useMemo(()=>{const c=s?.items??[],u=new Set((f?.items??[]).filter(r=>!!r.document.fixed_at).map(r=>r.document.contractor_id)),d={};return c.forEach(r=>{const{contractor:j}=r,i=j.works??[],m=r.profile_caption?.trim()||q(j),_=u.has(j.id),k=i.length===1;i.forEach(h=>{const p=d[h.id]??{assignedTo:[]};p.assignedTo=[...p.assignedTo,m],!p.blockedReason&&_?p.blockedReason=`У иÑполниÑÐµÐ»Ñ Â«${m}» докÑÐ¼ÐµÐ½Ñ Ñже заÑикÑиÑован`:!p.blockedReason&&k&&(p.blockedReason=`ÐÑо единÑÑвенное пÑоизведение иÑполниÑÐµÐ»Ñ Â«${m}»`),d[h.id]=p})}),d},[s?.items,f?.items])},de="_page_t0od5_1",je="_loadingScreen_t0od5_7",ge="_content_t0od5_12",fe="_stepperWrap_t0od5_21",xe="_stepperInner_t0od5_29",Se="_backButtonWrap_t0od5_34",_e="_requisitesSection_t0od5_40",a={page:de,loadingScreen:je,content:ge,stepperWrap:fe,stepperInner:xe,backButtonWrap:Se,requisitesSection:_e},He=()=>{const{profileId:t,projectId:s}=pe(),S=le(),f=me(),c=v(b.ACCOUNT_PERSON_PROJECT_DETAILS,f.pathname)!==null||v(b.ACCOUNT_PERSON_PROJECT_EDIT,f.pathname)!==null,[u,d]=n.useState(1),[r,j]=n.useState(!1),[i,m]=n.useState(null),{notification:_}=Z.useApp(),[k,{isLoading:h}]=U(),p=ue(s),{data:P}=z(t??"",{skip:!t}),{data:R,isLoading:T,isError:D}=F(s??"",{skip:!s||r}),x=R?.project,C=n.useMemo(()=>Q(P?.personal_data,"ÐомпаниÑ"),[P]),I=n.useMemo(()=>{const l=P?.personal_data?.data?.tax?.form;return ae(l)},[P]),y=n.useMemo(()=>ce(x??null),[x]);n.useEffect(()=>{s&&(j(!1),m(null),d(1))},[s]),n.useEffect(()=>{!y||r||(m(y),j(!0))},[y,r]);const B=n.useMemo(()=>[G,{label:C,muted:!1,href:c?g.person(t??""):g.company(t??"")},{label:x?.title??"РедакÑиÑование пÑоекÑа",muted:!1}],[C,t,x?.title,c]),w=()=>{window.scrollTo(0,0)},E=l=>{d(l),w()},L=()=>{S(c?g.person(t??""):g.company(t??""))},O=async()=>{if(!i||!s){_.error({message:"Ðе Ð·Ð°Ð¿Ð¾Ð»Ð½ÐµÐ½Ñ Ð´Ð°Ð½Ð½Ñе пÑоекÑа",description:"ÐеÑниÑеÑÑ Ð½Ð° Ñаг Ñ Ñ
аÑакÑеÑиÑÑиками и заполниÑе обÑзаÑелÑнÑе полÑ."});return}try{await k({projectId:s,body:ie(i)}).unwrap(),E(3)}catch(l){console.error(l),_.error({message:"Ðе ÑдалоÑÑ Ð¾Ð±Ð½Ð¾Ð²Ð¸ÑÑ Ð¿ÑоекÑ",description:H(l,"ÐÑовеÑÑÑе даннÑе и попÑобÑйÑе Ñнова.",{mapMessage:V})})}};return!s||!t?e.jsx(o,{vertical:!0,className:a.page,children:e.jsx(o,{className:a.loadingScreen,align:"center",justify:"center",children:e.jsx(N,{title:"ÐÑоекÑ",emptyText:"ÐекоÑÑекÑÐ½Ð°Ñ ÑÑÑлка на ÑедакÑиÑование пÑоекÑа"})})}):!T&&D?e.jsx(o,{vertical:!0,className:a.page,children:e.jsx(o,{className:a.loadingScreen,align:"center",justify:"center",children:e.jsx(N,{title:"ÐÑоекÑ",emptyText:"Ðе ÑдалоÑÑ Ð·Ð°Ð³ÑÑзиÑÑ Ð¿ÑоекÑ"})})}):!T&&!y&&!i?e.jsx(o,{vertical:!0,className:a.page,children:e.jsx(o,{className:a.loadingScreen,align:"center",justify:"center",children:e.jsx(N,{title:"ÐÑоекÑ",emptyText:"ÐÑÐ¾ÐµÐºÑ Ð½Ðµ найден"})})}):T||!i?e.jsx(o,{vertical:!0,className:a.page,children:e.jsx(o,{className:a.loadingScreen,align:"center",justify:"center",children:e.jsx(J,{size:"large"})})}):e.jsxs(o,{vertical:!0,className:a.page,children:[e.jsx(Y,{title:"РедакÑиÑоваÑÑ Ð¿ÑоекÑ",breadcrumbs:B}),e.jsxs(o,{vertical:!0,className:a.content,align:"center",children:[e.jsx(o,{className:a.stepperWrap,children:e.jsx(o,{className:a.stepperInner,children:e.jsx(se,{steps:["ХаÑакÑеÑиÑÑики пÑоекÑа","ÐÑовеÑка","ÐавеÑÑение"],activeStep:u})})}),u===1&&e.jsxs(e.Fragment,{children:[e.jsx(o,{className:a.backButtonWrap,children:e.jsxs($,{variant:"link",onClick:()=>S(c?g.personProjectDetails(t??"",s??""):g.companyProjectDetails(t??"",s??"")),children:[e.jsx(K,{}),"ÐÐ°Ð±Ð¸Ð½ÐµÑ Ð¿ÑоекÑа"]})}),e.jsx(o,{className:a.requisitesSection,vertical:!0,children:e.jsx(te,{title:"ÐлаÑÑжнÑе ÑеквизиÑÑ Ð¿ÑоекÑа",description:"ÐÐ°Ð±Ð¾Ñ Ð²ÑбÑан пÑи Ñоздании пÑоекÑа и иÑполÑзÑеÑÑÑ Ð²Ð¾ вÑеÑ
его доÐ
1ºÑменÑаÑ
.",children:e.jsx(ee,{profileId:t,variant:c?"person":"company",value:x?.payment_requisites_id,onChange:()=>{},readOnly:!0})})}),e.jsx(re,{initialValues:i,allowedProjectTypes:I,workLocks:p,preserveInitialProjectType:!0,onNext:l=>{m(l),E(2)}})]}),u===2&&e.jsx(ne,{data:i,isSubmitting:h,onNext:O,onBack:()=>{E(1)},confirmButtonText:"СоÑ
ÑаниÑÑ Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ"}),u===3&&e.jsx(oe,{icon:X,title:"ÐÑÐ¾ÐµÐºÑ Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½",description:"ÐÐ·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ ÑоÑ
ÑаненÑ. ÐÑ Ð¼Ð¾Ð¶ÐµÑе пÑодолжиÑÑ ÑабоÑÑ Ð² лиÑном кабинеÑе.",buttonText:"ÐеÑейÑи в лиÑнÑй кабинеÑ",onAction:L})]})]})};export{He 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.