1import{j as e,n as s}from"./chunk-CHPXP26E.js";import{r as a,aH as i,v as t,l,ap as r,t as c,Z as n,X as o,Y as d,ag as m,au as h,aP as u,f as p,aL as j,H as f,E as x,av as v,aw as k,aU as N,s as g,I as F,aF as C,R as I}from"./chunk-BIodJjId.js";import{f as y}from"./chunk-BxDgbgO6.js";import{t as D,f as P,c as w,h as $}from"./chunk-CXVmiye8.js";import{b,t as A}from"./chunk-C_NABtUk.js";import{I as E}from"./chunk-xhCkp7uf.js";import{B as L,a as R,I as S}from"./chunk-Dkjvrxnc.js";import{I as M}from"./chunk-Bn3d7APC.js";import{C as T}from"./chunk-DV-uny7W.js";import{E as z}from"./chunk-CZd-ntFb.js";import{L as H}from"./chunk-pihgsDCE.js";import{M as O}from"./chunk-BDJ2Ymne.js";import{I as V}from"./chunk-CO9260Ij.js";import{T as _}from"./chunk-BmtH2H7W.js";import{C as B}from"./chunk-BlbsXjoI.js";import{A as G}from"./chunk-DDg9XFPU.js";import{P as U}from"./chunk-BKyvjiI-.js";import{D as X}from"./chunk-DZWo-pST.js";import{t as Y}from"./chunk-CXS5uJci.js";import"./chunk-BhLMWRjL.js";import"./chunk-CojTAV5g.js";import"./chunk-DTT7mcVr.js";import"./chunk-DteGiL4r.js";import"./chunk-CQ7VT7aW.js";import"./chunk-Dr5piOmZ.js";import"./chunk-wgvU54-3.js";import"./chunk-xtG4Eayc.js";import"./chunk-DjrCYCQI.js";import"./chunk-Dt7fLkyA.js";import"./chunk-CAH_cikb.js";import"./chunk-DYycXddY.js";import"./chunk-BZdPK2Gl.js";import"./chunk-BLZMmKYD.js";import"./chunk-c8iSlhlM.js";import"./chunk-CZkF0E3J.js";import"./chunk-_F9124nm.js";import"./chunk-I3GkG-TK.js";import"./chunk-CeFMUgER.js";import"./chunk-jAowUkwz.js";import"./chunk-B9kWNVmC.js";import"./chunk-oN8PVRr9.js";import"./chunk-j_zEfePq.js";import"./chunk-lHMmHsTf.js";import"./chunk-Bptc359o.js";import"./chunk-Biqc47oa.js";import"./chunk-D8A3YXSB.js";import"./chunk-PKaWmY92.js";import"../entries/src_pages.ajikvuZU.js";import"./chunk-d5pl6CS0.js";import"./chunk-CrgSjA09.js";/* empty css */import"./chunk-CcTU0fVx.js";import"./chunk-eu5b1ctJ.js";import"./chunk-CSI5KBb8.js";import"./chunk-Qk1d1bsQ.js";import"./chunk-BUBHVWjm.js";const J=a.forwardRef(({size:s=20,color:a=L,...i},t)=>e.jsxs("svg",{ref:t,width:s,height:s,viewBox:"0 0 512 512",fill:a,...i,children:[e.jsx("path",{d:"M358 105h96c4 0 6-3 6-6 0-9-3-17-10-23L368 8c-6-4-15-7-23-7-4 0-7 4-7 7v78c0 11 9 19 20 19z"}),e.jsx("path",{d:"M310 86V0H171c-19 0-35 15-35 34v358c0 19 15 34 34 34h256c19 0 34-15 34-34V133H358c-26 0-48-21-48-47z"}),e.jsx("path",{d:"M107 422V69H86c-19 0-34 15-34 34v375c0 18 15 34 34 34h272c19 0 35-16 35-34v-22H142c-20-1-35-15-35-34z"})]})),Z="xtZrfkuD",q="evbAXWJL",Q="cwA8pnBc",K="_6mcuL25p",W="cDrcf8t5",ee="nPnVX5-l",se="l3a6uvHw",ae="_8lfs8rbT",ie="TRNwUAZm",te="RQDQ5Ooh",le="JNVXZ02-",re="MODSFh3t",ce="A6cLyI-f",ne="xvU3mDBc",oe="AHvSzCkG",de="_9OqemiUF",me="gMoy-ih1",he="hTgbuRfN",ue="J2sr8TKo",pe="JASEoAOh",je="TWznFpeV",fe="jF1-FXuS",xe=i(e=>{const s=u(e),{year:a}=p(e),{groups:i,plants:t}=j(e),{isLoadingFieldImages:l,selectedField:r={}}=f(e),{isLoading:c,isCropHistoryLoading:n}=x(e),o=v(e),d=k(e);return{year:a,groups:i,plants:t,fields:s,aiCultures:N(e),selectedCrop:d,selectedField:r,infoFarmSelected:o,root:g(e).root,isLoading:c||l||n}},{navigate:s,addError:I,cropDelete:$,cropSetMeta:w,showCropModal:P,setFieldsStep:C,toggleFarmInfo:A,selectFarmInfoFields:b,toggleCropGeneration:D})(({year:s,root:i,groups:u,plants:p,fields:j,navigate:f,addError:x,isLoading:v,cropDelete:k,aiCultures:N,cropSetMeta:g,selectedCrop:C,setFieldsStep:I,showCropModal:D,toggleFarmInfo:P,infoFarmSelected:w,toggleCropGeneration:$,selectFarmInfoFields:b})=>{const{t:A}=t(),L=l(r),xe=a.useRef(!0);a.useEffect(()=>(xe.current=!0,()=>{xe.current=!1}),[]);const[ve,ke]=a.useState(!0),[Ne,ge]=a.useState(!1),[Fe,Ce]=a.useState(""),[Ie,ye]=a.useState(!1),De=a.useRef(null),{farmInfoFieldsUpdated:Pe=[],culturesItems:we}=w||{},$e=e=>{xe.current&&ge(e)},be=e=>{xe.current&&ke(e)},Ae=e=>a=>{a.stopPropagation();const t=j?.find(s=>s?.fieldId===e?.fieldId);t&&(D?.(!1),P?.(w?.id,!1),f?.(`${i}${s}/${e.farmId}/${t.fieldId}/${Y(F.VEGETATION)}`),I?.(m.FIELD_INFO))},Ee=(e,s)=>()=>{const a=p?.find(s=>s.id===e?.plant?.id||e?.breed?.plant?.id);if(a?.id){$e(!0);const i=u?.find(e=>e.id===a?.group?.id),t=h(e)||"-";y.API_PLANT_BREEDS({plantId:a.id,name:t}).then(t=>{if(!xe.current)return;const l=t.find(e=>e.plant.id===a.id);g?.({...C,...e,...void 0===l?{}:{breed:l},...void 0===a?{}:{plant:a},...void 0===i?{}:{group:i}}),b?.([s]),be(!0),$e(!1)}).catch(e=>{xe.current&&($e(!1),x?.("Ðе найден ÑоÑÑ!",e,1e3))})}else x?.("Ðе найден ÑоÑÑ!",void 0,1e3)},Le=e=>{if(e&&e?.year)return e.year()>s||e.year()<s-1?e.set("year",s).valueOf():e.valueOf()}
1,Re=(e,s)=>e?X(e,"DD.MM.YYYY"):s?A("внеÑÑи"):"",Se=s=>a=>e.jsx(o,{className:oe,checked:a,text:s.name,style:{color:d(s.fieldId)}},s.fieldId),Me=a.useMemo(()=>c(w?.fields).filter(e=>!Fe||new RegExp(Fe,"gi").test(e.name)).map(e=>({id:e.fieldId,area:e.area,text:e.name,render:Se(e),field:e})).sort((e,s)=>s.area-e.area),[Fe,w?.id,w?.fields]);return a.useEffect(()=>()=>{De.current=null},[]),e.jsxs("div",{className:Z,children:[e.jsxs("div",{className:Q,id:"cropEditElement",children:[e.jsxs("div",{className:K,ref:De,onClick:()=>be(e=>!e),children:[e.jsx("span",{children:`${A("УкажиÑе ÑевообоÑÐ¾Ñ Ð´Ð»Ñ Ð¿Ð¾Ð»Ñ Ð¸Ð»Ð¸ гÑÑÐ¿Ð¿Ñ Ð¿Ð¾Ð»ÐµÐ¹")} ${Pe?.length?`(${Pe?.length})`:""}`}),e.jsx(E,{className:n(me,ve&&he),size:10})]}),e.jsx(R,{view:"link",onClick:()=>$?.(!0),children:A("ÐвÑомаÑиÑеÑÐºÐ°Ñ Ð³ÐµÐ½ÐµÑаÑÐ¸Ñ ÑевообоÑоÑа")})]}),e.jsxs("div",{className:n(W,ve&&ee),style:{gridTemplateColumns:Pe.length?"250px 250px auto":"60px 250px auto"},children:[e.jsxs("div",{className:ue,children:[e.jsx(V,{multi:!0,arrow:!0,hint:A("Ðоле"),parent:De,disabled:v||Ne,autocomplete:e=>{Ce(e),b?.(void 0)},value:Pe,searchText:A("ÐоиÑк полÑ"),selectAllText:A(Ie?"СнÑÑÑ Ð²Ñделение":"ÐÑделиÑÑ Ð²Ñе полÑ"),selectAllFunc:()=>{var e;e=e=>(b?.(e?void 0:Me),!e),xe.current&&ye(e)},items:Me,onChange:b}),e.jsx("div",{className:pe,children:e.jsx("div",{className:je,children:Pe.map(s=>e.jsxs("div",{className:fe,style:{background:d(s.id)},children:[s.text,e.jsx(R,{view:"link",disabled:v||Ne,icon:e.jsx(S,{color:"var(--background)",size:8}),onClick:()=>{b?.(Pe.filter(e=>
1e.id!==s.id))}})]},`${s?.id}-${s?.text}`))})})]}),e.jsx("div",{className:se,children:e.jsx(U,{})}),e.jsx("div",{className:se,children:e.jsxs("div",{className:ae,children:[e.jsxs("div",{className:le,children:[e.jsx("div",{className:ie,children:A("Сев")}),e.jsx("div",{className:n(re,v&&ce),children:e.jsx(T,{icon:null,input:!0,clear:!0,placeholder:A("Ðлан"),className:ne,value:C?.plantDatePlan,hint:Re(C?.plantDatePlan,!0),onChange:e=>g?.({...C,plantDatePlan:Le(e)})})}),e.jsx("div",{className:n(re,v&&ce),children:e.jsx(T,{icon:null,input:!0,clear:!0,className:ne,placeholder:A("ФакÑ"),value:C?.plantDateFact,hint:Re(C?.plantDateFact,!0),onChange:e=>g?.({...C,plantDateFact:Le(e)})})})]}),e.jsxs("div",{className:le,children:[e.jsx("div",{className:ie,children:A("УбоÑка")}),e.jsx("div",{className:n(re,v&&ce),children:e.jsx(T,{icon:null,input:!0,clear:!0,className:ne,placeholder:A("Ðлан"),value:C?.harvestDatePlan,hint:Re(C?.harvestDatePlan,!0),onChange:e=>g?.({...C,harvestDatePlan:Le(e)})})}),e.jsx("div",{className:n(re,v&&ce),children:e.jsx(T,{icon:null,input:!0,clear:!0,className:ne,placeholder:A("ФакÑ"),value:C?.harvestDateFact,hint:Re(C?.harvestDateFact,!0),onChange:e=>g?.({...C,harvestDateFact:Le(e)})})})]}),e.jsxs("div",{className:n(le),children:[e.jsx("div",{className:ie,children:A("УÑожай")}),e.jsx("div",{className:re}),e.jsx("div",{className:re})]}),e.jsxs("div",{className:le,children:[e.jsxs("div",{className:n(ie,te),children:[A("РпеÑвонаÑалÑном опÑиÑ
одованном веÑе"),":"]}),e.jsx("div",{className:n(re,v&&ce),children:e.jsx(z,{max:4,clear:!0,isNumber:!0,placeholder:A("внеÑÑи"),className:ne,after:C?.yieldPlanRaw?A("Ñ/Ðа"):"",value:C?.yieldPlanRaw||"",onChange:e=>g?.({...C,yieldPlanRaw:e})})}),e.jsx("div",{className:n(re,v&&ce),children:e.jsx(z,{max:4,clear:!0,isNumber:!0,placeholder:A("внеÑÑи"),className:ne,after:C?.yieldFactRaw?A("Ñ/Ðа"):"",value:C?.yieldFactRaw||"",onChange:e=>g?.({...C,yieldFactRaw:e})})})]}),e.jsxs("div",{className:le,children:[e.jsxs("div",{className:n(ie,te),children:[A("РвеÑе поÑле доÑабоÑки"),":"]}),e.jsx("div",{className:n(re,v&&ce),children:e.jsx(z,{max:4,clear:!0,isNumber:!0,placeholder:A("внеÑÑи"),className:ne,after:C?.yieldPlanProcessed?A("Ñ/Ðа"):"",value:C?.yieldPlanProcessed||"",onChange:e=>g?.({...C,yieldPlanProcessed:e})})}),e.jsx("div",{className:n(re,v&&ce),children:e.jsx(z,{max:4,clear:!0,isNumber:!0,placeholder:A("внеÑÑи"),className:ne,after:C?.yieldFactProcessed?A("Ñ/Ðа"):"",value:C?.yieldFactProcessed||"",onChange:e=>g?.({...C,yieldFactProcessed:e})})})]})]})})]}),e.jsxs("div",{className:q,children:[e.jsx(H,{items:c(we)}),e.jsx(O,{items:c(we),names:!0})]}),N&&e.jsxs("div",{className:q,children:[e.jsx(H,{title:A("ÐÑлÑÑÑÑÑ Ð¾Ð¿ÑеделеннÑе ÐÐ"),items:N}),e.jsx(O,{items:N,names:!0})]}),e.jsx(_,{disabled:v,name:"croprotations",title:[`${A("Ðоле")}#`,`${A("СÑаÑÑÑ")}#`,`${A("ÐаÑ")}#`,`${A("Тип")}#`,`${A("ÐÑлÑÑÑÑа")}#`,`${A("СоÑÑ")}#`,`${A("ÐаÑа Ñева (план)")}#`,`${A("ÐаÑа Ñева (ÑакÑ)")}#`,""],lines:c(we).reduce((e,s)=>[...e,...s.fields.map(e=>({...e,cultureName:s?.cultureName}))],[]).map(s=>{const a=s?.foundCrop||{};return[...[{component:e.jsx(G,{field:s,onClick:Ae(s)}),value:s?.name},a?.status?.title||"-",a?.fallow?.title||"-",a?.cropType?.title||"-",{component:e.jsx(B,{field:s,crop:a,fallowsList:L,acceptAi:!0,onAddAICulture:()=>b?.(),onAddCulture:()=>{const e=Me.find(e=>e?.id===s?.fieldId),a=Pe.filter(s=>s.id!==e?.id);if(e){b?.([...a,e]);const s=document.getElementById("cropEditElement");s&&s.scrollIntoView({behavior:"smooth"})}}},a?a.id:`${s.fieldId}`),value:`${a?.id?a?.plant?.name||a?.detectedPlant?.name:s?.name}`},a?.breed?.name||a?.breedName||"-",Re(a?.plantDatePlan),Re(a?.plantDateFact)],e.jsxs("div",{className:de,children:[e.jsx(R,{view:"link",icon:e.jsx(J,{size:18}),onClick:Ee(a,s)}),e.jsx(R,{view:"link",icon:e.jsx(M,{size:18}),onClick:()=>{b?.(void 0),k?.(a.id,s)}})]},`buttons-${s.fieldId}`)]})})]})});export{xe 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.