1import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{d as A,c as z,N as H,A as V}from"./addLoader-p8WLB-bt.js";import{u as P,f as Q,r as i}from"./createLucideIcon-CiWnlb16.js";import{d as E,e as b,iL as R,o as U,iM as X,iN as W,i9 as Y,c1 as M,iO as w,iP as I,bb as Z,ic as G,id as J,iQ as K,iR as ee,iS as te,iT as se,iU as oe,iV as ie,iW as ae,iX as ne,iY as re,iZ as me,i_ as ce,i$ as de,j0 as le,j1 as ue,j2 as _e,cX as he,j3 as O,j4 as pe,j5 as xe,n as L,j6 as fe,j7 as je}from"./loginCallback-DUlVA6A0.js";import{B as N}from"./index-CQOuJFSK.js";import{M as Ce}from"./modal-B_oAvykg.js";import{T as be}from"./TextInput-D56ByitK.js";import{I as S}from"./InputError-CCOh0X_2.js";import{T as $}from"./tableLoader-DmKfU8gk.js";import{u as ve}from"./index-D_YXp3zG.js";import{u as ge,a as F,P as qe,b as Ne,c as ke}from"./index-Ch95_YAW.js";import{C as Se}from"./CheckBox-DFWTUyKS.js";import{E as Qe}from"./Edit-8thwdvew.js";import{F as Ee}from"./file-loader-DQyP5CvM.js";import{F as we,C as Ie}from"./FileInput-B3g1HkTO.js";import"./config.release-CKeoGYk7.js";import"./info-BC1aLG_G.js";import"./loader-circle-C5dSd6jx.js";import"./check-Di4ZmmuT.js";import"./circle-alert-BcQG5ICW.js";const Fe="_committee_edit_create_form_1wdpe_1",De="_committee_edit_create_form_step_1wdpe_11",Te="_committee_edit_create_button_1wdpe_33",D={committee_edit_create_form:Fe,committee_edit_create_form_step:De,committee_edit_create_button:Te},y=[{label:"ÐÑбеÑиÑе ÑпоÑоб пÑоведениÑ",value:0},{label:"ÐÑное",value:1},{label:"ÐаоÑное",value:2},{label:"СмеÑанное",value:3}],Me=()=>{const r=E(),a=b(t=>t.publicationsCommitteeEditCreateForm.creditorCommitteeCreate),s=b(t=>t.publicationsCommitteeEditCreateForm.creditorCommittee),p=b(R),u=P(),{id:d}=Q(),o=d==="create",{debtors:_}=b(U),x=_?.map(t=>({value:t?.id,label:t?.value})),[n,h]=i.useState(!1),m=i.useMemo(()=>o?{debtorId:a?.debtorId??null,committeeTime:a?.committeeTime??null,address:a?.address??"",conductingMethod:a?.conductingMethod??null}:{debtorId:s?.message?.debtorId??null,committeeTime:s?.committeeTime??null,address:s?.address??"",conductingMethod:s?.conductingMethod??null},[o,a?.debtorId,a?.committeeTime,a?.address,a?.conductingMethod,s?.message?.debtorId,s?.committeeTime,s?.address,s?.conductingMethod]),C=t=>!!(t.debtorId&&t.committeeTime&&(t.address||t.conductingMethod===2)),q=ge(),c=ve(m,t=>{if(!o){if(!C(t)){h(!0);return}h(!1),q(()=>r(ee({id:d,committee:t})))}}),l=async t=>{if(t.preventDefault(),!C(m)){h(!0);return}h(!1);const B=await r(K(a)).unwrap();u(`/hub/publications/committee/${B?.id}`)};i.useEffect(()=>(o||r(X({id:d})),()=>{r(W())}),[d]);const g=o?a:s,v=i.useMemo(()=>Y(g?.committeeTime),[g?.committeeTime]),k=i.useMemo(()=>{const t=new Date;return!o&&v&&v<t?v:t},[o,v]);return e.jsx(e.Fragment,{children:p?e.jsx($,{}):e.jsxs("form",{className:D.committee_edit_create_form,onSubmit:l,children:[e.jsxs("div",{className:D.committee_edit_create_form_step,children:[e.jsxs("div",{className:"select-wrapper",children:[e.jsx("label",{children:"Ðолжник"}),e.jsx(M,{styles:{menuPortal:t=>({...t,zIndex:9999}),menu:t=>({...t,zIndex:9999})},options:x,value:x?.find(t=>t.value===m.debtorId)||null,placeholder:"ÐÑбеÑиÑе должника",isDisabled:s?.isFirst,onChange:t=>{t&&(r((o?w:I)({key:"debtorId",value:t.value})),c())},isSearchable:!1}),n&&!m.debtorId&&e.jsx(S,{error:"ÐÑбеÑиÑе должника"})]}),e.jsxs("div",{className:"input-wrapper",children:[e.jsx(Z,{showTimeSelect:!0,selected:v,label:"ÐаÑа и вÑÐµÐ¼Ñ Ð¿ÑоведениÑ",dateFormat:G,timeFormat:"HH:mm",timeIntervals:15,timeCaption:"ÐÑемÑ",placeholderText:"дд.мм.гггг ÑÑ:мм",minDate:k,onChange:t=>{r((o?w:I)({key:"committeeTime",value:J(t)})),c()}}),n&&!m.committeeTime&&e.jsx(S,{error:"ÐаполниÑе даÑÑ"})]}),e.jsxs("div",{className:"input-wrapper",children:[e.jsx(be,{label:"ÐеÑÑо пÑоведениÑ",placeholder:"ÐеÑÑо пÑоведениÑ",value:m.address,onChange:t=>{r((o?w:I)({key:"address",value:t.currentTarget.value})),c()}}),n&&!m.address&&m.conductingMethod!==2&&e.jsx(S,{error:"ÐаполниÑе меÑÑо пÑоведениÑ"})]}),e.jsxs("div",{className:"select-wrapper",children:[e.jsx("label",{children:"СпоÑоб пÑоведениÑ"}),e.jsx(M,{styles:{menuPortal:t=>({...t,zIndex:9999}),menu:t=>({...t,zIndex:9999})},options:y,placeholder:"ÐÑбеÑиÑе ÑпоÑоб пÑоведениÑ",value:y.find(t=>t.value===m.conductingMethod)||null,onChange:t=>{t&&(r((o?w:I)({key:"conductingMethod",value:t.value})),c())},isSearchable:!1}),n&&!m.conductingMethod&&e.jsx(S,{error:"ÐÑбеÑиÑе ÑпоÑоб пÑоведениÑ"})]})]}),o?e.jsx(N,{value:"ÐодÑвеÑдиÑÑ",type:"submit",className:`creditors-edit__button ${D.committee_edit_create_button}`}):null]})})},Le="_common_question_10gy7_1",ye="_question_10gy7_14",T={common_question:Le,question:ye},Pe=()=>{const r=E(),a=F(),s=b(te),p=b(se),u=b(oe),d=b(ie),{id:o}=Q(),[_,x]=i.useState([]);i.useEffect(()=>{r(ae()),r(ne({id:o}))},[]),i.useEffect(()=>{x(s.map(C=>C.id))},[s]);const n=()=>{a(me({creditorCommitteeId:o,questions:_}))},[h,m]=i.useState(0);return i.useEffect(()=>{h&&n()},[h]),i.useEffect(()=>()=>{r(re())},[]),u||d?e.jsx($,{}):e.jsxs("form",{onSubmit:n,className:T.common_question,children:[p.length?e.jsx("h5",{children:"ÐопÑоÑÑ Ð¿Ð¾Ð²ÐµÑÑки днÑ"}):null,e.jsx("ul",{className:T.questions,children:p.map(({id:C,text:q})=>{const c=s.map(l=>l.id).includes(C);return e.jsxs("div",{className:T.question,children:[e.jsx(Se,{checked:c,questionId:C,setQuestion:x,setCheckBoxSubmit:()=>m(l=>l+1)}),e.jsx("span",{children:q})]},C)})})]})},Oe="_create_otherquestion_form_tmlm5_1",$e="_other_question_buttons_tmlm5_24",Be="_other_question_edit_buttons_tmlm5_34",Ae="_other_question_tmlm5_24",ze="_other_question_list_tmlm5_84",He="_other_question_item_tmlm5_109",Ve="_other_question_modal_tmlm5_113",Re="_modal_buttons_tmlm5_132",Ue="_checkmark_container_tmlm5_167",Xe="_checkmark_box_tmlm5_174",We="_checkmark_tmlm5_167",Ye="_other_question_container_tmlm5_196",j={create_otherquestion_form:Oe,other_question_buttons:$e,other_question_edit_buttons:Be,other_question:Ae,other_question_list:ze,other_question_item:He,other_question_modal:Ve,modal_buttons:Re,checkmark_container:Ue,checkmark_box:Xe,checkmark:We,other_question_container:Ye},Ze=()=>{const r=E(),a=F(),{id:s}=Q(),p=b(ce),[u,d]=i.useState(""),[o,_]=i.useState(!1),x=n=>{n.preventDefault(),u?(_(!1),a(le({creditorCommitteeId:s,question:u})),d("")):_(!0)};return i.useEffect(()=>{r(de({creditorCommitteeId:s}))},[]),e.jsxs("div",{className:j.other_question,children:[e.jsx("h5",{children:"Свои вопÑоÑÑ"}),e.jsx("ul",{className:j.other_question_list,children:p?.length?p.map(({id:n,question:h},m)=>e.jsx(Ge,{questionId:n,question:h,index:m},n)):e.jsx("span",{children:"ÐÐµÑ ÑвоиÑ
вопÑоÑов"})}),e.jsxs("form",{className:j.create_otherquestion_form,onSubmit:x,children:[e.jsx("label",{children:"ÐÐ°Ñ Ð²Ð¾Ð¿ÑоÑ"}),e.jsx("textarea",{value:u,onChange:n=>d(n.target.value)}),e.jsx("div",{className:j.other_question_buttons,children:e.jsx(N,{value:"ÐобавиÑÑ Ð²Ð¾Ð¿ÑоÑ",type:"submit",className:"creditors-edit__button"})}),o&&!u&&e.jsx(S,{error:"ÐведиÑе вопÑоÑ"})]})]})},Ge=({question:r,questionId:a,index:s})=>{E();const p=F(),[u,d]=i.useState(!1),[o,_]=i.useState(!1),{id:x}=Q(),[n,h]=i.useState("");i.useEffect(()=>{h(r)}
1,[]);const m=()=>()=>{p(_e({creditorCommitteeId:x,questionId:a})),d(!1)},C=()=>()=>{n.length?(_(!1),p(ue({creditorCommitteeId:x,questionId:a,question:{id:a,text:n}})),c(!1)):_(!0)},[q,c]=i.useState(!1),[l,g]=i.useState(!1);return e.jsxs("li",{className:j.other_question_item,children:[q?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsxs("label",{children:["ÐÐ°Ñ Ð²Ð¾Ð¿ÑÐ¾Ñ ",s+1]}),e.jsx("textarea",{value:`${n}`,onChange:v=>{h(v.currentTarget.value)}}),o&&e.jsx(S,{error:"ÐведиÑе вопÑоÑ"})]}),e.jsxs("div",{className:j.other_question_edit_buttons,children:[e.jsx(N,{type:"button",value:"УдалиÑÑ",onClick:()=>d(!0),className:j.other_question_button}),e.jsx(N,{type:"button",value:"СоÑ
ÑаниÑÑ",onClick:C(),className:j.other_question_button})]})]}):e.jsxs("div",{className:j.other_question_container,onMouseOver:()=>g(!0),onMouseLeave:()=>g(!1),children:[e.jsx("div",{className:j.checkmark_container,children:e.jsx("div",{className:j.checkmark_box,children:e.jsx("div",{className:j.checkmark})})}),e.jsx("div",{children:n}),l&&e.jsx(Qe,{onClick:()=>c(!0)})]}),u&&e.jsxs("div",{className:j.other_question_modal,children:[e.jsx("h1",{children:"ÐÑ Ð´ÐµÐ¹ÑÑвиÑелÑно Ñ
оÑиÑе ÑдалиÑÑ ÑÑÐ¾Ñ Ð²Ð¾Ð¿ÑоÑ?"}),e.jsxs("div",{className:j.modal_buttons,children:[e.jsx(N,{value:"ÐодÑвеÑдиÑÑ",onClick:m()}),e.jsx(N,{value:"ÐÑмена",onClick:()=>d(!1)})]})]})]})},Je=({title:r})=>{E();const a=F(),s=b(he),{id:p}=Q(),[u,d]=i.useState([]),o=b(O);i.useEffect(()=>{o?.documents?.length&&d(o.documents)},[o?.documents]);const _=async c=>{let l=c.target.files;if(l){const g=new FormData;Array.from(l).forEach(k=>{k.size&&g.append("file",k)});const v=await a(pe({creditorCommitteeId:p,documents:g})).unwrap();d(k=>[...k,...v])}},[x,n]=i.useState(!1),[h,m]=i.useState(null),C=(c,l)=>()=>{m(c),n(l==="mouseOver")},q=c=>async()=>{await a(xe({documentId:c})),d(u.filter(l=>l.id!==c))};return e.jsxs("div",{className:"add-document-form",children:[r&&e.jsx("h5",{children:r}),e.jsxs("div",{className:"add-document-form-inputs",children:[e.jsxs("div",{className:"add-document-input-wrapper",children:[e.jsx(we,{onChange:_}),s?e.jsx(Ee,{progress:s}):null]}),e.jsx("ul",{className:"file-list",children:u&&u.map((c,l)=>e.jsx("li",{className:"file-item",children:e.jsxs("div",{className:"file-wrap",onMouseEnter:C(l,"mouseOver"),onMouseLeave:C(l,"mouseLeave"),children:[e.jsx("span",{className:"input-file-text",children:c.fileName}),e.jsx(Ie,{onClick:q(c.id),className:x&&h===l?"input-file-svg-active":""})]})},c.id))})]})]})},Ke="_committee_edit_create_1jhuq_1",et="_committee_edit_create__buttons_1jhuq_6",tt="_committee_edit_create_button_1jhuq_27",st="_danger_1jhuq_40",ot="_publish_1jhuq_52",it="_committee_edit_create_title_1jhuq_57",at="_committee_edit_create_menu_step_1jhuq_61",nt="_committee_edit_create_message_1jhuq_65",rt="_committee_edit_create_addloader_1jhuq_75",f={committee_edit_create:Ke,committee_edit_create__buttons:et,committee_edit_create_button:tt,danger:st,publish:ot,committee_edit_create_title:it,committee_edit_create_menu_step:at,committee_edit_create_message:nt,committee_edit_create_addloader:rt};function Et(){const r=P(),{id:a}=Q(),s=a==="create",p=E(),u=L(fe),[d,o]=i.useState(!1),[_,x]=i.useState(!1),n=()=>{x(!_)},m=L(O)?.message;return e.jsx(qe,{children:e.jsxs(A,{type:"section",className:f.committee_edit_create,children:[e.jsxs(z,{type:"div",className:f.committee_edit_create_menu,toggle:_,children:[e.jsxs("div",{className:f.committee_edit_create_title,children:["ÐÑÐ°Ð¿Ñ ÑÐ¾Ð·Ð´Ð°Ð½Ð¸Ñ ",e.jsx("br",{}),"комиÑеÑа кÑедиÑоÑов"]}),e.jsxs("div",{className:f.committee_edit_create_menu_steps,children:[e.jsx("div",{className:f.committee_edit_create_menu_step,children:"1. ÐаÑа, меÑÑо и ÑпоÑоб пÑÐ¾Ð²ÐµÐ´ÐµÐ½Ð¸Ñ ÐºÐ¾Ð¼Ð¸ÑеÑа кÑедиÑоÑов"}),s?null:e.jsxs(e.Fragment,{children:[e.jsx("div",{className:f.committee_edit_create_menu_step,children:"2. ÐопÑоÑÑ Ð¿Ð¾Ð²ÐµÑÑки Ð´Ð½Ñ / ÐнÑе вопÑоÑÑ"}),e.jsx("div",{className:f.committee_edit_create_menu_step,children:"3. ÐÑллеÑÐµÐ½Ñ Ð´Ð»Ñ Ð³Ð¾Ð»Ð¾ÑованиÑ"})]})]}),e.jsx(N,{className:"page-filters-button page-filters-create",type:"button",value:"Ðазад",onClick:()=>r(-1)})]}),e.jsxs("div",{children:[e.jsx(H,{title:s?"Создание комиÑеÑа кÑедиÑоÑов":"РедакÑиÑование комиÑеÑа кÑедиÑоÑов",handleShowFilters:n,toggle:_}),e.jsxs("div",{className:f.committee_edit_create_message,children:[s?null:e.jsx(Ne,{status:m?.status}),e.jsx(Me,{}),s?null:e.jsxs(e.Fragment,{children:[e.jsx(Pe,{}),e.jsx(Ze,{}),e.jsx(Je,{title:"ÐокÑменÑÑ"})]}),s?null:e.jsxs(e.Fragment,{children:[u?e.jsx("div",{className:f.committee_edit_create_addloader,children:e.jsx(V,{})}):e.jsx(ke,{status:m?.status,messageId:m?.id,onDelete:()=>o(!0),className:f.committee_edit_create__buttons,buttonClassName:`${f.committee_edit_create_button} ${f.publish}`,dangerButtonClassName:`${f.committee_edit_create_button} ${f.danger}`}),d?e.jsx(Ce,{title:"ÐÑ Ð´ÐµÐ¹ÑÑвиÑелÑно Ñ
оÑиÑе ÑдалиÑÑ ÐºÐ¾Ð¼Ð¸ÑÐµÑ ÐºÑедиÑоÑов?",hidePopup:()=>o(!1),confirm:()=>{p(je({id:a})).then(()=>{r("/hub/publications")})},confirmButtonText:"ÐодÑвеÑдиÑÑ",children:"ÐÑи подÑвеÑждении вÑе даннÑе бÑдÑÑ Ð±ÐµÐ·Ð²Ð¾Ð·Ð²ÑаÑно ÑдаленÑ"}):null]})]})]})]})})}export{Et 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.