1"use strict";(globalThis.webpackChunkfarmdeck=globalThis.webpackChunkfarmdeck||[]).push([[2861],{83941(e,t,l){l.d(t,{A:()=>p});var i=l(27565),n=l(72720),a=l.n(n),r=l(8547),s=l(27929);const o=i.memo(e=>{const{percent:t,step:l,strokeWidth:i=8,strokeColor:n,trailColor:a="rgba(0,0,0,0.1)",style:r,className:o}=e,{pathString:d,trailPathStyle:c,strokePathStyle:m}=function(e){const{percent:t,strokeWidth:l=5,gapDegree:i=12}=e,n=50-l/2,a=0,r=-2*n,s=`M 50,50 m 0,${-n}\n a ${n},${n} 0 1 1 ${a},${-r}\n a ${n},${n} 0 1 1 ${-a},${r}`,o=2*Math.PI*n,d={strokeDasharray:`${o-i}px ${o}px`,strokeDashoffset:`-${i/2}px`,transition:"stroke-dashoffset 3s ease 0s, stroke-dasharray 3s ease 0s, stroke 3s"},c={strokeDasharray:`${t/100*(o-i)}px ${o}px`,strokeDashoffset:`-${i/2}px`,transition:"stroke-dashoffset 3s ease 0s, stroke-dasharray 3s ease 0s, stroke 3s"};return{pathString:s,trailPathStyle:d,strokePathStyle:c}}({percent:t,strokeWidth:i});return(0,s.jsxs)("svg",{className:`react-sweet-progress-circle ${o}`,viewBox:"0 0 100 100",style:r,children:[(0,s.jsx)("path",{className:"trail",d:d,stroke:a,strokeWidth:i,fillOpacity:"0",style:c}),(0,s.jsx)("path",{className:"path",d:d,stroke:n||u(t),strokeWidth:i,fillOpacity:"0",style:m}),(0,s.jsx)("text",{x:"50%",y:"50%",dominantBaseline:"middle",textAnchor:"middle",style:{fontSize:"24px"},children:l})]})}),d=e=>{if(null!==e&&void 0!==e&&e.wrapper&&"object"===typeof(null===e||void 0===e?void 0:e.wrapper)){const t=e.wrapper;return"span"===t.type?(0,s.jsx)("span",{...t.props,children:"Something"}):(0,s.jsx)("div",{...t.props,...t.style,children:(0,s.jsx)(o,{})})}return(0,s.jsx)(o,{...e})},c=i.memo(d,(e,t)=>a()(e,t));function u(e){switch(!0){case e<=25:return"#e76f51";case e<=50:return"#f4a261";case e<=75:return"#e9c46a";default:return"#2a9d8f"}}const m=({active:e,steps:t})=>{const{t:l}=(0,r.B)();return(0,s.jsxs)("div",{className:"d-flex mb-16",children:[(0,s.jsx)(c,{className:"mr-16",percent:(e+1)/(null===t||void 0===t?void 0:t.length)*100,status:"success",style:{width:"40px",height:"40px"},step:l("3083",{current:e+1,total:null===t||void 0===t?void 0:t.length})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{style:{fontSize:"18px"},children:(0,s.jsx)("strong",{children:t[e]})}),(0,s.jsx)("div",{style:{fontSize:"10px"},children:e+1<(null===t||void 0===t?void 0:t.length)?l("3084",{nextStepName:t[e+1]}):l("1267")})]})]})},p=i.memo(m,(e,t)=>a()(e,t))},80763(e,t,l){l.d(t,{A:()=>u});var i=l(45435),n=l(57340),a=l(72720),r=l.n(a),s=l(27565),o=l(47135),d=l(27929);const c=e=>{const{acceptOnChange:t,className:l,onChange:a,onChangeInControl:r,defaultValue:c,tabs:u,disabled:m}=e,[p,v]=s.useState(0),h=(0,o.useMediaQuery)({maxWidth:768});(0,s.useEffect)(()=>{null!==c&&void 0!==c&&v(c)},[c]);return p<0?(0,d.jsx)(d.Fragment,{}):(0,d.jsx)("div",{className:`material-tabs ${l}`,children:(0,d.jsx)("div",{className:"tabs d-flex-dir-c",children:(0,d.jsx)(n.A,{value:p,onChange:(e,l)=>{r&&a?a({id:l,key:u[l]}):!1===t&&l>p||(v(l),a&&a({id:l,key:u[l]}))},variant:"scrollable",scrollButtons:h?"on":"auto",children:Object.keys(u).map(e=>(0,d.jsx)(i.A,{label:u[e],className:"text-no-wrap",disabled:m},u[e]))})})})},u=s.memo(c,(e,t)=>r()(e,t))},16754(e,t,l){l.d(t,{A:()=>d});l(27565);var i=l(89738),n=l(65603),a=l(49204),r=l(87152),s=l(41593),o=l(27929);const d=function(e){const t=e.itemConfig||!1;return e.items&&e.items.map?(0,o.jsxs)(i.A,{className:e.className,fullWidth:!0,style:e.style,children:[e.label&&(0,o.jsx)(a.A,{htmlFor:e.label,children:e.label.toUpperCase()}),(0,o.jsx)(n.A,{value:e.value,onChange:e.onChange(e.dataKey||e.label),inputProps:{name:e.label,id:e.label},children:e.items.map(l=>t?(0,o.jsx)(r.A,{value:l[e.itemConfig.value],children:l[e.itemConfig.text]},l[e.itemConfig.value]):(0,o.jsx)(r.A,{value:l,children:l},l)),required:!0,disabled:e.disabled,...e.selectProps}),e.error&&(0,o.jsx)(s.A,{className:"input-error",children:"Error"})]}):null}},29399(e,t,l){l.r(t),l.d(t,{default:()=>h});var i=l(14508),n=l(27565),a=l(8547),r=l(73933),s=l(6599),o=l(89823),d=l(77262),c=l(91462),u=l(21634),m=l(77018),p=(l(82458),l(27929));function v(e){const{account:t,dispatch:l,farm:v,isEdit:h,onClose:x,show:f,tenant:y}=e||{}
1,{assetParams:w,edit:g,paddock:b,record:j,title:N}=f||{};console.log("-----\x3e> event",g),console.log(j);const{t:k}=(0,a.B)(),[A,S]=(0,n.useState)(g&&j||null!==j&&void 0!==j&&j.new?j:{new:{}}),[T,C]=(0,n.useState)(0),$=e=>{const t=n.useRef(void 0);return(0,r.d4)(l=>{const i=e(l);var n;return(void 0===t.current||(n=t.current,Array.isArray(n)&&0===n.length&&Array.isArray(i)&&i.length>0))&&(t.current=i),t.current},r.bN)},L=$(e=>{var t,l,i;return null!==(t=null===e||void 0===e||null===(l=e.paddocks)||void 0===l||null===(i=l.data)||void 0===i?void 0:i.items)&&void 0!==t?t:[]}),D=$(e=>{var t,l,i;return null!==(t=null===e||void 0===e||null===(l=e.assets)||void 0===l||null===(i=l.data)||void 0===i?void 0:i.items)&&void 0!==t?t:[]}),M=($(e=>{var t,l,i,n;return null!==(t=null===e||void 0===e||null===(l=e.livestock)||void 0===l||null===(i=l.enumItems)||void 0===i||null===(n=i.data)||void 0===n?void 0:n.items)&&void 0!==t?t:[]}),(0,n.useMemo)(()=>(D||[]).filter(e=>{var t;return"chemicalProduct"===e.type&&"Agricultural"===(null===e||void 0===e||null===(t=e.detail)||void 0===t?void 0:t.type)}),[D])),P=(0,n.useMemo)(()=>(D||[]).filter(e=>"machinery"===e.type),[D]),F=(0,n.useMemo)(()=>(L||[]).map(e=>({value:e.id,label:e.name})),[L]),B=(0,n.useMemo)(()=>(M||[]).map(e=>({value:e.id,label:e.name})),[M]),I=(0,n.useMemo)(()=>(P||[]).map(e=>({value:e.id,label:e.name})),[P]),W=(0,n.useMemo)(()=>m.G.map(e=>({value:e.id,label:e.id})),[]),E=(0,n.useMemo)(()=>({s1242:k("1242"),s1245:k("1245"),s1283:k("1283"),s1284:k("1284"),s1285:k("1285"),s1527:k("1527"),f1291:k("1291"),f1292:k("1292"),f1293:k("1293"),f1303:k("1303"),f1305:k("1305"),f1278:k("1278"),f1297:k("1297"),f1279:k("1279"),f1306:k("1306"),f1314:k("1314"),f1043:k("1043"),f1042:k("1042"),f1040:k("1040"),f1298:k("1298"),g1282:k("1282"),g1301:k("1301"),g1276:k("1276"),f1529:k("1529"),f1511:k("1511"),f1526:k("1526")}),[k]),O=(0,n.useMemo)(()=>({time:{sLabel:E.s1242,iconClass:"fad fa-clock mr-8",fields:[{inputType:"DatePicker",fieldLabel:E.f1291,key:"timestamp",required:!0},{inputType:"TimePicker",fieldLabel:E.f1292,key:"new.startTime",required:!0},{inputType:"TimePicker",fieldLabel:E.f1293,key:"new.finishTime",required:!0},{inputType:"TextArea",fieldLabel:E.s1245,key:"new.other",multiline:!0,minRows:2}]},eventDetails:{sLabel:E.s1283,iconClass:"fad fa-usd-circle mr-8",fields:[{inputType:"MultiSelect",fieldLabel:E.f1303,key:"new.paddocks",options:F,required:!0},{inputType:"Select",fieldLabel:E.f1305,key:"new.productId",options:B,required:!0},{inputType:"Select",fieldLabel:E.f1278,key:"new.setupId",options:I},{inputType:"Text",fieldLabel:E.f1297,key:"new.cropType"},{inputType:"Number",fieldLabel:E.f1279,key:"new.productAmount",type:"number"},{inputType:"Number",fieldLabel:E.f1314,key:"new.whp",type:"number"}]},weather:{sLabel:E.s1284,iconClass:"fad fa-cloud-sun mr-8",fields:[{inputType:"Number",fieldLabel:E.f1043,key:"new.windSpeed",type:"number"},{inputType:"Select",fieldLabel:E.f1042,key:"new.windDirection",options:W},{inputType:"Number",fieldLabel:E.f1040,key:"new.temperature",type:"number"},{inputType:"Number",fieldLabel:E.f1298,key:"new.humidity",type:"number",min:0,max:100}]},contacts:{sLabel:E.s1285,iconClass:"fad fa-users mr-8",fields:[{groupLabel:E.g1282,fields:[{inputType:"Text",fieldLabel:E.f1529,key:"new.applicatorName"},{inputType:"Text",fieldLabel:E.f1511,key:"new.applicatorEmail",type:"email"},{inputType:"Text",fieldLabel:E.f1526,key:"new.applicatorPhone",type:"tel"}]},{groupLabel:E.g1301,fields:[{inputType:"Text",fieldLabel:E.f1529,key:"new.supervisorName"},{inputType:"Text",fieldLabel:E.f1511,key:"new.supervisorEmail",type:"email"},{inputType:"Text",fieldLabel:E.f1526,key:"new.supervisorPhone",type:"tel"}]},{groupLabel:E.g1276,fields:[{inputType:"Text",fieldLabel:E.f1529,key:"new.clientName"},{inputType:"Text",fieldLabel:E.f1511,key:"new.clientEmail",type:"email"},{inputType:"Text",fieldLabel:E.f1526,key:"new.clientPhone",type:"tel"}]}]}}),[E,F,B,I,W]),R=(0,n.useMemo)(()=>Object.entries(O).map(([e,t])=>({key:e,label:t.sLabel,fields:t.fields})),[O]),q=(0,n.useCallback)((e,t)=>{if(e&&"string"===typeof e){if("new.paddocks"===e){const l=(Array.isArray(t)?t:[]).map(e=>Number(e));let n=0;
1return l.forEach(e=>{const t=L.find(t=>t.id===e);null!==t&&void 0!==t&&t.area&&(n+=t.area/1e4)}),void S(t=>(0,i.Fs)((0,i.Fs)(t,"new.areaSize",n),e,l))}S(l=>(0,i.Fs)(l,e,t))}},[L]),z=(0,n.useCallback)((e,t)=>{var l;const{inputType:i,key:n}=e;if("DatePicker"===i||"TimePicker"===i){var a;const e=null===t||void 0===t||null===(a=t.target)||void 0===a?void 0:a.value;return void q(n,e||null)}if("MultiSelect"===i){const e=null===t||void 0===t?void 0:t.target,l=Array.from((null===e||void 0===e?void 0:e.selectedOptions)||[],e=>e.value);return void q(n,l)}var r,s;if("Select"===i)return void q(n,null!==(r=null===t||void 0===t||null===(s=t.target)||void 0===s?void 0:s.value)&&void 0!==r?r:null);const o=null===t||void 0===t||null===(l=t.target)||void 0===l?void 0:l.value;q(n,"number"===e.type?""===o?"":Number(o):o)},[q]),V=(0,n.useCallback)((e,t)=>{var l;const n=null!==(l=(0,i.LJ)(t,e.key))&&void 0!==l?l:"",a=e=>{if(!e)return"";try{const t="string"===typeof e?new Date(e):e;if(Number.isNaN(null===t||void 0===t?void 0:t.getTime()))return"";const l=t.getFullYear(),i=String(t.getMonth()+1).padStart(2,"0");return`${l}-${i}-${String(t.getDate()).padStart(2,"0")}`}catch{return""}},r=e=>{if(!e)return"";try{if("string"===typeof e&&/^\d{2}:\d{2}$/.test(e))return e;const t="string"===typeof e?new Date(e):e;if(Number.isNaN(null===t||void 0===t?void 0:t.getTime()))return"";const l=String(t.getHours()).padStart(2,"0");return`${l}:${String(t.getMinutes()).padStart(2,"0")}`}catch{return""}};switch(e.inputType){case"DatePicker":return(0,p.jsxs)("div",{className:"agri-row",children:[(0,p.jsxs)("label",{children:[e.fieldLabel,e.required?(0,p.jsx)("span",{style:{color:"var(--rosso-corsa)"},children:" *"}):null]}),(0,p.jsx)("input",{type:"date",value:a(n),placeholder:"yyyy-mm-dd",onChange:t=>z(e,t)})]});case"TimePicker":return(0,p.jsxs)("div",{className:"agri-row",children:[(0,p.jsxs)("label",{children:[e.fieldLabel,e.required?(0,p.jsx)("span",{style:{color:"var(--rosso-corsa)"},children:" *"}):null]}),(0,p.jsx)("input",{type:"time",value:r(n),placeholder:"hh:mm",onChange:t=>z(e,t)})]});case"MultiSelect":return(0,p.jsxs)("div",{className:"agri-row",children:[(0,p.jsxs)("label",{children:[e.fieldLabel,e.required?(0,p.jsx)("span",{style:{color:"var(--rosso-corsa)"},children:" *"}):null]}),(0,p.jsx)("select",{multiple:!0,value:Array.isArray(n)?n.length>0&&"object"===typeof n[0]?n.map(e=>String(null===e||void 0===e?void 0:e.id)):n.map(e=>String(e)):[],onChange:t=>z(e,t),style:{minHeight:"100px"},children:(e.options||[]).map(e=>(0,p.jsx)("option",{value:String(e.value),children:e.label},e.value))})]});case"Select":return(0,p.jsxs)("div",{className:"agri-row",children:[(0,p.jsxs)("label",{children:[e.fieldLabel,e.required?(0,p.jsx)("span",{style:{color:"var(--rosso-corsa)"},children:" *"}):null]}),(0,p.jsxs)("select",{value:n||"",onChange:t=>z(e,t),children:[(0,p.jsx)("option",{value:"",children:"-- Select --"}),(e.options||[]).map(e=>(0,p.jsx)("option",{value:e.value,children:e.label},e.value))]})]});case"TextArea":return(0,p.jsxs)("div",{className:"agri-row",children:[(0,p.jsx)("label",{children:e.fieldLabel}),(0,p.jsx)("textarea",{rows:e.minRows||2,value:n,onChange:t=>z(e,t)})]});default:return(0,p.jsxs)("div",{className:"agri-row",children:[(0,p.jsx)("label",{children:e.fieldLabel}),(0,p.jsx)("input",{type:"number"===e.type?"number":e.type||"text",value:n,onChange:t=>z(e,t),disabled:e.readOnly,min:e.min,max:e.max})]})}},[z]),G=(0,n.useCallback)(()=>C(e=>Math.min(e+1,R.length-1)),[R.length]),H=(0,n.useCallback)(()=>C(e=>Math.max(e-1,0)),[]),Y=(0,n.useCallback)(()=>{null===x||void 0===x||x({event:"update",data:A,target:"agriChemicalEvent"})()},[A,x]);return(0,p.jsxs)("div",{className:"agri-event-form wr-asset-edit",children:[(0,p.jsx)("div",{className:"section-title",children:N}),(0,p.jsx)(u.A,{activeStep:T,orientation:"vertical",className:"mesh-mui-stepper fd-stepper2",nonLinear:!0,children:R.map((e,t)=>{const l=t===T;return(0,p.jsxs)(s.A,{children:[(0,p.jsx)(c.A,{className:"step-label",onClick:()=>C(t),style:{cursor:"pointer"},children:e.label}),(0,p.jsx)(d.A,{className:"step-content",style:{display:l?"block":"none"},children:l&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("div",{className:"auto-row",children:(0,p.jsx)("div",{className:"auto-column w-100",children:e.fields.map((t,l)=>null!==t&&void 0!==t&&t.fields&&null!==t&&void 0!==t&&t.groupLabel?(0,p.jsxs)("div",{className:"mb-12",children:[(0,p.jsx)("div",{className:"group-label",children:t.groupLabel}),(t.fields||[]).map((t,i)=>(0,p.jsx)("div",{children:V(t,A)},`${e.key}-group-${l}-${i}`))]},`${e.key}-group-${l}`):(0,p.jsx)("div",{className:"normal-row",children:V(t,A)},`${e.key}-${l}`))})}),(0,p.jsxs)("div",{className:"stepper-buttons d-flex pt-8",children:[t>0&&(0,p.jsxs)("button",{className:"button-close mr-8 ocx-button ocx-grey",onClick:H,children:[(0,p.jsx)("i",{className:"fad fa-arrow-up"}),k("1513")]}),(0,p.jsxs)("button",{className:"button-update ocx-button ocx-blue",onClick:t===R.length-1?Y:G,children:[(0,p.jsx)("i",{className:"fad fa-arrow-down"}),t===R.length-1?k("1528"):k("1268")]})]})]})}),(0,p.jsx)(o.A,{})]},e.key)})}),(0,p.jsx)("div",{className:"save-container",children:(0,p.jsxs)("div",{className:"done-buttons",children:[(0,p.jsxs)("button",{className:"ocx-button ocx-green",onClick:Y,children:[(0,p.jsx)("i",{className:"fad fa-save mr-8"}),g&&k("1266")||k("1514")]}),(0,p.jsxs)("button",{className:"ocx-button ocx-grey outlined",onClick:()=>null===x||void 0===x?void 0:x({event:"close",target:"agriChemicalEvent"})(),children:[(0,p.jsx)("i",{className:"fad fa-times"}),k("1516")]})]})})]})}const h=n.memo(v,(e,t)=>{var l,i,n,a;const r=null!==(l=null===e||void 0===e||null===(i=e.event)||void 0===i?void 0:i.id)&&void 0!==l?l:null,s=null!==(n=null===t||void 0===t||null===(a=t.event)||void 0===a?void 0:a.id)&&void 0!==n?n:null;return e.edit===t.edit&&r===s})},50531(e,t,l){l.r(t),l.d(t,{default:()=>P});var i=l(89018),n=l(30906),a=l(52464),r=l(87152),s=l(65603),o=l(70982),d=l(35742),c=l(83941),u=l(80763),m=l(16754),p=l(20362),v=l(58344),h=l(86299),x=l(79646),f=l(10123),y=l(5241),w=l(44151),g=l(70061),b=l(20070),j=l(27565),N=l(6090),k=l(8547),A=l(73933),S=l(66001),T=l(57412),C=l(91565),$=l(77018),L=l(77184),D=l(84702),M=(l(3915),l(24344),l(27929));const P=e=>{const{assetParams:t,edit:l=!0,defaultPaddockId:P,paddocks:F,currentLocation:B,weatherStationSe
1nsorID:I,record:W,delete:E,products:O,selectedRecords:R,farmId:q,onClose:z,toggleProductModal:V,setups:G,enumItems:H,title:Y}=e||{},[X,_]=(0,j.useState)({}),[U,Z]=(0,j.useState)(0),[J,K]=(0,j.useState)(!1),[Q,ee]=(0,j.useState)(!1),[te,le]=(0,j.useState)(0),[ie,ne]=(0,j.useState)("-"),[ae,re]=(0,j.useState)(new Date),[se,oe]=(0,j.useState)(new Date),[de,ce]=(0,j.useState)(null),ue=(0,A.d4)(e=>{var t,l,i;return null!==(t=null===e||void 0===e||null===(l=e.paddocks)||void 0===l||null===(i=l.data)||void 0===i?void 0:i.items)&&void 0!==t?t:[]}),me=(0,A.d4)(e=>{var t,l,i;return(null!==(t=null===e||void 0===e||null===(l=e.assets)||void 0===l||null===(i=l.data)||void 0===i?void 0:i.items)&&void 0!==t?t:[]).filter(e=>"chemicalProduct"===e.type&&"Agricultural"===e.detail.type)}),pe=(0,A.d4)(e=>{var t,l,i;return(null!==(t=null===e||void 0===e||null===(l=e.assets)||void 0===l||null===(i=l.data)||void 0===i?void 0:i.items)&&void 0!==t?t:[]).filter(e=>"machinery"===e.type)}),ve=(0,A.d4)(e=>{var t,l,i,n;return null!==(t=null===e||void 0===e||null===(l=e.livestock)||void 0===l||null===(i=l.enumItems)||void 0===i||null===(n=i.data)||void 0===n?void 0:n.items)&&void 0!==t?t:[]}),he=(0,j.useRef)(null),xe=(0,j.useMemo)(()=>(null===F||void 0===F?void 0:F.length)>0?F:(null===ue||void 0===ue?void 0:ue.length)>0?ue:[],[F,ue]),fe=(0,j.useMemo)(()=>(null===O||void 0===O?void 0:O.length)>0?O:(null===me||void 0===me?void 0:me.length)>0?me:[],[O,me]),ye=(0,j.useMemo)(()=>(null===H||void 0===H?void 0:H.length)>0?H:(null===ve||void 0===ve?void 0:ve.length)>0?ve:[],[H,ve]),we=(0,j.useMemo)(()=>(null===G||void 0===G?void 0:G.length)>0?G:(null===pe||void 0===pe?void 0:pe.length)>0?pe:[],[G,pe]),{t:ge}=(0,k.B)(),be=(0,A.d4)(e=>{var t,l,i,n;return null!==e&&void 0!==e&&null!==(t=e.account)&&void 0!==t&&t.farmId&&null!==e&&void 0!==e&&null!==(l=e.account)&&void 0!==l&&null!==(i=l.farms)&&void 0!==i&&null!==(n=i.data)&&void 0!==n&&n.items?e.account.farms.data.items.find(t=>{var l;return t.id===(null===e||void 0===e||null===(l=e.account)||void 0===l?void 0:l.farmId)}).locale:null}),je=(0,A.wA)(),Ne=y.Br.find(e=>e.code===(null===be||void 0===be?void 0:be.area)),ke=y.B3.find(e=>e.code===(null===be||void 0===be?void 0:be.prefUnits)),Ae=y.gL.find(e=>e.code===(null===be||void 0===be?void 0:be.temperature));(0,j.useEffect)(()=>{je((0,C.Gq)())},[]);const Se=(0,j.useMemo)(()=>[ge("1242"),ge("1283"),ge("1284"),ge("1285"),ge("1527")],[ge]);(0,j.useEffect)(()=>{if(!l){Z(0);let e=0;if(P&&xe){let t=xe.find(e=>e.id===P)||(null===xe||void 0===xe?void 0:xe[0]);t&&t.area&&(e=+t.area/1e4)}_({new:{...P?{paddocks:[P],areaSize:e.toFixed(2)}:{}}})}},[l,P,xe]);(0,j.useEffect)(()=>{if(B&&2===U){(async()=>{try{var e,t,l,i;if(![(null===X||void 0===X||null===(e=X.new)||void 0===e?void 0:e.windSpeed)||"",(null===X||void 0===X||null===(t=X.new)||void 0===t?void 0:t.windDirection)||"",(null===X||void 0===X||null===(l=X.new)||void 0===l?void 0:l.temperature)||"",(null===X||void 0===X||null===(i=X.new)||void 0===i?void 0:i.humidity)||""].join("")){var n;let e=new Date(null===X||void 0===X?void 0:X.timestamp);if(!(0,p.f)(e))return;let t=new Date(null===X||void 0===X||null===(n=X.new)||void 0===n?void 0:n.startTime);if(!t)return;if(I){ee(!0);let e=null,l=await(0,C.EP)({startDate:(0,v.x)((0,h.O)(t,1),{representation:"date"})+"T00:00:00Z",endDate:(0,v.x)((0,x.L)(t,1),{representation:"date"})+"T00:00:00Z",id:I});if(l&&l.items&&l.items.length>0&&(e=((e,t)=>{let l=null,i=null,n=e.unix();return t.forEach(e=>{let t=e.tsunix/1e3,a=Math.abs(t-n);(!l||a<l)&&(l=a,i=e)}),i})(t,l.items)),e){var a,r,s,o,d,c,u,m;let t=null!==(a=e)&&void 0!==a&&null!==(r=a.content)&&void 0!==r&&r.windSpeed?Number((0,w.eY)(null===(s=e)||void 0===s||null===(o=s.content)||void 0===o?void 0:o.windSpeed).from("m/s").to(ke.converterCode).raw).toFixed(2):null,l=(0,b.F)(e.content.windBearing),i=null!==(d=e)&&void 0!==d&&null!==(c=d.content)&&void 0!==c&&c.temperature?Number((0,w.X1)(null===(u=e)||void 0===u||null===(m=u.content)||void 0===m?void 0:m.temperature).from("C").to(Ae.converterCode).raw).toFixed(2):null,n=100*e.content.humidity.toFixed(2);_({...X,new:{...X.new,windSpeed:t,windDirection:l,temperature:i,humidity:n}})}ee(!1)}else{var f,y,g,j;ee(!0);const e=await(0,C.VC)({data:B}),t="number"===typeof(null===e||void 0===e||null===(f=e.current)||void 0===f?void 0:f.wind_speed)?Number((0,w.eY)(null===e||void 0===e||null===(y=e.current)||void 0===y?void 0:y.wind_speed).from("m/s").to(ke.converterCode).raw).toFixed(2):null,l=(0,b.F)(e.current.wind_deg),i="number"===typeof(null===e||void 0===e||null===(g=e.current)||void 0===g?void 0:g.temp)?Number((0,w.X1)(null===e||void 0===e||null===(j=e.current)||void 0===j?void 0:j.temp).from("C").to(Ae.converterCode).raw).toFixed(2):null,n=e.current.humidity;ee(!1),_({...X,new:{...X.new,windSpeed:t,windDirection:l,temperature:i,humidity:n}})}}}catch(N){ee(!1),console.error(N)}})()}},[B,U,I,X,ke,Ae]),(0,j.useEffect)(()=>
1{if(W&&!he.current){if(l){if(console.log("record",W),W.new){var e,t,i,n,a,r;let l=new Date(W.timestamp),s=new Date(W.new.startTime),o=new Date(W.new.finishTime);re((0,p.f)(s)?s:W.new.startTime),oe((0,p.f)(o)?o:W.new.finishTime),ce((0,p.f)(l)?l:null);let d=[];W.new.paddocks&&W.new.paddocks.length>0&&(d=W.new.paddocks.map(e=>e.id).filter(e=>null===xe||void 0===xe?void 0:xe.find(t=>t.id===e)));const c=null!==(e=W.new)&&void 0!==e&&e.productId&&Array.isArray(fe)?fe.find(e=>e.id===W.new.productId):null;null!==c&&void 0!==c&&null!==(t=c.detail)&&void 0!==t&&t.unitOfMeasure&&ne(c.detail.unitOfMeasure);let u=null!==W&&void 0!==W&&null!==(i=W.new)&&void 0!==i&&i.windSpeed?Number((0,w.eY)(null===W||void 0===W||null===(n=W.new)||void 0===n?void 0:n.windSpeed).from("m/s").to(null===ke||void 0===ke?void 0:ke.converterCode).raw).toFixed(2):null,m=null!==W&&void 0!==W&&null!==(a=W.new)&&void 0!==a&&a.temperature?Number((0,w.X1)(null===W||void 0===W||null===(r=W.new)||void 0===r?void 0:r.temperature).from("C").to(null===Ae||void 0===Ae?void 0:Ae.converterCode).raw).toFixed(2):null,v={...W,timestamp:(0,p.f)(l)?(0,f.GP)(l,"yyyy-MM-dd"):null,new:{...W.new,startTime:(0,p.f)(s)?s:null,finishTime:(0,p.f)(o)?o:null,paddocks:d,...W.new.personName&&{applicatorName:W.new.personName},...W.new.windDirectionBefore&&{windDirection:W.new.windDirectionBefore},...W.new.humidityBefore&&{humidity:W.new.humidityBefore},windSpeed:u,temperature:m}};_(v)}}else if(E)_(null);else if(_(W),Z(1),null!==W&&void 0!==W&&W.timestamp){const e=new Date(W.timestamp);ce((0,p.f)(e)?e:null)}he.current=!0}},[W,l,E,xe,fe,ke,Ae]);const Te=e=>t=>{var l,i;switch(e){case"startTime":case"finishTime":le(0),_({...X,new:{...X.new,[e]:t}});break;case"timestamp":let n=null===t?null:new Date(t);_({...X,[e]:(0,p.f)(n)?(0,f.GP)(new Date(t),"yyyy-MM-dd"):null,new:{...X.new,startTime:ae,finishTime:se}});break;case"paddocks":{let l=0;const i=t.target.value;i.forEach(e=>{let t=(0,g.wr)(e,"id",xe,1);t&&t.area&&(l+=t.area/1e4)}),_({...X,new:{...X.new,[e]:i,areaSize:l}});break}case"productId":const a=fe&&Array.isArray(fe)?fe.find(e=>e.id===t.target.value):null;null!==a&&void 0!==a&&null!==(l=a.detail)&&void 0!==l&&l.unitOfMeasure?ne(a.detail.unitOfMeasure):ne("-"),_({...X,new:{...X.new,whp:null===a||void 0===a||null===(i=a.detail)||void 0===i?void 0:i.whp,[e]:t.target.value}});break;case"whp":const r=parseFloat(t.target.value);_({...X,new:{...X.new,[e]:r<=0?(-1*r).toString():t.target.value}});break;default:_({...X,new:{...X.new,[e]:t.target.value}})}},Ce=(0,j.useMemo)(()=>{var e,t,l,i;switch(U){case 0:const n=new Date(null===X||void 0===X?void 0:X.timestamp),a=null===X||void 0===X||null===(e=X.new)||void 0===e?void 0:e.startTime,r=null===X||void 0===X||null===(t=X.new)||void 0===t?void 0:t.finishTime;return n&&a&&r;case 1:null===X||void 0===X||null===(l=X.new)||void 0===l||l.paddocks,null===X||void 0===X||null===(i=X.new)||void 0===i||i.productId;return!0;case 2:case 3:case 4:case 5:return!0}return!1},[X,U]),$e=async()=>{let e=(()=>{var e,t,l,i,n,a,r,s,o;let d=new Date(null===X||void 0===X?void 0:X.timestamp);if(!(0,p.f)(d))return null;let c=new Date(null===X||void 0===X||null===(e=X.new)||void 0===e?void 0:e.startTime);if(!c)return null;let u=new Date(null===X||void 0===X||null===(t=X.new)||void 0===t?void 0:t.finishTime);if(!u)return null;let m=((null===X||void 0===X||null===(l=X.new)||void 0===l?void 0:l.paddocks)||[]).map(e=>({id:e})),v=null!==X&&void 0!==X&&null!==(i=X.new)&&void 0!==i&&i.productAmount?Number((0,w.r1)(null===X||void 0===X||null===(n=X.new)||void 0===n?void 0:n.productAmount).from(Ne.converterCode).to("ha").raw):null;return{...X,timestamp:d,new:{...X.new,startTime:c,finishTime:u,paddocks:m,windSpeed:null!==X&&void 0!==X&&null!==(a=X.new)&&void 0!==a&&a.windSpeed?Number((0,w.eY)(null===X||void 0===X||null===(r=X.new)||void 0===r?void 0:r.windSpeed).from(ke.converterCode||"m/s").to("m/s").raw).toFixed(2):null,temperature:null!==X&&void 0!==X&&null!==(s=X.new)&&void 0!==s&&s.temperature?Number((0,w.X1)(null===X||void 0===X||null===(o=X.new)||void 0===o?void 0:o.temperature).from(Ae.converterCode||"C").to("
1C").raw).toFixed(2):null,productAmount:v}}})();if(!e)return;let t={farmId:q,data:e};try{const e=await(0,C.Z6)(t);switch(e.status){case 200:case 201:T.oR.success(`${ge("1395")} ${t.data.id?ge("1396"):ge("1397")}`,{position:"top-center"}),z&&z("refresh",e.data,t);break;case 400:if("validation_error"===e.data.error){if(e.data.fields&&"required"===e.data.fields.name)return T.oR.error(ge("1286"),{position:"top-center"}),null}else T.oR.info(ge("1328"),{position:"top-center"});break;default:console.error(e.status)}}catch(l){}},Le=()=>{U===Se.length-1?$e():Z(U+1)},De=()=>{0===U?z&&z("cancel"):Z(U-1)};function Me(e,t,l=!1,i){var n;return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)("label",{children:e}),(0,M.jsx)(o.A,{InputProps:{inputProps:{min:0}},type:i||"text",className:"mb-0",onChange:Te(t),fullWidth:!0,value:(null===X||void 0===X?void 0:X[t])||(null===X||void 0===X||null===(n=X.new)||void 0===n?void 0:n[t])||"",size:"small",disabled:!!l})]})}const Pe=(0,j.useCallback)((e,t="id")=>{var l,i;return((null===W||void 0===W||null===(l=W.new)||void 0===l?void 0:l.paddocks)||(null===X||void 0===X||null===(i=X.new)||void 0===i?void 0:i.paddocks)||[]).findIndex(l=>l===e[t])>=0},[W,X]),Fe=(0,j.useCallback)(e=>{re(e),Te("startTime")(e)},[Te]),Be=(0,j.useCallback)(e=>{oe(e),Te("finishTime")(e)},[Te]),Ie=(0,j.useCallback)(e=>{var t,c,u,p,v,h,x,f;const y=l?(0,D.merge)({},W,X):X;switch(e){case 0:return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)("div",{className:"auto-row",children:(0,M.jsxs)("div",{className:"auto-column w-50 pr-16",children:[(0,M.jsxs)("label",{children:[ge("1291"),(0,M.jsx)("span",{style:{color:"var(--rosso-corsa)"},children:" *"})]}),(0,M.jsx)(N.A,{value:de||(null!==y&&void 0!==y&&y.timestamp?new Date(null===y||void 0===y?void 0:y.timestamp):null),className:"date-picker ",onChange:Te("timestamp"),dateFormat:"dd/MM/yyyy",format:"dd/MM/yyyy"})]})}),(0,M.jsxs)("div",{className:"auto-row custom-time-picker",children:[(0,M.jsxs)("div",{className:"auto-column w-50 pr-16 ",children:[(0,M.jsxs)("label",{children:[ge("1292")," ",(0,M.jsx)("span",{style:{color:"var(--rosso-corsa)"},children:" *"})]}),(0,M.jsx)(S.A,{onChange:Fe,value:new Date(ae)})]}),(0,M.jsxs)("div",{className:"auto-column w-50 pl-16",children:[(0,M.jsxs)("label",{children:[ge("1293"),(0,M.jsx)("span",{style:{color:"var(--rosso-corsa)"},children:" *"})]}),(0,M.jsx)(S.A,{onChange:Be,value:new Date(se)})]})]})]});case 1:return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)("div",{className:"auto-row",children:[(0,M.jsxs)("div",{className:"auto-column w-50 pr-16",children:[(0,M.jsxs)("label",{children:[ge("1303"),(0,M.jsx)("span",{style:{color:"var(--rosso-corsa)"},children:" *"})]}),(0,M.jsx)(s.A,{multiple:!0,value:(null===y||void 0===y||null===(t=y.new)||void 0===t?void 0:t.paddocks)||[1,2],onChange:Te("paddocks"),input:(0,M.jsx)(n.A,{className:"select-multiple-input"}),renderValue:e=>e.reduce((e,t)=>{console.log("currentValue",t,e);let l=xe.find(e=>e.id===t);return l?e?`${e}, ${l.name}`:`${l.name}`:e},""),children:null===xe||void 0===xe?void 0:xe.map(e=>(0,M.jsxs)(r.A,{value:e.id,children:[(0,M.jsx)(i.A,{checked:Pe(e)}),(0,M.jsx)(a.A,{primary:e.name})]},e.id))}),(0,M.jsxs)("select",{name:"pets",id:"pet-select",multiple:!0,size:"64",children:[(0,M.jsx)("option",{value:"",children:"--Please choose an option--"}),(0,M.jsx)("option",{value:"dog",children:"Dog"}),(0,M.jsx)("option",{value:"cat",children:"Cat"}),(0,M.jsx)("option",{value:"hamster",children:"Hamster"}),(0,M.jsx)("option",{value:"parrot",children:"Parrot"}),(0,M.jsx)("option",{value:"spider",children:"Spider"}),(0,M.jsx)("option",{value:"goldfish",children:"Goldfish"})]})]}),(0,M.jsxs)("div",{className:"auto-column w-50 pl-16",id:"event-details",children:[(0,M.jsxs)("label",{children:[ge("1305"),(0,M.jsx)("span",{style:{color:"var(--rosso-corsa)"},children:" *"})]}),(0,M.jsx)(m.A,{className:"select",items:fe||[],itemConfig:{value:"id",text:"name"},onChange:()=>Te("productId"),value:(null===y||void 0===y||null===(c=y.new)||void 0===c?void 0:c.productId)||""}),!l&&V&&(0,M.jsxs)("div",{className:"pt-4",children:["Click"," ",(0,M.jsx)("button",{onClick:V,style:{padding:"0px",border:"none",backgroundColor:"transparent",textDecoration:"underline"},children:"here"})," ","to add new chemical"]})]})]}),(0,M.jsxs)("div",{className:"auto-row",children:[(0,M.jsxs)("div",{className:"auto-column w-50 pr-16",i
1d:"event-details",children:[(0,M.jsx)("label",{children:ge("1278")}),(0,M.jsx)(m.A,{className:"select",items:we||[],itemConfig:{value:"id",text:"name"},onChange:()=>Te("setupId"),value:(null===y||void 0===y||null===(u=y.new)||void 0===u?void 0:u.setupId)||""})]}),(0,M.jsxs)("div",{className:"auto-column w-50 pl-16",id:"event-details",children:[(0,M.jsx)("label",{children:ge("1297")}),(0,M.jsx)(m.A,{className:"select",items:ye?ye.cropTypes:[],itemConfig:{value:"value",text:"value"},onChange:()=>Te("cropType"),value:(null===y||void 0===y||null===(p=y.new)||void 0===p?void 0:p.cropType)||""})]})]}),(0,M.jsxs)("div",{className:"auto-row",children:[(0,M.jsx)("div",{className:"auto-column w-50 pr-16",children:Me(`${ge("1279",{unit:ge(Ne.text)})} (${ie}/${ge(Ne.symbol)})`,"productAmount",!1,"number")}),(0,M.jsxs)("div",{className:"auto-column w-50 pl-16",children:[(0,M.jsx)("label",{children:`${ge("1306")} (${ge(Ne.symbol)})`}),(0,M.jsx)(o.A,{type:"text",className:"mb-0",fullWidth:!0,value:null!==y&&void 0!==y&&null!==(v=y.new)&&void 0!==v&&v.areaSize?Number((0,w.Wc)(null===y||void 0===y||null===(h=y.new)||void 0===h?void 0:h.areaSize).from("ha").to(Ne.converterCode).raw).toFixed(2):"",size:"small",disabled:!0}),(0,M.jsx)("div",{className:"subtile",children:ge("1280")})]})]}),(0,M.jsx)("div",{className:"auto-row",children:(0,M.jsx)("div",{className:"auto-column w-50 pr-16",children:Me(ge("1314"),"whp",!1,"number")})})]});case 2:return(0,M.jsxs)(d.A,{active:Q,spinner:!0,text:"Retrieving weather information",children:[(0,M.jsxs)("div",{className:"auto-row",children:[(0,M.jsx)("div",{className:"auto-column w-50 pr-16",children:Me(`${ge("1043")} (${ge(ke.symbol)})`,"windSpeed",!1,"number")}),(0,M.jsxs)("div",{className:"auto-column w-50 pl-16",children:[(0,M.jsx)("label",{children:ge("1043")}),(0,M.jsx)(m.A,{className:"select",items:$.G,itemConfig:{value:"id",text:"id"},onChange:()=>Te("windDirection"),value:(null===y||void 0===y||null===(x=y.new)||void 0===x?void 0:x.windDirection)||""})]})]}),(0,M.jsxs)("div",{className:"auto-row",children:[(0,M.jsx)("div",{className:"auto-column w-50 pr-16",children:Me(`${ge("1040")} (${ge(Ae.symbol)})`,"temperature",!1,"number")}),(0,M.jsx)("div",{className:"auto-column w-50 pl-16",children:Me(ge("1281"),"humidity",!1,"number")})]})]});case 3:return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)("div",{className:"fs-base fw-bold mb-12",children:ge("1282")}),(0,M.jsxs)("div",{className:"auto-row",children:[(0,M.jsx)("div",{className:"auto-column w-50 pr-16",children:Me(ge("1529"),"applicatorName")}),(0,M.jsx)("div",{className:"auto-column w-50 pl-16",children:Me(ge("1511"),"applicatorEmail")})]}),(0,M.jsx)("div",{className:"auto-row",children:(0,M.jsx)("div",{className:"auto-column w-50 pr-16",children:Me(ge("1526"),"applicatorPhone")})}),(0,M.jsx)("div",{className:"fs-base fw-bold pt-16 mb-12",children:ge("1301")}),(0,M.jsxs)("div",{className:"auto-row",children:[(0,M.jsx)("div",{className:"auto-column w-50 pr-16",children:Me(ge("1529"),"supervisorName")}),(0,M.jsx)("div",{className:"auto-column w-50 pl-16",children:Me(ge("1511"),"supervisorEmail")})]}),(0,M.jsx)("div",{className:"auto-row",children:(0,M.jsx)("div",{className:"auto-column w-50 pr-16",children:Me(ge("1526"),"supervisorPhone")})}),(0,M.jsx)("div",{className:"fs-base fw-bold pt-16 mb-12",children:ge("1276")}),(0,M.jsxs)("div",{className:"auto-row",children:[(0,M.jsx)("div",{className:"auto-column w-50 pr-16",children:Me(ge("1529"),"clientName")}),(0,M.jsx)("div",{className:"auto-column w-50 pl-16",children:Me(ge("1511"),"clientEmail")})]}),(0,M.jsx)("div",{className:"auto-row",children:(0,M.jsx)("div",{className:"auto-column w-50 pr-16",children:Me(ge("1526"),"clientPhone")})})]});case 4:return(0,M.jsx)(M.Fragment,{children:(0,M.jsxs)("div",{className:"frow xs-6 textarea",children:[(0,M.jsx)("label",{children:ge("1527")}),(0,M.jsx)(o.A,{type:"text",className:"mb-0",onChange:Te("other"),fullWidth:!0,multiline:!0,minRows:2,value:(null===y||void 0===y||null===(f=y.new)||void 0===f?void 0:f.other)||"",size:"small"})]})});default:return(0,M.jsx)("div",{children:ge("1300")})}},[Te,xe,fe,we,ye,ge,ie,ae,se,de]),We=(0,j.useCallback)(e=>{K(e.target.checked)},[]);let Ee=ge("1288");Y?Ee="":l?Ee=ge("1289"):E&&(Ee=ge("1290"));const Oe=()=>(0,M.jsxs)("div",{className:"d-flex justify-content-end",children:[(0,M.jsx)("button",{className:"button-close",onClick:De,children:ge(0===U?"1516":"1513")}),(0,M.jsx)("button",{onClick:Le,className:"button-update",disabled:!Ce,children:U===Se.length-1?ge("1528"):ge("1268")})]});return(0,M.jsxs)("div",{className:`agrichemical-record-edit bg-white ${l?"":"new"} `,children:[(0,M.jsx)("div",{className:"inpage-title-heading text-center",children:Ee}),E&&R&&R.length>0&&(0,M.jsxs)("div",{className:"delete",children:[(0,M.jsxs)("div",{className:"text-center",children:[(0,M.jsx)("div",{className:"icon",children:(0,M.jsx)("i",{className:"fal fa-trash-alt mr-8"})}),(0,M.jsx)("div",{className:"heading",children:`${ge("1311")} ${1===R.length?ge("1312"):ge("1313")}?`}),(0,M.jsxs)("div",{className:"text-center",children:[(0,M.jsx)(i.A,{className:"red",checked:J,onChange:We}),(0,M.jsx)("span",{children:(0,M.jsx)("strong",{children:ge("1517")})})]})]}),(0,M.jsxs)("div",{className:"buttons pt-16 d-flex-jfe",children:[(0,M.jsx)("button",{className:"button-close mr-16",onClick:()=>{z&&z("cancel")},children:ge("1516")}),(0,M.jsx)("button",{className:"button-delete",onClick:()=>{E&&R&&(0,L.tY)({id:parseInt(R[0]),farmId:q,endPoint:["agrichemical","spraying"]}).then(e=>{T.oR.success(`${ge("1393")}`)}).catch(e=>{console.error("err",e),T.oR.error(`${ge("1394")}`)}).finally(()=>{null===z||void 0===z||z("delete")})},disabled:!J,children:ge("1522")})]})]}),!l&&!E&&(0,M.jsx)(M.Fragment,{children:(0,M.jsx)("div",{className:"add-content",children:(0,M.jsxs)("div",{className:"p-16",children:[(0,M.jsx)(c.A,{steps:Se,active:U}),Ie(U),Oe()]})})}),l&&!E&&(0,M.jsx)("div",{className:"edit-content",children:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(u.A,{tabs:Se,onChange:e=>(e=>{e.id>U?Ce&&Z(e.id):Z(e.id)})(e),defaultValue:U||0,acceptOnChange:Ce}),Ie(U),Oe()]})})]})}}
1,77018(e,t,l){l.d(t,{$O:()=>a,G:()=>r,K5:()=>i,Ud:()=>s,hY:()=>n});const i=[{id:"Even fan - Standard"},{id:"Flat fan - Air assist(twin fluid)"},{id:"Flat fan - Air induction"},{id:"Flat fan - Extended range"},{id:"Flat fan - Flooding"},{id:"Flat fan - Low pressure"},{id:"Flat fan - Standard"},{id:"Flat fan - Twin"},{id:"Flat fan - Wide angle"},{id:"Hollow cone - Standard"},{id:"Hollow cone - Standard"},{id:"Hollow cone - Whirl"},{id:"Solid cone - Full"},{id:"Solid cone - Standard"},{id:"Other"}],n=[{id:"Agricultural",text:"1308"},{id:"Veterinary",text:"1309"},{id:"Pests Baits",text:"1310"}],a=e=>[{id:"mL",text:e("1483")},{id:"L",text:e("1484")},{id:"kL",text:e("1485")},{id:"mg",text:e("1486")},{id:"g",text:e("1487")},{id:"kg",text:e("1488")},{id:"m",text:e("1489")},{id:"sqm",text:e("1490")},{id:"Baits",text:e("1491")},{id:"Blisters",text:e("1492")},{id:"Collars",text:e("1483")},{id:"Doses",text:e("1494")},{id:"Packets",text:e("1495")},{id:"Patches",text:e("1496")},{id:"Rolls",text:e("1497")},{id:"Strips",text:e("1498")},{id:"Tablets",text:e("1499")},{id:"Vials",text:e("1500")},{id:"Width",text:e("1501")},{id:"gal",text:e("1502")},{id:"mi",text:e("1503")},{id:"yd",text:e("1504")},{id:"ft",text:e("1505")},{id:"floz",text:e("1506")}],r=[{id:"N"},{id:"NE"},{id:"E"},{id:"SE"},{id:"S"},{id:"SW"},{id:"W"},{id:"NW"}],s=[{id:"Vaccination"},{id:"Drenching"},{id:"Treatment"}]},52464(e,t,l){l.d(t,{A:()=>h});var i=l(27565),n=l(71099),a=l(49360),r=l(22946),s=l(94304),o=l(90429),d=l(82064),c=l(82384),u=l(98882),m=l(13572),p=l(27929);const v=(0,d.Ay)("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[{[`& .${u.A.primary}`]:t.primary},{[`& .${u.A.secondary}`]:t.secondary},t.root,l.inset&&t.inset,l.primary&&l.secondary&&t.multiline,l.dense&&t.dense]}})({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4,[`.${s.A.root}:where(& .${u.A.primary})`]:{display:"block"},[`.${s.A.root}:where(& .${u.A.secondary})`]:{display:"block"},variants:[{props:({ownerState:e})=>e.primary&&e.secondary,style:{marginTop:6,marginBottom:6}},{props:({ownerState:e})=>e.inset,style:{paddingLeft:56}}]}),h=i.forwardRef(function(e,t){const l=(0,c.b)({props:e,name:"MuiListItemText"}),{children:s,className:d,disableTypography:h=!1,inset:x=!1,primary:f,primaryTypographyProps:y,secondary:w,secondaryTypographyProps:g,slots:b={},slotProps:j={},...N}=l,{dense:k}=i.useContext(o.A);let A=null!=f?f:s,S=w;const T={...l,disableTypography:h,inset:x,primary:!!A,secondary:!!S,dense:k},C=(e=>{const{classes:t,inset:l,primary:i,secondary:n,dense:r}=e,s={root:["root",l&&"inset",r&&"dense",i&&n&&"multiline"],primary:["primary"],secondary:["secondary"]};return(0,a.A)(s,u.b,t)})(T),$={slots:b,slotProps:{primary:y,secondary:g,...j}},[L,D]=(0,m.A)("root",{className:(0,n.A)(C.root,d),elementType:v,externalForwardedProps:{...$,...N},ownerState:T,ref:t}),[M,P]=(0,m.A)("primary",{className:C.primary,elementType:r.A,externalForwardedProps:$,ownerState:T}),[F,B]=(0,m.A)("secondary",{className:C.secondary,elementType:r.A,externalForwardedProps:$,ownerState:T});return null==A||A.type===r.A||h||(A=(0,p.jsx)(M,{variant:k?"body2":"body1",component:P?.variant?void 0:"span",...P,children:A})),null==S||S.type===r.A||h||(S=(0,p.jsx)(F,{variant:"body2",color:"textSecondary",...B,children:S})),(0,p.jsxs)(L,{...D,children:[A,S]})})},22946(e,t,l){l.d(t,{A:()=>y});var i=l(27565),n=l(71099),a=l(49360),r=l(42936),s=l(82064),o=l(47568),d=l(82384),c=l(23637),u=l(46967),m=l(94304),p=l(27929);const v={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},h=(0,r.Dg)(),x=(0,s.Ay)("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.root,l.variant&&t[l.variant],"inherit"!==l.align&&t[`align${(0,c.A)(l.align)}`],l.noWrap&&t.noWrap,l.gutterBottom&&t.gutterBottom,l.paragraph&&t.paragraph]}})((0,o.A)(({theme:e})=>({margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(e.typography).filter(([e,t])=>"inherit"!==e&&t&&"object"===typeof t).map(([e,t])=>({props:{variant:e},style:t})),...Object.entries(e.palette).filter((0,u.A)()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette?.text||{}).filter(([,e])=>"string"===typeof e).map(([t])=>({props:{color:`text${(0,c.A)(t)}`},style:{color:(e.vars||e).palette.text[t]}})),{props:({ownerState:e})=>"inherit"!==e.align,style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:e})=>e.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:e})=>e.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:e})=>e.paragraph,style:{marginBottom:16}}]}
1))),f={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},y=i.forwardRef(function(e,t){const{color:l,...i}=(0,d.b)({props:e,name:"MuiTypography"}),r=h({...i,...!v[l]&&{color:l}}),{align:s="inherit",className:o,component:u,gutterBottom:y=!1,noWrap:w=!1,paragraph:g=!1,variant:b="body1",variantMapping:j=f,...N}=r,k={...r,align:s,color:l,className:o,component:u,gutterBottom:y,noWrap:w,paragraph:g,variant:b,variantMapping:j},A=u||(g?"p":j[b]||f[b])||"span",S=(e=>{const{align:t,gutterBottom:l,noWrap:i,paragraph:n,variant:r,classes:s}=e,o={root:["root",r,"inherit"!==e.align&&`align${(0,c.A)(t)}`,l&&"gutterBottom",i&&"noWrap",n&&"paragraph"]};return(0,a.A)(o,m.y,s)})(k);return(0,p.jsx)(x,{as:A,ref:t,className:(0,n.A)(S.root,o),...N,ownerState:k,style:{..."inherit"!==s&&{"--Typography-textAlign":s},...N.style}})})},94304(e,t,l){l.d(t,{A:()=>r,y:()=>a});var i=l(22458),n=l(18210);function a(e){return(0,n.Ay)("MuiTypography",e)}const r=(0,i.A)("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"])},82458(){},79646(e,t,l){l.d(t,{L:()=>a});var i=l(92915),n=l(24391);function a(e,t){return(0,i.A)(e,t*n.s0)}},86299(e,t,l){l.d(t,{O:()=>n});var i=l(79646);function n(e,t){return(0,i.L)(e,-t)}}}]); 2//# sourceMappingURL=agrichemical-event-addedit.c772fe97.chunk.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.